diff --git a/src/main/java/com/glxp/api/constant/BasicProcessStatus.java b/src/main/java/com/glxp/api/constant/BasicProcessStatus.java index b028a12d..95fe4b11 100644 --- a/src/main/java/com/glxp/api/constant/BasicProcessStatus.java +++ b/src/main/java/com/glxp/api/constant/BasicProcessStatus.java @@ -28,6 +28,7 @@ public class BasicProcessStatus { public static final int NEW_ALL_DATA = 7; //所有最新数据 public static final int NEW_ALL_BUS = 8; public static final String NEW_ALL_ORDER = "9"; + public static final String NEW_ALL_BUS_ORDER = "11"; public static final int NEW_ALL_DI = 10; public static final int SCHEDULE_NORMAL = 1; //常规任务 diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java index 964c717b..22627c6d 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java @@ -128,7 +128,7 @@ public class UdiRelevanceController extends BaseController { } List temps = udiRelevanceService.filterUdiGp(filterUdiRelRequest); if (temps != null && temps.size() > 0) { - filterUdiRelRequest.setUuid(temps.get(0).getUuid()); + filterUdiRelRequest.setOriginUuid(temps.get(0).getOriginUuid()); filterUdiRelRequest.setNameCode(null); } } else { @@ -157,7 +157,7 @@ public class UdiRelevanceController extends BaseController { filterUdiRelRequest.setNameCode(filterUdiRelRequest.getUnionCode()); List temps = udiRelevanceService.filterUdiGp(filterUdiRelRequest); if (temps != null && temps.size() > 0) { - filterUdiRelRequest.setUuid(temps.get(0).getUuid()); + filterUdiRelRequest.setOriginUuid(temps.get(0).getOriginUuid()); filterUdiRelRequest.setNameCode(null); } } else { diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java index 31009915..207857cf 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java @@ -97,7 +97,7 @@ public class UdiRlSupController extends BaseController { filterUdiInfoRequest.setNameCode(companyProductRelevanceRequest.getUnionCode()); List temps = udiRelevanceService.filterUdiGp(filterUdiInfoRequest); if (temps != null && temps.size() > 0) { - companyProductRelevanceRequest.setUuid(temps.get(0).getUuid()); + companyProductRelevanceRequest.setOriginUuid(temps.get(0).getOriginUuid()); companyProductRelevanceRequest.setNameCode(filterUdiInfoRequest.getNameCode()); companyProductRelevanceRequest.setUnionCode(null); } diff --git a/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java b/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java index ae9c402b..1144b35a 100644 --- a/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java +++ b/src/main/java/com/glxp/api/controller/purchase/SupManufacturerController.java @@ -99,26 +99,26 @@ public class SupManufacturerController { String customerId = getCustomerId(); supManufacturerEntity.setCustomerId(customerId); //判断用户名和社会信用代码不能重复 - FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest(); + FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest(); filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName()); filterSupManufacturerRequest.setCustomerId(getCustomerId()); List companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - if(companyEntities.size()>0){ - return ResultVOUtils.error(999,"企业名称不能重复!"); + if (companyEntities.size() > 0) { + return ResultVOUtils.error(999, "企业名称不能重复!"); } - filterSupManufacturerRequest=new FilterSupManufacturerRequest(); + filterSupManufacturerRequest = new FilterSupManufacturerRequest(); filterSupManufacturerRequest.setCustomerId(getCustomerId()); filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode()); companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - if(companyEntities.size()>0){ - return ResultVOUtils.error(999,"统一社会信用代码不能重复!"); + if (companyEntities.size() > 0) { + return ResultVOUtils.error(999, "统一社会信用代码不能重复!"); } //提交审核 if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) { //判断是否上级供应商是否审核通过 SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId()); - if (supCompanyEntity.getAuditStatus()==null || supCompanyEntity.getAuditStatus() != ConstantStatus.AUDIT_PASS - ) { + if (supCompanyEntity.getAuditStatus() == null || supCompanyEntity.getAuditStatus() != ConstantStatus.AUDIT_PASS + ) { return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!"); } @@ -129,27 +129,27 @@ public class SupManufacturerController { List supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest); List supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId()); //判断存在有草稿的未提交的就不能通过 - for(SupCertEntity obj:supCertEntityList){ + for (SupCertEntity obj : supCertEntityList) { if (obj.getAuditStatus() == 0.) { - return ResultVOUtils.error(999,"资质证书存在草稿不能提交!"); + return ResultVOUtils.error(999, "资质证书存在草稿不能提交!"); } } ListIterator iterable = supCertSetEntities.listIterator(); while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 + if ((supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || ( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && supManufacturerEntity.getCompanyType().equals("1")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 3 && supManufacturerEntity.getCompanyType().equals("1"))) { for (SupCertEntity supCertEntity : supCertEntityList) { @@ -197,22 +197,22 @@ public class SupManufacturerController { if (StrUtil.isEmpty(supManufacturerEntity.getManufacturerId()) || StrUtil.isEmpty(supManufacturerEntity.getCustomerId())) { return ResultVOUtils.error(500, "参数错误!"); } - if(supManufacturerEntity.getId()==0){//新增 - //判断用户名和社会信用代码不能重复 - FilterSupManufacturerRequest filterSupManufacturerRequest=new FilterSupManufacturerRequest(); - filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName()); - filterSupManufacturerRequest.setCustomerId(getCustomerId()); - List companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - if(companyEntities.size()>0){ - return ResultVOUtils.error(999,"企业名称不能重复!"); - } - filterSupManufacturerRequest=new FilterSupManufacturerRequest(); - filterSupManufacturerRequest.setCustomerId(getCustomerId()); - filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode()); - companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); - if(companyEntities.size()>0){ - return ResultVOUtils.error(999,"统一社会信用代码不能重复!"); - } + if (supManufacturerEntity.getId() == 0) {//新增 + //判断用户名和社会信用代码不能重复 + FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest(); + filterSupManufacturerRequest.setCompanyName(supManufacturerEntity.getCompanyName()); + filterSupManufacturerRequest.setCustomerId(getCustomerId()); + List companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); + if (companyEntities.size() > 0) { + return ResultVOUtils.error(999, "企业名称不能重复!"); + } + filterSupManufacturerRequest = new FilterSupManufacturerRequest(); + filterSupManufacturerRequest.setCustomerId(getCustomerId()); + filterSupManufacturerRequest.setCreditCode(supManufacturerEntity.getCreditCode()); + companyEntities = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest); + if (companyEntities.size() > 0) { + return ResultVOUtils.error(999, "统一社会信用代码不能重复!"); + } } //提交审核 @@ -231,27 +231,27 @@ public class SupManufacturerController { List supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest); List supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId()); //判断存在有草稿的未提交的就不能通过 - for(SupCertEntity obj:supCertEntityList){ + for (SupCertEntity obj : supCertEntityList) { if (obj.getAuditStatus() == 0.) { - return ResultVOUtils.error(999,"资质证书存在草稿不能提交!"); + return ResultVOUtils.error(999, "资质证书存在草稿不能提交!"); } } ListIterator iterable = supCertSetEntities.listIterator(); while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 + if ((supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || ( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && supManufacturerEntity.getCompanyType().equals("1")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 3 && supManufacturerEntity.getCompanyType().equals("1"))) { for (SupCertEntity supCertEntity : supCertEntityList) { @@ -305,8 +305,7 @@ public class SupManufacturerController { } - - if(supManufacturerEntity.getAuditStatus()==1 || supManufacturerEntity.getAuditStatus()==4){ + if (supManufacturerEntity.getAuditStatus() == 1 || supManufacturerEntity.getAuditStatus() == 4) { //查询上传的资质证书 FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest(); filterSupCertRequest.setCustomerId(supManufacturerEntity.getCustomerId()); @@ -322,18 +321,18 @@ public class SupManufacturerController { while (iterable.hasNext()) { SupCertSetEntity supCertSetEntity = iterable.next(); - if (( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 + if ((supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || ( supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1 && supManufacturerEntity.getCompanyType().equals("1")) || - ( supCertSetEntity.getForeign() != null + (supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 3 && supManufacturerEntity.getCompanyType().equals("1"))) { for (SupCertEntity supCertEntity : supCertEntityList) { @@ -355,7 +354,7 @@ public class SupManufacturerController { } } - String msg=""; + String msg = ""; // 查询是否包含审核未通过的证书 if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS) { @@ -367,9 +366,10 @@ public class SupManufacturerController { List supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest); if (CollUtil.isNotEmpty(supCertEntityList)) { for (SupCertEntity supCertEntity : supCertEntityList) { - msg+=supCertEntity.getName()+","; + msg += supCertEntity.getName() + ","; } - return ResultVOUtils.error(500, "审核失败,还有必须提交证书未确认(" + msg.substring(0,msg.length()-1) + ")"); } + return ResultVOUtils.error(500, "审核失败,还有必须提交证书未确认(" + msg.substring(0, msg.length() - 1) + ")"); + } } supManufacturerEntity.setUpdateTime(new Date()); diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index 82ea2178..bc80ed6c 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -8,16 +8,22 @@ import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.BasicProcessStatus; import com.glxp.api.constant.Constant; import com.glxp.api.constant.ConstantStatus; +import com.glxp.api.controller.purchase.PurOrderController; import com.glxp.api.dao.inout.IoCodeTempDao; import com.glxp.api.dao.inout.IoOrderDao; import com.glxp.api.dao.inout.IoOrderDetailBizDao; import com.glxp.api.dao.inout.IoOrderDetailCodeDao; +import com.glxp.api.dao.purchase.PurOrderDao; +import com.glxp.api.dao.purchase.PurOrderDetailDao; import com.glxp.api.entity.inout.*; +import com.glxp.api.entity.purchase.PurOrderDetailEntity; +import com.glxp.api.entity.purchase.PurOrderEntity; import com.glxp.api.entity.sync.BasicDownloadStatusEntity; import com.glxp.api.entity.sync.BasicExportStatusEntity; import com.glxp.api.entity.sync.SyncDataBustypeEntity; import com.glxp.api.entity.sync.SyncDataSetEntity; import com.glxp.api.req.sync.SpsSyncDataRequest; +import com.glxp.api.res.sync.SpsSyncBusOrderResponse; import com.glxp.api.res.sync.SpsSyncOrderResponse; import com.glxp.api.res.system.SyncDataSetResponse; import com.glxp.api.service.inout.IoOrderService; @@ -166,5 +172,67 @@ public class SpsSyncDownloadController { } + // 接收中级服务,UDI管理系统上传业务单据 + @AuthRuleAnnotation("/sps/sync/busOrder/upload") + @PostMapping("/sps/sync/busOrder/upload") + public BaseResponse busOrderSava(@RequestBody @Valid SpsSyncBusOrderResponse spsSyncBusOrderResponse) { + BasicDownloadStatusEntity basicDownloadStatusEntity = new BasicDownloadStatusEntity(); + basicDownloadStatusEntity.setId(CustomUtil.getId()); + basicDownloadStatusEntity.setTaskId(spsSyncBusOrderResponse.getTaskId()); + basicDownloadStatusEntity.setStartTime(new Date()); + basicDownloadStatusEntity.setIdDatas(ConstantStatus.SYNC_DOWNLOAD_SCAN_ORDER); + basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_WAIT); //下载中 + basicDownloadStatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS_ORDER); + basicDownloadStatusEntity.setScheduleType(1); + basicDownloadService.insertDownloadStatus(basicDownloadStatusEntity); + StringBuffer remark = new StringBuffer(); + SqlSession batchSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED); + if (CollUtil.isNotEmpty(spsSyncBusOrderResponse.getPurOrderEntities())) { + try { + List orderEntities = spsSyncBusOrderResponse.getPurOrderEntities(); + PurOrderDao mapper = batchSession.getMapper(PurOrderDao.class); + for (PurOrderEntity orderEntity : orderEntities) { + orderEntity.setUpdateTime(null); + IoOrderEntity temp = orderService.findById(orderEntity.getBillNo()); + if (temp == null) { + orderEntity.setId(null); + mapper.insert(orderEntity); + if (CollUtil.isNotEmpty(spsSyncBusOrderResponse.getPurOrderDetailEntities())) { + PurOrderDetailDao codeMappert = batchSession.getMapper(PurOrderDetailDao.class); + List warehouseEntityList = spsSyncBusOrderResponse.getPurOrderDetailEntities(); + for (PurOrderDetailEntity warehouseEntity : warehouseEntityList) { + PurOrderDetailEntity codeTempEntity = new PurOrderDetailEntity(); + BeanUtils.copyProperties(warehouseEntity, codeTempEntity); + codeTempEntity.setId(null); + codeMappert.insert(codeTempEntity); + } + } + + batchSession.commit(); + } + } + batchSession.commit(); + + String logs = ""; + if (CollUtil.isNotEmpty(spsSyncBusOrderResponse.getPurOrderEntities())) + logs = logs + "单据:" + spsSyncBusOrderResponse.getPurOrderEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(spsSyncBusOrderResponse.getPurOrderDetailEntities())) + logs = logs + "单据详情:" + spsSyncBusOrderResponse.getPurOrderDetailEntities().size() + "条\n"; + remark.append(logs); + } catch (Exception e) { + e.printStackTrace(); + } + } + batchSession.close(); + basicDownloadStatusEntity.setUpdateTime(new Date()); + basicDownloadStatusEntity.setEndTime(new Date()); + basicDownloadStatusEntity.setRemark(remark.toString()); + basicDownloadStatusEntity.setStatus(ConstantStatus.SYNC_STATUS_SUCCESS); + basicDownloadService.updateDownloadStatus(basicDownloadStatusEntity); + + return ResultVOUtils.success("上传成功!"); + } + + } diff --git a/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java b/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java index 8c2b9504..5427cc0b 100644 --- a/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java +++ b/src/main/java/com/glxp/api/entity/inv/InvProductEntity.java @@ -105,4 +105,35 @@ public class InvProductEntity { @TableField(value = "updateTime") private Date updateTime; + /** + * 现存量 + */ + @TableField(value = "nowStock") + private Integer nowStock; + /** + * 冻结量 + */ + @TableField(value = "frozenCount") + private Integer frozenCount; + /** + * 预计入库量 + */ + @TableField(value = "planInCount") + private Integer planInCount; + /** + * 预计出库量 + */ + @TableField(value = "planOutCount") + private Integer planOutCount; + /** + * 在途库存 + */ + @TableField(value = "onWayCount") + private Integer onWayCount; + /** + * 可用库存 + */ + @TableField(value = "availableStock") + private Integer availableStock; + } diff --git a/src/main/java/com/glxp/api/req/basic/CompanyProductRelevanceRequest.java b/src/main/java/com/glxp/api/req/basic/CompanyProductRelevanceRequest.java index 4e38ef61..c86834d3 100644 --- a/src/main/java/com/glxp/api/req/basic/CompanyProductRelevanceRequest.java +++ b/src/main/java/com/glxp/api/req/basic/CompanyProductRelevanceRequest.java @@ -11,6 +11,7 @@ public class CompanyProductRelevanceRequest extends ListPageRequest { private String cpmctymc; private String nameCode; private String uuid; + private String originUuid; private String ggxh; private String thirdId; private String id; diff --git a/src/main/java/com/glxp/api/req/basic/FilterUdiRelRequest.java b/src/main/java/com/glxp/api/req/basic/FilterUdiRelRequest.java index 7c324d33..6e9690b0 100644 --- a/src/main/java/com/glxp/api/req/basic/FilterUdiRelRequest.java +++ b/src/main/java/com/glxp/api/req/basic/FilterUdiRelRequest.java @@ -12,6 +12,7 @@ public class FilterUdiRelRequest extends ListPageRequest { private String cpmctymc; private String nameCode; private String uuid; + private String originUuid; private String ggxh; private String thirdId; private Long id; @@ -56,7 +57,6 @@ public class FilterUdiRelRequest extends ListPageRequest { private String uniqueNameCode; private String supName; private String unitFk; - private String originUuid; private String relId; private String companyName; diff --git a/src/main/java/com/glxp/api/res/sync/SpsSyncBusOrderResponse.java b/src/main/java/com/glxp/api/res/sync/SpsSyncBusOrderResponse.java new file mode 100644 index 00000000..ccb8df58 --- /dev/null +++ b/src/main/java/com/glxp/api/res/sync/SpsSyncBusOrderResponse.java @@ -0,0 +1,16 @@ +package com.glxp.api.res.sync; + +import com.glxp.api.entity.purchase.PurOrderDetailEntity; +import com.glxp.api.entity.purchase.PurOrderEntity; +import lombok.Data; + +import java.util.List; + +@Data +public class SpsSyncBusOrderResponse { + + private String taskId; + private List purOrderEntities; + private List purOrderDetailEntities; + +} diff --git a/src/main/java/com/glxp/api/res/sync/SpsSyncOrderResponse.java b/src/main/java/com/glxp/api/res/sync/SpsSyncOrderResponse.java index c10f855c..e46dea35 100644 --- a/src/main/java/com/glxp/api/res/sync/SpsSyncOrderResponse.java +++ b/src/main/java/com/glxp/api/res/sync/SpsSyncOrderResponse.java @@ -17,6 +17,4 @@ public class SpsSyncOrderResponse { List orderDetailResultEntities; - - } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index eb401e13..4da96933 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -4,9 +4,9 @@ server: spring: datasource: driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_spms?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:p6spy:mysql://192.168.0.66:3364/udi_spms_wmd?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root - password: 123456 + password: Glxp@6066 hikari: connection-timeout: 60000 maximum-pool-size: 20 diff --git a/src/main/resources/mybatis/mapper/basic/CompanyProductRelevanceDao.xml b/src/main/resources/mybatis/mapper/basic/CompanyProductRelevanceDao.xml index f6c5c24d..8004250e 100644 --- a/src/main/resources/mybatis/mapper/basic/CompanyProductRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/basic/CompanyProductRelevanceDao.xml @@ -2,45 +2,42 @@ - replace - INTO company_product_relevance(customerId,productId,enterpriseId,registrationId, - createTime,updateTime,auditStatus,productUuid,udiRlIdFk,unitFk,price) values - ( - #{customerId}, - #{productId}, - #{enterpriseId}, - #{registrationId}, - #{createTime}, - #{updateTime}, - #{auditStatus}, - #{productUuid}, - #{udiRlIdFk}, - #{unitFk},#{price} - ) + INTO company_product_relevance(customerId, productId, enterpriseId, registrationId, + createTime, updateTime, auditStatus, productUuid, udiRlIdFk, unitFk, + price) + values (#{customerId}, + #{productId}, + #{enterpriseId}, + #{registrationId}, + #{createTime}, + #{updateTime}, + #{auditStatus}, + #{productUuid}, + #{udiRlIdFk}, + #{unitFk}, #{price}) replace - INTO company_product_relevance(id,customerId,productId,enterpriseId,registrationId, - create_time,update_time,auditStatus,productUuid,udiRlIdFk,unitFk,price) values - ( - #{id}, - #{customerId}, - #{productId}, - #{enterpriseId}, - #{registrationId}, - #{create_time}, - #{update_time}, - #{auditStatus}, - #{productUuid}, - #{udiRlIdFk}, - #{unitFk},#{price} - ) + INTO company_product_relevance(id, customerId, productId, enterpriseId, registrationId, + create_time, update_time, auditStatus, productUuid, udiRlIdFk, unitFk, + price) + values (#{id}, + #{customerId}, + #{productId}, + #{enterpriseId}, + #{registrationId}, + #{create_time}, + #{update_time}, + #{auditStatus}, + #{productUuid}, + #{udiRlIdFk}, + #{unitFk}, #{price}) @@ -58,101 +55,99 @@ - diff --git a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index 5c544687..1f6c4aa7 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -404,6 +404,9 @@ AND basic_udirel.id = #{id} + + and originUuid = #{originUuid} + ORDER BY modifyTime DESC diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index 87e59a91..fb881b96 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -127,3 +127,13 @@ INSERT ignore INTO `sys_scheduled`(`id`, `cronName`, `cron`, `customerId`, `rema VALUES (100, 'clean_log_task', '0 0 2 1/1 * ? ', NULL, '删除日志数据'); + +CALL Pro_Temp_ColumnWork('inv_product', 'nowStock', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_product', 'frozenCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_product', 'planInCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_product', 'planOutCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_product', 'onWayCount', 'int ', 1); +CALL Pro_Temp_ColumnWork('inv_product', 'availableStock', 'int ', 1); + + +