yxk-20260714
改造抄送模块,将我的抄送拆分为:我的待阅和我的已阅 - 抄送记录新增阅读状态和已阅时间字段 - 新建抄送任务默认初始化为待阅 - 新增抄送记录标记已阅接口,并校验仅接收人可操作 - 我的抄送列表支持按待阅/已阅状态过滤 - 查询结果补充抄送记录ID、阅读状态、已阅时间 - 新增数据库升级脚本,拆分“我的待阅”“我的已阅”菜单并同步权限
This commit is contained in:
+9
@@ -52,6 +52,15 @@ public class TaskDTO implements java.io.Serializable {
|
||||
/** 流程取消原因*/
|
||||
private String processDeleteReason;
|
||||
|
||||
/** 抄送记录ID,用于标记已阅;历史任务详情仍使用 id */
|
||||
private String ccId;
|
||||
/** 抄送阅读状态:0-待阅,1-已阅 */
|
||||
private Integer isRead;
|
||||
/** 抄送已阅时间 */
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date readTime;
|
||||
|
||||
|
||||
/** 业务标题*/
|
||||
private String bpmBizTitle;
|
||||
|
||||
+2
-1
@@ -81,7 +81,8 @@ public interface ActivitiMapper extends BaseMapper {
|
||||
@Param("processDefinitionName") String processDefinitionName,
|
||||
@Param("executionIdList") List<String> executionIdList,
|
||||
@Param("processInstanceIds") List<String> processInstanceIds,
|
||||
@Param("processKeyList") List<String> processKeyList);
|
||||
@Param("processKeyList") List<String> processKeyList,
|
||||
@Param("isRead") Integer isRead);
|
||||
|
||||
/**
|
||||
* 查询流程的历史任务节点
|
||||
|
||||
+9
@@ -16,6 +16,9 @@
|
||||
<result column="taskId" property="taskId" jdbcType="VARCHAR"/>
|
||||
<result column="processEndTime" property="processEndTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="processDeleteReason" property="processDeleteReason" jdbcType="VARCHAR"/>
|
||||
<result column="ccId" property="ccId" jdbcType="VARCHAR"/>
|
||||
<result column="isRead" property="isRead" jdbcType="INTEGER"/>
|
||||
<result column="readTime" property="readTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ActTaskCcDTO" type="org.jeecg.modules.bpm.dto.ActTaskCcDTO" >
|
||||
@@ -158,6 +161,9 @@
|
||||
,aht.END_TIME_ AS taskEndTime
|
||||
,aht.DURATION_ AS taskDueTime
|
||||
,aht.TASK_DEF_KEY_ AS taskId
|
||||
,cc.ID AS ccId
|
||||
,cc.IS_READ AS isRead
|
||||
,cc.READ_TIME AS readTime
|
||||
FROM ACT_HI_TASKINST aht,
|
||||
EXT_ACT_TASK_CC cc,
|
||||
ACT_RE_PROCDEF arp,
|
||||
@@ -169,6 +175,9 @@
|
||||
and aht.PROC_INST_ID_ = ahp.id_
|
||||
and aht.DURATION_ >0
|
||||
and cc.CC_USER_NAME = #{ccUserName}
|
||||
<if test="isRead != null">
|
||||
and cc.IS_READ = #{isRead}
|
||||
</if>
|
||||
<if test="processKeyList!= null and processKeyList.size()>0">
|
||||
AND arp.KEY_ IN
|
||||
<foreach item="item" collection="processKeyList" open="(" separator="," close=")">
|
||||
|
||||
+7
-1
@@ -874,8 +874,14 @@ public class ActivitiServiceImpl implements ActivitiService {
|
||||
}
|
||||
}
|
||||
//------------根据流程的业务标题查询数据-----------------------------------------------------------------------------------------------
|
||||
Integer isRead = null;
|
||||
String isReadParam = request.getParameter("isRead");
|
||||
// 我的待阅/已阅共用同一查询接口,仅接受 0/1,避免异常参数改变原有抄送列表行为。
|
||||
if ("0".equals(isReadParam) || "1".equals(isReadParam)) {
|
||||
isRead = Integer.valueOf(isReadParam);
|
||||
}
|
||||
long start2 = System.currentTimeMillis();
|
||||
List<TaskDTO> result = activitiMapper.getAllCcHistoryTasks(page,username,procDefId, procName,null ,processInstanceIds,processKeyList);
|
||||
List<TaskDTO> result = activitiMapper.getAllCcHistoryTasks(page,username,procDefId, procName,null ,processInstanceIds,processKeyList,isRead);
|
||||
|
||||
long end4 = System.currentTimeMillis();
|
||||
log.info("3 【我的抄送任务】查询 getAllCcHistoryTasks 消耗时间" + (end4 - start2) + "毫秒");
|
||||
|
||||
+45
@@ -1,10 +1,12 @@
|
||||
package org.jeecg.modules.extbpm.process.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.SqlInjectionUtil;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.extbpm.process.entity.ExtActTaskCc;
|
||||
@@ -154,6 +156,49 @@ public class ExtActTaskCcController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记抄送记录为已阅,仅允许该抄送记录的接收人操作。
|
||||
* @param id 抄送记录ID
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/read")
|
||||
public Result<ExtActTaskCc> read(@RequestParam(name="id",required=true) String id, HttpServletRequest request) {
|
||||
Result<ExtActTaskCc> result = new Result<ExtActTaskCc>();
|
||||
if (oConvertUtils.isEmpty(id)) {
|
||||
result.error500("参数不识别!");
|
||||
return result;
|
||||
}
|
||||
ExtActTaskCc extActTaskCc = extActTaskCcService.getById(id);
|
||||
if(extActTaskCc==null) {
|
||||
result.error500("未找到对应实体");
|
||||
return result;
|
||||
}
|
||||
String username = JwtUtil.getUserNameByToken(request);
|
||||
if (oConvertUtils.isEmpty(username) || !username.equals(extActTaskCc.getCcUserName())) {
|
||||
result.error500("无权限操作该抄送记录");
|
||||
return result;
|
||||
}
|
||||
if (Integer.valueOf(1).equals(extActTaskCc.getIsRead())) {
|
||||
result.setResult(extActTaskCc);
|
||||
result.success("已阅成功!");
|
||||
return result;
|
||||
}
|
||||
Date now = new Date();
|
||||
extActTaskCc.setIsRead(1);
|
||||
extActTaskCc.setReadTime(now);
|
||||
extActTaskCc.setUpdateBy(username);
|
||||
extActTaskCc.setUpdateTime(now);
|
||||
boolean ok = extActTaskCcService.updateById(extActTaskCc);
|
||||
if(ok) {
|
||||
result.setResult(extActTaskCc);
|
||||
result.success("已阅成功!");
|
||||
} else {
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
|
||||
+6
@@ -39,6 +39,12 @@ public class ExtActTaskCc implements Serializable {
|
||||
private java.lang.String fromUserName;
|
||||
/**任务抄送人员*/
|
||||
private java.lang.String ccUserName;
|
||||
/**是否已阅:0-待阅,1-已阅*/
|
||||
private java.lang.Integer isRead;
|
||||
/**已阅时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date readTime;
|
||||
/**创建人登录名称*/
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
|
||||
+1
@@ -510,6 +510,7 @@ public class ExtActBpmLogServiceImpl extends ServiceImpl<ExtActBpmLogMapper, Ext
|
||||
taskCcEntity.setTaskName(task.getName());
|
||||
taskCcEntity.setFromUserName(username);
|
||||
taskCcEntity.setCcUserName(ccUserName);
|
||||
taskCcEntity.setIsRead(0);
|
||||
extActTaskCcMapper.insert(taskCcEntity);
|
||||
this.ccNotice(username, taskCcEntity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user