From 5c9b67d39e62c8667def77013ff2382a077c422a Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Thu, 17 Mar 2022 17:51:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD=EF=BC=8Cbu?= =?UTF-8?q?g=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sale/admin/constant/ConstantStatus.java | 1 + .../basic/BussinessChangeTypeController.java | 13 +++++++++++ .../controller/inout/OrderController.java | 7 +++++- .../inout/utils/CheckOrderUtils.java | 4 ++++ .../inventory/InvPreProductsController.java | 5 ++++ .../inventory/InvProductsController.java | 6 +++++ .../param/SystemParamConfigController.java | 13 +++++++---- .../dao/basic/BussinessChangeTypeDao.java | 3 +++ .../entity/basic/BussinessTypeEntity.java | 4 ++++ .../admin/req/basic/FilterUdiInfoRequest.java | 1 + .../admin/res/basic/BussinessTypResponse.java | 4 ++++ .../basic/BussinessChangeTypeService.java | 1 + .../impl/BussinessChangeTypeServiceaImpl.java | 5 ++++ .../service/inout/impl/OrderServiceImpl.java | 2 +- .../sale/admin/thread/IoErpCheckTask.java | 1 + .../admin/thread/IoTransInoutService.java | 23 ++++++++++++++++--- .../sale/admin/thread/IoTransInoutTask.java | 12 ++++++++-- .../mapper/basic/BussinessChangeTypeDao.xml | 7 ++++++ .../mybatis/mapper/basic/BussinessTypeDao.xml | 16 ++++++++----- .../mybatis/mapper/basic/UdiRelevanceDao.xml | 5 +++- scripts/vue-admin.sql | 9 ++++++++ 21 files changed, 124 insertions(+), 18 deletions(-) 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 73c31cb..f5a0498 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 @@ -88,6 +88,7 @@ public class ConstantStatus { public static final int FROM_PC = 5; //pc端扫码精灵 public static final int FROM_CHANGE = 6; //单据流转 public static final int FROM_UDISP = 7; //udi供应商平台 + public static final int FROM_PEACE_CHANGE = 8; //平衡补单 //DI类型 diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessChangeTypeController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessChangeTypeController.java index e2fc147..81629a0 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessChangeTypeController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/BussinessChangeTypeController.java @@ -97,6 +97,19 @@ public class BussinessChangeTypeController { return ResultVOUtils.success(bussinessTypeEntities); } + @AuthRuleAnnotation("") + @PostMapping("/spms/bussinessChangeType/remove") + public BaseResponse removeBussinessType(@RequestBody BussinessChangeTypeEntity deleteRequest, BindingResult bindingResult) { + + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + String action = deleteRequest.getScAction(); + bussinessChangeTypeService.deleteByAction(action); + return ResultVOUtils.success("删除成功"); + } + + @AuthRuleAnnotation("") @PostMapping("/spms/bussinessChangeType/delete") public BaseResponse deleteBussinessType(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) { 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 5748925..1bc594f 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 @@ -445,8 +445,13 @@ public class OrderController { } StockOrderEntity stockOrderEntity = stockOrderService.findByBillNo(billNo); + if(StrUtil.isEmpty(stockOrderEntity.getSupplementNo())){ + return orderService.supplementOrder(stockOrderEntity.getBillNo(), stockOrderEntity.getOrderIdFk()); + }else { + return ResultVOUtils.error(500,"当前单据已补单,请勿重复补单"); + } + - return orderService.supplementOrder(stockOrderEntity.getBillNo(), stockOrderEntity.getOrderIdFk()); } 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 227fb7a..c66fe0c 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 @@ -193,6 +193,10 @@ public class CheckOrderUtils { if (bussinessTypeEntity.isSecCheckChange()) { return ConstantStatus.SORDER_CHECKED; } + }else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PEACE_CHANGE) { + if (bussinessTypeEntity.isSecCheckBalacne()) { + return ConstantStatus.SORDER_CHECKED; + } } } else { return ConstantStatus.SORDER_DELIVER; 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 462821b..6742f98 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 @@ -7,6 +7,7 @@ import com.glxp.sale.admin.constant.ConstantType; import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; import com.glxp.sale.admin.entity.inventory.InvProductEntity; +import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity; import com.glxp.sale.admin.req.inout.DeleteRequest; import com.glxp.sale.admin.req.inventory.FilterInvProductDetailRequest; import com.glxp.sale.admin.req.inventory.FilterInvProductRequest; @@ -18,6 +19,7 @@ import com.glxp.sale.admin.res.inventory.InvProductStatResponse; import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inventory.InvPreProductDetailService; import com.glxp.sale.admin.service.inventory.InvPreProductService; +import com.glxp.sale.admin.service.inventory.InvWarehouseService; import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; @@ -42,6 +44,8 @@ public class InvPreProductsController { InvPreProductDetailService invProductDetailService; @Resource private CompanyService companyService; + @Resource + private InvWarehouseService invWarehouseService; @AuthRuleAnnotation("") @GetMapping("spms/pre/inv/products/filter") @@ -53,6 +57,7 @@ public class InvPreProductsController { } else { CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId())); filterInvProductRequest.setSupId(companyEntity.getUnitIdFk()); + InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(true, true); filterInvProductRequest.setCustomerId(null); } List invProductResponses = invProductService.filterJoinInvProduct(filterInvProductRequest); 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 f0c8c60..b99d335 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 @@ -10,6 +10,7 @@ import com.glxp.sale.admin.entity.info.CompanyEntity; import com.glxp.sale.admin.entity.inout.OrderEntity; import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity; import com.glxp.sale.admin.entity.inventory.InvProductEntity; +import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity; import com.glxp.sale.admin.entity.udid.UdiEntity; import com.glxp.sale.admin.req.info.DeleteRequest; import com.glxp.sale.admin.req.inventory.FilterCodeTraceRequest; @@ -27,6 +28,7 @@ import com.glxp.sale.admin.service.info.CompanyService; import com.glxp.sale.admin.service.inout.OrderService; import com.glxp.sale.admin.service.inventory.InvProductDetailService; import com.glxp.sale.admin.service.inventory.InvProductService; +import com.glxp.sale.admin.service.inventory.InvWarehouseService; import com.glxp.sale.admin.util.FilterUdiUtils; import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; @@ -61,6 +63,8 @@ public class InvProductsController { private UdiInfoService udiInfoService; @Resource private CompanyService companyService; + @Resource + private InvWarehouseService invWarehouseService; @AuthRuleAnnotation("") @GetMapping("spms/inv/products/filter") @@ -72,6 +76,8 @@ public class InvProductsController { } else { CompanyEntity companyEntity = companyService.findCompany(Long.parseLong(filterInvProductRequest.getCustomerId())); filterInvProductRequest.setSupId(companyEntity.getUnitIdFk()); + InvWarehouseEntity invWarehouseEntity = invWarehouseService.findDefault(false, true); + filterInvProductRequest.setInvStorageCode(invWarehouseEntity.getCode()); filterInvProductRequest.setCustomerId(null); } // filterInvProductRequest.setGroupType("invStorageCode"); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/param/SystemParamConfigController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/param/SystemParamConfigController.java index f4fe500..b26be32 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/param/SystemParamConfigController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/param/SystemParamConfigController.java @@ -99,7 +99,10 @@ public class SystemParamConfigController { //出入库新增单据校验 if (systemParamConfigSaveRequest.getParamKey().equals("io_transInout_interval")) { try { - int time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue()); + int time = 5; + if (!"0".equals(systemParamConfigSaveRequest.getParamValue())) { + time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue()); + } String cronStr = CronUtils.parseMinuteIntervel(time); ScheduledEntity scheduledEntity = new ScheduledEntity(); scheduledEntity.setCron(cronStr); @@ -110,7 +113,10 @@ public class SystemParamConfigController { } } else if (systemParamConfigSaveRequest.getParamKey().equals("io_erpcheck_interval")) { try { - int time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue()); + int time = 5; + if (!"0".equals(systemParamConfigSaveRequest.getParamValue())) { + time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue()); + } String cronStr = CronUtils.parseMinuteIntervel(time); ScheduledEntity scheduledEntity = new ScheduledEntity(); scheduledEntity.setCron(cronStr); @@ -121,11 +127,10 @@ public class SystemParamConfigController { } } else if (systemParamConfigSaveRequest.getParamKey().equals("supplement_order_interval")) { try { - int time = 1; + int time = 5; if (!"0".equals(systemParamConfigSaveRequest.getParamValue())) { time = Integer.parseInt(systemParamConfigSaveRequest.getParamValue()); } - String cornStr = CronUtils.parseMinuteIntervel(time); ScheduledEntity scheduledEntity = new ScheduledEntity(); scheduledEntity.setCron(cornStr); 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 8d166cc..1f93ac2 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 @@ -19,4 +19,7 @@ public interface BussinessChangeTypeDao { boolean insertBusChangeTypee(BussinessChangeTypeEntity bussinessTypeEntity); boolean deleteById(@Param("id") String id); + + boolean deleteByAction(@Param("scAction") String scAction); + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java index e56f5e7..d67ff1a 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/entity/basic/BussinessTypeEntity.java @@ -28,6 +28,7 @@ public class BussinessTypeEntity { private boolean checkWebNew; private boolean checkChange; + private boolean secCheckUdims; private boolean secCheckPdaEd; private boolean secCheckPdaUn; @@ -35,6 +36,9 @@ public class BussinessTypeEntity { private boolean secCheckWebNew; private boolean secCheckChange; + private boolean checkBalacne; + private boolean secCheckBalacne; + private int corpType; private String storageCode; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/FilterUdiInfoRequest.java b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/FilterUdiInfoRequest.java index c44e3f8..07cb9da 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/req/basic/FilterUdiInfoRequest.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/basic/FilterUdiInfoRequest.java @@ -50,6 +50,7 @@ public class FilterUdiInfoRequest extends ListPageRequest { private String sptm; private String unionFilterStr;//产品名称,规格,批文,生产厂家联合查询 + private Boolean isDisable; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java index d2de449..9d87c47 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/res/basic/BussinessTypResponse.java @@ -47,4 +47,8 @@ public class BussinessTypResponse { //启用默认补单 private boolean enableSupplementOrder; + + + private boolean checkBalacne; + private boolean secCheckBalacne; } 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 81f3392..e32b89a 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 @@ -19,4 +19,5 @@ public interface BussinessChangeTypeService { boolean deleteById(String id); + boolean deleteByAction(String scAction); } 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 4b0575c..ffd41e0 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 @@ -50,4 +50,9 @@ public class BussinessChangeTypeServiceaImpl implements BussinessChangeTypeServi public boolean deleteById(String id) { return bussinessChangeTypeDao.deleteById(id); } + + @Override + public boolean deleteByAction(String scAction) { + return bussinessChangeTypeDao.deleteByAction(scAction); + } } 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 5d41192..27f0c2a 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 @@ -214,7 +214,7 @@ public class OrderServiceImpl implements OrderService { supplementOrder.setLocStorageCode(order.getFromCorpId()); String name = invWarehouseDao.getNameByCode(supplementOrder.getFromCorpId()); supplementOrder.setFromCorp(name); - supplementOrder.setFromType(ConstantStatus.FROM_CHANGE); + supplementOrder.setFromType(ConstantStatus.FROM_PEACE_CHANGE); BussinessTypeEntity supplementType = bussinessTypeDao.selectByAction(bussinessTypeEntity.getSupplementOrderType()); supplementOrder.setMainAction(supplementType.getMainAction()); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoErpCheckTask.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoErpCheckTask.java index f7b06b9..5d5215f 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoErpCheckTask.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoErpCheckTask.java @@ -41,5 +41,6 @@ public class IoErpCheckTask implements SchedulingConfigurer { private void process() { logger.info("定时校验ERP单---暂停"); // ioTransInoutService.checkOrder(); + } } \ No newline at end of file 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 9c2551f..88fbe3d 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 @@ -370,8 +370,8 @@ public class IoTransInoutService { //近效期提醒: - SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("recent_date_tip"); - int recent = Integer.parseInt(systemParamConfigEntity.getParamValue()); + SystemParamConfigEntity recentParamConfigEntity = systemParamConfigService.selectByParamKey("recent_date_tip"); + int recent = Integer.parseInt(recentParamConfigEntity.getParamValue()); if (recent > 0) { UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); if (udiEntity.getExpireDate() != null) { @@ -386,7 +386,19 @@ public class IoTransInoutService { } //过期提醒: - + SystemParamConfigEntity expireParamConfigEntity = systemParamConfigService.selectByParamKey("expire_date_tip"); + if (!"0".equals(expireParamConfigEntity.getParamValue())) { + UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode()); + if (udiEntity.getExpireDate() != null) { + String expireDate = "20" + udiEntity.getExpireDate(); + long expireTime = DateUtil.parseDateExpire(expireDate); + if (expireTime - System.currentTimeMillis() < 0) { + orderService.updateOrderStatus(warehouseEntity.getOrderId(), ConstantStatus.ORDER_STATUS_FAIL); + orderService.updateRemark(orderEntity.getId(), "udi码:" + warehouseEntity.getCode() + "已经过期!"); + return; + } + } + } List udiRelevanceResponses = udiRelevanceService.selectAllByNameCode(warehouseEntity.getNameCode()); if (udiRelevanceResponses.size() == 1) { @@ -522,6 +534,11 @@ public class IoTransInoutService { unCheckFinish(orderEntity, warehouseEntityList); return; } + } else if (orderEntity.getFromType().intValue() == ConstantStatus.FROM_PEACE_CHANGE) { + if (!bussinessTypeEntity.isCheckBalacne()) { + unCheckFinish(orderEntity, warehouseEntityList); + return; + } } genOrderDetail(warehouseEntityList); checkMutiDi(orderEntity.getId(), bussinessTypeEntity); //校验一个DI是否绑定多个产品ID diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutTask.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutTask.java index f785d52..46ea4cf 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutTask.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/IoTransInoutTask.java @@ -2,8 +2,10 @@ package com.glxp.sale.admin.thread; import com.glxp.sale.admin.dao.info.ScheduledDao; import com.glxp.sale.admin.entity.info.ScheduledEntity; +import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.httpclient.UdiDlHttpClient; import com.glxp.sale.admin.req.udid.ScheduledRequest; +import com.glxp.sale.admin.service.param.SystemParamConfigService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.EnableScheduling; @@ -24,6 +26,8 @@ public class IoTransInoutTask implements SchedulingConfigurer { protected ScheduledDao scheduledDao; @Resource private IoTransInoutService ioTransInoutService; + @Resource + SystemParamConfigService systemParamConfigService; @Override public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { @@ -42,7 +46,11 @@ public class IoTransInoutTask implements SchedulingConfigurer { private void process() { - logger.info("定时重码校验"); - ioTransInoutService.transInout(); + SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("io_transInout_interval"); + if (!"0".equals(systemParamConfigEntity.getParamValue())) { + logger.info("定时重码校验"); + ioTransInoutService.transInout(); + } + } } 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 82604e8..feaab14 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/BussinessChangeTypeDao.xml @@ -47,6 +47,13 @@ + + DELETE + FROM basic_bustype_pre + WHERE scAction = #{scAction} + + +