清单 流程回退

This commit is contained in:
yuezhihang
2021-10-29 14:02:47 +08:00
parent 0d18758178
commit 539cf47101
3 changed files with 61 additions and 10 deletions
@@ -399,4 +399,7 @@ public interface workFlowFeignClient {
// @RequestMapping(value = "/bat-wkflow/findProcessNameByPrcNum",method = RequestMethod.POST) // @RequestMapping(value = "/bat-wkflow/findProcessNameByPrcNum",method = RequestMethod.POST)
// List<BusProcessName> findProcessNameByPrcNum(@RequestBody String taskId); // List<BusProcessName> findProcessNameByPrcNum(@RequestBody String taskId);
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlock",method = RequestMethod.GET)
List<BusProcessNew> everyDayTenOlock();
} }
@@ -1,10 +1,17 @@
package com.adc.da.Timer; package com.adc.da.Timer;
import com.adc.da.FeignClient.workFlowFeignClient; import com.adc.da.FeignClient.workFlowFeignClient;
import com.adc.da.common.BusMes;
import com.adc.da.common.BusProcessName; import com.adc.da.common.BusProcessName;
import com.adc.da.common.BusProcessNew;
import com.adc.da.common.Wrapper;
import com.adc.da.http.ResponseMessage;
import com.adc.da.sys.common.EmailUtils; import com.adc.da.sys.common.EmailUtils;
import com.adc.da.sys.entity.UserEO; import com.adc.da.sys.entity.UserEO;
import com.adc.da.sys.service.IUserEOService; import com.adc.da.sys.service.IUserEOService;
import com.adc.da.workFlow.controller.WorkFlowController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
@@ -13,6 +20,7 @@ import org.springframework.stereotype.Component;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -34,6 +42,9 @@ public class ProcessTimer {
@Autowired @Autowired
private IUserEOService userEOService; private IUserEOService userEOService;
@Autowired
private WorkFlowController workFlowController;
/*** /***
* @Description: 自动催办,任务截至时间前3天开始每天催办 * @Description: 自动催办,任务截至时间前3天开始每天催办
* @Author: yangxuenan * @Author: yangxuenan
@@ -151,4 +162,31 @@ public class ProcessTimer {
} }
return type; return type;
} }
@Scheduled(cron = "0 0 10 * * ? ")//每天十点执行
// @Scheduled(cron = "*/20 * * * * ? ")//每天十点执行
public void everyDayTenOlockScan() {
List<BusProcessNew> busProcessNews=new ArrayList<>();
busProcessNews=workFlowFeignClient.everyDayTenOlock();
if (!busProcessNews.isEmpty()){
for (BusProcessNew bus:busProcessNews) {
JSONObject jsonObject= JSON.parseObject(bus.getMesg());
jsonObject.put("auto","1");
ResponseMessage responseMessage = workFlowController.startProcessNew("19",jsonObject.getString("revisionId"),null);
BusMes busMes=new BusMes();
busMes.setTaskIds(String.valueOf(responseMessage.getData()));
busMes.setJson(jsonObject.toJSONString());
busMes.setUserId(jsonObject.getString("revisionId"));
Wrapper<String> wrapper=workFlowFeignClient.completeTaskByUserId(busMes);
System.out.println("dasda");
}
}
}
public static void main(String[]args){
ProcessTimer processTimer = new ProcessTimer();
processTimer.everyDayTenOlockScan();
}
} }
@@ -122,6 +122,16 @@ public class WorkFlowController {
} }
} }
@ApiOperation(value = "定时任务启动流程-以流程定义id")
@GetMapping("/startProcessNew")
public ResponseMessage startProcessNew(@RequestParam("type") String type, @RequestParam(value="userId",required = false) String userId, @RequestParam(value="id",required = false) String id){
if(StringUtils.isNotBlank(type)){
return this.activiti_define_start(ActDefineStartMap.actDefineStartMap(type), userId,id);
}else {
return null;
}
}
@ApiOperation(value = "待办任务详情") @ApiOperation(value = "待办任务详情")
@GetMapping("/todotask") @GetMapping("/todotask")
public PageInfo<BusProcessNew> todotask(@RequestParam("userId") String userId, @RequestParam("pId") String pId){ public PageInfo<BusProcessNew> todotask(@RequestParam("userId") String userId, @RequestParam("pId") String pId){