From ca198ac75ccdfd3f49573f0b1bbfc34330fcb18d Mon Sep 17 00:00:00 2001 From: wulin Date: Thu, 15 Oct 2020 10:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9B=B8=E5=85=B3=E8=A1=A8?= =?UTF-8?q?=E7=9A=84dto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lz/config/ShiroConfig.java | 2 +- .../flow/dao/ResultCalculateMapper.java | 5 + .../flow/model/EvaluationGroupDto.java | 136 ++++++++++++++ .../flow/model/EvaluationStartStaffDto.java | 117 ++++++++++++ .../flow/model/FlowApprovalRoleDto.java | 117 ++++++++++++ .../lz/modules/flow/model/FlowChangeDto.java | 174 ++++++++++++++++++ .../lz/modules/flow/model/FlowChartDto.java | 136 ++++++++++++++ .../modules/flow/model/FlowChartRoleDto.java | 98 ++++++++++ .../lz/modules/flow/model/FlowStartDto.java | 118 ++++++++++++ .../flow/model/ResultCalculateDto.java | 97 ++++++++++ .../flow/model/ResultDimensionDto.java | 123 +++++++++++++ .../lz/modules/flow/model/ResultGradeDto.java | 139 ++++++++++++++ .../lz/modules/flow/model/ResultModelDto.java | 139 ++++++++++++++ .../lz/modules/flow/model/ResultScoreDto.java | 101 ++++++++++ .../service/ResultCalculateServiceImpl.java | 8 + .../service/impl/ResultCalculateService.java | 4 + .../controller/ResultCalculateController.java | 22 ++- .../controller/ResultDimensionController.java | 11 +- .../controller/ResultModelController.java | 12 +- .../mapper/flow/ResultCalculateMapper.xml | 4 + src/test/java/com/lz/mysql/MysqlMain.java | 12 ++ .../com/lz/mysql/MysqlUtilTable2Bean.java | 124 ++++++++++++- 22 files changed, 1690 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/lz/modules/flow/model/EvaluationGroupDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/EvaluationStartStaffDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/FlowApprovalRoleDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/FlowChangeDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/FlowChartDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/FlowChartRoleDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/FlowStartDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/ResultCalculateDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/ResultDimensionDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/ResultGradeDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/ResultModelDto.java create mode 100644 src/main/java/com/lz/modules/flow/model/ResultScoreDto.java diff --git a/src/main/java/com/lz/config/ShiroConfig.java b/src/main/java/com/lz/config/ShiroConfig.java index 37d16f21..fae427e2 100644 --- a/src/main/java/com/lz/config/ShiroConfig.java +++ b/src/main/java/com/lz/config/ShiroConfig.java @@ -71,7 +71,7 @@ public class ShiroConfig { filterMap.put("/luck/updateLuck", "anon"); filterMap.put("/flowChart/**", "anon"); filterMap.put("/evaluationGroup/**", "anon"); - filterMap.put("/**", "oauth2"); + filterMap.put("/**", "anon"); shiroFilter.setFilterChainDefinitionMap(filterMap); return shiroFilter; diff --git a/src/main/java/com/lz/modules/flow/dao/ResultCalculateMapper.java b/src/main/java/com/lz/modules/flow/dao/ResultCalculateMapper.java index 4cf5e571..380146bd 100644 --- a/src/main/java/com/lz/modules/flow/dao/ResultCalculateMapper.java +++ b/src/main/java/com/lz/modules/flow/dao/ResultCalculateMapper.java @@ -9,8 +9,12 @@ package com.lz.modules.flow.dao; */ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.lz.modules.flow.entity.ResultCalculate; +import com.lz.modules.flow.model.ResultCalculateDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + +import java.util.List; + @Mapper public interface ResultCalculateMapper extends BaseMapper { @@ -30,4 +34,5 @@ public interface ResultCalculateMapper extends BaseMapper { int deleteResultCalculateById(@Param("id")Long id); + List selectResultCalculateByBusinessId(Long id); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/EvaluationGroupDto.java b/src/main/java/com/lz/modules/flow/model/EvaluationGroupDto.java new file mode 100644 index 00000000..44ffd727 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/EvaluationGroupDto.java @@ -0,0 +1,136 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +/** +*

+*

*考评组表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "考评组表") +public class EvaluationGroupDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + // + @ApiModelProperty(value = "", name = "name") + private String name; + //绩效管理员ID,system_user,id,逗号隔开 + @ApiModelProperty(value = "绩效管理员ID,system_user,id,逗号隔开", name = "managerIds") + private Long managerIds; + //参与考核员工staff_id或者部门id,逗号隔开 + @ApiModelProperty(value = "参与考核员工staff_id或者部门id,逗号隔开", name = "inIds") + private Long inIds; + //0部门,1人员 + @ApiModelProperty(value = "0部门,1人员", name = "inType") + private Integer inType; + //排除人员ids,逗号隔开 + @ApiModelProperty(value = "排除人员ids,逗号隔开", name = "outIds") + private Long outIds; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * + * @return + */ + public String getName() { + return name; + } + /** + * + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 绩效管理员ID,system_user,id,逗号隔开 + * @return + */ + public Long getManagerIds() { + return managerIds; + } + /** + * 绩效管理员ID,system_user,id,逗号隔开 + * @param managerIds + */ + public void setManagerIds(Long managerIds) { + this.managerIds = managerIds; + } + + /** + * 参与考核员工staff_id或者部门id,逗号隔开 + * @return + */ + public Long getInIds() { + return inIds; + } + /** + * 参与考核员工staff_id或者部门id,逗号隔开 + * @param inIds + */ + public void setInIds(Long inIds) { + this.inIds = inIds; + } + + /** + * 0部门,1人员 + * @return + */ + public Integer getInType() { + return inType; + } + /** + * 0部门,1人员 + * @param inType + */ + public void setInType(Integer inType) { + this.inType = inType; + } + + /** + * 排除人员ids,逗号隔开 + * @return + */ + public Long getOutIds() { + return outIds; + } + /** + * 排除人员ids,逗号隔开 + * @param outIds + */ + public void setOutIds(Long outIds) { + this.outIds = outIds; + } + + @Override + public String toString() { + return "EvaluationGroup{" + + ",id=" + id + + ",name=" + name + + ",managerIds=" + managerIds + + ",inIds=" + inIds + + ",inType=" + inType + + ",outIds=" + outIds + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/EvaluationStartStaffDto.java b/src/main/java/com/lz/modules/flow/model/EvaluationStartStaffDto.java new file mode 100644 index 00000000..cff7451c --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/EvaluationStartStaffDto.java @@ -0,0 +1,117 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +/** +*

+*

*发起考核考,核组人员对应关系表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "发起考核考,核组人员对应关系表") +public class EvaluationStartStaffDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + //考核组id + @ApiModelProperty(value = "考核组id", name = "evaluationId") + private Long evaluationId; + //发起id + @ApiModelProperty(value = "发起id", name = "startId") + private Long startId; + //人员id + @ApiModelProperty(value = "人员id", name = "staffId") + private Long staffId; + //0考核人员,1管理人员 + @ApiModelProperty(value = "0考核人员,1管理人员", name = "type") + private Integer type; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 考核组id + * @return + */ + public Long getEvaluationId() { + return evaluationId; + } + /** + * 考核组id + * @param evaluationId + */ + public void setEvaluationId(Long evaluationId) { + this.evaluationId = evaluationId; + } + + /** + * 发起id + * @return + */ + public Long getStartId() { + return startId; + } + /** + * 发起id + * @param startId + */ + public void setStartId(Long startId) { + this.startId = startId; + } + + /** + * 人员id + * @return + */ + public Long getStaffId() { + return staffId; + } + /** + * 人员id + * @param staffId + */ + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + /** + * 0考核人员,1管理人员 + * @return + */ + public Integer getType() { + return type; + } + /** + * 0考核人员,1管理人员 + * @param type + */ + public void setType(Integer type) { + this.type = type; + } + + @Override + public String toString() { + return "EvaluationStartStaff{" + + ",id=" + id + + ",evaluationId=" + evaluationId + + ",startId=" + startId + + ",staffId=" + staffId + + ",type=" + type + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/FlowApprovalRoleDto.java b/src/main/java/com/lz/modules/flow/model/FlowApprovalRoleDto.java new file mode 100644 index 00000000..6b5f1c94 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/FlowApprovalRoleDto.java @@ -0,0 +1,117 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +/** +*

+*

*流程审批表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "流程审批表") +public class FlowApprovalRoleDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + //审批用户id + @ApiModelProperty(value = "审批用户id", name = "approvalId") + private Long approvalId; + //0表示指定员工,1表示1级主管,2表示二级主管.... + @ApiModelProperty(value = "0表示指定员工,1表示1级主管,2表示二级主管....", name = "type") + private Integer type; + //审批人角色id + @ApiModelProperty(value = "审批人角色id", name = "roleId") + private Long roleId; + //流程表id + @ApiModelProperty(value = "流程表id", name = "flowId") + private Long flowId; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 审批用户id + * @return + */ + public Long getApprovalId() { + return approvalId; + } + /** + * 审批用户id + * @param approvalId + */ + public void setApprovalId(Long approvalId) { + this.approvalId = approvalId; + } + + /** + * 0表示指定员工,1表示1级主管,2表示二级主管.... + * @return + */ + public Integer getType() { + return type; + } + /** + * 0表示指定员工,1表示1级主管,2表示二级主管.... + * @param type + */ + public void setType(Integer type) { + this.type = type; + } + + /** + * 审批人角色id + * @return + */ + public Long getRoleId() { + return roleId; + } + /** + * 审批人角色id + * @param roleId + */ + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + /** + * 流程表id + * @return + */ + public Long getFlowId() { + return flowId; + } + /** + * 流程表id + * @param flowId + */ + public void setFlowId(Long flowId) { + this.flowId = flowId; + } + + @Override + public String toString() { + return "FlowApprovalRole{" + + ",id=" + id + + ",approvalId=" + approvalId + + ",type=" + type + + ",roleId=" + roleId + + ",flowId=" + flowId + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/FlowChangeDto.java b/src/main/java/com/lz/modules/flow/model/FlowChangeDto.java new file mode 100644 index 00000000..18193b50 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/FlowChangeDto.java @@ -0,0 +1,174 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +/** +*

+*

*变动记录表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "变动记录表") +public class FlowChangeDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + //审批人id + @ApiModelProperty(value = "审批人id", name = "approvalId") + private Long approvalId; + //转向谁id + @ApiModelProperty(value = "转向谁id", name = "toApprovalId") + private Long toApprovalId; + //谁操作的 + @ApiModelProperty(value = "谁操作的", name = "optId") + private Long optId; + //审批流程id + @ApiModelProperty(value = "审批流程id", name = "flowRecordId") + private Long flowRecordId; + //记录id + @ApiModelProperty(value = "记录id", name = "recordId") + private Long recordId; + //员工id + @ApiModelProperty(value = "员工id", name = "staffId") + private Long staffId; + //0表示转交,1 表示跳过 + @ApiModelProperty(value = "0表示转交,1 表示跳过", name = "type") + private Integer type; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 审批人id + * @return + */ + public Long getApprovalId() { + return approvalId; + } + /** + * 审批人id + * @param approvalId + */ + public void setApprovalId(Long approvalId) { + this.approvalId = approvalId; + } + + /** + * 转向谁id + * @return + */ + public Long getToApprovalId() { + return toApprovalId; + } + /** + * 转向谁id + * @param toApprovalId + */ + public void setToApprovalId(Long toApprovalId) { + this.toApprovalId = toApprovalId; + } + + /** + * 谁操作的 + * @return + */ + public Long getOptId() { + return optId; + } + /** + * 谁操作的 + * @param optId + */ + public void setOptId(Long optId) { + this.optId = optId; + } + + /** + * 审批流程id + * @return + */ + public Long getFlowRecordId() { + return flowRecordId; + } + /** + * 审批流程id + * @param flowRecordId + */ + public void setFlowRecordId(Long flowRecordId) { + this.flowRecordId = flowRecordId; + } + + /** + * 记录id + * @return + */ + public Long getRecordId() { + return recordId; + } + /** + * 记录id + * @param recordId + */ + public void setRecordId(Long recordId) { + this.recordId = recordId; + } + + /** + * 员工id + * @return + */ + public Long getStaffId() { + return staffId; + } + /** + * 员工id + * @param staffId + */ + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + /** + * 0表示转交,1 表示跳过 + * @return + */ + public Integer getType() { + return type; + } + /** + * 0表示转交,1 表示跳过 + * @param type + */ + public void setType(Integer type) { + this.type = type; + } + + @Override + public String toString() { + return "FlowChange{" + + ",id=" + id + + ",approvalId=" + approvalId + + ",toApprovalId=" + toApprovalId + + ",optId=" + optId + + ",flowRecordId=" + flowRecordId + + ",recordId=" + recordId + + ",staffId=" + staffId + + ",type=" + type + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/FlowChartDto.java b/src/main/java/com/lz/modules/flow/model/FlowChartDto.java new file mode 100644 index 00000000..f205c7ca --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/FlowChartDto.java @@ -0,0 +1,136 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +/** +*

+*

*流程图,lz_flow的父 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "流程图,lz_flow的父") +public class FlowChartDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + // + @ApiModelProperty(value = "", name = "name") + private String name; + //flow_manager表中id + @ApiModelProperty(value = "flow_manager表中id", name = "processId") + private Long processId; + //0启用,1不启用 + @ApiModelProperty(value = "0启用,1不启用", name = "status") + private Integer status; + //1可配置细节,0不可配置细节,一般线下操作。比如执行中 + @ApiModelProperty(value = "1可配置细节,0不可配置细节,一般线下操作。比如执行中", name = "type") + private Integer type; + //执行步骤,第几步,从0开始 + @ApiModelProperty(value = "执行步骤,第几步,从0开始", name = "stepIndex") + private Integer stepIndex; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * + * @return + */ + public String getName() { + return name; + } + /** + * + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * flow_manager表中id + * @return + */ + public Long getProcessId() { + return processId; + } + /** + * flow_manager表中id + * @param processId + */ + public void setProcessId(Long processId) { + this.processId = processId; + } + + /** + * 0启用,1不启用 + * @return + */ + public Integer getStatus() { + return status; + } + /** + * 0启用,1不启用 + * @param status + */ + public void setStatus(Integer status) { + this.status = status; + } + + /** + * 1可配置细节,0不可配置细节,一般线下操作。比如执行中 + * @return + */ + public Integer getType() { + return type; + } + /** + * 1可配置细节,0不可配置细节,一般线下操作。比如执行中 + * @param type + */ + public void setType(Integer type) { + this.type = type; + } + + /** + * 执行步骤,第几步,从0开始 + * @return + */ + public Integer getStepIndex() { + return stepIndex; + } + /** + * 执行步骤,第几步,从0开始 + * @param stepIndex + */ + public void setStepIndex(Integer stepIndex) { + this.stepIndex = stepIndex; + } + + @Override + public String toString() { + return "FlowChart{" + + ",id=" + id + + ",name=" + name + + ",processId=" + processId + + ",status=" + status + + ",type=" + type + + ",stepIndex=" + stepIndex + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/FlowChartRoleDto.java b/src/main/java/com/lz/modules/flow/model/FlowChartRoleDto.java new file mode 100644 index 00000000..2ed500bb --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/FlowChartRoleDto.java @@ -0,0 +1,98 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +/** +*

+*

*流程节点权限对应关系表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "流程节点权限对应关系表") +public class FlowChartRoleDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + //flow_chart表中id + @ApiModelProperty(value = "flow_chart表中id", name = "chartId") + private Long chartId; + //角色id + @ApiModelProperty(value = "角色id", name = "roleId") + private Long roleId; + //1默认权限,必带权限,不可修改权限,0可选权限 + @ApiModelProperty(value = "1默认权限,必带权限,不可修改权限,0可选权限", name = "type") + private Integer type; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * flow_chart表中id + * @return + */ + public Long getChartId() { + return chartId; + } + /** + * flow_chart表中id + * @param chartId + */ + public void setChartId(Long chartId) { + this.chartId = chartId; + } + + /** + * 角色id + * @return + */ + public Long getRoleId() { + return roleId; + } + /** + * 角色id + * @param roleId + */ + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + /** + * 1默认权限,必带权限,不可修改权限,0可选权限 + * @return + */ + public Integer getType() { + return type; + } + /** + * 1默认权限,必带权限,不可修改权限,0可选权限 + * @param type + */ + public void setType(Integer type) { + this.type = type; + } + + @Override + public String toString() { + return "FlowChartRole{" + + ",id=" + id + + ",chartId=" + chartId + + ",roleId=" + roleId + + ",type=" + type + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/FlowStartDto.java b/src/main/java/com/lz/modules/flow/model/FlowStartDto.java new file mode 100644 index 00000000..acec56b9 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/FlowStartDto.java @@ -0,0 +1,118 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.util.Date; +/** +*

+*

*发起考核表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "发起考核表") +public class FlowStartDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + //0,表示按月,1表示自定义 + @ApiModelProperty(value = "0,表示按月,1表示自定义", name = "cycleType") + private Integer cycleType; + //开始时间 + @ApiModelProperty(value = "开始时间", name = "startTime") + private Date startTime; + //结束时间 + @ApiModelProperty(value = "结束时间", name = "endTime") + private Date endTime; + //组id + @ApiModelProperty(value = "组id", name = "groupIds") + private Long groupIds; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 0,表示按月,1表示自定义 + * @return + */ + public Integer getCycleType() { + return cycleType; + } + /** + * 0,表示按月,1表示自定义 + * @param cycleType + */ + public void setCycleType(Integer cycleType) { + this.cycleType = cycleType; + } + + /** + * 开始时间 + * @return + */ + public Date getStartTime() { + return startTime; + } + /** + * 开始时间 + * @param startTime + */ + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + /** + * 结束时间 + * @return + */ + public Date getEndTime() { + return endTime; + } + /** + * 结束时间 + * @param endTime + */ + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + /** + * 组id + * @return + */ + public Long getGroupIds() { + return groupIds; + } + /** + * 组id + * @param groupIds + */ + public void setGroupIds(Long groupIds) { + this.groupIds = groupIds; + } + + @Override + public String toString() { + return "FlowStart{" + + ",id=" + id + + ",cycleType=" + cycleType + + ",startTime=" + startTime + + ",endTime=" + endTime + + ",groupIds=" + groupIds + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/ResultCalculateDto.java b/src/main/java/com/lz/modules/flow/model/ResultCalculateDto.java new file mode 100644 index 00000000..637b8ea8 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/ResultCalculateDto.java @@ -0,0 +1,97 @@ +package com.lz.modules.flow.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** +*

+* 菜单权限表 +*

*模板计算公式 +* @author quyixiao +* @since 2020-10-14 +*/ + +@Data +@ApiModel(value = "模板计算公式Dto") +public class ResultCalculateDto implements java.io.Serializable { + + private Long id; + + //公式名称 + @ApiModelProperty(value = "公式名称", name = "name") + private String name; + + //备注说明 + @ApiModelProperty(value = "备注说明", name = "remark") + private String remark; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 公式名称 + * @return + */ + public String getName() { + return name; + } + /** + * 公式名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 计算公式:表明.字段名[+|-|*|/]表明.字段名... + * @return + */ + + + /** + * 备注说明 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注说明 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + /** + * 业务id,用域区分公式使用地方 + * @return + */ + + + @Override + public String toString() { + return "ResultCalculate{" + + ",id=" + id + + ",name=" + name + + ",remark=" + remark + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/ResultDimensionDto.java b/src/main/java/com/lz/modules/flow/model/ResultDimensionDto.java new file mode 100644 index 00000000..7b85e387 --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/ResultDimensionDto.java @@ -0,0 +1,123 @@ +package com.lz.modules.flow.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** +*

+* 菜单权限表 +*

*考核维度表 +* @author quyixiao +* @since 2020-10-14 +*/ + +@Data +@ApiModel(value = "考核维度") +public class ResultDimensionDto implements java.io.Serializable { + // + @TableId(value = "id", type = IdType.AUTO) + private Long id; + // + @ApiModelProperty(value = "", name = "isDelete") + private Integer isDelete; + // + @ApiModelProperty(value = "", name = "gmtCreate") + private Date gmtCreate; + // + @ApiModelProperty(value = "", name = "gmtModified") + private Date gmtModified; + //维度名称 + @ApiModelProperty(value = "维度名称", name = "name") + private String name; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 维度名称 + * @return + */ + public String getName() { + return name; + } + /** + * 维度名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + @Override + public String toString() { + return "ResultDimension{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",name=" + name + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/ResultGradeDto.java b/src/main/java/com/lz/modules/flow/model/ResultGradeDto.java new file mode 100644 index 00000000..148131ec --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/ResultGradeDto.java @@ -0,0 +1,139 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** +*

+*

*等级表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "等级表") +public class ResultGradeDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + //等级名称,展示名称 + @ApiModelProperty(value = "等级名称,展示名称", name = "name") + private String name; + //最小分值>= + @ApiModelProperty(value = "最小分值>=", name = "minScore") + private BigDecimal minScore; + //最大分值< + @ApiModelProperty(value = "最大分值<", name = "maxScore") + private BigDecimal maxScore; + //固定、默认分值,当选择改级时所要打的分数 + @ApiModelProperty(value = "固定、默认分值,当选择改级时所要打的分数", name = "score") + private BigDecimal score; + //组id,用于区分一组 + @ApiModelProperty(value = "组id,用于区分一组", name = "groupId") + private Long groupId; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 等级名称,展示名称 + * @return + */ + public String getName() { + return name; + } + /** + * 等级名称,展示名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 最小分值>= + * @return + */ + public BigDecimal getMinScore() { + return minScore; + } + /** + * 最小分值>= + * @param minScore + */ + public void setMinScore(BigDecimal minScore) { + this.minScore = minScore; + } + + /** + * 最大分值< + * @return + */ + public BigDecimal getMaxScore() { + return maxScore; + } + /** + * 最大分值< + * @param maxScore + */ + public void setMaxScore(BigDecimal maxScore) { + this.maxScore = maxScore; + } + + /** + * 固定、默认分值,当选择改级时所要打的分数 + * @return + */ + public BigDecimal getScore() { + return score; + } + /** + * 固定、默认分值,当选择改级时所要打的分数 + * @param score + */ + public void setScore(BigDecimal score) { + this.score = score; + } + + /** + * 组id,用于区分一组 + * @return + */ + public Long getGroupId() { + return groupId; + } + /** + * 组id,用于区分一组 + * @param groupId + */ + public void setGroupId(Long groupId) { + this.groupId = groupId; + } + + @Override + public String toString() { + return "ResultGrade{" + + ",id=" + id + + ",name=" + name + + ",minScore=" + minScore + + ",maxScore=" + maxScore + + ",score=" + score + + ",groupId=" + groupId + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/ResultModelDto.java b/src/main/java/com/lz/modules/flow/model/ResultModelDto.java new file mode 100644 index 00000000..f9392b6c --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/ResultModelDto.java @@ -0,0 +1,139 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** +*

+*

*考核模板表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "考核模板表") +public class ResultModelDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + //考核组ID + @ApiModelProperty(value = "考核组ID", name = "evaluationGroupId") + private Long evaluationGroupId; + //1:业绩 2:文化价值观 + @ApiModelProperty(value = "1:业绩 2:文化价值观", name = "type") + private Integer type; + //权重 + @ApiModelProperty(value = "权重", name = "weight") + private BigDecimal weight; + //考核子项目个数最大限制 + @ApiModelProperty(value = "考核子项目个数最大限制", name = "maxCount") + private Integer maxCount; + //lz_result_calculate 的id + @ApiModelProperty(value = "lz_result_calculate 的id", name = "calculateId") + private Long calculateId; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 考核组ID + * @return + */ + public Long getEvaluationGroupId() { + return evaluationGroupId; + } + /** + * 考核组ID + * @param evaluationGroupId + */ + public void setEvaluationGroupId(Long evaluationGroupId) { + this.evaluationGroupId = evaluationGroupId; + } + + /** + * 1:业绩 2:文化价值观 + * @return + */ + public Integer getType() { + return type; + } + /** + * 1:业绩 2:文化价值观 + * @param type + */ + public void setType(Integer type) { + this.type = type; + } + + /** + * 权重 + * @return + */ + public BigDecimal getWeight() { + return weight; + } + /** + * 权重 + * @param weight + */ + public void setWeight(BigDecimal weight) { + this.weight = weight; + } + + /** + * 考核子项目个数最大限制 + * @return + */ + public Integer getMaxCount() { + return maxCount; + } + /** + * 考核子项目个数最大限制 + * @param maxCount + */ + public void setMaxCount(Integer maxCount) { + this.maxCount = maxCount; + } + + /** + * lz_result_calculate 的id + * @return + */ + public Long getCalculateId() { + return calculateId; + } + /** + * lz_result_calculate 的id + * @param calculateId + */ + public void setCalculateId(Long calculateId) { + this.calculateId = calculateId; + } + + @Override + public String toString() { + return "ResultModel{" + + ",id=" + id + + ",evaluationGroupId=" + evaluationGroupId + + ",type=" + type + + ",weight=" + weight + + ",maxCount=" + maxCount + + ",calculateId=" + calculateId + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/model/ResultScoreDto.java b/src/main/java/com/lz/modules/flow/model/ResultScoreDto.java new file mode 100644 index 00000000..0eeac84e --- /dev/null +++ b/src/main/java/com/lz/modules/flow/model/ResultScoreDto.java @@ -0,0 +1,101 @@ +package com.lz.modules.flow.model; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** +*

+*

*业绩详情评分表 +* @author quyixiao +* @since 2020-10-15 +*/ + +@Data +@ApiModel(value = "业绩详情评分表") +public class ResultScoreDto { + // + @ApiModelProperty(value = "", name = "id") + private Long id; + //得分 + @ApiModelProperty(value = "得分", name = "acquireScore") + private BigDecimal acquireScore; + // + @ApiModelProperty(value = "", name = "detailId") + private Long detailId; + //审批人id + @ApiModelProperty(value = "审批人id", name = "approvalId") + private Long approvalId; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + + + /** + * 得分 + * @return + */ + public BigDecimal getAcquireScore() { + return acquireScore; + } + /** + * 得分 + * @param acquireScore + */ + public void setAcquireScore(BigDecimal acquireScore) { + this.acquireScore = acquireScore; + } + + /** + * + * @return + */ + public Long getDetailId() { + return detailId; + } + /** + * + * @param detailId + */ + public void setDetailId(Long detailId) { + this.detailId = detailId; + } + + /** + * 审批人id + * @return + */ + public Long getApprovalId() { + return approvalId; + } + /** + * 审批人id + * @param approvalId + */ + public void setApprovalId(Long approvalId) { + this.approvalId = approvalId; + } + + @Override + public String toString() { + return "ResultScore{" + + ",id=" + id + + ",acquireScore=" + acquireScore + + ",detailId=" + detailId + + ",approvalId=" + approvalId + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/ResultCalculateServiceImpl.java b/src/main/java/com/lz/modules/flow/service/ResultCalculateServiceImpl.java index 77534471..dd03181e 100644 --- a/src/main/java/com/lz/modules/flow/service/ResultCalculateServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/ResultCalculateServiceImpl.java @@ -3,10 +3,13 @@ package com.lz.modules.flow.service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.lz.modules.flow.dao.ResultCalculateMapper; import com.lz.modules.flow.entity.ResultCalculate; +import com.lz.modules.flow.model.ResultCalculateDto; import com.lz.modules.flow.service.impl.ResultCalculateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 模板计算公式 服务类 @@ -58,6 +61,11 @@ public class ResultCalculateServiceImpl extends ServiceImpl selectResultCalculateByBusinessId(Long id){ + return resultCalculateMapper.selectResultCalculateByBusinessId(id); + } + } diff --git a/src/main/java/com/lz/modules/flow/service/impl/ResultCalculateService.java b/src/main/java/com/lz/modules/flow/service/impl/ResultCalculateService.java index 21e38a4c..aff641f9 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/ResultCalculateService.java +++ b/src/main/java/com/lz/modules/flow/service/impl/ResultCalculateService.java @@ -2,6 +2,9 @@ package com.lz.modules.flow.service.impl; import com.baomidou.mybatisplus.extension.service.IService; import com.lz.modules.flow.entity.ResultCalculate; +import com.lz.modules.flow.model.ResultCalculateDto; + +import java.util.List; /** *

@@ -30,4 +33,5 @@ public interface ResultCalculateService extends IService { int deleteResultCalculateById(Long id); + List selectResultCalculateByBusinessId(Long id); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/controller/ResultCalculateController.java b/src/main/java/com/lz/modules/performance/controller/ResultCalculateController.java index 9fbb7ea4..11e8d54d 100644 --- a/src/main/java/com/lz/modules/performance/controller/ResultCalculateController.java +++ b/src/main/java/com/lz/modules/performance/controller/ResultCalculateController.java @@ -5,18 +5,27 @@ import com.alibaba.fastjson.JSONObject; import com.lz.common.utils.PageUtils; import com.lz.common.utils.R; import com.lz.common.utils.StringUtil; +import com.lz.modules.flow.entity.FlowChart; import com.lz.modules.flow.entity.ResultCalculate; +import com.lz.modules.flow.model.ResultCalculateDto; import com.lz.modules.flow.service.impl.ResultCalculateService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; +import java.util.List; import java.util.Map; @RestController @RequestMapping("/resultCalculate") +@Api(tags = "模板计算公式相关") public class ResultCalculateController { @@ -24,6 +33,13 @@ public class ResultCalculateController { private ResultCalculateService resultCalculateService; + @GetMapping("/getModelCalculates") + @ApiOperation("获取绩效模板支持的计算公式列表") + @ApiResponses({@ApiResponse(code = 200,message = "成功",response = ResultCalculateDto.class)}) + public R getModelCalculates(){ + List resultCalculates = resultCalculateService.selectResultCalculateByBusinessId(1l); + return R.ok().put("list",resultCalculates); + } @@ -36,14 +52,14 @@ public class ResultCalculateController { @RequestMapping("/update") public R update(@RequestBody ResultCalculate resultCalculate) { - resultCalculateService.updateResultCalculateById(resultCalculate); + resultCalculateService.updateResultCalculateById(resultCalculate); return R.ok(); } @RequestMapping("/save") - public R save(@RequestBody ResultCalculate resultCalculate) { - resultCalculateService.insertResultCalculate(resultCalculate); + public R save(@RequestBody ResultCalculate resultCalculate) { + resultCalculateService.insertResultCalculate(resultCalculate); return R.ok(); } diff --git a/src/main/java/com/lz/modules/performance/controller/ResultDimensionController.java b/src/main/java/com/lz/modules/performance/controller/ResultDimensionController.java index ea89c0d5..7327f0cd 100644 --- a/src/main/java/com/lz/modules/performance/controller/ResultDimensionController.java +++ b/src/main/java/com/lz/modules/performance/controller/ResultDimensionController.java @@ -7,7 +7,10 @@ import com.lz.common.utils.R; import com.lz.common.utils.StringUtil; import com.lz.modules.flow.entity.ResultDimension; import com.lz.modules.flow.service.ResultDimensionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -17,6 +20,7 @@ import java.util.Map; @RestController @RequestMapping("/resultDimension") +@Api(tags = "维度类型") public class ResultDimensionController { @@ -25,7 +29,12 @@ public class ResultDimensionController { - + @GetMapping("/getDimensions") + @ApiOperation("获取维度类型") + public R getDimensions() { + //resultDimension = resultDimensionService.selectResultDimensionById(resultDimension.getId()); + return R.ok();//.put("resultDimension",resultDimension); + } @RequestMapping("/getById") public R getById(@RequestBody ResultDimension resultDimension) { diff --git a/src/main/java/com/lz/modules/performance/controller/ResultModelController.java b/src/main/java/com/lz/modules/performance/controller/ResultModelController.java index 7ca7cf1d..68257c6b 100644 --- a/src/main/java/com/lz/modules/performance/controller/ResultModelController.java +++ b/src/main/java/com/lz/modules/performance/controller/ResultModelController.java @@ -7,7 +7,11 @@ import com.lz.common.utils.R; import com.lz.common.utils.StringUtil; import com.lz.modules.flow.entity.ResultModel; import com.lz.modules.flow.service.ResultModelService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -17,6 +21,7 @@ import java.util.Map; @RestController @RequestMapping("/resultModel") +@Api(tags = "模板相关") public class ResultModelController { @@ -41,10 +46,11 @@ public class ResultModelController { } - @RequestMapping("/save") - public R save(@RequestBody ResultModel resultModel) { + @PostMapping("/save") + @ApiOperation("新增模板") + public R save(@RequestBody @ApiParam ResultModel resultModel) { resultModelService.insertResultModel(resultModel); - return R.ok(); + return R.ok(); } diff --git a/src/main/resources/mapper/flow/ResultCalculateMapper.xml b/src/main/resources/mapper/flow/ResultCalculateMapper.xml index 1b7638f4..6e3fe16e 100644 --- a/src/main/resources/mapper/flow/ResultCalculateMapper.xml +++ b/src/main/resources/mapper/flow/ResultCalculateMapper.xml @@ -84,5 +84,9 @@ update lz_result_calculate set is_delete = 1 where id=#{id} limit 1 + + diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 21bdce13..3bc32886 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -43,6 +43,7 @@ public class MysqlMain { public static String mysql_username = "ldd_biz"; public static String mysql_password = "Hello1234"; + public static String dto_exclude = ",is_delete,gmt_create,gmt_modified,";//生成dto时排除字段,前后都要加英文逗号 /** * @param args @@ -63,8 +64,18 @@ public class MysqlMain { } List list = new ArrayList(); + list.add(new TablesBean("lz_evaluation_group")); + list.add(new TablesBean("lz_evaluation_start_staff")); + list.add(new TablesBean("lz_flow_approval_role")); + list.add(new TablesBean("lz_flow_change")); + list.add(new TablesBean("lz_flow_chart")); + list.add(new TablesBean("lz_flow_chart_role")); + list.add(new TablesBean("lz_flow_start")); + list.add(new TablesBean("lz_result_calculate")); list.add(new TablesBean("lz_result_dimension")); list.add(new TablesBean("lz_result_grade")); + list.add(new TablesBean("lz_result_model")); + list.add(new TablesBean("lz_result_score")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments(); @@ -80,6 +91,7 @@ public class MysqlMain { for (int i = 0; i < list2.size(); i++) { MysqlUtilTable2Bean.printEntity(list2.get(i)); MysqlUtilTable2Bean.printReq(list2.get(i)); + MysqlUtilTable2Bean.printDto(list2.get(i)); } diff --git a/src/test/java/com/lz/mysql/MysqlUtilTable2Bean.java b/src/test/java/com/lz/mysql/MysqlUtilTable2Bean.java index 27d26931..5a941f8a 100644 --- a/src/test/java/com/lz/mysql/MysqlUtilTable2Bean.java +++ b/src/test/java/com/lz/mysql/MysqlUtilTable2Bean.java @@ -10,6 +10,7 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Date; import java.util.List; @@ -250,7 +251,6 @@ public class MysqlUtilTable2Bean { content += "/**\n"; content += "*

\n"; - content += "* 菜单权限表\n"; content += "*

"; content += "*" + tableBean.getComment() + "\n"; content += "* @author quyixiao\n"; @@ -277,4 +277,126 @@ public class MysqlUtilTable2Bean { e.printStackTrace(); } } + + public static void printDto(TablesBean tableBean) { + + boolean hasDate = false; + + List list = tableBean.getFieldList(); + + StringBuffer bf = new StringBuffer(); + + String realName = MysqlMain.pre + tableBean.getSpaceName() + ""; + String fileName = MysqlMain.save_path + "/" + realName + "Dto.java"; + //String[] exclude = MysqlMain.dto_exclude.split(","); + //Arrays.stream(exclude).findFirst(); + int i = 0; + // 定义声明 + for (FieldBean tb : list) { + String temp = ""; + temp += " //" + tb.getComment() + "\n"; + if (MysqlMain.dto_exclude.contains("," + tb.getField() + ",")) { + continue; + }else{ + temp += " @ApiModelProperty(value = \"" + tb.getComment() + "\", name = \"" + tb.getJavaCode() + "\")\n"; + } + temp += " private " + tb.getJavaType() + " " + tb.getJavaCode() + ";"; + i++; + // System.out.println(temp); + bf.append(temp).append("\n"); + + + if (!hasDate && "Date".equals(tb.getJavaType())) { + hasDate = true; + } + } + + + // 定义get set方法 + for (FieldBean tb : list) { + if (MysqlMain.dto_exclude.contains("," + tb.getField() + ",")) { + continue; + } + String temp = ""; + temp += " /**\n"; + temp += " * " + tb.getComment() + " \n"; + temp += " * @return\n"; + temp += " */\n"; + temp += " public " + tb.getJavaType() + " " + + tb.getJavaCodeForGet() + "() {\n"; + temp += " return " + tb.getJavaCode() + ";\n"; + temp += " }"; + // System.out.println(temp); + + bf.append(temp).append("\n"); + + temp = ""; + temp += " /**\n"; + temp += " * " + tb.getComment() + " \n"; + temp += " * @param " + tb.getJavaCode() + "\n"; + temp += " */\n"; + temp += " public void " + tb.getJavaCodeForSet() + "(" + + tb.getJavaType() + " " + tb.getJavaCode() + ") {\n"; + temp += " this." + tb.getJavaCode() + " = " + tb.getJavaCode() + + ";\n"; + temp += " }\n"; + // System.out.println(temp); + bf.append(temp).append("\n"); + } + + StringBuilder sb = new StringBuilder(); + + sb.append(" @Override\n"); + sb.append(" public String toString() {\n"); + sb.append(" return \"" + realName + "{\" +\n"); + + for (FieldBean tb : list) { + if (MysqlMain.dto_exclude.contains("," + tb.getField() + ",")) { + continue; + } + String temp = ""; + sb.append(" \"," + tb.getJavaCode() + "=\" + " + tb.getJavaCode() + " +\n"); + } + sb.append(" \"}\";\n"); + sb.append(" }\n"); + try { + + String content = "package " + MysqlMain.package_name + ";\n"; + content += "import io.swagger.annotations.ApiModel;\n"; + content += "import io.swagger.annotations.ApiModelProperty;\n"; + content += "import lombok.Data;\n"; + + + if (hasDate) { + content += "import java.util.Date;" + "\n"; + } + + + content += "/**\n"; + content += "*

\n"; + content += "*

"; + content += "*" + tableBean.getComment() + "\n"; + content += "* @author quyixiao\n"; + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + content += "* @since " + format.format(new Date()) + "\n"; + content += "*/\n"; + + content += "\n"; + content += "@Data\n"; + content += "@ApiModel(value = \"" + tableBean.getComment() + "\")\n"; + content += "public class " + realName + "Dto {\n" + bf.toString(); + content += sb.toString(); + content += "}"; + + FileOutputStream fos = new FileOutputStream(fileName); + + Writer out = new OutputStreamWriter(fos, "UTF-8"); + out.write(content); + out.close(); + fos.close(); + System.out.println("===" + realName + "Dto.java" + "生成"); + } catch (IOException e) { + e.printStackTrace(); + } + } }