174-OA待办修改
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE `es_prc_relation` (
|
||||
`id` varchar(32) NOT NULL,
|
||||
`es_id` varchar(32) DEFAULT NULL COMMENT '企标计划ID',
|
||||
`prc_id` varchar(33) DEFAULT NULL COMMENT '企标制修订技术标准流程实例ID',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`oa_flag` varchar(2) DEFAULT NULL COMMENT 'OA待办标识 0-已办,1-待办',
|
||||
`prc_id_gk` varchar(33) DEFAULT NULL COMMENT '企标计划管控流程的实例ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='企标计划和企标制修订流程关联表';
|
||||
@@ -211,16 +211,6 @@ public interface LawsUserInfoService {
|
||||
@PostMapping(value = "/lawss/NewsFeed/insertNewsFeed")
|
||||
public ResponseMessage<Object> insertNewsFeed(NewsFeed newsFeed);
|
||||
|
||||
|
||||
@GetMapping("/esRevisePlan/es-revise-plan/listEsPrcRelationByWk")
|
||||
public ResponseMessage<Object> listEsPrcRelation(@RequestParam("esId") String esId);
|
||||
|
||||
@PostMapping("/esRevisePlan/es-revise-plan/addEsPrcRelationByWk")
|
||||
public ResponseMessage<Object> addEsPrcRelation(@RequestBody EsPrcRelationDTO esPrcRelationDTO);
|
||||
|
||||
@PostMapping("/esRevisePlan/es-revise-plan/modEsPrcRelationByWk")
|
||||
public ResponseMessage<Object> modEsPrcRelation(@RequestBody EsPrcRelationDTO esPrcRelationDTO);
|
||||
|
||||
@GetMapping("/esRevisePlan/es-revise-plan/delEsPrcRelationByWk")
|
||||
public ResponseMessage<Object> delEsPrcRelation(@RequestParam("esId") String esId);
|
||||
@GetMapping("/esRevisePlan/es-revise-plan/getAllPlansByWk")
|
||||
public List<EsRevisePlanDTO> getAllPlansByWk();
|
||||
}
|
||||
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
package com.ydw.bat.wkflow.business_main.datas.controller;
|
||||
|
||||
import com.ydw.bat.wkflow.business_auth.LawsUserInfoService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.EsPrcRelation;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.EsRevisePlanDTO;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IEsPrcRelationService;
|
||||
import com.ydw.bat.wkflow.business_oa.webService.service.WebServiceOAService;
|
||||
import com.ydw.bat.wkflow.util.SpringContextUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(description = "管控流程接受任务")
|
||||
@RestController
|
||||
@RequestMapping("/esPrcRelation")
|
||||
public class EsPrcRelationController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(EsPrcRelationController.class);
|
||||
|
||||
@Value("${oa.flag}")
|
||||
private Boolean OAFlag;
|
||||
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
@Autowired
|
||||
private IEsPrcRelationService esPrcRelationService;
|
||||
@Autowired
|
||||
private WebServiceOAService webServiceOAService;
|
||||
|
||||
@ApiOperation(value = "接受任务")
|
||||
@GetMapping("/acceptTask")
|
||||
public Integer acceptTack(String nowEsId, String oaFlag, String taskId) {
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
if(task!=null) {
|
||||
//发送OA已办
|
||||
try {
|
||||
if (OAFlag) {
|
||||
//发送OA已办
|
||||
webServiceOAService.completeOA(task);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return esPrcRelationService.modifyEsPrcRelation(nowEsId, null, oaFlag, null);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "定时任务调试")
|
||||
@GetMapping("/testAcceptTack")
|
||||
public String testAcceptTack() {
|
||||
LawsUserInfoService lawsUserInfoService = SpringContextUtil.getBean(LawsUserInfoService.class);
|
||||
IEsPrcRelationService esPrcRelationService = SpringContextUtil.getBean(IEsPrcRelationService.class);
|
||||
TaskService taskService = SpringContextUtil.getBean(TaskService.class);
|
||||
|
||||
List<EsRevisePlanDTO> esRevisePlanDTOList = lawsUserInfoService.getAllPlansByWk(); // 查询 制定中,修订中的企标计划
|
||||
// 计划标准初稿时间前一个月的企标计划
|
||||
SimpleDateFormat sdfQuery = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MONTH, -1);
|
||||
String endDate = sdfQuery.format(calendar.getTime());
|
||||
List<EsRevisePlanDTO> esRevisePlanDTOList2 = esRevisePlanDTOList.stream()
|
||||
.filter(e -> !ObjectUtils.isEmpty(e.getDraftTime()) && endDate.equals(sdfQuery.format(e.getDraftTime())))
|
||||
.collect(Collectors.toList());
|
||||
if (!esRevisePlanDTOList2.isEmpty()) {
|
||||
for (EsRevisePlanDTO esRevisePlanDTO : esRevisePlanDTOList2) {
|
||||
List<EsPrcRelation> esPrcRelationList = esPrcRelationService.list(esRevisePlanDTO.getId());
|
||||
if (esPrcRelationList.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
String esId = esPrcRelationList.get(0).getEsId();
|
||||
String prcIdGk = esPrcRelationList.get(0).getPrcIdGk();
|
||||
String oaFlag = esPrcRelationList.get(0).getOaFlag();
|
||||
// 判断对应 管控流程是否还在 技术标准起草节点, 且之前点过接受任务
|
||||
if (StringUtils.isNotBlank(prcIdGk)) {
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(prcIdGk).active().list();
|
||||
if (!list2.isEmpty()) {
|
||||
String nowTaskInfo = list2.get(0).getName();
|
||||
if ("技术标准起草".equals(nowTaskInfo) && "0".equals(oaFlag)) {
|
||||
// 再次发送待办
|
||||
logger.info("============再次发送待办,企标计划" + esRevisePlanDTO.getEsName() +"===========");
|
||||
// sendOATodo(list2.get(0));
|
||||
|
||||
// 更新 状态为待办
|
||||
esPrcRelationService.modifyEsPrcRelation(esId, null, "1", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "定时任务完成";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.ydw.bat.wkflow.business_main.datas.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="EsPrcRelation对象", description="企标计划和技术标准流程关联表")
|
||||
public class EsPrcRelation implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "ID", type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "企标计划ID")
|
||||
private String esId;
|
||||
|
||||
@ApiModelProperty(value = "流程ID")
|
||||
private String prcId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "OA待办标识")
|
||||
private String oaFlag; // 0-已办 1-待办
|
||||
|
||||
@ApiModelProperty(value = "企标计划管控流程的实例ID")
|
||||
private String prcIdGk;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.ydw.bat.wkflow.business_main.datas.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="EsPrcRelation对象", description="企标计划和技术标准流程关联表")
|
||||
public class EsPrcRelationDTO {
|
||||
|
||||
@ApiModelProperty(value = "企标计划ID")
|
||||
private String esId;
|
||||
|
||||
@ApiModelProperty(value = "流程ID")
|
||||
private String prcId;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ydw.bat.wkflow.business_main.datas.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.EsPrcRelation;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 企标计划和技术标准流程关联表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author iyawei
|
||||
* @since 2022-11-18
|
||||
*/
|
||||
@Repository
|
||||
public interface EsPrcRelationMapper extends BaseMapper<EsPrcRelation> {
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.ydw.bat.wkflow.business_main.datas.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.EsPrcRelation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IEsPrcRelationService extends IService<EsPrcRelation> {
|
||||
/**
|
||||
*
|
||||
* @param esId
|
||||
* @return
|
||||
*/
|
||||
List<EsPrcRelation> list(String esId);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param esId
|
||||
* @param prcId
|
||||
* @return
|
||||
*/
|
||||
int addEsPrcRelation(String esId, String prcId, String prcIdGk);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param esId
|
||||
* @param prcId
|
||||
* @param oaFlag
|
||||
* @return
|
||||
*/
|
||||
int modifyEsPrcRelation(String esId, String prcId, String oaFlag, String prcIdGk);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param esId
|
||||
* @return
|
||||
*/
|
||||
int delEsPrcRelation(String esId);
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.ydw.bat.wkflow.business_main.datas.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.EsPrcRelation;
|
||||
import com.ydw.bat.wkflow.business_main.datas.mapper.EsPrcRelationMapper;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IEsPrcRelationService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class EsPrcRelationServiceImpl extends ServiceImpl<EsPrcRelationMapper, EsPrcRelation> implements IEsPrcRelationService {
|
||||
|
||||
@Override
|
||||
public List<EsPrcRelation> list(String esId) {
|
||||
QueryWrapper<EsPrcRelation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EsPrcRelation::getEsId, esId);
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addEsPrcRelation(String esId, String prcId, String prcIdGk) {
|
||||
EsPrcRelation esPrcRelation = new EsPrcRelation();
|
||||
esPrcRelation.setEsId(esId);
|
||||
esPrcRelation.setOaFlag("0"); // 已办
|
||||
Date date = new Date();
|
||||
esPrcRelation.setCreateTime(date);
|
||||
esPrcRelation.setUpdateTime(date);
|
||||
|
||||
if (StringUtils.isNotBlank(prcId)) {
|
||||
esPrcRelation.setPrcId(prcId);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(prcIdGk)) {
|
||||
esPrcRelation.setPrcId(prcIdGk);
|
||||
}
|
||||
return this.baseMapper.insert(esPrcRelation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifyEsPrcRelation(String esId, String prcId, String oaFlag, String prcIdGk) {
|
||||
EsPrcRelation esPrcRelation = new EsPrcRelation();
|
||||
esPrcRelation.setEsId(esId);
|
||||
Date date = new Date();
|
||||
esPrcRelation.setUpdateTime(date);
|
||||
|
||||
if (StringUtils.isNotBlank(oaFlag)) {
|
||||
esPrcRelation.setOaFlag(oaFlag);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(prcId)) {
|
||||
esPrcRelation.setPrcId(prcId);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(prcIdGk)) {
|
||||
esPrcRelation.setPrcId(prcIdGk);
|
||||
}
|
||||
QueryWrapper<EsPrcRelation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EsPrcRelation::getEsId, esPrcRelation.getEsId());
|
||||
return this.baseMapper.update(esPrcRelation, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delEsPrcRelation(String esId) {
|
||||
QueryWrapper<EsPrcRelation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EsPrcRelation::getEsId, esId);
|
||||
return this.baseMapper.delete(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.ydw.bat.wkflow.config;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ydw.bat.wkflow.business_auth.LawsUserInfoService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessNew;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.EsPrcRelation;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.EsRevisePlanDTO;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IEsPrcRelationService;
|
||||
import com.ydw.bat.wkflow.business_mq.service.CreateMQService;
|
||||
import com.ydw.bat.wkflow.util.SpringContextUtil;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ScheduledJobEsPlan {
|
||||
Logger logger = LoggerFactory.getLogger(ScheduledJobEsPlan.class);
|
||||
|
||||
@Value("${isNotScheduled}")
|
||||
private boolean isNotScheduled; //是否开启定时器
|
||||
|
||||
@Scheduled(cron = "0 0 2 * * ?") //每天的凌晨2点执行
|
||||
@Async
|
||||
public void SchedulingTask() {
|
||||
if(isNotScheduled) {
|
||||
logger.info("============企标计划定时任务开始===========");
|
||||
LawsUserInfoService lawsUserInfoService = SpringContextUtil.getBean(LawsUserInfoService.class);
|
||||
IEsPrcRelationService esPrcRelationService = SpringContextUtil.getBean(IEsPrcRelationService.class);
|
||||
TaskService taskService = SpringContextUtil.getBean(TaskService.class);
|
||||
|
||||
List<EsRevisePlanDTO> esRevisePlanDTOList = lawsUserInfoService.getAllPlansByWk(); // 查询 制定中,修订中的企标计划
|
||||
// 计划标准初稿时间前一个月的企标计划
|
||||
SimpleDateFormat sdfQuery = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MONTH, -1);
|
||||
String endDate = sdfQuery.format(calendar.getTime());
|
||||
List<EsRevisePlanDTO> esRevisePlanDTOList2 = esRevisePlanDTOList.stream()
|
||||
.filter(e -> endDate.equals(sdfQuery.format(e.getDraftTime())))
|
||||
.collect(Collectors.toList());
|
||||
if (!esRevisePlanDTOList2.isEmpty()) {
|
||||
for (EsRevisePlanDTO esRevisePlanDTO : esRevisePlanDTOList2) {
|
||||
List<EsPrcRelation> esPrcRelationList = esPrcRelationService.list(esRevisePlanDTO.getId());
|
||||
if (esPrcRelationList.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
String esId = esPrcRelationList.get(0).getEsId();
|
||||
String prcIdGk = esPrcRelationList.get(0).getPrcIdGk();
|
||||
String oaFlag = esPrcRelationList.get(0).getOaFlag();
|
||||
// 判断对应 管控流程是否还在 技术标准起草节点, 且之前点过接受任务
|
||||
if (StringUtils.isNotBlank(prcIdGk)) {
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(prcIdGk).active().list();
|
||||
if (!list2.isEmpty()) {
|
||||
String nowTaskInfo = list2.get(0).getName();
|
||||
if ("技术标准起草".equals(nowTaskInfo) && "0".equals(oaFlag)) {
|
||||
// 再次发送待办
|
||||
logger.info("============再次发送待办的企标计划" + esRevisePlanDTO.getEsName() +"===========");
|
||||
sendOATodo(list2.get(0));
|
||||
|
||||
// 更新 状态为待办
|
||||
esPrcRelationService.modifyEsPrcRelation(esId, null, "1", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("============企标计划定时任务结束===========");
|
||||
}
|
||||
}
|
||||
|
||||
public void sendOATodo(Task delegateTask) {
|
||||
IBusProcessNewService busBean = SpringContextUtil.getBean(IBusProcessNewService.class);
|
||||
QueryWrapper queryWrapper1 = new QueryWrapper();
|
||||
queryWrapper1.eq("P_ID",delegateTask.getProcessInstanceId());
|
||||
queryWrapper1.eq("USER_ID",delegateTask.getAssignee());
|
||||
queryWrapper1.isNull("TASK_ID");
|
||||
List<BusProcessNew> list = busBean.list(queryWrapper1);
|
||||
if(!list.isEmpty()) {
|
||||
BusProcessNew one1 = list.get(0);
|
||||
one1.setTaskId(delegateTask.getId());
|
||||
busBean.saveOrUpdate(one1);
|
||||
|
||||
CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class);
|
||||
// 发送 oa 待办 设置 跳转页面 router ? 后面流程类型
|
||||
one1.setLink("qbzxdjhgkStep6?prcType=25");
|
||||
one1.setTaskInfo(delegateTask.getName());
|
||||
oaService.sendTodoMq(one1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,14 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessName;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessNew;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.Datas;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessModelHisService;
|
||||
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.IDatasService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.entity.EsPrcRelation;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.*;
|
||||
import com.ydw.bat.wkflow.util.SpringContextUtil;
|
||||
import org.activiti.engine.ActivitiException;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.delegate.DelegateTask;
|
||||
import org.activiti.engine.delegate.TaskListener;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.tomcat.util.digester.ArrayStack;
|
||||
|
||||
@@ -26,6 +27,12 @@ import java.util.List;
|
||||
*/
|
||||
public class BLApplicantAfter implements TaskListener{
|
||||
|
||||
TaskService taskService = SpringContextUtil.getBean(TaskService.class);
|
||||
|
||||
IEsPrcRelationService esPrcRelationService = SpringContextUtil.getBean(IEsPrcRelationService.class);
|
||||
|
||||
RuntimeService runtimeService = SpringContextUtil.getBean(RuntimeService.class);
|
||||
|
||||
@Override
|
||||
public void notify(DelegateTask delegateTask) {
|
||||
IDatasService datasService = SpringContextUtil.getBean(IDatasService.class);
|
||||
@@ -137,6 +144,56 @@ public class BLApplicantAfter implements TaskListener{
|
||||
|
||||
// 生成 模板
|
||||
// busProcessModelHisService.saveBussTemplateFile(object,delegateTask.getProcessInstanceId());
|
||||
|
||||
// 给企标计划绑定 技术标准流程
|
||||
//1合并 2延期 3取消 4更名 5立项
|
||||
String type=object.getString("type");
|
||||
if (StringUtils.isNotBlank(type)) {
|
||||
// 删除 进行中的 旧流程
|
||||
if ("1".equals(type)) {
|
||||
String esId1 = object.getString("esId1");
|
||||
String esId2 = object.getString("esId2");
|
||||
|
||||
List<EsPrcRelation> esPrcRelationList1 = esPrcRelationService.list(esId1);
|
||||
if (esPrcRelationList1 != null && !esPrcRelationList1.isEmpty()) {
|
||||
String prcId1 = esPrcRelationList1.get(0).getPrcId();
|
||||
List<Task> list1 = taskService.createTaskQuery().processInstanceId(prcId1).active().list();
|
||||
if (list1 != null && !list1.isEmpty()) {
|
||||
// 删除正在运行中的流程根据流程实例ID
|
||||
runtimeService.deleteProcessInstance(prcId1, "");
|
||||
}
|
||||
}
|
||||
|
||||
List<EsPrcRelation> esPrcRelationList2 = esPrcRelationService.list(esId2);
|
||||
if (esPrcRelationList2 != null && !esPrcRelationList2.isEmpty()) {
|
||||
String prcId2 = esPrcRelationList2.get(0).getPrcId();
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(prcId2).active().list();
|
||||
if (list2 != null && !list2.isEmpty()) {
|
||||
// 删除正在运行中的流程根据流程实例ID
|
||||
runtimeService.deleteProcessInstance(prcId2, "");
|
||||
}
|
||||
}
|
||||
|
||||
// 删除旧的 计划和流程关联关系
|
||||
esPrcRelationService.delEsPrcRelation(esId1);
|
||||
esPrcRelationService.delEsPrcRelation(esId2);
|
||||
|
||||
} else if ("2".equals(type) || "3".equals(type) || "4".equals(type)) {
|
||||
String esId = object.getString("esId");
|
||||
List<EsPrcRelation> esPrcRelationList = esPrcRelationService.list(esId);
|
||||
if (esPrcRelationList != null && !esPrcRelationList.isEmpty()) {
|
||||
String prcId = esPrcRelationList.get(0).getPrcId();
|
||||
List<Task> list = taskService.createTaskQuery().processInstanceId(esPrcRelationList.get(0).getPrcId()).active().list();
|
||||
if (list != null && !list.isEmpty()) {
|
||||
// 删除正在运行中的流程根据流程实例ID
|
||||
runtimeService.deleteProcessInstance(prcId, "");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 修改 计划和流程关联关系
|
||||
esPrcRelationService.modifyEsPrcRelation(object.getString("nowEsId"), delegateTask.getProcessInstanceId(), null, null);
|
||||
}
|
||||
}
|
||||
|
||||
private String verifyObj(String str){
|
||||
|
||||
+12
-12
@@ -8,6 +8,7 @@ import com.ydw.bat.wkflow.business_main.datas.entity.Datas;
|
||||
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.IDatasService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IEsPrcRelationService;
|
||||
import com.ydw.bat.wkflow.util.SpringContextUtil;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.delegate.DelegateTask;
|
||||
@@ -16,6 +17,9 @@ import org.activiti.engine.delegate.TaskListener;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 企标制修订计划管控-技术标准起草
|
||||
*/
|
||||
public class ProcessStep6After implements TaskListener {
|
||||
|
||||
@Override
|
||||
@@ -27,7 +31,7 @@ public class ProcessStep6After implements TaskListener {
|
||||
//流程信息
|
||||
IBusProcessNameService busProcessNameService = SpringContextUtil.getBean(IBusProcessNameService.class);
|
||||
|
||||
TaskService taskService = SpringContextUtil.getBean(TaskService.class);
|
||||
IEsPrcRelationService esPrcRelationService = SpringContextUtil.getBean(IEsPrcRelationService.class);
|
||||
|
||||
//根据流程id找到流程信息
|
||||
QueryWrapper<Datas> queryWrapper = new QueryWrapper<>();
|
||||
@@ -67,22 +71,18 @@ public class ProcessStep6After implements TaskListener {
|
||||
busBean.saveOrUpdate(one2);
|
||||
}
|
||||
|
||||
|
||||
// 处理 oaFlag 为已办
|
||||
//1合并 2延期 3取消 4更名 5立项
|
||||
String type=object.getString("type");
|
||||
// 删除 进行中的 旧流程
|
||||
if ("1".equals(type)) {
|
||||
// List<Task> list = taskService.createTaskQuery().processInstanceId().active().list();
|
||||
// if (list != null && !list.isEmpty()) {
|
||||
//
|
||||
// }
|
||||
if ("2".equals(type) || "3".equals(type) || "4".equals(type)) {
|
||||
|
||||
} else if ("2".equals(type)) {
|
||||
|
||||
} else if ("3".equals(type)) {
|
||||
|
||||
} else if ("4".equals(type)) {
|
||||
// 修改 计划和流程关联关系
|
||||
esPrcRelationService.modifyEsPrcRelation(object.getString("nowEsId"), null , "0", delegateTask.getProcessInstanceId());
|
||||
} else {
|
||||
|
||||
// 新增新的 计划和流程关联关系
|
||||
esPrcRelationService.addEsPrcRelation(object.getString("nowEsId"), null, delegateTask.getProcessInstanceId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -51,7 +51,8 @@ public class ProcessstartAfter implements TaskListener {
|
||||
delegateTask.setVariable("Step3", object.getString("approver")); // 批准人员
|
||||
|
||||
} else {
|
||||
delegateTask.setVariable("createUser",delegateTask.getVariable("prcCreateUser",String.class)); // 技术标准起草人员
|
||||
nextUserList.add(object.getString("prcCreateUser"));
|
||||
delegateTask.setVariable("createUser",object.getString("prcCreateUser")); // 技术标准起草人员
|
||||
delegateTask.setVariable("addFlag", object.getString("addFlag"));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ydw.bat.wkflow.business_main.datas.mapper.EsPrcRelationMapper">
|
||||
|
||||
<resultMap id="BaseInfoMap" type="com.ydw.bat.wkflow.business_main.datas.entity.EsPrcRelation">
|
||||
<id column="id" property="id" />
|
||||
<id column="es_id" property="esId" />
|
||||
<id column="prc_id" property="prcId" />
|
||||
<id column="create_time" property="createTime" />
|
||||
<id column="update_time" property="updateTime" />
|
||||
<id column="oa_flag" property="oaFlag" />
|
||||
<id column="prc_id_gk" property="prcIdGk" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user