Commit 831ea89f authored by 廖旭伟's avatar 廖旭伟

事项管理配置

parent 6a16cfd8
...@@ -28,5 +28,9 @@ public class ComplexImplementationReq extends BaseApiReq { ...@@ -28,5 +28,9 @@ public class ComplexImplementationReq extends BaseApiReq {
private String dict; private String dict;
/**
* 申报来源1, 自助端申报 2, 移动端申报 3,第三方申报
*/
private Integer applyType=1;
} }
...@@ -29,4 +29,8 @@ public class ComplexAcceptReq extends BaseApiReq { ...@@ -29,4 +29,8 @@ public class ComplexAcceptReq extends BaseApiReq {
private Map<String,String> infoMap=new HashMap<>(); private Map<String,String> infoMap=new HashMap<>();
private LegalProxy legalProxy; private LegalProxy legalProxy;
private Object thingId; private Object thingId;
/**
* 申报来源1, 自助端申报 2, 移动端申报 3,第三方申报
*/
private Integer applyType =1;
} }
...@@ -83,4 +83,7 @@ public class RecordsItem{ ...@@ -83,4 +83,7 @@ public class RecordsItem{
private String stateDate; private String stateDate;
private Object unitOfLimitTime; private Object unitOfLimitTime;
private Object resultsDefines; private Object resultsDefines;
/**是否启用*/
private Integer enableFlag = 0;
} }
\ No newline at end of file
...@@ -15,11 +15,17 @@ import com.mortals.xhx.busiz.req.FindHandlingPageReq; ...@@ -15,11 +15,17 @@ import com.mortals.xhx.busiz.req.FindHandlingPageReq;
import com.mortals.xhx.busiz.req.accept.ComplexAcceptReq; import com.mortals.xhx.busiz.req.accept.ComplexAcceptReq;
import com.mortals.xhx.busiz.rsp.ApiResp; import com.mortals.xhx.busiz.rsp.ApiResp;
import com.mortals.xhx.busiz.rsp.ImplementEventInfo; import com.mortals.xhx.busiz.rsp.ImplementEventInfo;
import com.mortals.xhx.busiz.rsp.RecordsItem;
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.busiz.rsp.work.ComplexWorkInfo;
import com.mortals.xhx.common.code.ApiRespCodeEnum; import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.module.matter.model.ApplyMatterEntity;
import com.mortals.xhx.module.matter.model.ApplyMatterQuery;
import com.mortals.xhx.module.matter.model.EventImplementationEntity;
import com.mortals.xhx.module.matter.service.ApplyMatterService;
import com.mortals.xhx.module.matter.service.EventImplementationService;
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.DictInfo;
import com.mortals.xhx.protocol.complex.matter.model.rsp.HandlingRspInfoList; import com.mortals.xhx.protocol.complex.matter.model.rsp.HandlingRspInfoList;
...@@ -34,6 +40,9 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -34,6 +40,9 @@ import org.springframework.web.bind.annotation.RestController;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.Constant.HTTP_TIMEOUT; import static com.mortals.xhx.common.key.Constant.HTTP_TIMEOUT;
import static com.mortals.xhx.common.key.RedisKey.KEY_COMPLEX_REQ; import static com.mortals.xhx.common.key.RedisKey.KEY_COMPLEX_REQ;
...@@ -53,6 +62,9 @@ public class ComplexApiController { ...@@ -53,6 +62,9 @@ public class ComplexApiController {
@Autowired @Autowired
private ICacheService cacheService; private ICacheService cacheService;
@Autowired
private ApplyMatterService applyMatterService;
/** /**
* 事项列表查询 * 事项列表查询
* *
...@@ -76,6 +88,20 @@ public class ComplexApiController { ...@@ -76,6 +88,20 @@ public class ComplexApiController {
} }
Rest<ImplementEventInfo> eventListRest = JSON.parseObject(rest, new TypeReference<Rest<ImplementEventInfo>>() { Rest<ImplementEventInfo> eventListRest = JSON.parseObject(rest, new TypeReference<Rest<ImplementEventInfo>>() {
}); });
if(eventListRest.getCode()==1){
Integer applyType = req.getApplyType()==null?1:req.getApplyType();
List<ApplyMatterEntity> entityList = applyMatterService.find(new ApplyMatterQuery().applyType(applyType));
if(CollectionUtils.isNotEmpty(entityList)) {
Set<String> matter = entityList.stream().map(t -> t.getEventId()).collect(Collectors.toSet());
for (RecordsItem item : eventListRest.getData().getRecords()) {
if(matter.contains(item.getEventId())){
item.setEnableFlag(1);
}else {
item.setEnableFlag(0);
}
}
}
}
return JSON.toJSONString(eventListRest); return JSON.toJSONString(eventListRest);
} catch (Exception e) { } catch (Exception e) {
log.error("接收数据失败", e); log.error("接收数据失败", e);
...@@ -290,12 +316,25 @@ public class ComplexApiController { ...@@ -290,12 +316,25 @@ public class ComplexApiController {
public String acceptHandling(@RequestBody ComplexAcceptReq req) { public String acceptHandling(@RequestBody ComplexAcceptReq req) {
log.info("【自助设备接件】【请求体】--> " + JSONObject.toJSONString(req)); log.info("【自助设备接件】【请求体】--> " + JSONObject.toJSONString(req));
req.setUrlPath("self-device-info/acceptHandling"); req.setUrlPath("self-device-info/acceptHandling");
ApiResp<String> rsp = new ApiResp<>();
if(CollectionUtils.isEmpty(req.getHandlings())){
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
rsp.setMsg("办理事项参数为空");
return JSON.toJSONString(rsp);
}
List<String> eventIds = req.getHandlings().stream().map(i->i.getEventId()).collect(Collectors.toList());
List<ApplyMatterEntity> entityList = applyMatterService.find(new ApplyMatterQuery().applyType(req.getApplyType()).eventIdList(eventIds));
if(CollectionUtils.isEmpty(entityList)||entityList.size()!=eventIds.size()){
rsp.setCode(ApiRespCodeEnum.FAILED.getValue());
rsp.setMsg("事项没有启用,无法申报");
return JSON.toJSONString(rsp);
}
if(CollectionUtils.isNotEmpty(req.getMaterials())){ if(CollectionUtils.isNotEmpty(req.getMaterials())){
if(StringUtils.isEmpty(req.getMaterials().get(0).getMaterialContent())){ if(StringUtils.isEmpty(req.getMaterials().get(0).getMaterialContent())){
log.info("材料附件为空"); log.info("材料附件为空");
} }
} }
ApiResp<String> rsp = new ApiResp<>();
rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel()); rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel());
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue()); rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
try { try {
......
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