This commit is contained in:
fang 2024-11-14 11:02:45 +08:00
parent a1956b40d3
commit 45bc094c89
3 changed files with 13 additions and 5 deletions

View File

@ -29,6 +29,7 @@ public class CreateToDoHandler {
return _CreateToDoHandler; return _CreateToDoHandler;
} }
public boolean sendCreateToDo(BacklogMessage messageInfo) { public boolean sendCreateToDo(BacklogMessage messageInfo) {
logger.info("###进入待办推送接口数据组装");
try { try {
//body //body
JSONObject jsonObject2 = new JSONObject(); JSONObject jsonObject2 = new JSONObject();
@ -36,6 +37,7 @@ public class CreateToDoHandler {
String jsonMessage = jsonObject2.toJSONString(); String jsonMessage = jsonObject2.toJSONString();
//调用接口结果 //调用接口结果
String result = RequestClient.getInstance().callService(ToDoCenterConstant.URI_send_addNew,jsonMessage); String result = RequestClient.getInstance().callService(ToDoCenterConstant.URI_send_addNew,jsonMessage);
logger.info("###接口返回结果"+result);
//接口调用结果 //接口调用结果
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
if(Objects.equals("success",jsonObject.getString("status"))){ if(Objects.equals("success",jsonObject.getString("status"))){
@ -47,7 +49,7 @@ public class CreateToDoHandler {
//调用保存操作 //调用保存操作
RequestClient.getInstance().saveCreateToDo(messageInfo.getTitle(),ToDoCenterConstant.URI_send_addNew,false,result,jsonMessage); RequestClient.getInstance().saveCreateToDo(messageInfo.getTitle(),ToDoCenterConstant.URI_send_addNew,false,result,jsonMessage);
//发送失败 //发送失败
logger.error("##接口调通失败"); logger.error("###接口调通失败");
return false; return false;
} }
} catch (Exception e) { } catch (Exception e) {

View File

@ -37,6 +37,7 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone", new QFilter[]{new QFilter("id", "in", userIds)}); DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone", new QFilter[]{new QFilter("id", "in", userIds)});
DynamicObject dynamicObject = QueryServiceHelper.queryOne("wf_hitaskinst", "billno,startname,id,name", DynamicObject dynamicObject = QueryServiceHelper.queryOne("wf_hitaskinst", "billno,startname,id,name",
new QFilter[]{new QFilter("id", "=", todoInfo.getTaskId())}); new QFilter[]{new QFilter("id", "=", todoInfo.getTaskId())});
logger.info("####待办taskid:"+todoInfo.getTaskId());
for (DynamicObject query_one : query) { for (DynamicObject query_one : query) {
BacklogMessage backlogMessage = new BacklogMessage(); BacklogMessage backlogMessage = new BacklogMessage();
@ -87,6 +88,7 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
logger.info("###创建已办_dealToDo"); logger.info("###创建已办_dealToDo");
//几个已办 //几个已办
List<Long> userIds = info.getUserIds(); List<Long> userIds = info.getUserIds();
logger.info("####已办taskid:"+info.getTaskId());
DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone", new QFilter[]{new QFilter("id", "in", userIds)}); DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone", new QFilter[]{new QFilter("id", "in", userIds)});
//业务id //业务id
Long taskId = ctx.getTaskId(); Long taskId = ctx.getTaskId();
@ -103,6 +105,7 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone", new QFilter[]{new QFilter("id", "in", userIds)}); DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone", new QFilter[]{new QFilter("id", "in", userIds)});
//业务id //业务id
Long taskId = ctx.getTaskId(); Long taskId = ctx.getTaskId();
logger.info("####撤销taskid:"+info.getTaskId());
for (DynamicObject queryOne : query) { for (DynamicObject queryOne : query) {
deleteToDoHandler.get_deleteToDoHandler().sendDeleteToDo(taskId,queryOne.getString("phone")); deleteToDoHandler.get_deleteToDoHandler().sendDeleteToDo(taskId,queryOne.getString("phone"));
} }

View File

@ -76,6 +76,7 @@ public class RequestClient {
} }
private Map<String, String> getHeaders(){ private Map<String, String> getHeaders(){
logger.info("###进入拼接请求头方法");
Map<String,String> header=new HashMap<>(); Map<String,String> header=new HashMap<>();
String timestamp = Long.toString(System.currentTimeMillis() / 1000); String timestamp = Long.toString(System.currentTimeMillis() / 1000);
byte[] securityKey = this.clientSecret.substring(10, 26).getBytes(); byte[] securityKey = this.clientSecret.substring(10, 26).getBytes();
@ -103,9 +104,9 @@ public class RequestClient {
urlStr.append(":").append(this.port); urlStr.append(":").append(this.port);
} }
urlStr.append(url);; urlStr.append(url);;
logger.info("保存时,环境参数,protocal:"+this.protocal+",ip:"+this.ip+",this.port:"+this.port); logger.info("###保存时,环境参数,protocal:"+this.protocal+",ip:"+this.ip+",this.port:"+this.port);
DynamicObject dynamicObject = BusinessDataServiceHelper.newDynamicObject("shkd_backlog"); DynamicObject dynamicObject = BusinessDataServiceHelper.newDynamicObject("shkd_backlog");
logger.info("保存日志表id"+dynamicObject.getPkValue()); logger.info("###保存日志表id"+dynamicObject.getPkValue());
dynamicObject.set("shkd_url",urlStr); dynamicObject.set("shkd_url",urlStr);
dynamicObject.set("shkd_request",title); dynamicObject.set("shkd_request",title);
dynamicObject.set("shkd_request_tag",jsonMessage); dynamicObject.set("shkd_request_tag",jsonMessage);
@ -113,7 +114,7 @@ public class RequestClient {
dynamicObject.set("shkd_response",result); dynamicObject.set("shkd_response",result);
dynamicObject.set("shkd_status","0"); dynamicObject.set("shkd_status","0");
SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
logger.info("保存日志表id"+dynamicObject.getPkValue()); logger.info("###保存日志表id"+dynamicObject.getPkValue());
logger.info("###结束调用待办保存日志方法"); logger.info("###结束调用待办保存日志方法");
} }
/*** /***
@ -141,7 +142,9 @@ public class RequestClient {
dynamicObject.set("shkd_response",isTrue); dynamicObject.set("shkd_response",isTrue);
dynamicObject.set("shkd_response",result); dynamicObject.set("shkd_response",result);
dynamicObject.set("shkd_status",status); dynamicObject.set("shkd_status",status);
logger.info("###开始调用已办、撤销保存日志方法"); SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
logger.info("###保存日志表id"+dynamicObject.getPkValue());
logger.info("###结束调用已办、撤销保存日志方法");
} }