数据同步修改

master
anthonywj 2 years ago
parent ec9c295e03
commit d730b5c084

@ -1,10 +1,12 @@
package com.glxp.api.controller.sync;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONUtil;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.constant.Constant;
import com.glxp.api.entity.system.SyncDataBustypeEntity;
import com.glxp.api.entity.system.SyncDataSetEntity;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.res.system.SyncDataSetResponse;
import com.glxp.api.service.sync.SyncDataBustypeService;
import com.glxp.api.service.sync.SyncDataChangeBustypeService;
@ -36,6 +38,8 @@ public class SyncDataSetController {
private SyncDataChangeBustypeService syncDataChangeBustypeService;
@Resource
private RedisUtil redisUtil;
@Resource
SpGetHttpClient spGetHttpClient;
@AuthRuleAnnotation("system/param/syncData/config")
@ -87,6 +91,8 @@ public class SyncDataSetController {
}
//todo 请立即同步至UDI管理系统
return ResultVOUtils.success();
spGetHttpClient.updateSynsSet(syncDataSetResponse);
return ResultVOUtils.success("设置成功");
}
}

@ -21,6 +21,11 @@ public class SyncDataSetEntity {
private int basicThirdInv; //第三方仓库信息
private int basicThirdBusOrder; //第三方业务单据
private int dbDiProducts; //DI产品信息
private int dbDiCompany; //DI企业信息
private int udiCodeLost; // UDI码补齐
private int udiCodeRel; //UDI码关联关系
private boolean downstreamEnable; //上游是否联通
private Integer syncTime; //数据上传间隔时间
private Integer syncDownloadTime; //数据下载间隔时间
@ -59,4 +64,5 @@ public class SyncDataSetEntity {
private int manufacturerCert;
private int productCert;
}

@ -15,6 +15,7 @@ import com.glxp.api.req.sync.BasicExportStatusRequest;
import com.glxp.api.req.sync.OrderStatusFilterRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.sync.*;
import com.glxp.api.res.system.SyncDataSetResponse;
import com.glxp.api.service.sync.SyncDataSetService;
import com.glxp.api.util.OkHttpCli;
import org.springframework.beans.factory.annotation.Value;
@ -83,7 +84,7 @@ public class SpGetHttpClient {
}
//上传单据类型
//上传用户信息
public BaseResponse<String> postAllUser(SpsSyncDataResponse syncDataResponse) {
String json = JSONUtil.toJsonStr(syncDataResponse);
String result = okHttpCli.doPostJson(getIpUrl() + "/sps/sync/allUser/upload", json, buildHeader());
@ -97,7 +98,7 @@ public class SpGetHttpClient {
//获取自助平台验收单据---直连接口
public BaseResponse<SpsSyncOrderResponse> getReviewOrder(ReviewSpmsRequest reviewSpmsRequest) {
String json = JSONUtil.toJsonStr(reviewSpmsRequest);
String result = okHttpCli.doPostJson(getIpUrl() + "/udiwms/order/getReviews", json, buildHeader());
String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/udiwms/order/getReviews", json, buildHeader());
BaseResponse<SpsSyncOrderResponse> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<SpsSyncOrderResponse>>() {
});
@ -107,7 +108,16 @@ public class SpGetHttpClient {
//验收自助平台单据--直连接口
public BaseResponse<String> reviewOrder(ReviewFinishRequest reviewFinishRequest) {
String json = JSONUtil.toJsonStr(reviewFinishRequest);
String result = okHttpCli.doPostJson(getIpUrl() + "/spms/inout/order/web/updateStatus", json, buildHeader());
String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/spms/inout/order/web/updateStatus", json, buildHeader());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
return response;
}
public BaseResponse<String> updateSynsSet(SyncDataSetResponse syncDataSetResponse) {
String json = JSONUtil.toJsonStr(syncDataSetResponse);
String result = okHttpCli.doPostJson(getIpUrl() + "/directToSpms" + "/system/param/syncData/save", json, buildHeader());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -226,8 +236,6 @@ public class SpGetHttpClient {
}
public BaseResponse<String> postBasicStatus(String id) {
BasicExportStatusRequest basicStatusFilterRequest = new BasicExportStatusRequest();
basicStatusFilterRequest.setId(id);
@ -291,7 +299,7 @@ public class SpGetHttpClient {
*/
public BaseResponse<String> postThrData(SpsSyncThrDataResponse spsSyncThrDataResponse) {
String json = JSONUtil.toJsonStr(spsSyncThrDataResponse);
String result = okHttpCli.doPostJson(getIpUrl() + "/sps/sync/thrData/upload", json, buildHeader());
String result = okHttpCli.doPostJson(getIpUrl() + "/syncToSpms" + "/sps/sync/thrData/upload", json, buildHeader());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -306,7 +314,7 @@ public class SpGetHttpClient {
*/
public BaseResponse<String> postThrProducts(SpsSyncThrProductsResponse spsSyncThrProductsResponse) {
String json = JSONUtil.toJsonStr(spsSyncThrProductsResponse);
String result = okHttpCli.doPostJson(getIpUrl() + "/sps/sync/thrData/products/upload", json, buildHeader());
String result = okHttpCli.doPostJson(getIpUrl() + "/syncToSpms" + "/sps/sync/thrData/products/upload", json, buildHeader());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -321,7 +329,7 @@ public class SpGetHttpClient {
*/
public BaseResponse<String> postSysSetting(SpsSyncSysSettingResponse spsSyncSysSettingResponse) {
String json = JSONUtil.toJsonStr(spsSyncSysSettingResponse);
String result = okHttpCli.doPostJson(getIpUrl() + "/sps/sync/sys/setting", json, buildHeader());
String result = okHttpCli.doPostJson(getIpUrl() + "/syncToSpms" + "/sps/sync/sys/setting", json, buildHeader());
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});

@ -11,5 +11,6 @@ public class BaseSyncResponse {
private List<String> files;
private List<String> uploadFiles;
private String updateTime;
private String type;
private String idDatas;
}

@ -22,6 +22,11 @@ public class SyncDataSetResponse {
private int basicThirdInv;
private int basicThirdBusOrder;
private int dbDiProducts;
private int dbDiCompany;
private int udiCodeLost; // UDI码补齐
private int udiCodeRel; //UDI码关联关系
private boolean downstreamEnable;
private int orderScanFinish;
private int orderUnReceive;

@ -919,6 +919,8 @@ public class HeartService {
basicExportStatusTimeEntity.setLastUpdateTime(DateUtil.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"));
basicExportStatusTimeEntity.setKey(ConstantStatus.SYNC_SYS_SETTING);
spsSyncSysSettingResponse.setTaskId(basicExportStatusEntity1.getId());
spsSyncSysSettingResponse.setType(basicExportStatusEntity1.getType());
spsSyncSysSettingResponse.setIdDatas(basicExportStatusEntity1.getIdDatas());
BaseResponse<String> baseResponse = spGetHttp.postSysSetting(spsSyncSysSettingResponse);
//若模板记录不为空,则将模板文件同步过去
String uploadFileLog = "";

@ -2,24 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.system.SyncDataSetDao">
<select id="selectSet"
resultType="com.glxp.api.entity.system.SyncDataSetEntity">
SELECT *
FROM sync_data_set limit 1
FROM sync_data_set
limit 1
</select>
<insert id="insert" parameterType="com.glxp.api.entity.system.SyncDataSetEntity">
replace
INTO sync_data_set(id,typeBus, typeScan,
typeThird, basicProducts, basicCorp, basicInv, basicThirdProducts, basicThirdCorp, basicThirdInv
, basicThirdBusOrder, orderScanFinish, dbDiProducts,downstreamEnable,syncTime,syncDownloadTime,
orderUnReceive,orderUnCheck,busTypes,sysUser,syncIp,orderSyncTime,orderSyncStart,basicSyncStart,entrustAction
,unCheckCert,checkedCert,companyCert,manufacturerCert,productCert,basicDept)
values (
#{id},
INTO sync_data_set( id, typeBus, typeScan,
typeThird, basicProducts, basicCorp, basicInv, basicThirdProducts, basicThirdCorp
, basicThirdInv
, basicThirdBusOrder, orderScanFinish, dbDiProducts, downstreamEnable, syncTime
, syncDownloadTime,
orderUnReceive, orderUnCheck, busTypes, sysUser, syncIp, orderSyncTime
, orderSyncStart, basicSyncStart, entrustAction
, unCheckCert, checkedCert, companyCert, manufacturerCert, productCert, basicDept
, systemConfig
, printConfig, scanChangeConfig, supCert, dbDiCompany, busChangeConfig
, udiCodeLost, udiCodeRel)
values (#{id},
#{typeBus},
#{typeScan},
#{typeThird},
@ -45,9 +49,8 @@
#{basicSyncStart},
#{entrustAction},
#{unCheckCert},
#{checkedCert}, #{companyCert}, #{manufacturerCert}, #{productCert},#{basicDept}
)
#{checkedCert}, #{companyCert}, #{manufacturerCert}, #{productCert}, #{basicDept},
#{systemConfig}, #{printConfig}, #{scanChangeConfig}, #{supCert}, #{dbDiCompany}, #{busChangeConfig},
#{udiCodeLost}, #{udiCodeRel})
</insert>
</mapper>

@ -170,6 +170,8 @@ CALL Pro_Temp_ColumnWork('auth_warehouse', 'updateTime', 'datetime ', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'basicType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'basicDept', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'dbDiCompany', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'updateTime', 'datetime', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'orderToInSyncTime', 'int', 1);
@ -198,7 +200,8 @@ CALL Pro_Temp_ColumnWork('io_order', 'checkPreInOrders', 'varchar(255)', 1);
# CALL Pro_Temp_ColumnWork('sup_cert_set', 'foreign', 'tinyint', 3);
# CALL Pro_Temp_ColumnWork('sup_cert_set', 'needForeign', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'udiCodeLost', 'tinyint ', 1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'udiCodeRel', 'tinyint ', 1);
CREATE TABLE IF NOT EXISTS `inv_prein_product`
(
`id` int NOT NULL AUTO_INCREMENT,

Loading…
Cancel
Save