履职新增问题处理
This commit is contained in:
parent
e9571c97f0
commit
248166ea2d
|
|
@ -50,6 +50,9 @@ public interface OATaskMapper extends BaseMapper<OATask> {
|
||||||
/*修改任务完成状态*/
|
/*修改任务完成状态*/
|
||||||
Integer changeIsFinish(@Param("taskIds") List<String> taskIds);
|
Integer changeIsFinish(@Param("taskIds") List<String> taskIds);
|
||||||
|
|
||||||
|
/*修改任务状态*/
|
||||||
|
Integer changeTask(@Param("taskId") String taskId);
|
||||||
|
|
||||||
/*任务详情*/
|
/*任务详情*/
|
||||||
OATask taskDetail(@Param("taskId") String taskId,@Param("sysUserId") String sysUserId);
|
OATask taskDetail(@Param("taskId") String taskId,@Param("sysUserId") String sysUserId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -21,4 +22,8 @@ public interface ListRelationMapper extends BaseMapper<ListRelation> {
|
||||||
/*删除清单记录关系数据*/
|
/*删除清单记录关系数据*/
|
||||||
Integer delByTargetId(@Param("targetId") String targetId, @Param("targetType") Integer targetType );
|
Integer delByTargetId(@Param("targetId") String targetId, @Param("targetType") Integer targetType );
|
||||||
|
|
||||||
|
/*查询履职记录对应的任务、清单列表*/
|
||||||
|
List<ListRelation> findByDetailId(@Param("detailId") String detailId,
|
||||||
|
@Param("targetType") Integer targetType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.rzyc.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.rzyc.enums.DelState;
|
import com.rzyc.enums.DelState;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
|
@ -16,6 +17,7 @@ import java.util.List;
|
||||||
* @author
|
* @author
|
||||||
*/
|
*/
|
||||||
@ApiModel("任务、待办事项")
|
@ApiModel("任务、待办事项")
|
||||||
|
@TableName("oatask")
|
||||||
public class OATask implements Serializable {
|
public class OATask implements Serializable {
|
||||||
|
|
||||||
@TableId("OATaskId")
|
@TableId("OATaskId")
|
||||||
|
|
@ -159,9 +161,33 @@ public class OATask implements Serializable {
|
||||||
@TableField("del_state")
|
@TableField("del_state")
|
||||||
private Integer delState;
|
private Integer delState;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
@ApiModelProperty("任务接收人")
|
@ApiModelProperty("任务接收人")
|
||||||
private List<OADistribution> distributions = new ArrayList<>();
|
private List<OADistribution> 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() {
|
public String getFile() {
|
||||||
return file;
|
return file;
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
|
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
|
||||||
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
|
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
|
||||||
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
|
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
|
||||||
|
<result column="FactorCnt" jdbcType="VARCHAR" property="factorcnt" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -217,6 +218,11 @@
|
||||||
)
|
)
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!--修改任务状态-->
|
||||||
|
<update id="changeTask">
|
||||||
|
UPDATE `OATask` SET IsFinish = '否' where OATaskId = #{taskId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<!--任务详情-->
|
<!--任务详情-->
|
||||||
<select id="taskDetail" resultMap="TaskResultMap">
|
<select id="taskDetail" resultMap="TaskResultMap">
|
||||||
SELECT ob.`AppStatus` taskStatus,ot.* FROM OATask ot
|
SELECT ob.`AppStatus` taskStatus,ot.* FROM OATask ot
|
||||||
|
|
@ -319,7 +325,7 @@
|
||||||
|
|
||||||
<!--需完成的任务列-->
|
<!--需完成的任务列-->
|
||||||
<select id="findByListPerformId" resultMap="BaseResultMap">
|
<select id="findByListPerformId" resultMap="BaseResultMap">
|
||||||
SELECT ot.*,
|
SELECT ot.*,lf.FactorCnt,
|
||||||
lf.RedAlert,lf.YellowAlert,
|
lf.RedAlert,lf.YellowAlert,
|
||||||
lf.Frequency totalFrequency
|
lf.Frequency totalFrequency
|
||||||
FROM `OATask` ot
|
FROM `OATask` ot
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,12 @@
|
||||||
DELETE FROM list_relation WHERE target_id = #{targetId} AND target_type = #{targetType}
|
DELETE FROM list_relation WHERE target_id = #{targetId} AND target_type = #{targetType}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<!--查询履职记录对应的任务、清单列表-->
|
||||||
|
<select id="findByDetailId" resultMap="BaseResultMap">
|
||||||
|
SELECT *
|
||||||
|
FROM `list_relation` lr
|
||||||
|
WHERE lr.`detail_id` = #{detailId}
|
||||||
|
and lr.target_type = #{targetType}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -1967,6 +1967,10 @@ public class BaseController {
|
||||||
* @param oaTask
|
* @param oaTask
|
||||||
*/
|
*/
|
||||||
protected void handleEndDate(OATask oaTask){
|
protected void handleEndDate(OATask oaTask){
|
||||||
|
|
||||||
|
//履职id
|
||||||
|
oaTask.setListfactorid(oaTask.getOtcid());
|
||||||
|
|
||||||
if(IsFinish.YES.getFinish().equals(oaTask.getIsfinish())){
|
if(IsFinish.YES.getFinish().equals(oaTask.getIsfinish())){
|
||||||
if(null == oaTask.getEnddate()){
|
if(null == oaTask.getEnddate()){
|
||||||
oaTask.setEnddate(oaTask.getPlanenddate());
|
oaTask.setEnddate(oaTask.getPlanenddate());
|
||||||
|
|
|
||||||
|
|
@ -1476,6 +1476,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
||||||
@ApiImplicitParam(name = "listdetailid",value = "履职记录id 多个逗号隔开")
|
@ApiImplicitParam(name = "listdetailid",value = "履职记录id 多个逗号隔开")
|
||||||
@PostMapping(value = "delPerformRecord/{listdetailid}")
|
@PostMapping(value = "delPerformRecord/{listdetailid}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@Transactional
|
||||||
public SingleResult<String> delPerformRecord(@PathVariable String listdetailid)throws Exception{
|
public SingleResult<String> delPerformRecord(@PathVariable String listdetailid)throws Exception{
|
||||||
SingleResult<String> result = new SingleResult<>();
|
SingleResult<String> result = new SingleResult<>();
|
||||||
String[] strs = listdetailid.split(",");
|
String[] strs = listdetailid.split(",");
|
||||||
|
|
@ -1485,6 +1486,20 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
||||||
if(null != listDetail){
|
if(null != listDetail){
|
||||||
String chinaName = getChinaName();
|
String chinaName = getChinaName();
|
||||||
listDetailMapper.changeSelState(listIds, DelState.DELETE.getState(),chinaName);
|
listDetailMapper.changeSelState(listIds, DelState.DELETE.getState(),chinaName);
|
||||||
|
|
||||||
|
//修改任务状态为未完成
|
||||||
|
List<ListRelation> 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());
|
factorProgres(listDetail.getListfactorid());
|
||||||
}
|
}
|
||||||
|
|
@ -1492,6 +1507,38 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
||||||
return result;
|
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
|
* @param factorId
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user