Commit e621cf6c authored by 廖旭伟's avatar 廖旭伟

修改办事情形查询接口

parent a6343c55
......@@ -133,7 +133,7 @@ public class ComplexApiController {
rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel());
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
try {
req.setNonce(RandomUtil.randomNumbers(8));
req.setNonce(RandomUtil.randomNumbers(6));
cacheService.lpush(KEY_COMPLEX_REQ, JSONObject.toJSONString(req));
String rest = cacheService.blpop(KEY_EVENT_IMPLEMENTATION_RESP + req.getNonce(), HTTP_TIMEOUT, String.class);
if (ObjectUtil.isEmpty(rest)) {
......@@ -345,38 +345,6 @@ public class ComplexApiController {
}
}
/**
* 查询办理事项情形
*
* @param req
* @return
*/
@PostMapping("bus-situation-material/judgmentExist")
@UnAuth
public String judgmentExist(@RequestBody ComplexImplementationReq req) {
log.info("【查询办理事项情形】【请求体】--> " + JSONObject.toJSONString(req));
req.setUrlPath("bus-situation-material/judgmentExist");
ApiResp<String> rsp = new ApiResp<>();
rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel());
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
try {
req.setNonce(RandomUtil.randomNumbers(6));
cacheService.lpush(KEY_COMPLEX_REQ, JSONObject.toJSONString(req));
String rest = cacheService.blpop(KEY_EVENT_IMPLEMENTATION_RESP + req.getNonce(), HTTP_TIMEOUT, String.class);
if (ObjectUtil.isEmpty(rest)) {
throw new AppException("请求访问超时");
}
Rest<ComplexStituationInfo> eventRest = JSON.parseObject(rest, new TypeReference<Rest<ComplexStituationInfo>>() {
});
return JSON.toJSONString(eventRest);
} catch (Exception e) {
log.error("接收数据失败", e);
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
rsp.setMsg(e.getMessage());
return JSON.toJSONString(rsp);
}
}
public static void main(String[] args) {
File file = new File("E:\\pic\\1.png");
......
......@@ -4,8 +4,6 @@ import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICacheService;
import com.mortals.xhx.protocol.complex.matter.model.req.ImplementationReq;
import com.mortals.xhx.protocol.complex.matter.model.rsp.implement.ImplementDetailInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.material.MaterialInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.matter.MatterWorkInfo;
import com.mortals.xhx.protocol.complex.matter.service.IComplexMatterService;
import com.mortals.xhx.utils.SpringUtils;
......@@ -39,7 +37,7 @@ public class ImplementSituationSendTask implements Runnable {
public void run() {
try {
log.info("ImplementSituationSendTask启动发送");
Rest<List<MaterialInfo>> rest = complexMatterService.getMaterialByEventAndSituation(deviceLogo, implementationReq);
Rest<List<MatterWorkInfo>> rest = complexMatterService.doWorkMatterSearch(deviceLogo, implementationReq.getEventId());
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
} catch (Exception e) {
......
......@@ -79,13 +79,8 @@ public class SendThread extends AbstractThread {
ComplexAcceptReq complexAcceptReq = JSONObject.parseObject(reqStr, ComplexAcceptReq.class);
ImplementAcceptSendTask acceptSendTask = new ImplementAcceptSendTask(deviceCode, complexAcceptReq);
ThreadPool.getInstance().execute(acceptSendTask);
} else if ("bus-situation-material/judgmentExist".equals(urlPath)) {
ComplexAcceptReq complexAcceptReq = JSONObject.parseObject(reqStr, ComplexAcceptReq.class);
ImplementAcceptSendTask acceptSendTask = new ImplementAcceptSendTask(deviceCode, complexAcceptReq);
ThreadPool.getInstance().execute(acceptSendTask);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment