From 6d1f1f1f429e2b62373435d5433577bf3eb10f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Thu, 22 Oct 2020 15:46:54 +0800 Subject: [PATCH] fix --- .../flow/entity/EvaluationStartStaff.java | 22 +++++++- .../controller/AssessManagerController.java | 33 ++++++++++- .../flow/EvaluationStartStaffMapper.xml | 56 ++++++++++--------- src/test/java/com/lz/mysql/MysqlMain.java | 4 +- 4 files changed, 82 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/lz/modules/flow/entity/EvaluationStartStaff.java b/src/main/java/com/lz/modules/flow/entity/EvaluationStartStaff.java index 9e431549..b1c6394f 100644 --- a/src/main/java/com/lz/modules/flow/entity/EvaluationStartStaff.java +++ b/src/main/java/com/lz/modules/flow/entity/EvaluationStartStaff.java @@ -8,10 +8,9 @@ import lombok.Data; import java.util.Date; /** *

-* 菜单权限表 *

*发起考核考,核组人员对应关系表 * @author quyixiao -* @since 2020-10-13 +* @since 2020-10-22 */ @Data @@ -42,6 +41,9 @@ public class EvaluationStartStaff implements java.io.Serializable { //0考核人员,1管理人员 @ApiModelProperty(value = "0考核人员,1管理人员", name = "type") private Integer type; + //0: 未通知评分 1: 已通知评分 + @ApiModelProperty(value = "0: 未通知评分 1: 已通知评分", name = "score") + private Integer score; /** * * @return @@ -162,6 +164,21 @@ public class EvaluationStartStaff implements java.io.Serializable { this.type = type; } + /** + * 0: 未通知评分 1: 已通知评分 + * @return + */ + public Integer getScore() { + return score; + } + /** + * 0: 未通知评分 1: 已通知评分 + * @param score + */ + public void setScore(Integer score) { + this.score = score; + } + @Override public String toString() { return "EvaluationStartStaff{" + @@ -173,6 +190,7 @@ public class EvaluationStartStaff implements java.io.Serializable { ",startId=" + startId + ",staffId=" + staffId + ",type=" + type + + ",score=" + score + "}"; } } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/controller/AssessManagerController.java b/src/main/java/com/lz/modules/performance/controller/AssessManagerController.java index 05ca68c3..33298e50 100644 --- a/src/main/java/com/lz/modules/performance/controller/AssessManagerController.java +++ b/src/main/java/com/lz/modules/performance/controller/AssessManagerController.java @@ -3,21 +3,29 @@ package com.lz.modules.performance.controller; import com.lz.common.utils.PageUtils; import com.lz.common.utils.R; import com.lz.modules.flow.dao.FlowStartMapper; +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.performance.req.AssessListReq; import com.lz.modules.performance.req.AssessDetailReq; import com.lz.modules.performance.res.AssessManagerDetailRes; import com.lz.modules.performance.res.AssessManagerListRes; import com.lz.modules.performance.res.ChartStatisticalRes; +import io.swagger.annotations.ApiImplicitParam; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.ToLongFunction; +import java.util.stream.Collectors; /** * @Author: djc @@ -30,10 +38,12 @@ public class AssessManagerController { @Autowired private FlowStartMapper flowStartMapper; + @Autowired + private EvaluationGroupService evaluationGroupService; @RequestMapping("assess/manager/list") - public R groupList(@RequestBody AssessListReq req){ + public R assessList(@RequestBody AssessListReq req){ List data = new ArrayList<>(); PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect( page -> flowStartMapper.selectListByTime(page,req.getCycleType(),req.getName()) @@ -64,11 +74,28 @@ public class AssessManagerController { } @RequestMapping("assess/manager/detail") - public R groupDetail(@RequestBody AssessDetailReq req){ - + public R assessDetail(@RequestBody AssessDetailReq req){ AssessManagerDetailRes res = new AssessManagerDetailRes(); return R.ok(); } + + + + + @RequestMapping("assess/manager/delete") + @ApiImplicitParam(name = "assessId",value = "发起考核id", required = true, dataType = "Long",paramType = "query") + public R assessDelete(@RequestParam Long assessId){ + FlowStart flowStart = flowStartMapper.selectFlowStartById(assessId); + if(flowStart == null){ + return R.error("没有此条记录"); + } + String[] split = flowStart.getGroupIds().split(","); + List collect = Arrays.asList(split).stream().map(s -> Long.valueOf(s)).collect(Collectors.toList()); + List evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(collect); + + return R.ok(); + + } } diff --git a/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml b/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml index 1c8b734b..4d7728da 100644 --- a/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml +++ b/src/main/resources/mapper/flow/EvaluationStartStaffMapper.xml @@ -12,12 +12,13 @@ + - id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, evaluation_id AS evaluationId, start_id AS startId, staff_id AS staffId, type AS type + id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, evaluation_id AS evaluationId, start_id AS startId, staff_id AS staffId, type AS type, score AS score @@ -30,35 +31,38 @@ insert into lz_evaluation_start_staff( - evaluation_id, - start_id, - staff_id, - type, - is_delete, - gmt_create, - gmt_modified + evaluation_id, + start_id, + staff_id, + type, + score, + is_delete, + gmt_create, + gmt_modified )values( - #{ evaluationId}, - #{ startId}, - #{ staffId}, - #{ type}, - 0, - now(), - now() + #{ evaluationId}, + #{ startId}, + #{ staffId}, + #{ type}, + #{ score}, + 0, + now(), + now() ) update - lz_evaluation_start_staff + lz_evaluation_start_staff is_delete = #{isDelete}, gmt_create = #{gmtCreate}, evaluation_id = #{evaluationId}, start_id = #{startId}, staff_id = #{staffId}, - type = #{type} + type = #{type}, + score = #{score} ,gmt_modified = now() where id = #{id} @@ -67,19 +71,19 @@ update - lz_evaluation_start_staff - set - is_delete = #{isDelete}, - gmt_create = #{gmtCreate}, - evaluation_id = #{evaluationId}, - start_id = #{startId}, - staff_id = #{staffId}, - type = #{type} + lz_evaluation_start_staff + set + is_delete = #{isDelete}, + gmt_create = #{gmtCreate}, + evaluation_id = #{evaluationId}, + start_id = #{startId}, + staff_id = #{staffId}, + type = #{type}, + score = #{score} ,gmt_modified = now() where id = #{id} - update lz_evaluation_start_staff 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 6c2efa57..5a35f8d6 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -80,9 +80,9 @@ public class MysqlMain { //list.add(new TablesBean("lz_result_taget_lib")); //list.add(new TablesBean("lz_flow_chart_detail_record")); - list.add(new TablesBean("lz_flow_approval_role")); + //list.add(new TablesBean("lz_flow_approval_role")); - list.add(new TablesBean("lz_flow_start")); + list.add(new TablesBean("lz_evaluation_start_staff")); List list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments();