OA 关闭

This commit is contained in:
gaojiabao
2023-05-19 19:12:28 +08:00
parent e025fd4e33
commit 975371512d
@@ -89,43 +89,43 @@ public class WebServiceOAServiceImpl implements WebServiceOAService {
CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class); CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class);
log.info("--------------------------ESP 发送单个删除OA待办----------------------------"); log.info("--------------------------ESP 发送单个删除OA待办----------------------------");
if(StringUtils.isNotBlank(todoId) && StringUtils.isNotBlank(assignee)){ // if(StringUtils.isNotBlank(todoId) && StringUtils.isNotBlank(assignee)){
//
QueryWrapper wrapper = new QueryWrapper(); // QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("TODO_ID",todoId); // wrapper.eq("TODO_ID",todoId);
wrapper.eq("MSG_TYPE","0"); // wrapper.eq("MSG_TYPE","0");
List<SendTodoLog> list = sendTodoLogMapper.selectList(wrapper); // List<SendTodoLog> list = sendTodoLogMapper.selectList(wrapper);
if(!list.isEmpty()){ // if(!list.isEmpty()){
net.sf.json.JSONObject fromObject = net.sf.json.JSONObject.fromObject(list.get(0).getMesg()); // net.sf.json.JSONObject fromObject = net.sf.json.JSONObject.fromObject(list.get(0).getMesg());
net.sf.json.JSONObject jsonObjectFilter = net.sf.json.JSONObject.fromObject(list.get(0).getMesg()); // net.sf.json.JSONObject jsonObjectFilter = net.sf.json.JSONObject.fromObject(list.get(0).getMesg());
jsonObjectFilter = jsonObjectFilter.discard("PId"); // jsonObjectFilter = jsonObjectFilter.discard("PId");
jsonObjectFilter.remove("createTime"); // jsonObjectFilter.remove("createTime");
jsonObjectFilter.remove("updateTime"); // jsonObjectFilter.remove("updateTime");
jsonObjectFilter.put("pid",fromObject.getString("PId")); // jsonObjectFilter.put("pid",fromObject.getString("PId"));
BusProcessNew object = JSON.parseObject(jsonObjectFilter.toString(),BusProcessNew.class); // BusProcessNew object = JSON.parseObject(jsonObjectFilter.toString(),BusProcessNew.class);
//
List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>(); // List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>();
NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); // NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext();
notifyTodoSendContext.setAppName("SPRS"); // notifyTodoSendContext.setAppName("SPRS");
notifyTodoSendContext.setModelId(todoId); // notifyTodoSendContext.setModelId(todoId);
notifyTodoSendContext.setModelName(object.getTaskInfo()); // notifyTodoSendContext.setModelName(object.getTaskInfo());
notifyTodoSendContext.setType("1"); // notifyTodoSendContext.setType("1");
notifyTodoSendContext.setOptType("2"); // notifyTodoSendContext.setOptType("2");
Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();
ResponseMessage<UserVO> byId = lawsUserInfoService.getById(assignee); // ResponseMessage<UserVO> byId = lawsUserInfoService.getById(assignee);
map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); // map.put("LoginName",byId == null ? "" : byId.getData().getAccount());
JSONObject jsonLoginName = new JSONObject(map); // JSONObject jsonLoginName = new JSONObject(map);
notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); // notifyTodoSendContext.setTargets(jsonLoginName.toJSONString());
notifyTodoSendContext.setUserId(assignee); // notifyTodoSendContext.setUserId(assignee);
notifyTodoSendContexts.add(notifyTodoSendContext); // notifyTodoSendContexts.add(notifyTodoSendContext);
Map<String,Object> objectMap = new TreeMap<>(); // Map<String,Object> objectMap = new TreeMap<>();
objectMap.put("todoId",todoId); // objectMap.put("todoId",todoId);
objectMap.put("list",notifyTodoSendContexts); // objectMap.put("list",notifyTodoSendContexts);
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(objectMap); // net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(objectMap);
log.info("=================发送单个删除OA待办:"+jsonObject.toString()); // log.info("=================发送单个删除OA待办:"+jsonObject.toString());
oaService.setTodoDeleteMq(jsonObject.toString()); // oaService.setTodoDeleteMq(jsonObject.toString());
} // }
} // }
} }
/** /**
@@ -137,47 +137,47 @@ public class WebServiceOAServiceImpl implements WebServiceOAService {
CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class); CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class);
log.info("--------------------------ESP 发送删除待办任务 及 再次发送待办----------------------------"); log.info("--------------------------ESP 发送删除待办任务 及 再次发送待办----------------------------");
if(busProcessNew != null && StringUtils.isNotBlank(busProcessNew.getId())){ // if(busProcessNew != null && StringUtils.isNotBlank(busProcessNew.getId())){
//
QueryWrapper wrapper = new QueryWrapper(); // QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("TODO_ID",busProcessNew.getId()); // wrapper.eq("TODO_ID",busProcessNew.getId());
wrapper.eq("MSG_TYPE","0"); // wrapper.eq("MSG_TYPE","0");
List<SendTodoLog> list = sendTodoLogMapper.selectList(wrapper); // List<SendTodoLog> list = sendTodoLogMapper.selectList(wrapper);
if(!list.isEmpty()){ // if(!list.isEmpty()){
net.sf.json.JSONObject fromObject = net.sf.json.JSONObject.fromObject(list.get(0).getMesg()); // net.sf.json.JSONObject fromObject = net.sf.json.JSONObject.fromObject(list.get(0).getMesg());
net.sf.json.JSONObject jsonObjectFilter = net.sf.json.JSONObject.fromObject(list.get(0).getMesg()); // net.sf.json.JSONObject jsonObjectFilter = net.sf.json.JSONObject.fromObject(list.get(0).getMesg());
jsonObjectFilter = jsonObjectFilter.discard("PId"); // jsonObjectFilter = jsonObjectFilter.discard("PId");
jsonObjectFilter.remove("createTime"); // jsonObjectFilter.remove("createTime");
jsonObjectFilter.remove("updateTime"); // jsonObjectFilter.remove("updateTime");
jsonObjectFilter.put("pid",fromObject.getString("PId")); // jsonObjectFilter.put("pid",fromObject.getString("PId"));
BusProcessNew object = JSON.parseObject(jsonObjectFilter.toString(),BusProcessNew.class); // BusProcessNew object = JSON.parseObject(jsonObjectFilter.toString(),BusProcessNew.class);
//
List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>(); // List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>();
NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); // NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext();
notifyTodoSendContext.setAppName("SPRS"); // notifyTodoSendContext.setAppName("SPRS");
notifyTodoSendContext.setModelId(busProcessNew.getId()); // notifyTodoSendContext.setModelId(busProcessNew.getId());
notifyTodoSendContext.setModelName(object.getTaskInfo()); // notifyTodoSendContext.setModelName(object.getTaskInfo());
notifyTodoSendContext.setType("1"); // notifyTodoSendContext.setType("1");
notifyTodoSendContext.setOptType("2"); // notifyTodoSendContext.setOptType("2");
Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();
ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId()); // ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId());
map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); // map.put("LoginName",byId == null ? "" : byId.getData().getAccount());
JSONObject jsonLoginName = new JSONObject(map); // JSONObject jsonLoginName = new JSONObject(map);
notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); // notifyTodoSendContext.setTargets(jsonLoginName.toJSONString());
notifyTodoSendContext.setUserId(busProcessNew.getUserId()); // notifyTodoSendContext.setUserId(busProcessNew.getUserId());
notifyTodoSendContexts.add(notifyTodoSendContext); // notifyTodoSendContexts.add(notifyTodoSendContext);
Map<String,Object> objectMap = new TreeMap<>(); // Map<String,Object> objectMap = new TreeMap<>();
objectMap.put("todoId",busProcessNew.getId()); // objectMap.put("todoId",busProcessNew.getId());
objectMap.put("list",notifyTodoSendContexts); // objectMap.put("list",notifyTodoSendContexts);
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(objectMap); // net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(objectMap);
oaService.setTodoDeleteMq(jsonObject.toString()); // oaService.setTodoDeleteMq(jsonObject.toString());
log.info("=================ESP 发送删除待办任务 及 再次发送待办:"+jsonObject.toString()); // log.info("=================ESP 发送删除待办任务 及 再次发送待办:"+jsonObject.toString());
//
// 重新发送OA待办 // // 重新发送OA待办
object.setUserId(assignee); // object.setUserId(assignee);
oaService.sendTodoMq(object); // oaService.sendTodoMq(object);
} // }
} // }
} }
/** /**
@@ -190,234 +190,234 @@ public class WebServiceOAServiceImpl implements WebServiceOAService {
CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class); CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class);
log.info("--------------------------ESP 批量发送删除待办任务----------------------------"); log.info("--------------------------ESP 批量发送删除待办任务----------------------------");
QueryWrapper queryWrapper1 = new QueryWrapper(); // QueryWrapper queryWrapper1 = new QueryWrapper();
queryWrapper1.eq("P_ID",pId); // queryWrapper1.eq("P_ID",pId);
List<BusProcessNew> list = iBusProcessNewService.list(queryWrapper1); // List<BusProcessNew> list = iBusProcessNewService.list(queryWrapper1);
if(!list.isEmpty()){ // if(!list.isEmpty()){
List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>(); // List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>();
list.forEach(busProcessNew -> { // list.forEach(busProcessNew -> {
NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); // NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext();
notifyTodoSendContext.setAppName("SPRS"); // notifyTodoSendContext.setAppName("SPRS");
notifyTodoSendContext.setModelId(busProcessNew.getId()); // notifyTodoSendContext.setModelId(busProcessNew.getId());
notifyTodoSendContext.setModelName(busProcessNew.getTaskInfo()); // notifyTodoSendContext.setModelName(busProcessNew.getTaskInfo());
notifyTodoSendContext.setType("1"); // notifyTodoSendContext.setType("1");
notifyTodoSendContext.setOptType("2"); // notifyTodoSendContext.setOptType("2");
Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();
ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId()); // ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId());
map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); // map.put("LoginName",byId == null ? "" : byId.getData().getAccount());
JSONObject jsonLoginName = new JSONObject(map); // JSONObject jsonLoginName = new JSONObject(map);
notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); // notifyTodoSendContext.setTargets(jsonLoginName.toJSONString());
notifyTodoSendContext.setUserId(busProcessNew.getUserId()); // notifyTodoSendContext.setUserId(busProcessNew.getUserId());
notifyTodoSendContexts.add(notifyTodoSendContext); // notifyTodoSendContexts.add(notifyTodoSendContext);
}); // });
for (NotifyTodoSendContext data: notifyTodoSendContexts){ // for (NotifyTodoSendContext data: notifyTodoSendContexts){
List<NotifyTodoSendContext> notifyTodoSendContextArrayList = new ArrayList<>(); // List<NotifyTodoSendContext> notifyTodoSendContextArrayList = new ArrayList<>();
notifyTodoSendContextArrayList.add(data); // notifyTodoSendContextArrayList.add(data);
Map<String,Object> map = new TreeMap<>(); // Map<String,Object> map = new TreeMap<>();
map.put("todoId",pId); // map.put("todoId",pId);
map.put("list",notifyTodoSendContextArrayList); // map.put("list",notifyTodoSendContextArrayList);
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(map); // net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(map);
log.info("调用MQ数据!!!:"+jsonObject.toString()); // log.info("调用MQ数据!!!:"+jsonObject.toString());
OASendLog oaSendLog = new OASendLog(); // OASendLog oaSendLog = new OASendLog();
oaSendLog.setType("delete"); // oaSendLog.setType("delete");
oaSendLog.setCreateTime(new Date()); // oaSendLog.setCreateTime(new Date());
oaSendLog.setMeans("deleteOAByPid"); // oaSendLog.setMeans("deleteOAByPid");
oaSendLog.setMsgLog(jsonObject.toString()); // oaSendLog.setMsgLog(jsonObject.toString());
oaSendLogService.addOASendLog(oaSendLog); // oaSendLogService.addOASendLog(oaSendLog);
oaService.setTodoDeleteMq(jsonObject.toString()); // oaService.setTodoDeleteMq(jsonObject.toString());
} // }
} // }
} }
@Override @Override
@Async @Async
public NotifyTodoAppDeleteResult setTodoDelete(String object) throws Exception{ public NotifyTodoAppDeleteResult setTodoDelete(String object) throws Exception{
Map<String,Object> objectMap = net.sf.json.JSONObject.fromObject(object); // Map<String,Object> objectMap = net.sf.json.JSONObject.fromObject(object);
List<NotifyTodoSendContext> notifyTodoSendContexts = JSONObject.parseArray(objectMap.get("list").toString(), NotifyTodoSendContext.class); // List<NotifyTodoSendContext> notifyTodoSendContexts = JSONObject.parseArray(objectMap.get("list").toString(), NotifyTodoSendContext.class);
NotifyTodoAppDeleteResult notifyTodoAppResult = new NotifyTodoAppDeleteResult(); // NotifyTodoAppDeleteResult notifyTodoAppResult = new NotifyTodoAppDeleteResult();
String result = ""; // String result = "";
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); // SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
//
JsonSend jsonSend = new JsonSend(); // JsonSend jsonSend = new JsonSend();
HEAD head = new HEAD(); // HEAD head = new HEAD();
head.setACCOUNT("OA"); // head.setACCOUNT("OA");
head.setBIZTRANSACTIONID("SYC_161320210206133219"); // head.setBIZTRANSACTIONID("SYC_161320210206133219");
head.setCONSUMER("SPRS"); // head.setCONSUMER("SPRS");
head.setCOUNT("1"); // head.setCOUNT("1");
head.setPASSWORD("TEST_oa201611241710"); // head.setPASSWORD("TEST_oa201611241710");
head.setSRVLEVEL("1"); // head.setSRVLEVEL("1");
List<Object> list = new ArrayList<>(); // List<Object> list = new ArrayList<>();
list.addAll(notifyTodoSendContexts); // list.addAll(notifyTodoSendContexts);
jsonSend.setHEAD(head); // jsonSend.setHEAD(head);
jsonSend.setLIST(list); // jsonSend.setLIST(list);
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonSend); // net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonSend);
Map<String,String> mapCtr = new TreeMap<>(); // Map<String,String> mapCtr = new TreeMap<>();
mapCtr.put("Authorization",credentials); // mapCtr.put("Authorization",credentials);
log.info("处理完文件数据,开始请求发送删除接口数据:【"+sdf.format(new Date())+""); // log.info("处理完文件数据,开始请求发送删除接口数据:【"+sdf.format(new Date())+"】");
log.info("删除当前处理的文件数据(josnSend):"+jsonSend.toString()); // log.info("删除当前处理的文件数据(josnSend):"+jsonSend.toString());
log.info("删除当前处理的文件数据(Object):"+object); // log.info("删除当前处理的文件数据(Object):"+object);
result = okHttpUtil.postForJson("https://fesbnew.foton.com.cn/WP_FOTON_FSOA/APP_DOC_SERVICES/Proxy_Services/TA_OA/DOC_SYC_1020_SendRemoveTodo_PS",json.toString(),mapCtr); // result = okHttpUtil.postForJson("https://fesbnew.foton.com.cn/WP_FOTON_FSOA/APP_DOC_SERVICES/Proxy_Services/TA_OA/DOC_SYC_1020_SendRemoveTodo_PS",json.toString(),mapCtr);
log.info("请求发送删除接口完毕,返回响应状态:【"+sdf.format(new Date())+""); // log.info("请求发送删除接口完毕,返回响应状态:【"+sdf.format(new Date())+"】");
// JSONObject jsonObject = JSONObject.parseObject(result); //// JSONObject jsonObject = JSONObject.parseObject(result);
if(!result.contains("操作成功")){ // if(!result.contains("操作成功")){
log.error("请求发送删除接口出现异常:"+result); // log.error("请求发送删除接口出现异常:"+result);
notifyTodoAppResult.setSign("1"); // notifyTodoAppResult.setSign("1");
notifyTodoAppResult.setMassage(result); // notifyTodoAppResult.setMassage(result);
log.info("删除失败当前处理的文件数据(josnSend):"+jsonSend.toString()); // log.info("删除失败当前处理的文件数据(josnSend):"+jsonSend.toString());
log.info("删除失败当前处理的文件数据(Object):"+object); // log.info("删除失败当前处理的文件数据(Object):"+object);
}else { // }else {
log.info("--------------------------成功发送 ESP 删除待办 "+object+"----------------------------"); // log.info("--------------------------成功发送 ESP 删除待办 "+object+"----------------------------");
log.info("okHttp请求发送删除接口成功结果:"+result); // log.info("okHttp请求发送删除接口成功结果:"+result);
notifyTodoAppResult = (NotifyTodoAppDeleteResult) net.sf.json.JSONObject.toBean(net.sf.json.JSONObject.fromObject(result), NotifyTodoAppDeleteResult.class); // notifyTodoAppResult = (NotifyTodoAppDeleteResult) net.sf.json.JSONObject.toBean(net.sf.json.JSONObject.fromObject(result), NotifyTodoAppDeleteResult.class);
} // }
// try { // try {
// //
// } catch (Exception e) { // } catch (Exception e) {
// log.error(errMes, e.getMessage()); // log.error(errMes, e.getMessage());
// } // }
return notifyTodoAppResult; return null;
} }
@Override @Override
@Async @Async
public void completeOA(Task task){ public void completeOA(Task task){
CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class); // CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class);
log.info("--------------------------ESP 发送已办任务----------------------------"); // log.info("--------------------------ESP 发送已办任务----------------------------");
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); // SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); // NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext();
notifyTodoSendContext.setAppName("SPRS"); // notifyTodoSendContext.setAppName("SPRS");
notifyTodoSendContext.setCreateTime(sdf.format(new Date())); // notifyTodoSendContext.setCreateTime(sdf.format(new Date()));
//
QueryWrapper queryWrapper1 = new QueryWrapper(); // QueryWrapper queryWrapper1 = new QueryWrapper();
queryWrapper1.eq("P_ID",task.getProcessInstanceId()); // queryWrapper1.eq("P_ID",task.getProcessInstanceId());
queryWrapper1.eq("TASK_ID",task.getId()); // queryWrapper1.eq("TASK_ID",task.getId());
List<BusProcessNew> list = iBusProcessNewService.list(queryWrapper1); // List<BusProcessNew> list = iBusProcessNewService.list(queryWrapper1);
if(!list.isEmpty()){ // if(!list.isEmpty()){
notifyTodoSendContext.setModelId(list.get(0).getId()); // notifyTodoSendContext.setModelId(list.get(0).getId());
notifyTodoSendContext.setModelName(task.getName()); // notifyTodoSendContext.setModelName(task.getName());
notifyTodoSendContext.setOptType("1"); // notifyTodoSendContext.setOptType("1");
Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();
ResponseMessage<UserVO> byId = lawsUserInfoService.getById(task.getAssignee()); // ResponseMessage<UserVO> byId = lawsUserInfoService.getById(task.getAssignee());
map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); // map.put("LoginName",byId == null ? "" : byId.getData().getAccount());
JSONObject jsonLoginName = new JSONObject(map); // JSONObject jsonLoginName = new JSONObject(map);
notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); // notifyTodoSendContext.setTargets(jsonLoginName.toJSONString());
notifyTodoSendContext.setUserId(task.getAssignee()); // notifyTodoSendContext.setUserId(task.getAssignee());
oaService.setTodoDoneMq(notifyTodoSendContext); // oaService.setTodoDoneMq(notifyTodoSendContext);
} // }
} }
@Override @Override
@Async @Async
public NotifyTodoAppResult setTodoDone(NotifyTodoSendContext notifyTodoSendContext) throws Exception{ public NotifyTodoAppResult setTodoDone(NotifyTodoSendContext notifyTodoSendContext) throws Exception{
NotifyTodoAppResult notifyTodoAppResult = new NotifyTodoAppResult(); // NotifyTodoAppResult notifyTodoAppResult = new NotifyTodoAppResult();
String result = ""; // String result = "";
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); // SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
//
JsonSend jsonSend = new JsonSend(); // JsonSend jsonSend = new JsonSend();
HEAD head = new HEAD(); // HEAD head = new HEAD();
head.setACCOUNT("OA"); // head.setACCOUNT("OA");
head.setBIZTRANSACTIONID("SYC_161320210206133219"); // head.setBIZTRANSACTIONID("SYC_161320210206133219");
head.setCONSUMER("SPRS"); // head.setCONSUMER("SPRS");
head.setCOUNT("1"); // head.setCOUNT("1");
head.setPASSWORD("oa201611241710"); // head.setPASSWORD("oa201611241710");
head.setSRVLEVEL("1"); // head.setSRVLEVEL("1");
List<Object> list = new ArrayList<>(); // List<Object> list = new ArrayList<>();
list.add(notifyTodoSendContext); // list.add(notifyTodoSendContext);
jsonSend.setHEAD(head); // jsonSend.setHEAD(head);
jsonSend.setLIST(list); // jsonSend.setLIST(list);
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonSend); // net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonSend);
Map<String,String> mapCtr = new TreeMap<>(); // Map<String,String> mapCtr = new TreeMap<>();
mapCtr.put("Authorization",credentials); // mapCtr.put("Authorization",credentials);
log.info("处理完文件数据,开始请求发送已办接口数据:【"+sdf.format(new Date())+""); // log.info("处理完文件数据,开始请求发送已办接口数据:【"+sdf.format(new Date())+"】");
log.info("Done当前处理的文件数据(josnSend):"+jsonSend.toString()); // log.info("Done当前处理的文件数据(josnSend):"+jsonSend.toString());
log.info("Done当前处理的文件数据(notifyTodoSendContext):"+notifyTodoSendContext.toString()); // log.info("Done当前处理的文件数据(notifyTodoSendContext):"+notifyTodoSendContext.toString());
result = okHttpUtil.postForJson("https://fesbnew.foton.com.cn/WP_FOTON_FSOA/APP_DOC_SERVICES/Proxy_Services/TA_OA/DOC_SYC_1021_SendNotifyTodo_PS",json.toString(),mapCtr); // result = okHttpUtil.postForJson("https://fesbnew.foton.com.cn/WP_FOTON_FSOA/APP_DOC_SERVICES/Proxy_Services/TA_OA/DOC_SYC_1021_SendNotifyTodo_PS",json.toString(),mapCtr);
log.info("请求发送已办接口完毕,返回响应状态:【"+sdf.format(new Date())+""); // log.info("请求发送已办接口完毕,返回响应状态:【"+sdf.format(new Date())+"】");
// JSONObject jsonObject = JSONObject.parseObject(result); //// JSONObject jsonObject = JSONObject.parseObject(result);
if(!result.contains("操作成功")){ // if(!result.contains("操作成功")){
log.error("请求发送已办接口出现异常:"+result); // log.error("请求发送已办接口出现异常:"+result);
log.info("Done当前处理的文件数据(josnSend):"+jsonSend.toString()); // log.info("Done当前处理的文件数据(josnSend):"+jsonSend.toString());
log.info("Done当前处理的文件数据(notifyTodoSendContext):"+notifyTodoSendContext.toString()); // log.info("Done当前处理的文件数据(notifyTodoSendContext):"+notifyTodoSendContext.toString());
notifyTodoAppResult.setSIGN("1"); // notifyTodoAppResult.setSIGN("1");
notifyTodoAppResult.setMASSAGE(result); // notifyTodoAppResult.setMASSAGE(result);
}else { // }else {
log.info("--------------------------成功发送 ESP 已办 模块ID"+notifyTodoSendContext.getModelId()+"----------------------------"); // log.info("--------------------------成功发送 ESP 已办 模块ID"+notifyTodoSendContext.getModelId()+"----------------------------");
log.info("okHttp请求发送已办接口成功结果:"+result); // log.info("okHttp请求发送已办接口成功结果:"+result);
notifyTodoAppResult = (NotifyTodoAppResult) net.sf.json.JSONObject.toBean(net.sf.json.JSONObject.fromObject(result), NotifyTodoAppResult.class); // notifyTodoAppResult = (NotifyTodoAppResult) net.sf.json.JSONObject.toBean(net.sf.json.JSONObject.fromObject(result), NotifyTodoAppResult.class);
} // }
// try { // try {
// //
// } catch (Exception e) { // } catch (Exception e) {
// log.error(errMes, e.getMessage()); // log.error(errMes, e.getMessage());
// } // }
return notifyTodoAppResult; return null;
} }
@Override @Override
@Async @Async
public NotifyTodoAppResult sendTodo(BusProcessNew busProcessNew) throws Exception{ public NotifyTodoAppResult sendTodo(BusProcessNew busProcessNew) throws Exception{
NotifyTodoAppResult notifyTodoAppResult = new NotifyTodoAppResult(); // NotifyTodoAppResult notifyTodoAppResult = new NotifyTodoAppResult();
String result = ""; // String result = "";
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); // SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
JsonSend jsonSend = new JsonSend(); // JsonSend jsonSend = new JsonSend();
HEAD head = new HEAD(); // HEAD head = new HEAD();
head.setACCOUNT("OA"); // head.setACCOUNT("OA");
head.setBIZTRANSACTIONID("SYC_161320210206133219"); // head.setBIZTRANSACTIONID("SYC_161320210206133219");
head.setCONSUMER("SPRS"); // head.setCONSUMER("SPRS");
head.setCOUNT("1"); // head.setCOUNT("1");
head.setPASSWORD("oa201611241710"); // head.setPASSWORD("oa201611241710");
head.setSRVLEVEL("1"); // head.setSRVLEVEL("1");
List<Object> list = new ArrayList<>(); // List<Object> list = new ArrayList<>();
NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); // NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext();
// 待办来源的系统 // // 待办来源的系统
notifyTodoSendContext.setAppName("SPRS"); // notifyTodoSendContext.setAppName("SPRS");
//创建时间 // //创建时间
notifyTodoSendContext.setCreateTime(sdf.format(new Date())); // notifyTodoSendContext.setCreateTime(sdf.format(new Date()));
// 待办在原系统唯一标识 // // 待办在原系统唯一标识
notifyTodoSendContext.setModelId(busProcessNew.getId()); // notifyTodoSendContext.setModelId(busProcessNew.getId());
//模块名称 // //模块名称
notifyTodoSendContext.setModelName(busProcessNew.getTaskInfo()); // notifyTodoSendContext.setModelName(busProcessNew.getTaskInfo());
//标题 // //标题
notifyTodoSendContext.setSubject(busProcessNew.getPrcName()); // notifyTodoSendContext.setSubject(busProcessNew.getPrcName());
//地址 // //地址
QueryWrapper queryWrapper = new QueryWrapper(); // QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("PRC_ID", busProcessNew.getPId()); // queryWrapper.eq("PRC_ID", busProcessNew.getPId());
BusProcessName busProcessName = iBusProcessNameService.getOne(queryWrapper); // BusProcessName busProcessName = iBusProcessNameService.getOne(queryWrapper);
String linkParam = "&taskIds="+busProcessNew.getTaskId()+"&prcId="+busProcessNew.getPId()+"&prcNum="+busProcessName.getPrcNum()+"&prcName="+busProcessNew.getPrcName(); // String linkParam = "&taskIds="+busProcessNew.getTaskId()+"&prcId="+busProcessNew.getPId()+"&prcNum="+busProcessName.getPrcNum()+"&prcName="+busProcessNew.getPrcName();
notifyTodoSendContext.setLink(webUrl+busProcessNew.getLink()+linkParam); // notifyTodoSendContext.setLink(webUrl+busProcessNew.getLink()+linkParam);
//待办类型 // //待办类型
notifyTodoSendContext.setType("1"); // notifyTodoSendContext.setType("1");
//
Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();
ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId()); // ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId());
map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); // map.put("LoginName",byId == null ? "" : byId.getData().getAccount());
JSONObject jsonLoginName = new JSONObject(map); // JSONObject jsonLoginName = new JSONObject(map);
notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); // notifyTodoSendContext.setTargets(jsonLoginName.toJSONString());
list.add(notifyTodoSendContext); // list.add(notifyTodoSendContext);
jsonSend.setHEAD(head); // jsonSend.setHEAD(head);
jsonSend.setLIST(list); // jsonSend.setLIST(list);
net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonSend); // net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonSend);
Map<String,String> mapCtr = new TreeMap<>(); // Map<String,String> mapCtr = new TreeMap<>();
mapCtr.put("Authorization",credentials); // mapCtr.put("Authorization",credentials);
log.info("处理完文件数据,开始请求发送待办接口数据:【"+sdf.format(new Date())+""); // log.info("处理完文件数据,开始请求发送待办接口数据:【"+sdf.format(new Date())+"】");
log.info("sendTodo当前处理的文件数据(josnSend):"+jsonSend.toString()); // log.info("sendTodo当前处理的文件数据(josnSend):"+jsonSend.toString());
log.info("sendTodo当前处理的文件数据(notifyTodoSendContext):"+notifyTodoSendContext.toString()); // log.info("sendTodo当前处理的文件数据(notifyTodoSendContext):"+notifyTodoSendContext.toString());
result = okHttpUtil.postForJson("https://fesbnew.foton.com.cn/WP_FOTON_FSOA/APP_DOC_SERVICES/Proxy_Services/TA_OA/DOC_SYC_1019_SendTodo_PS",json.toString(),mapCtr); // result = okHttpUtil.postForJson("https://fesbnew.foton.com.cn/WP_FOTON_FSOA/APP_DOC_SERVICES/Proxy_Services/TA_OA/DOC_SYC_1019_SendTodo_PS",json.toString(),mapCtr);
log.info("请求发送待办接口完毕,返回响应状态:【"+sdf.format(new Date())+""); // log.info("请求发送待办接口完毕,返回响应状态:【"+sdf.format(new Date())+"】");
// JSONObject jsonObject = JSONObject.parseObject(result); //// JSONObject jsonObject = JSONObject.parseObject(result);
if(!result.contains("操作成功")){ // if(!result.contains("操作成功")){
log.error("请求发送待办接口出现异常:"+result); // log.error("请求发送待办接口出现异常:"+result);
log.info("sendTodo当前处理的文件数据(josnSend):"+jsonSend.toString()); // log.info("sendTodo当前处理的文件数据(josnSend):"+jsonSend.toString());
log.info("sendTodo当前处理的文件数据(notifyTodoSendContext):"+notifyTodoSendContext.toString()); // log.info("sendTodo当前处理的文件数据(notifyTodoSendContext):"+notifyTodoSendContext.toString());
notifyTodoAppResult.setSIGN("1"); // notifyTodoAppResult.setSIGN("1");
notifyTodoAppResult.setMASSAGE(result); // notifyTodoAppResult.setMASSAGE(result);
}else { // }else {
log.info("okHttp请求发送待办接口成功结果:"+result); // log.info("okHttp请求发送待办接口成功结果:"+result);
notifyTodoAppResult = (NotifyTodoAppResult) net.sf.json.JSONObject.toBean(net.sf.json.JSONObject.fromObject(result), NotifyTodoAppResult.class); // notifyTodoAppResult = (NotifyTodoAppResult) net.sf.json.JSONObject.toBean(net.sf.json.JSONObject.fromObject(result), NotifyTodoAppResult.class);
} // }
// try { // try {
// //
// //
@@ -425,7 +425,7 @@ public class WebServiceOAServiceImpl implements WebServiceOAService {
// log.error(errMes, e.getMessage()); // log.error(errMes, e.getMessage());
// } // }
return notifyTodoAppResult; return null;
} }
/** /**
@@ -434,45 +434,45 @@ public class WebServiceOAServiceImpl implements WebServiceOAService {
*/ */
@Async @Async
public void deleteOAByPidInfo(String pId){ public void deleteOAByPidInfo(String pId){
CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class); // CreateMQService oaService = SpringContextUtil.getBean(CreateMQService.class);
log.info("--------------------------ESP 批量发送删除待办任务----------------------------"); // log.info("--------------------------ESP 批量发送删除待办任务----------------------------");
//
QueryWrapper queryWrapper1 = new QueryWrapper(); // QueryWrapper queryWrapper1 = new QueryWrapper();
queryWrapper1.eq("P_ID",pId); // queryWrapper1.eq("P_ID",pId);
List<BusProcessNew> list = iBusProcessNewService.list(queryWrapper1); // List<BusProcessNew> list = iBusProcessNewService.list(queryWrapper1);
if(!list.isEmpty()){ // if(!list.isEmpty()){
List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>(); // List<NotifyTodoSendContext> notifyTodoSendContexts = new ArrayList<>();
list.forEach(busProcessNew -> { // list.forEach(busProcessNew -> {
NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext(); // NotifyTodoSendContext notifyTodoSendContext = new NotifyTodoSendContext();
notifyTodoSendContext.setAppName("SPRS"); // notifyTodoSendContext.setAppName("SPRS");
notifyTodoSendContext.setModelId(busProcessNew.getId()); // notifyTodoSendContext.setModelId(busProcessNew.getId());
notifyTodoSendContext.setModelName("技术标准起草"); // notifyTodoSendContext.setModelName("技术标准起草");
notifyTodoSendContext.setType("1"); // notifyTodoSendContext.setType("1");
notifyTodoSendContext.setOptType("2"); // notifyTodoSendContext.setOptType("2");
Map<String, Object> map = new HashMap<>(); // Map<String, Object> map = new HashMap<>();
ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId()); // ResponseMessage<UserVO> byId = lawsUserInfoService.getById(busProcessNew.getUserId());
map.put("LoginName",byId == null ? "" : byId.getData().getAccount()); // map.put("LoginName",byId == null ? "" : byId.getData().getAccount());
JSONObject jsonLoginName = new JSONObject(map); // JSONObject jsonLoginName = new JSONObject(map);
notifyTodoSendContext.setTargets(jsonLoginName.toJSONString()); // notifyTodoSendContext.setTargets(jsonLoginName.toJSONString());
notifyTodoSendContext.setUserId(busProcessNew.getUserId()); // notifyTodoSendContext.setUserId(busProcessNew.getUserId());
notifyTodoSendContexts.add(notifyTodoSendContext); // notifyTodoSendContexts.add(notifyTodoSendContext);
}); // });
for (NotifyTodoSendContext data: notifyTodoSendContexts){ // for (NotifyTodoSendContext data: notifyTodoSendContexts){
List<NotifyTodoSendContext> notifyTodoSendContextArrayList = new ArrayList<>(); // List<NotifyTodoSendContext> notifyTodoSendContextArrayList = new ArrayList<>();
notifyTodoSendContextArrayList.add(data); // notifyTodoSendContextArrayList.add(data);
Map<String,Object> map = new TreeMap<>(); // Map<String,Object> map = new TreeMap<>();
map.put("todoId",pId); // map.put("todoId",pId);
map.put("list",notifyTodoSendContextArrayList); // map.put("list",notifyTodoSendContextArrayList);
net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(map); // net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(map);
log.info("调用MQ数据!!!:"+jsonObject.toString()); // log.info("调用MQ数据!!!:"+jsonObject.toString());
OASendLog oaSendLog = new OASendLog(); // OASendLog oaSendLog = new OASendLog();
oaSendLog.setType("delete"); // oaSendLog.setType("delete");
oaSendLog.setCreateTime(new Date()); // oaSendLog.setCreateTime(new Date());
oaSendLog.setMeans("deleteOAByPid"); // oaSendLog.setMeans("deleteOAByPid");
oaSendLog.setMsgLog(jsonObject.toString()); // oaSendLog.setMsgLog(jsonObject.toString());
oaSendLogService.addOASendLog(oaSendLog); // oaSendLogService.addOASendLog(oaSendLog);
oaService.setTodoDeleteMq(jsonObject.toString()); // oaService.setTodoDeleteMq(jsonObject.toString());
} // }
} // }
} }
} }