From 248166ea2d1ba9268783ea87cc27fdcb3159fa92 Mon Sep 17 00:00:00 2001 From: mythxb Date: Tue, 22 Aug 2023 17:13:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=A5=E8=81=8C=E6=96=B0=E5=A2=9E=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/rzyc/mapper/OATaskMapper.java | 3 ++ .../rzyc/mapper/user/ListRelationMapper.java | 5 ++ .../src/main/java/com/rzyc/model/OATask.java | 26 ++++++++++ .../main/resources/mapper/OATaskMapper.xml | 8 +++- .../mapper/user/ListRelationMapper.xml | 8 ++++ .../com/rzyc/controller/BaseController.java | 4 ++ .../rzyc/controller/PcPersonalController.java | 47 +++++++++++++++++++ 7 files changed, 100 insertions(+), 1 deletion(-) diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/OATaskMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/OATaskMapper.java index 3eb4bb7..b75cf48 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/OATaskMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/OATaskMapper.java @@ -50,6 +50,9 @@ public interface OATaskMapper extends BaseMapper { /*修改任务完成状态*/ Integer changeIsFinish(@Param("taskIds") List taskIds); + /*修改任务状态*/ + Integer changeTask(@Param("taskId") String taskId); + /*任务详情*/ OATask taskDetail(@Param("taskId") String taskId,@Param("sysUserId") String sysUserId); diff --git a/inventory-dao/src/main/java/com/rzyc/mapper/user/ListRelationMapper.java b/inventory-dao/src/main/java/com/rzyc/mapper/user/ListRelationMapper.java index 5a31af5..c2e13ce 100644 --- a/inventory-dao/src/main/java/com/rzyc/mapper/user/ListRelationMapper.java +++ b/inventory-dao/src/main/java/com/rzyc/mapper/user/ListRelationMapper.java @@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import javax.annotation.Resource; +import java.util.List; /** *

@@ -21,4 +22,8 @@ public interface ListRelationMapper extends BaseMapper { /*删除清单记录关系数据*/ Integer delByTargetId(@Param("targetId") String targetId, @Param("targetType") Integer targetType ); + /*查询履职记录对应的任务、清单列表*/ + List findByDetailId(@Param("detailId") String detailId, + @Param("targetType") Integer targetType); + } diff --git a/inventory-dao/src/main/java/com/rzyc/model/OATask.java b/inventory-dao/src/main/java/com/rzyc/model/OATask.java index 1e6ad71..3e06263 100644 --- a/inventory-dao/src/main/java/com/rzyc/model/OATask.java +++ b/inventory-dao/src/main/java/com/rzyc/model/OATask.java @@ -2,6 +2,7 @@ package com.rzyc.model; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.rzyc.enums.DelState; import io.swagger.annotations.ApiModel; @@ -16,6 +17,7 @@ import java.util.List; * @author */ @ApiModel("任务、待办事项") +@TableName("oatask") public class OATask implements Serializable { @TableId("OATaskId") @@ -159,9 +161,33 @@ public class OATask implements Serializable { @TableField("del_state") private Integer delState; + @TableField(exist = false) @ApiModelProperty("任务接收人") private List distributions = new ArrayList<>(); + @TableField(exist = false) + @ApiModelProperty("清单内容") + private String factorcnt; + + @TableField(exist = false) + @ApiModelProperty("清单id") + private String listfactorid; + + public String getFactorcnt() { + return factorcnt; + } + + public void setFactorcnt(String factorcnt) { + this.factorcnt = factorcnt; + } + + public String getListfactorid() { + return listfactorid; + } + + public void setListfactorid(String listfactorid) { + this.listfactorid = listfactorid; + } public String getFile() { return file; diff --git a/inventory-dao/src/main/resources/mapper/OATaskMapper.xml b/inventory-dao/src/main/resources/mapper/OATaskMapper.xml index e540279..53c7401 100644 --- a/inventory-dao/src/main/resources/mapper/OATaskMapper.xml +++ b/inventory-dao/src/main/resources/mapper/OATaskMapper.xml @@ -20,6 +20,7 @@ + @@ -217,6 +218,11 @@ ) + + + UPDATE `OATask` SET IsFinish = '否' where OATaskId = #{taskId} + + - SELECT ot.*, + SELECT ot.*,lf.FactorCnt, lf.RedAlert,lf.YellowAlert, lf.Frequency totalFrequency FROM `OATask` ot diff --git a/inventory-dao/src/main/resources/mapper/user/ListRelationMapper.xml b/inventory-dao/src/main/resources/mapper/user/ListRelationMapper.xml index 2afda90..7510256 100644 --- a/inventory-dao/src/main/resources/mapper/user/ListRelationMapper.xml +++ b/inventory-dao/src/main/resources/mapper/user/ListRelationMapper.xml @@ -24,4 +24,12 @@ DELETE FROM list_relation WHERE target_id = #{targetId} AND target_type = #{targetType} + + + diff --git a/inventory-gov/src/main/java/com/rzyc/controller/BaseController.java b/inventory-gov/src/main/java/com/rzyc/controller/BaseController.java index 9d25509..ef362ea 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/BaseController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/BaseController.java @@ -1967,6 +1967,10 @@ public class BaseController { * @param oaTask */ protected void handleEndDate(OATask oaTask){ + + //履职id + oaTask.setListfactorid(oaTask.getOtcid()); + if(IsFinish.YES.getFinish().equals(oaTask.getIsfinish())){ if(null == oaTask.getEnddate()){ oaTask.setEnddate(oaTask.getPlanenddate()); diff --git a/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java b/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java index 5847132..d3c15d6 100644 --- a/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java +++ b/inventory-gov/src/main/java/com/rzyc/controller/PcPersonalController.java @@ -1476,6 +1476,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController { @ApiImplicitParam(name = "listdetailid",value = "履职记录id 多个逗号隔开") @PostMapping(value = "delPerformRecord/{listdetailid}") @ResponseBody + @Transactional public SingleResult delPerformRecord(@PathVariable String listdetailid)throws Exception{ SingleResult result = new SingleResult<>(); String[] strs = listdetailid.split(","); @@ -1485,6 +1486,20 @@ public class PcPersonalController extends com.rzyc.controller.BaseController { if(null != listDetail){ String chinaName = getChinaName(); listDetailMapper.changeSelState(listIds, DelState.DELETE.getState(),chinaName); + + //修改任务状态为未完成 + List relations = listRelationMapper.findByDetailId(listDetail.getListdetailid(),ListTargerType.TASK.getType()); + if(null != relations && relations.size() > 0){ + for (ListRelation relation : relations){ + + OATask oaTask = oaTaskMapper.selectById(relation.getTargetId()); + if(null != oaTask){ + //修改任务状态 + taskStateChange(oaTask,listDetail.getListfactorid()); + } + } + } + //修改履职档案完成情况 factorProgres(listDetail.getListfactorid()); } @@ -1492,6 +1507,38 @@ public class PcPersonalController extends com.rzyc.controller.BaseController { return result; } + + /** + * 删除履职清单时 修改任务状态 + * @version v1.0 + * @author dong + * @date 2023/8/22 16:20 + */ + private void taskStateChange(OATask oaTask,String listfactorid)throws Exception{ + Long total = oaTask.getFrequency(); + if(null == total){ + total = 0l; + } + + total = total - 1; + + if(total < 0){ + total = 0l; + } + + + ListFactor listFactor = listFactorMapper.selectByPrimaryKey(oaTask.getOtcid()); + if(null == listFactor.getFrequency()){ + listFactor.setFrequency(1); + } + String isFinsh = "否"; + if(total >= listFactor.getFrequency()){ + isFinsh = "是"; + } + oaTaskMapper.changeFrequency(oaTask.getOataskid(),total,isFinsh); + } + + /** * 未完成的履职任务 * @param factorId