中继服务同步修改

master
anthonyywj2 3 years ago
parent 0f1e4bc2c1
commit b1e8a79f85

@ -7,6 +7,7 @@ public class Constant {
public static final String SERIAL_CACHE_PREFIX = "serial_"; public static final String SERIAL_CACHE_PREFIX = "serial_";
public static final String SERIAL_CACHE_PREFIX_ST = "serialst_"; public static final String SERIAL_CACHE_PREFIX_ST = "serialst_";
public static final String SERIAL_CACHE_SYNC_UDI = "syncUdi";
public static final String SCAN_ORDER = "MS"; public static final String SCAN_ORDER = "MS";
public static final String BUS_ORDER = "MY"; public static final String BUS_ORDER = "MY";

@ -137,4 +137,8 @@ public class ConstantStatus {
public static final String SYNC_DOWNLOAD_SCAN_ORDER = "AutoDownloadOrder"; public static final String SYNC_DOWNLOAD_SCAN_ORDER = "AutoDownloadOrder";
//自动下载DI数据 //自动下载DI数据
public static final String SYNC_DOWNLOAD_DI_PRODUCTS = "AutoDownloadDiProducts"; public static final String SYNC_DOWNLOAD_DI_PRODUCTS = "AutoDownloadDiProducts";
public static final int SYNC_STATUS_SUCCESS = 1; //处理成功
public static final int SYNC_STATUS_FAIL = 2; //处理失败
public static final int SYNC_STATUS_WAIT = 0; //等待处理
} }

@ -109,7 +109,7 @@ public class DlBasicService {
basicDownloadStatusEntity.setTaskId(syncDataResponse.getTaskId()); basicDownloadStatusEntity.setTaskId(syncDataResponse.getTaskId());
basicDownloadStatusEntity.setStartTime(new Date()); basicDownloadStatusEntity.setStartTime(new Date());
basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_BASIC_DATA); basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_BASIC_DATA);
basicDownloadStatusEntity.setStatus(0); //下载中 basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中
basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA); basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA);
basicDownloadStatusEntity.setScheduleType(1); basicDownloadStatusEntity.setScheduleType(1);
@ -293,7 +293,7 @@ public class DlBasicService {
basicDownloadStatusEntity.setUpdateTime(new Date()); basicDownloadStatusEntity.setUpdateTime(new Date());
basicDownloadStatusEntity.setEndTime(new Date()); basicDownloadStatusEntity.setEndTime(new Date());
basicDownloadStatusEntity.setRemark(remark.toString()); basicDownloadStatusEntity.setRemark(remark.toString());
basicDownloadStatusEntity.setStatus(1); basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS);
basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity); basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity);
} }
} }
@ -321,7 +321,7 @@ public class DlBasicService {
basicDownloadStatusEntity.setTaskId(syncDataResponse.getTaskId()); basicDownloadStatusEntity.setTaskId(syncDataResponse.getTaskId());
basicDownloadStatusEntity.setStartTime(new Date()); basicDownloadStatusEntity.setStartTime(new Date());
basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_BUS_TYPE); basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_BUS_TYPE);
basicDownloadStatusEntity.setStatus(0); //下载中 basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中
basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS);
basicDownloadStatusEntity.setScheduleType(1); basicDownloadStatusEntity.setScheduleType(1);
@ -400,7 +400,7 @@ public class DlBasicService {
basicDownloadStatusEntity.setUpdateTime(new Date()); basicDownloadStatusEntity.setUpdateTime(new Date());
basicDownloadStatusEntity.setEndTime(new Date()); basicDownloadStatusEntity.setEndTime(new Date());
basicDownloadStatusEntity.setRemark(remark.toString()); basicDownloadStatusEntity.setRemark(remark.toString());
basicDownloadStatusEntity.setStatus(1); basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS);
basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity); basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity);
} }
} }
@ -428,7 +428,7 @@ public class DlBasicService {
basicDownloadStatusEntity.setTaskId(syncDataResponse.getTaskId()); basicDownloadStatusEntity.setTaskId(syncDataResponse.getTaskId());
basicDownloadStatusEntity.setStartTime(new Date()); basicDownloadStatusEntity.setStartTime(new Date());
basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER); basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER);
basicDownloadStatusEntity.setStatus(0); //下载中 basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中
basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER);
basicDownloadStatusEntity.setScheduleType(1); basicDownloadStatusEntity.setScheduleType(1);
@ -476,7 +476,7 @@ public class DlBasicService {
if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailEntityList())) if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailEntityList()))
logs = logs + "单据详情:" + syncDataResponse.getOrderDetailEntityList().size() + "条\n"; logs = logs + "单据详情:" + syncDataResponse.getOrderDetailEntityList().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseEntityList())) if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseEntityList()))
logs = logs + "UDI码信息:" + syncDataResponse.getWarehouseEntityList().size() + "条\n"; logs = logs + "单据条码信息:" + syncDataResponse.getWarehouseEntityList().size() + "条\n";
remark.append(logs); remark.append(logs);
} catch (Exception e) { } catch (Exception e) {
} }
@ -487,7 +487,7 @@ public class DlBasicService {
basicDownloadStatusEntity.setUpdateTime(new Date()); basicDownloadStatusEntity.setUpdateTime(new Date());
basicDownloadStatusEntity.setEndTime(new Date()); basicDownloadStatusEntity.setEndTime(new Date());
basicDownloadStatusEntity.setRemark(remark.toString()); basicDownloadStatusEntity.setRemark(remark.toString());
basicDownloadStatusEntity.setStatus(1); basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS);
basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity); basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity);
} }
} }
@ -541,7 +541,7 @@ public class DlBasicService {
basicDownloadStatusEntity.setTaskId(spSyncUdiResponse.getTaskId()); basicDownloadStatusEntity.setTaskId(spSyncUdiResponse.getTaskId());
basicDownloadStatusEntity.setStartTime(new Date()); basicDownloadStatusEntity.setStartTime(new Date());
basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_DI_PRODUCTS); basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_DI_PRODUCTS);
basicDownloadStatusEntity.setStatus(0); //下载中 basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中
basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI); basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI);
basicDownloadStatusEntity.setScheduleType(1); basicDownloadStatusEntity.setScheduleType(1);
@ -574,7 +574,7 @@ public class DlBasicService {
basicDownloadStatusEntity.setUpdateTime(new Date()); basicDownloadStatusEntity.setUpdateTime(new Date());
basicDownloadStatusEntity.setEndTime(new Date()); basicDownloadStatusEntity.setEndTime(new Date());
basicDownloadStatusEntity.setRemark(remark.toString()); basicDownloadStatusEntity.setRemark(remark.toString());
basicDownloadStatusEntity.setStatus(1); basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS);
basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity); basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity);
} }
} }

@ -63,7 +63,7 @@ public class HeartService {
orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER);
orderStatusEntity.setUpdateTime(new Date()); orderStatusEntity.setUpdateTime(new Date());
orderStatusEntity.setStartTime(new Date()); orderStatusEntity.setStartTime(new Date());
orderStatusEntity.setStatus(0); orderStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT);
orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL);
basicExportService.insertExportStatus(orderStatusEntity); basicExportService.insertExportStatus(orderStatusEntity);
basicExportStatusEntity1 = orderStatusEntity; basicExportStatusEntity1 = orderStatusEntity;
@ -74,10 +74,12 @@ public class HeartService {
spsSyncOrderResponse.setTaskId(basicExportStatusEntity1.getId()); spsSyncOrderResponse.setTaskId(basicExportStatusEntity1.getId());
BaseResponse<String> baseResponse1 = spGetHttp.postAllOrder(spsSyncOrderResponse); BaseResponse<String> baseResponse1 = spGetHttp.postAllOrder(spsSyncOrderResponse);
if (baseResponse1.getCode() == 20000) { if (baseResponse1.getCode() == 20000) {
basicExportStatusEntity1.setStatus(1); basicExportStatusEntity1.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS);
basicExportStatusEntity1.setEndTime(new Date()); } else {
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity); basicExportStatusEntity1.setStatus(ConstantStatus.SYNC_STATUS_FAIL);
} }
basicExportStatusEntity1.setEndTime(new Date());
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
//拼接日志 //拼接日志
String logs = ""; String logs = "";
if (CollUtil.isNotEmpty(spsSyncOrderResponse.getOrderEntities())) if (CollUtil.isNotEmpty(spsSyncOrderResponse.getOrderEntities()))
@ -85,7 +87,7 @@ public class HeartService {
if (CollUtil.isNotEmpty(spsSyncOrderResponse.getOrderDetailEntityList())) if (CollUtil.isNotEmpty(spsSyncOrderResponse.getOrderDetailEntityList()))
logs = logs + "单据详情:" + spsSyncOrderResponse.getOrderDetailEntityList().size() + "条\n"; logs = logs + "单据详情:" + spsSyncOrderResponse.getOrderDetailEntityList().size() + "条\n";
if (CollUtil.isNotEmpty(spsSyncOrderResponse.getWarehouseEntityList())) if (CollUtil.isNotEmpty(spsSyncOrderResponse.getWarehouseEntityList()))
logs = logs + "UDI码信息:" + spsSyncOrderResponse.getWarehouseEntityList().size() + "条\n"; logs = logs + "单据条码信息:" + spsSyncOrderResponse.getWarehouseEntityList().size() + "条\n";
basicExportStatusEntity1.setRemark(logs); basicExportStatusEntity1.setRemark(logs);
basicExportStatusEntity1.setUpdateTime(new Date()); basicExportStatusEntity1.setUpdateTime(new Date());
basicExportService.updateExportStatus(basicExportStatusEntity1); basicExportService.updateExportStatus(basicExportStatusEntity1);
@ -128,11 +130,14 @@ public class HeartService {
basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_BUS_TYPE); basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_BUS_TYPE);
spsSyncBusResponse.setTaskId(basicExportStatusEntity2.getId()); spsSyncBusResponse.setTaskId(basicExportStatusEntity2.getId());
BaseResponse<String> baseResponse2 = spGetHttp.postAllBus(spsSyncBusResponse); BaseResponse<String> baseResponse2 = spGetHttp.postAllBus(spsSyncBusResponse);
if (baseResponse2.getCode() == 20000) { if (baseResponse2.getCode() == 20000) {
basicExportStatusEntity2.setStatus(1); basicExportStatusEntity2.setStatus(1);
basicExportStatusEntity2.setEndTime(new Date()); } else {
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity); basicExportStatusEntity2.setStatus(ConstantStatus.SYNC_STATUS_FAIL);
} }
basicExportStatusEntity2.setEndTime(new Date());
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
//拼接日志 //拼接日志
String logs = ""; String logs = "";
if (CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities())) if (CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities()))
@ -202,9 +207,11 @@ public class HeartService {
BaseResponse<String> baseResponse = spGetHttp.postAllBaseData(syncDataResponse); BaseResponse<String> baseResponse = spGetHttp.postAllBaseData(syncDataResponse);
if (baseResponse.getCode() == 20000) { if (baseResponse.getCode() == 20000) {
basicExportStatusEntity3.setStatus(1); basicExportStatusEntity3.setStatus(1);
basicExportStatusEntity3.setEndTime(new Date()); } else {
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity); basicExportStatusEntity3.setStatus(ConstantStatus.SYNC_STATUS_FAIL);
} }
basicExportStatusEntity3.setEndTime(new Date());
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
String logs = ""; String logs = "";
if (CollUtil.isNotEmpty(syncDataResponse.getUdiRelevanceEntities())) if (CollUtil.isNotEmpty(syncDataResponse.getUdiRelevanceEntities()))
logs = logs + "耗材字典:" + syncDataResponse.getUdiRelevanceEntities().size() + "条\n"; logs = logs + "耗材字典:" + syncDataResponse.getUdiRelevanceEntities().size() + "条\n";
@ -232,7 +239,6 @@ public class HeartService {
public void uploadScheduleList() { public void uploadScheduleList() {
//自动创建要求被下载基础信息任务 //自动创建要求被下载基础信息任务
BasicExportStatusRequest basicExportStatusRequest = new BasicExportStatusRequest(); BasicExportStatusRequest basicExportStatusRequest = new BasicExportStatusRequest();
basicExportStatusRequest.setScheduleType(2); basicExportStatusRequest.setScheduleType(2);
List<BasicExportStatusEntity> basicExportStatusEntities = basicExportService.filterExportStatus(basicExportStatusRequest); List<BasicExportStatusEntity> basicExportStatusEntities = basicExportService.filterExportStatus(basicExportStatusRequest);
@ -245,7 +251,6 @@ public class HeartService {
basicExportService.deleteById(basicExportStatusEntity.getId()); basicExportService.deleteById(basicExportStatusEntity.getId());
} }
} else { } else {
for (BasicExportStatusEntity basicExportStatusEntity : basicExportStatusEntities) { for (BasicExportStatusEntity basicExportStatusEntity : basicExportStatusEntities) {
String logs = ""; String logs = "";
if (CollUtil.isNotEmpty(spsSyncScheduleResponse.getBasicExportStatusEntities())) { if (CollUtil.isNotEmpty(spsSyncScheduleResponse.getBasicExportStatusEntities())) {
@ -256,11 +261,7 @@ public class HeartService {
basicExportService.updateExportStatus(basicExportStatusEntity); basicExportService.updateExportStatus(basicExportStatusEntity);
} }
} }
} }
} }
} }

@ -1,9 +1,9 @@
# 本地环境 # 本地环境
server.port=9991 server.port=9991
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true spring.datasource.jdbc-url=jdbc:mysql://192.168.0.148:3306/udiwms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=123456 spring.datasource.password=Glxp@6066
#spring.datasource.password=89083fb2fc145533 #spring.datasource.password=89083fb2fc145533
server.servlet.context-path= server.servlet.context-path=
#logging.level.com.glxp.api.admin.dao=debug #logging.level.com.glxp.api.admin.dao=debug
@ -20,8 +20,8 @@ logging.path=output/logs
# 不指定的情况下默认生成在项目根目录,按照配置生成所需的日志名称 # 不指定的情况下默认生成在项目根目录,按照配置生成所需的日志名称
#logging.file=D:/udi.log #logging.file=D:/udi.log
file_path=D:/udi/udiwms/udiwmsfile/ #file_path=D:/udi/udiwms/udiwmsfile/
#file_path=/home/glxp/udiwms file_path=/home/glxp/udiwms
#UDI数据下载 #UDI数据下载
UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test
@ -35,7 +35,7 @@ SPSYNC_IP=http://127.0.0.1:9989
# Redis数据库索引默认为0 # Redis数据库索引默认为0
spring.redis.database=8 spring.redis.database=8
# Redis服务器地址 # Redis服务器地址
spring.redis.host=127.0.0.1 spring.redis.host=192.168.0.148
# Redis服务器连接端口 # Redis服务器连接端口
spring.redis.port=6379 spring.redis.port=6379
# Redis服务器连接密码默认为空 # Redis服务器连接密码默认为空

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false"> <configuration scan="true" scanPeriod="60 seconds" debug="false">
<contextName>logback</contextName> <contextName>logback</contextName>
<property name="log.path" value="D:\\udi\\logs\\UDI_WMS_MC\\" /> <property name="log.path" value="/home/glxpdata/udiwms/UDI_WMS_MC/" />
<!--输出到控制台/home/glxpdata/udiwms/UDI_WMS_MC/--> <!--输出到控制台/home/glxpdata/udiwms/UDI_WMS_MC/-->
<!--D:\\udi\\logs\\UDI_WMS_MC\\--> <!--D:\\udi\\logs\\UDI_WMS_MC\\-->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <appender name="console" class="ch.qos.logback.core.ConsoleAppender">

Loading…
Cancel
Save