fix: OA发送失败的补发
This commit is contained in:
+37
@@ -5,6 +5,7 @@ import java.util.*;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tmsps.fk.common.util.JsonUtil;
|
||||
import com.ydw.bat.wkflow.business_activiti.dto.*;
|
||||
@@ -22,6 +23,8 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessEntrustService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNameService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.ISendTodoLogService;
|
||||
import com.ydw.bat.wkflow.business_main.datas.service.impl.SendTodoLogServiceImpl;
|
||||
import com.ydw.bat.wkflow.business_oa.webService.service.WebServiceOAService;
|
||||
import com.ydw.bat.wkflow.business_oa.webService.todoContent.NotifyTodoSendContext;
|
||||
import com.ydw.bat.wkflow.business_oa.webService.todoContent.SendOAContent;
|
||||
@@ -83,4 +86,38 @@ public class WebServiceOAController extends BaseAction {
|
||||
return WrapMapper.ok(result);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ISendTodoLogService sendTodoLogService;
|
||||
@ApiOperation(value = "OA发送失败的补发")
|
||||
@GetMapping("/reissueSendOA")
|
||||
public String reissueSendOA() throws Exception {
|
||||
LambdaQueryWrapper<SendTodoLog> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SendTodoLog::getOperMesg,"okhttp post error >> ex = {} sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target");
|
||||
wrapper.gt(SendTodoLog::getCreateTime,"2024-04-19 18:00:00");
|
||||
wrapper.orderByAsc(SendTodoLog::getCreateTime);
|
||||
List<SendTodoLog> sendTodoLogList = sendTodoLogService.list(wrapper);
|
||||
for (SendTodoLog sendTodoLog : sendTodoLogList) {
|
||||
String msgType = sendTodoLog.getMsgType();
|
||||
String mesg = sendTodoLog.getMesg();
|
||||
JSONObject jsonObject = JSONObject.parseObject(mesg);
|
||||
if ("0".equals(msgType)) {
|
||||
// 待办
|
||||
JSONObject processNewJsonObject = jsonObject.getJSONObject("mesg");
|
||||
BusProcessNew busProcessNew = JSONObject.toJavaObject(processNewJsonObject, BusProcessNew.class);
|
||||
webServiceOAService.sendTodo(busProcessNew);
|
||||
} else if ("1".equals(msgType)) {
|
||||
// 已办
|
||||
JSONObject notifyTodoSendContextJsonObject = JSONObject.parseObject(mesg);
|
||||
NotifyTodoSendContext notifyTodoSendContext = JSONObject.toJavaObject(notifyTodoSendContextJsonObject, NotifyTodoSendContext.class);
|
||||
webServiceOAService.setTodoDone(notifyTodoSendContext);
|
||||
} else if ("3".equals(msgType)) {
|
||||
// 删除
|
||||
String todoId = sendTodoLog.getTodoId();
|
||||
String userId = sendTodoLog.getUserId();
|
||||
webServiceOAService.deleteOAByMandatory(todoId,userId);
|
||||
}
|
||||
}
|
||||
return "ok";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user