Commit 1ff79323 authored by 赵啸非's avatar 赵啸非

添加事项材料与情形查询

parent 44e1167d
...@@ -24,7 +24,9 @@ public class ComplexImplementationReq extends BaseApiReq { ...@@ -24,7 +24,9 @@ public class ComplexImplementationReq extends BaseApiReq {
private List<String> itemsIds; private List<String> itemsIds;
private List<String> eventIdList;
private String dict;
} }
package com.mortals.xhx.busiz.rsp.work;
import lombok.Data;
import java.util.List;
@Data
public class ComplexWorkInfo {
private String fieldGenerateRules;
private String commonCharacterName;
private Object defaultValue;
private String hcFillRule;
private String defaultValueRules;
private Object xpath;
private Object regularName;
private String handlingCharacterPackage;
private int hcOrder;
private int elCol;
private String state;
private Object commonCharacterComment;
private Object parentValue;
private String commonCharacterCode;
private String commonCharacterId;
private String commonCharacterType;
private int userId;
private String assType;
private Object parentId;
private String regularId;
private String tacheStep;
private Object checkTrictly;
private String handlingCharacterTemplateId;
private Object parentMovement;
private Object regularVal;
private String allowModify;
private String stateDate;
private int commonCharacterLength;
private List<Object> items;
private String dataInterfaceType;
}
\ No newline at end of file
...@@ -18,8 +18,10 @@ import com.mortals.xhx.busiz.rsp.ImplementEventInfo; ...@@ -18,8 +18,10 @@ import com.mortals.xhx.busiz.rsp.ImplementEventInfo;
import com.mortals.xhx.busiz.rsp.implement.ComplexImplementDetailInfo; import com.mortals.xhx.busiz.rsp.implement.ComplexImplementDetailInfo;
import com.mortals.xhx.busiz.rsp.material.ComplexMaterialInfo; import com.mortals.xhx.busiz.rsp.material.ComplexMaterialInfo;
import com.mortals.xhx.busiz.rsp.situation.ComplexStituationInfo; import com.mortals.xhx.busiz.rsp.situation.ComplexStituationInfo;
import com.mortals.xhx.busiz.rsp.work.ComplexWorkInfo;
import com.mortals.xhx.common.code.ApiRespCodeEnum; import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.protocol.complex.ComplexApiRest; import com.mortals.xhx.protocol.complex.ComplexApiRest;
import com.mortals.xhx.protocol.complex.matter.model.rsp.DictInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -196,7 +198,72 @@ public class ComplexApiController { ...@@ -196,7 +198,72 @@ public class ComplexApiController {
if (ObjectUtil.isEmpty(rest)) { if (ObjectUtil.isEmpty(rest)) {
throw new AppException("请求访问超时"); throw new AppException("请求访问超时");
} }
Rest<ComplexMaterialInfo> eventRest = JSON.parseObject(rest, new TypeReference<Rest<ComplexMaterialInfo>>() { Rest<List<ComplexMaterialInfo>> eventRest = JSON.parseObject(rest, new TypeReference<Rest<List<ComplexMaterialInfo>>>() {
});
return JSON.toJSONString(eventRest);
} catch (Exception e) {
log.error("接收数据失败", e);
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
rsp.setMsg(e.getMessage());
return JSON.toJSONString(rsp);
}
}
/**
* 获取办件要素
*
* @param req
* @return
*/
@PostMapping("event-implementation/getDynamicFormByEventIds")
@UnAuth
public String getDynamicFormByEventIds(@RequestBody ComplexImplementationReq req) {
log.info("【获取办件要素】【请求体】--> " + JSONObject.toJSONString(req));
req.setUrlPath("event-implementation/getDynamicFormByEventIds");
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<ComplexWorkInfo> eventRest = JSON.parseObject(rest, new TypeReference<Rest<ComplexWorkInfo>>() {
});
return JSON.toJSONString(eventRest);
} catch (Exception e) {
log.error("接收数据失败", e);
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
rsp.setMsg(e.getMessage());
return JSON.toJSONString(rsp);
}
}
/**
* 查询字典值
*
* @param req
* @return
*/
@PostMapping("common/queryDict")
@UnAuth
public String queryDict(@RequestBody ComplexImplementationReq req) {
log.info("【查询字典值】【请求体】--> " + JSONObject.toJSONString(req));
req.setUrlPath("common/queryDict");
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<List<DictInfo>> eventRest = JSON.parseObject(rest, new TypeReference<Rest<List<DictInfo>>>() {
}); });
return JSON.toJSONString(eventRest); return JSON.toJSONString(eventRest);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -14,5 +14,9 @@ public class BaseReq implements Serializable { ...@@ -14,5 +14,9 @@ public class BaseReq implements Serializable {
private String eventIds; private String eventIds;
private String dict;
private List<String> itemsIds; private List<String> itemsIds;
private List<String> eventIdList;
} }
package com.mortals.xhx.protocol.complex.matter.model.rsp;
import lombok.Data;
/**
* 字典
* @author: zxfei
* @date: 2023/12/1 15:42
*/
@Data
public class DictInfo{
private String itemText;
private String itemValue;
}
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.mortals.xhx.protocol.complex.matter.model.req.AcceptReq; ...@@ -7,6 +7,7 @@ import com.mortals.xhx.protocol.complex.matter.model.req.AcceptReq;
import com.mortals.xhx.protocol.complex.matter.model.req.DeviceLoginReq; import com.mortals.xhx.protocol.complex.matter.model.req.DeviceLoginReq;
import com.mortals.xhx.protocol.complex.matter.model.req.ImplementationReq; import com.mortals.xhx.protocol.complex.matter.model.req.ImplementationReq;
import com.mortals.xhx.protocol.complex.matter.model.rsp.AcceptRspInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.AcceptRspInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.DictInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.LoginRspInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.LoginRspInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.implement.ImplementDetailInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.implement.ImplementDetailInfo;
...@@ -59,7 +60,6 @@ public interface IComplexMatterService extends IComplexService { ...@@ -59,7 +60,6 @@ public interface IComplexMatterService extends IComplexService {
Rest<MatterListInfo> findMatters(String deviceLogo, ImplementationReq implementationReq); Rest<MatterListInfo> findMatters(String deviceLogo, ImplementationReq implementationReq);
/** /**
* 查询事项所需材料根据事项与情形id * 查询事项所需材料根据事项与情形id
* *
...@@ -70,7 +70,6 @@ public interface IComplexMatterService extends IComplexService { ...@@ -70,7 +70,6 @@ public interface IComplexMatterService extends IComplexService {
Rest<List<MaterialInfo>> getMaterialByEventAndSituation(String deviceLogo, ImplementationReq implementationReq); Rest<List<MaterialInfo>> getMaterialByEventAndSituation(String deviceLogo, ImplementationReq implementationReq);
/** /**
* 查询事项所需材料 * 查询事项所需材料
* *
...@@ -81,25 +80,23 @@ public interface IComplexMatterService extends IComplexService { ...@@ -81,25 +80,23 @@ public interface IComplexMatterService extends IComplexService {
Rest<List<MaterialInfo>> getMaterialByEvent(String deviceLogo, String eventId); Rest<List<MaterialInfo>> getMaterialByEvent(String deviceLogo, String eventId);
/** /**
* 查询办理事项情形 * 查询办理事项情形
* *
* @param eventIds * @param eventIds
* @return * @return
*/ */
Rest<MatterWorkInfo> doWorkMatterSearch(String deviceLogo, String eventIds); Rest<List<MatterWorkInfo>> doWorkMatterSearch(String deviceLogo, String eventIds);
/** /**
* 获取办件要素 * 获取办件要素
* *
* @param deviceLogo * @param deviceLogo
* @param eventIds * @param eventIdList
* @return * @return
*/ */
Rest<WorkInfo> getWorkMatter(String deviceLogo, String eventIds); Rest<WorkInfo> getWorkMatter(String deviceLogo, List<String> eventIdList);
/** /**
...@@ -112,4 +109,13 @@ public interface IComplexMatterService extends IComplexService { ...@@ -112,4 +109,13 @@ public interface IComplexMatterService extends IComplexService {
Rest<ImplementDetailInfo> getImplement(String deviceLogo, String eventId); Rest<ImplementDetailInfo> getImplement(String deviceLogo, String eventId);
/**
* 查询字典
*
* @param deviceLogo
* @param dict
* @return
*/
Rest<List<DictInfo>> queryDict(String deviceLogo, String dict);
} }
...@@ -14,6 +14,7 @@ import com.mortals.xhx.protocol.complex.matter.model.req.AcceptReq; ...@@ -14,6 +14,7 @@ import com.mortals.xhx.protocol.complex.matter.model.req.AcceptReq;
import com.mortals.xhx.protocol.complex.matter.model.req.DeviceLoginReq; import com.mortals.xhx.protocol.complex.matter.model.req.DeviceLoginReq;
import com.mortals.xhx.protocol.complex.matter.model.req.ImplementationReq; import com.mortals.xhx.protocol.complex.matter.model.req.ImplementationReq;
import com.mortals.xhx.protocol.complex.matter.model.rsp.AcceptRspInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.AcceptRspInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.DictInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.LoginRspInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.LoginRspInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.MatterListInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.implement.ImplementDetailInfo; import com.mortals.xhx.protocol.complex.matter.model.rsp.implement.ImplementDetailInfo;
...@@ -140,7 +141,7 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements ...@@ -140,7 +141,7 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements
} }
@Override @Override
public Rest<MatterWorkInfo> doWorkMatterSearch(String deviceLogo, String eventIds) { public Rest<List<MatterWorkInfo>> doWorkMatterSearch(String deviceLogo, String eventIds) {
String mattersApi = host + "bus-situation-material/getSituationMaterialTreeByEventIds"; String mattersApi = host + "bus-situation-material/getSituationMaterialTreeByEventIds";
Map<String, String> paramMap = new HashMap<>(); Map<String, String> paramMap = new HashMap<>();
paramMap.put("eventIds", eventIds); paramMap.put("eventIds", eventIds);
...@@ -153,24 +154,20 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements ...@@ -153,24 +154,20 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements
ComplexApiRest<List<MatterWorkInfo>> complexApiRest = JSON.parseObject(rest, new TypeReference<ComplexApiRest<List<MatterWorkInfo>>>() { ComplexApiRest<List<MatterWorkInfo>> complexApiRest = JSON.parseObject(rest, new TypeReference<ComplexApiRest<List<MatterWorkInfo>>>() {
}); });
if (complexApiRest.getSuccess()) { if (complexApiRest.getSuccess()) {
if (!ObjectUtils.isEmpty(complexApiRest.getResult())) { return Rest.ok(complexApiRest.getMessage(), complexApiRest.getResult());
return Rest.ok(complexApiRest.getMessage(), complexApiRest.getResult().get(0));
} else {
return Rest.fail("查询结果数量为0");
}
} }
return Rest.fail(complexApiRest.getMessage()); return Rest.fail(complexApiRest.getMessage());
} }
@Override @Override
public Rest<WorkInfo> getWorkMatter(String deviceLogo, String eventIds) { public Rest<WorkInfo> getWorkMatter(String deviceLogo, List<String> eventIdList) {
String mattersApi = host + "event-implementation/getDynamicFormByEventIds"; String mattersApi = host + "event-implementation/getDynamicFormByEventIds";
ArrayList<String> list = new ArrayList<>();
list.add(eventIds);
String deviceToken = checkToken(deviceLogo); String deviceToken = checkToken(deviceLogo);
String rest = HttpUtil.createPost(mattersApi) String rest = HttpUtil.createPost(mattersApi)
.header("X-Access-Token", deviceToken) .header("X-Access-Token", deviceToken)
.body(JSON.toJSONString(list)) .body(JSON.toJSONString(eventIdList))
.execute().body(); .execute().body();
ComplexApiRest<WorkInfo> complexApiRest = JSON.parseObject(rest, new TypeReference<ComplexApiRest<WorkInfo>>() { ComplexApiRest<WorkInfo> complexApiRest = JSON.parseObject(rest, new TypeReference<ComplexApiRest<WorkInfo>>() {
}); });
...@@ -196,6 +193,25 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements ...@@ -196,6 +193,25 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements
return Rest.fail(complexApiRest.getMessage()); return Rest.fail(complexApiRest.getMessage());
} }
@Override
public Rest<List<DictInfo>> queryDict(String deviceLogo, String dict) {
String mattersApi = host + "common/queryDict";
Map<String, String> paramMap = new HashMap<>();
paramMap.put("dict", dict);
String deviceToken = checkToken(deviceLogo);
String rest = HttpUtil.createGet(mattersApi)
.header("X-Access-Token", deviceToken)
.formStr(paramMap)
.execute().body();
log.info("dict resp:{}", rest);
ComplexApiRest<List<DictInfo>> complexApiRest = JSON.parseObject(rest, new TypeReference<ComplexApiRest<List<DictInfo>>>() {
});
if (complexApiRest.getSuccess()) {
return Rest.ok(complexApiRest.getMessage(), complexApiRest.getResult());
}
return Rest.fail(complexApiRest.getMessage());
}
@Override @Override
public Rest<List<MaterialInfo>> getMaterialByEventAndSituation(String deviceLogo, ImplementationReq implementationReq) { public Rest<List<MaterialInfo>> getMaterialByEventAndSituation(String deviceLogo, ImplementationReq implementationReq) {
......
package com.mortals.xhx.thread;
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.DictInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.material.MaterialInfo;
import com.mortals.xhx.protocol.complex.matter.service.IComplexMatterService;
import com.mortals.xhx.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import static com.mortals.xhx.common.key.Constant.REDIS_RESP_TIMEOUT;
import static com.mortals.xhx.common.key.RedisKey.KEY_EVENT_IMPLEMENTATION_RESP;
@Slf4j
public class DictSendTask implements Runnable {
private ImplementationReq implementationReq;
private String deviceLogo;
private IComplexMatterService complexMatterService;
private ICacheService cacheService;
public DictSendTask(String deviceLogo, ImplementationReq implementationReq) {
this.implementationReq = implementationReq;
this.deviceLogo = deviceLogo;
complexMatterService = SpringUtils.getBean(IComplexMatterService.class);
cacheService = SpringUtils.getBean(ICacheService.class);
}
@Override
public void run() {
try {
log.info("DictSendTask启动发送");
Rest<List<DictInfo>> rest = complexMatterService.queryDict(deviceLogo, implementationReq.getDict());
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
} catch (Exception e) {
log.error("发送异常:" + e);
}
}
}
\ No newline at end of file
...@@ -37,9 +37,8 @@ public class EventAndSituationSendTask implements Runnable { ...@@ -37,9 +37,8 @@ public class EventAndSituationSendTask implements Runnable {
@Override @Override
public void run() { public void run() {
try { try {
log.info("启动发送"); log.info("EventAndSituationSendTask启动发送");
Rest<List<MaterialInfo>> rest = complexMatterService.getMaterialByEventAndSituation(deviceLogo, implementationReq); Rest<List<MaterialInfo>> rest = complexMatterService.getMaterialByEventAndSituation(deviceLogo, implementationReq);
log.info("发送完成==>{}", JSONObject.toJSONString(rest));
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest)); cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
} catch (Exception e) { } catch (Exception e) {
......
...@@ -35,9 +35,8 @@ public class ImplementDetailSendTask implements Runnable { ...@@ -35,9 +35,8 @@ public class ImplementDetailSendTask implements Runnable {
@Override @Override
public void run() { public void run() {
try { try {
log.info("启动发送"); log.info("ImplementDetailSendTask启动发送");
Rest<ImplementDetailInfo> rest = complexMatterService.getImplement(deviceLogo, implementationReq.getEventId()); Rest<ImplementDetailInfo> rest = complexMatterService.getImplement(deviceLogo, implementationReq.getEventId());
log.info("发送完成==>{}", JSONObject.toJSONString(rest));
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest)); cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
} catch (Exception e) { } catch (Exception e) {
......
package com.mortals.xhx.thread;
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.work.WorkInfo;
import com.mortals.xhx.protocol.complex.matter.service.IComplexMatterService;
import com.mortals.xhx.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j;
import static com.mortals.xhx.common.key.Constant.REDIS_RESP_TIMEOUT;
import static com.mortals.xhx.common.key.RedisKey.KEY_EVENT_IMPLEMENTATION_RESP;
@Slf4j
public class ImplementDynamicFormSendTask implements Runnable {
private ImplementationReq implementationReq;
private String deviceLogo;
private IComplexMatterService complexMatterService;
private ICacheService cacheService;
public ImplementDynamicFormSendTask(String deviceLogo, ImplementationReq implementationReq) {
this.implementationReq = implementationReq;
this.deviceLogo = deviceLogo;
complexMatterService = SpringUtils.getBean(IComplexMatterService.class);
cacheService = SpringUtils.getBean(ICacheService.class);
}
@Override
public void run() {
try {
log.info("ImplementDynamicFormSendTask启动发送");
Rest<WorkInfo> rest = complexMatterService.getWorkMatter(deviceLogo, implementationReq.getEventIdList());
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
} catch (Exception e) {
log.error("发送异常:" + e);
}
}
}
\ No newline at end of file
...@@ -34,11 +34,8 @@ public class ImplementListSendTask implements Runnable { ...@@ -34,11 +34,8 @@ public class ImplementListSendTask implements Runnable {
@Override @Override
public void run() { public void run() {
try { try {
log.info("启动发送"); log.info("ImplementListSendTask启动发送");
Rest<MatterListInfo> rest = complexMatterService.findMatters(deviceLogo, implementationReq); Rest<MatterListInfo> rest = complexMatterService.findMatters(deviceLogo, implementationReq);
log.info("发送完成==>{}", JSONObject.toJSONString(rest));
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest)); cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
} catch (Exception e) { } catch (Exception e) {
......
...@@ -37,9 +37,8 @@ public class ImplementMaterialSendTask implements Runnable { ...@@ -37,9 +37,8 @@ public class ImplementMaterialSendTask implements Runnable {
@Override @Override
public void run() { public void run() {
try { try {
log.info("启动发送"); log.info("ImplementMaterialSendTask启动发送");
Rest<List<MaterialInfo>> rest = complexMatterService.getMaterialByEvent(deviceLogo, implementationReq.getEventId()); Rest<List<MaterialInfo>> rest = complexMatterService.getMaterialByEvent(deviceLogo, implementationReq.getEventId());
log.info("发送完成==>{}", JSONObject.toJSONString(rest));
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest)); cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
} catch (Exception e) { } catch (Exception e) {
......
...@@ -5,11 +5,14 @@ import com.mortals.framework.common.Rest; ...@@ -5,11 +5,14 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.xhx.protocol.complex.matter.model.req.ImplementationReq; 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.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.model.rsp.matter.MatterWorkInfo;
import com.mortals.xhx.protocol.complex.matter.service.IComplexMatterService; import com.mortals.xhx.protocol.complex.matter.service.IComplexMatterService;
import com.mortals.xhx.utils.SpringUtils; import com.mortals.xhx.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.List;
import static com.mortals.xhx.common.key.Constant.REDIS_RESP_TIMEOUT; import static com.mortals.xhx.common.key.Constant.REDIS_RESP_TIMEOUT;
import static com.mortals.xhx.common.key.RedisKey.KEY_EVENT_IMPLEMENTATION_RESP; import static com.mortals.xhx.common.key.RedisKey.KEY_EVENT_IMPLEMENTATION_RESP;
...@@ -35,9 +38,8 @@ public class ImplementSituationSendTask implements Runnable { ...@@ -35,9 +38,8 @@ public class ImplementSituationSendTask implements Runnable {
@Override @Override
public void run() { public void run() {
try { try {
log.info("启动发送"); log.info("ImplementSituationSendTask启动发送");
Rest<MatterWorkInfo> rest = complexMatterService.doWorkMatterSearch(deviceLogo, implementationReq.getEventId()); Rest<List<MaterialInfo>> rest = complexMatterService.getMaterialByEventAndSituation(deviceLogo, implementationReq);
log.info("发送完成==>{}", JSONObject.toJSONString(rest));
cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest)); cacheService.lpushForTime(KEY_EVENT_IMPLEMENTATION_RESP + implementationReq.getNonce(), REDIS_RESP_TIMEOUT, JSONObject.toJSONString(rest));
} catch (Exception e) { } catch (Exception e) {
......
...@@ -71,8 +71,17 @@ public class SendThread extends AbstractThread { ...@@ -71,8 +71,17 @@ public class SendThread extends AbstractThread {
ImplementationReq implementationReq = JSONObject.parseObject(reqStr, ImplementationReq.class); ImplementationReq implementationReq = JSONObject.parseObject(reqStr, ImplementationReq.class);
ImplementMaterialSendTask implementSendTask = new ImplementMaterialSendTask(deviceCode, implementationReq); ImplementMaterialSendTask implementSendTask = new ImplementMaterialSendTask(deviceCode, implementationReq);
ThreadPool.getInstance().execute(implementSendTask); ThreadPool.getInstance().execute(implementSendTask);
}else if("event-implementation/getDynamicFormByEventIds".equals(urlPath)){
ImplementationReq implementationReq = JSONObject.parseObject(reqStr, ImplementationReq.class);
ImplementDynamicFormSendTask implementSendTask = new ImplementDynamicFormSendTask(deviceCode, implementationReq);
ThreadPool.getInstance().execute(implementSendTask);
}else if("common/queryDict".equals(urlPath)){
ImplementationReq implementationReq = JSONObject.parseObject(reqStr, ImplementationReq.class);
DictSendTask implementSendTask = new DictSendTask(deviceCode, implementationReq);
ThreadPool.getInstance().execute(implementSendTask);
} }
} }
} }
......
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