Commit 182d80e6 authored by shenxin's avatar shenxin

省一体化营山推送

parent b76cde72
package com.mortals.xhx;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.impl.LocalCacheServiceImpl;
import com.mortals.framework.springcloud.boot.BaseWebApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication(scanBasePackages = {"com.mortals"})
......@@ -11,6 +14,11 @@ import org.springframework.context.annotation.ImportResource;
@ImportResource(locations = {"classpath:config/spring-config.xml"})
public class ManagerApplication extends BaseWebApplication {
// @Bean
// public ICacheService cacheService() {
// return LocalCacheServiceImpl.getInstance();
// }
public static void main(String[] args) {
SpringApplication.run(ManagerApplication.class, args);
}
......
......@@ -297,7 +297,7 @@ public class TaskServiceImpl extends AbstractCRUDServiceImpl<TaskDao, TaskEntity
executorService.shutdown();
log.info("任务执行线程退出!");
});
// thread.start();
thread.start();
}
@Override
......
package com.mortals.xhx.modules.information.task;
import cn.hutool.core.date.DateTime;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
......@@ -11,6 +12,7 @@ import com.mortals.xhx.common.code.NodeTypeEnum;
import com.mortals.xhx.common.utils.DateByAffairUtils;
import com.mortals.xhx.common.utils.SnowFlakeUtil;
import com.mortals.xhx.modules.arameter.model.ArameterEntity;
import com.mortals.xhx.modules.arameter.model.ArameterQuery;
import com.mortals.xhx.modules.arameter.service.ArameterService;
import com.mortals.xhx.modules.call.model.CallRecordEntity;
import com.mortals.xhx.modules.call.service.CallRecordService;
......@@ -64,30 +66,31 @@ public class ApplyAndAcceptInformationTaskImpl implements ITaskExcuteService {
}
private void applyAndAccept(List<InformationEntity> informationEntities) {
ArameterEntity arameterEntity = new ArameterEntity();
if (!informationEntities.isEmpty()) {
List<CallRecordEntity> callRecordEntities = new ArrayList<>();
List<InformationEntity> entities = informationEntities.parallelStream().map(e -> {
ArameterEntity extCache = arameterService.getExtCache(e.getSystemCode());
ArameterEntity extCache = new ArameterEntity();
extCache.setSysCode(e.getSystemCode());
extCache = arameterService.find(extCache).get(0);
Map<String, Object> dataMap = assembleData(e);
// String post = "";
String post = "1";
// JSONObject ifResultInfo = null;
String post = "";
// String post = "1";
JSONObject ifResultInfo = null;
CallRecordEntity recordEntity = new CallRecordEntity();
try {
// post = HttpUtil.post(extCache.getAcceptAdress(), JSONObject.toJSONString(dataMap));
// ifResultInfo = JSONObject.parseObject(post).getJSONObject("ifResultInfo");
post = HttpUtil.post(extCache.getAcceptAdress(), JSONObject.toJSONString(dataMap));
ifResultInfo = JSONObject.parseObject(post).getJSONObject("ifResultInfo");
if ("200".equals("200")) {
e.setIsReport("1");
e.setIsSuccess("1");
// e.setOfficeCode(ifResultInfo.getJSONObject("data").getString("code"));
e.setOfficeCode(ifResultInfo.getJSONObject("data").getString("code"));
e.setBizStatus(NodeTypeEnum.审查.getDesc());
e.setNodeType(NodeTypeEnum.审查.getCode());
//默认区间3~20分钟
e.setCreateTime(DateByAffairUtils.getTimeByAddRandomDouble(DateTime.now(), null, null));
e.setProcessStatusName("审查");
// recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
// log.info("推送省一体化申请并受理成功,办件编码:" + ifResultInfo.getJSONObject("data").getString("code"));
recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
log.info("推送省一体化申请并受理成功,办件编码:" + ifResultInfo.getJSONObject("data").getString("code"));
} else {
e.setIsReport("0");
if (0 == e.getFailTimes()) {
......@@ -96,25 +99,26 @@ public class ApplyAndAcceptInformationTaskImpl implements ITaskExcuteService {
e.setFailTimes(e.getFailTimes() + 1);
}
recordEntity.setInterfaceCallStatus("500");
// recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
// e.setFailReason(ifResultInfo.getString("message"));
// log.info("省一体化申请并受理数据推送失败:" + ifResultInfo.getString("message"));
recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
e.setFailReason(ifResultInfo.getString("message"));
log.info("省一体化申请并受理数据推送失败:" + ifResultInfo.getString("message"));
}
callRecordEntities.add(recordEntity);
return e;
} catch (Exception ex) {
ex.printStackTrace();
e.setIsReport("0");
if (0 == e.getFailTimes()) {
e.setFailTimes(1);
} else {
e.setFailTimes(e.getFailTimes() + 1);
}
// e.setFailReason(ifResultInfo.getString("message"));
e.setFailReason(ifResultInfo.getString("message"));
log.error("省一体化申请并受理数据推送失败:连接异常" + ex.getMessage());
recordEntity.setInterfaceCallStatus("500");
// recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
//记录接口交换记录
callRecordEntities.add(recordEntity);
return e;
......@@ -123,7 +127,7 @@ public class ApplyAndAcceptInformationTaskImpl implements ITaskExcuteService {
}).collect(Collectors.toList());
informationService.update(entities,null);
//记录接口交换记录
// callRecordService.save(callRecordEntities,null);
callRecordService.save(callRecordEntities,null);
} else {
log.info("没有从办件表中获取到申请并受理数据");
......@@ -139,7 +143,7 @@ public class ApplyAndAcceptInformationTaskImpl implements ITaskExcuteService {
recordEntity.setIncomingMessage(JSONObject.toJSONString(dataMap));
if (StringUtils.isNotEmpty(post)){
recordEntity.setReturnMessage(JSONObject.toJSONString(post));
// recordEntity.setInterfaceCallStatus(ifResultInfo.getString("code"));
recordEntity.setInterfaceCallStatus(ifResultInfo.getString("code"));
}
recordEntity.setInterfaceCallTime(DateTime.now());
recordEntity.setSystemCode(e.getSystemCode());
......
package com.mortals.xhx.modules.information.task;
import cn.hutool.core.date.DateTime;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
......@@ -62,7 +63,6 @@ public class DecideInformationTaskImpl implements ITaskExcuteService {
}
private void decideData(List<InformationEntity> informationEntities) {
ArameterEntity arameterEntity = new ArameterEntity();
if (!informationEntities.isEmpty()) {
List<CallRecordEntity> callRecordEntities = new ArrayList<>();
List<InformationEntity> collect = informationEntities.parallelStream().map(e -> {
......@@ -106,19 +106,21 @@ public class DecideInformationTaskImpl implements ITaskExcuteService {
valueMap.put("rprojectruntask", rlogisticsinfoMap);
dataMap.put("value", valueMap);
String post = "";
// JSONObject ifResultInfo = null;
JSONObject ifResultInfo = null;
CallRecordEntity recordEntity = new CallRecordEntity();
try {
ArameterEntity extCache = arameterService.getExtCache(e.getSystemCode());
// post = HttpUtil.post(extCache.getDecideAdress(), JSONObject.toJSONString(dataMap));
// ifResultInfo = JSONObject.parseObject(post).getJSONObject("ifResultInfo");
ArameterEntity extCache = new ArameterEntity();
extCache.setSysCode(e.getSystemCode());
extCache = arameterService.find(extCache).get(0);
post = HttpUtil.post(extCache.getDecideAdress(), JSONObject.toJSONString(dataMap));
ifResultInfo = JSONObject.parseObject(post).getJSONObject("ifResultInfo");
if ("200".equals("200")) {
e.setBizStatus(NodeTypeEnum.办结.getDesc());
e.setNodeType(NodeTypeEnum.办结.getCode());
e.setProcessStatusName("办结");
//默认区间3~20分钟
e.setCreateTime(DateByAffairUtils.getTimeByAddRandomDouble(DateTime.now(), null, null));
// recordEntity = recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
recordEntity = recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
log.info("推送一体化决定数据成功");
} else {
//推送失败后,设置标识符,不在重复推送
......@@ -129,13 +131,14 @@ public class DecideInformationTaskImpl implements ITaskExcuteService {
e.setFailTimes(e.getFailTimes() + 1);
}
recordEntity.setInterfaceCallStatus("500");
// recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
// e.setFailReason(ifResultInfo.getString("message"));
// log.info("省一体化申请并受理数据推送失败:" + ifResultInfo.getString("message"));
recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
e.setFailReason(ifResultInfo.getString("message"));
log.info("省一体化申请并受理数据推送失败:" + ifResultInfo.getString("message"));
}
callRecordEntities.add(recordEntity);
return e;
} catch (Exception ex) {
ex.printStackTrace();
//推送失败后,设置标识符,不在重复推送
e.setIsReport("0");
if (0 == e.getFailTimes()) {
......@@ -143,17 +146,17 @@ public class DecideInformationTaskImpl implements ITaskExcuteService {
} else {
e.setFailTimes(e.getFailTimes() + 1);
}
// e.setFailReason(ifResultInfo.getString("message"));
// log.error("省一体化决定数据推送失败:连接异常" + post);
e.setFailReason(ifResultInfo.getString("message"));
log.error("省一体化决定数据推送失败:连接异常" + post);
recordEntity.setInterfaceCallStatus("500");
// recordEntity = recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
recordEntity = recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
//记录接口交换记录
callRecordEntities.add(recordEntity);
return e;
}
}).collect(Collectors.toList());
informationService.update(collect, null);
// callRecordService.save(callRecordEntities, null);
callRecordService.save(callRecordEntities, null);
} else {
log.info("没有从办件表中获取到决定数据");
}
......@@ -168,7 +171,7 @@ public class DecideInformationTaskImpl implements ITaskExcuteService {
recordEntity.setIncomingMessage(JSONObject.toJSONString(dataMap));
if (StringUtils.isNotEmpty(post)) {
recordEntity.setReturnMessage(JSONObject.toJSONString(post));
// recordEntity.setInterfaceCallStatus(ifResultInfo.getString("code"));
recordEntity.setInterfaceCallStatus(ifResultInfo.getString("code"));
}
recordEntity.setInterfaceCallTime(DateTime.now());
recordEntity.setSystemCode(e.getSystemCode());
......
package com.mortals.xhx.modules.information.task;
import cn.hutool.core.date.DateTime;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask;
......@@ -107,20 +108,22 @@ public class ReviewInformationTaskImpl implements ITaskExcuteService {
valueMap.put("rprojectruntask", rlogisticsinfoMap);
dataMap.put("value", valueMap);
String post = "";
// JSONObject ifResultInfo = null;
JSONObject ifResultInfo = null;
CallRecordEntity recordEntity = new CallRecordEntity();
try {
ArameterEntity extCache = arameterService.getExtCache(e.getSystemCode());
// post = HttpUtil.post(extCache.getReviewAdress(), JSONObject.toJSONString(dataMap));
// ifResultInfo = JSONObject.parseObject(post).getJSONObject("ifResultInfo");
//ifResultInfo.getString("code")
ArameterEntity extCache = new ArameterEntity();
extCache.setSysCode(e.getSystemCode());
extCache = arameterService.find(extCache).get(0);
post = HttpUtil.post(extCache.getReviewAdress(), JSONObject.toJSONString(dataMap));
ifResultInfo = JSONObject.parseObject(post).getJSONObject("ifResultInfo");
ifResultInfo.getString("code");
if ("200".equals("200")) {
e.setBizStatus(NodeTypeEnum.决定.getDesc());
e.setNodeType(NodeTypeEnum.决定.getCode());
e.setProcessStatusName("决定");
//默认区间3~20分钟
e.setCreateTime(DateByAffairUtils.getTimeByAddRandomDouble(DateTime.now(), null, null));
// recordEntity = recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
recordEntity = recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
log.info("推送一体化审查数据成功,");
} else {
//推送失败后,设置标识符,不在重复推送
......@@ -131,13 +134,14 @@ public class ReviewInformationTaskImpl implements ITaskExcuteService {
e.setFailTimes(e.getFailTimes() + 1);
}
recordEntity.setInterfaceCallStatus("500");
// recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
// e.setFailReason(ifResultInfo.getString("message"));
// log.info("省一体化申请并受理数据推送失败:" + ifResultInfo.getString("message"));
recordEntity=recordInterfaceExchangeRecord(post,ifResultInfo,e,dataMap);
e.setFailReason(ifResultInfo.getString("message"));
log.info("省一体化申请并受理数据推送失败:" + ifResultInfo.getString("message"));
}
callRecordEntities.add(recordEntity);
return e;
} catch (Exception ex) {
ex.printStackTrace();
//推送失败后,设置标识符,不在重复推送
e.setIsReport("0");
if (0 == e.getFailTimes()) {
......@@ -145,17 +149,17 @@ public class ReviewInformationTaskImpl implements ITaskExcuteService {
} else {
e.setFailTimes(e.getFailTimes() + 1);
}
// e.setFailReason(ifResultInfo.getString("message"));
e.setFailReason(ifResultInfo.getString("message"));
log.error("省一体化审查数据推送失败:连接异常" + post);
recordEntity.setInterfaceCallStatus("500");
// recordEntity = recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
recordEntity = recordInterfaceExchangeRecord(post, ifResultInfo, e, dataMap);
//记录接口交换记录
callRecordEntities.add(recordEntity);
return e;
}
}).collect(Collectors.toList());
informationService.update(collect, null);
// callRecordService.save(callRecordEntities, null);
callRecordService.save(callRecordEntities, null);
} else {
log.info("没有从办件表中获取到审查数据");
}
......@@ -170,7 +174,7 @@ public class ReviewInformationTaskImpl implements ITaskExcuteService {
recordEntity.setIncomingMessage(JSONObject.toJSONString(dataMap));
if (StringUtils.isNotEmpty(post)) {
recordEntity.setReturnMessage(JSONObject.toJSONString(post));
// recordEntity.setInterfaceCallStatus(ifResultInfo.getString("code"));
recordEntity.setInterfaceCallStatus(ifResultInfo.getString("code"));
}
recordEntity.setInterfaceCallTime(DateTime.now());
recordEntity.setSystemCode(e.getSystemCode());
......
......@@ -32,7 +32,7 @@ public class InformationDataConversionListener extends AnalysisEventListener<Sup
/**
* 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收
*/
private static final int BATCH_COUNT = 3000;
private static final int BATCH_COUNT = 1000;
/**
* 这个集合用于接收 读取Excel文件得到的数据
......
......@@ -58,8 +58,8 @@ public class SupplementServiceImpl extends AbstractCRUDServiceImpl<SupplementDao
arameterEntity.setSysCode(sysCode);
List<ArameterEntity> arameterEntities = arameterService.find(arameterEntity, null);
//地区编码
// String areaCode = arameterEntities.get(0).getAreaCode();
String areaCode = "513237000000";
String areaCode = arameterEntities.get(0).getAreaCode();
// String areaCode = "513237000000";
//当前系统每天的固定办件量
// Integer limitTheNumberOfDocuments = Integer.valueOf(arameterEntities.get(0).getThresholdValue());
Integer limitTheNumberOfDocuments = Integer.valueOf("5000000");
......
......@@ -88,6 +88,10 @@ public class SupplementTaskImpl implements ITaskExcuteService {
e.setIsSuccess("1");
} else {
e.setFailReason(" Err:实施清单不存在");
// 是否执行转化(0.未执行 1.已执行)
e.setIsExecute("1");
//是否转化成功(0默认 1成功)
e.setIsSuccess("0");
informationQuery.setFailReason(" Err:实施清单不存在");
informationQuery.setIsSuccess("0");
}
......
......@@ -69,11 +69,53 @@
<profile>
<id>product</id>
<properties>
<profiles.active>product</profiles.active>
<profiles.datasource.uri>
<![CDATA[jdbc:mysql://localhost:3306/xhx-base?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri>
<profiles.datasource.username>root</profiles.datasource.username>
<profiles.datasource.password>nczwroot</profiles.datasource.password>
<profiles.redis.uri>127.0.0.1</profiles.redis.uri>
<profiles.redis.port>6379</profiles.redis.port>
<profiles.redis.username></profiles.redis.username>
<profiles.redis.password></profiles.redis.password>
<profiles.redis.database>1</profiles.redis.database>
<profiles.filepath>/mortals/data</profiles.filepath>
<profiles.log.level>INFO</profiles.log.level>
<profiles.log.path>/logs</profiles.log.path>
<profiles.data.path>/data</profiles.data.path>
</properties>
</profile>
</profiles>
<repositories>
<repository>
<id>nexus</id>
<name>nexus</name>
<!--仓库地址-->
<url>http://192.168.0.251:8081/repository/xhx-group/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<!--插件地址-->
<id>nexus</id>
<name>nexus</name>
<url>http://192.168.0.251:8081/repository/xhx-group/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
......
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