同步数据修改,界面修改

master
anthonyywj2 3 years ago
parent 67e16c3248
commit c7a6f4ab41

@ -367,6 +367,14 @@
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
</plugins>
</build>

@ -15,4 +15,7 @@ public class Constant {
public static final String dlThrInvProducts = "THR_DOWNLOAD_INV_PRODUCTS";
public static final String dlThrOrders = "THR_DOWNLOAD_ORDERS";
public static final String dlThrCorps = "THR_DOWNLOAD_CORPS";
public static String SPTM_TO_DI = "sptm_to_di";
}

@ -6,6 +6,7 @@ import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.entity.basic.BasicThirdSysBusApiEntity;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.basic.BasicThirdSysEntity;
import com.glxp.api.admin.httpclient.ErpBasicClient;
import com.glxp.api.admin.req.basic.FilterBasicThirdSysDetailRequest;
import com.glxp.api.admin.req.basic.FilterBasicThirdSysRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
@ -276,4 +277,12 @@ public class BasicThirdSysController {
return basicThirdSysDetailService.testThirdService(basicThirdSysEntity);
}
@Resource
ErpBasicClient erpBasicClient;
@PostMapping("/udiwms/basic/thirdsys/testThirdInter")
public BaseResponse testThirdInter(@RequestBody BasicThirdSysEntity basicThirdSysEntity) {
return erpBasicClient.testThridConnect(basicThirdSysEntity);
}
}

@ -262,7 +262,7 @@ public class BasicUnitMaintainController {
basicUnitImportService.selectAllUnit(basicThirdSysDetailEntity, unitMaintainFilterRequest);
} else {
return ResultVOUtils.error(500, "第三方往来单位服务未启用");
return ResultVOUtils.error(500, "第三方系统往来单位接口服务未启用");
}
@ -414,7 +414,7 @@ public class BasicUnitMaintainController {
return ResultVOUtils.success(pageSimpleResponse);
}
} else {
return ResultVOUtils.error(500, "第三方往来单位服务未启用");
return ResultVOUtils.error(500, "第三方系统往来单位服务接口未启用");
}

@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@RestController
@ -132,6 +133,11 @@ public class BussinessChangeTypeController {
}
if (bussinessTypeEntity != null) {
bussinessChangeTypeService.updateBusChangeType(bussinessTypeEntity);
BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findByAction(bussinessTypeEntity.getAction());
bussinessLocalTypeEntity.setUpdateTime(new Date());
bussinessLocalTypeService.updateBusLocalType(bussinessLocalTypeEntity);
} else {
ResultVOUtils.error(999, "参数错误");
}

@ -104,6 +104,7 @@ public class BussinessOriginTypeController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (bussinessTypeEntity != null) {
bussinessTypeEntity.setUpdateTime(new Date());
bussinessOriginTypeService.insertBusOriginType(bussinessTypeEntity);
} else {
return ResultVOUtils.error(999, "参数错误");

@ -180,7 +180,8 @@ public class SpsSyncExportStatusController {
spsSyncDataRequest.setLimit(1);
if (StrUtil.isEmpty(syncTime)) {
BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByKey(type);
spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime());
if (basicExportStatusTimeEntity != null)
spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime());
} else {
spsSyncDataRequest.setLastUpdateTime(syncTime);
}

@ -194,7 +194,7 @@ public class UdiInfoController {
return ResultVOUtils.success(pageSimpleResponse);
}
} else {
return ResultVOUtils.error(500, "第三方产品信息服务未启用");
return ResultVOUtils.error(500, "第三方系统产品信息接口服务未启用");
}

@ -373,7 +373,7 @@ public class OrderController {
String supplementOrderNo = orderNo;
supplementOrder.setOriginUllageSupNo(orderEntity.getId());
supplementOrder.setId(supplementOrderNo);
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
supplementOrder.setStatus(ConstantStatus.ORDER_STATUS_ADDITIONAL);
supplementOrder.setExportStatus(0); //设置导出状态为未导出

@ -295,7 +295,7 @@ public class OrderDetailController {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = bussinessOriginTypeService.findSysByAction(filterErpOrderRequest.getBillAction(), "orderQueryUrl");
filterErpOrderRequest.setThirdOrderFk(basicThirdSysDetailEntity.getThirdSysFk());
if (basicThirdSysDetailEntity == null || !basicThirdSysDetailEntity.getEnabled()) {
return ResultVOUtils.error(500, "第三方业务单据服务未启用");
return ResultVOUtils.error(500, "第三方系统业务单据接口服务未启用");
}
if (basicThirdSysDetailEntity.getThirdSysFk() == null) {
@ -592,20 +592,6 @@ public class OrderDetailController {
return ResultVOUtils.success("导入成功");
}
// @PostMapping("/warehouse/repeatCheck")//TODO 重新校验
// public BaseResponse repeatCheck(@RequestBody FilterErpOrderRequest filterErpOrderRequest, BindingResult bindingResult) {
//
// if (bindingResult.hasErrors()) {
// return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
// }
// OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
// orderFilterRequest.setId(filterErpOrderRequest.getOrderId());
// OrderEntity orderEntity = orderService.findOne(orderFilterRequest);
// transInoutService.repeatCheck(orderEntity.getId());
// return ResultVOUtils.success("后台已开始校验,请稍后刷新重试!");
// }
@AuthRuleAnnotation("")
@PostMapping("/warehouse/repeatPrintCheck")//TODO 重新校验
public BaseResponse repeatPrintCheck(@RequestBody FilterErpOrderRequest filterErpOrderRequest, BindingResult bindingResult) {

@ -440,6 +440,19 @@ public class WareHouseController {
UdiEntity udiEntity = FilterUdiUtils.getUdi(code);
if (udiEntity == null) {
String sptmtodi = systemParamConfigService.selectValueByParamKey(Constant.SPTM_TO_DI);
if (sptmtodi.equals("1")) {
if (code.length() == 13) {
UdiInfoEntity udiInfoEntity = udiInfoService.findBySptm(code);
if (udiInfoEntity != null) {
BaseResponse baseResponse = ResultVOUtils.error(508, "商品条码");
baseResponse.setData(udiInfoEntity);
return baseResponse;
}
}
}
BaseResponse baseResponse = ResultVOUtils.error(501, "UDI码格式错误");
baseResponse.setData(originCode);
return baseResponse;
@ -956,17 +969,41 @@ public class WareHouseController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
Integer userId = customerService.getUserId();
try {
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("sps_sync_upload_order");
if (systemParamConfigEntity.getParamValue().equals("1")) {
postOrderRequest.setWmsUserId(userId + "");
return spsDirectClient.uploadPdaOrder(postOrderRequest);
} else {
PostOrderRequest inPostOrder = new PostOrderRequest();
List<PostOrderRequest.PostOrder> inPostOrders = new ArrayList<>();
PostOrderRequest outPostOrder = new PostOrderRequest();
List<PostOrderRequest.PostOrder> outPostOrders = new ArrayList<>();
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrders();
if (postOrders != null && postOrders.size() > 0) {
for (PostOrderRequest.PostOrder postOrder : postOrders) {
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(postOrder.getCodes().get(0).getAction());
if (bussinessTypeEntity.isOutTospms()) {
outPostOrders.add(postOrder);
} else {
inPostOrders.add(postOrder);
}
}
}
BeanUtils.copyProperties(postOrderRequest, inPostOrder);
BeanUtils.copyProperties(postOrderRequest, outPostOrder);
inPostOrder.setPostOrders(inPostOrders);
outPostOrder.setPostOrders(outPostOrders);
if (CollUtil.isNotEmpty(outPostOrders)) {
outPostOrder.setWmsUserId(userId + "");
return spsDirectClient.uploadPdaOrder(outPostOrder);
}
if (CollUtil.isNotEmpty(inPostOrders)) {
String customerId = getCustomerId();
postOrderRequest.setCustomerId(customerId);
postOrderRequest.setUserId(userId);
ioTransInoutService.creatOrder(postOrderRequest, null);
inPostOrder.setCustomerId(customerId);
inPostOrder.setUserId(userId);
ioTransInoutService.creatOrder(inPostOrder, null);
}
@ -974,7 +1011,7 @@ public class WareHouseController {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success("导入成功");
return ResultVOUtils.success("上传成功,等待后台处理");
}
@ -1050,6 +1087,7 @@ public class WareHouseController {
if (StrUtil.isBlank(code) || StrUtil.isBlank(userListJson))
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
warehouseUserService.saveWarehouseUser(code, JSONUtil.toList(userListJson, AuthAdmin.class));
invWarehouseService.updateTime(code, new Date());
return ResultVOUtils.success();
}
@ -1061,6 +1099,8 @@ public class WareHouseController {
if (StrUtil.isBlank(code) || StrUtil.isBlank(bussinessTypeJson))
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
warehouseBussinessTypeService.saveWarehouseBussinessType(code, JSONUtil.toList(bussinessTypeJson, BussinessTypResponse.class));
invWarehouseService.updateTime(code, new Date());
return ResultVOUtils.success();
}
@ -1070,6 +1110,7 @@ public class WareHouseController {
if (warehouseUserEntity == null)
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
warehouseUserService.updateDirector(warehouseUserEntity);
invWarehouseService.updateTime(warehouseUserEntity.getCode(), new Date());
return ResultVOUtils.success();
}

@ -69,7 +69,7 @@ public class InvErpOnhandController {
else
onHandUrl = basicThirdSysDetailEntity.getValue();
if (!basicThirdSysDetailEntity.getEnabled()) {
return ResultVOUtils.error(500, "第三方库存信息服务未启用!");
return ResultVOUtils.error(500, "第三方系统库存信息接口服务未启用!");
}
if (basicThirdSysDetailEntity.getFromType() == 0 || (onhandQueryRequest.getIsDownThrSys() != null && onhandQueryRequest.getIsDownThrSys())) {

@ -216,7 +216,7 @@ public class ThrCorpExportLogController {
return ResultVOUtils.success(pageSimpleResponse);
}
} else {
return ResultVOUtils.error(500, "第三方往来单位服务未启用");
return ResultVOUtils.error(500, "第三方系统往来单位接口服务未启用");
}

@ -155,7 +155,7 @@ public class ThrInvProductsExportLogController {
else
onHandUrl = basicThirdSysDetailEntity.getValue();
if (!basicThirdSysDetailEntity.getEnabled()) {
return ResultVOUtils.error(500, "第三方库存信息服务未启用!");
return ResultVOUtils.error(500, "第三方系统库存信息接口服务未启用!");
}
if (basicThirdSysDetailEntity.getFromType() == 0 ) {

@ -24,10 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
*
@ -105,6 +102,7 @@ public class ThrInvWarehouseController {
thrInvWarehouseEntity.setLevel(pEntity.getLevel());
thrInvWarehouseEntity.setPcode(pEntity.getPcode());
}
thrInvWarehouseEntity.setUpdateTime(new Date());
boolean b = thrInvWarehouseService.insertInvWarehouse(thrInvWarehouseEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);

@ -177,7 +177,7 @@ public class ThrOrderExportLogController {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = bussinessTypeService.findByActionKey(filterErpOrderRequest.getBillAction(), "orderQueryUrl");
if (!basicThirdSysDetailEntity.getEnabled() || basicThirdSysDetailEntity.getThirdSysFk() == null) {
return ResultVOUtils.error(500, "第三方业务单据服务未启用");
return ResultVOUtils.error(500, "第三方系统业务单据接口服务未启用");
}
if (basicThirdSysDetailEntity.getValue() == null) {
return ResultVOUtils.error(500, "业务单据查询接口未定义");

@ -191,7 +191,7 @@ public class ThrProductsExportLogController {
return ResultVOUtils.success(pageSimpleResponse);
}
} else {
return ResultVOUtils.error(500, "第三方产品信息服务未启用");
return ResultVOUtils.error(500, "第三方系统产品信息接口服务未启用");
}
}
}

@ -28,5 +28,6 @@ public class BussinessLocalTypeEntity {
private String prefix;
private String localPrefix;
private boolean preIn;
private boolean outTospms;
}

@ -56,5 +56,6 @@ public class BussinessTypeEntity {
private String prefix;
private String localPrefix;
private boolean preIn;
private boolean outTospms;
}

@ -27,5 +27,7 @@ public class SpsBusLoclTypeResponse {
private String prefix;
private String localPrefix;
private boolean preIn;
private boolean changeEnable;
}

@ -26,4 +26,5 @@ public class SyncDataSetEntity {
private boolean orderUnCheck; //待校验单据
private String busTypes; //单据类型
private String syncIp;
private boolean sysUser;
}

@ -125,4 +125,17 @@ public class ErpBasicClient {
}
}
//测试连通性
public BaseResponse testThridConnect(BasicThirdSysEntity basicThirdSysEntity) {
String response = HttpClient.uCloudPost(basicThirdSysEntity.getThridUrl() + "/udiwms/erp/testThirdSys", "{}");
log.info(response);
try {
return JSONObject.parseObject(response, BaseResponse.class);
} catch (Exception e) {
log.info("测试第三方服务接口连通性失败");
return ResultVOUtils.error(500, "连接失败");
}
}
}

@ -3,6 +3,7 @@ package com.glxp.api.admin.httpclient;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.glxp.api.admin.entity.basic.BasicExportStatusEntity;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.entity.inout.IOOrderStatusEntity;
import com.glxp.api.admin.httpclient.UHttpClient;
import com.glxp.api.admin.req.basic.BasicExportStatusRequest;
@ -14,11 +15,13 @@ import com.glxp.api.admin.res.basic.SpsSyncDataResponse;
import com.glxp.api.admin.res.basic.SpsSyncOrderResponse;
import com.glxp.api.admin.res.basic.SpsSyncScheduleResponse;
import com.glxp.api.admin.res.inout.DlOrderResponse;
import com.glxp.api.admin.service.info.SyncDataSetService;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -26,13 +29,21 @@ import java.util.Map;
@Service
public class SpGetHttpClient {
@Value("${SPSYNC_IP}")
private String spsSyncUrl;
// @Value("${SPSYNC_IP}")
// private String spsSyncUrl;
@Resource
SyncDataSetService syncDataSetService;
public String getIpUrl() {
SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet();
return syncDataSetEntity.getSyncIp();
}
public BaseResponse<PageSimpleResponse<IOOrderStatusEntity>> getOrderStatus() {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("status", 1);
String response = UHttpClient.mipsGet(spsSyncUrl + "/spms/inout/order/status", paramMap);
String response = UHttpClient.mipsGet(getIpUrl() + "/spms/inout/order/status", paramMap);
try {
BaseResponse<PageSimpleResponse<IOOrderStatusEntity>> data =
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<IOOrderStatusEntity>>>() {
@ -49,7 +60,7 @@ public class SpGetHttpClient {
public BaseResponse<List<DlOrderResponse>> getOrders(String orderId) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("orderId", orderId);
String response = UHttpClient.mipsGet(spsSyncUrl + "/spms/inout/order/dlByStatus", paramMap);
String response = UHttpClient.mipsGet(getIpUrl() + "/spms/inout/order/dlByStatus", paramMap);
try {
BaseResponse<List<DlOrderResponse>> data =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<DlOrderResponse>>>() {
@ -66,7 +77,7 @@ public class SpGetHttpClient {
OrderStatusFilterRequest orderStatusFilterRequest = new OrderStatusFilterRequest();
orderStatusFilterRequest.setOrderId(orderId);
orderStatusFilterRequest.setStatus(2);
String result = UHttpClient.postJson(spsSyncUrl + "/spms/inout/order/updateStatus", orderStatusFilterRequest);
String result = UHttpClient.postJson(getIpUrl() + "/spms/inout/order/updateStatus", orderStatusFilterRequest);
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -77,7 +88,7 @@ public class SpGetHttpClient {
public BaseResponse<List<BasicExportStatusEntity>> getBasicStatus(String type) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("type", type);
String response = UHttpClient.mipsGet(spsSyncUrl + "/spssync/basic/udiinfo/getStatus", paramMap);
String response = UHttpClient.mipsGet(getIpUrl() + "/spssync/basic/udiinfo/getStatus", paramMap);
try {
BaseResponse<List<BasicExportStatusEntity>> data =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<BasicExportStatusEntity>>>() {
@ -92,7 +103,7 @@ public class SpGetHttpClient {
public BaseResponse<String> testConnect() {
Map<String, Object> paramMap = new HashMap<>(16);
String response = UHttpClient.mipsGet(spsSyncUrl + "/sps/sync/connect/test", paramMap);
String response = UHttpClient.mipsGet(getIpUrl() + "/sps/sync/connect/test", paramMap);
try {
BaseResponse<String> data =
JSONObject.parseObject(response, new TypeReference<BaseResponse<String>>() {
@ -115,7 +126,7 @@ public class SpGetHttpClient {
paramMap.put("id", basicExportStatusRequest.getId());
if (basicExportStatusRequest.getScheduleType() != null)
paramMap.put("scheduleType", basicExportStatusRequest.getScheduleType());
String response = UHttpClient.mipsGet(spsSyncUrl + "/spssync/basic/udiinfo/getStatus", paramMap);
String response = UHttpClient.mipsGet(getIpUrl() + "/spssync/basic/udiinfo/getStatus", paramMap);
try {
BaseResponse<List<BasicExportStatusEntity>> data =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<BasicExportStatusEntity>>>() {
@ -133,7 +144,7 @@ public class SpGetHttpClient {
BasicExportStatusRequest basicExportStatusRequest = new BasicExportStatusRequest();
basicExportStatusRequest.setId(id);
basicExportStatusRequest.setType(type);
String result = UHttpClient.postJson(spsSyncUrl + "/spssync/basic/udiinfo/downloadByStatus", basicExportStatusRequest);
String result = UHttpClient.postJson(getIpUrl() + "/spssync/basic/udiinfo/downloadByStatus", basicExportStatusRequest);
return result;
}
@ -141,7 +152,7 @@ public class SpGetHttpClient {
public BaseResponse<String> postBasicStatus(String id) {
BasicExportStatusRequest basicStatusFilterRequest = new BasicExportStatusRequest();
basicStatusFilterRequest.setId(id);
String result = UHttpClient.postJson(spsSyncUrl + "/spssync/basic/udiinfo/deleteByStatus", basicStatusFilterRequest);
String result = UHttpClient.postJson(getIpUrl() + "/spssync/basic/udiinfo/deleteByStatus", basicStatusFilterRequest);
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -150,7 +161,7 @@ public class SpGetHttpClient {
public BaseResponse<String> postAllBaseData(SpsSyncDataResponse syncDataResponse) {
String result = UHttpClient.postJson(spsSyncUrl + "/sps/sync/basic/upload", syncDataResponse);
String result = UHttpClient.postJson(getIpUrl() + "/sps/sync/basic/upload", syncDataResponse);
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -159,7 +170,7 @@ public class SpGetHttpClient {
public BaseResponse<String> postAllBus(SpsSyncBusResponse spsSyncBusResponse) {
String result = UHttpClient.postJson(spsSyncUrl + "/sps/sync/busType/upload", spsSyncBusResponse);
String result = UHttpClient.postJson(getIpUrl() + "/sps/sync/busType/upload", spsSyncBusResponse);
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -168,7 +179,7 @@ public class SpGetHttpClient {
public BaseResponse<String> postAllOrder(SpsSyncOrderResponse spsSyncOrderResponse) {
String result = UHttpClient.postJson(spsSyncUrl + "/sps/sync/order/upload", spsSyncOrderResponse);
String result = UHttpClient.postJson(getIpUrl() + "/sps/sync/order/upload", spsSyncOrderResponse);
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -176,7 +187,7 @@ public class SpGetHttpClient {
}
public BaseResponse<String> postAllSchedule(SpsSyncScheduleResponse spsSyncScheduleResponse) {
String result = UHttpClient.postJson(spsSyncUrl + "/sps/sync/schedule/upload", spsSyncScheduleResponse);
String result = UHttpClient.postJson(getIpUrl() + "/sps/sync/schedule/upload", spsSyncScheduleResponse);
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});

@ -2,25 +2,33 @@ package com.glxp.api.admin.httpclient;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.req.inout.OrderFilterRequest;
import com.glxp.api.admin.req.inout.PostOrderRequest;
import com.glxp.api.admin.service.info.SyncDataSetService;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
@Service
public class SpsDirectClient {
@Value("${SPSYNC_IP}")
private String spsSyncUrl;
// @Value("${SPSYNC_IP}")
// private String spsSyncUrl;
@Resource
SyncDataSetService syncDataSetService;
public String getIpUrl() {
SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet();
return syncDataSetEntity.getSyncIp();
}
//单据验收
public BaseResponse reviewOrder(OrderFilterRequest orderFilterRequest) {
String result = UHttpClient.postJson(spsSyncUrl + "/sps/review/download/order/finsih", orderFilterRequest);
String result = UHttpClient.postJson(getIpUrl() + "/sps/review/download/order/finsih", orderFilterRequest);
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});
@ -34,7 +42,7 @@ public class SpsDirectClient {
paramMap.put("wmsUserId", wmsUserId);
paramMap.put("orderId", orderId);
paramMap.put("action", action);
String response = UHttpClient.mipsGet(spsSyncUrl + "/sps/review/download/order", paramMap);
String response = UHttpClient.mipsGet(getIpUrl() + "/sps/review/download/order", paramMap);
try {
BaseResponse data = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
@ -50,7 +58,7 @@ public class SpsDirectClient {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("wmsUserId", wmsUserId);
paramMap.put("orderId", orderId);
String response = UHttpClient.mipsGet(spsSyncUrl + "/sps/review/download/orderDetail", paramMap);
String response = UHttpClient.mipsGet(getIpUrl() + "/sps/review/download/orderDetail", paramMap);
try {
BaseResponse data = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
@ -67,7 +75,7 @@ public class SpsDirectClient {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("wmsUserId", wmsUserId);
paramMap.put("orderId", orderId);
String response = UHttpClient.mipsGet(spsSyncUrl + "/sps/review/download/codes", paramMap);
String response = UHttpClient.mipsGet(getIpUrl() + "/sps/review/download/codes", paramMap);
try {
BaseResponse data = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
@ -81,7 +89,7 @@ public class SpsDirectClient {
//单据上传
public BaseResponse uploadPdaOrder(PostOrderRequest postOrderRequest) {
String result = UHttpClient.postJson(spsSyncUrl + "/sps/pda/upload/orders", postOrderRequest);
String result = UHttpClient.postJson(getIpUrl() + "/sps/pda/upload/orders", postOrderRequest);
BaseResponse<String> response =
JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() {
});

@ -18,4 +18,6 @@ public class AuthAdminQueryRequest extends ListPageRequest {
private List<Long> ids;
private String lastUpdateTime;
}

@ -16,14 +16,6 @@ public class PostOrderRequest {
private String wmsUserId;
private String wmsUserName;
public List<PostOrder> getPostOrder() {
return postOrders;
}
public void setPostOrder(List<PostOrder> postOrder) {
this.postOrders = postOrder;
}
public int getSubmitType() {
return submitType;
}

@ -59,5 +59,6 @@ public class BussinessTypResponse {
private String prefix;
private String localPrefix;
private boolean preIn;
private boolean outTospms;
}

@ -1,9 +1,6 @@
package com.glxp.api.admin.res.basic;
import com.glxp.api.admin.entity.basic.BussinessLocalTypeEntity;
import com.glxp.api.admin.entity.basic.BussinessOriginTypeEntity;
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
import com.glxp.api.admin.entity.basic.SpsBusLoclTypeResponse;
import com.glxp.api.admin.entity.basic.*;
import lombok.Data;
import java.util.List;
@ -14,4 +11,6 @@ public class SpsSyncBusResponse {
private List<BussinessTypeEntity> bussinessTypeEntities;
private List<BussinessOriginTypeEntity> bussinessOriginTypeEntities;
private List<SpsBusLoclTypeResponse> bussinessLocalTypeEntities;
private List<BussinessChangeTypeEntity> bussinessChangeTypeEntities;
}

@ -26,5 +26,6 @@ public class SyncDataSetResponse {
private Integer syncTime;
private String syncIp;
private Integer syncDownloadTime; //定时下载时间
private boolean sysUser;
}

@ -26,8 +26,11 @@ public class AuthAdminServiceImpl implements AuthAdminService {
if (authAdminQueryRequest == null) {
return Collections.emptyList();
}
int offset = (authAdminQueryRequest.getPage() - 1) * authAdminQueryRequest.getLimit();
PageHelper.offsetPage(offset, authAdminQueryRequest.getLimit());
if (authAdminQueryRequest.getPage() != null) {
int offset = (authAdminQueryRequest.getPage() - 1) * authAdminQueryRequest.getLimit();
PageHelper.offsetPage(offset, authAdminQueryRequest.getLimit());
}
return authAdminDao.listAdminPage(authAdminQueryRequest);
}
@ -38,6 +41,7 @@ public class AuthAdminServiceImpl implements AuthAdminService {
/**
* id info
*
* @param id
* @return
*/
@ -48,6 +52,7 @@ public class AuthAdminServiceImpl implements AuthAdminService {
/**
* id
*
* @param id
* @return
*/
@ -58,6 +63,7 @@ public class AuthAdminServiceImpl implements AuthAdminService {
/**
*
*
* @param authAdmin
* @return
*/
@ -76,6 +82,7 @@ public class AuthAdminServiceImpl implements AuthAdminService {
/**
*
*
* @param authAdmin
* @return
*/
@ -99,6 +106,7 @@ public class AuthAdminServiceImpl implements AuthAdminService {
/**
* id
*
* @param id
* @return
*/
@ -106,6 +114,7 @@ public class AuthAdminServiceImpl implements AuthAdminService {
public boolean deleteById(Long id) {
return authAdminDao.deleteById(id);
}
@Override
public List<AuthAdmin> getHospitalUserList() {
List<AuthAdmin> userList = authAdminDao.selectHospitalUser();

@ -27,6 +27,8 @@ public interface BussinessLocalTypeService {
BussinessOriginTypeResponse findOriginJoinByAction(String action);
BussinessLocalTypeEntity findByAction(String action);
BussinessLocalTypeEntity findBTByAction(String action);
BussinessLocalTypeEntity findBTByName(String name);

@ -11,6 +11,8 @@ import java.util.List;
public interface UdiInfoService {
List<UdiInfoEntity> filterUdiInfo(FilterUdiInfoRequest filterUdiInfoRequest);
UdiInfoEntity findBySptm(String sptm);
List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiInfoRequest filterUdiInfoRequest);
List<UdiInfoEntity> filterAllUdiInfo(FilterUdiInfoRequest filterUdiInfoRequest);

@ -1,5 +1,6 @@
package com.glxp.api.admin.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.basic.BussinessLocalTypeDao;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
@ -119,6 +120,17 @@ public class BussinessLocalTypeServiceImpl implements BussinessLocalTypeService
return null;
}
@Override
public BussinessLocalTypeEntity findByAction(String action) {
BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest();
bussinessLocalTypeFilterRequest.setAction(action);
List<BussinessLocalTypeEntity> data = bussinessLocalTypeDao.filterAllList(bussinessLocalTypeFilterRequest);
if (CollUtil.isNotEmpty(data)) {
data.get(0);
}
return null;
}
@Override
public BussinessLocalTypeEntity findBTByAction(String action) {
BussinessLocalTypeFilterRequest bussinessTypeFilterRequest = new BussinessLocalTypeFilterRequest();

@ -1,5 +1,6 @@
package com.glxp.api.admin.service.basic.impl;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.basic.UdiInfoDao;
import com.glxp.api.admin.entity.basic.UdiInfoEntity;
@ -33,6 +34,18 @@ public class UdiInfoServiceImpl implements UdiInfoService {
return data;
}
@Override
public UdiInfoEntity findBySptm(String sptm) {
FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest();
filterUdiInfoRequest.setSptm(sptm);
List<UdiInfoEntity> data = udiInfoDao.filterUdiInfo(filterUdiInfoRequest);
if (CollUtil.isNotEmpty(data)) {
return data.get(0);
}
return null;
}
@Override
public List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiInfoRequest filterUdiInfoRequest) {
if (filterUdiInfoRequest == null) {

@ -52,7 +52,7 @@ public class ThrDataService {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailService.selectByKey("piQueryUrl", thirdSys);
if (basicThirdSysDetailEntity == null || !basicThirdSysDetailEntity.getEnabled()) {
logger.info("第三方产品信息服务未启用");
logger.info("第三方系统产品信息接口服务未启用");
return null;
}

@ -5,6 +5,7 @@ import com.alibaba.fastjson.TypeReference;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.entity.basic.*;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.entity.info.SystemParamConfigEntity;
import com.glxp.api.admin.req.basic.*;
import com.glxp.api.admin.res.basic.BasicUnitMaintainExportResponse;
@ -14,6 +15,7 @@ import com.glxp.api.admin.service.basic.BasicUnitMaintainService;
import com.glxp.api.admin.service.basic.CorpExportLogService;
import com.glxp.api.admin.service.basic.UdiInfoExportLogService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
import com.glxp.api.admin.service.info.SyncDataSetService;
import com.glxp.api.admin.service.info.SystemParamConfigService;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.admin.util.HttpClient;
@ -33,8 +35,15 @@ import java.util.List;
@Service
public class BasicGenExcelService {
@Value("${SPSYNC_IP}")
private String spsSyncUrl;
// @Value("${SPSYNC_IP}")
// private String spsSyncUrl;
@Resource
SyncDataSetService syncDataSetService;
public String getIpUrl() {
SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet();
return syncDataSetEntity.getSyncIp();
}
@Resource
CorpExportLogService corpExportLogService;
@ -155,7 +164,7 @@ public class BasicGenExcelService {
//todo 上传SMP
// SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("smp_service_ip");
// if (systemParamConfigEntity != null) {
String response = HttpClient.uCloudPost(spsSyncUrl + "/udiwms/basic/corps/upload", postCorpsRequest);
String response = HttpClient.uCloudPost(getIpUrl() + "/udiwms/basic/corps/upload", postCorpsRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
@ -173,12 +182,11 @@ public class BasicGenExcelService {
}
@Async
public void uploadCorpSmpJson(String genKey, BasicUnitMaintainExportResponse exportData) {
CorpExportLogEntity corpExportLogEntity = corpExportLogService.selectByGenKey(genKey);
String response = HttpClient.uCloudPost(spsSyncUrl + "/spssync/basic/corp/upload", exportData);
String response = HttpClient.uCloudPost(getIpUrl() + "/spssync/basic/corp/upload", exportData);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
@ -247,7 +255,7 @@ public class BasicGenExcelService {
public void uploadProductsSmpJson(String genKey, UdiRelevanceExportJsonResponse exportData) {
UdiInfoExportLogEntity udiInfoExportLogEntity = udiInfoExportLogService.selectByGenKey(genKey);
// String response = HttpClient.uCloudPost(spsSyncUrl + "/udiwms/basic/products/upload", exportData);
String response = HttpClient.uCloudPost(spsSyncUrl + "/spssync/basic/udiinfo/upload", exportData);
String response = HttpClient.uCloudPost(getIpUrl() + "/spssync/basic/udiinfo/upload", exportData);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
@ -286,7 +294,7 @@ public class BasicGenExcelService {
//todo 上传SMP
// SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("smp_service_ip");
// if (systemParamConfigEntity != null) {
String response = HttpClient.uCloudPost(spsSyncUrl + "/udiwms/basic/products/upload", postUdiInfoRequest);
String response = HttpClient.uCloudPost(getIpUrl() + "/udiwms/basic/products/upload", postUdiInfoRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {

@ -20,6 +20,7 @@ import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.req.basic.BasicExportStatusRequest;
import com.glxp.api.admin.res.basic.*;
import com.glxp.api.admin.service.auth.AuthAdminService;
import com.glxp.api.admin.service.basic.BussinessChangeTypeService;
import com.glxp.api.admin.service.basic.UdiInfoImportDetailService;
import com.glxp.api.admin.service.inout.OrderService;
import com.glxp.api.admin.service.inventory.InvWarehouseService;
@ -47,10 +48,6 @@ public class DlBasicService {
@Resource
SpGetHttpClient spGetHttp;
@Resource
UdiInfoImportDetailService udiInfoImportDetailService;
@Resource
BasicCorpImportService basicCorpImportService;
@Resource
InvWarehouseService invWarehouseService;
@Resource
SqlSessionFactory sqlSessionFactory;
@ -69,6 +66,8 @@ public class DlBasicService {
@Resource
ThrInvWarehouseService thrInvWarehouseService;
@Resource
BussinessChangeTypeService bussinessChangeTypeService;
private static final Logger logger = LoggerFactory.getLogger(DlBasicService.class);
//------------------------------------------------------------
@ -218,13 +217,6 @@ public class DlBasicService {
thrInvWarehouseService.insertInvWarehouses(syncDataResponse.getThrInvWarehouseEntities());
}
//用户表
if (CollUtil.isNotEmpty(syncDataResponse.getAuthAdminList())) {
for (AuthAdmin authAdmin : syncDataResponse.getAuthAdminList()) {
authAdmin.setLastModifyTime(null);
authAdminService.replaceAuthAdmin(authAdmin);
}
}
//仓库用户表
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseUserEntities())) {
@ -282,6 +274,7 @@ public class DlBasicService {
}
batchSession.commit();
} catch (Exception e) {
logger.error(e.getMessage());
}
}
//业务单据
@ -293,10 +286,18 @@ public class DlBasicService {
BussinessLocalTypeEntity bussinessTypeEntity = new BussinessLocalTypeEntity();
BeanUtils.copyProperties(spsBusLoclTypeResponse, bussinessTypeEntity);
bussinessTypeEntity.setUpdateTime(null);
bussinessChangeTypeService.deleteByAction(spsBusLoclTypeResponse.getAction());
mapper.insertBussinessType(bussinessTypeEntity);
}
batchSession.commit();
List<BussinessChangeTypeEntity> bussinessChangeTypeEntities = syncDataResponse.getBussinessChangeTypeEntities();
if (CollUtil.isNotEmpty(bussinessChangeTypeEntities)) {
for (BussinessChangeTypeEntity bussinessChangeTypeEntity : bussinessChangeTypeEntities) {
bussinessChangeTypeService.insertBusChangeTypee(bussinessChangeTypeEntity);
}
}
} catch (Exception e) {
logger.error(e.getMessage());
}
}
//原始单据
@ -310,6 +311,7 @@ public class DlBasicService {
}
batchSession.commit();
} catch (Exception e) {
logger.error(e.getMessage());
}
}
batchSession.close();
@ -346,17 +348,15 @@ public class DlBasicService {
orderEntity.setErpFk(null);
orderEntity.setOutChangeEnable(false);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
OrderEntity temp = orderService.findById(orderEntity.getId());
if(temp == null){
if (temp == null) {
mapper.importOrder(orderEntity);
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseEntityList())) {
try {
CodesTempDao codeMappert = batchSession.getMapper(CodesTempDao.class);
List<WarehouseEntity> warehouseEntityList = syncDataResponse.getWarehouseEntityList();
for (WarehouseEntity warehouseEntity:warehouseEntityList){
if(warehouseEntity.getOrderId().equals(orderEntity.getId())){
for (WarehouseEntity warehouseEntity : warehouseEntityList) {
if (warehouseEntity.getOrderId().equals(orderEntity.getId())) {
codeMappert.replaceCodesTempSingle(warehouseEntity);
}
}
@ -364,7 +364,6 @@ public class DlBasicService {
} catch (Exception e) {
}
}
}
}
@ -372,18 +371,6 @@ public class DlBasicService {
} catch (Exception e) {
}
}
// if (CollUtil.isNotEmpty(syncDataResponse.getOrderDetailEntityList())) {
// try {
// List<ErpOrderEntity> erpOrderEntities = syncDataResponse.getOrderDetailEntityList();
// OrderDetailDao mapper = batchSession.getMapper(OrderDetailDao.class);
// for (ErpOrderEntity erpOrderEntity : erpOrderEntities) {
// mapper.insertErpOrder(erpOrderEntity);
// }
// batchSession.commit();
// } catch (Exception e) {
// }
// }
batchSession.close();
spGetHttp.postBasicStatus(basicExportStatusEntity.getId());
}
@ -406,8 +393,8 @@ public class DlBasicService {
if (basicExportStatusEntity.getId().equals("AsyncUploadAllData")) {
heartService.uploadAllBus(null);
heartService.uploadAllData(null);
heartService.uploadScheduleList();
heartService.uploadAllOrder(null);
heartService.uploadScheduleList();
redisUtil.set("SPS_SYNC_UPLOAD_DATA", System.currentTimeMillis());
}
}

@ -90,6 +90,7 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer {
List<String> thirdIds = basicThirdSysDao.selectEnabledThirdId();
if (CollUtil.isNotEmpty(thirdIds)) {
for (String thirdId : thirdIds) {
log.info("自动下载第三方系统为:{} 的基础数据", thirdId);
log.info("开始下载第三方系统的仓库数据");
BaseResponse baseResponse = thrInvWarehouseService.downloadThirdWarehouse(thirdId);
@ -100,7 +101,6 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer {
log.error(JSONUtil.toJsonStr(baseResponse));
}
log.info("开始下载第三方系统的往来单位数据");
ThrCorpImportLogEntity thrCorpImportLogEntity = new ThrCorpImportLogEntity();
String genKey = CustomUtil.getId();
@ -130,8 +130,7 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer {
thrProductsDlService.importProducrs(genKey1, filterThrProductsRequest);
log.info("第三方系统往来产品信息数据下载完成");
log.info("开始下载第三方系统的产品信息数据");
log.info("开始下载第三方系统单据类型");
FilterBasicThirdSysDetailRequest filterBasicThirdSysDetailRequest = new FilterBasicThirdSysDetailRequest();
filterBasicThirdSysDetailRequest.setThirdSysFk(thirdId);
int page = 1;
@ -163,6 +162,7 @@ public class DownloadThirdSysDataTask implements SchedulingConfigurer {
}
} else {
log.error("第三方系统单据类型数据下载失败");
break;
}
log.info("第三方系统往来产品信息数据下载完成");
}

@ -42,9 +42,8 @@ public class HeartService {
if (basicExportStatusTimeEntity == null) {
basicExportStatusTimeEntity = new BasicExportStatusTimeEntity();
basicExportStatusTimeEntity.setLastUpdateTime("1949-10-01 09:00:00");
basicExportTimeService.insertExportStatus(basicExportStatusTimeEntity);
spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime());
}
spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime());
} else {
spsSyncDataRequest.setLastUpdateTime(syncTime);
}
@ -94,7 +93,16 @@ public class HeartService {
public BaseResponse uploadAllBus(String syncTime) {
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
spsSyncDataRequest.setLastUpdateTime(syncTime);
if (syncTime == null) {
BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByKey(ConstantStatus.SYNC_BUS_TYPE);
if (basicExportStatusTimeEntity == null) {
basicExportStatusTimeEntity = new BasicExportStatusTimeEntity();
basicExportStatusTimeEntity.setLastUpdateTime("1949-10-01 09:00:00");
}
spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime());
} else {
spsSyncDataRequest.setLastUpdateTime(syncTime);
}
SpsSyncBusResponse spsSyncBusResponse = upBasicService.upAllBus(spsSyncDataRequest);
if (CollUtil.isEmpty(spsSyncBusResponse.getBussinessOriginTypeEntities())
&& CollUtil.isEmpty(spsSyncBusResponse.getBussinessLocalTypeEntities())
@ -139,7 +147,18 @@ public class HeartService {
public BaseResponse uploadAllData(String syncTime) {
SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest();
spsSyncDataRequest.setLastUpdateTime(syncTime);
if (syncTime == null) {
BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByKey(ConstantStatus.SYNC_BASIC_DATA);
if (basicExportStatusTimeEntity == null) {
basicExportStatusTimeEntity = new BasicExportStatusTimeEntity();
basicExportStatusTimeEntity.setLastUpdateTime("1949-10-01 09:00:00");
}
spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime());
} else {
spsSyncDataRequest.setLastUpdateTime(syncTime);
}
SpsSyncDataResponse syncDataResponse = upBasicService.upAllData(spsSyncDataRequest);
if (CollUtil.isEmpty(syncDataResponse.getInvWarehouseEntities())
&& CollUtil.isEmpty(syncDataResponse.getUdiInfoEntities())
@ -150,7 +169,10 @@ public class HeartService {
&& CollUtil.isEmpty(syncDataResponse.getThrOrderEntities())
&& CollUtil.isEmpty(syncDataResponse.getThrOrderDetailEntities())
&& CollUtil.isEmpty(syncDataResponse.getCompanyProductRelevanceEntities())
&& CollUtil.isEmpty(syncDataResponse.getUdiRelevanceEntities())) {
&& CollUtil.isEmpty(syncDataResponse.getUdiRelevanceEntities())
&& CollUtil.isEmpty(syncDataResponse.getAuthAdminList())
&& CollUtil.isEmpty(syncDataResponse.getWarehouseBussinessTypeEntities())
&& CollUtil.isEmpty(syncDataResponse.getWarehouseUserEntities())) {
//数据不记录日志
return ResultVOUtils.success("无数据");
}
@ -181,8 +203,6 @@ public class HeartService {
String logs = "";
if (CollUtil.isNotEmpty(syncDataResponse.getUdiRelevanceEntities()))
logs = logs + "耗材字典:" + syncDataResponse.getUdiRelevanceEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getUdiInfoEntities()))
logs = logs + "耗材字典:" + syncDataResponse.getUdiInfoEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getBasicUnitMaintainEntities()))
logs = logs + "往来单位:" + syncDataResponse.getBasicUnitMaintainEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getCompanyProductRelevanceEntities()))
@ -193,12 +213,12 @@ public class HeartService {
logs = logs + "第三方仓库字典:" + syncDataResponse.getThrInvWarehouseEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getThrOrderEntities()))
logs = logs + "第三方业务单据:" + syncDataResponse.getThrOrderEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getThrOrderDetailEntities()))
logs = logs + "第三方业务单据详情:" + syncDataResponse.getThrOrderDetailEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getThrOrderEntities()))
if (CollUtil.isNotEmpty(syncDataResponse.getThrProductsEntities()))
logs = logs + "第三方产品信息:" + syncDataResponse.getThrProductsEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getThrCorpEntities()))
logs = logs + "第三方往来单位:" + syncDataResponse.getThrCorpEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getAuthAdminList()))
logs = logs + "系统用户信息:" + syncDataResponse.getAuthAdminList().size() + "条\n";
basicExportStatusEntity3.setRemark(logs);
basicExportStatusEntity3.setUpdateTime(new Date());
basicExportService.updateExportStatus(basicExportStatusEntity3);

@ -69,122 +69,6 @@ public class IoModifyErpTask implements SchedulingConfigurer {
// modifyErp();
}
public void modifyErp() {
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("erpSaleOutModify");
String isErpSaleOutModify = systemParamConfigEntity.getParamValue();
systemParamConfigEntity = systemParamConfigService.selectByParamKey("erpPruchaseModify");
String isErpPruchaseModify = systemParamConfigEntity.getParamValue();
if ("1".equals(isErpSaleOutModify) || "1".equals(isErpPruchaseModify)) {
logger.info("定时修改ERP单定时签字");
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
orderFilterRequest.setExportStatus(ConstantStatus.ORDER_EXPORT_UN);
orderFilterRequest.setContrastStatus(ConstantStatus.ORDER_CHECK_SUCCESS);
List<OrderEntity> orderEntities = orderService.findAllOrders(orderFilterRequest);
if (orderEntities != null && orderEntities.size() > 0) {
for (OrderEntity orderEntity : orderEntities) {
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setPage(1);
filterErpOrderRequest.setLimit(100);
filterErpOrderRequest.setOrderId(orderEntity.getId());
List<ErpOrderEntity> erpOrderEntities = myErpOrderService.filterMyErpOrder(filterErpOrderRequest);
BasicThirdSysDetailEntity basicThirdSysDetailEntity = bussinessTypeService.findByActionKey(filterErpOrderRequest.getBillAction(), "orderQueryUrl");
if (basicThirdSysDetailEntity.getEnabled() && basicThirdSysDetailEntity.getFromType() == 0) {
if (basicThirdSysDetailEntity.getValue() != null) {
String url = basicThirdSysDetailEntity.getValue();
if (erpOrderEntities != null && !erpOrderEntities.isEmpty()) {
Map<String, List<ErpOrderEntity>> listMap = erpOrderEntities.stream().collect(Collectors.groupingBy(ErpOrderEntity::getErpOrderId));
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
if ("1".equals(isErpSaleOutModify)) {
BaseResponse baseResponse = erpOrderClient.postBill(listMap, orderEntity.getAction(), url, basicThirdSysDetailEntity.getThirdSysFk());
if (baseResponse != null && baseResponse.getCode() == 20000) {
orderService.updateExportStatus(orderEntity.getId(), ConstantStatus.ORDER_EXPORT_ED);
}
}
} else {
if ("1".equals(isErpPruchaseModify)) {
BaseResponse baseResponse = erpOrderClient.postBill(listMap, orderEntity.getAction(), url, basicThirdSysDetailEntity.getThirdSysFk());
if (baseResponse != null && baseResponse.getCode() == 20000) {
orderService.updateExportStatus(orderEntity.getId(), ConstantStatus.ORDER_EXPORT_ED);
}
}
}
}
} else {
logger.error("ERP单据修改接口地址未定义");
}
} else {
logger.error("ERP单据修改未启用");
}
}
}
SystemParamConfigEntity saleOutSign = systemParamConfigService.selectByParamKey("erpSaleOutSign");
String isSaleOutSign = saleOutSign.getParamValue();
saleOutSign = systemParamConfigService.selectByParamKey("erpPruchaseSign");
String isPruchaseSign = saleOutSign.getParamValue();
OrderFilterRequest signFilterRequest = new OrderFilterRequest();
signFilterRequest.setSignStatus(ConstantStatus.ORDER_SIGN_UN);
signFilterRequest.setContrastStatus(ConstantStatus.ORDER_CHECK_SUCCESS);
List<OrderEntity> signsOrderEntities = orderService.findAllOrders(signFilterRequest);
if (signsOrderEntities != null && signsOrderEntities.size() > 0) {
for (OrderEntity orderEntity : signsOrderEntities) {
BasicThirdSysDetailEntity basicThirdSysDetailEntity = bussinessTypeService.findByActionKey(orderEntity.getAction(), "orderQueryUrl");
if (basicThirdSysDetailEntity.getEnabled() && basicThirdSysDetailEntity.getFromType() == 0) {
if (basicThirdSysDetailEntity.getValue() != null) {
String url = basicThirdSysDetailEntity.getValue();
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setOrderId(orderEntity.getId());
List<ErpOrderEntity> erpOrderEntities = myErpOrderService.filterMyErpOrder(filterErpOrderRequest);
if (erpOrderEntities != null && !erpOrderEntities.isEmpty()) {
Map<String, List<ErpOrderEntity>> listMap = erpOrderEntities.stream().collect(Collectors.groupingBy(ErpOrderEntity::getErpOrderId));
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
if ("1".equals(isSaleOutSign)) {
if (listMap != null && listMap.size() > 0) {
for (String key : listMap.keySet()) {
ERPPostBillRequest signRequest = new ERPPostBillRequest();
signRequest.setBillNo(key);
signRequest.setBillAction(orderEntity.getAction());
signRequest.setModifyType("sign");
BaseResponse baseResponse = new ErpOrderClient().postBill(signRequest, url);
if (baseResponse != null && baseResponse.getCode() == 20000) {
orderService.updateSignStatus(orderEntity.getId(), ConstantStatus.ORDER_SIGN_ED + "");
}
}
}
}
} else {
if ("1".equals(isPruchaseSign)) {
if (listMap != null && listMap.size() > 0) {
for (String key : listMap.keySet()) {
ERPPostBillRequest signRequest = new ERPPostBillRequest();
signRequest.setBillNo(key);
signRequest.setBillAction(orderEntity.getAction());
signRequest.setModifyType("sign");
BaseResponse baseResponse = new ErpOrderClient().postBill(signRequest, url);
if (baseResponse != null && baseResponse.getCode() == 20000) {
orderService.updateSignStatus(orderEntity.getId(), ConstantStatus.ORDER_SIGN_ED + "");
}
}
}
}
}
}
} else {
logger.error("ERP单据修改接口地址未定义");
}
} else {
logger.error("ERP单据修改未启用");
}
}
}
}
}
}

@ -125,7 +125,7 @@ public class IoTransInoutService {
//手持终端生成订单,插入零时表
public void creatOrder(PostOrderRequest postOrderRequest, Integer fromType) {
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrder();
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrders();
if (postOrders != null && postOrders.size() > 0) {
for (int i = 0; i < postOrders.size(); i++) {
PostOrderRequest.PostOrder postOrder = postOrders.get(i);
@ -190,7 +190,7 @@ public class IoTransInoutService {
//web端新增订单
@Async
public void creatOrderWeb(PostOrderRequest postOrderRequest) {
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrder();
List<PostOrderRequest.PostOrder> postOrders = postOrderRequest.getPostOrders();
if (postOrders != null && postOrders.size() > 0) {
for (int i = 0; i < postOrders.size(); i++) {
PostOrderRequest.PostOrder postOrder = postOrders.get(i);

@ -8,6 +8,7 @@ import com.glxp.api.admin.config.WebSocketServer;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.httpclient.ErpBasicClient;
import com.glxp.api.admin.req.basic.BasicUnitMaintainFilterRequest;
@ -18,6 +19,7 @@ import com.glxp.api.admin.req.thrsys.ThrCorpExportRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpUnitsResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.info.SyncDataSetService;
import com.glxp.api.admin.service.thrsys.ThrCorpExportLogService;
import com.glxp.api.admin.service.thrsys.ThrCorpImportDetailService;
import com.glxp.api.admin.service.thrsys.ThrCorpImportLogService;
@ -50,10 +52,17 @@ public class ThrCorpsDlService {
ThrCorpExportLogService thrCorpExportLogService;
@Resource
private ThrCorpImportDetailService thrCorpImportDetailService;
@Value("${SPSYNC_IP}")
private String spsSyncUrl;
// @Value("${SPSYNC_IP}")
// private String spsSyncUrl;
@Resource
ErpBasicClient erpBasicClient;
@Resource
SyncDataSetService syncDataSetService;
public String getIpUrl() {
SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet();
return syncDataSetEntity.getSyncIp();
}
@Async
public void importSelectCorps(String genKey, List<ErpUnitsResponse> erpUnitsResponses, String thirdSys) {
@ -180,7 +189,7 @@ public class ThrCorpsDlService {
if (!basicThirdSysDetailEntity.getEnabled()) {
thrCorpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrCorpExportLogEntity.setRemark("第三方往来单位服务未启用");
thrCorpExportLogEntity.setRemark("第三方接口往来单位服务接口未启用");
thrCorpExportLogService.updateThrCorpExportLog(thrCorpExportLogEntity);
return;
}
@ -381,7 +390,7 @@ public class ThrCorpsDlService {
if (!basicThirdSysDetailEntity.getEnabled()) {
thrCorpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrCorpExportLogEntity.setRemark("第三方往来单位服务未启用");
thrCorpExportLogEntity.setRemark("第三方接口往来单位服务接口未启用");
thrCorpExportLogService.updateThrCorpExportLog(thrCorpExportLogEntity);
return;
}
@ -428,7 +437,7 @@ public class ThrCorpsDlService {
if (!basicThirdSysDetailEntity.getEnabled()) {
thrCorpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrCorpExportLogEntity.setRemark("第三方往来单位服务未启用");
thrCorpExportLogEntity.setRemark("第三方接口往来单位服务接口未启用");
thrCorpExportLogService.updateThrCorpExportLog(thrCorpExportLogEntity);
return;
}
@ -451,7 +460,7 @@ public class ThrCorpsDlService {
postThrCorpRequest.setGenKey(genKey);
postThrCorpRequest.setThirdSys(thrCorpExportRequest.getThirdSys());
postThrCorpRequest.setUploadType("接口上传");
String response = HttpClient.uCloudPost(spsSyncUrl + "/spssync/thirdsys/corp/upload", postThrCorpRequest);
String response = HttpClient.uCloudPost(getIpUrl() + "/spssync/thirdsys/corp/upload", postThrCorpRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {

@ -10,6 +10,7 @@ import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.basic.BasicUnitMaintainEntity;
import com.glxp.api.admin.entity.basic.BussinessTypeEntity;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.httpclient.ErpOrderClient;
import com.glxp.api.admin.req.inout.FilterOrderRequest;
@ -24,6 +25,7 @@ import com.glxp.api.admin.res.thrsys.ThrOrderExportJsonResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.basic.BasicUnitMaintainService;
import com.glxp.api.admin.service.basic.BussinessTypeService;
import com.glxp.api.admin.service.info.SyncDataSetService;
import com.glxp.api.admin.service.thrsys.*;
import com.glxp.api.admin.util.ExcelUtil;
import com.glxp.api.admin.util.HttpClient;
@ -42,8 +44,8 @@ import java.util.List;
@Service
public class ThrOrdersDlService {
@Value("${SPSYNC_IP}")
private String spsSyncUrl;
// @Value("${SPSYNC_IP}")
// private String spsSyncUrl;
@Resource
ThrOrderService thrOrderService;
@Resource
@ -67,6 +69,13 @@ public class ThrOrdersDlService {
@Resource
private ErpOrderClient erpOrderClient;
@Resource
SyncDataSetService syncDataSetService;
public String getIpUrl() {
SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet();
return syncDataSetEntity.getSyncIp();
}
@Async
public void importOrders(String genKey, String action, FilterThrOrderRequest filterThrProductsRequest) {
@ -194,7 +203,7 @@ public class ThrOrdersDlService {
}
if (!basicThirdSysDetailEntity.getEnabled() || basicThirdSysDetailEntity.getThirdSysFk() == null) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("第三方业务单据服务未启用");
thrOrderExportLogEntity.setRemark("第三方系统业务单据接口服务未启用");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}
@ -261,7 +270,7 @@ public class ThrOrdersDlService {
}
if (!basicThirdSysDetailEntity.getEnabled() || basicThirdSysDetailEntity.getThirdSysFk() == null) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("第三方业务单据服务未启用");
thrOrderExportLogEntity.setRemark("第三方系统业务单据接口服务未启用");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}
@ -354,7 +363,7 @@ public class ThrOrdersDlService {
}
if (!basicThirdSysDetailEntity.getEnabled() || basicThirdSysDetailEntity.getThirdSysFk() == null) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("第三方业务单据服务未启用");
thrOrderExportLogEntity.setRemark("第三方系统业务单据接口服务未启用");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}
@ -403,7 +412,7 @@ public class ThrOrdersDlService {
}
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
String response = HttpClient.uCloudPost(spsSyncUrl + "/spssync/thirdsys/order/upload", thrOrderExportJsonResponse);
String response = HttpClient.uCloudPost(getIpUrl() + "/spssync/thirdsys/order/upload", thrOrderExportJsonResponse);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
@ -444,7 +453,7 @@ public class ThrOrdersDlService {
}
if (!basicThirdSysDetailEntity.getEnabled()) {
thrOrderExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrOrderExportLogEntity.setRemark("第三方往来单位服务未启用");
thrOrderExportLogEntity.setRemark("第三方接口往来单位服务接口未启用");
thrOrderExportLogService.updateThrOrderExportLog(thrOrderExportLogEntity);
return;
}
@ -484,7 +493,7 @@ public class ThrOrdersDlService {
postThrOrderRequest.setThirdSys(thrOrderExportRequest.getThirdSysFk());
// SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("smp_service_ip");
// if (systemParamConfigEntity != null) {
String response = HttpClient.uCloudPost(spsSyncUrl + "/udiwms/thrsys/postOrderDetail", postThrOrderRequest);
String response = HttpClient.uCloudPost(getIpUrl() + "/udiwms/thrsys/postOrderDetail", postThrOrderRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {

@ -8,6 +8,7 @@ import com.glxp.api.admin.config.WebSocketServer;
import com.glxp.api.admin.constant.BasicProcessStatus;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.entity.basic.BasicThirdSysDetailEntity;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsExportLogEntity;
import com.glxp.api.admin.entity.thrsys.ThrProductsImportDetailEntity;
@ -21,6 +22,7 @@ import com.glxp.api.admin.req.thrsys.ThrProductsExportRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.ErpProductsResponse;
import com.glxp.api.admin.service.basic.BasicThirdSysDetailService;
import com.glxp.api.admin.service.info.SyncDataSetService;
import com.glxp.api.admin.service.thrsys.ThrProductsExportLogService;
import com.glxp.api.admin.service.thrsys.ThrProductsImportDetailService;
import com.glxp.api.admin.service.thrsys.ThrProductsImportLogService;
@ -41,8 +43,15 @@ import java.util.stream.Collectors;
@Service
public class ThrProductsDlService {
@Value("${SPSYNC_IP}")
private String spsSyncUrl;
// @Value("${SPSYNC_IP}")
// private String spsSyncUrl;
@Resource
SyncDataSetService syncDataSetService;
public String getIpUrl() {
SyncDataSetEntity syncDataSetEntity = syncDataSetService.findSet();
return syncDataSetEntity.getSyncIp();
}
@Resource
ThrProductsService thrProductsService;
@ -171,7 +180,7 @@ public class ThrProductsDlService {
if (!basicThirdSysDetailEntity.getEnabled()) {
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setRemark("第三方产品信息服务未启用!");
thrProductsExportLogEntity.setRemark("第三方系统产品信息接口服务未启用!");
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
return;
}
@ -235,7 +244,7 @@ public class ThrProductsDlService {
if (!basicThirdSysDetailEntity.getEnabled()) {
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setRemark("第三方产品信息服务未启用!");
thrProductsExportLogEntity.setRemark("第三方系统产品信息接口服务未启用!");
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
return;
}
@ -265,7 +274,7 @@ public class ThrProductsDlService {
}
String response = HttpClient.uCloudPost(spsSyncUrl + "/udiwms/thrsys/postThrProducts", postThrProductsRequest);
String response = HttpClient.uCloudPost(getIpUrl() + "/udiwms/thrsys/postThrProducts", postThrProductsRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
@ -314,7 +323,7 @@ public class ThrProductsDlService {
if (!basicThirdSysDetailEntity.getEnabled()) {
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setRemark("第三方产品信息服务未启用!");
thrProductsExportLogEntity.setRemark("第三方系统产品信息接口服务未启用!");
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
return;
}
@ -345,7 +354,7 @@ public class ThrProductsDlService {
}
String response = HttpClient.uCloudPost(spsSyncUrl + "/spssync/thirdsys/products/upload", postThrProductsRequest);
String response = HttpClient.uCloudPost(getIpUrl() + "/spssync/thirdsys/products/upload", postThrProductsRequest);
BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
});
if (baseResponse.getCode() == 20000) {
@ -547,7 +556,7 @@ public class ThrProductsDlService {
if (!basicThirdSysDetailEntity.getEnabled()) {
thrProductsExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
thrProductsExportLogEntity.setRemark("第三方产品信息服务未启用!");
thrProductsExportLogEntity.setRemark("第三方系统产品信息接口服务未启用!");
thrProductsExportLogService.updateThrProductsExportLog(thrProductsExportLogEntity);
return;
}

@ -4,16 +4,17 @@ import cn.hutool.core.collection.CollUtil;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.dao.basic.UdiInfoDao;
import com.glxp.api.admin.dao.info.SyncDataSetDao;
import com.glxp.api.admin.entity.auth.AuthAdmin;
import com.glxp.api.admin.entity.basic.*;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.entity.inout.ErpOrderEntity;
import com.glxp.api.admin.entity.inout.OrderEntity;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.entity.inout.*;
import com.glxp.api.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.req.auth.AuthAdminQueryRequest;
import com.glxp.api.admin.req.basic.*;
import com.glxp.api.admin.req.inout.OrderFilterRequest;
import com.glxp.api.admin.req.inout.OrderQueryRequest;
import com.glxp.api.admin.req.inventory.FilterInvUserRequest;
import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest;
import com.glxp.api.admin.req.receipt.BussinessTypeFilterRequest;
import com.glxp.api.admin.req.thrsys.*;
@ -21,12 +22,11 @@ import com.glxp.api.admin.res.basic.SpsSyncBusResponse;
import com.glxp.api.admin.res.basic.SpsSyncDataResponse;
import com.glxp.api.admin.res.basic.SpsSyncOrderResponse;
import com.glxp.api.admin.res.info.SyncDataSetResponse;
import com.glxp.api.admin.service.auth.AuthAdminService;
import com.glxp.api.admin.service.basic.*;
import com.glxp.api.admin.service.info.CompanyProductRelevanceService;
import com.glxp.api.admin.service.info.SyncDataSetService;
import com.glxp.api.admin.service.inout.CodesService;
import com.glxp.api.admin.service.inout.OrderDetailService;
import com.glxp.api.admin.service.inout.OrderService;
import com.glxp.api.admin.service.inout.*;
import com.glxp.api.admin.service.inventory.InvWarehouseService;
import com.glxp.api.admin.service.thrsys.*;
import org.springframework.beans.BeanUtils;
@ -62,10 +62,14 @@ public class UpBasicService {
@Resource
private CompanyProductRelevanceService companyProductRelevanceService;
@Resource
private BasicExportTimeService basicExportTimeService;
@Resource
SyncDataSetService syncDataSetService;
@Resource
AuthAdminService authAdminService;
@Resource
WarehouseBussinessTypeService warehouseBussinessTypeService;
@Resource
WarehouseUserService warehouseUserService;
public SpsSyncDataResponse upAllData(SpsSyncDataRequest spsSyncDataRequest) {
SpsSyncDataResponse syncDataResponse = new SpsSyncDataResponse();
@ -83,8 +87,24 @@ public class UpBasicService {
if (syncDataSetEntity.isBasicInv()) {
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterInvWarehouseRequest);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterInvWarehouse(filterInvWarehouseRequest);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterGroupInvWarehouse(filterInvWarehouseRequest);
syncDataResponse.setInvWarehouseEntities(invWarehouseEntities);
if (CollUtil.isNotEmpty(invWarehouseEntities)) {
//仓库关联单据类型
FilterInvBusTypeRequest filterInvBusTypeRequest = new FilterInvBusTypeRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterInvBusTypeRequest);
List<WarehouseBussinessTypeEntity> warehouseBussinessTypeEntities = warehouseBussinessTypeService.filterList(filterInvBusTypeRequest);
syncDataResponse.setWarehouseBussinessTypeEntities(warehouseBussinessTypeEntities);
//仓库关联用户
FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterInvBusTypeRequest);
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest);
syncDataResponse.setWarehouseUserEntities(warehouseUserEntities);
}
}
//耗材字典
@ -106,7 +126,6 @@ public class UpBasicService {
syncDataResponse.setUdiRelevanceEntities(udiRelevanceEntities);
//供应商产品信息关联表
FilterCompanyProductRelevanceRequest filterCompanyProductRelevanceRequest = new FilterCompanyProductRelevanceRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterCompanyProductRelevanceRequest);
@ -123,7 +142,7 @@ public class UpBasicService {
}
//第三方仓库信息
if (syncDataSetEntity.isBasicInv()) {
if (syncDataSetEntity.isBasicThirdInv()) {
FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterThrInvWarehouseRequest);
List<ThrInvWarehouseEntity> thrInvWarehouseEntities = thrInvWarehouseService.filterThrInvWarehouse(filterThrInvWarehouseRequest);
@ -166,6 +185,14 @@ public class UpBasicService {
}
//系统用户信息
if (syncDataSetEntity.isSysUser()) {
AuthAdminQueryRequest authAdminQueryRequest = new AuthAdminQueryRequest();
BeanUtils.copyProperties(spsSyncDataRequest, authAdminQueryRequest);
List<AuthAdmin> authAdminList = authAdminService.listAdminPage(authAdminQueryRequest);
syncDataResponse.setAuthAdminList(authAdminList);
}
return syncDataResponse;
}
@ -176,6 +203,8 @@ public class UpBasicService {
BussinessLocalTypeService bussinessLocalTypeService;
@Resource
BussinessOriginTypeService bussinessOriginTypeService;
@Resource
private BussinessChangeTypeService bussinessChangeTypeService;
public SpsSyncBusResponse upAllBus(SpsSyncDataRequest spsSyncDataRequest) {
SpsSyncBusResponse spsSyncBusResponse = new SpsSyncBusResponse();
@ -188,7 +217,7 @@ public class UpBasicService {
// }
//业务单据类型
if (syncDataSetEntity.isTypeBus()) {
if (syncDataSetEntity.isTypeScan()) {
BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, bussinessTypeFilterRequest);
List<BussinessTypeEntity> bussinessTypeEntities = bussinessTypeService.filterAllList(bussinessTypeFilterRequest);
@ -196,18 +225,23 @@ public class UpBasicService {
}
//扫码单据类型
if (syncDataSetEntity.isTypeScan()) {
if (syncDataSetEntity.isTypeBus()) {
BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest();
BeanUtils.copyProperties(spsSyncDataRequest, bussinessLocalTypeFilterRequest);
List<BussinessLocalTypeEntity> bussinessLocalTypeEntities = bussinessLocalTypeService.filterAllList(bussinessLocalTypeFilterRequest);
List<SpsBusLoclTypeResponse> spsBusLoclTypeResponses = new ArrayList<>();
List<BussinessChangeTypeEntity> allBussinessChanges = new ArrayList<>();
bussinessLocalTypeEntities.forEach(bussinessLocalTypeEntity ->
{
SpsBusLoclTypeResponse spsBusLoclTypeResponse = new SpsBusLoclTypeResponse();
BeanUtils.copyProperties(bussinessLocalTypeEntity, spsBusLoclTypeResponse);
spsBusLoclTypeResponses.add(spsBusLoclTypeResponse);
List<BussinessChangeTypeEntity> bussinessChangeTypeEntities = bussinessChangeTypeService.findByAction(bussinessLocalTypeEntity.getAction());
allBussinessChanges.addAll(bussinessChangeTypeEntities);
});
spsSyncBusResponse.setBussinessLocalTypeEntities(spsBusLoclTypeResponses);
spsSyncBusResponse.setBussinessChangeTypeEntities(allBussinessChanges);
}
//第三方单据类型

@ -1,9 +1,16 @@
package com.glxp.api.admin.util;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.admin.entity.basic.UdiInfoEntity;
import com.glxp.api.admin.entity.basic.UdiEntity;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.util.gs1.AI;
import com.glxp.api.admin.util.gs1.AIs;
import com.glxp.api.admin.util.gs1.Gs1128Decoder;
import com.glxp.api.admin.util.gs1.Gs1128Engine;
import java.util.Map;
/**
* @author
@ -25,7 +32,7 @@ public class FilterUdiUtils {
return null;
}
public static UdiEntity getGS1Udi(String data) {
public static UdiEntity getGS1UdiOld(String data) {
String batchNo = "";
String produceDate = "";
String expireDate = "";
@ -164,6 +171,31 @@ public class FilterUdiUtils {
return udiEntity;
}
public static UdiEntity getGS1Udi(String data) {
Gs1128Engine engine = new Gs1128Engine();
Gs1128Decoder decoder = engine.decoder();
Map<AI, String> result = decoder.decode("]C1" + data);
UdiEntity udiEntity = new UdiEntity();
for (Map.Entry<AI, String> entry : result.entrySet()) {
if (entry.getKey() == AIs.GTIN) {
udiEntity.setUdi(entry.getValue());
} else if (entry.getKey() == AIs.BATCH_LOT) {
udiEntity.setBatchNo(entry.getValue());
} else if (entry.getKey() == AIs.EXPIRY) {
udiEntity.setExpireDate(entry.getValue());
} else if (entry.getKey() == AIs.PROD_DATE) {
udiEntity.setProduceDate(entry.getValue());
} else if (entry.getKey() == AIs.SERIAL) {
udiEntity.setSerialNo(entry.getValue());
}
}
if (StrUtil.isEmpty(udiEntity.getUdi())) {
return null;
} else
return udiEntity;
}
public static UdiEntity getZGCUdi(String data) {
String batchNo = "";
String produceDate = "";

@ -0,0 +1,14 @@
package com.glxp.api.admin.util.gs1;
/**
* @author guilherme.pacheco
*/
public interface AI {
String getCode();
String getDescription();
String getFormat();
}

@ -0,0 +1,112 @@
package com.glxp.api.admin.util.gs1;
/**
* @author guilherme.pacheco
*/
public enum AIs implements AI {
SSCC("00", "Serial Shipping Container Code", "n2+n18"),
GTIN("01", "GTIN-14", "n2+n14"),
CONTENT("02", "Number of containers", "n2+n14"),
BATCH_LOT("10", "Batch Number", "n2+an..20"),
PROD_DATE("11", "Production Date", "n2+n6"),
DUE_DATE("12", "Production Date", "n2+n6"),
PACK_DATE("13", "Packaging Date", "n2+n6"),
BEST_BEFORE("15", "Sell by Date (Quality Control) ", "n2+n6"),
EXPIRY("17", "Expiration Date", "n2+n6"),
VARIANT("20", "Product Variant", "n2+n2"),
SERIAL("21", "Serial Number", "n2+an..20"),
INTERNAL("91", "Company Internal Information", "n2+an..30"),
ADDITIONAL_ID("240", "Additional Product Identification", "n3+an..30"),
CUSTOMER_PART("241", "Customer Part Number", "n3+an..30"),
VARIATION_NUMBER("242", "242 Made-to-Order variation no", "n2+n..30"),
SECONDARY_SERIAL("250", "Secondary Serial Number", "n3+an..30"),
REF_TO_SOURCE("251", "Reference to source entity", "n3+an..30"),
DOC_ID("253", "Global Document Type Identifier", "n3+n13+n..17"),
GLN_EXTENSION("254", "GLN extension component ", "n3+an..20"),
VAR_COUNT("30", "Quantity Each", "n2+n..8"),
NET_WEIGHT("310n", "Product Net Weight in kg", "n4+n6"),
LENGTH("311n", "Product Length/1st Dimension, in meters", "n4+n6"),
WIDTH("312n", "Product Width/Diameter/2nd Dimension, in meters", "n4+n6"),
HEIGHT("313n", "Product Depth/Thickness/3rd Dimension, in meters", "n4+n6"),
AREA("314n", "Product Area, in square meters", "n4+n6"),
NET_VOLUME_LITERS("315n", " Product Volume, in liters", "n4+n6"),
NET_VOLUME_CUBICS("316n", " product Volume, in cubic meters", "n4+n6"),
NET_WEIGHT_POUNDS("320n", "Product Net Weight, in pounds", "n4+n6"),
LENGTH_INCHES("321n", "Product Length/1st Dimension, in inches", "n4+n6"),
LENGTH_PES("322n", "Product Length/1st Dimension, in feet", "n4+n6"),
LENGTH_YARDS("323n", "Product Length/1st Dimension, in yards", "n4+n6"),
WIDTH_INCHES("324n", "Product Width/Diameter/2nd Dimension, in inches", "n4+n6"),
WIDTH_FEET("325n", "Product Width/Diameter/2nd Dimension, in feet", "n4+n6"),
WIDTH_YARDS("326n", "Product Width/Diameter/2nd Dimension, in yards", "n4+n6"),
HEIGHT_INCHES("327n", "Product Depth/Thickness/3rd Dimension, in inches", "n4+n6"),
HEIGHT_FEET("328n", "Product Depth/Thickness/3rd Dimension, in feet", "n4+n6"),
HEIGHT_YARDS("329n", "Product Depth/Thickness/3rd Dimension, in yards", "n4+n6"),
PRODUCT_AREA_INCHES("350n", "Product Area (Square Inches)", "n4+n6"),
PRODUCT_AREA_FEET("351n", "Product Area (Square Feet)", "n4+n6"),
PRODUCT_AREA_YARDS("352n", "Product Area (Square Yards)", "n4+n6"),
CONTAINER_AREA_INCHES("353n", "Container Area (Square Inches) ", "n4+n6"),
CONTAINER_AREA_FEET("354n", "Container Area (Square Feet) ", "n4+n6"),
CONTAINER_AREA_YARDS("355n", "Container Area (Square Yards) ", "n4+n6"),
NET_WEIGHT_OUNCES("356n", "Net Weight (Troy Ounces)", "n4+n6"),
PRODUCT_VOLUME_QUARTS("360n", " Product Volume (Quarts)", "n4+n6"),
PRODUCT_VOLUME_GALLONS("361n", " Product Volume (Gallons)", "n4+n6"),
CONTAINER_VOLUME_QUARTS("362n", " Container Gross Volume (Quarts)", "n4+n6"),
CONTAINER_VOLUME_GALLONS("363n", " Container Gross Volume (Gallons)", "n4+n6"),
PRODUCT_VOLUME_INCHES("364n", " Product Volume (Cubic Inches)", "n4+n6"),
PRODUCT_VOLUME_FEET("365n", " Product Volume (Cubic Feet)", "n4+n6"),
PRODUCT_VOLUME_YARDS("366n", " Product Volume (Cubic Yards)", "n4+n6"),
CONTAINER_VOLUME_INCHES("367n", " Container Gross Volume (Cubic Inches)", "n4+n6"),
CONTAINER_VOLUME_FEET("368n", " Container Gross Volume (Cubic Feet)", "n4+n6"),
CONTAINER_VOLUME_YARDS("369n", " Container Gross Volume (Cubic Yards)", "n4+n6"),
COUNT("37", " Number of Units Contained", "n2+n..8"),
ORDER_NUMBER("400", "Customer Purchase Order Number", "n3+an..30"),
SHIP_TO_DELIVER_TO_LOCATION_CODE("410", "Ship To/Deliver To Location Code (EAN13 or DUNS code)", "n3+n13"),
BILL_TO_INVOICEE_TO_LOCATION_CODE("411", "Bill To/Invoice Location Code (EAN13 or DUNS code)", "n3+n13"),
PURCHASE_FROM_LOCATION_CODE("412", "Purchase From Location Code (EAN13 or DUNS code)", "n3+n13"),
SHIP_TO_DELIVER_TO_POSTALCODE("420", "Ship To/Deliver To Postal Code (Single Postal Authority)", "n3+an..9"),
SHIP_TO_DELIVER_TO_MULTI_POSTALCODE("421", "Ship To/Deliver To Postal Code (Multiple Postal Authority)",
"n3+n3+an..9"),
ORIGIN("422", "Country orign", "n3+n3"),
COUNTRY_INITIAL_PROCESS("423", "County initial processing", "n3+n3+n..12"),
COUNTRY_PROCESS("424", "County processing", "n3+n3"),
COUNTRY_DISASSEMBLY("425", "Country disassembly", "n3+n3"),
COUNTRY_FULL_PROCESS("426", "Country pull processing", "n3+n3"),
ROLL_PRODUCTS("8001", "Roll Products Width/Length/Core Diameter", "n4+n14"),
ESN("8002", "Electronic Serial Number (ESN) for Cellular Phone", "n4+an..20"),
UPC_EAN_RETURNABLE_ASSET("8003", "UPC/EAN Number and Serial Number of Returnable Asset", "n4+an..30"),
UPC_EAN_SERIAL_IDENTIFICATION("8004", "UPC/EAN Serial Identification", "n4+an..30"),
PRICE_UNIT_MEASURE("8005", "Price per Unit of Measure", "n4+n6"),
;
private final String code;
private final String description;
private final String format;
private AIs(String code, String description, String format) {
this.code = code;
this.description = description;
this.format = format;
}
@Override
public String getCode() {
return code;
}
@Override
public String getDescription() {
return description;
}
@Override
public String getFormat() {
return format;
}
@Override
public String toString() {
return description;
}
}

@ -0,0 +1,32 @@
package com.glxp.api.admin.util.gs1;
/**
* @author guilherme.pacheco
*/
public final class AiFactory {
private AiFactory() {
super();
}
public static AI create(String code, String description, String format) {
return new AI() {
@Override
public String getFormat() {
return format;
}
@Override
public String getDescription() {
return description;
}
@Override
public String getCode() {
return code;
}
};
}
}

@ -0,0 +1,71 @@
package com.glxp.api.admin.util.gs1;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author guilherme.pacheco
*/
final class Format {
private static final String JOIN_SYMBOL = "+";
private final List<Session> sessions;
public Format(List<Session> sessions) {
this.sessions = Validate.notEmpty(sessions);
}
public Format(Session... sessions) {
this(Arrays.asList(sessions));
}
public Session getIdentifier() {
return sessions.get(0);
}
public List<Session> getDataSessions() {
return sessions.subList(1, sessions.size());
}
@Override
public String toString() {
return sessions.stream().map(String::valueOf).collect(Collectors.joining(JOIN_SYMBOL));
}
public boolean isValid(String value) {
if (StringUtils.isBlank(value)) {
return false;
}
if (!validLength(value)) {
return false;
}
return validate(value);
}
private boolean validate(String value) {
return getDataSessions().stream().allMatch(s -> s.getType().isValid(Gs1128Utils.value(s, value)));
}
private boolean validLength(String value) {
return isVaried() ? value.length() <= getLength() : value.length() == getLength();
}
public int getLength() {
return getDataSessions().stream().mapToInt(Session::getLength).sum();
}
public boolean isVaried() {
return getDataSessions().stream().anyMatch(Session::isVaried);
}
public static Format valueOf(String value) {
String[] split = StringUtils.split(value, JOIN_SYMBOL);
List<Session> list = Arrays.stream(split).map(Session::valueOf).collect(Collectors.toList());
return new Format(list);
}
}

@ -0,0 +1,57 @@
package com.glxp.api.admin.util.gs1;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import java.util.*;
import java.util.function.Function;
/**
* @author guilherme.pacheco
*/
public final class Gs1128Decoder {
private final Collection<AI> ais;
Gs1128Decoder(Collection<AI> ais) {
this.ais = ais;
}
public Map<AI, String> decode(final String barcode) {
validateBarcode(barcode);
String barcodeValue = StringUtils.remove(barcode, Gs1128Utils.PREFIX);
return extract(barcodeValue);
}
private Map<AI, String> extract(String barcode) {
final Iterator<Character> iterator = Gs1128Utils.iterator(barcode);
final Map<AI, String> result = new WeakHashMap<>(4);
StringBuilder builder = new StringBuilder();
while (iterator.hasNext()) {
builder.append(iterator.next());
Optional<Map<AI, String>> mapAi = mapAi(iterator, builder.toString());
if (mapAi.isPresent()) {
result.putAll(mapAi.get());
builder = new StringBuilder();
}
}
return result;
}
private Optional<Map<AI, String>> mapAi(Iterator<Character> iterator, String builder) {
return ais.stream().filter(v -> v.getCode().equals(builder)).findFirst().map(aiValue(iterator));
}
private Function<AI, Map<AI, String>> aiValue(Iterator<Character> iterator) {
return ai -> {
String value = Gs1128Utils.value(ai, iterator);
return Map.of(ai, value);
};
}
private void validateBarcode(String barcode) {
Validate.notBlank(barcode, "Barcode cannot be blank");
Validate.isTrue(StringUtils.startsWith(barcode, Gs1128Utils.PREFIX), "Barcode must start with prefix Gs1-128 \"]C1\"");
}
}

@ -0,0 +1,33 @@
package com.glxp.api.admin.util.gs1;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import java.util.Collection;
import java.util.stream.Collectors;
/**
* @author guilherme.pacheco
*/
public final class Gs1128Encoder {
Gs1128Encoder() {
super();
}
public String encode(Collection<Segment> segments) {
Validate.notEmpty(segments);
String barcode = joinSegments(segments);
return checkBarcode(barcode);
}
private String checkBarcode(String barcode) {
return StringUtils.removeEnd(barcode, String.valueOf(Gs1128Utils.END_AI_VARIED));
}
private String joinSegments(Collection<Segment> segments) {
String joinValue = segments.stream().map(Segment::encode).collect(Collectors.joining());
return Gs1128Utils.PREFIX.concat(joinValue);
}
}

@ -0,0 +1,35 @@
package com.glxp.api.admin.util.gs1;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.Set;
/**
* @author guilherme.pacheco
*/
public final class Gs1128Engine {
private final Set<AI> aisRegistred = new HashSet<>();
public Gs1128Engine() {
aisRegistred.addAll(EnumSet.allOf(AIs.class));
}
public void registerAi(AI ai) {
aisRegistred.add(ai);
}
public Set<AI> getAisRegistred() {
return Collections.unmodifiableSet(aisRegistred);
}
public Gs1128Encoder encoder() {
return new Gs1128Encoder();
}
public Gs1128Decoder decoder() {
return new Gs1128Decoder(aisRegistred);
}
}

@ -0,0 +1,59 @@
package com.glxp.api.admin.util.gs1;
import java.util.Iterator;
/**
* @author guilherme.pacheco
*/
final class Gs1128Utils {
public static final String PREFIX = "]C1";
public static final char END_AI_VARIED = (char) 29;
private Gs1128Utils() {
super();
}
public static Iterator<Character> iterator(String value) {
return value.chars().mapToObj(c -> (char) c).iterator();
}
public static String value(AI ai, Iterator<Character> iterator) {
Format format = Format.valueOf(ai.getFormat());
if (format.isVaried()) {
return variedValue(iterator);
} else {
return fixedValue(format.getLength(), iterator);
}
}
public static String value(Session session, String value) {
Iterator<Character> iterator = iterator(value);
if (session.isVaried()) {
return variedValue(iterator);
} else {
return fixedValue(session.getLength(), iterator);
}
}
private static String fixedValue(int size, Iterator<Character> iterator) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < size; i++) {
builder.append(iterator.next());
}
return builder.toString();
}
private static String variedValue(Iterator<Character> iterator) {
StringBuilder builder = new StringBuilder();
while (iterator.hasNext()) {
char value = iterator.next();
if (value == END_AI_VARIED) {
break;
}
builder.append(value);
}
return builder.toString();
}
}

@ -0,0 +1,35 @@
package com.glxp.api.admin.util.gs1;
import org.apache.commons.lang3.Validate;
/**
* @author guilherme.pacheco
*/
public final class Segment {
private final AI ai;
private final String value;
private final Format format;
public Segment(AI ai, String value) {
this.ai = Validate.notNull(ai, "Invalid AI");
format = Format.valueOf(ai.getFormat());
this.value = validateValue(format, value);
}
private String validateValue(Format format, String value) {
Validate.notBlank(value, "Invalid segment value");
Validate.notNull(format, "Invalid format");
Validate.isTrue(format.isValid(value));
return value;
}
String encode() {
String codeValue = ai.getCode().concat(value);
if (format.isVaried()) {
return codeValue + Gs1128Utils.END_AI_VARIED;
}
return codeValue;
}
}

@ -0,0 +1,69 @@
package com.glxp.api.admin.util.gs1;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
/**
* @author guilherme.pacheco
*/
final class Session {
private static final String VARIED_CONSTANT = "..";
private final SessionType type;
private final boolean varied;
private final int length;
public Session(SessionType type, int length, boolean varied) {
this.type = Validate.notNull(type);
Validate.isTrue(length > 0, "Session invalid lenght");
this.length = length;
this.varied = varied;
}
public SessionType getType() {
return type;
}
public int getLength() {
return length;
}
public boolean isVaried() {
return varied;
}
public static Session valueOf(String value) {
Validate.notBlank(value, "Session cannot be blank");
SessionType type = sessionType(value);
String strLength = value.substring(type.length());
boolean varied = strLength.startsWith(VARIED_CONSTANT);
int length = createLength(strLength, varied);
return new Session(type, length, varied);
}
private static SessionType sessionType(String value) {
return SessionType.valueByPrefix(value).orElseThrow(() -> new IllegalArgumentException("Invalid session type"));
}
private static Integer createLength(String strLength, boolean varied) {
try {
if (varied) {
String lengthValue = StringUtils.substringAfter(strLength, VARIED_CONSTANT);
return Integer.parseInt(lengthValue);
}
return Integer.valueOf(strLength);
} catch (NumberFormatException ex) {
throw new IllegalArgumentException(String.format("Invalid length: '%s'", strLength), ex);
}
}
@Override
public String toString() {
return new StringBuilder(type.getSymbol())
.append(varied ? VARIED_CONSTANT : StringUtils.EMPTY)
.append(length)
.toString();
}
}

@ -0,0 +1,50 @@
package com.glxp.api.admin.util.gs1;
import org.apache.commons.lang3.StringUtils;
import java.util.EnumSet;
import java.util.Optional;
import java.util.function.Predicate;
/**
* @author guilherme.pacheco
*/
enum SessionType {
ALPHANUMERIC("an", v -> Character.isAlphabetic(v) || Character.isDigit(v)),
ALPHABETIC("a", v -> Character.isAlphabetic(v)),
NUMERIC("n", v -> Character.isDigit(v));
private final String symbol;
private final Predicate<Character> validator;
private SessionType(String symbol, Predicate<Character> validator) {
this.symbol = symbol;
this.validator = validator;
}
public boolean isValid(String value) {
if (StringUtils.isBlank(value)) {
return false;
}
return value.chars().mapToObj(c -> (char) c).allMatch(validator::test);
}
public String getSymbol() {
return symbol;
}
public int length() {
return symbol.length();
}
public static Optional<SessionType> valueByPrefix(String value) {
if (StringUtils.isBlank(value)) {
return Optional.empty();
}
return EnumSet.allOf(SessionType.class).stream()
.filter(v -> StringUtils.startsWithIgnoreCase(value, v.symbol))
.findFirst();
}
}

@ -20,7 +20,7 @@ logging.path=output/logs
# 不指定的情况下默认生成在项目根目录,按照配置生成所需的日志名称
#logging.file=D:/udi.log
file_path=D:/1s/udiwms/udiwmsfile/
file_path=D:/udi/udiwms/udiwmsfile/
#file_path=/home/glxp/udiwms
#UDI数据下载
UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df

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

@ -20,6 +20,9 @@
<if test="userName != null and '' != userName">
AND userName LIKE CONCAT(#{userName},'%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(lastModifyTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
ORDER BY id
DESC

@ -77,7 +77,7 @@
parameterType="com.glxp.api.admin.entity.basic.BussinessOriginTypeEntity">
replace
INTO basic_bustype_origin
(`action`, `name`, enable, remark, thirdSys, thirdSysName,inoutType)
(`action`, `name`, enable, remark, thirdSys, thirdSysName,inoutType,updateTime)
values (
#{action},
#{name},
@ -85,7 +85,7 @@
#{remark},
#{thirdSys},
#{thirdSysName},
#{inoutType}
#{inoutType},#{updateTime}
)
</insert>
@ -99,7 +99,7 @@
<if test="thirdSysName != null">thirdSysName = #{thirdSysName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="inoutType != null">inoutType = #{inoutType},</if>
<if test="updateTime != null">updateTime = #{updateTime},</if>
</trim>
WHERE id = #{id}
</update>

@ -14,7 +14,7 @@
basic_bussiness_type.secCheckUdims, basic_bussiness_type.secCheckPdaEd, basic_bussiness_type.secCheckPdaUn,
basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange,
basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,basic_bussiness_type.outTospms,
basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,
basic_bussiness_type.secCheckBalacne, defaultUnit,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys,basic_bussiness_type.useDyCount,basic_bussiness_type.expireTip,
@ -129,12 +129,13 @@
basic_bussiness_type.checkUdims,basic_bussiness_type.checkPdaEd,basic_bussiness_type.checkPdaUn,basic_bussiness_type.checkPc,
basic_bussiness_type.checkWebNew,basic_bussiness_type.checkChange,
basic_bussiness_type.secCheckUdims, basic_bussiness_type.secCheckPdaEd, basic_bussiness_type.secCheckPdaUn,
basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange,
basic_bussiness_type.secCheckWebNew, basic_bussiness_type.secCheckChange,basic_bussiness_type.outTospms,
basic_bustype_local.name localName,basic_bussiness_type.checkEnable, basic_bustype_local.advanceType,
basic_bustype_local.changeEnable,basic_bussiness_type.genUnit,basic_bussiness_type.innerOrder,
basic_bustype_local.spUse,corpType,basic_bussiness_type.storageCode,basic_bussiness_type.checkBalacne,defaultUnit,
basic_bussiness_type.secCheckBalacne,basic_bustype_origin.action
thirdAction,basic_bustype_origin.thirdSys,useDyCount,basic_bussiness_type.expireTip,basic_bussiness_type.prefix,basic_bustype_local.prefix localPrefix
thirdAction,basic_bustype_origin.thirdSys,useDyCount,basic_bussiness_type.expireTip,basic_bussiness_type.prefix,basic_bustype_local.prefix
localPrefix
,basic_bustype_local.preIn
FROM basic_bussiness_type LEFT JOIN basic_bustype_local
on basic_bussiness_type.localAction = basic_bustype_local.action
@ -180,7 +181,7 @@
checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,
secCheckChange,corpType,basic_bussiness_type.storageCode,checkBalacne,
secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix)
secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms)
values
(
#{action},
@ -214,7 +215,9 @@
#{defaultUnit},
#{useDyCount},
#{expireTip},
#{updateTime},#{prefix}
#{updateTime},
#{prefix},
#{outTospms}
)
</insert>
@ -227,7 +230,7 @@
checkEnable,genUnit,innerOrder,secCheckEnable,
checkUdims,checkPdaEd,checkPdaUn,checkPc,checkWebNew,checkChange
,secCheckUdims,secCheckPdaEd,secCheckPdaUn,secCheckPc,secCheckWebNew,
secCheckChange,corpType,storageCode,checkBalacne,secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix)
secCheckChange,corpType,storageCode,checkBalacne,secCheckBalacne,supplementOrderType,defaultUnit,useDyCount,expireTip,updateTime,prefix,outTospms)
values
(
#{index},
@ -262,7 +265,9 @@
#{defaultUnit},
#{useDyCount},
#{expireTip},
#{updateTime},#{prefix}
#{updateTime},
#{prefix},
#{outTospms}
)
</insert>
@ -303,7 +308,7 @@
<if test="expireTip != null">expireTip=#{expireTip},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="prefix != null">prefix=#{prefix},</if>
<if test="outTospms != null">outTospms=#{outTospms},</if>
thirdSysFk=#{thirdSysFk},
</trim>
WHERE id = #{id}

@ -22,6 +22,9 @@
<if test="originUuid != '' and originUuid != null">
AND originUuid = #{originUuid}
</if>
<if test="sptm != '' and sptm != null">
AND sptm = #{sptm}
</if>
</where>
</select>

@ -16,7 +16,7 @@
INTO sync_data_set(id,typeBus, typeScan,
typeThird, basicProducts, basicCorp, basicInv, basicThirdProducts, basicThirdCorp, basicThirdInv
, basicThirdBusOrder, orderScanFinish, dbDiProducts,downstreamEnable,syncTime, syncDownloadTime,
orderUnReceive,orderUnCheck,busTypes,syncIp)
orderUnReceive,orderUnCheck,busTypes,syncIp,sysUser)
values (
#{id},
#{typeBus},
@ -31,7 +31,7 @@
#{basicThirdBusOrder},
#{orderScanFinish},
#{dbDiProducts},#{downstreamEnable},#{syncTime},#{syncDownloadTime},
#{orderUnReceive},#{orderUnCheck},#{busTypes},#{syncIp}
#{orderUnReceive},#{orderUnCheck},#{busTypes},#{syncIp},#{sysUser}
)
</insert>

@ -33,7 +33,7 @@
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo, preCheck, thirdBillNo)
outChangeEnable, originUllageSupNo, preCheck, thirdBillNo,updateTime)
values (#{id},
#{action},
#{corpOrderId},
@ -53,7 +53,7 @@
#{stockCheckFk},
#{supId}, #{exportFilePath}, #{locStorageCode}, #{supplementNo}
, #{ullageSupNo}, #{createUser}, #{reviewUser}, #{outChangeEnable}, #{originUllageSupNo},
#{preCheck}, #{thirdBillNo})
#{preCheck}, #{thirdBillNo},#{updateTime})
</insert>
<insert id="importOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.inout.OrderEntity">
@ -63,7 +63,7 @@
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo,preCheck,thirdBillNo)
outChangeEnable, originUllageSupNo,preCheck,thirdBillNo,updateTime)
values (
#{id},
#{action},
@ -92,7 +92,7 @@
#{outChangeEnable},
#{originUllageSupNo},
#{preCheck},
#{thirdBillNo}
#{thirdBillNo},#{updateTime}
)
</insert>

@ -245,7 +245,7 @@
<select id="filterList" parameterType="com.glxp.api.admin.req.basic.FilterInvBusTypeRequest"
resultType="com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity">
SELECT * FROM inv_warehouse_user
SELECT * FROM inv_warehouse_bussiness_type
<where>
<if test="id != '' and id != null">
AND id = #{id}

@ -127,7 +127,7 @@
<select id="filterGroupInvWarehouse" parameterType="com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest"
resultType="com.glxp.api.admin.res.inventory.InvProductResponse">
resultType="com.glxp.api.admin.entity.inventory.InvWarehouseEntity">
SELECT * FROM inv_warehouse
<where>
<if test="id != '' and id != null">

@ -95,7 +95,7 @@
</insert>
<insert id="insertThrInvWarehouses" parameterType="java.util.List">
insert INTO thr_inv_warehouse
replace INTO thr_inv_warehouse
(pid, code, name, advanceType, isDefault,
status, updateTime, remark, thirdSysFk)
VALUES
@ -170,7 +170,7 @@
</where>
</select>
<insert id="insertInvWarehouses">
replace into thr_inv_warehouse (pid, code, name, advanceType, isDefault, status, updateTime, remark, level,
replace into thr_inv_warehouse (pid, code, `name`, advanceType, isDefault, status, updateTime, remark, `level`,
pcode,
thirdSysFk)
values

Loading…
Cancel
Save