diff --git a/src/main/java/com/lz/common/emun/CheckStaffType.java b/src/main/java/com/lz/common/emun/CheckStaffType.java new file mode 100644 index 00000000..e4215fc1 --- /dev/null +++ b/src/main/java/com/lz/common/emun/CheckStaffType.java @@ -0,0 +1,32 @@ +package com.lz.common.emun; +//考核人员类型 +public enum CheckStaffType { + + STAFF(0, "考核人员"), + MANAGER(1, "管理人员人员"), + + ; + + CheckStaffType(int code, String name){ + this.code = code; + this.name = name; + } + private int code; + private String name; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/src/main/java/com/lz/modules/app/controller/StaffRoleController.java b/src/main/java/com/lz/modules/app/controller/StaffRoleController.java index b9a685c6..c33121ea 100644 --- a/src/main/java/com/lz/modules/app/controller/StaffRoleController.java +++ b/src/main/java/com/lz/modules/app/controller/StaffRoleController.java @@ -1,12 +1,16 @@ package com.lz.modules.app.controller; import com.alibaba.fastjson.JSON; +import com.dingtalk.api.response.OapiDepartmentListResponse; import com.lz.common.utils.NumberUtil; import com.lz.common.utils.PageUtils; import com.lz.common.utils.R; import com.lz.modules.app.entity.DepartmentsEntity; +import com.lz.modules.app.entity.DepartmentsStaffRelateEntity; import com.lz.modules.app.entity.StaffEntity; +import com.lz.modules.app.resp.StaffRoleModel; import com.lz.modules.app.service.DepartmentsService; +import com.lz.modules.app.service.DepartmentsStaffRelateService; import com.lz.modules.app.service.StaffService; import com.lz.modules.flow.entity.RecordRole; import com.lz.modules.flow.entity.StaffRole; @@ -17,7 +21,12 @@ import com.lz.modules.flow.service.StaffRoleDepartmentService; import com.lz.modules.flow.service.StaffRoleService; import com.lz.modules.sys.entity.SysMenuEntity; import com.lz.modules.sys.entity.SysRoleEntity; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -34,6 +43,7 @@ import java.util.stream.Collectors; */ @RestController @RequestMapping("user/lzstaffrole") +@Api(tags = "考评组管理员管理") public class StaffRoleController { @Autowired private StaffRoleService staffRoleService; @@ -50,7 +60,8 @@ public class StaffRoleController { @Autowired private DepartmentsService departmentsService; - + @Autowired + private DepartmentsStaffRelateService departmentsStaffRelateService; /** * 列表 @@ -63,10 +74,26 @@ public class StaffRoleController { } - @RequestMapping("/listByGroupId") - public R listByGroupId(Long id ) { - List staffRoles = staffRoleService.selectByGroupId(id); - return R.ok().put("staffRoles", staffRoles); + @GetMapping("/listByGroupId") + @ApiOperation(value="根据groupId获取管理员列表") + @ApiImplicitParam(name = "groupId",value = "组id",defaultValue = "1",required = true, dataType = "Long",paramType = "query") + public R listByGroupId( Long groupId ) { + List staffRoleList = staffRoleService.selectByGroupId(groupId); + List staffRoles = new ArrayList<>(); + for(StaffRole staffRole:staffRoleList){ + StaffRoleModel staffRoleModel = new StaffRoleModel(); + BeanUtils.copyProperties(staffRole,staffRoleModel); + Long staffId = staffRole.getStaffId(); + DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId); + if(departmentsStaffRelateEntity !=null ){ + DepartmentsEntity departmentsEntity = departmentsService.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId()); + if(departmentsEntity !=null){ + staffRoleModel.setStaffName(staffRoleModel.getStaffName() + " "+departmentsEntity.getDepartmentName()); + } + } + staffRoles.add(staffRoleModel); + } + return R.ok().put("data", staffRoles); } /** diff --git a/src/main/java/com/lz/modules/app/resp/StaffRoleModel.java b/src/main/java/com/lz/modules/app/resp/StaffRoleModel.java new file mode 100644 index 00000000..9e060205 --- /dev/null +++ b/src/main/java/com/lz/modules/app/resp/StaffRoleModel.java @@ -0,0 +1,32 @@ +package com.lz.modules.app.resp; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +public class StaffRoleModel { + + //员工 id + @ApiModelProperty(value = "员工 id", name = "staffId") + private Long staffId; + + //员工名称 + @ApiModelProperty(value = "员工名称", name = "staffName") + private String staffName; + //组id + @ApiModelProperty(value = "组id", name = "evaluationGroupId") + private Long evaluationGroupId; + + + + + + //是否是必选 + @ApiModelProperty(value = "是否是必选,0不是必选,1必选", name = "isSelect") + private Integer isSelect; + +} diff --git a/src/main/java/com/lz/modules/flow/dao/EvaluationGroupMapper.java b/src/main/java/com/lz/modules/flow/dao/EvaluationGroupMapper.java index 833b1713..728c362d 100644 --- a/src/main/java/com/lz/modules/flow/dao/EvaluationGroupMapper.java +++ b/src/main/java/com/lz/modules/flow/dao/EvaluationGroupMapper.java @@ -38,4 +38,6 @@ public interface EvaluationGroupMapper extends BaseMapper { List seleteEvaluationGroupByReq(@Param("page") IPage page, @Param("req") EvaluationGroupReq req); List selectEvaluationGroupByIds(@Param("ids") List ids); + + EvaluationGroup selectEvaluationGroupByName(@Param("name") String name); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/dao/EvaluationStartStaffMapper.java b/src/main/java/com/lz/modules/flow/dao/EvaluationStartStaffMapper.java index 30053dea..ce5f56e8 100644 --- a/src/main/java/com/lz/modules/flow/dao/EvaluationStartStaffMapper.java +++ b/src/main/java/com/lz/modules/flow/dao/EvaluationStartStaffMapper.java @@ -11,6 +11,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.lz.modules.flow.entity.EvaluationStartStaff; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + +import java.util.List; + @Mapper public interface EvaluationStartStaffMapper extends BaseMapper { @@ -30,4 +33,5 @@ public interface EvaluationStartStaffMapper extends BaseMapper evaluationStartStaffs); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/dao/FlowChartDetailRecordMapper.java b/src/main/java/com/lz/modules/flow/dao/FlowChartDetailRecordMapper.java index a62553d6..dc4c4c2f 100644 --- a/src/main/java/com/lz/modules/flow/dao/FlowChartDetailRecordMapper.java +++ b/src/main/java/com/lz/modules/flow/dao/FlowChartDetailRecordMapper.java @@ -35,4 +35,6 @@ public interface FlowChartDetailRecordMapper extends BaseMapper selectFlowChartDetailRecordByGroupIdAndChartId(@Param("groupId") Long groupId, @Param("chartId") Long chartId); + + List selectFlowChartDetailRecordByGroupId(Long groupId); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/entity/EvaluationGroup.java b/src/main/java/com/lz/modules/flow/entity/EvaluationGroup.java index 36d8966b..93fd209b 100644 --- a/src/main/java/com/lz/modules/flow/entity/EvaluationGroup.java +++ b/src/main/java/com/lz/modules/flow/entity/EvaluationGroup.java @@ -22,6 +22,7 @@ import java.util.Date; public class EvaluationGroup implements java.io.Serializable { // @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "如果不传,那么表示新建,否则更新", name = "id") private Long id; // @ApiModelProperty(value = "", name = "isDelete") diff --git a/src/main/java/com/lz/modules/flow/entity/StaffRole.java b/src/main/java/com/lz/modules/flow/entity/StaffRole.java index 6c69ce93..d768e61a 100644 --- a/src/main/java/com/lz/modules/flow/entity/StaffRole.java +++ b/src/main/java/com/lz/modules/flow/entity/StaffRole.java @@ -44,6 +44,9 @@ public class StaffRole implements java.io.Serializable { //组id @ApiModelProperty(value = "组id", name = "evaluationGroupId") private Long evaluationGroupId; + //是否是必选 + @ApiModelProperty(value = "是否是必选", name = "isSelect") + private Integer isSelect; /** * * @return @@ -179,6 +182,21 @@ public class StaffRole implements java.io.Serializable { this.evaluationGroupId = evaluationGroupId; } + /** + * 是否是必选 + * @return + */ + public Integer getIsSelect() { + return isSelect; + } + /** + * 是否是必选 + * @param isSelect + */ + public void setIsSelect(Integer isSelect) { + this.isSelect = isSelect; + } + @Override public String toString() { return "StaffRole{" + @@ -191,6 +209,7 @@ public class StaffRole implements java.io.Serializable { ",typeRoleIds=" + typeRoleIds + ",staffName=" + staffName + ",evaluationGroupId=" + evaluationGroupId + + ",isSelect=" + isSelect + "}"; } } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/EvaluationGroupService.java b/src/main/java/com/lz/modules/flow/service/EvaluationGroupService.java index c880d950..081d66e6 100644 --- a/src/main/java/com/lz/modules/flow/service/EvaluationGroupService.java +++ b/src/main/java/com/lz/modules/flow/service/EvaluationGroupService.java @@ -41,4 +41,6 @@ public interface EvaluationGroupService extends IService { PageUtils selectEvaluationGroupByReq(EvaluationGroupReq req); List selectEvaluationGroupByIds(List ids); + + EvaluationGroup selectEvaluationGroupByName(String name); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/EvaluationStartStaffService.java b/src/main/java/com/lz/modules/flow/service/EvaluationStartStaffService.java index 92089e5e..464f396a 100644 --- a/src/main/java/com/lz/modules/flow/service/EvaluationStartStaffService.java +++ b/src/main/java/com/lz/modules/flow/service/EvaluationStartStaffService.java @@ -3,6 +3,8 @@ package com.lz.modules.flow.service; import com.baomidou.mybatisplus.extension.service.IService; import com.lz.modules.flow.entity.EvaluationStartStaff; +import java.util.List; + /** *

* 发起考核考,核组人员对应关系表 服务类 @@ -30,4 +32,5 @@ public interface EvaluationStartStaffService extends IService evaluationStartStaffs); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/FlowChartDetailRecordService.java b/src/main/java/com/lz/modules/flow/service/FlowChartDetailRecordService.java index b5d920d8..ac7fe043 100644 --- a/src/main/java/com/lz/modules/flow/service/FlowChartDetailRecordService.java +++ b/src/main/java/com/lz/modules/flow/service/FlowChartDetailRecordService.java @@ -34,4 +34,6 @@ public interface FlowChartDetailRecordService extends IService selectFlowChartDetailRecordByGroupIdAndChartId(Long groupId, Long chartId); + + List selectFlowChartDetailRecordByGroupId(Long groupId); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/flow/service/impl/EvaluationGroupServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/EvaluationGroupServiceImpl.java index 325821e1..e662a7a6 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/EvaluationGroupServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/EvaluationGroupServiceImpl.java @@ -125,4 +125,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl selectEvaluationGroupByIds(List ids){ return evaluationGroupMapper.selectEvaluationGroupByIds(ids); } + + @Override + public EvaluationGroup selectEvaluationGroupByName(String name){ + return evaluationGroupMapper.selectEvaluationGroupByName(name); + } } diff --git a/src/main/java/com/lz/modules/flow/service/impl/EvaluationStartStaffServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/EvaluationStartStaffServiceImpl.java index a3c44d98..de384347 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/EvaluationStartStaffServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/EvaluationStartStaffServiceImpl.java @@ -7,6 +7,9 @@ import com.lz.modules.flow.service.EvaluationStartStaffService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.List; + /** *

* 发起考核考,核组人员对应关系表 服务类 @@ -23,7 +26,7 @@ public class EvaluationStartStaffServiceImpl extends ServiceImpl evaluationStartStaffs){ + if(evaluationStartStaffs.size() <= maxInsertSQL){ + return evaluationStartStaffMapper.insertEvaluationStartStaffs(evaluationStartStaffs); + } + //下面防止sql语句过大 + Long count = Long.getLong("0"); + int insert = 0; + List startStaffs = new ArrayList<>(); + for (EvaluationStartStaff startStaff:evaluationStartStaffs + ) { + startStaffs.add(startStaff); + insert++; + if(insert >= maxInsertSQL){ + count += evaluationStartStaffMapper.insertEvaluationStartStaffs(startStaffs); + startStaffs.clear(); + insert = 0; + } + + } + if(startStaffs.size() > 0){ + count += evaluationStartStaffMapper.insertEvaluationStartStaffs(startStaffs); + } + return count; + + + } + } diff --git a/src/main/java/com/lz/modules/flow/service/impl/FlowChartDetailRecordServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/FlowChartDetailRecordServiceImpl.java index f752db2e..6a96c45b 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/FlowChartDetailRecordServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/FlowChartDetailRecordServiceImpl.java @@ -66,6 +66,10 @@ public class FlowChartDetailRecordServiceImpl extends ServiceImpl selectFlowChartDetailRecordByGroupId(Long groupId){ + return flowChartDetailRecordMapper.selectFlowChartDetailRecordByGroupId(groupId); + } diff --git a/src/main/java/com/lz/modules/performance/controller/EvaluationGroupController.java b/src/main/java/com/lz/modules/performance/controller/EvaluationGroupController.java index 4552450d..25cc5031 100644 --- a/src/main/java/com/lz/modules/performance/controller/EvaluationGroupController.java +++ b/src/main/java/com/lz/modules/performance/controller/EvaluationGroupController.java @@ -122,7 +122,6 @@ public class EvaluationGroupController { @PostMapping("/update") - @ApiOperation("编辑考评组") public R update(@RequestBody @ApiParam EvaluationGroup evaluationGroup) { evaluationGroupService.updateEvaluationGroupById(evaluationGroup); return R.ok(); @@ -130,10 +129,25 @@ public class EvaluationGroupController { @PostMapping("/save") - @ApiOperation("新增考评组") + @ApiOperation("保存考评组") @ApiResponses({@ApiResponse(code = 200, message = "成功", response = EvaluationGroup.class)}) public R save(@RequestBody @ApiParam EvaluationGroup evaluationGroup) { - evaluationGroupService.insertEvaluationGroup(evaluationGroup); + if(evaluationGroup.getId() != null && evaluationGroup.getId().intValue() > 0){ + EvaluationGroup evaluationGroup1 = evaluationGroupService.selectEvaluationGroupByName(evaluationGroup.getName()); + if(evaluationGroup1 == null || evaluationGroup1.getId().equals(evaluationGroup.getId())){ + evaluationGroupService.updateEvaluationGroupById(evaluationGroup); + }else { + return R.error("已经存在相同名称考核组"); + } + + }else{ + EvaluationGroup evaluationGroup1 = evaluationGroupService.selectEvaluationGroupByName(evaluationGroup.getName()); + if(evaluationGroup1 != null){ + return R.error("已经存在相同名称考核组"); + } + evaluationGroupService.insertEvaluationGroup(evaluationGroup); + } + return R.ok().put("data", evaluationGroup); } diff --git a/src/main/java/com/lz/modules/performance/controller/FlowChartController.java b/src/main/java/com/lz/modules/performance/controller/FlowChartController.java index 3594bcf7..bc7128bf 100644 --- a/src/main/java/com/lz/modules/performance/controller/FlowChartController.java +++ b/src/main/java/com/lz/modules/performance/controller/FlowChartController.java @@ -86,12 +86,14 @@ public class FlowChartController { @ApiOperation("保存流程节点小流程") @ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecord.class)}) public R saveDetailProc(@RequestBody @ApiParam FlowChartDetailRecord flowChartDetailRecord) { + if(flowChartDetailRecord.getId() != null && flowChartDetailRecord.getId().intValue() > 0){ + return updateDetailProc(flowChartDetailRecord); + } flowChartDetailRecordService.insertFlowChartDetailRecord(flowChartDetailRecord); return R.ok().put("data", flowChartDetailRecord); } @PostMapping("/updateDetailProc") - @ApiOperation("编辑流程节点小流程") public R updateDetailProc(@RequestBody @ApiParam FlowChartDetailRecord flowChartDetailRecord) { flowChartDetailRecordService.updateFlowChartDetailRecordById(flowChartDetailRecord); return R.ok(); diff --git a/src/main/java/com/lz/modules/performance/controller/FlowStartController.java b/src/main/java/com/lz/modules/performance/controller/FlowStartController.java index 911960c8..3db5a7da 100644 --- a/src/main/java/com/lz/modules/performance/controller/FlowStartController.java +++ b/src/main/java/com/lz/modules/performance/controller/FlowStartController.java @@ -2,13 +2,12 @@ package com.lz.modules.performance.controller; import com.alibaba.fastjson.JSONObject; +import com.lz.common.emun.CheckStaffType; import com.lz.common.utils.PageUtils; import com.lz.common.utils.R; import com.lz.common.utils.StringUtil; -import com.lz.modules.flow.entity.EvaluationGroup; -import com.lz.modules.flow.entity.FlowStart; -import com.lz.modules.flow.service.EvaluationGroupService; -import com.lz.modules.flow.service.FlowStartService; +import com.lz.modules.flow.entity.*; +import com.lz.modules.flow.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -19,10 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collector; import java.util.stream.Collectors; @@ -40,6 +36,17 @@ public class FlowStartController { @Autowired private EvaluationGroupService evaluationGroupService; + @Autowired + private EvaluationStartStaffService evaluationStartStaffService; + + @Autowired + private ResultModelService resultModelService; + + @Autowired + private FlowChartDetailRecordService flowChartDetailRecordService; + + + @RequestMapping("/getById") @@ -68,12 +75,57 @@ public class FlowStartController { } }).collect(Collectors.toList()); List evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids); - Map map = new HashedMap(); + for (EvaluationGroup evaluationGroup:evaluationGroups ) { - //下面初始化部门的员工考核流程 + //下面初始化员工考核流程 + List staffIds = evaluationGroupService.selectAllStaffIdsByGroupId(evaluationGroup.getId()); + if(staffIds.size() == 0){ + return R.error(evaluationGroup.getName() + "——无有效考核人员"); + } + List resultModels = resultModelService.selectResultModelByGroupId(evaluationGroup.getId()); + if(resultModels.size() == 0){ + return R.error(evaluationGroup.getName() + "——没有设置考核模板"); + } + + List flowChartDetailRecords + = flowChartDetailRecordService.selectFlowChartDetailRecordByGroupId(evaluationGroup.getId()); + if(flowChartDetailRecords.size() == 0){ + return R.error(evaluationGroup.getName() + "——没有设置考核流程"); + } + + List evaluationStartStaffs = new ArrayList<>(); + + for (String staffId:staffIds + ) { + EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff(); + evaluationStartStaff.setEvaluationId(evaluationGroup.getId()); + evaluationStartStaff.setStaffId(Long.getLong(staffId)); + evaluationStartStaff.setStaffId(flowStart.getId()); + evaluationStartStaff.setType(CheckStaffType.STAFF.getCode()); + evaluationStartStaffs.add(evaluationStartStaff); + + } + //下面初始化管理人员 + if(evaluationGroup.getManagerIds() != null && evaluationGroup.getManagerIds().length() > 0){ + String[] managerIds = evaluationGroup.getManagerIds().split(","); + for (String staffId:managerIds + ) { + EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff(); + evaluationStartStaff.setEvaluationId(evaluationGroup.getId()); + evaluationStartStaff.setStaffId(Long.getLong(staffId)); + evaluationStartStaff.setStaffId(flowStart.getId()); + evaluationStartStaff.setType(CheckStaffType.MANAGER.getCode()); + evaluationStartStaffs.add(evaluationStartStaff); + + } + } + if(evaluationStartStaffs.size() > 0){ + evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs); + } + //下面初始化lz_flow流程表 lz_flow_approval_role流程审批表 + - //下面初始化考核人员的考核流程 } return R.ok(); } 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 7d971395..e58d3127 100644 --- a/src/main/java/com/lz/modules/performance/controller/ResultModelController.java +++ b/src/main/java/com/lz/modules/performance/controller/ResultModelController.java @@ -50,7 +50,6 @@ public class ResultModelController { @PostMapping("/update") - @ApiOperation("编辑考核模板") public R update(@RequestBody @ApiParam ResultModel resultModel) { resultModelService.updateResultModelById(resultModel); return R.ok(); @@ -58,10 +57,13 @@ public class ResultModelController { @PostMapping("/save") - @ApiOperation("新增模板中的考核维度") + @ApiOperation("保存模板中的考核维度") public R save(@RequestBody @ApiParam ResultModel resultModel) { - resultModelService.insertResultModel(resultModel); - return R.ok().put("data",resultModel); + if(resultModel.getId() != null && resultModel.getId().intValue() > 0){ + return update(resultModel); + } + resultModelService.insertResultModel(resultModel); + return R.ok().put("data",resultModel); } diff --git a/src/main/java/com/lz/modules/performance/controller/ResultTagetLibController.java b/src/main/java/com/lz/modules/performance/controller/ResultTagetLibController.java index 5eabfe52..67b06801 100644 --- a/src/main/java/com/lz/modules/performance/controller/ResultTagetLibController.java +++ b/src/main/java/com/lz/modules/performance/controller/ResultTagetLibController.java @@ -48,9 +48,12 @@ public class ResultTagetLibController { @PostMapping("/save") - @ApiOperation("新增考核指标") + @ApiOperation("保存考核指标") public R save(@RequestBody @ApiParam ResultTagetLib resultTagetLib) { + if(resultTagetLib.getId() != null && resultTagetLib.getId().intValue() > 0){ + return update(resultTagetLib); + } return resultTagetLibService.insertResultTagetLib(resultTagetLib); } diff --git a/src/main/resources/mapper/app/ResultRecordMapper.xml b/src/main/resources/mapper/app/ResultRecordMapper.xml index 7dae2690..404796d0 100644 --- a/src/main/resources/mapper/app/ResultRecordMapper.xml +++ b/src/main/resources/mapper/app/ResultRecordMapper.xml @@ -343,7 +343,7 @@ - select * from lz_evaluation_group where is_delete = 0 and id in ( #{id} @@ -104,6 +104,10 @@ ) + + diff --git a/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml b/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml index 0816098a..1e1db351 100644 --- a/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml +++ b/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml @@ -83,6 +83,21 @@ update lz_evaluation_start_staff set is_delete = 1 where id=#{id} limit 1 + + insert into lz_evaluation_start_staff( + evaluation_id, + start_id, + staff_id, + type + )values + + #{ item.evaluationId}, + #{ item.startId}, + #{ item.staffId}, + #{ item.type} + + + diff --git a/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml b/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml index a0c8e4a6..9dd52877 100644 --- a/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml +++ b/src/main/resources/mapper/flow/FlowChartDetailRecordMapper.xml @@ -108,5 +108,9 @@ select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId} and chart_id = #{chartId} and is_delete = 0 order by step_index desc + + diff --git a/src/main/resources/mapper/flow/StaffRoleMapper.xml b/src/main/resources/mapper/flow/StaffRoleMapper.xml index f0f10ec4..fd55ce3c 100644 --- a/src/main/resources/mapper/flow/StaffRoleMapper.xml +++ b/src/main/resources/mapper/flow/StaffRoleMapper.xml @@ -13,12 +13,13 @@ + - id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, department_level AS departmentLevel, type_role_ids AS typeRoleIds, staff_name AS staffName, evaluation_group_id AS evaluationGroupId + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, department_level AS departmentLevel, type_role_ids AS typeRoleIds, staff_name AS staffName, evaluation_group_id AS evaluationGroupId, is_select AS isSelect @@ -36,6 +37,7 @@ type_role_ids, staff_name, evaluation_group_id, + is_select, is_delete, gmt_create, gmt_modified @@ -45,6 +47,7 @@ #{ typeRoleIds}, #{ staffName}, #{ evaluationGroupId}, + #{ isSelect}, 0, now(), now() @@ -62,7 +65,8 @@ department_level = #{departmentLevel}, type_role_ids = #{typeRoleIds}, staff_name = #{staffName}, - evaluation_group_id = #{evaluationGroupId} + evaluation_group_id = #{evaluationGroupId}, + is_select = #{isSelect} ,gmt_modified = now() where id = #{id} @@ -79,7 +83,8 @@ department_level = #{departmentLevel}, type_role_ids = #{typeRoleIds}, staff_name = #{staffName}, - evaluation_group_id = #{evaluationGroupId} + evaluation_group_id = #{evaluationGroupId}, + is_select = #{isSelect} ,gmt_modified = now() where id = #{id} diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 6f770727..d2303851 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -73,7 +73,7 @@ public class MysqlMain { 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_dimension"));' list.add(new TablesBean("lz_result_grade"));*/ //list.add(new TablesBean("lz_result_model")); //list.add(new TablesBean("lz_result_score"));