feat: There is no way the task exec
This commit is contained in:
@@ -7,9 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.ydw.bat.wkflow.business_auth.LawsUserInfoService;
|
import com.ydw.bat.wkflow.business_auth.LawsUserInfoService;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.entity.*;
|
import com.ydw.bat.wkflow.business_main.datas.entity.*;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessEntrustService;
|
import com.ydw.bat.wkflow.business_main.datas.service.*;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNameService;
|
|
||||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
|
||||||
import org.activiti.engine.HistoryService;
|
import org.activiti.engine.HistoryService;
|
||||||
import org.activiti.engine.history.HistoricTaskInstance;
|
import org.activiti.engine.history.HistoricTaskInstance;
|
||||||
import org.activiti.engine.history.HistoricTaskInstanceQuery;
|
import org.activiti.engine.history.HistoricTaskInstanceQuery;
|
||||||
@@ -42,20 +40,45 @@ public class TaskController {
|
|||||||
private IBusProcessNameService iBusProcessNameService;
|
private IBusProcessNameService iBusProcessNameService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBusProcessNewService iBusProcessNewService;
|
private IBusProcessNewService iBusProcessNewService;
|
||||||
|
@Autowired
|
||||||
|
private IOaTaskExecService oaTaskExecService;
|
||||||
|
@Autowired
|
||||||
|
private ISendTodoLogService sendTodoLogService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBusProcessEntrustService iBusProcessEntrustService;
|
private IBusProcessEntrustService iBusProcessEntrustService;
|
||||||
|
|
||||||
@ApiOperation(value = "流程实例明细验证是否完成")
|
@ApiOperation(value = "流程实例明细验证是否完成")
|
||||||
@GetMapping("/get_verify_by_instance")
|
@GetMapping("/get_verify_by_instance")
|
||||||
public long get_verify_by_instance(String taskId,String pId) {
|
public Map<String,Object> get_verify_by_instance(String taskId,String pId) {
|
||||||
HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery()
|
Map<String,Object> map = new TreeMap<>();
|
||||||
|
HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery()
|
||||||
.processInstanceId(pId).taskId(taskId).finished();
|
.processInstanceId(pId).taskId(taskId).finished();
|
||||||
List<HistoricTaskInstance> list = historicTaskInstanceQuery.list();
|
List<HistoricTaskInstance> list = historicTaskInstanceQuery.list();
|
||||||
long count = 0;
|
long count = 0;
|
||||||
if(!list.isEmpty()){
|
if(!list.isEmpty()){
|
||||||
count = list.size();
|
count = list.size();
|
||||||
}
|
}
|
||||||
return count;
|
map.put("hisCount",count);
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("TASK_ID",taskId);
|
||||||
|
queryWrapper.eq("P_ID",pId);
|
||||||
|
List<BusProcessNew> list1 = iBusProcessNewService.list(queryWrapper);
|
||||||
|
long count1 = 0;
|
||||||
|
if(!list1.isEmpty()){
|
||||||
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
|
wrapper.eq("TODO_ID",list1.get(0).getId());
|
||||||
|
wrapper.eq("EXEC_TYPE",2);
|
||||||
|
wrapper.eq("EXEC_STATUS",0);
|
||||||
|
count1 = oaTaskExecService.count(wrapper);
|
||||||
|
}
|
||||||
|
map.put("commitStatus",count1);
|
||||||
|
// OA 流程 是否置为 已办 (用于干活流程 接收逻辑)
|
||||||
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
|
wrapper.eq("TODO_ID",list1.get(0).getId());
|
||||||
|
wrapper.eq("MSG_TYPE","1");
|
||||||
|
long count2 = sendTodoLogService.count(wrapper);
|
||||||
|
map.put("isNotFinished",count2);
|
||||||
|
return map;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessEntrustService;
|
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessEntrustService;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNameService;
|
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNameService;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
||||||
|
import com.ydw.bat.wkflow.business_main.datas.service.IOaTaskExecService;
|
||||||
import com.ydw.bat.wkflow.business_mq.service.CreateMQService;
|
import com.ydw.bat.wkflow.business_mq.service.CreateMQService;
|
||||||
import com.ydw.bat.wkflow.business_oa.webService.service.WebServiceOAService;
|
import com.ydw.bat.wkflow.business_oa.webService.service.WebServiceOAService;
|
||||||
import com.ydw.bat.wkflow.business_oa.webService.todoContent.NotifyTodoSendContext;
|
import com.ydw.bat.wkflow.business_oa.webService.todoContent.NotifyTodoSendContext;
|
||||||
@@ -91,6 +92,9 @@ public class TodoTaskController extends BaseAction {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private LawsUserInfoService lawsUserInfoService;
|
private LawsUserInfoService lawsUserInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOaTaskExecService oaTaskExecService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CreateMQService mqService;
|
private CreateMQService mqService;
|
||||||
|
|
||||||
@@ -562,6 +566,12 @@ public class TodoTaskController extends BaseAction {
|
|||||||
JSONArray arr2 = new JSONArray();
|
JSONArray arr2 = new JSONArray();
|
||||||
object3.put("taskBreak", arr2);
|
object3.put("taskBreak", arr2);
|
||||||
processNew.setMesg(object3.toJSONString());
|
processNew.setMesg(object3.toJSONString());
|
||||||
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
|
wrapper.eq("TODO_ID",processNew.getId());
|
||||||
|
wrapper.eq("EXEC_TYPE",2);
|
||||||
|
wrapper.eq("EXEC_STATUS",0);
|
||||||
|
long count = oaTaskExecService.count(wrapper);
|
||||||
|
processNew.setCommitStatus(count);
|
||||||
return processNew;
|
return processNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
@@ -1,10 +1,16 @@
|
|||||||
package com.ydw.bat.wkflow.business_main.datas.controller;
|
package com.ydw.bat.wkflow.business_main.datas.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ydw.bat.wkflow.business_main.datas.service.IOaTaskExecService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* OA 干活任务执行表 前端控制器
|
* OA 干活任务执行表 前端控制器
|
||||||
@@ -17,5 +23,15 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@RequestMapping("/oaTaskExec")
|
@RequestMapping("/oaTaskExec")
|
||||||
public class OaTaskExecController {
|
public class OaTaskExecController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOaTaskExecService oaTaskExecService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "接受任务")
|
||||||
|
@GetMapping("/execTask")
|
||||||
|
public Map<String,Object> execTask(String todoId) {
|
||||||
|
Map<String,Object> map = oaTaskExecService.execTask(todoId);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,10 +101,10 @@ public class BusProcessNew implements Serializable {
|
|||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
@TableField( exist = false)
|
@TableField( exist = false)
|
||||||
@ApiModelProperty(value = "任务状态 1 审批任务 2 干活任务")
|
@ApiModelProperty(value = "任务状态 0 默认 1 审批任务 2 干活任务")
|
||||||
private int taskStatus;
|
private int taskStatus;
|
||||||
|
|
||||||
@TableField( exist = false)
|
@TableField( exist = false)
|
||||||
@ApiModelProperty(value = "维度 1 3天内 2 3天外")
|
@ApiModelProperty(value = "提交状态 0 提交 其它 接受 ")
|
||||||
private int execType;
|
private long commitStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ydw.bat.wkflow.business_main.datas.entity;
|
package com.ydw.bat.wkflow.business_main.datas.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
@@ -30,10 +31,10 @@ public class OaTaskExec implements Serializable {
|
|||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键")
|
@ApiModelProperty(value = "主键")
|
||||||
@TableId("ID")
|
@TableId(value = "ID", type = IdType.UUID)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "执行维度 1 3天内 2 3天外")
|
@ApiModelProperty(value = "执行维度 1 3天内 2 3天外 3 超时")
|
||||||
@TableField("EXEC_TYPE")
|
@TableField("EXEC_TYPE")
|
||||||
private int execType;
|
private int execType;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.ydw.bat.wkflow.business_main.datas.service;
|
|||||||
import com.ydw.bat.wkflow.business_main.datas.entity.OaTaskExec;
|
import com.ydw.bat.wkflow.business_main.datas.entity.OaTaskExec;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* OA 干活任务执行表 服务类
|
* OA 干活任务执行表 服务类
|
||||||
@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
*/
|
*/
|
||||||
public interface IOaTaskExecService extends IService<OaTaskExec> {
|
public interface IOaTaskExecService extends IService<OaTaskExec> {
|
||||||
|
|
||||||
|
Map<String,Object> execTask(String todoId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+60
@@ -1,11 +1,21 @@
|
|||||||
package com.ydw.bat.wkflow.business_main.datas.service.impl;
|
package com.ydw.bat.wkflow.business_main.datas.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessNew;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.entity.OaTaskExec;
|
import com.ydw.bat.wkflow.business_main.datas.entity.OaTaskExec;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.mapper.OaTaskExecMapper;
|
import com.ydw.bat.wkflow.business_main.datas.mapper.OaTaskExecMapper;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.service.IOaTaskExecService;
|
import com.ydw.bat.wkflow.business_main.datas.service.IOaTaskExecService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ydw.bat.wkflow.business_mq.service.CreateMQService;
|
||||||
|
import com.ydw.bat.wkflow.util.Utils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* OA 干活任务执行表 服务实现类
|
* OA 干活任务执行表 服务实现类
|
||||||
@@ -17,4 +27,54 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class OaTaskExecServiceImpl extends ServiceImpl<OaTaskExecMapper, OaTaskExec> implements IOaTaskExecService {
|
public class OaTaskExecServiceImpl extends ServiceImpl<OaTaskExecMapper, OaTaskExec> implements IOaTaskExecService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IOaTaskExecService oaTaskExecService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CreateMQService oaService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String,Object> execTask(String todoId){
|
||||||
|
Map<String,Object> map = new TreeMap<>();
|
||||||
|
QueryWrapper wrapper = new QueryWrapper();
|
||||||
|
wrapper.eq("TODO_ID",todoId);
|
||||||
|
wrapper.eq("EXEC_TYPE",2);
|
||||||
|
List<OaTaskExec> taskExecs = oaTaskExecService.list(wrapper);
|
||||||
|
if(!taskExecs.isEmpty()){
|
||||||
|
OaTaskExec oaTaskExec = taskExecs.get(0);
|
||||||
|
BusProcessNew object = (BusProcessNew) net.sf.json.JSONObject.toBean(net.sf.json.JSONObject.fromObject(oaTaskExec.getMesg()), BusProcessNew.class);
|
||||||
|
|
||||||
|
int days = Utils.subDayNum(oaTaskExec.getEndTime());
|
||||||
|
if(days > 3){
|
||||||
|
// 3天外处理 更改执行状态 1 进入定时任务 不发送OA待办
|
||||||
|
// ????? 待
|
||||||
|
updateOaTaskExec(taskExecs,1,2);
|
||||||
|
}else {
|
||||||
|
if(days < 0){
|
||||||
|
// 超时处理
|
||||||
|
updateOaTaskExec(taskExecs,0,3);
|
||||||
|
// 直接发送OA待办 重置任务状态 0
|
||||||
|
object.setTaskStatus(0);
|
||||||
|
oaService.sendTodoMq(object);
|
||||||
|
}else {
|
||||||
|
// 3天内处理
|
||||||
|
updateOaTaskExec(taskExecs,0,1);
|
||||||
|
// 直接发送OA待办 重置任务状态 0
|
||||||
|
object.setTaskStatus(0);
|
||||||
|
oaService.sendTodoMq(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateOaTaskExec(List<OaTaskExec> taskExecs, int execStatus, int execType){
|
||||||
|
taskExecs.forEach(taskExec -> {
|
||||||
|
// 任务修改为 启动状态
|
||||||
|
taskExec.setExecStatus(execStatus);
|
||||||
|
taskExec.setExecType(execType);
|
||||||
|
});
|
||||||
|
oaTaskExecService.updateBatchById(taskExecs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.ydw.bat.wkflow.business_oa.webService.todoContent.NotifyTodoSendConte
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.amqp.core.AmqpTemplate;
|
import org.springframework.amqp.core.AmqpTemplate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -16,14 +17,20 @@ public class CreateMQService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AmqpTemplate rabbitTemplate;
|
private AmqpTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
@Value("${oa.flag}")
|
||||||
|
private Boolean oaFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author: super_liu
|
* @author: super_liu
|
||||||
* @date: 2021年09月17日 14:40
|
* @date: 2021年09月17日 14:40
|
||||||
**/
|
**/
|
||||||
public void setTodoDoneMq(NotifyTodoSendContext object){
|
public void setTodoDoneMq(NotifyTodoSendContext object){
|
||||||
|
|
||||||
//发送消息队列
|
if(oaFlag){
|
||||||
this.rabbitTemplate.convertAndSend("sendDone-exchange_MQ_GSAR", "sendDone-key_MQ_GSAR", object);
|
//发送消息队列
|
||||||
|
this.rabbitTemplate.convertAndSend("sendDone-exchange_MQ_GSAR", "sendDone-key_MQ_GSAR", object);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,8 +39,10 @@ public class CreateMQService {
|
|||||||
**/
|
**/
|
||||||
public void sendTodoMq(BusProcessNew object){
|
public void sendTodoMq(BusProcessNew object){
|
||||||
|
|
||||||
//发送消息队列
|
if(oaFlag) {
|
||||||
this.rabbitTemplate.convertAndSend("send-exchange_MQ_GSAR", "send-key_MQ_GSAR", object);
|
//发送消息队列
|
||||||
|
this.rabbitTemplate.convertAndSend("send-exchange_MQ_GSAR", "send-key_MQ_GSAR", object);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.ydw.bat.wkflow.business_main.datas.service.IOaTaskExecService;
|
|||||||
import com.ydw.bat.wkflow.business_oa.utils.EmailUtils;
|
import com.ydw.bat.wkflow.business_oa.utils.EmailUtils;
|
||||||
import com.ydw.bat.wkflow.business_oa.webService.service.WebServiceOAService;
|
import com.ydw.bat.wkflow.business_oa.webService.service.WebServiceOAService;
|
||||||
import com.ydw.bat.wkflow.business_oa.webService.todoResult.NotifyTodoAppResult;
|
import com.ydw.bat.wkflow.business_oa.webService.todoResult.NotifyTodoAppResult;
|
||||||
|
import com.ydw.bat.wkflow.util.Utils;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||||
@@ -63,19 +64,30 @@ public class SendMQService {
|
|||||||
try{
|
try{
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
if(object.getTaskStatus() == 2 && object.getEndTime() != null && StringUtils.isNotBlank(object.getEndTime())){
|
if(object.getTaskStatus() == 2 && object.getEndTime() != null && StringUtils.isNotBlank(object.getEndTime())){
|
||||||
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||||
LocalDate startDate = LocalDate.parse(new SimpleDateFormat("yyyy-MM-dd").format(new Date()),fmt);
|
int days = Utils.subDayNum(object.getEndTime());
|
||||||
LocalDate endDate = LocalDate.parse(object.getEndTime(),fmt);
|
|
||||||
int days = (int) startDate.until(endDate, ChronoUnit.DAYS);
|
|
||||||
// 3 天 外
|
// 3 天 外
|
||||||
if(days > 3){
|
if(days > 3){
|
||||||
// 待
|
// 执行日期
|
||||||
|
String execTime = Utils.subDay(object.getEndTime(),3);
|
||||||
|
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(object);
|
||||||
|
|
||||||
|
// 执行任务对象 默认存储
|
||||||
OaTaskExec oaTaskExec = new OaTaskExec();
|
OaTaskExec oaTaskExec = new OaTaskExec();
|
||||||
oaTaskExec.setExecType(2);
|
oaTaskExec.setExecType(2);
|
||||||
|
oaTaskExec.setTodoId(object.getId());
|
||||||
|
oaTaskExec.setUserId(object.getUserId());
|
||||||
|
oaTaskExec.setMesg(json.toString());
|
||||||
oaTaskExec.setCreateTime(sdf.format(new Date()));
|
oaTaskExec.setCreateTime(sdf.format(new Date()));
|
||||||
oaTaskExec.setUpdateTime(sdf.format(new Date()));
|
oaTaskExec.setUpdateTime(sdf.format(new Date()));
|
||||||
|
oaTaskExec.setExecTime(execTime);
|
||||||
|
oaTaskExec.setEndTime(object.getEndTime());
|
||||||
|
oaTaskExec.setExecStatus(0);
|
||||||
oaTaskExecService.save(oaTaskExec);
|
oaTaskExecService.save(oaTaskExec);
|
||||||
|
object.setPrcName(object.getPrcName()+",请接受任务!");
|
||||||
|
|
||||||
|
// 3 天 外 发送 OA 接受待办
|
||||||
|
insertOrUpdateInfo(object);
|
||||||
}else {
|
}else {
|
||||||
// 3 天 内 发送 OA 待办
|
// 3 天 内 发送 OA 待办
|
||||||
insertOrUpdateInfo(object);
|
insertOrUpdateInfo(object);
|
||||||
|
|||||||
+6
@@ -1,10 +1,12 @@
|
|||||||
package com.ydw.bat.wkflow.listener.StandardCommentProcess;
|
package com.ydw.bat.wkflow.listener.StandardCommentProcess;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessNew;
|
import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessNew;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
||||||
import com.ydw.bat.wkflow.business_mq.service.CreateMQService;
|
import com.ydw.bat.wkflow.business_mq.service.CreateMQService;
|
||||||
import com.ydw.bat.wkflow.util.SpringContextUtil;
|
import com.ydw.bat.wkflow.util.SpringContextUtil;
|
||||||
|
import com.ydw.bat.wkflow.util.Utils;
|
||||||
import org.activiti.engine.delegate.DelegateTask;
|
import org.activiti.engine.delegate.DelegateTask;
|
||||||
import org.activiti.engine.delegate.TaskListener;
|
import org.activiti.engine.delegate.TaskListener;
|
||||||
|
|
||||||
@@ -28,8 +30,12 @@ public class UploadResearchResultBefore implements TaskListener {
|
|||||||
busBean.saveOrUpdate(one1);
|
busBean.saveOrUpdate(one1);
|
||||||
|
|
||||||
// 发送 oa 待办 设置 跳转页面 router ? 后面流程类型
|
// 发送 oa 待办 设置 跳转页面 router ? 后面流程类型
|
||||||
|
JSONObject object = JSONObject.parseObject(one1.getMesg());
|
||||||
one1.setLink("bzzqyjStep3?prcType=3");
|
one1.setLink("bzzqyjStep3?prcType=3");
|
||||||
one1.setTaskInfo(delegateTask.getName());
|
one1.setTaskInfo(delegateTask.getName());
|
||||||
|
// 干活节点流程
|
||||||
|
one1.setTaskStatus(2);
|
||||||
|
one1.setEndTime(Utils.interceptTime(object.getString("endTime")));
|
||||||
oaService.sendTodoMq(one1);
|
oaService.sendTodoMq(one1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -1,10 +1,12 @@
|
|||||||
package com.ydw.bat.wkflow.listener.projectEvaluationProcess;
|
package com.ydw.bat.wkflow.listener.projectEvaluationProcess;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessNew;
|
import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessNew;
|
||||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
||||||
import com.ydw.bat.wkflow.business_mq.service.CreateMQService;
|
import com.ydw.bat.wkflow.business_mq.service.CreateMQService;
|
||||||
import com.ydw.bat.wkflow.util.SpringContextUtil;
|
import com.ydw.bat.wkflow.util.SpringContextUtil;
|
||||||
|
import com.ydw.bat.wkflow.util.Utils;
|
||||||
import org.activiti.engine.delegate.DelegateTask;
|
import org.activiti.engine.delegate.DelegateTask;
|
||||||
import org.activiti.engine.delegate.TaskListener;
|
import org.activiti.engine.delegate.TaskListener;
|
||||||
|
|
||||||
@@ -28,8 +30,12 @@ public class PEPtaskLssueBefore implements TaskListener {
|
|||||||
busBean.saveOrUpdate(one1);
|
busBean.saveOrUpdate(one1);
|
||||||
|
|
||||||
// 发送 oa 待办 设置 跳转页面 router ? 后面流程类型
|
// 发送 oa 待办 设置 跳转页面 router ? 后面流程类型
|
||||||
|
JSONObject object = JSONObject.parseObject(one1.getMesg());
|
||||||
one1.setLink("xmpgStep3?prcType=5");
|
one1.setLink("xmpgStep3?prcType=5");
|
||||||
one1.setTaskInfo(delegateTask.getName());
|
one1.setTaskInfo(delegateTask.getName());
|
||||||
|
// 干活节点流程
|
||||||
|
one1.setTaskStatus(2);
|
||||||
|
one1.setEndTime(Utils.interceptTime(object.getString("endTime")));
|
||||||
oaService.sendTodoMq(one1);
|
oaService.sendTodoMq(one1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,16 @@ package com.ydw.bat.wkflow.util;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.text.ParseException;
|
||||||
import java.util.HashMap;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.time.LocalDate;
|
||||||
import java.util.Map;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: TODO
|
* @Description: TODO
|
||||||
@@ -15,6 +20,49 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public class Utils {
|
public class Utils {
|
||||||
|
|
||||||
|
public static int subDayNum(String endTime){
|
||||||
|
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
LocalDate startDate = LocalDate.parse(new SimpleDateFormat("yyyy-MM-dd").format(new Date()),fmt);
|
||||||
|
LocalDate endDate = LocalDate.parse(endTime,fmt);
|
||||||
|
int days = (int) startDate.until(endDate, ChronoUnit.DAYS);
|
||||||
|
return days;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String interceptTime(String timeStr) {
|
||||||
|
if (StringUtils.isNotBlank(timeStr)) {
|
||||||
|
System.out.println(timeStr.length());
|
||||||
|
if (timeStr.contains("T")) {
|
||||||
|
DateTimeFormatter df20 = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.ENGLISH);
|
||||||
|
DateTimeFormatter df24 = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH);
|
||||||
|
LocalDateTime ldt = LocalDateTime.parse(timeStr, timeStr.length() > 20 ? df24:df20);
|
||||||
|
ZoneId currentZone = ZoneId.of("UTC");
|
||||||
|
ZoneId newZone = ZoneId.of("Asia/Shanghai");
|
||||||
|
timeStr = ldt.atZone(currentZone).withZoneSameInstant(newZone).toLocalDateTime().toString();
|
||||||
|
}
|
||||||
|
if (timeStr.length() >= 10) {
|
||||||
|
return timeStr.substring(0, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return timeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String subDay(String date, Integer dayInt) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date today = null;
|
||||||
|
try {
|
||||||
|
today = sdf.parse(date);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
}
|
||||||
|
String endDate = sdf.format(today);//当前日期
|
||||||
|
Calendar theCa = Calendar.getInstance();
|
||||||
|
theCa.setTime(today);
|
||||||
|
theCa.add(theCa.DATE, -dayInt);//最后一个数字30可改,30天的意思
|
||||||
|
Date start = theCa.getTime();
|
||||||
|
String startDate = sdf.format(start);//三十天之前日期
|
||||||
|
|
||||||
|
return startDate;
|
||||||
|
}
|
||||||
|
|
||||||
public static Map<String, JSONArray> jsonArrGroup(JSONArray arr, String groupName, String sGroupName) {
|
public static Map<String, JSONArray> jsonArrGroup(JSONArray arr, String groupName, String sGroupName) {
|
||||||
Map<String, JSONArray> map = new HashMap<>();
|
Map<String, JSONArray> map = new HashMap<>();
|
||||||
String tempIdStr = "";
|
String tempIdStr = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user