OA待办任务 删除 PID

This commit is contained in:
gaojiabao
2023-04-18 15:09:29 +08:00
parent f30cb67762
commit 86ab9f8c8b
2 changed files with 54 additions and 2 deletions
@@ -25,6 +25,7 @@ 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_oa.webService.service.WebServiceOAService;
import com.ydw.bat.wkflow.business_oa.webService.service.impl.WebServiceOAServiceImpl;
import com.ydw.bat.wkflow.business_oa.webService.todoContent.NotifyTodoSendContext;
import com.ydw.bat.wkflow.business_oa.webService.todoResult.NotifyTodoAppResult;
import com.ydw.bat.wkflow.business_wkflow.form.dto.FormSubmitDto;
@@ -99,6 +100,9 @@ public class TodoTaskController extends BaseAction {
@Autowired
private WebServiceOAService webServiceOAService;
@Autowired
private WebServiceOAServiceImpl webServiceOAServiceImol;
@Autowired
private CreateMQService mqService;
@@ -2759,11 +2763,11 @@ public class TodoTaskController extends BaseAction {
return busProcessNames;
}
@ApiOperation(value = "删除OA消息通知")
@ApiOperation(value = "删除OA消息通知 起草专用")
@GetMapping("/deleteOATask")
public String deleteOATask(@RequestParam("pId") String pId) {
//查询出当前数据
webServiceOAService.deleteOAByPid(pId);
webServiceOAServiceImol.deleteOAByPidInfo(pId);
return "1";
}
@@ -427,4 +427,52 @@ public class WebServiceOAServiceImpl implements WebServiceOAService {
return notifyTodoAppResult;
}
/**
* 批量删除OA待办 制修订 起草 专用
* @param pId
*/
@Async
public void deleteOAByPidInfo(String pId){
CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class);
log.info("--------------------------ESP 批量发送删除待办任务----------------------------");
QueryWrapper queryWrapper1 = new QueryWrapper();
queryWrapper1.eq("P_ID",pId);
List<BusProcessNew> list = iBusProcessNewService.list(queryWrapper1);
if(!list.isEmpty()){
List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>();
list.forEach(busProcessNew -> {
NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext();
notifyTodoSendContext.setAppName("SPRS");
notifyTodoSendContext.setModelId(busProcessNew.getId());
notifyTodoSendContext.setModelName("技术标准起草");
notifyTodoSendContext.setType("1");
notifyTodoSendContext.setOptType("2");
Map<String, Object> map = new HashMap<>();
ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId());
map.put("LoginName",byId == null ? "" : byId.getData().getAccount());
JSONObject jsonLoginName = new JSONObject(map);
notifyTodoSendContext.setTargets(jsonLoginName.toJSONString());
notifyTodoSendContext.setUserId(busProcessNew.getUserId());
notifyTodoSendContexts.add(notifyTodoSendContext);
});
for (NotifyTodoSendContext data: notifyTodoSendContexts){
List<NotifyTodoSendContext> notifyTodoSendContextArrayList = new ArrayList<>();
notifyTodoSendContextArrayList.add(data);
Map<String,Object> map = new TreeMap<>();
map.put("todoId",pId);
map.put("list",notifyTodoSendContextArrayList);
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(map);
log.info("调用MQ数据!!!:"+jsonObject.toString());
OASendLog oaSendLog = new OASendLog();
oaSendLog.setType("delete");
oaSendLog.setCreateTime(new Date());
oaSendLog.setMeans("deleteOAByPid");
oaSendLog.setMsgLog(jsonObject.toString());
oaSendLogService.addOASendLog(oaSendLog);
oaService.setTodoDeleteMq(jsonObject.toString());
}
}
}
}