Compare commits

...

2 Commits

Author SHA1 Message Date
fang b491c976e5 Merge remote-tracking branch 'origin/main' into main 2024-12-09 16:16:30 +08:00
fang 95213d5356 修改 2024-12-09 16:16:03 +08:00
6 changed files with 42 additions and 21 deletions

View File

@ -214,13 +214,13 @@ public class ToDoResendTack extends AbstractTask {
form.append("\"pendingAttr\":"); form.append("\"pendingAttr\":");
form.append("\"0\""); form.append("\"0\"");
form.append("}"); form.append("}");
CreateToDoHandler.get_CreateToDoHandler().sendCreateToDo(form.toString(),title,next.getLong("fid").toString(),username); CreateToDoHandler.get_CreateToDoHandler().sendCreateToDo(form.toString(),title,next.getLong("fid").toString(),username,next.getString("fbillno"));
break; break;
case "2": case "2":
DealToDoHandler.get_DealToDoHandler().sendDealToDo(next.getLong("fid"),username); DealToDoHandler.get_DealToDoHandler().sendDealToDo(next.getLong("fid"),username,next.getString("fbillno"));
break; break;
case "5": case "5":
deleteToDoHandler.get_deleteToDoHandler().sendDeleteToDo(next.getLong("fid"),username); deleteToDoHandler.get_deleteToDoHandler().sendDeleteToDo(next.getLong("fid"),username,next.getString("fbillno"));
break; break;
default: default:
break; break;

View File

@ -28,7 +28,8 @@ public class CreateToDoHandler {
} }
return _CreateToDoHandler; return _CreateToDoHandler;
} }
public boolean sendCreateToDo(String messageInfo,String title,String appRecordId,String userId) { public boolean
sendCreateToDo(String messageInfo,String title,String appRecordId,String userId,String number) {
logger.info("###进入待办推送接口数据组装"); logger.info("###进入待办推送接口数据组装");
try { try {
//调用接口结果 //调用接口结果
@ -37,18 +38,18 @@ public class CreateToDoHandler {
//接口调用结果 //接口调用结果
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject == null){ if(jsonObject == null){
RequestClient.getInstance().saveCreateToDo(title,ToDoCenterConstant.URI_send_addNew,false,result,messageInfo,appRecordId,userId); RequestClient.getInstance().saveCreateToDo(title,ToDoCenterConstant.URI_send_addNew,false,result,messageInfo,appRecordId,userId,number);
logger.info("###响应报文为空"); logger.info("###响应报文为空");
return false; return false;
}else{ }else{
if(Objects.equals("success",jsonObject.getString("status"))){ if(Objects.equals("success",jsonObject.getString("status"))){
//发送成功 //发送成功
//调用保存操作 //调用保存操作
RequestClient.getInstance().saveCreateToDo(title,ToDoCenterConstant.URI_send_addNew,true,result,messageInfo,appRecordId,userId); RequestClient.getInstance().saveCreateToDo(title,ToDoCenterConstant.URI_send_addNew,true,result,messageInfo,appRecordId,userId,number);
return true; return true;
}else{ }else{
//调用保存操作 //调用保存操作
RequestClient.getInstance().saveCreateToDo(title,ToDoCenterConstant.URI_send_addNew,false,result,messageInfo,appRecordId,userId); RequestClient.getInstance().saveCreateToDo(title,ToDoCenterConstant.URI_send_addNew,false,result,messageInfo,appRecordId,userId,number);
//发送失败 //发送失败
logger.error("###接口调通失败"); logger.error("###接口调通失败");
return false; return false;

View File

@ -28,7 +28,7 @@ public class DealToDoHandler {
return _DealToDoHandler; return _DealToDoHandler;
} }
public boolean sendDealToDo(Long appRecordId, String userId) { public boolean sendDealToDo(Long appRecordId, String userId,String number) {
try { try {
String part = "{ \"appRecordId\": \""+appRecordId+"\", \"userId\": \""+userId+"\" }"; String part = "{ \"appRecordId\": \""+appRecordId+"\", \"userId\": \""+userId+"\" }";
//调用接口结果 //调用接口结果
@ -38,17 +38,17 @@ public class DealToDoHandler {
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
if (jsonObject == null) { if (jsonObject == null) {
//发送失败 //发送失败
RequestClient.getInstance().saveDeLToDo(appRecordId, userId, ToDoCenterConstant.URI_SEND_finish, false, result, part, "2"); RequestClient.getInstance().saveDeLToDo(appRecordId, userId, ToDoCenterConstant.URI_SEND_finish, false, result, part, "2",number);
logger.info("###响应报文为空"); logger.info("###响应报文为空");
return false; return false;
} else { } else {
if(Objects.equals("success",jsonObject.getString("status"))){ if(Objects.equals("success",jsonObject.getString("status"))){
//发送成功 //发送成功
RequestClient.getInstance().saveDeLToDo(appRecordId, userId, ToDoCenterConstant.URI_SEND_finish, true, result, part, "2"); RequestClient.getInstance().saveDeLToDo(appRecordId, userId, ToDoCenterConstant.URI_SEND_finish, true, result, part, "2",number);
return true; return true;
} else { } else {
//发送失败 //发送失败
RequestClient.getInstance().saveDeLToDo(appRecordId, userId, ToDoCenterConstant.URI_SEND_finish, false, result, part, "2"); RequestClient.getInstance().saveDeLToDo(appRecordId, userId, ToDoCenterConstant.URI_SEND_finish, false, result, part, "2",number);
return false; return false;
} }
} }

View File

@ -28,7 +28,7 @@ public class deleteToDoHandler {
return _deleteToDoHandler; return _deleteToDoHandler;
} }
public boolean sendDeleteToDo(Long appRecordId,String userId) { public boolean sendDeleteToDo(Long appRecordId,String userId,String number) {
try { try {
//body //body
String part = "{ \"appRecordId\": \""+appRecordId+"\", \"userId\": \""+userId+"\" }"; String part = "{ \"appRecordId\": \""+appRecordId+"\", \"userId\": \""+userId+"\" }";
@ -38,16 +38,16 @@ public class deleteToDoHandler {
//接口调用结果 //接口调用结果
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
if(jsonObject== null){ if(jsonObject== null){
RequestClient.getInstance().saveDeLToDo(appRecordId,userId,ToDoCenterConstant.URI_send_deleteP,false,result,part,"5"); RequestClient.getInstance().saveDeLToDo(appRecordId,userId,ToDoCenterConstant.URI_send_deleteP,false,result,part,"5",number);
logger.info("###响应报文为空"); logger.info("###响应报文为空");
return false; return false;
}else{ }else{
if(Objects.equals("success",jsonObject.getString("status"))){ if(Objects.equals("success",jsonObject.getString("status"))){
//发送成功 //发送成功
RequestClient.getInstance().saveDeLToDo(appRecordId,userId,ToDoCenterConstant.URI_send_deleteP,true,result,part,"5"); RequestClient.getInstance().saveDeLToDo(appRecordId,userId,ToDoCenterConstant.URI_send_deleteP,true,result,part,"5",number);
return true; return true;
}else{ }else{
RequestClient.getInstance().saveDeLToDo(appRecordId,userId,ToDoCenterConstant.URI_send_deleteP,false,result,part,"5"); RequestClient.getInstance().saveDeLToDo(appRecordId,userId,ToDoCenterConstant.URI_send_deleteP,false,result,part,"5",number);
return false; return false;
} }
} }

View File

@ -105,7 +105,8 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
//业务自定义数据 //业务自定义数据
backlogMessage.setJsonData("");*/ backlogMessage.setJsonData("");*/
logger.info("###待办拼接请求体:"+form); logger.info("###待办拼接请求体:"+form);
CreateToDoHandler.get_CreateToDoHandler().sendCreateToDo(form.toString(),todoInfo.getTitle(),todoInfo.getTaskId().toString(),query_one.getString("username")); CreateToDoHandler.get_CreateToDoHandler().sendCreateToDo(form.toString(),todoInfo.getTitle(),
todoInfo.getTaskId().toString(),query_one.getString("username"),dynamicObject.getString("billno"));
} }
logger.info("###结束待办_createToDo"); logger.info("###结束待办_createToDo");
@ -118,10 +119,16 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
List<Long> userIds = info.getUserIds(); List<Long> userIds = info.getUserIds();
logger.info("####已办taskid:"+info.getTaskId()); logger.info("####已办taskid:"+info.getTaskId());
DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone,username", new QFilter[]{new QFilter("id", "in", userIds)}); DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone,username", new QFilter[]{new QFilter("id", "in", userIds)});
//业务id DynamicObject dynamicObject = QueryServiceHelper.queryOne("wf_hitaskinst", "billno",
new QFilter[]{new QFilter("id", "=", info.getTaskId())});
//业务id
Long taskId = ctx.getTaskId(); Long taskId = ctx.getTaskId();
for (DynamicObject queryOne : query) { for (DynamicObject queryOne : query) {
DealToDoHandler.get_DealToDoHandler().sendDealToDo(taskId,queryOne.getString("username")); if(dynamicObject != null){
DealToDoHandler.get_DealToDoHandler().sendDealToDo(taskId,queryOne.getString("username"),dynamicObject.getString("billno"));
}else{
DealToDoHandler.get_DealToDoHandler().sendDealToDo(taskId,queryOne.getString("username"),"");
}
} }
logger.info("###结束已办_dealToDo"); logger.info("###结束已办_dealToDo");
@ -132,11 +139,18 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
logger.info("###创建撤销_deleteToDo"); logger.info("###创建撤销_deleteToDo");
List<Long> userIds = info.getUserIds(); List<Long> userIds = info.getUserIds();
DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone,username", new QFilter[]{new QFilter("id", "in", userIds)}); DynamicObjectCollection query = QueryServiceHelper.query("bos_user", "id,name,phone,username", new QFilter[]{new QFilter("id", "in", userIds)});
DynamicObject dynamicObject = QueryServiceHelper.queryOne("wf_hitaskinst", "billno",
new QFilter[]{new QFilter("id", "=", info.getTaskId())});
//业务id //业务id
Long taskId = ctx.getTaskId(); Long taskId = ctx.getTaskId();
logger.info("####撤销taskid:"+info.getTaskId()); logger.info("####撤销taskid:"+info.getTaskId());
for (DynamicObject queryOne : query) { for (DynamicObject queryOne : query) {
deleteToDoHandler.get_deleteToDoHandler().sendDeleteToDo(taskId,queryOne.getString("username")); if(dynamicObject != null){
deleteToDoHandler.get_deleteToDoHandler().sendDeleteToDo(taskId,queryOne.getString("username"),dynamicObject.getString("billno"));
}else{
deleteToDoHandler.get_deleteToDoHandler().sendDeleteToDo(taskId,queryOne.getString("username"),"");
}
} }
logger.info("###结束撤销_deleteToDo"); logger.info("###结束撤销_deleteToDo");
} }

View File

@ -93,7 +93,7 @@ public class RequestClient {
* @param result 响应报文 * @param result 响应报文
* @param jsonMessage 请求报文 * @param jsonMessage 请求报文
*/ */
public void saveCreateToDo(String title,String url, boolean isTrue,String result,String jsonMessage,String appRecordId,String userId){ public void saveCreateToDo(String title,String url, boolean isTrue,String result,String jsonMessage,String appRecordId,String userId,String number){
logger.info("###开始调用待办保存日志方法"); logger.info("###开始调用待办保存日志方法");
StringBuffer urlStr = new StringBuffer(); StringBuffer urlStr = new StringBuffer();
urlStr.append(this.protocal).append("://").append(this.ip); urlStr.append(this.protocal).append("://").append(this.ip);
@ -116,6 +116,9 @@ public class RequestClient {
dynamicObject.set("shkd_response_tag",result); dynamicObject.set("shkd_response_tag",result);
dynamicObject.set("shkd_status","0"); dynamicObject.set("shkd_status","0");
dynamicObject.set("billstatus","C"); dynamicObject.set("billstatus","C");
if(StringUtils.isNotEmpty(number)){
dynamicObject.set("shkd_number",number);
}
Object[] save = SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); Object[] save = SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
logger.info("###保存日志表后id"+dynamicObject.getPkValue()); logger.info("###保存日志表后id"+dynamicObject.getPkValue());
logger.info("save结果"+save.toString()); logger.info("save结果"+save.toString());
@ -135,7 +138,7 @@ public class RequestClient {
* @param jsonMessage 请求报文 * @param jsonMessage 请求报文
* @param status 类型 2已办 5撤销 * @param status 类型 2已办 5撤销
*/ */
public void saveDeLToDo(Long appRecordId,String userId,String url,boolean isTrue,String result,String jsonMessage,String status){ public void saveDeLToDo(Long appRecordId,String userId,String url,boolean isTrue,String result,String jsonMessage,String status,String number){
logger.info("###开始调用已办、撤销保存日志方法"); logger.info("###开始调用已办、撤销保存日志方法");
StringBuffer urlStr = new StringBuffer(); StringBuffer urlStr = new StringBuffer();
urlStr.append(this.protocal).append("://").append(this.ip); urlStr.append(this.protocal).append("://").append(this.ip);
@ -156,6 +159,9 @@ public class RequestClient {
dynamicObject.set("shkd_response_tag",result); dynamicObject.set("shkd_response_tag",result);
dynamicObject.set("shkd_status",status); dynamicObject.set("shkd_status",status);
dynamicObject.set("billstatus","C"); dynamicObject.set("billstatus","C");
if(StringUtils.isNotEmpty(number)){
dynamicObject.set("shkd_number",number);
}
Object[] save = SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); Object[] save = SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
logger.info("###保存日志表id"+dynamicObject.getPkValue()); logger.info("###保存日志表id"+dynamicObject.getPkValue());
logger.info("save结果"+save.toString()); logger.info("save结果"+save.toString());