Commit 69e136a8 authored by cq990612's avatar cq990612

优化代码结构

parent 01dc286d
...@@ -81,7 +81,7 @@ public enum BASE_RESP_CODE_ENUM { ...@@ -81,7 +81,7 @@ public enum BASE_RESP_CODE_ENUM {
CENTERMANAGERALREADYEXISTS("661","该中心已经有中心负责人"), CENTERMANAGERALREADYEXISTS("661","该中心已经有中心负责人"),
ROLE_CANNOTBE_EMPTY("662", "设置的角色不能为空"), ROLE_CANNOTBE_EMPTY("662", "设置的角色不能为空"),
NOADMIN_ISTRATIVE_RIGHTS("663", "设置的负责人没有管理权限"), NOADMIN_ISTRATIVE_RIGHTS("663", "设置的负责人没有管理权限"),
NON_PROJECT_OPPORTUNITYNUMBERNAME_ISEMPTY("664","非项目,无商机属性")
; ;
......
...@@ -17,11 +17,13 @@ ...@@ -17,11 +17,13 @@
<result column="end_time" property="endTime"/> <result column="end_time" property="endTime"/>
<result column="create_time" property="createTime"/> <result column="create_time" property="createTime"/>
<result column="modify_time" property="modifyTime"/> <result column="modify_time" property="modifyTime"/>
<result column="business_id" property="businessId"/>
<result column="business_name" property="businessName"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, oa_project_id, project_name, type, manager_id, dept_id, work_time, cost_budget, is_conclusion,start_time,end_time, create_time, modify_time id, oa_project_id, project_name,business_id,business_name, type, manager_id, dept_id, work_time, cost_budget, is_conclusion,start_time,end_time, create_time, modify_time
</sql> </sql>
<sql id="table"> <sql id="table">
...@@ -32,6 +34,8 @@ ...@@ -32,6 +34,8 @@
<if test="id != null">and id = #{id}</if> <if test="id != null">and id = #{id}</if>
<if test="oaProjectId != null">and oa_project_id = #{oaProjectId}</if> <if test="oaProjectId != null">and oa_project_id = #{oaProjectId}</if>
<if test="projectName != null">and project_name = #{projectName}</if> <if test="projectName != null">and project_name = #{projectName}</if>
<if test="businessId !=null"> and business_id = #{businessId}</if>
<if test="businessName !=null"> and business_name = #{businessName}</if>
<if test="type != null">and `type` =#{type}</if> <if test="type != null">and `type` =#{type}</if>
<if test="managerId != null">and manager_id = #{managerId}</if> <if test="managerId != null">and manager_id = #{managerId}</if>
<if test="deptId != null">and dept_id = #{deptId}</if> <if test="deptId != null">and dept_id = #{deptId}</if>
...@@ -69,6 +73,15 @@ ...@@ -69,6 +73,15 @@
<if test="null != managerId"> <if test="null != managerId">
manager_id = #{managerId}, manager_id = #{managerId},
</if> </if>
<if test="null != deptId">
dept_id = #{deptId},
</if>
<if test="null != businessId">
business_id = #{businessId},
</if>
<if test="null != businessName">
business_name = #{businessName},
</if>
modify_time = now() modify_time = now()
</set> </set>
<where> <where>
......
...@@ -37,8 +37,9 @@ ORDER BY rank desc ...@@ -37,8 +37,9 @@ ORDER BY rank desc
select u.id,u.name,u.dept_id select u.id,u.name,u.dept_id
from work_user_role r left JOIN work_user u on r.user_id = u.id from work_user_role r left JOIN work_user u on r.user_id = u.id
<where> <where>
u.status = 1
<if test="null != roleId"> <if test="null != roleId">
r.role_id = #{roleId} AND r.role_id = #{roleId}
</if> </if>
group by r.user_id group by r.user_id
</where> </where>
......
...@@ -37,6 +37,12 @@ public class WorkProject implements Serializable { ...@@ -37,6 +37,12 @@ public class WorkProject implements Serializable {
@ApiModelProperty(name = "projectName",value = "项目名称") @ApiModelProperty(name = "projectName",value = "项目名称")
private String projectName; private String projectName;
@ApiModelProperty(name = "businessId",value = "商机编号")
private String businessId;
@ApiModelProperty(name = "businessName",value = "商机名称")
private String businessName;
@ApiModelProperty(name = "type",value = "1:项目,2:商机") @ApiModelProperty(name = "type",value = "1:项目,2:商机")
private Integer type; private Integer type;
......
...@@ -31,11 +31,17 @@ public class ManagerProjectsDto implements Serializable { ...@@ -31,11 +31,17 @@ public class ManagerProjectsDto implements Serializable {
@ApiModelProperty(name = "projectName",value = "项目名称") @ApiModelProperty(name = "projectName",value = "项目名称")
private String projectName; private String projectName;
@ApiModelProperty(name = "businessId",value = "商机编号")
private String businessId;
@ApiModelProperty(name = "businessName",value = "商机名称")
private String businessName;
@ApiModelProperty(name = "type",value = "1:项目,2:商机") @ApiModelProperty(name = "type",value = "1:项目,2:商机")
private Integer type; private Integer type;
@ApiModelProperty(name = "managerId",value = "项目负责人id") @ApiModelProperty(name = "managerId",value = "项目负责人id")
private Integer managerId; private String managerId;
@ApiModelProperty(name = "managerName", value = "项目负责人名字") @ApiModelProperty(name = "managerName", value = "项目负责人名字")
private String managerName; private String managerName;
......
...@@ -9,7 +9,8 @@ public enum ChangeTypeEnum { ...@@ -9,7 +9,8 @@ public enum ChangeTypeEnum {
WORKINGHOURSBUDGET(2, "工时预算(人/天)"), WORKINGHOURSBUDGET(2, "工时预算(人/天)"),
STARTINGTIME(3, "预计开始时间"), STARTINGTIME(3, "预计开始时间"),
ENDTIME(4, "预计结束时间"), ENDTIME(4, "预计结束时间"),
MANAGER(5,"项目/商机负责人") MANAGER(5,"项目/商机负责人"),
DEPARTMENT(6,"项目/商机所属部门")
; ;
......
package cn.wisenergy.model.enums;
public enum WorkOrderType {
PROJECT(1, "项目"),
BUSINESS(2, "商机"),
LEAVE(3, "请假"),
CONMPENSATORY_LEAVE(4, "调休"),
EXTERNAL_WORK(5, "外部商务、技术交流"),
INTERNAL_WORK(6, "内部培训、技术准备、管理"),
OTHER_NOT_PROJECT_BUSINESS(7, "其他非项目、商机工作");
private Integer code;
private String desc;
WorkOrderType(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
...@@ -47,4 +47,10 @@ public class CreateProjectVo { ...@@ -47,4 +47,10 @@ public class CreateProjectVo {
@ApiModelProperty(name = "deptId",value = "部门id") @ApiModelProperty(name = "deptId",value = "部门id")
private Integer deptId; private Integer deptId;
@ApiModelProperty(name = "businessId",value = "商机编号")
private String businessId;
@ApiModelProperty(name = "businessName",value = "商机名称")
private String businessName;
} }
...@@ -26,6 +26,10 @@ public class ModifyProjectVo { ...@@ -26,6 +26,10 @@ public class ModifyProjectVo {
private List<Integer> userIds; private List<Integer> userIds;
private Integer deptId;
private String deptIdReason;
@JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd") @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd")
private Date startTime; private Date startTime;
...@@ -43,4 +47,8 @@ public class ModifyProjectVo { ...@@ -43,4 +47,8 @@ public class ModifyProjectVo {
private BigDecimal costBudget; private BigDecimal costBudget;
private String costBudgetReason; private String costBudgetReason;
private String businessId;
private String businessName;
} }
...@@ -172,10 +172,12 @@ public class UserRoleLevelUtils { ...@@ -172,10 +172,12 @@ public class UserRoleLevelUtils {
} }
List<Integer> getlevelIds = getlevelIds(roles); List<Integer> getlevelIds = getlevelIds(roles);
Set<Integer> hashSet = new HashSet<>(); Set<Integer> hashSet = new HashSet<>();
for (Integer id : getlevelIds) { if (!CollectionUtils.isEmpty(getlevelIds)) {
if (!hashSet.add(id)){ for (Integer id : getlevelIds) {
//有重复值 if (!hashSet.add(id)){
return true; //有重复值
return true;
}
} }
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment