From 5b164764573af1549b04beef16deba3a7bdd6b98 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Thu, 26 May 2022 10:28:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E7=BB=A7=E6=9C=8D=E5=8A=A1=E5=90=8C?= =?UTF-8?q?=E6=AD=A5bug=E4=BF=AE=E6=94=B9=EF=BC=8C=E9=A2=84=E9=AA=8C?= =?UTF-8?q?=E6=94=B6bug=E4=BF=AE=E6=94=B9=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sale/admin/constant/ConstantStatus.java | 5 + .../basic/BasicUnitMaintainController.java | 1 + .../basic/BussinessLocalTypeController.java | 9 +- .../basic/SpsSyncDownloadController.java | 80 ++++++++- .../basic/SpsSyncDownloadService.java | 61 ++++--- .../basic/SpsSyncExportStatusController.java | 152 ++++++++++++------ .../basic/SpsSyncUploadController.java | 11 +- .../basic/UdiContrastController.java | 6 + .../controller/basic/UdiInfoController.java | 6 +- .../CompanyProductRelevanceController.java | 1 - .../inout/StockOrderDetailController.java | 1 + .../controller/inout/WareHouseController.java | 4 + .../inventory/InvPreInProductsController.java | 5 + .../inventory/InvPreProductsController.java | 5 + .../inventory/InvProductsController.java | 5 +- .../inventory/InvWarehouseController.java | 12 ++ .../dao/basic/BussinessChangeTypeDao.java | 1 + .../entity/basic/SpsBusLoclTypeResponse.java | 31 ++++ .../entity/thrsys/ThrProductsAddEntity.java | 1 + .../entity/thrsys/ThrProductsEntity.java | 1 + .../req/basic/BasicEntrustRecRequest.java | 19 +++ .../sale/admin/req/basic/CombineRequest.java | 1 + .../req/thrsys/FilterThrProductsRequest.java | 2 + .../admin/res/basic/SpsSyncBusResponse.java | 3 +- .../admin/res/basic/UdiRelevanceResponse.java | 1 + .../basic/BussinessChangeTypeService.java | 2 + .../impl/BussinessChangeTypeServiceaImpl.java | 6 + .../service/inout/impl/OrderServiceImpl.java | 2 +- .../InvPreInProductDetailServiceImpl.java | 59 ++++--- .../impl/InvPreProductServiceImpl.java | 11 -- .../thread/BasicBackUpdateProductService.java | 32 ++-- .../thread/BasicUpdateProductService.java | 8 +- .../thread/CompanyProductsRelService.java | 4 + .../admin/thread/InvProductsTrService.java | 12 +- .../thread/InvProductsTrService_back.java | 6 +- .../admin/thread/IoTransInoutService.java | 6 +- .../main/resources/application-pro.properties | 4 +- .../mybatis/mapper/basic/BasicExportDao.xml | 3 +- .../mapper/basic/BussinessChangeTypeDao.xml | 9 +- .../mybatis/mapper/basic/UdiRelevanceDao.xml | 20 +-- .../mybatis/mapper/inout/OrderDao.xml | 3 +- .../mapper/inventory/InvPreInProductDao.xml | 4 + .../inventory/InvPreInProductDetailDao.xml | 21 ++- .../mapper/inventory/InvPreProductDao.xml | 4 + .../inventory/InvPreProductDetailDao.xml | 16 +- .../mapper/inventory/InvProductDao.xml | 4 + .../mapper/inventory/InvProductDetailDao.xml | 19 ++- .../mapper/inventory/InvWarehouseDao.xml | 1 + .../mybatis/mapper/thrsys/ThrProductsDao.xml | 98 +++++------ 49 files changed, 563 insertions(+), 215 deletions(-) create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/entity/basic/SpsBusLoclTypeResponse.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicEntrustRecRequest.java diff --git a/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java b/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java index 3f75b78..ecd8296 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java @@ -112,4 +112,9 @@ public class ConstantStatus { public static final int ORDER_CHANGE_INNOR_NORMAL_IN = 5; //补调拨入库 + public static final String SYNC_BASIC_DATA = "AutoDownloadAllData"; + public static final String SYNC_BUS_TYPE = "AutoDownloadBusType"; + public static final String SYNC_SCAN_ORDER = "AutoDownloadOrder"; + public static final String SYNC_DI_PRODUCTS = "AutoDownloadDiProducts"; + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java index 0d6a2c5..c57d2d3 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BasicUnitMaintainController.java @@ -139,6 +139,7 @@ public class BasicUnitMaintainController { @AuthRuleAnnotation("") @PostMapping("/udiwms/basic/unit/maintain/update") public BaseResponse update(@RequestBody BasicUnitMaintainEntity basicUnitMaintainSaveRequest) { + basicUnitMaintainSaveRequest.setUpdateTime(new Date()); basicUnitMaintainService.updateById(basicUnitMaintainSaveRequest); return ResultVOUtils.success("修改成功"); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessLocalTypeController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessLocalTypeController.java index dfbdfca..17f29a1 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessLocalTypeController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessLocalTypeController.java @@ -192,12 +192,13 @@ public class BussinessLocalTypeController { } } - BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeService.findFirstByAction(bussinessLocalTypeEntity.getAction()); - if (bussinessChangeTypeEntity != null && bussinessChangeTypeEntity.getScAction() != null) { - return ResultVOUtils.error(500, "该业务单据类型已绑定流转单据类型,无法删除!"); - } +// BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeService.findFirstByAction(bussinessLocalTypeEntity.getAction()); +// if (bussinessChangeTypeEntity != null && bussinessChangeTypeEntity.getScAction() != null) { +// return ResultVOUtils.error(500, "该业务单据类型已绑定流转单据类型,无法删除!"); +// } bussinessLocalTypeService.deleteById(id); + bussinessChangeTypeService.deleteByLocaAction(bussinessLocalTypeEntity.getAction()); return ResultVOUtils.success("删除成功"); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java index c01bcc1..a237287 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadController.java @@ -1,6 +1,15 @@ package com.glxp.sale.admin.controller.basic; +import cn.hutool.core.collection.CollUtil; +import com.glxp.sale.admin.constant.ConstantStatus; +import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity; import com.glxp.sale.admin.req.basic.SpsSyncDataRequest; +import com.glxp.sale.admin.res.basic.SpSyncUdiResponse; +import com.glxp.sale.admin.res.basic.SpsSyncBusResponse; +import com.glxp.sale.admin.res.basic.SpsSyncDataResponse; +import com.glxp.sale.admin.res.basic.SpsSyncOrderResponse; +import com.glxp.sale.admin.service.basic.BasicExportService; +import com.glxp.sale.admin.util.Constant; import com.glxp.sale.common.res.BaseResponse; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @@ -12,27 +21,90 @@ public class SpsSyncDownloadController { @Resource SpsSyncDownloadService spsSyncDownloadService; + @Resource + BasicExportService basicExportService; @GetMapping("sps/sync/basic") public BaseResponse findProductInfo(SpsSyncDataRequest spsSyncDataRequest) { - return spsSyncDownloadService.findProductInfo(spsSyncDataRequest); + + + BaseResponse baseResponse = spsSyncDownloadService.findProductInfo(spsSyncDataRequest); + BasicExportStatusEntity basicExportStatusEntity = basicExportService.findByData(ConstantStatus.SYNC_BASIC_DATA, 0); + String logs = ""; + if (basicExportStatusEntity != null) { + if (CollUtil.isNotEmpty(baseResponse.getData().getUdiRelevanceEntities())) + logs = logs + "耗材字典:" + baseResponse.getData().getUdiRelevanceEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getBasicUnitMaintainEntities())) + logs = logs + "往来单位:" + baseResponse.getData().getBasicUnitMaintainEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getCompanyProductRelevanceEntities())) + logs = logs + "供应商关联产品信息:" + baseResponse.getData().getCompanyProductRelevanceEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getInvWarehouseEntities())) + logs = logs + "仓库字典:" + baseResponse.getData().getInvWarehouseEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getThrInvWarehouseEntities())) + logs = logs + "第三方仓库字典:" + baseResponse.getData().getThrInvWarehouseEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getThrOrderEntities())) + logs = logs + "第三方业务单据:" + baseResponse.getData().getThrOrderEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getThrProductsEntities())) + logs = logs + "第三方产品信息:" + baseResponse.getData().getThrProductsEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getThrCorpEntities())) + logs = logs + "第三方往来单位:" + baseResponse.getData().getThrCorpEntities().size() + "条\n"; + basicExportStatusEntity.setRemark(logs); + basicExportService.updateExportStatus(basicExportStatusEntity); + } + + return baseResponse; } @GetMapping("sps/sync/busType") public BaseResponse findBusType(SpsSyncDataRequest spsSyncDataRequest) { - return spsSyncDownloadService.findBusType(spsSyncDataRequest); + + BaseResponse baseResponse = spsSyncDownloadService.findBusType(spsSyncDataRequest); + BasicExportStatusEntity basicExportStatusEntity = basicExportService.findByData(ConstantStatus.SYNC_BUS_TYPE, 0); + String logs = ""; + if (basicExportStatusEntity != null) { + if (CollUtil.isNotEmpty(baseResponse.getData().getBussinessTypeEntities())) + logs = logs + "扫码单据类型:" + baseResponse.getData().getBussinessTypeEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getBussinessLocalTypeEntities())) + logs = logs + "业务单据类型:" + baseResponse.getData().getBussinessLocalTypeEntities().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getBussinessOriginTypeEntities())) + logs = logs + "第三方单据类型:" + baseResponse.getData().getBussinessOriginTypeEntities().size() + "条\n"; + basicExportStatusEntity.setRemark(logs); + basicExportService.updateExportStatus(basicExportStatusEntity); + } + return baseResponse; } @GetMapping("sps/sync/order") public BaseResponse findOrder(SpsSyncDataRequest spsSyncDataRequest) { - return spsSyncDownloadService.findOrder(spsSyncDataRequest); + BaseResponse baseResponse = spsSyncDownloadService.findOrder(spsSyncDataRequest); + BasicExportStatusEntity basicExportStatusEntity = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 0); + String logs = ""; + if (basicExportStatusEntity != null) { + logs = logs + "单据:" + baseResponse.getData().getOrderEntities().size() + "条\n"; + basicExportStatusEntity.setRemark(logs); + basicExportService.updateExportStatus(basicExportStatusEntity); + } + return baseResponse; } + //udi同步数据 @GetMapping("sps/sync/syncUdis") public BaseResponse syncUdi(SpsSyncDataRequest spsSyncDataRequest) { - return spsSyncDownloadService.syncUdi(spsSyncDataRequest); + BaseResponse baseResponse = spsSyncDownloadService.syncUdi(spsSyncDataRequest); + BasicExportStatusEntity basicExportStatusEntity = basicExportService.findByData(ConstantStatus.SYNC_DI_PRODUCTS, 0); + String logs = ""; + if (basicExportStatusEntity != null) { + if (CollUtil.isNotEmpty(baseResponse.getData().getProductInfoEntityList())) + logs = logs + "DI信息:" + baseResponse.getData().getProductInfoEntityList().size() + "条\n"; + if (CollUtil.isNotEmpty(baseResponse.getData().getUdiCompanyEntities())) + logs = logs + "医疗器械注册人:" + baseResponse.getData().getUdiCompanyEntities().size() + "条\n"; + basicExportStatusEntity.setRemark(logs); + basicExportService.updateExportStatus(basicExportStatusEntity); + } + return baseResponse; + } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadService.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadService.java index 719a6e1..5bd8025 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncDownloadService.java @@ -7,6 +7,7 @@ import com.glxp.sale.admin.entity.basic.*; import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity; import com.glxp.sale.admin.entity.inout.ErpOrderEntity; import com.glxp.sale.admin.entity.inout.OrderEntity; +import com.glxp.sale.admin.entity.inout.WarehouseBussinessTypeEntity; import com.glxp.sale.admin.entity.inout.WarehouseEntity; import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity; import com.glxp.sale.admin.entity.receipt.ProductInfoEntity; @@ -182,7 +183,15 @@ public class SpsSyncDownloadService { BussinessLocalTypeFilterRequest bussinessLocalTypeFilterRequest = new BussinessLocalTypeFilterRequest(); BeanUtils.copyProperties(spsSyncDataRequest, bussinessLocalTypeFilterRequest); List bussinessLocalTypeEntities = bussinessLocalTypeService.filterAllList(bussinessLocalTypeFilterRequest); - spsSyncBusResponse.setBussinessLocalTypeEntities(bussinessLocalTypeEntities); + + List spsBusLoclTypeResponses = new ArrayList<>(); + bussinessLocalTypeEntities.forEach(bussinessTypeEntity -> { + SpsBusLoclTypeResponse busLoclTypeResponse = new SpsBusLoclTypeResponse(); + BeanUtils.copyProperties(bussinessTypeEntity, busLoclTypeResponse); + spsBusLoclTypeResponses.add(busLoclTypeResponse); + }); + + spsSyncBusResponse.setBussinessLocalTypeEntities(spsBusLoclTypeResponses); } if (syncDataSetEntity.isTypeThird()) { BussinessOriginTypeFilterRequest bussinessOriginTypeFilterRequest = new BussinessOriginTypeFilterRequest(); @@ -214,47 +223,59 @@ public class SpsSyncDownloadService { OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); orderFilterRequest.setFilterActions(syncDataSetEntity.getBusTypes()); - orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); - orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED); - List temps = orderService.findAllByTime(orderFilterRequest); - if (CollUtil.isNotEmpty(temps)) { - orderEntities.addAll(temps); + if (CollUtil.isNotEmpty(orderFilterRequest.getFilterActions())) { + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); + orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED); + List temps = orderService.findAllByTime(orderFilterRequest); + if (CollUtil.isNotEmpty(temps)) { + orderEntities.addAll(temps); + } } + } if (syncDataSetEntity.isOrderUnReceive()) { OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); orderFilterRequest.setFilterActions(syncDataSetEntity.getBusTypes()); - orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); - orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN); - List temps = orderService.findAllByTime(orderFilterRequest); - if (CollUtil.isNotEmpty(temps)) { - orderEntities.addAll(temps); + if (CollUtil.isNotEmpty(orderFilterRequest.getFilterActions())) { + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); + orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_UN); + List temps = orderService.findAllByTime(orderFilterRequest); + if (CollUtil.isNotEmpty(temps)) { + orderEntities.addAll(temps); + } } + } if (syncDataSetEntity.isOrderUnCheck()) { OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); orderFilterRequest.setFilterActions(syncDataSetEntity.getBusTypes()); - orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK); - List temps = orderService.findAllByTime(orderFilterRequest); - if (CollUtil.isNotEmpty(temps)) { - orderEntities.addAll(temps); + if (CollUtil.isNotEmpty(orderFilterRequest.getFilterActions())) { + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_CHECK); + List temps = orderService.findAllByTime(orderFilterRequest); + if (CollUtil.isNotEmpty(temps)) { + orderEntities.addAll(temps); + } } + } if (syncDataSetEntity.isOrderScanFinish()) { OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); orderFilterRequest.setFilterActions(syncDataSetEntity.getBusTypes()); - orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); - orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED); - List temps = orderService.findAllByTime(orderFilterRequest); - if (CollUtil.isNotEmpty(temps)) { - orderEntities.addAll(temps); + if (CollUtil.isNotEmpty(orderFilterRequest.getFilterActions())) { + orderFilterRequest.setStatus(ConstantStatus.ORDER_STATUS_SUCCESS); + orderFilterRequest.setReceiveStatus(ConstantStatus.RECEIVE_ED); + List temps = orderService.findAllByTime(orderFilterRequest); + if (CollUtil.isNotEmpty(temps)) { + orderEntities.addAll(temps); + } } + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java index f93dbf7..ead988a 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncExportStatusController.java @@ -5,16 +5,16 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.constant.BasicProcessStatus; +import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity; import com.glxp.sale.admin.entity.basic.BasicExportStatusTimeEntity; import com.glxp.sale.admin.entity.inout.StockOrderEntity; import com.glxp.sale.admin.req.basic.BasicExportStatusRequest; import com.glxp.sale.admin.req.basic.BasicExportTimeRequest; +import com.glxp.sale.admin.req.basic.SpsSyncDataRequest; import com.glxp.sale.admin.req.info.DeleteRequest; import com.glxp.sale.admin.res.PageSimpleResponse; -import com.glxp.sale.admin.res.basic.BasicUnitMaintainExportResponse; -import com.glxp.sale.admin.res.basic.SpsSyncDataResponse; -import com.glxp.sale.admin.res.basic.UdiRelevanceExportJsonResponse; +import com.glxp.sale.admin.res.basic.*; import com.glxp.sale.admin.res.inventory.InvWarehouseExportResponse; import com.glxp.sale.admin.service.basic.BasicExportService; import com.glxp.sale.admin.service.basic.BasicExportTimeService; @@ -41,7 +41,8 @@ public class SpsSyncExportStatusController { BasicExportTimeService basicExportTimeService; @Resource RedisUtil redisUtil; - + @Resource + SpsSyncDownloadService spsSyncDownloadService; @GetMapping("/spssync/basic/udiinfo/getStatus") public BaseResponse getStatus(BasicExportStatusRequest basicExportStatusRequest) { @@ -110,76 +111,121 @@ public class SpsSyncExportStatusController { if (basicExportStatusRequest.getCreateType() == 1) { - //自动创建要求被下载已完成单据任务 - BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData("AutoDownloadOrder", 0); + BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 0); if (basicExportStatusEntity1 == null) { - BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); - orderStatusEntity.setId(CustomUtil.getId()); - orderStatusEntity.setIdDatas("AutoDownloadOrder"); - orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); - orderStatusEntity.setUpdateTime(new Date()); - orderStatusEntity.setStatus(0); - orderStatusEntity.setStartTime(new Date()); - orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); - basicExportService.insertExportStatus(orderStatusEntity); - }else { - return ResultVOUtils.error(501,"任务已存在!"); + BaseResponse baseResponse = spsSyncDownloadService.findOrder(getRequest(ConstantStatus.SYNC_SCAN_ORDER)); + SpsSyncOrderResponse syncOrderResponse = baseResponse.getData(); + if (CollUtil.isNotEmpty(syncOrderResponse.getOrderEntities())) { + BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); + orderStatusEntity.setId(CustomUtil.getId()); + orderStatusEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER); + orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); + orderStatusEntity.setUpdateTime(new Date()); + orderStatusEntity.setStatus(0); + orderStatusEntity.setStartTime(new Date()); + orderStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(orderStatusEntity); + } else { + return ResultVOUtils.error(501, "当前暂无更新数据需要同步!"); + } + } else { + return ResultVOUtils.error(501, "当前任务已存在!"); } } else if (basicExportStatusRequest.getCreateType() == 2) { //自动创建要求被下载单据类型任务 - BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData("AutoDownloadBusType", 0); + BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData(ConstantStatus.SYNC_BUS_TYPE, 0); if (basicExportStatusEntity2 == null) { - BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity(); - busTypetatusEntity.setId(CustomUtil.getId()); - busTypetatusEntity.setIdDatas("AutoDownloadBusType"); - busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); - busTypetatusEntity.setUpdateTime(new Date()); - busTypetatusEntity.setStatus(0); - busTypetatusEntity.setStartTime(new Date()); - busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); - basicExportService.insertExportStatus(busTypetatusEntity); - }else { - return ResultVOUtils.error(501,"任务已存在!"); + BaseResponse baseResponse = spsSyncDownloadService.findBusType(getRequest(ConstantStatus.SYNC_BUS_TYPE)); + SpsSyncBusResponse spsSyncBusResponse = baseResponse.getData(); + if (CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessLocalTypeEntities()) + || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessOriginTypeEntities()) + || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities())) { + BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity(); + busTypetatusEntity.setId(CustomUtil.getId()); + busTypetatusEntity.setIdDatas(ConstantStatus.SYNC_BUS_TYPE); + busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); + busTypetatusEntity.setUpdateTime(new Date()); + busTypetatusEntity.setStatus(0); + busTypetatusEntity.setStartTime(new Date()); + busTypetatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(busTypetatusEntity); + } else { + return ResultVOUtils.error(501, "当前暂无更新数据需要同步!"); + } + } else { + return ResultVOUtils.error(501, "任务已存在!"); } } else if (basicExportStatusRequest.getCreateType() == 3) { //自动创建要求被下载基础信息任务 - BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData("AutoDownloadAllData", 0); + BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData(ConstantStatus.SYNC_BASIC_DATA, 0); if (basicExportStatusEntity3 == null) { - BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); - basicExportStatusEntity.setId(CustomUtil.getId()); - basicExportStatusEntity.setIdDatas("AutoDownloadAllData"); - basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA); - basicExportStatusEntity.setUpdateTime(new Date()); - basicExportStatusEntity.setStatus(0); - basicExportStatusEntity.setStartTime(new Date()); - basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); - basicExportService.insertExportStatus(basicExportStatusEntity); - }else { - return ResultVOUtils.error(501,"任务已存在!"); + BaseResponse baseResponse = spsSyncDownloadService.findProductInfo(getRequest(ConstantStatus.SYNC_BASIC_DATA)); + SpsSyncDataResponse spsSyncDataResponse = baseResponse.getData(); + if (CollUtil.isNotEmpty(spsSyncDataResponse.getThrOrderDetailEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getThrOrderEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getInvWarehouseEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getBasicUnitMaintainEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getCompanyProductRelevanceEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getThrCorpEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getUdiInfoEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getUdiRelevanceEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getThrProductsEntities()) + || CollUtil.isNotEmpty(spsSyncDataResponse.getThrInvWarehouseEntities()) + ) { + BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); + basicExportStatusEntity.setId(CustomUtil.getId()); + basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_BASIC_DATA); + basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA); + basicExportStatusEntity.setUpdateTime(new Date()); + basicExportStatusEntity.setStatus(0); + basicExportStatusEntity.setStartTime(new Date()); + basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(basicExportStatusEntity); + } else { + return ResultVOUtils.error(501, "当前暂无更新数据需要同步!"); + } + } else { + return ResultVOUtils.error(501, "任务已存在!"); } } else if (basicExportStatusRequest.getCreateType() == 4) { //自动创建要求被下载同步库DI信息 - BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData("AutoDownloadDiProducts", 0); + BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData(ConstantStatus.SYNC_DI_PRODUCTS, 0); if (basicExportStatusEntity4 == null) { - BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); - basicExportStatusEntity.setId(CustomUtil.getId()); - basicExportStatusEntity.setIdDatas("AutoDownloadDiProducts"); - basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI); - basicExportStatusEntity.setUpdateTime(new Date()); - basicExportStatusEntity.setStatus(0); - basicExportStatusEntity.setStartTime(new Date()); - basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); - basicExportService.insertExportStatus(basicExportStatusEntity); - }else { - return ResultVOUtils.error(501,"任务已存在!"); + BaseResponse baseResponse = spsSyncDownloadService.syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS)); + SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData(); + if (CollUtil.isNotEmpty(spSyncUdiResponse.getProductInfoEntityList()) + || CollUtil.isNotEmpty(spSyncUdiResponse.getUdiCompanyEntities())) { + BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); + basicExportStatusEntity.setId(CustomUtil.getId()); + basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS); + basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI); + basicExportStatusEntity.setUpdateTime(new Date()); + basicExportStatusEntity.setStatus(0); + basicExportStatusEntity.setStartTime(new Date()); + basicExportStatusEntity.setScheduleType(BasicProcessStatus.SCHEDULE_NORMAL); + basicExportService.insertExportStatus(basicExportStatusEntity); + } else { + return ResultVOUtils.error(501, "当前暂无更新数据需要同步!"); + } + } else { + return ResultVOUtils.error(501, "任务已存在!"); } } return ResultVOUtils.success("创建成功!"); } + + public SpsSyncDataRequest getRequest(String type) { + SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest(); + spsSyncDataRequest.setPage(1); + spsSyncDataRequest.setLimit(1); + BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByType(type); + spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime()); + return spsSyncDataRequest; + } } \ No newline at end of file diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java index d53f639..ecd25c1 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/SpsSyncUploadController.java @@ -35,6 +35,7 @@ import com.glxp.sale.admin.service.inout.OrderService; import com.glxp.sale.admin.service.inventory.InvWarehouseService; import com.glxp.sale.admin.service.thrsys.*; import com.glxp.sale.admin.thread.BasicBackUpdateProductService; +import com.glxp.sale.admin.util.BeanUtils; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; import org.apache.ibatis.session.ExecutorType; @@ -47,6 +48,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @RestController @@ -251,7 +253,14 @@ public class SpsSyncUploadController { //业务单据 if (CollUtil.isNotEmpty(syncDataResponse.getBussinessLocalTypeEntities())) { try { - List bussinessLocalTypeEntities = syncDataResponse.getBussinessLocalTypeEntities(); + List spsBusLoclTypeResponses = syncDataResponse.getBussinessLocalTypeEntities(); + List bussinessLocalTypeEntities = new ArrayList<>(); + spsBusLoclTypeResponses.forEach(spsBusLoclTypeResponse -> + { + BussinessLocalTypeEntity bussinessLocalTypeEntity = new BussinessLocalTypeEntity(); + BeanUtils.copyProperties(spsBusLoclTypeResponse, bussinessLocalTypeEntity); + bussinessLocalTypeEntities.add(bussinessLocalTypeEntity); + }); BussinessLocalTypeDao mapper = batchSession.getMapper(BussinessLocalTypeDao.class); for (BussinessLocalTypeEntity bussinessTypeEntity : bussinessLocalTypeEntities) { bussinessTypeEntity.setUpdateTime(null); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiContrastController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiContrastController.java index f503315..fff5753 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiContrastController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiContrastController.java @@ -164,6 +164,7 @@ public class UdiContrastController { udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime()); udiRelevanceEntity.setManufactory(combineRequest.getManufactory()); udiRelevanceEntity.setSupName(combineRequest.getSupName()); + udiRelevanceEntity.setPrice(combineRequest.getPrice()); UdiRelevanceEntity temp = udiContrastService.findById(udiRelevanceEntity.getId()); if (udiContrastService.isExit(temp.getOriginUuid(), udiRelevanceEntity.getMainId())) { return ResultVOUtils.error(500, "已存在相同的对照关系,对照失败!"); @@ -217,6 +218,8 @@ public class UdiContrastController { try { CombineRequest combineRequest = new CombineRequest(); combineRequest.setRelId(removeRelRequest.getRelId()); + udiRelevanceEntity.setSupName(""); + udiRelevanceEntity.setPrice(""); udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); } catch (Exception e) { e.printStackTrace(); @@ -271,6 +274,7 @@ public class UdiContrastController { } else udiRelevanceEntity.setManufactory(udiInfoEntities.get(0).getYlqxzcrbarmc()); udiRelevanceEntity.setSupName(combineRequest.getSupName()); + udiRelevanceEntity.setPrice(combineRequest.getPrice()); udiRelevanceEntity.setId(gennerOrderUtils.getRelId() + ""); udiRelevanceService.insertUdiRelevance(udiRelevanceEntity); insertUdiInfos(udiInfoEntities); @@ -283,6 +287,7 @@ public class UdiContrastController { udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid()); udiRelevanceEntity.setManufactory(udiInfoEntities.get(0).getYlqxzcrbarmc()); udiRelevanceEntity.setSupName(combineRequest.getSupName()); + udiRelevanceEntity.setPrice(combineRequest.getPrice()); udiRelevanceEntity.setId(gennerOrderUtils.getRelId() + ""); udiRelevanceService.insertUdiRelevance(udiRelevanceEntity); insertUdiInfos(udiInfoEntities); @@ -303,6 +308,7 @@ public class UdiContrastController { udiRelevanceEntity.setManufactory(thrProductsEntity.getManufactory()); udiRelevanceEntity.setSupName(combineRequest.getSupName()); udiRelevanceEntity.setId(gennerOrderUtils.getRelId() + ""); + udiRelevanceEntity.setPrice(thrProductsEntity.getPrice()); udiRelevanceService.insertUdiRelevance(udiRelevanceEntity); UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); BeanUtils.copyProperties(thrProductsEntity, udiInfoEntity); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java index 12dbd9b..59aafaa 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java @@ -43,10 +43,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; //基础信息维护 @RestController @@ -312,6 +309,7 @@ public class UdiInfoController { if (null == thrProductsEntity) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); thrProductsEntity.setThirdSysFk("thirdId"); + thrProductsEntity.setUpdateTime(new Date()); thrProductsService.insertThrProducts(thrProductsEntity); return ResultVOUtils.success(); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/info/CompanyProductRelevanceController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/info/CompanyProductRelevanceController.java index 58744e1..892b915 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/info/CompanyProductRelevanceController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/info/CompanyProductRelevanceController.java @@ -172,7 +172,6 @@ public class CompanyProductRelevanceController { if (companyEntity.getUnitIdFk().equals("110")) { udiInfoExportRequest.setUnitFk(null); } else { -// udiInfoExportRequest.setCustomerId(null); udiInfoExportRequest.setUnitFk(companyEntity.getUnitIdFk()); } companyProductsRelService.insertCompanyProducts(udiInfoExportRequest); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java index 365d334..05cb65c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderDetailController.java @@ -268,6 +268,7 @@ public class StockOrderDetailController { CompanyProductRelevanceResponse companyProductRelevanceResponse = new CompanyProductRelevanceResponse(); BeanUtils.copyProperties(udiRelevanceResponses.get(0), companyProductRelevanceResponse); companyProductRelevanceResponse.setRlId(udiRelevanceResponses.get(0).getId()); + companyProductRelevanceResponse.setPrice(udiRelevanceResponses.get(0).getPrice()); companyProductRelevanceResponses.add(companyProductRelevanceResponse); } } else diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java index 30f7c2e..21ca91a 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/WareHouseController.java @@ -414,6 +414,10 @@ public class WareHouseController { return ResultVOUtils.error(500, "超出预验收库存数量"); } } + }else { + if(invProductDetailEntity.getCount()<1){ + return ResultVOUtils.error(500, "超出预验收库存数量"); + } } } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreInProductsController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreInProductsController.java index 8ad6b50..c2ea157 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreInProductsController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreInProductsController.java @@ -1,6 +1,7 @@ package com.glxp.sale.admin.controller.inventory; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.annotation.AuthRuleAnnotation; import com.glxp.sale.admin.constant.ConstantStatus; @@ -104,6 +105,10 @@ public class InvPreInProductsController { if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { filterInvProductRequest.setCustomerId(null); } + if(StrUtil.isEmpty(filterInvProductRequest.getBatchNo())) + { + filterInvProductRequest.setBatchNo("empty"); + } List invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(invProductDetailEntities); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreProductsController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreProductsController.java index 476d392..34de64f 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreProductsController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvPreProductsController.java @@ -1,5 +1,6 @@ package com.glxp.sale.admin.controller.inventory; +import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.annotation.AuthRuleAnnotation; import com.glxp.sale.admin.constant.ConstantStatus; @@ -75,6 +76,10 @@ public class InvPreProductsController { filterInvProductRequest.setCustomerId(null); // filterInvProductRequest.setSupId(); } + if(StrUtil.isEmpty(filterInvProductRequest.getBatchNo())) + { + filterInvProductRequest.setBatchNo("empty"); + } List invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(invProductDetailEntities); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java index da04bbe..ab6a9a8 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvProductsController.java @@ -52,7 +52,6 @@ import java.util.List; import java.util.Map; - @RestController public class InvProductsController { @@ -135,7 +134,9 @@ public class InvProductsController { if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { filterInvProductRequest.setCustomerId(null); } -// filterInvProductRequest.setSupId(null); + if (StrUtil.isEmpty(filterInvProductRequest.getBatchNo())) { + filterInvProductRequest.setBatchNo("empty"); + } List invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest); PageInfo pageInfo; pageInfo = new PageInfo<>(invProductDetailEntities); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvWarehouseController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvWarehouseController.java index 3601710..3080fe7 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvWarehouseController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inventory/InvWarehouseController.java @@ -90,6 +90,18 @@ public class InvWarehouseController { } + @AuthRuleAnnotation("") + @GetMapping("spms/inv/warehouse/filterByUser") + public BaseResponse filterByUser(FilterInvWarehouseRequest filterInvWarehouseRequest) { + AuthAdmin authAdmin = customerService.getUserBean(); + filterInvWarehouseRequest.setPid(0); + filterInvWarehouseRequest.setStatus(1); + filterInvWarehouseRequest.setUserId(authAdmin.getId().intValue()); + List mInvWarehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest); + return ResultVOUtils.success(mInvWarehouseEntities); + } + + @AuthRuleAnnotation("") @GetMapping("spms/inv/warehouse/filterAllLocInv") public BaseResponse filterAllLocInv(FilterInvWarehouseRequest filterInvWarehouseRequest) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessChangeTypeDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessChangeTypeDao.java index 1f93ac2..62e7683 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessChangeTypeDao.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/BussinessChangeTypeDao.java @@ -22,4 +22,5 @@ public interface BussinessChangeTypeDao { boolean deleteByAction(@Param("scAction") String scAction); + boolean deleteByLocaAction(@Param("action") String action); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/SpsBusLoclTypeResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/SpsBusLoclTypeResponse.java new file mode 100644 index 0000000..7dbb9fc --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/SpsBusLoclTypeResponse.java @@ -0,0 +1,31 @@ +package com.glxp.sale.admin.entity.basic; + +import lombok.Data; + +import java.util.Date; + +@Data +public class SpsBusLoclTypeResponse { + private Integer id; + private String action; + private String name; + private String localAction; + private String originAction; + private String mainAction; + private String localName; + private String remark; + private boolean checkEnable; + private boolean advanceType; + private boolean spUse; + private String storageCode; + private int corpType; + private String defaultUnit; + private boolean genUnit; + private String thirdAction; + private String thirdSys; + private Date updateTime; + private String prefix; + private String localPrefix; + private boolean preIn; + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrProductsAddEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrProductsAddEntity.java index 2a2fe5b..8d98fb6 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrProductsAddEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrProductsAddEntity.java @@ -39,6 +39,7 @@ public class ThrProductsAddEntity { private String remark1; //备注1 private String remark2; //备注2 private String remark3; //备注3 + private String price; private Integer checkStatus; private String customerId; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrProductsEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrProductsEntity.java index 54d56ed..2fc97f6 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrProductsEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/thrsys/ThrProductsEntity.java @@ -27,6 +27,7 @@ public class ThrProductsEntity { private Date updateTime; private String supName; private boolean isChecked; + private String price; //添加字段 private String model; //型号 diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicEntrustRecRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicEntrustRecRequest.java new file mode 100644 index 0000000..974c11d --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicEntrustRecRequest.java @@ -0,0 +1,19 @@ +package com.glxp.sale.admin.req.basic; + +import com.glxp.sale.admin.req.ListPageRequest; +import lombok.Data; + +import java.util.Date; + +@Data +public class BasicEntrustRecRequest extends ListPageRequest { + + private Integer id; + private String action; + private String entrustInv; + private String entrustUser; + private String userId; + private Date updateTime; + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/CombineRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/CombineRequest.java index 466fd80..8ed5286 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/CombineRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/CombineRequest.java @@ -22,6 +22,7 @@ public class CombineRequest { private Boolean supEnable; private String manufactory; private String supName; + private String price; private boolean idSpliUdi; private String uuid; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/thrsys/FilterThrProductsRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/thrsys/FilterThrProductsRequest.java index b40d359..79165f4 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/thrsys/FilterThrProductsRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/thrsys/FilterThrProductsRequest.java @@ -22,5 +22,7 @@ public class FilterThrProductsRequest extends ListPageRequest { private Integer checkStatus; private String customerId; private String supId; + private String sptm; private String lastUpdateTime; + private String ybbm; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/SpsSyncBusResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/SpsSyncBusResponse.java index ed7e775..70712e6 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/SpsSyncBusResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/SpsSyncBusResponse.java @@ -3,6 +3,7 @@ package com.glxp.sale.admin.res.basic; import com.glxp.sale.admin.entity.basic.BussinessLocalTypeEntity; import com.glxp.sale.admin.entity.basic.BussinessOriginTypeEntity; import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; +import com.glxp.sale.admin.entity.basic.SpsBusLoclTypeResponse; import lombok.Data; import java.util.List; @@ -12,5 +13,5 @@ public class SpsSyncBusResponse { private List bussinessTypeEntities; private List bussinessOriginTypeEntities; - private List bussinessLocalTypeEntities; + private List bussinessLocalTypeEntities; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/UdiRelevanceResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/UdiRelevanceResponse.java index 3b08660..d0a78d8 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/UdiRelevanceResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/UdiRelevanceResponse.java @@ -67,6 +67,7 @@ public class UdiRelevanceResponse { private String companyName; private String originUuid; private boolean allowNoBatch; + private String price; public int getBhzxxsbzsl() { if (bhzxxsbzsl == null || bhzxxsbzsl == 0) { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessChangeTypeService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessChangeTypeService.java index e32b89a..77012ff 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessChangeTypeService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/BussinessChangeTypeService.java @@ -20,4 +20,6 @@ public interface BussinessChangeTypeService { boolean deleteById(String id); boolean deleteByAction(String scAction); + + boolean deleteByLocaAction(String action); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessChangeTypeServiceaImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessChangeTypeServiceaImpl.java index ffd41e0..b6a3d5f 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessChangeTypeServiceaImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/BussinessChangeTypeServiceaImpl.java @@ -55,4 +55,10 @@ public class BussinessChangeTypeServiceaImpl implements BussinessChangeTypeServi public boolean deleteByAction(String scAction) { return bussinessChangeTypeDao.deleteByAction(scAction); } + + + @Override + public boolean deleteByLocaAction(String action) { + return bussinessChangeTypeDao.deleteByLocaAction(action); + } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/OrderServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/OrderServiceImpl.java index 4d03d4b..18b2d7b 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/OrderServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/OrderServiceImpl.java @@ -239,7 +239,7 @@ public class OrderServiceImpl implements OrderService { BussinessTypeEntity supplementType = bussinessTypeDao.selectByAction(bussinessTypeEntity.getSupplementOrderType()); supplementOrder.setMainAction(supplementType.getMainAction()); supplementOrder.setAction(supplementType.getAction()); - + supplementOrder.setErpFk(null); // String time = DateUtil.getBeforeMinute(supplementOrder.getActDate(), 5); // supplementOrder.setActDate(time); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java index 1b0e30c..a0d258e 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreInProductDetailServiceImpl.java @@ -1,9 +1,13 @@ package com.glxp.sale.admin.service.inventory.impl; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageHelper; import com.glxp.sale.admin.constant.ConstantType; +import com.glxp.sale.admin.dao.inventory.InvPreInProductDao; import com.glxp.sale.admin.dao.inventory.InvPreInProductDetailDao; import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; +import com.glxp.sale.admin.entity.inventory.InvProductEntity; import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; import com.glxp.sale.admin.res.inventory.InvProductDetailJoinResponse; import com.glxp.sale.admin.service.inventory.InvPreInProductDetailService; @@ -20,6 +24,8 @@ public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailSe @Resource InvPreInProductDetailDao invPreInProductDetailDao; + @Resource + InvPreInProductDao invPreInProductDao; @Override public List filterInvProduct(FilterInvProductDetailRequest filterInvProductDetailRequest) { @@ -88,27 +94,42 @@ public class InvPreInProductDetailServiceImpl implements InvPreInProductDetailSe FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); filterInvProductDetailRequest.setOriginCode(code); List datas = invPreInProductDetailDao.filterInvProductDetail(filterInvProductDetailRequest); - Map invProductDetailEntityMap = new HashMap<>(); - for (InvProductDetailEntity invProductDetailEntity : datas) { - InvProductDetailEntity temp = invProductDetailEntityMap.get(invProductDetailEntity.getCode()); - if (temp == null) { - invProductDetailEntityMap.put(invProductDetailEntity.getOriginCode(), invProductDetailEntity); + + if (CollUtil.isNotEmpty(datas)) { + InvProductDetailEntity invProductDetailEntity = datas.get(0); + String bacthNo = null; + if (StrUtil.isEmpty(invProductDetailEntity.getBatchNo())) { + bacthNo = "empty"; } else { - int count1 = 0; - int count2 = 0; - if (temp.getMainAction().equals(ConstantType.TYPE_PUT)) { - count1 = temp.getCount(); - } else { - count1 = 0 - temp.getCount(); - } - if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { - count2 = invProductDetailEntity.getCount(); - } else { - count2 = 0 - invProductDetailEntity.getCount(); - } - temp.setCount(count1 + count2); + bacthNo = invProductDetailEntity.getBatchNo(); } + InvProductEntity invProductEntity = invPreInProductDao.selectByUuid(invProductDetailEntity.getProductIdFk(), bacthNo, invProductDetailEntity.getSupId(), invProductDetailEntity.getInvStorageCode(), invProductDetailEntity.getInvWarehouseCode()); + invProductDetailEntity.setCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); + return invProductDetailEntity; } - return invProductDetailEntityMap.get(code); + return null; + + +// Map invProductDetailEntityMap = new HashMap<>(); +// for (InvProductDetailEntity invProductDetailEntity : datas) { +// InvProductDetailEntity temp = invProductDetailEntityMap.get(invProductDetailEntity.getOriginCode()); +// if (temp == null) { +// invProductDetailEntityMap.put(invProductDetailEntity.getOriginCode(), invProductDetailEntity); +// } else { +// int count1 = 0; +// int count2 = 0; +// if (temp.getMainAction().equals(ConstantType.TYPE_PUT)) { +// count1 = temp.getCount(); +// } else { +// count1 = 0 - temp.getCount(); +// } +// if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { +// count2 = invProductDetailEntity.getCount(); +// } else { +// count2 = 0 - invProductDetailEntity.getCount(); +// } +// temp.setCount(count1 + count2); +// } +// } } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductServiceImpl.java index e5c80b5..4c34324 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inventory/impl/InvPreProductServiceImpl.java @@ -53,17 +53,6 @@ public class InvPreProductServiceImpl implements InvPreProductService { return invPreProductDao.selectByUuid(uuid, batchNo, supId, invStorageCode, invWarehouseCode); - // FilterInvProductRequest filterInvProductRequest = new FilterInvProductRequest(); -// filterInvProductRequest.setRelIdFk(uuid); -// filterInvProductRequest.setBatchNo(batchNo); -// filterInvProductRequest.setSupId(supId); -// filterInvProductRequest.setInvWarehouseCode(invWarehouseCode); -// filterInvProductRequest.setInvStorageCode(invStorageCode); -// List data = filterInvProduct(filterInvProductRequest); -// if (data != null && data.size() > 0) { -// return data.get(0); -// } -// return null; } @Override diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java index 3cbd0bc..a3f16f9 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicBackUpdateProductService.java @@ -78,10 +78,6 @@ public class BasicBackUpdateProductService { Map erpProductsMap = new HashMap<>(); if (invmandocResponses != null && invmandocResponses.size() > 0) { List inventoryCodes = new ArrayList<>(); -// if (filterErpGoodsRequest.getCode() != null) { -// inventoryCodes.add(filterErpGoodsRequest.getCode()); -// erpProductsMap.put(filterErpGoodsRequest.getCode(), invmandocResponses.get(0)); -// } else { for (ErpProductsResponse invmandocResponse : invmandocResponses) { UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectByThirdId(invmandocResponse.getCode(), thirdSysId); if (udiRelevanceEntity == null) { @@ -238,11 +234,12 @@ public class BasicBackUpdateProductService { udiRelevanceEntity1.setMainId(udiRelevanceEntity1.getThirdId4()); udiRelevanceEntity1.setMainName(udiRelevanceEntity1.getThirdName4()); } - + udiRelevanceEntity1.setPrice(thrProductsEntity.getPrice()); udiRelevanceEntity1.setManufactory(thrProductsEntity.getManufactory()); udiRelevanceEntity1.setThirdId(thrProductsEntity.getCode()); udiRelevanceEntity1.setThirdName(thrProductsEntity.getName()); udiRelevanceEntity1.setUpdateTime(DateUtil.getDateTime()); + udiRelevanceEntity1.setId(gennerOrderUtils.getRelId() + ""); udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1); } } @@ -256,14 +253,14 @@ public class BasicBackUpdateProductService { public void syncUpdatetTime() { //自动创建要求被下载已完成单据任务 - BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData("AutoDownloadOrder", 0); + BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 0); if (basicExportStatusEntity1 == null) { - BaseResponse baseResponse = spsSyncDownloadService.findOrder(getRequest("AutoDownloadOrder")); + BaseResponse baseResponse = spsSyncDownloadService.findOrder(getRequest(ConstantStatus.SYNC_SCAN_ORDER)); SpsSyncOrderResponse syncOrderResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(syncOrderResponse.getOrderEntities())) { BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); orderStatusEntity.setId(CustomUtil.getId()); - orderStatusEntity.setIdDatas("AutoDownloadOrder"); + orderStatusEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER); orderStatusEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); orderStatusEntity.setUpdateTime(new Date()); orderStatusEntity.setStatus(0); @@ -275,17 +272,17 @@ public class BasicBackUpdateProductService { //自动创建要求被下载单据类型任务 - BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData("AutoDownloadBusType", 0); + BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData(ConstantStatus.SYNC_BUS_TYPE, 0); if (basicExportStatusEntity2 == null) { - BaseResponse baseResponse = spsSyncDownloadService.findBusType(getRequest("AutoDownloadBusType")); + BaseResponse baseResponse = spsSyncDownloadService.findBusType(getRequest(ConstantStatus.SYNC_BUS_TYPE)); SpsSyncBusResponse spsSyncBusResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessLocalTypeEntities()) || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessOriginTypeEntities()) || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities())) { BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity(); busTypetatusEntity.setId(CustomUtil.getId()); - busTypetatusEntity.setIdDatas("AutoDownloadBusType"); + busTypetatusEntity.setIdDatas(ConstantStatus.SYNC_BUS_TYPE); busTypetatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); busTypetatusEntity.setUpdateTime(new Date()); busTypetatusEntity.setStatus(0); @@ -297,11 +294,10 @@ public class BasicBackUpdateProductService { //自动创建要求被下载基础信息任务 - BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData("AutoDownloadAllData", 0); + BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData(ConstantStatus.SYNC_BASIC_DATA, 0); if (basicExportStatusEntity3 == null) { - BaseResponse baseResponse = spsSyncDownloadService.findProductInfo(getRequest("AutoDownloadAllData")); + BaseResponse baseResponse = spsSyncDownloadService.findProductInfo(getRequest(ConstantStatus.SYNC_BASIC_DATA)); SpsSyncDataResponse spsSyncDataResponse = baseResponse.getData(); - if (CollUtil.isNotEmpty(spsSyncDataResponse.getThrOrderDetailEntities()) || CollUtil.isNotEmpty(spsSyncDataResponse.getThrOrderEntities()) || CollUtil.isNotEmpty(spsSyncDataResponse.getInvWarehouseEntities()) @@ -315,7 +311,7 @@ public class BasicBackUpdateProductService { ) { BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); basicExportStatusEntity.setId(CustomUtil.getId()); - basicExportStatusEntity.setIdDatas("AutoDownloadAllData"); + basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_BASIC_DATA); basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DATA); basicExportStatusEntity.setUpdateTime(new Date()); basicExportStatusEntity.setStatus(0); @@ -326,15 +322,15 @@ public class BasicBackUpdateProductService { } //自动创建要求被下载同步库DI信息 - BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData("AutoDownloadDiProducts", 0); + BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData(ConstantStatus.SYNC_DI_PRODUCTS, 0); if (basicExportStatusEntity4 == null) { - BaseResponse baseResponse = spsSyncDownloadService.syncUdi(getRequest("AutoDownloadDiProducts")); + BaseResponse baseResponse = spsSyncDownloadService.syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS)); SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(spSyncUdiResponse.getProductInfoEntityList()) || CollUtil.isNotEmpty(spSyncUdiResponse.getUdiCompanyEntities())) { BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); basicExportStatusEntity.setId(CustomUtil.getId()); - basicExportStatusEntity.setIdDatas("AutoDownloadDiProducts"); + basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS); basicExportStatusEntity.setType(BasicProcessStatus.NEW_ALL_DI); basicExportStatusEntity.setUpdateTime(new Date()); basicExportStatusEntity.setStatus(0); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicUpdateProductService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicUpdateProductService.java index a5405b7..4875eee 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicUpdateProductService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/BasicUpdateProductService.java @@ -99,6 +99,7 @@ public class BasicUpdateProductService { udiRelevanceEntity1.setThirdName(thrProductsEntity.getName()); udiRelevanceEntity1.setUpdateTime(DateUtil.getDateTime()); udiRelevanceEntity1.setSupName(thrProductsEntity.getSupName()); + udiRelevanceEntity1.setPrice(thrProductsEntity.getPrice()); udiRelevanceEntity1.setManufactory(udiInfoEntity.getManufactory()); BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectMainThrSys(); String mainSys = basicThirdSysEntity.getThirdId(); @@ -120,11 +121,12 @@ public class BasicUpdateProductService { } UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectUpteaByAll(udiRelevanceEntity1.getUuid(), udiRelevanceEntity1.getMainId()); if (udiRelevanceEntity == null) { + udiRelevanceEntity1.setId(gennerOrderUtils.getRelId() + ""); udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1); } else { errMsg = errMsg + "产品编码:" + udiRelevanceEntity1.getMainId() + "已存在!;"; } - udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1); +// udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1); } } } @@ -169,6 +171,7 @@ public class BasicUpdateProductService { udiRelevanceEntity1.setUuid(udiInfoEntity.getUuid()); udiRelevanceEntity1.setThirdName(thrProductsEntity.getName()); udiRelevanceEntity1.setUpdateTime(DateUtil.getDateTime()); + udiRelevanceEntity1.setPrice(thrProductsEntity.getPrice()); udiRelevanceEntity1.setSupName(thrProductsEntity.getSupName()); udiRelevanceEntity1.setManufactory(udiInfoEntity.getManufactory()); @@ -192,9 +195,10 @@ public class BasicUpdateProductService { } UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectUpteaByAll(udiRelevanceEntity1.getUuid(), udiRelevanceEntity1.getMainId()); if (udiRelevanceEntity == null) { + udiRelevanceEntity1.setId(gennerOrderUtils.getRelId() + ""); udiRelevanceService.insertUdiRelevanceignore(udiRelevanceEntity1); } else { - errMsg = errMsg + "产品编码:" + udiRelevanceEntity1.getMainId() + "已存在,将直接选入!;"; + errMsg = errMsg + "产品编码:" + udiRelevanceEntity1.getMainId() + "已存在,将直接选入!"; } UdiRelevanceEntity temp = udiRelevanceService.selectUpteaByAll(udiRelevanceEntity1.getUuid(), udiRelevanceEntity1.getMainId()); rlIds.add(temp.getId()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/CompanyProductsRelService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/CompanyProductsRelService.java index aa1b16c..e0e9eef 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/CompanyProductsRelService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/CompanyProductsRelService.java @@ -1,5 +1,6 @@ package com.glxp.sale.admin.thread; +import com.glxp.sale.admin.entity.basic.UdiRelevanceEntity; import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity; import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest; import com.glxp.sale.admin.req.basic.UdiInfoExportRequest; @@ -29,6 +30,9 @@ public class CompanyProductsRelService { List rlIdS = udiInfoExportRequest.getRlIds(); for (String uuid : rlIdS) { CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity(); + UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(uuid); + if (udiRelevanceEntity != null) + companyProductRelevanceEntity.setPrice(udiRelevanceEntity.getPrice()); companyProductRelevanceEntity.setCreate_time(new Date()); companyProductRelevanceEntity.setUpdate_time(new Date()); companyProductRelevanceEntity.setAuditStatus("3"); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java index b6d7840..67e79e0 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService.java @@ -807,14 +807,17 @@ public class InvProductsTrService { orderEntity, WarehouseEntity warehouseEntity) { InvProductEntity invProductEntity = new InvProductEntity(); invProductEntity.setRelIdFk(relId); - invProductEntity.setBatchNo(erpOrderEntity.getBatchNo()); + if (StrUtil.isNotEmpty(erpOrderEntity.getBatchNo())) { + invProductEntity.setBatchNo(erpOrderEntity.getBatchNo()); + } else + invProductEntity.setBatchNo(null); invProductEntity.setCustomerId(orderEntity.getCustomerId()); invProductEntity.setExpireDate(erpOrderEntity.getExpireDate()); invProductEntity.setProductionDate(erpOrderEntity.getProductDate()); invProductEntity.setGgxh(erpOrderEntity.getPackSpec()); invProductEntity.setSupId(warehouseEntity.getSupId()); invProductEntity.setNameCode(erpOrderEntity.getNameCode()); - invProductEntity.setPrice(erpOrderEntity.getPrice()+""); + invProductEntity.setPrice(erpOrderEntity.getPrice() + ""); invProductEntity.setProductsName(erpOrderEntity.getCoName()); invProductEntity.setYlqxzcrbarmc(erpOrderEntity.getProductCompany()); invProductEntity.setZczbhhzbapzbh(erpOrderEntity.getAuthCode()); @@ -854,7 +857,10 @@ public class InvProductsTrService { warehouseEntity.setCode(code); } invProductDetailEntity.setCode(code); - invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo()); + if (StrUtil.isEmpty(warehouseEntity.getBatchNo())) { + invProductDetailEntity.setBatchNo(null); + } else + invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo()); invProductDetailEntity.setProductionDate(warehouseEntity.getProduceDate()); invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate()); invProductDetailEntity.setAction(warehouseEntity.getAction()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService_back.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService_back.java index b493b0b..9534611 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService_back.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/InvProductsTrService_back.java @@ -1,5 +1,6 @@ package com.glxp.sale.admin.thread; +import cn.hutool.core.util.StrUtil; import com.glxp.sale.admin.constant.ConstantStatus; import com.glxp.sale.admin.constant.ConstantType; import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity; @@ -768,7 +769,10 @@ public class InvProductsTrService_back { InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); invProductDetailEntity.setProductIdFk(erpOrderEntity.getGoodsid() + ""); invProductDetailEntity.setCode(warehouseEntity.getCode()); - invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo()); + if (StrUtil.isEmpty(warehouseEntity.getBatchNo())) { + invProductDetailEntity.setBatchNo(null); + } else + invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo()); invProductDetailEntity.setProductionDate(warehouseEntity.getProduceDate()); invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate()); invProductDetailEntity.setAction(warehouseEntity.getAction()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java index b5d640e..1503a1c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutService.java @@ -823,6 +823,10 @@ public class IoTransInoutService { orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); orderEntity.setUpdateTime(new Date()); orderService.updateOrder(orderEntity); + + if (stockOrderEntity.getStatus().equals(ConstantStatus.SORDER_DELIVER)) { + invProductsTrService.genInvProducts(orderEntity.getId()); + } } else { orderEntity.setRemark("该产品DI绑定多个产品ID,请在扫码单据详情绑定对应产品ID"); orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL); @@ -891,7 +895,7 @@ public class IoTransInoutService { } } else { stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER); - invProductsTrService.genInvProducts(orderEntity.getId()); +// invProductsTrService.genInvProducts(orderEntity.getId()); } stockOrderEntity.setSupplementNo(orderEntity.getSupplementNo()); stockOrderEntity.setCorpName(orderEntity.getFromCorp()); diff --git a/api-admin/src/main/resources/application-pro.properties b/api-admin/src/main/resources/application-pro.properties index 543329b..db812f2 100644 --- a/api-admin/src/main/resources/application-pro.properties +++ b/api-admin/src/main/resources/application-pro.properties @@ -36,8 +36,8 @@ logging.file=D:/glxpdata/udiwms/udiwms.log file_path=D:/glxpdata/udiwms #UDI\u6570\u636E\u4E0B\u8F7D UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df -#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test -UDI_SERVER_URL=http://127.0.0.1:9994 +UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test +#UDI_SERVER_URL=http://127.0.0.1:9994 #UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server #UCLOD\u670D\u52A1 #UCLOD_SERVER_URL=http://127.0.0.1:9997 diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BasicExportDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BasicExportDao.xml index a01f5c5..842a3c7 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BasicExportDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BasicExportDao.xml @@ -22,8 +22,8 @@ and scheduleType = #{scheduleType} - + order by updateTime desc @@ -55,6 +55,7 @@ startTime=#{startTime}, endTime=#{endTime}, remark=#{remark}, + WHERE id = #{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml index feaab14..5758475 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml @@ -17,12 +17,12 @@ parameterType="com.glxp.sale.admin.entity.basic.BussinessChangeTypeEntity"> insert INTO basic_bustype_pre - (action, scAction, `index`, remark, beforeTime,intro,changeType) + (action, scAction, `index`, remark, beforeTime, intro, changeType) values (#{action}, #{scAction}, #{index}, #{remark}, - #{beforeTime},#{intro},#{changeType}) + #{beforeTime}, #{intro}, #{changeType}) @@ -54,6 +54,11 @@ + + DELETE + FROM basic_bustype_pre + WHERE `action` = #{action} + diff --git a/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml b/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml index 72c77a4..1bb1ffa 100644 --- a/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrProductsDao.xml @@ -13,6 +13,12 @@ AND code LIKE concat('%',#{code},'%') + + AND sptm LIKE concat('%',#{sptm},'%') + + + AND ybbm LIKE concat('%',#{ybbm},'%') + AND registerNo LIKE concat('%',#{registerNo},'%') @@ -22,22 +28,22 @@ AND spec LIKE concat('%',#{spec},'%') - - AND supName LIKE concat('%',#{supName},'%') - or code LIKE concat('%',#{unionCode},'%') or sptm LIKE concat('%',#{unionCode},'%') or ybbm LIKE concat('%',#{unionCode},'%') - AND thirdSysFk = #{thirdSysFk} + + AND supName = #{supName} + = DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]> + - ORDER BY updateTime DESC + @@ -84,13 +90,10 @@ replace INTO thr_products - ( - code,name,measname,spec,registerNo,manufactory, - cplb,flbm,qxlb,ybbm,sptm,tyshxydm,zczbhhzbapzbh,ylqxzcrbarmc,ylqxzcrbarywmc,cpms, - thirdSysFk,updateTime,supName - ) - values - ( + (code, `name`, measname, spec, registerNo, manufactory, + cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, + thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,price) + values ( #{code}, #{name}, #{measname}, @@ -109,32 +112,38 @@ #{cpms}, #{thirdSysFk}, #{updateTime}, - #{supName} + #{supName}, + #{model}, + #{standard}, + #{qtbm}, + #{zczyxqz}, + #{remark}, + #{remark1}, + #{remark2}, + #{remark3},#{price} ) replace INTO thr_products - ( - code,name,measname,spec,registerNo,manufactory, - cplb,flbm,qxlb,ybbm,sptm,tyshxydm,zczbhhzbapzbh,ylqxzcrbarmc,ylqxzcrbarywmc,cpms, - thirdSysFk,updateTime,supName - ) + (code, `name`, measname, spec, registerNo, manufactory, + cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, + thirdSysFk, updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, remark3,price) values - ( - #{item.code}, + (#{item.code}, #{item.name}, #{item.measname}, #{item.spec}, #{item.registerNo}, #{item.manufactory}, - #{item.cplb}, #{item.flbm}, #{item.qxlb}, #{item.ybbm},#{item.sptm}, - #{item.tyshxydm}, #{item.zczbhhzbapzbh}, #{item.ylqxzcrbarmc}, #{item.ylqxzcrbarywmc},#{item.cpms}, - #{item.thirdSysFk},#{item.updateTime},#{item.supName} - ) + #{item.cplb}, #{item.flbm}, #{item.qxlb}, #{item.ybbm}, #{item.sptm}, + #{item.tyshxydm}, #{item.zczbhhzbapzbh}, #{item.ylqxzcrbarmc}, #{item.ylqxzcrbarywmc}, #{item.cpms}, + #{item.thirdSysFk}, #{item.updateTime}, #{item.supName}, #{item.model}, #{item.standard},#{item.qtbm}, + #{item.zczyxqz}, + #{item.remark}, #{item.remark1}, #{item.remark2}, #{item.remark3},#{item.price}) @@ -166,6 +175,14 @@ thirdSysFk=#{thirdSysFk}, updateTime=#{updateTime}, supName=#{supName}, + model=#{model}, + standard=#{standard}, + zczyxqz=#{zczyxqz}, + remark=#{remark}, + remark1=#{remark1}, + remark2=#{remark2}, + remark3=#{remark3}, + price=#{price}, WHERE id = #{id} @@ -176,31 +193,11 @@ FROM thr_products - - replace INTO thr_products - (id, code, name, measname, spec, registerNo, manufactory, - cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, - thirdSysFk, updateTime, supName) - values - - (#{item.id}, - #{item.code}, - #{item.name}, - #{item.measname}, - #{item.spec}, - #{item.registerNo}, - #{item.manufactory}, - #{item.cplb}, #{item.flbm}, #{item.qxlb}, #{item.ybbm}, #{item.sptm}, - #{item.tyshxydm}, #{item.zczbhhzbapzbh}, #{item.ylqxzcrbarmc}, #{item.ylqxzcrbarywmc}, #{item.cpms}, - #{item.thirdSysFk}, #{item.updateTime}, #{item.supName}) - - - replace into thr_products (id, code, name, measname, spec, registerNo, manufactory, thirdSysFk, cplb, flbm, qxlb, ybbm, sptm, tyshxydm, zczbhhzbapzbh, ylqxzcrbarmc, ylqxzcrbarywmc, cpms, - updateTime, supName) VALUES + updateTime, supName, model, standard, qtbm, zczyxqz, remark, remark1, remark2, + remark3,price) VALUES (#{item.id}, #{item.code}, @@ -221,7 +218,14 @@ #{item.ylqxzcrbarywmc}, #{item.cpms}, #{item.updateTime}, - #{item.supName}) + #{item.supName}, + #{item.model}, + #{item.standard}, + #{item.zczyxqz}, + #{item.remark}, + #{item.remark1}, + #{item.remark2}, + #{item.remark3},#{item.price}) \ No newline at end of file