中继服务同步修改,分库功能修改

fengcang
anthonyywj2 3 years ago
parent 001fe3190d
commit 727e9481c6

@ -210,7 +210,7 @@ public class InvWarehouseController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (invWarehouseEntity.getPid() == null) {//仓库
if (invWarehouseEntity.getPid() == null || invWarehouseEntity.getPid() == 0) {//仓库
invWarehouseEntity.setPid(0); // 默认设置
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
filterInvWarehouseRequest.setPid(invWarehouseEntity.getPid());

@ -25,4 +25,5 @@ public interface InvSubWarehouseDao {
boolean deleteById(String id);
boolean deleteByParentCode(@Param("code") String code);
}

@ -25,5 +25,5 @@ public interface InvSubWarehouseService {
boolean deleteById(String id);
boolean deleteByParentCode(String code);
}

@ -84,4 +84,9 @@ public class InvSubWarehouseServiceImpl implements InvSubWarehouseService {
public boolean deleteById(String id) {
return invSubWarehouseDao.deleteById(id);
}
@Override
public boolean deleteByParentCode(String code) {
return invSubWarehouseDao.deleteByParentCode(code);
}
}

@ -21,6 +21,7 @@ import com.glxp.api.admin.entity.inout.OrderEntity;
import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity;
import com.glxp.api.admin.entity.inout.WarehouseEntity;
import com.glxp.api.admin.entity.inout.WarehouseUserEntity;
import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity;
import com.glxp.api.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.httpclient.SpGetHttpClient;
@ -34,6 +35,7 @@ import com.glxp.api.admin.service.basic.BussinessChangeTypeService;
import com.glxp.api.admin.service.basic.EntrustReceService;
import com.glxp.api.admin.service.info.SystemParamConfigService;
import com.glxp.api.admin.service.inout.OrderService;
import com.glxp.api.admin.service.inventory.InvSubWarehouseService;
import com.glxp.api.admin.service.inventory.InvWarehouseService;
import com.glxp.api.admin.service.thrsys.ThrInvWarehouseService;
import com.glxp.api.admin.util.CustomUtil;
@ -73,6 +75,9 @@ public class DlBasicService {
AuthAdminDao authAdminService;
@Resource
WarehouseUserDao warehouseUserDao;
@Resource
InvSubWarehouseService invSubWarehouseService;
@Resource
WarehouseBussinessTypeDao warehouseBussinessTypeDao;
@Resource
@ -122,15 +127,45 @@ public class DlBasicService {
for (InvWarehouseEntity invWarehouseEntity : syncDataResponse.getInvWarehouseEntities()) {
invWarehouseEntity.setUpdateTime(null);
warehouseUserDao.deleteByCode(invWarehouseEntity.getCode());
warehouseBussinessTypeDao.deleteByCode(invWarehouseEntity.getCode());
List<InvSubWarehouseEntity> invSubWarehouseEntities = invSubWarehouseService.findByParentId(invWarehouseEntity.getCode());
if (CollUtil.isNotEmpty(invSubWarehouseEntities)) {
for (InvSubWarehouseEntity invSubWarehouseEntity : invSubWarehouseEntities) {
warehouseUserDao.deleteByCode(invSubWarehouseEntity.getCode());
warehouseBussinessTypeDao.deleteByCode(invSubWarehouseEntity.getCode());
}
}
invSubWarehouseService.deleteByParentCode(invWarehouseEntity.getCode());
}
invWarehouseService.importInvWarehouse(syncDataResponse.getInvWarehouseEntities());
remark.append("仓库字典:").append(syncDataResponse.getInvWarehouseEntities().size()).append("条\n");
}
//分库
if (CollUtil.isNotEmpty(syncDataResponse.getInvSubWarehouseEntities())) {
for (InvSubWarehouseEntity invSubWarehouseEntity : syncDataResponse.getInvSubWarehouseEntities()) {
invSubWarehouseService.insertInvSubWarehouse(invSubWarehouseEntity);
}
remark.append("仓库用户:").append(syncDataResponse.getWarehouseUserEntities().size()).append("条\n");
}
//仓库用户表
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseUserEntities())) {
for (WarehouseUserEntity warehouseUserEntity : syncDataResponse.getWarehouseUserEntities()) {
warehouseUserDao.insertOrUpdate(warehouseUserEntity);
}
remark.append("仓库用户:").append(syncDataResponse.getWarehouseUserEntities().size()).append("条\n");
}
//仓库单据类型表
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseBussinessTypeEntities())) {
for (WarehouseBussinessTypeEntity warehouseUserEntity : syncDataResponse.getWarehouseBussinessTypeEntities()) {
warehouseBussinessTypeDao.insertOrUpdate(warehouseUserEntity);
}
remark.append("仓库单据:").append(syncDataResponse.getWarehouseBussinessTypeEntities().size()).append("条\n");
}
//关联表导入
if (CollUtil.isNotEmpty(syncDataResponse.getUdiRelevanceEntities())) {
try {
@ -262,22 +297,6 @@ public class DlBasicService {
}
//仓库用户表
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseUserEntities())) {
for (WarehouseUserEntity warehouseUserEntity : syncDataResponse.getWarehouseUserEntities()) {
warehouseUserDao.insertOrUpdate(warehouseUserEntity);
}
remark.append("仓库用户:").append(syncDataResponse.getWarehouseUserEntities().size()).append("条\n");
}
//仓库单据类型表
if (CollUtil.isNotEmpty(syncDataResponse.getWarehouseBussinessTypeEntities())) {
for (WarehouseBussinessTypeEntity warehouseUserEntity : syncDataResponse.getWarehouseBussinessTypeEntities()) {
warehouseBussinessTypeDao.insertOrUpdate(warehouseUserEntity);
}
remark.append("仓库单据:").append(syncDataResponse.getWarehouseBussinessTypeEntities().size()).append("条\n");
}
//用户表
if (CollUtil.isNotEmpty(syncDataResponse.getAuthAdminList())) {
for (AuthAdmin authAdmin : syncDataResponse.getAuthAdminList()) {

@ -181,7 +181,8 @@ public class HeartService {
&& CollUtil.isEmpty(syncDataResponse.getUdiRelevanceEntities())
&& CollUtil.isEmpty(syncDataResponse.getAuthAdminList())
&& CollUtil.isEmpty(syncDataResponse.getWarehouseBussinessTypeEntities())
&& CollUtil.isEmpty(syncDataResponse.getWarehouseUserEntities())) {
&& CollUtil.isEmpty(syncDataResponse.getWarehouseUserEntities())
&& CollUtil.isEmpty(syncDataResponse.getInvSubWarehouseEntities())) {
//数据不记录日志
return ResultVOUtils.success("无数据");
}
@ -221,6 +222,8 @@ public class HeartService {
logs = logs + "供应商关联产品信息:" + syncDataResponse.getCompanyProductRelevanceEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getInvWarehouseEntities()))
logs = logs + "仓库字典:" + syncDataResponse.getInvWarehouseEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getInvSubWarehouseEntities()))
logs = logs + "分库信息:" + syncDataResponse.getInvSubWarehouseEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getThrInvWarehouseEntities()))
logs = logs + "第三方仓库字典:" + syncDataResponse.getThrInvWarehouseEntities().size() + "条\n";
if (CollUtil.isNotEmpty(syncDataResponse.getThrOrderEntities()))

@ -96,7 +96,7 @@ public class InvProductsTrService {
if (bussinessTypeEntity.isPreIn()) {
InvProductEntity invPreProductEntity =
invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
, null, null);
, warehouseEntity.getLocStorageCode(), warehouseEntity.getInvWarehouseCode());
if (invPreProductEntity == null) {
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
invPreInProductService.insertInvProduct(invPreProductEntity);

@ -10,6 +10,7 @@ import com.glxp.api.admin.entity.basic.*;
import com.glxp.api.admin.entity.info.SyncDataBustypeEntity;
import com.glxp.api.admin.entity.info.SyncDataSetEntity;
import com.glxp.api.admin.entity.inout.*;
import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity;
import com.glxp.api.admin.entity.inventory.InvWarehouseEntity;
import com.glxp.api.admin.entity.thrsys.*;
import com.glxp.api.admin.req.auth.AuthAdminQueryRequest;
@ -29,6 +30,7 @@ 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.*;
import com.glxp.api.admin.service.inventory.InvSubWarehouseService;
import com.glxp.api.admin.service.inventory.InvWarehouseService;
import com.glxp.api.admin.service.thrsys.*;
import org.springframework.beans.BeanUtils;
@ -46,6 +48,8 @@ public class UpBasicService {
@Resource
InvWarehouseService invWarehouseService;
@Resource
InvSubWarehouseService invSubWarehouseService;
@Resource
UdiRelevanceService udiRelevanceService;
@Resource
UdiInfoDao udiInfoDao;
@ -87,30 +91,41 @@ public class UpBasicService {
//仓库字典
if (syncDataSetEntity.isBasicInv()) {
//仓库字典
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();
BeanUtils.copyProperties(spsSyncDataRequest, filterInvWarehouseRequest);
List<InvWarehouseEntity> invWarehouseEntities = invWarehouseService.filterGroupInvWarehouse(filterInvWarehouseRequest);
syncDataResponse.setInvWarehouseEntities(invWarehouseEntities);
//获取仓库分库
if (CollUtil.isNotEmpty(invWarehouseEntities)) {
List<InvSubWarehouseEntity> mInvSubWarehouseEntities = new ArrayList<>();
List<WarehouseBussinessTypeEntity> mWarehouseBussinessTypeEntities = new ArrayList<>();
List<WarehouseUserEntity> mWarehouseUserEntities = new ArrayList<>();
for (InvWarehouseEntity invWarehouseEntity : invWarehouseEntities) {
//仓库关联单据类型
FilterInvBusTypeRequest filterInvBusTypeRequest = new FilterInvBusTypeRequest();
filterInvBusTypeRequest.setCode(invWarehouseEntity.getCode());
List<WarehouseBussinessTypeEntity> warehouseBussinessTypeEntities = warehouseBussinessTypeService.filterList(filterInvBusTypeRequest);
mWarehouseBussinessTypeEntities.addAll(warehouseBussinessTypeEntities);
//仓库关联用户
FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest();
filterInvUserRequest.setCode(invWarehouseEntity.getCode());
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest);
mWarehouseUserEntities.addAll(warehouseUserEntities);
List<InvSubWarehouseEntity> invSubWarehouseEntities = invSubWarehouseService.findByParentId(invWarehouseEntity.getCode());
if (CollUtil.isNotEmpty(invSubWarehouseEntities)) {
mInvSubWarehouseEntities.addAll(invSubWarehouseEntities);
for (InvSubWarehouseEntity invSubWarehouseEntity : invSubWarehouseEntities) {
//仓库关联单据类型
FilterInvBusTypeRequest filterInvBusTypeRequest = new FilterInvBusTypeRequest();
filterInvBusTypeRequest.setCode(invSubWarehouseEntity.getCode());
List<WarehouseBussinessTypeEntity> warehouseBussinessTypeEntities = warehouseBussinessTypeService.filterList(filterInvBusTypeRequest);
mWarehouseBussinessTypeEntities.addAll(warehouseBussinessTypeEntities);
//仓库关联用户
FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest();
filterInvUserRequest.setCode(invSubWarehouseEntity.getCode());
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest);
mWarehouseUserEntities.addAll(warehouseUserEntities);
}
}
}
syncDataResponse.setInvSubWarehouseEntities(mInvSubWarehouseEntities);
syncDataResponse.setWarehouseUserEntities(mWarehouseUserEntities);
syncDataResponse.setWarehouseBussinessTypeEntities(mWarehouseBussinessTypeEntities);
}
}

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

@ -136,9 +136,9 @@
<if test="preCheck != null">preCheck=#{preCheck},</if>
<if test="thirdBillNo != null">thirdBillNo=#{thirdBillNo},</if>
<if test="auditTime != null">auditTime=#{auditTime},</if>
<if test="replicateNo != null and replicateNo != ''">replicateNo=#{replicateNo}</if>
<if test="fromSubInvCode != null and fromSubInvCode != ''">fromSubInvCode=#{fromSubInvCode}</if>
<if test="createTime != null and createTime != ''">createTime=#{createTime}</if>
<if test="replicateNo != null and replicateNo != ''">replicateNo=#{replicateNo},</if>
<if test="fromSubInvCode != null and fromSubInvCode != ''">fromSubInvCode=#{fromSubInvCode},</if>
<if test="createTime != null and createTime != ''">createTime=#{createTime},</if>
</trim>
WHERE id = #{id}

@ -89,6 +89,13 @@
WHERE id = #{id}
</delete>
<delete id="deleteByParentCode" parameterType="Map">
DELETE
FROM inv_warehouse_sub
WHERE parentId = #{code}
</delete>
<update id="updateInvSubWarehouse" parameterType="com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity">
UPDATE inv_warehouse_sub
<trim prefix="set" suffixOverrides=",">

Loading…
Cancel
Save