From f3dd6cce03e246c9aa4240b28b812bc5b9979ce9 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Tue, 31 May 2022 15:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E8=A1=A1=E8=A1=A5=E5=8D=95=EF=BC=8C?= =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=9C=89=E9=87=8D?= =?UTF-8?q?=E5=A4=A7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/ConnectTestController.java | 18 ++ .../basic/EntrustReceController.java | 98 ++++++++ .../basic/SpsSyncDownloadService.java | 29 +-- .../basic/SpsSyncExportStatusController.java | 35 ++- .../basic/UdiRelevanceController.java | 7 +- .../controller/info/DeviceKeyController.java | 5 - .../controller/inout/OrderController.java | 27 +- .../inout/StockOrderController.java | 2 +- .../controller/inout/WareHouseController.java | 238 +++++++++++++++++- .../inout/utils/CheckOrderUtils.java | 2 + .../controller/inout/utils/InoutUtils.java | 29 ++- .../inventory/InvPreInProductsController.java | 5 +- .../inventory/InvProductsController.java | 8 - .../sale/admin/dao/basic/EntrustReceDao.java | 24 ++ .../admin/entity/basic/EntrustReceEntity.java | 22 ++ .../admin/entity/basic/UdiInfoEntity.java | 3 + .../entity/basic/UdiRelevanceEntity.java | 2 - .../sale/admin/req/auth/ConnectRequest.java | 7 + .../req/basic/BasicExportStatusRequest.java | 1 + .../admin/req/inout/AddEnterCodeRequest.java | 9 + .../admin/req/inout/AddEnterCodeResult.java | 8 + .../sale/admin/req/inout/AddOrderRequest.java | 5 + .../req/inout/UpdateExportStatusRequest.java | 2 +- .../CompanyProductRelevanceResponse.java | 3 + .../admin/res/basic/EntrustReceRespose.java | 23 ++ .../admin/res/basic/UdiRelevanceResponse.java | 3 + .../service/basic/EntrustReceService.java | 24 ++ .../basic/impl/EntrustReceServiceImpl.java | 62 +++++ .../receipt/impl/ProductInfoServiceImpl.java | 8 +- .../sale/admin/thread/AsyncDiDlHelper.java | 1 + .../admin/thread/InvProductsTrService.java | 20 +- .../admin/thread/IoTransInoutService.java | 9 +- .../glxp/sale/admin/util/FilterUdiUtils.java | 2 +- .../sale/admin/util/GennerOrderUtils.java | 2 +- .../mybatis/mapper/basic/EntrustReceDao.xml | 94 +++++++ .../mybatis/mapper/basic/UdiInfoDao.xml | 19 +- .../mybatis/mapper/basic/UdiRelevanceDao.xml | 27 +- .../info/CompanyProductRelevanceDao.xml | 4 +- .../mybatis/mapper/inout/CodesTempDao.xml | 6 + .../mybatis/mapper/inout/StockOrderDetail.xml | 2 +- .../inout/WarehouseBussinessTypeDao.xml | 7 + .../inventory/InvPreInProductDetailDao.xml | 6 - .../inventory/InvPreProductDetailDao.xml | 6 - .../mapper/inventory/InvProductDetailDao.xml | 9 - 44 files changed, 787 insertions(+), 136 deletions(-) create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/controller/auth/ConnectTestController.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/controller/basic/EntrustReceController.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/dao/basic/EntrustReceDao.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/entity/basic/EntrustReceEntity.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/req/auth/ConnectRequest.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddEnterCodeRequest.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddEnterCodeResult.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/res/basic/EntrustReceRespose.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/basic/EntrustReceService.java create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/EntrustReceServiceImpl.java create mode 100644 api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/ConnectTestController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/ConnectTestController.java new file mode 100644 index 0000000..cf7513a --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/auth/ConnectTestController.java @@ -0,0 +1,18 @@ +package com.glxp.sale.admin.controller.auth; + +import com.glxp.sale.admin.req.auth.ConnectRequest; +import com.glxp.sale.common.res.BaseResponse; +import com.glxp.sale.common.util.ResultVOUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class ConnectTestController { + + @GetMapping("/udiwms/auth/device/connect") + public BaseResponse index(ConnectRequest connequest) { + return ResultVOUtils.success("连接UDI自助平台成功!"); + } + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/EntrustReceController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/EntrustReceController.java new file mode 100644 index 0000000..429079c --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/EntrustReceController.java @@ -0,0 +1,98 @@ +package com.glxp.sale.admin.controller.basic; +//委托验收 + +import cn.hutool.core.collection.CollUtil; +import com.github.pagehelper.PageInfo; +import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; +import com.glxp.sale.admin.entity.basic.EntrustReceEntity; +import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest; +import com.glxp.sale.admin.req.basic.BussinessTypeFilterRequest; +import com.glxp.sale.admin.req.info.DeleteRequest; +import com.glxp.sale.admin.res.PageSimpleResponse; +import com.glxp.sale.admin.res.basic.EntrustReceRespose; +import com.glxp.sale.admin.service.auth.CustomerService; +import com.glxp.sale.admin.service.basic.BussinessTypeService; +import com.glxp.sale.admin.service.basic.EntrustReceService; +import com.glxp.sale.common.res.BaseResponse; +import com.glxp.sale.common.util.ResultVOUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +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.Date; +import java.util.List; + +@RestController +public class EntrustReceController { + + + @Resource + EntrustReceService entrustReceService; + @Resource + CustomerService customerService; + @Resource + private BussinessTypeService bussinessTypeService; + + @GetMapping("/spms/entrust/rece/filter") + public BaseResponse getEntrustRece(BasicEntrustRecRequest basicExportStatusRequest) { + List entrustReceEntities = entrustReceService.filterJoinEntrustRec(basicExportStatusRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(entrustReceEntities); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(entrustReceEntities); + return ResultVOUtils.success(pageSimpleResponse); + } + + @GetMapping("/spms/entrust/rece/filterAllNoUse") + public BaseResponse filterAllNoUse(BasicEntrustRecRequest basicExportStatusRequest) { + Integer uerId = customerService.getUserId(); + BussinessTypeFilterRequest bussinessTypeFilterRequest = new BussinessTypeFilterRequest(); + bussinessTypeFilterRequest.setUserId(uerId); + List bussinessTypeEntities = bussinessTypeService.filterAllByUser(bussinessTypeFilterRequest); + return ResultVOUtils.success(bussinessTypeEntities); + + } + + + @PostMapping("/spms/entrust/rece/add") + public BaseResponse aadEntrustRece(@RequestBody EntrustReceEntity entrustReceEntity) { + Integer userId = customerService.getUserId(); + entrustReceEntity.setUserId(userId + ""); + entrustReceEntity.setUpdateTime(new Date()); + boolean b = entrustReceService.insertEntrustRec(entrustReceEntity); + if (b) { + return ResultVOUtils.success("添加成功!"); + } else { + return ResultVOUtils.error(500, "添加失败!"); + } + + } + + + @PostMapping("/spms/entrust/rece/update") + public BaseResponse updateEntrustRece(@RequestBody EntrustReceEntity entrustReceEntity) { + boolean b = entrustReceService.updateEntrustRec(entrustReceEntity); + if (b) { + return ResultVOUtils.success("添加成功!"); + } else { + return ResultVOUtils.error(500, "添加失败!"); + } + + } + + @PostMapping("/spms/entrust/rece/delete") + public BaseResponse deleteByStatus(@RequestBody DeleteRequest deleteRequest) { + + boolean b = entrustReceService.deleteById(deleteRequest.getId()); + if (b) + return ResultVOUtils.success("删除成功!"); + else + return ResultVOUtils.error(500, "删除失败!"); + } + + +} 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 5bd8025..3ff1fde 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 @@ -76,7 +76,7 @@ public class SpsSyncDownloadService { if (syncDataSetEntity.isBasicInv()) { //仓库字典 FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); - filterInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + BeanUtils.copyProperties(spsSyncDataRequest, filterInvWarehouseRequest); List invWarehouseEntities = invWarehouseService.filterGroupInvWarehouse(filterInvWarehouseRequest); syncDataResponse.setInvWarehouseEntities(invWarehouseEntities); } @@ -84,7 +84,7 @@ public class SpsSyncDownloadService { if (syncDataSetEntity.isBasicProducts()) { //耗材字典 FilterUdiInfoRequest filterUdiInfoRequest = new FilterUdiInfoRequest(); - filterUdiInfoRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + BeanUtils.copyProperties(spsSyncDataRequest, filterUdiInfoRequest); List udiRelevanceEntities = udiRelevanceService.filterUdiEntity(filterUdiInfoRequest); List results = new ArrayList<>(); udiRelevanceEntities.forEach( @@ -109,7 +109,7 @@ public class SpsSyncDownloadService { if (syncDataSetEntity.isBasicCorp()) { //往来单位字典 BasicUnitMaintainFilterRequest basicUnitMaintainFilterRequest = new BasicUnitMaintainFilterRequest(); - basicUnitMaintainFilterRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + BeanUtils.copyProperties(spsSyncDataRequest, basicUnitMaintainFilterRequest); List basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest); syncDataResponse.setBasicUnitMaintainEntities(basicUnitMaintainEntities); } @@ -117,7 +117,7 @@ public class SpsSyncDownloadService { if (syncDataSetEntity.isBasicThirdInv()) { //第三方仓库信息 FilterThrInvWarehouseRequest filterThrInvWarehouseRequest = new FilterThrInvWarehouseRequest(); - filterThrInvWarehouseRequest.setLastUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + BeanUtils.copyProperties(spsSyncDataRequest, filterThrInvWarehouseRequest); List thrInvWarehouseEntities = thrInvWarehouseService.filterThrInvWarehouse(filterThrInvWarehouseRequest); syncDataResponse.setThrInvWarehouseEntities(thrInvWarehouseEntities); } @@ -168,7 +168,6 @@ public class SpsSyncDownloadService { BussinessOriginTypeService bussinessOriginTypeService; - @GetMapping("sps/sync/busType") public BaseResponse findBusType(SpsSyncDataRequest spsSyncDataRequest) { SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); @@ -212,27 +211,12 @@ public class SpsSyncDownloadService { OrderDetailService orderDetailService; - @GetMapping("sps/sync/order") public BaseResponse findOrder(SpsSyncDataRequest spsSyncDataRequest) { SpsSyncOrderResponse syncOrderResponse = new SpsSyncOrderResponse(); SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); if (syncDataSetEntity.isOrderScanFinish()) { List orderEntities = new ArrayList<>(); - if (syncDataSetEntity.isOrderScanFinish()) { - OrderFilterRequest orderFilterRequest = new OrderFilterRequest(); - BeanUtils.copyProperties(spsSyncDataRequest, orderFilterRequest); - orderFilterRequest.setFilterActions(syncDataSetEntity.getBusTypes()); - 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(); @@ -308,16 +292,15 @@ public class SpsSyncDownloadService { UdiCompanyService udiCompanyService; //udi同步数据 - @GetMapping("sps/sync/syncUdis") public BaseResponse syncUdi(SpsSyncDataRequest spsSyncDataRequest) { SpSyncUdiResponse spSyncUdiResponse = new SpSyncUdiResponse(); SyncDataSetResponse syncDataSetEntity = syncDataSetService.selectSet(); if (syncDataSetEntity.isDbDiProducts()) { ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); - productInfoFilterRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + BeanUtils.copyProperties(spsSyncDataRequest, productInfoFilterRequest); List productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest); UdiCompanyRequest udiCompanyRequest = new UdiCompanyRequest(); - udiCompanyRequest.setUpdateTime(spsSyncDataRequest.getLastUpdateTime()); + BeanUtils.copyProperties(spsSyncDataRequest, udiCompanyRequest); List udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest); spSyncUdiResponse.setUdiCompanyEntities(udiCompanyEntities); spSyncUdiResponse.setProductInfoEntityList(productInfoEntityList); 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 ead988a..a65240a 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 @@ -1,6 +1,7 @@ package com.glxp.sale.admin.controller.basic; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.github.pagehelper.PageInfo; @@ -114,9 +115,13 @@ public class SpsSyncExportStatusController { //自动创建要求被下载已完成单据任务 BasicExportStatusEntity basicExportStatusEntity1 = basicExportService.findByData(ConstantStatus.SYNC_SCAN_ORDER, 0); if (basicExportStatusEntity1 == null) { - BaseResponse baseResponse = spsSyncDownloadService.findOrder(getRequest(ConstantStatus.SYNC_SCAN_ORDER)); + BaseResponse baseResponse = spsSyncDownloadService.findOrder(getRequest(ConstantStatus.SYNC_SCAN_ORDER, basicExportStatusRequest.getSyncTime())); SpsSyncOrderResponse syncOrderResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(syncOrderResponse.getOrderEntities())) { + BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByType(ConstantStatus.SYNC_SCAN_ORDER); + if (basicExportStatusTimeEntity != null) { + basicExportStatusTimeEntity.setLastUpdateTime(basicExportStatusRequest.getSyncTime()); + } BasicExportStatusEntity orderStatusEntity = new BasicExportStatusEntity(); orderStatusEntity.setId(CustomUtil.getId()); orderStatusEntity.setIdDatas(ConstantStatus.SYNC_SCAN_ORDER); @@ -136,11 +141,15 @@ public class SpsSyncExportStatusController { //自动创建要求被下载单据类型任务 BasicExportStatusEntity basicExportStatusEntity2 = basicExportService.findByData(ConstantStatus.SYNC_BUS_TYPE, 0); if (basicExportStatusEntity2 == null) { - BaseResponse baseResponse = spsSyncDownloadService.findBusType(getRequest(ConstantStatus.SYNC_BUS_TYPE)); + BaseResponse baseResponse = spsSyncDownloadService.findBusType(getRequest(ConstantStatus.SYNC_BUS_TYPE, basicExportStatusRequest.getSyncTime())); SpsSyncBusResponse spsSyncBusResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessLocalTypeEntities()) || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessOriginTypeEntities()) || CollUtil.isNotEmpty(spsSyncBusResponse.getBussinessTypeEntities())) { + BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByType(ConstantStatus.SYNC_BUS_TYPE); + if (basicExportStatusTimeEntity != null) { + basicExportStatusTimeEntity.setLastUpdateTime(basicExportStatusRequest.getSyncTime()); + } BasicExportStatusEntity busTypetatusEntity = new BasicExportStatusEntity(); busTypetatusEntity.setId(CustomUtil.getId()); busTypetatusEntity.setIdDatas(ConstantStatus.SYNC_BUS_TYPE); @@ -162,7 +171,7 @@ public class SpsSyncExportStatusController { //自动创建要求被下载基础信息任务 BasicExportStatusEntity basicExportStatusEntity3 = basicExportService.findByData(ConstantStatus.SYNC_BASIC_DATA, 0); if (basicExportStatusEntity3 == null) { - BaseResponse baseResponse = spsSyncDownloadService.findProductInfo(getRequest(ConstantStatus.SYNC_BASIC_DATA)); + BaseResponse baseResponse = spsSyncDownloadService.findProductInfo(getRequest(ConstantStatus.SYNC_BASIC_DATA, basicExportStatusRequest.getSyncTime())); SpsSyncDataResponse spsSyncDataResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(spsSyncDataResponse.getThrOrderDetailEntities()) || CollUtil.isNotEmpty(spsSyncDataResponse.getThrOrderEntities()) @@ -175,6 +184,10 @@ public class SpsSyncExportStatusController { || CollUtil.isNotEmpty(spsSyncDataResponse.getThrProductsEntities()) || CollUtil.isNotEmpty(spsSyncDataResponse.getThrInvWarehouseEntities()) ) { + BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByType(ConstantStatus.SYNC_BASIC_DATA); + if (basicExportStatusTimeEntity != null) { + basicExportStatusTimeEntity.setLastUpdateTime(basicExportStatusRequest.getSyncTime()); + } BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); basicExportStatusEntity.setId(CustomUtil.getId()); basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_BASIC_DATA); @@ -195,10 +208,14 @@ public class SpsSyncExportStatusController { //自动创建要求被下载同步库DI信息 BasicExportStatusEntity basicExportStatusEntity4 = basicExportService.findByData(ConstantStatus.SYNC_DI_PRODUCTS, 0); if (basicExportStatusEntity4 == null) { - BaseResponse baseResponse = spsSyncDownloadService.syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS)); + BaseResponse baseResponse = spsSyncDownloadService.syncUdi(getRequest(ConstantStatus.SYNC_DI_PRODUCTS, basicExportStatusRequest.getSyncTime())); SpSyncUdiResponse spSyncUdiResponse = baseResponse.getData(); if (CollUtil.isNotEmpty(spSyncUdiResponse.getProductInfoEntityList()) || CollUtil.isNotEmpty(spSyncUdiResponse.getUdiCompanyEntities())) { + BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByType(ConstantStatus.SYNC_DI_PRODUCTS); + if (basicExportStatusTimeEntity != null) { + basicExportStatusTimeEntity.setLastUpdateTime(basicExportStatusRequest.getSyncTime()); + } BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); basicExportStatusEntity.setId(CustomUtil.getId()); basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS); @@ -220,12 +237,16 @@ public class SpsSyncExportStatusController { } - public SpsSyncDataRequest getRequest(String type) { + public SpsSyncDataRequest getRequest(String type, String syncTime) { SpsSyncDataRequest spsSyncDataRequest = new SpsSyncDataRequest(); spsSyncDataRequest.setPage(1); spsSyncDataRequest.setLimit(1); - BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByType(type); - spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime()); + if (StrUtil.isEmpty(syncTime)) { + BasicExportStatusTimeEntity basicExportStatusTimeEntity = basicExportTimeService.findByType(type); + spsSyncDataRequest.setLastUpdateTime(basicExportStatusTimeEntity.getLastUpdateTime()); + } else { + spsSyncDataRequest.setLastUpdateTime(syncTime); + } return spsSyncDataRequest; } } \ No newline at end of file diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java index f260332..c654065 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiRelevanceController.java @@ -262,11 +262,13 @@ public class UdiRelevanceController { @AuthRuleAnnotation("") @PostMapping("/udi/udirel/update") - public BaseResponse updateRelevanceEntity(@RequestBody UdiRelevanceEntity udiRelevanceEntity, BindingResult bindingResult) { + public BaseResponse updateRelevanceEntity(@RequestBody UdiRelevanceResponse udiRelevanceResponse, BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } + UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity(); + BeanUtils.copyProperties(udiRelevanceResponse, udiRelevanceEntity); udiRelevanceEntity.setUpdateTime(DateUtil.getDateTime()); udiRelevanceService.updateUdiRelevance(udiRelevanceEntity); long customerId = customerService.getCustomerId(); @@ -278,6 +280,9 @@ public class UdiRelevanceController { } } + UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); + BeanUtils.copyProperties(udiRelevanceResponse, udiInfoEntity); + udiInfoService.updateUdiInfo(udiInfoEntity); return ResultVOUtils.success("更新成功"); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/info/DeviceKeyController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/info/DeviceKeyController.java index 85f4fee..ae204bb 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/info/DeviceKeyController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/info/DeviceKeyController.java @@ -1,6 +1,5 @@ package com.glxp.sale.admin.controller.info; -import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.entity.info.DeviceKeyEntity; import com.glxp.sale.admin.req.info.FilterDeviceKeyRequest; @@ -12,9 +11,6 @@ import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.mail.SimpleMailMessage; -import org.springframework.mail.javamail.JavaMailSender; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -22,7 +18,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import javax.servlet.http.HttpSession; import javax.validation.Valid; import java.security.MessageDigest; import java.util.List; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java index db14e1c..3748e4d 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/OrderController.java @@ -273,18 +273,13 @@ public class OrderController { public BaseResponse updateStatus(@RequestBody UpdateExportStatusRequest updateExportStatusRequest, BindingResult bindingResult) { - if (bindingResult.hasErrors()) { - return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); - } AuthAdmin authAdmin = customerService.getUserBean(); OrderEntity orderEntity = orderService.findById(updateExportStatusRequest.getOrderId()); orderEntity.setReceiveStatus(1); long customerId = customerService.getCustomerId(); - if (customerId == 110) { orderEntity.setReviewUser(authAdmin.getId().intValue()); } - orderEntity.setUpdateTime(new Date()); orderService.updateOrder(orderEntity); List erpIds = DataTransUtil.strToErpList(orderEntity.getErpFk()); @@ -298,7 +293,6 @@ public class OrderController { stockOrderEntity.setReviewUser(authAdmin.getId().intValue()); } stockOrderService.updateById(stockOrderEntity); - } } else { StockOrderFilterRequest stockOrderFilterRequest = new StockOrderFilterRequest(); @@ -313,14 +307,31 @@ public class OrderController { stockOrderService.updateById(stockOrderEntity); } - } } invProductsTrService.genInvProducts(orderEntity.getId()); - return ResultVOUtils.success("更新成功"); } + //前端直接验收完成 + @AuthRuleAnnotation("") + @PostMapping("/spms/inout/order/web/updateStatus") + public BaseResponse webUpdateStatus(@RequestBody UpdateExportStatusRequest updateExportStatusRequest, + BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + + StockOrderEntity temp = stockOrderService.findByBillNo(updateExportStatusRequest.getStockOrderId()); + if (temp == null) { + return ResultVOUtils.error(500, "未找到该业务单据"); + } + updateExportStatusRequest.setOrderId(temp.getOrderIdFk()); + return updateStatus(updateExportStatusRequest, null); + } + + @AuthRuleAnnotation("") @GetMapping("/udiwms/inout/order/filterCode") public BaseResponse filterOrderByCode(OrderFilterByCodeRequest orderFilterByCodeRequest, diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java index 91571a8..c29f343 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java @@ -421,7 +421,7 @@ public class StockOrderController { } ); - + originOrder.setUpdateTime(new Date()); orderService.insertOrder(originOrder); codesTempService.insertCodesTemp(supplementCodes); 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 f6d83e3..da45d65 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 @@ -13,16 +13,17 @@ import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity; import com.glxp.sale.admin.entity.basic.BussinessTypeEntity; import com.glxp.sale.admin.entity.basic.UdiInfoEntity; import com.glxp.sale.admin.entity.info.CompanyEntity; -import com.glxp.sale.admin.entity.inout.OrderEntity; -import com.glxp.sale.admin.entity.inout.StockOrderEntity; -import com.glxp.sale.admin.entity.inout.WarehouseEntity; -import com.glxp.sale.admin.entity.inout.WarehouseUserEntity; +import com.glxp.sale.admin.entity.info.CompanyProductRelevanceEntity; +import com.glxp.sale.admin.entity.inout.*; import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.exception.JsonException; import com.glxp.sale.admin.req.basic.CompanyProductRelevanceRequest; +import com.glxp.sale.admin.req.basic.FilterUdiInfoRequest; +import com.glxp.sale.admin.req.info.FilterCompanyProductRelevanceRequest; import com.glxp.sale.admin.req.inout.*; +import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; import com.glxp.sale.admin.res.PageSimpleResponse; import com.glxp.sale.admin.res.basic.BussinessTypResponse; import com.glxp.sale.admin.res.basic.CompanyProductRelevanceResponse; @@ -45,6 +46,8 @@ import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; @@ -54,10 +57,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @RestController @@ -93,6 +93,7 @@ public class WareHouseController { CompanyProductRelevanceService companyProductRelevanceService; @Resource SystemParamConfigService systemParamConfigService; + Logger logger = LoggerFactory.getLogger(StockOrderController.class); @Resource StockOrderService stockOrderService; @Resource @@ -280,6 +281,16 @@ public class WareHouseController { return ResultVOUtils.success(); } + + @AuthRuleAnnotation("") + @PostMapping("warehouse/inout/saveTempCode") + public BaseResponse saveCode(@RequestBody WarehouseEntity warehouseEntity) { + boolean b = codesTempService.update(warehouseEntity); + if (b) + return ResultVOUtils.success("修改成功"); + else return ResultVOUtils.error(500, "修改失败!"); + } + @AuthRuleAnnotation("") @GetMapping("warehouse/inout/deleteCodesTempById") public BaseResponse deleteCodesTempById(@RequestParam("id") Long id) { @@ -336,6 +347,132 @@ public class WareHouseController { @Resource InvPreInProductDetailService invPreInProductDetailService; + + @AuthRuleAnnotation("") + @PostMapping("warehouse/inout/enterCode") + public BaseResponse addEndterCode(@RequestBody AddEnterCodeRequest addEnterCodeRequest, BindingResult bindingResult) { + + if (StrUtil.isEmpty(addEnterCodeRequest.getCode())) { + return ResultVOUtils.error(500, "条码不能为空!"); + } + String code = ""; + String originCode = addEnterCodeRequest.getOriginCode(); + if (originCode == null) + originCode = ""; + code = originCode + addEnterCodeRequest.getCode(); + String newCode = addEnterCodeRequest.getCode(); + //重复判断 + if (StrUtil.isNotEmpty(addEnterCodeRequest.getOriginCode())) { + String tempOriginCode = addEnterCodeRequest.getOriginCode(); + if (tempOriginCode.endsWith("\u001D")) { + tempOriginCode = tempOriginCode.replace("\u001D", ""); + } + UdiEntity originUdiEntity = FilterUdiUtils.getUdi(tempOriginCode); + if (StrUtil.isNotEmpty(newCode)) { + if (newCode.startsWith("10")) { + if (StrUtil.isNotEmpty(originUdiEntity.getBatchNo())) { + BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误"); + baseResponse.setData(originCode); + return baseResponse; + } + } else if (newCode.startsWith("17")) { + if (StrUtil.isNotEmpty(originUdiEntity.getExpireDate())) { + BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误"); + baseResponse.setData(originCode); + return baseResponse; + } + } else if (newCode.startsWith("11")) { + if (StrUtil.isNotEmpty(originUdiEntity.getProduceDate())) { + BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误"); + baseResponse.setData(originCode); + return baseResponse; + } + } else if (newCode.startsWith("21")) { + if (StrUtil.isNotEmpty(originUdiEntity.getSerialNo())) { + BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误"); + baseResponse.setData(originCode); + return baseResponse; + } +// else { +// return ResultVOUtils.success(code); +// } + } else { + BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误"); + baseResponse.setData(originCode); + return baseResponse; + } + + + } + } + + UdiEntity udiEntity = FilterUdiUtils.getUdi(code); + if (udiEntity == null) { + BaseResponse baseResponse = ResultVOUtils.error(501, "DI格式错误"); + baseResponse.setData(originCode); + return baseResponse; + } + + if (StrUtil.isNotEmpty(udiEntity.getBatchNo())) { + if (code.endsWith("10" + udiEntity.getBatchNo())) { + code = code + "\u001D"; + } + } + + UdiRelevanceResponse checkUdi = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); + if (checkUdi == null) { + return ResultVOUtils.error(500, "耗材字典不存在此产品!"); + } + boolean checkSuccess = true; + //校验条码完整性 + if (("是".equals(checkUdi.getScbssfbhph()) && StrUtil.isEmpty(udiEntity.getBatchNo()))) { + if (!checkUdi.isAllowNoBatch()) + checkSuccess = false; + } + if (("是".equals(checkUdi.getScbssfbhscrq()) && StrUtil.isEmpty(udiEntity.getProduceDate())) + ) { + if (!checkUdi.isAllowNoProduct()) + checkSuccess = false; + } + + if (("是".equals(checkUdi.getScbssfbhsxrq()) && StrUtil.isEmpty(udiEntity.getExpireDate())) + ) { + if (!checkUdi.isAllowNoExpire()) + checkSuccess = false; + } + if (("是".equals(checkUdi.getScbssfbhxlh()) && StrUtil.isEmpty(udiEntity.getSerialNo())) + ) { + checkSuccess = false; + } + if (StrUtil.isNotEmpty(udiEntity.getSerialNo()) && udiEntity.getSerialNo().length() > 20) { + checkSuccess = false; + return ResultVOUtils.error(504, "序列号超出20位!"); + } + if (StrUtil.isNotEmpty(udiEntity.getBatchNo()) && udiEntity.getBatchNo().length() > 20) { + checkSuccess = false; + return ResultVOUtils.error(504, "批次号超出20位!"); + } + if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) { + checkSuccess = false; + } + if (checkSuccess) { + if (code.endsWith("\u001D")) { + code = code.replace("\u001D", ""); + } + return ResultVOUtils.success(code); + } else { + if (newCode.startsWith("21")) { + BaseResponse baseResponse = ResultVOUtils.error(503, "当前条码未完成,是否继续添加?"); + baseResponse.setData(code); + return baseResponse; + } + } + BaseResponse baseResponse = ResultVOUtils.error(502, "校验未完成"); + baseResponse.setData(code); + return baseResponse; + } + + //网页端数据上传调用接口 @AuthRuleAnnotation("") @PostMapping("warehouse/inout/addOrderWeb") @@ -352,6 +489,20 @@ public class WareHouseController { if (udiEntity == null) return ResultVOUtils.error(500, "无效条码!"); + if (StrUtil.isNotEmpty(addOrderRequest.getBatchNo())) { + udiEntity.setBatchNo(addOrderRequest.getBatchNo()); + } + if (StrUtil.isNotEmpty(addOrderRequest.getProduceDate())) { + udiEntity.setProduceDate(addOrderRequest.getProduceDate()); + } + if (StrUtil.isNotEmpty(addOrderRequest.getExpireDate())) { + udiEntity.setExpireDate(addOrderRequest.getExpireDate()); + } + if (StrUtil.isNotEmpty(addOrderRequest.getSerialNo())) { + udiEntity.setSerialNo(addOrderRequest.getSerialNo()); + } + + if (StrUtil.isNotEmpty(udiEntity.getSerialNo()) && udiEntity.getSerialNo().length() > 20) { return ResultVOUtils.error(500, "无效条码!序列号超出最大范围"); } @@ -365,6 +516,9 @@ public class WareHouseController { if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) { return ResultVOUtils.error(500, "批次号不能为空!"); } + BaseResponse checkOriginCodeRes = checkOriginCode(udiEntity); + if (checkOriginCodeRes != null) + return checkOriginCodeRes; //过期提醒: SystemParamConfigEntity expireParamConfigEntity = systemParamConfigService.selectByParamKey("expire_date_tip"); @@ -417,8 +571,8 @@ public class WareHouseController { return ResultVOUtils.error(500, "超出预验收库存数量"); } } - } else { - if (invProductDetailEntity.getCount() < 1) { + }else { + if(invProductDetailEntity.getCount()<1){ return ResultVOUtils.error(500, "超出预验收库存数量"); } } @@ -585,7 +739,7 @@ public class WareHouseController { return null; } - + //校验产品ID唯一性 public BaseResponse checkRelId(BussinessTypeEntity bussinessTypeEntity, WarehouseEntity warehouseEntity) { String unitFk = null; @@ -615,6 +769,7 @@ public class WareHouseController { return null; } + //校验供应商唯一性 public BaseResponse checkSupId(BussinessTypeEntity bussinessTypeEntity, WarehouseEntity warehouseEntity) { String originSupId = ioTransInoutService.checkOriginExitSup(bussinessTypeEntity, warehouseEntity); if (originSupId != null) { @@ -643,6 +798,63 @@ public class WareHouseController { return null; } + //校验条码完整性 + public BaseResponse checkCode(WarehouseEntity warehouseEntity) { + //校验条码的完整性 + String errMsg = ""; + UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectGroupById(warehouseEntity.getRelId()); + if (StrUtil.isEmpty(warehouseEntity.getBatchNo()) && + "是".equals(udiRelevanceResponse.getScbssfbhph()) && !udiRelevanceResponse.isAllowNoBatch()) { + errMsg = errMsg + ",批次号"; + } + if (StrUtil.isEmpty(warehouseEntity.getProduceDate()) && + "是".equals(udiRelevanceResponse.getScbssfbhscrq()) && !udiRelevanceResponse.isAllowNoProduct()) { + errMsg = errMsg + ",生产日期"; + } + if (StrUtil.isEmpty(warehouseEntity.getExpireDate()) && + "是".equals(udiRelevanceResponse.getScbssfbhsxrq()) && !udiRelevanceResponse.isAllowNoExpire()) { + errMsg = errMsg + ",失效日期"; + } + if (StrUtil.isNotEmpty(errMsg)) { + BaseResponse baseResponse = ResultVOUtils.error(507, "请补齐" + errMsg.substring(1) + ""); + baseResponse.setData(warehouseEntity); + return baseResponse; + } + return null; + } + + public BaseResponse checkOriginCode(UdiEntity udiEntity) { + //校验条码的完整性 + String errMsg = ""; + UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); + + if (StrUtil.isEmpty(udiEntity.getBatchNo()) && + "是".equals(udiRelevanceResponse.getScbssfbhph()) && !udiRelevanceResponse.isAllowNoBatch()) { + errMsg = errMsg + ",批次号"; + } + if (StrUtil.isEmpty(udiEntity.getProduceDate()) && + "是".equals(udiRelevanceResponse.getScbssfbhscrq()) && !udiRelevanceResponse.isAllowNoProduct()) { + errMsg = errMsg + ",生产日期"; + } + if (StrUtil.isEmpty(udiEntity.getExpireDate()) && + "是".equals(udiRelevanceResponse.getScbssfbhsxrq()) && !udiRelevanceResponse.isAllowNoExpire()) { + errMsg = errMsg + ",失效日期"; + } + + + if (StrUtil.isEmpty(udiEntity.getSerialNo()) && + "是".equals(udiRelevanceResponse.getScbssfbhxlh())) { + errMsg = errMsg + ",序列号"; + } + + if (StrUtil.isNotEmpty(errMsg)) { + BaseResponse baseResponse = ResultVOUtils.error(507, "请补齐" + errMsg.substring(1) + ""); + baseResponse.setData(udiEntity); + return baseResponse; + } + return null; + } + @AuthRuleAnnotation("") @PostMapping("/udiwms/addCode/updateBindSup") @@ -680,11 +892,11 @@ public class WareHouseController { try { String customerId = getCustomerId(); - if (customerId.equals("110")) { + if(customerId.equals("110")){ Integer userId = customerService.getUserId(); postOrderRequest.setCustomerId(customerId); postOrderRequest.setUserId(userId); - } else { + }else { postOrderRequest.setUserId(null); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java index 4f8c860..f8632af 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/CheckOrderUtils.java @@ -136,6 +136,8 @@ public class CheckOrderUtils { } } if (status.equals(ConstantStatus.SORDER_DELIVER)) { + orderEntity.setReceiveStatus(1); + orderService.updateOrder(orderEntity); invProductsTrService.genInvProducts(orderEntity.getId()); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/InoutUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/InoutUtils.java index 9c0c6ef..fb19835 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/InoutUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/utils/InoutUtils.java @@ -184,9 +184,9 @@ public class InoutUtils { } - public UdiInfoEntity getUdiInfo(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, String code, UdiDlHttpClient udiDlHttpClient) { + public UdiInfoEntity getUdiInfo(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, WarehouseEntity warehouseEntity, UdiDlHttpClient udiDlHttpClient) { String prefix; - prefix = FilterUdiUtils.getDiStr(code); + prefix = FilterUdiUtils.getDiStr(warehouseEntity.getCode()); UdiInfoEntity udiInfoEntity = udiInfoService.findByNameCode(prefix); if (udiInfoEntity == null) { List froms = udiDlHttpClient.getUdiByDi(prefix); @@ -207,14 +207,19 @@ public class InoutUtils { } } - udiInfoEntity.setCode(code); - udiInfoEntity = FilterUdiUtils.transUdi(udiInfoEntity); + udiInfoEntity.setCode(warehouseEntity.getCode()); + udiInfoEntity.setBatchNo(warehouseEntity.getBatchNo()); + udiInfoEntity.setProduceDate(warehouseEntity.getProduceDate()); + udiInfoEntity.setExpireDate(warehouseEntity.getExpireDate()); + udiInfoEntity.setSerialNo(warehouseEntity.getSerialNo()); + udiInfoEntity.setUdi(warehouseEntity.getNameCode()); return udiInfoEntity; } - public UdiInfoEntity getUdiInfoByRlId(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, String code, UdiDlHttpClient udiDlHttpClient) { + public UdiInfoEntity getUdiInfoByRlId(UdiInfoService udiInfoService, UdiRelevanceService udiRelevanceService, WarehouseEntity warehouseEntity, UdiDlHttpClient udiDlHttpClient) { String prefix; + String code = warehouseEntity.getCode(); prefix = FilterUdiUtils.getDiStr(code); UdiInfoEntity udiInfoEntity = new UdiInfoEntity(); @@ -225,12 +230,18 @@ public class InoutUtils { udiRelevanceResponse = udiRelevanceResponses.get(0); } if (udiRelevanceResponse == null) { - udiInfoEntity = getUdiInfo(udiInfoService, udiRelevanceService, code, udiDlHttpClient); + udiInfoEntity = getUdiInfo(udiInfoService, udiRelevanceService, warehouseEntity, udiDlHttpClient); } else { BeanUtils.copyProperties(udiRelevanceResponse, udiInfoEntity); udiInfoEntity.setRelId(udiRelevanceResponse.getId() + ""); udiInfoEntity.setCode(code); - udiInfoEntity = FilterUdiUtils.transUdi(udiInfoEntity); +// udiInfoEntity = FilterUdiUtils.transUdi(udiInfoEntity); + udiInfoEntity.setCode(warehouseEntity.getCode()); + udiInfoEntity.setBatchNo(warehouseEntity.getBatchNo()); + udiInfoEntity.setProduceDate(warehouseEntity.getProduceDate()); + udiInfoEntity.setExpireDate(warehouseEntity.getExpireDate()); + udiInfoEntity.setSerialNo(warehouseEntity.getSerialNo()); + udiInfoEntity.setUdi(warehouseEntity.getNameCode()); udiInfoEntity.setNameCode(udiRelevanceResponse.getNameCode()); } @@ -248,7 +259,7 @@ public class InoutUtils { List udiInfoEntities = new ArrayList<>(); for (WarehouseEntity warehouseEntity : warehouseEntityList) { UdiInfoEntity udiInfoEntity = null; - udiInfoEntity = new InoutUtils(udiUrl).getUdiInfoByRlId(udiInfoService, udiRelevanceService, warehouseEntity.getCode(), udiDlHttpClient); + udiInfoEntity = new InoutUtils(udiUrl).getUdiInfoByRlId(udiInfoService, udiRelevanceService, warehouseEntity, udiDlHttpClient); if (udiInfoEntity != null) { udiInfoEntity.setCount(getActCount(warehouseEntity, udiRelevanceService) * warehouseEntity.getCount()); udiInfoEntity.setRelId(warehouseEntity.getRelId()); @@ -326,7 +337,7 @@ public class InoutUtils { if (CollUtil.isNotEmpty(udiRelevanceEntities)) { for (UdiRelevanceEntity udiRelevanceEntity : udiRelevanceEntities) { if (udiRelevanceEntity.getId().equals(erpOrderEntity.getBindRlFk()) && StrUtil.isNotEmpty(udimsOrderDetailBean.getBatchNo()) && - StrUtil.isNotEmpty(erpOrderEntity.getBatchNo())&& udimsOrderDetailBean.getBatchNo().equals(erpOrderEntity.getBatchNo())) { + StrUtil.isNotEmpty(erpOrderEntity.getBatchNo()) && udimsOrderDetailBean.getBatchNo().equals(erpOrderEntity.getBatchNo())) { return udimsOrderDetailBean; } } 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 c2ea157..ad37f5b 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 @@ -105,8 +105,7 @@ public class InvPreInProductsController { if (Constant.SYSTEM_CUSTOMER_ID.equals(filterInvProductRequest.getCustomerId())) { filterInvProductRequest.setCustomerId(null); } - if(StrUtil.isEmpty(filterInvProductRequest.getBatchNo())) - { + if (StrUtil.isEmpty(filterInvProductRequest.getBatchNo())) { filterInvProductRequest.setBatchNo("empty"); } List invProductDetailEntities = invProductDetailService.filterInvProduct(filterInvProductRequest); @@ -159,7 +158,7 @@ public class InvPreInProductsController { @PostMapping("spms/prein/inv/products/clearAll") public BaseResponse clearAllInvProduct(@RequestBody DeleteRequest deleteRequest) { - boolean b = invProductService.deleteAll(); + boolean b = invProductService.deleteAll(); if (b) { return ResultVOUtils.success("删除成功"); } else { 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 4467acb..dd4007d 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 @@ -95,15 +95,10 @@ public class InvProductsController { }); filterInvProductRequest.setInvCodes(invCodes); } - - } } else { CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(customerId)); filterInvProductRequest.setSupId(companyEntity.getUnitIdFk()); -// InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true); -// filterInvProductRequest.setInvStorageCode(invWarehouseEntity.getCode()); - FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); filterInvWarehouseRequest.setSpUse(true); List invWarehouseEntities = invWarehouseService.filterInvWarehouse(filterInvWarehouseRequest); @@ -115,8 +110,6 @@ public class InvProductsController { filterInvProductRequest.setCustomerId(null); } -// filterInvProductRequest.setGroupType("invStorageCode"); - List invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest); PageInfo pageInfo; @@ -307,7 +300,6 @@ public class InvProductsController { if (udiInfoEntities != null && udiInfoEntities.size() > 1) { filterInvProductDetailRequest.setProductIdFk(udiInfoBean.getId() + ""); filterInvProductDetailRequest.setBatchNo(udiEntity.getBatchNo()); - } else { filterInvProductDetailRequest.setOriginCode(filterCodeTraceRequest.getCode()); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/EntrustReceDao.java b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/EntrustReceDao.java new file mode 100644 index 0000000..e03175c --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/dao/basic/EntrustReceDao.java @@ -0,0 +1,24 @@ +package com.glxp.sale.admin.dao.basic; + +import com.glxp.sale.admin.entity.basic.EntrustReceEntity; +import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest; +import com.glxp.sale.admin.res.basic.EntrustReceRespose; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface EntrustReceDao { + + + List filterEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); + + List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); + + boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity); + + boolean deleteById(String id); + + boolean updateEntrustRec(EntrustReceEntity warehouseEntity); + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/EntrustReceEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/EntrustReceEntity.java new file mode 100644 index 0000000..12daee9 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/EntrustReceEntity.java @@ -0,0 +1,22 @@ +package com.glxp.sale.admin.entity.basic; + +import lombok.Data; + +import java.util.Date; + +@Data +public class EntrustReceEntity { + + + private Integer id; + private String action; + private String entrustInv; + private String entrustUser; + private String userId; + private String entrustAction; + private Date updateTime; + private String remark; + private boolean finishRece; + + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiInfoEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiInfoEntity.java index dd5e667..b6fd264 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiInfoEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiInfoEntity.java @@ -59,6 +59,9 @@ public class UdiInfoEntity { private String supId; private Boolean isCheck; + private boolean allowNoBatch; + private boolean allowNoExpire; + private boolean allowNoProduct; public Integer getId() { return id; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiRelevanceEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiRelevanceEntity.java index 294eb52..1a475ba 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiRelevanceEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/UdiRelevanceEntity.java @@ -32,8 +32,6 @@ public class UdiRelevanceEntity { private Boolean isAdavence; private String supName; private String originUuid; - private boolean allowNoBatch; - private String price; public Integer getLockStatus() { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/auth/ConnectRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/ConnectRequest.java new file mode 100644 index 0000000..a47a8a1 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/auth/ConnectRequest.java @@ -0,0 +1,7 @@ +package com.glxp.sale.admin.req.auth; + +import lombok.Data; + +@Data +public class ConnectRequest { +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicExportStatusRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicExportStatusRequest.java index 8379ebb..d992117 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicExportStatusRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/BasicExportStatusRequest.java @@ -11,4 +11,5 @@ public class BasicExportStatusRequest extends ListPageRequest { private Integer scheduleType; private String idDatas; public Integer createType; + private String syncTime; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddEnterCodeRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddEnterCodeRequest.java new file mode 100644 index 0000000..b626dc0 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddEnterCodeRequest.java @@ -0,0 +1,9 @@ +package com.glxp.sale.admin.req.inout; + +import lombok.Data; + +@Data +public class AddEnterCodeRequest { + private String originCode; + private String code; +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddEnterCodeResult.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddEnterCodeResult.java new file mode 100644 index 0000000..6e8a032 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddEnterCodeResult.java @@ -0,0 +1,8 @@ +package com.glxp.sale.admin.req.inout; + +import lombok.Data; + +@Data +public class AddEnterCodeResult { + String resultCode; +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddOrderRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddOrderRequest.java index 24857df..433a699 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddOrderRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/AddOrderRequest.java @@ -23,5 +23,10 @@ public class AddOrderRequest { private boolean outChangeEnable; private boolean ignoreExpire; private boolean ignoreRecentExpire; + private boolean ignoreCode; private boolean preCheck; + private String batchNo; + private String produceDate; + private String expireDate; + private String serialNo; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/UpdateExportStatusRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/UpdateExportStatusRequest.java index e25cae0..4e7f82c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/inout/UpdateExportStatusRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/inout/UpdateExportStatusRequest.java @@ -8,5 +8,5 @@ public class UpdateExportStatusRequest { private String orderId; private Integer exportStatus; private Integer checkStatus; - + private String stockOrderId; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/CompanyProductRelevanceResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/CompanyProductRelevanceResponse.java index b9d9ac1..23b3f3c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/CompanyProductRelevanceResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/CompanyProductRelevanceResponse.java @@ -66,6 +66,9 @@ public class CompanyProductRelevanceResponse { private String cpms; private String supName; private boolean allowNoBatch; + private boolean allowNoExpire; + private boolean allowNoProduct; + private String price; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/EntrustReceRespose.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/EntrustReceRespose.java new file mode 100644 index 0000000..3f27ad2 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/EntrustReceRespose.java @@ -0,0 +1,23 @@ +package com.glxp.sale.admin.res.basic; + +import lombok.Data; + +import java.util.Date; + +@Data +public class EntrustReceRespose { + private Integer id; + private String action; + private String entrustInv; + private String entrustUser; + private String userId; + private String entrustAction; + private Date updateTime; + private String remark; + private boolean finishRece; + private String curName; + private String entrustName; + private String employeeName; + private String entrustInvName; + +} 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 d0a78d8..f5b5478 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,9 @@ public class UdiRelevanceResponse { private String companyName; private String originUuid; private boolean allowNoBatch; + private boolean allowNoExpire; + private boolean allowNoProduct; + private String price; public int getBhzxxsbzsl() { diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/EntrustReceService.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/EntrustReceService.java new file mode 100644 index 0000000..7fedf1e --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/EntrustReceService.java @@ -0,0 +1,24 @@ +package com.glxp.sale.admin.service.basic; + +import com.glxp.sale.admin.entity.basic.BasicExportStatusEntity; +import com.glxp.sale.admin.entity.basic.EntrustReceEntity; +import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest; +import com.glxp.sale.admin.req.basic.BasicExportStatusRequest; +import com.glxp.sale.admin.res.basic.EntrustReceRespose; + +import java.util.List; + +public interface EntrustReceService { + + + List filterEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); + + List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); + + boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity); + + boolean deleteById(String id); + + boolean updateEntrustRec(EntrustReceEntity warehouseEntity); + +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/EntrustReceServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/EntrustReceServiceImpl.java new file mode 100644 index 0000000..85bdad3 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/basic/impl/EntrustReceServiceImpl.java @@ -0,0 +1,62 @@ +package com.glxp.sale.admin.service.basic.impl; + +import com.github.pagehelper.PageHelper; +import com.glxp.sale.admin.dao.basic.EntrustReceDao; +import com.glxp.sale.admin.entity.basic.CorpImportLogEntity; +import com.glxp.sale.admin.entity.basic.EntrustReceEntity; +import com.glxp.sale.admin.req.basic.BasicEntrustRecRequest; +import com.glxp.sale.admin.res.basic.EntrustReceRespose; +import com.glxp.sale.admin.service.basic.EntrustReceService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; + +@Service +public class EntrustReceServiceImpl implements EntrustReceService { + + @Resource + EntrustReceDao entrustReceDao; + + @Override + public List filterEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) { + + if (basicEntrustRecRequest == null) { + return Collections.emptyList(); + } + if (basicEntrustRecRequest.getPage() != null) { + int offset = (basicEntrustRecRequest.getPage() - 1) * basicEntrustRecRequest.getLimit(); + PageHelper.offsetPage(offset, basicEntrustRecRequest.getLimit()); + } + return entrustReceDao.filterEntrustRec(basicEntrustRecRequest); + } + + @Override + public List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) { + + if (basicEntrustRecRequest == null) { + return Collections.emptyList(); + } + if (basicEntrustRecRequest.getPage() != null) { + int offset = (basicEntrustRecRequest.getPage() - 1) * basicEntrustRecRequest.getLimit(); + PageHelper.offsetPage(offset, basicEntrustRecRequest.getLimit()); + } + return entrustReceDao.filterJoinEntrustRec(basicEntrustRecRequest); + } + + @Override + public boolean insertEntrustRec(EntrustReceEntity entrustReceEntity) { + return entrustReceDao.insertEntrustRec(entrustReceEntity); + } + + @Override + public boolean deleteById(String id) { + return entrustReceDao.deleteById(id); + } + + @Override + public boolean updateEntrustRec(EntrustReceEntity entrustReceEntity) { + return entrustReceDao.updateEntrustRec(entrustReceEntity); + } +} diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/receipt/impl/ProductInfoServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/receipt/impl/ProductInfoServiceImpl.java index 19e786a..8e680b1 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/receipt/impl/ProductInfoServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/receipt/impl/ProductInfoServiceImpl.java @@ -120,8 +120,12 @@ public class ProductInfoServiceImpl implements ProductInfoService { @Override public List syncDlUdi(ProductInfoFilterRequest productInfoFilterRequest) { - int offset = (productInfoFilterRequest.getPage() - 1) * productInfoFilterRequest.getLimit() + 1; - productInfoFilterRequest.setPage(offset); + +// if (productInfoFilterRequest.getPage() != null) { +// int offset = (productInfoFilterRequest.getPage() - 1) * productInfoFilterRequest.getLimit(); +// PageHelper.offsetPage(offset, productInfoFilterRequest.getLimit()); +// } + return productInfoDao.syncDlUdi(productInfoFilterRequest); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java index 0b00b76..f684b76 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java @@ -54,6 +54,7 @@ public class AsyncDiDlHelper { }); + List udiCompanyEntities = baseResponse.getData(); return udiCompanyEntities; } catch (Exception e) { 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 67e79e0..780ec13 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 @@ -264,6 +264,9 @@ public class InvProductsTrService { //缺量补单时是否全量补单 SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("ullage_supplement_all"); if (systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) { + + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(orderEntity.getAction()); + insetInv(bussinessTypeEntity, invProductDetailEntities);//2.插入当前库存 WarehouseEntity warehouseEntity = warehouseEntities.get(0); InvWarehouseEntity locWarehouseEntity = invWarehouseService.selectByCode(warehouseEntity.getLocStorageCode()); if (locWarehouseEntity.getLevel() == 1 && isAdavnce(warehouseEntity)) {//补寄售转入 @@ -329,10 +332,10 @@ public class InvProductsTrService { warehouseEntity.setFromCorp(invWarehouseEntity.getName()); if (invCount > 0) {//仓库已存在该产品 if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 - UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); +// UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 preiInList.add(warehouseEntity); - } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 + } else if (warehouseEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 int lea = count - invCount; warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // preiInList.add(warehouseEntity); @@ -374,10 +377,10 @@ public class InvProductsTrService { if (invCount > 0) {//仓库已存在该产品 if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 - UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); +// UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 inList.add(warehouseEntity); - } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 + } else if (warehouseEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 int lea = count - invCount; warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // inList.add(warehouseEntity); @@ -444,10 +447,10 @@ public class InvProductsTrService { int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode()); if (invCount > 0) {//仓库已存在该产品 if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装 - UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); +// UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补 prePutList.add(warehouseEntity); - } else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 + } else if (warehouseEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量 int lea = count - invCount; warehouseEntity.setCount(lea / (warehouseEntity.getCount())); // prePutList.add(warehouseEntity); @@ -514,6 +517,7 @@ public class InvProductsTrService { outOrder.setCreateUser(null); outOrder.setReviewUser(null); outOrder.setPreCheck(false); + outOrder.setReceiveStatus(0); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : preOutList) { warehouseEntity.setOrderId(outOrder.getId()); @@ -590,6 +594,7 @@ public class InvProductsTrService { outOrder.setCreateUser(null); outOrder.setReviewUser(null); outOrder.setPreCheck(false); + outOrder.setReceiveStatus(0); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : temps) { warehouseEntity.setOrderId(outOrder.getId()); @@ -634,6 +639,7 @@ public class InvProductsTrService { outOrder.setCreateUser(null); outOrder.setReviewUser(null); outOrder.setPreCheck(false); + outOrder.setReceiveStatus(0); orderService.insertOrder(outOrder); warehouseEntity.setOrderId(outOrder.getId()); warehouseEntity.setId(null); @@ -706,6 +712,7 @@ public class InvProductsTrService { outOrder.setCreateUser(null); outOrder.setReviewUser(null); outOrder.setPreCheck(false); + outOrder.setReceiveStatus(0); orderService.insertOrder(outOrder); for (WarehouseEntity warehouseEntity : temps) { warehouseEntity.setOrderId(outOrder.getId()); @@ -768,6 +775,7 @@ public class InvProductsTrService { outOrder.setLocStorageCode(orderEntity.getLocStorageCode()); outOrder.setErpFk(null); outOrder.setFromType(ConstantStatus.FROM_CHANGE); + outOrder.setReceiveStatus(0); String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + MyStrUtil.trim(bussinessTypeEntity.getPrefix()), "yyyyMMdd")); outOrder.setId(orderNo); SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit"); 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 1503a1c..ec07a3d 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 @@ -822,11 +822,11 @@ public class IoTransInoutService { orderEntity.setErpFk(stockOrderEntity.getBillNo()); orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_UN); orderEntity.setUpdateTime(new Date()); - orderService.updateOrder(orderEntity); - if (stockOrderEntity.getStatus().equals(ConstantStatus.SORDER_DELIVER)) { + orderEntity.setReceiveStatus(1); invProductsTrService.genInvProducts(orderEntity.getId()); } + orderService.updateOrder(orderEntity); } else { orderEntity.setRemark("该产品DI绑定多个产品ID,请在扫码单据详情绑定对应产品ID"); orderEntity.setContrastStatus(ConstantStatus.ORDER_CHECK_FAIL); @@ -895,6 +895,8 @@ public class IoTransInoutService { } } else { stockOrderEntity.setStatus(ConstantStatus.SORDER_DELIVER); + + orderEntity.setReceiveStatus(1); // invProductsTrService.genInvProducts(orderEntity.getId()); } stockOrderEntity.setSupplementNo(orderEntity.getSupplementNo()); @@ -907,7 +909,8 @@ public class IoTransInoutService { stockOrderFilterRequest.setBillNo(stockOrderEntity.getBillNo()); stockOrderEntity = stockOrderService.findOne(stockOrderFilterRequest); stockOrderDetailService.deleteByOrderIdFk(stockOrderEntity.getId()); - + orderEntity.setUpdateTime(new Date()); + orderService.updateOrder(orderEntity); return stockOrderEntity; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/util/FilterUdiUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/util/FilterUdiUtils.java index 1829e81..48e6fc6 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/util/FilterUdiUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/util/FilterUdiUtils.java @@ -247,7 +247,7 @@ public class FilterUdiUtils { } - public static UdiInfoEntity transUdi(UdiInfoEntity data) { + public static UdiInfoEntity transUdi1(UdiInfoEntity data) { UdiEntity udiEntity = getUdi(data.getCode()); if (udiEntity != null) { data.setBatchNo(udiEntity.getBatchNo()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/util/GennerOrderUtils.java b/api-admin/src/main/java/com/glxp/sale/admin/util/GennerOrderUtils.java index c78ec79..ad74265 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/util/GennerOrderUtils.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/util/GennerOrderUtils.java @@ -94,7 +94,7 @@ public class GennerOrderUtils { * @time: 14:15 * @return: java.lang.String **/ - public String createScOrderNo(OrderNoTypeBean orderNoTypeEnum) { + public synchronized String createScOrderNo(OrderNoTypeBean orderNoTypeEnum) { //获得单号前缀 //格式 固定前缀 +时间前缀 示例 String formNoPrefix = getFormNoPrefix(orderNoTypeEnum); diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml new file mode 100644 index 0000000..927df99 --- /dev/null +++ b/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + replace + INTO basic_entrust_accept(`action`, entrustInv, `entrustUser`, userId, updateTime, remark,entrustAction,finishRece) + values ( + #{action}, + #{entrustInv}, + #{entrustUser}, + #{userId}, + #{updateTime}, + #{remark}, + #{entrustAction}, + #{finishRece} + ) + + + + UPDATE basic_entrust_accept + + action=#{action}, + entrustInv=#{entrustInv}, + entrustUser=#{entrustUser}, + userId=#{userId}, + updateTime=#{updateTime}, + remark=#{remark}, + + WHERE id = #{id} + + + DELETE + FROM basic_entrust_accept + WHERE id = #{id} + + + \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml index d73fe8e..7f439d0 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml @@ -43,7 +43,8 @@ basic_products.scbssfbhph, basic_products.scbssfbhxlh, basic_products.scbssfbhscrq, - basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid + basic_products.scbssfbhsxrq,basic_products.cpms,basic_products.originUuid,basic_products.allowNoBatch, + basic_products.allowNoExpire,basic_products.allowNoProduct FROM (company_product_relevance inner JOIN basic_udirel ON company_product_relevance.udiRlIdFk = basic_udirel.id) @@ -130,7 +131,7 @@ nameCode,packRatio,packLevel,bhxjsl, bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,addType,deviceRecordKey, cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber - ,diType,productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,manufactory,originUuid) + ,diType,productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,manufactory,originUuid,allowNoBatch,allowNoExpire,allowNoProduct) values ( #{id}, @@ -163,7 +164,7 @@ #{scbssfbhscrq}, #{scbssfbhsxrq}, #{cpms}, - #{manufactory},#{originUuid} + #{manufactory},#{originUuid},,#{allowNoBatch},#{allowNoExpire},#{allowNoProduct} ) @@ -173,7 +174,7 @@ nameCode,packRatio,packLevel,bhxjsl, bhzxxsbzsl,zxxsbzbhsydysl,bhxjcpbm,bzcj,addType,deviceRecordKey, cpmctymc,cplb,flbm,ggxh,qxlb,tyshxydm,ylqxzcrbarmc,zczbhhzbapzbh,ylqxzcrbarywmc,uuid,sjcpbm,versionNumber - ,diType,productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,manufactory,originUuid + ,diType,productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,manufactory,originUuid,allowNoBatch,allowNoExpire,allowNoProduct ) values @@ -205,7 +206,7 @@ #{item.diType},#{item.productType}, #{item.scbssfbhph}, #{item.scbssfbhxlh}, #{item.scbssfbhscrq}, - #{item.scbssfbhsxrq},#{item.cpms},#{item.manufactory},#{item.originUuid} + #{item.scbssfbhsxrq},#{item.cpms},#{item.manufactory},#{item.originUuid},#{item.allowNoBatch},#{item.allowNoExpire},#{item.allowNoProduct} ) @@ -257,7 +258,9 @@ scbssfbhsxrq=#{scbssfbhsxrq}, cpms=#{cpms}, originUuid=#{originUuid}, - + allowNoBatch=#{allowNoBatch}, + allowNoExpire=#{allowNoExpire}, + allowNoProduct=#{allowNoProduct}, WHERE nameCode = #{nameCode} @@ -284,7 +287,7 @@ (id, nameCode, packRatio, packLevel, bhxjsl, bhzxxsbzsl, zxxsbzbhsydysl, bhxjcpbm, bzcj, addType, deviceRecordKey, cpmctymc, cplb, flbm, ggxh, qxlb, tyshxydm, ylqxzcrbarmc, zczbhhzbapzbh, ylqxzcrbarywmc, sydycpbs, uuid, sjcpbm, versionNumber, diType, ybbm, sptm, manufactory, measname, - productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,originUuid) values + productType,scbssfbhph,scbssfbhxlh,scbssfbhscrq,scbssfbhsxrq,cpms,originUuid,allowNoBatch,allowNoExpire,allowNoProduct) values (#{item.id}, #{item.nameCode}, @@ -318,7 +321,7 @@ #{item.productType}, #{item.scbssfbhph}, #{item.scbssfbhxlh}, #{item.scbssfbhscrq}, - #{item.scbssfbhsxrq},#{item.cpms},#{item.originUuid}) + #{item.scbssfbhsxrq},#{item.cpms},#{item.originUuid},#{allowNoBatch},#{allowNoExpire},#{allowNoProduct}) \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml index b5adee0..9d35150 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/UdiRelevanceDao.xml @@ -12,7 +12,10 @@ basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4, basic_udirel.manufactory,basic_udirel.measname,basic_udirel.ybbm,basic_udirel.sptm, basic_udirel.isDisable, basic_udirel.isLock,basic_udirel.lockStatus,basic_udirel.udplatCode, - basic_udirel.isAdavence,basic_udirel.mainId,basic_udirel.allowNoBatch,basic_udirel.price, + basic_udirel.isAdavence,basic_udirel.mainId,basic_products.allowNoBatch, + basic_products.allowNoExpire, + basic_products.allowNoProduct, + basic_udirel.price, basic_products.nameCode,basic_products.packRatio,basic_products.packLevel, basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl, basic_products.bhxjcpbm,basic_products.bzcj, @@ -97,7 +100,9 @@ basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4, basic_udirel.manufactory,basic_udirel.measname,basic_udirel.ybbm,basic_udirel.sptm,basic_udirel.price, basic_udirel.isDisable, basic_udirel.isLock,basic_udirel.lockStatus,basic_udirel.udplatCode, - basic_udirel.isAdavence,basic_udirel.mainId,basic_udirel.allowNoBatch, + basic_udirel.isAdavence,basic_udirel.mainId,basic_products.allowNoBatch, + basic_products.allowNoExpire, + basic_products.allowNoProduct, basic_products.nameCode,basic_products.packRatio,basic_products.packLevel, basic_products.bhxjsl,basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl, basic_products.bhxjcpbm,basic_products.bzcj, @@ -187,7 +192,9 @@ basic_udirel.thirdId1,basic_udirel.thirdId2,basic_udirel.thirdId3,basic_udirel.thirdId4, basic_udirel.ybbm,basic_udirel.sptm,basic_udirel.isDisable, basic_udirel.isLock,basic_udirel.lockStatus, basic_udirel.thirdName1,basic_udirel.thirdName2,basic_udirel.thirdName3,basic_udirel.thirdName4, - basic_udirel.manufactory,basic_udirel.measname,basic_udirel.udplatCode,basic_udirel.allowNoBatch,basic_udirel.price, + basic_udirel.manufactory,basic_udirel.measname,basic_udirel.udplatCode,basic_products.allowNoBatch, + basic_products.allowNoExpire,basic_products.allowNoProduct, + basic_udirel.price, basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,basic_products.bhxjsl, basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,basic_products.bhxjcpbm,basic_products.bzcj, basic_products.addType,basic_products.deviceRecordKey,basic_products.cpmctymc,basic_products.cplb, @@ -393,7 +400,7 @@ (id, thirdId,thirdName,uuid,isUseDy,updateTime, thirdId1,thirdId2,thirdId3,thirdId4,thirdName1,thirdName2,thirdName3,thirdName4,manufactory,measname,ybbm,sptm,isDisable,isLock - ,mainId,mainName,lockStatus,udplatCode,isAdavence,supName,allowNoBatch,price + ,mainId,mainName,lockStatus,udplatCode,isAdavence,supName,price ) values ( @@ -422,8 +429,7 @@ #{lockStatus}, #{udplatCode}, #{isAdavence}, - #{supName}, - #{allowNoBatch},#{price} + #{supName},#{price} ) @@ -436,7 +442,7 @@ (id, thirdId,thirdName,uuid,isUseDy,updateTime, thirdId1,thirdId2,thirdId3,thirdId4,thirdName1,thirdName2,thirdName3,thirdName4,manufactory,measname,ybbm,sptm,isDisable,isLock - ,mainId,mainName,lockStatus,udplatCode,isAdavence,supName,allowNoBatch,price + ,mainId,mainName,lockStatus,udplatCode,isAdavence,supName,price ) values ( @@ -466,7 +472,7 @@ #{udplatCode}, #{isAdavence}, #{supName}, - #{allowNoBatch},#{price} + #{price} ) @@ -515,7 +521,6 @@ udplatCode=#{udplatCode}, isAdavence=#{isAdavence}, supName=#{supName}, - allowNoBatch=#{allowNoBatch}, price=#{price}, @@ -542,7 +547,7 @@ replace into basic_udirel (id, thirdId, thirdName, uuid, isUseDy, updateTime, thirdId1, thirdId2, thirdId3, thirdId4, thirdName1, thirdName2, thirdName3, thirdName4, ybbm, sptm, manufactory, - measname, isDisable, mainId, mainName, udplatCode,supName,allowNoBatch,price) + measname, isDisable, mainId, mainName, udplatCode,supName,price) values (#{item.id}, @@ -566,7 +571,7 @@ #{item.isDisable}, #{item.mainId}, #{item.mainName}, - #{item.udplatCode},#{item.supName},#{item.allowNoBatch},#{item.price}) + #{item.udplatCode},#{item.supName},#{item.price}) \ No newline at end of file diff --git a/api-admin/src/main/resources/mybatis/mapper/info/CompanyProductRelevanceDao.xml b/api-admin/src/main/resources/mybatis/mapper/info/CompanyProductRelevanceDao.xml index a572731..e52aeb0 100644 --- a/api-admin/src/main/resources/mybatis/mapper/info/CompanyProductRelevanceDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/info/CompanyProductRelevanceDao.xml @@ -36,7 +36,9 @@ basic_udirel.thirdName1,basic_udirel.thirdName2, basic_udirel.thirdName3,basic_udirel.thirdName4, basic_udirel.ybbm,basic_udirel.sptm, - basic_udirel.manufactory,basic_udirel.measname,basic_udirel.lockStatus,basic_udirel.allowNoBatch, + basic_udirel.manufactory,basic_udirel.measname,basic_udirel.lockStatus,basic_products.allowNoBatch, + basic_products.allowNoExpire, + basic_products.allowNoProduct, basic_products.nameCode,basic_products.packRatio,basic_products.packLevel,basic_products.bhxjsl, basic_products.bhzxxsbzsl,basic_products.zxxsbzbhsydysl,basic_products.bhxjcpbm, basic_products.bzcj,basic_products.addType,basic_udirel.isDisable, diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml b/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml index c188eba..fceaab1 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml @@ -123,6 +123,9 @@ `fromCorpId`=#{fromCorpId}, `fromCorp`=#{fromCorp}, `locStorageCode`=#{locStorageCode}, + `produceDate`=#{produceDate}, + `expireDate`=#{expireDate}, + `batchNo`=#{batchNo}, `supId`=#{supId}, `relId`=#{relId}, @@ -138,6 +141,9 @@ `fromCorp`=#{fromCorp}, `locStorageCode`=#{locStorageCode}, `supId`=#{supId}, + `produceDate`=#{produceDate}, + `expireDate`=#{expireDate}, + `batchNo`=#{batchNo}, `relId`=#{relId}, WHERE id=#{id} diff --git a/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDetail.xml b/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDetail.xml index a155c87..22b73a2 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDetail.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inout/StockOrderDetail.xml @@ -5,7 +5,7 @@ + + delete diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDetailDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDetailDao.xml index b46a760..68247a4 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDetailDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreInProductDetailDao.xml @@ -223,9 +223,6 @@ AND batchNo = #{batchNo} - - AND batchNo is NULL - AND supId = #{supId} @@ -277,9 +274,6 @@ AND batchNo = #{batchNo} - - AND batchNo is NULL - AND unitFk = #{unitFk} diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDetailDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDetailDao.xml index 868b85f..d2fa7cd 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDetailDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvPreProductDetailDao.xml @@ -163,9 +163,6 @@ AND batchNo = #{batchNo} - - AND batchNo is NULL - AND supId = #{supId} @@ -217,9 +214,6 @@ AND batchNo = #{batchNo} - - AND batchNo is NULL - AND unitFk = #{unitFk} diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDetailDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDetailDao.xml index 159dc8d..1f8bfb6 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDetailDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvProductDetailDao.xml @@ -163,9 +163,6 @@ AND batchNo = #{batchNo} - - AND batchNo is NULL - AND supId = #{supId} @@ -217,9 +214,6 @@ AND batchNo = #{batchNo} - - AND batchNo is NULL - AND unitFk = #{unitFk} @@ -266,9 +260,6 @@ AND batchNo = #{batchNo} - - AND batchNo is NULL - AND unitFk = #{unitFk}