Commit be0040d5 authored by 赵啸非's avatar 赵啸非

修改配置文件

parent 64b13181
......@@ -36,6 +36,8 @@
<profiles.ocrUrl>http://rocrt.egovrobot.com/</profiles.ocrUrl>
<profiles.apiUrl>http://api.egovrobot.com</profiles.apiUrl>
<profiles.robertServerUrl>http://localhost:8099/</profiles.robertServerUrl>
<profiles.complexServerUrl>https://112.19.80.237:11043/zwzc/</profiles.complexServerUrl>
<profiles.complexDeviceCode>9c:30:5b:b5:c0:d5</profiles.complexDeviceCode>
<profiles.mq>yibin</profiles.mq>
<profiles.activemq.brokerUrl>tcp://59.175.148.30:62818</profiles.activemq.brokerUrl>
<profiles.publish.path>/home/publish</profiles.publish.path>
......
package com.lilosoft.api.bean.receive;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Data;
@Data
public class ReceiveMsgInfo{
public class ReceiveMsgInfo {
private String msg;
private String wordUrl;
private String isSkip;
......@@ -28,4 +31,6 @@ public class ReceiveMsgInfo{
private String isReceipt;
private String projectId;
private List<ErrorsItem> errors;
private Map<String, String> userData;
}
\ No newline at end of file
......@@ -38,46 +38,52 @@ public class ComplexService extends PublicService {
@Autowired
private OcrApi ocrApi;
@Value("${complex.robertServerUrl:''}")
protected String robertServerUrl;
@Value("${api.robertServerUrl:''}")
public String robertServerUrl;
@Value("${complex.host:''}")
public String complexServerUrl;
@Value("${complex.deviceCode:''}")
public String deviceCode;
/**
* 综窗申报
*/
public String windowApply(ReceiveMsgInfo receiveMsgInfo) throws Exception {
logger.info(JSONUtil.toJsonStr(receiveMsgInfo));
Boolean success = receiveMsgInfo.getSuccess();
receiveMsgInfo.getFileData().forEach(item -> {
Response<ResponseBody> response = ocrApi.downloadFile(item.getFileUrl(), item.getFileName(), "0");
boolean successful = response.isSuccessful();
int code = response.code();
if (successful && code == 200) {
ResponseBody responseBody = response.body();
//上传受理平台
if (responseBody != null) {
try {
byte[] bytes = responseBody.bytes();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
});
if (success) {
ComplexWindowAbstract complexWindowAbstract = ComplexWindowAbstract.newType(receiveMsgInfo.getItemCode());
CommonData commonData = new CommonData();
commonData.setRobertServerUrl(robertServerUrl);
commonData.setComplexServerUrl(complexServerUrl);
commonData.setDeviceLogo(deviceCode);
commonData.setFileData(receiveMsgInfo.getFileData());
//设置申请人信息
Map<String, String> userData = receiveMsgInfo.getUserData();
//申请人信息
commonData.setApplicantName(userData.getOrDefault("applicantName",""));
//申请人性别
commonData.setApplicantSex(userData.getOrDefault("applicantSex",""));
//申请人证件号码
commonData.setApplicantIdNumber(userData.getOrDefault("applicantIdNumber",""));
//申请人号码
commonData.setApplicantPhone(userData.getOrDefault("applicantPhone",""));
//申请人证件
commonData.setApplicantDocumentId("111");
//设置法人信息
commonData.setLegalName(userData.getOrDefault("legalName",""));//营业执照法人姓名
commonData.setLegalIdNumber(userData.getOrDefault("legalIdNumber",""));//法人id号
commonData.setLegalSex(userData.getOrDefault("legalSex",""));//法人性别
commonData.setLegalDocumentId("111");
//commonData.setUserMap();
complexWindowAbstract.doHandleWork(commonData);
} else {
......
......@@ -36,7 +36,7 @@ public class ScheduledService {
@Autowired
private ApplyService applyService;
@Scheduled(cron="${scheduled.monitorCron}")
//@Scheduled(cron="${scheduled.monitorCron}")
public void serverMonitorSchedule() {
if("true".equals(monitorOpen)){
JsonResult jsonResult = robotApi.queryRecordList(mq, "1");
......
......@@ -2,10 +2,14 @@ package com.lilosoft.api.service.complexWindow;
import com.lilosoft.api.bean.receive.FileDataItem;
import com.lilosoft.complex.matter.model.req.ApplicantLeagal;
import com.lilosoft.complex.matter.model.req.LegalProxy;
import lombok.Data;
import java.lang.reflect.ParameterizedType;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 通用参数
......@@ -18,7 +22,8 @@ public class CommonData {
private String deviceLogo;
private String robertServerUrl;
private String robertServerUrl;//机器人地址
private String complexServerUrl;//综合窗口地址
private List<FileDataItem> fileData;
......@@ -30,8 +35,25 @@ public class CommonData {
//当前日期
private String dateStr;
/**
* 申请人信息
*/
private String applicantPhone;//号码
private String applicantName;//名称
private String applicantSex;//性别
private String applicantDocumentId;//证件类型 默认111
private String applicantIdNumber;//申请号码
/**
* 法人信息
*/
private String legalName;
//法人号码
private String legalIdNumber;
//证件类型
private String legalDocumentId;
private String legalSex;
private Map<String,String> userMap;
}
......@@ -29,7 +29,7 @@ public abstract class ComplexWindowAbstract {
public static ComplexWindowAbstract newType(String type) {
if (type == TypeEnum.危险化学品经营许可法人变更.getValue()) {
if (TypeEnum.危险化学品经营许可法人变更.getValue().equals(type)) {
return new WXHXPJYXKFRBG(type);
}
......
......@@ -57,7 +57,6 @@ public class WXHXPJYXKFRBG extends ComplexWindowAbstract {
public void doHandleWork(CommonData commonData) {
//获取数据资源 todo
//下载附件
List<FileDataItem> fileCollect = commonData.getFileData().stream().map(item -> {
FileDataItem fileDataItem = new FileDataItem();
......@@ -75,7 +74,6 @@ public class WXHXPJYXKFRBG extends ComplexWindowAbstract {
Rest<LoginRspInfo> loginRspInfoRest = complexMatterService.deviceLogin(deviceLoginReq);
if (loginRspInfoRest.getCode() == YesNoEnum.YES.getValue()) {
//设备登录成功 上传附件
fileCollect.stream().forEach(item -> {
Rest<String> uploadFileRest = complexMatterService.uploadFile(commonData.getDeviceLogo(), item.getBytes(), item.getFileName());
if (uploadFileRest.getCode() == YesNoEnum.YES.getValue()) {
......@@ -83,7 +81,6 @@ public class WXHXPJYXKFRBG extends ComplexWindowAbstract {
}
});
//通过事项查询eventId
ImplementationReq implementationReq = new ImplementationReq();
implementationReq.setImplementName(matterName);
......@@ -95,6 +92,8 @@ public class WXHXPJYXKFRBG extends ComplexWindowAbstract {
String eventId = matterRespInfo.getEventId();
String eventObjectType = matterRespInfo.getEventObjectType();
AcceptReq acceptReq = new AcceptReq();
//查询办理事项情形
Rest<MatterWorkInfo> matterWorkInfoRest = complexMatterService.doWorkMatterSearch(commonData.getDeviceLogo(), eventId);
if (matterWorkInfoRest.getCode() == YesNoEnum.YES.getValue()) {
......@@ -102,17 +101,18 @@ public class WXHXPJYXKFRBG extends ComplexWindowAbstract {
ChildrenItem childrenItem = matterWorkInfo.getChildren().stream().filter(f -> "变更法人".equals(f.getLabel())).findFirst().orElseGet(() -> null);
if (!ObjectUtils.isEmpty(childrenItem)) {
MaterialsItem materialsItem = new MaterialsItem();
//构建受理材料附件
List<MaterialsItem> materialsItemList = childrenItem.getMaterials().stream().map(item -> {
MaterialsItem materialsItem = new MaterialsItem();
String name = item.getName();
if (StrUtil.contains(name, "变更申请表")) {
matchUploadFile(fileCollect, materialsItem,"申请书");
}else if(StrUtil.contains(name, "安全资格证书")){
matchUploadFile(fileCollect, materialsItem,"合格证");
}else if(StrUtil.contains(name, "化学品经营许可证")){
matchUploadFile(fileCollect, materialsItem,"许可证");
matchUploadFile(fileCollect, materialsItem, "申请书");
} else if (StrUtil.contains(name, "安全资格证书")) {
matchUploadFile(fileCollect, materialsItem, "合格证");
} else if (StrUtil.contains(name, "化学品经营许可证")) {
matchUploadFile(fileCollect, materialsItem, "许可证");
}
materialsItem.setMaterialForm(item.getFromId());
materialsItem.setMaterialId(item.getId());
......@@ -120,16 +120,11 @@ public class WXHXPJYXKFRBG extends ComplexWindowAbstract {
return materialsItem;
}).collect(Collectors.toList());
acceptReq.setMaterials(materialsItemList);
}
}
//提交响应的受理
AcceptReq acceptReq = new AcceptReq();
List<HandlingsItem> handlingsItemList = new ArrayList<>();
HandlingsItem handlingsItem = new HandlingsItem();
......@@ -139,9 +134,29 @@ public class WXHXPJYXKFRBG extends ComplexWindowAbstract {
acceptReq.setHandlings(handlingsItemList);
//申请人信息
ApplicantLeagal applicantLeagal = new ApplicantLeagal();
applicantLeagal.setPhone(commonData.getApplicantPhone());
applicantLeagal.setApplicantSex(commonData.getApplicantSex());
applicantLeagal.setDocumentId(commonData.getApplicantDocumentId());
applicantLeagal.setApplicantName(commonData.getApplicantName());
applicantLeagal.setApplicantIdNumber(commonData.getApplicantIdNumber());
acceptReq.setApplicantLegal(applicantLeagal);
//法人信息
LegalProxy legalProxy = new LegalProxy();
legalProxy.setLegalName(commonData.getLegalName());
legalProxy.setLegalIdNumber(commonData.getLegalIdNumber());
legalProxy.setDocumentId(commonData.getLegalDocumentId());
acceptReq.setLegalProxy(legalProxy);
Rest<AcceptRspInfo> acceptRest = complexMatterService.accept(commonData.getDeviceLogo(), acceptReq);
log.info("受理返回==>{}", JSON.toJSONString(acceptRest));
if (acceptRest.getCode() == YesNoEnum.YES.getValue()) {
log.info("受理成功==>{}", JSON.toJSONString(acceptRest));
}
}
......@@ -152,9 +167,9 @@ public class WXHXPJYXKFRBG extends ComplexWindowAbstract {
}
private static void matchUploadFile(List<FileDataItem> fileCollect, MaterialsItem materialsItem,String fileName) {
FileDataItem fileDataItem = fileCollect.stream().filter(f -> StrUtil.contains(f.getFileName(), fileName)).findFirst().orElseGet(() -> null);
if(!ObjectUtils.isEmpty(fileDataItem)){
private static void matchUploadFile(List<FileDataItem> fileCollect, MaterialsItem materialsItem, String fileName) {
FileDataItem fileDataItem = fileCollect.stream().filter(f -> StrUtil.contains(f.getName(), fileName)).findFirst().orElseGet(() -> null);
if (!ObjectUtils.isEmpty(fileDataItem)) {
materialsItem.setUploadFileName(fileDataItem.getFileName());
materialsItem.setMaterialPath(fileDataItem.getDownloadUrl());
}
......
......@@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.Map;
......@@ -22,11 +23,8 @@ public abstract class AbstractComplexService implements IComplexMatterService {
@Value("${complex.deviceCode:''}")
protected String deviceCode;
@Value("${hik.appSecret:''}")
protected String appSecret;
//综窗接件token deviceCode--对应tokenMap
public Map<String, String> tokenMap;
public static Map<String, String> tokenMap=new HashMap<>();
//综窗接件token
public String token;
......
......@@ -13,6 +13,6 @@ public class AcceptReq{
private ApplicantPersonal applicantPersonal;
private List<HandlingsItem> handlings;
private InfoMap infoMap;
private Object legalProxy;
private LegalProxy legalProxy;
private Object thingId;
}
\ No newline at end of file
package com.lilosoft.complex.matter.model.req;
import lombok.Data;
import java.beans.PropertyVetoException;
@Data
public class LegalProxy {
private String legalName;
private String legalIdNumber;
private String documentId;
}
......@@ -77,6 +77,8 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements
public Rest<AcceptRspInfo> accept(String deviceLogo, AcceptReq acceptReq) {
String deviceLoginApi = host + "self-device-info/acceptHandling";
log.info("accept req==>{}",JSON.toJSONString(acceptReq));
String deviceToken = checkToken(deviceLogo);
String rest = HttpUtil.createPost(deviceLoginApi)
.header("X-Access-Token", deviceToken)
......@@ -108,7 +110,7 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements
String rest = HttpUtil.createGet(mattersApi)
.header("X-Access-Token", deviceToken)
.headerMap(paramMap, true)
.formStr(paramMap)
.execute().body();
ComplexApiRest<MatterListInfo> complexApiRest = JSON.parseObject(rest, new TypeReference<ComplexApiRest<MatterListInfo>>() {
......@@ -129,13 +131,17 @@ public class ComplexMatterServiceImpl extends AbstractComplexService implements
String deviceToken = checkToken(deviceLogo);
String rest = HttpUtil.createGet(mattersApi)
.header("X-Access-Token", deviceToken)
.headerMap(paramMap, true)
.formStr(paramMap)
.execute().body();
ComplexApiRest<MatterWorkInfo> complexApiRest = JSON.parseObject(rest, new TypeReference<ComplexApiRest<MatterWorkInfo>>() {
ComplexApiRest<List<MatterWorkInfo>> complexApiRest = JSON.parseObject(rest, new TypeReference<ComplexApiRest<List<MatterWorkInfo>>>() {
});
if (complexApiRest.getCode() == 200) {
return Rest.ok(complexApiRest.getMessage(), complexApiRest.getResult());
if(!ObjectUtils.isEmpty(complexApiRest.getResult())){
return Rest.ok(complexApiRest.getMessage(), complexApiRest.getResult().get(0));
}else {
return Rest.fail("查询结果数量为0");
}
}
return Rest.fail(complexApiRest.getMessage());
}
......
......@@ -7,6 +7,9 @@ api:
apiUrl: @profiles.apiUrl@ #资料预审配置接口地址
robertServerUrl: @profiles.robertServerUrl@ #机器人预审地址
mq: @profiles.mq@ #mq监听队列名称
complex:
host: @profiles.complexServerUrl@ #综窗地址
deviceCode: @profiles.complexDeviceCode@ #综窗设备编码
scheduled: #定时任务推送
monitorCron: 0 0/5 * * * ?
monitorOpen: true
......
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