diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java index 49df79e3..2c6414ba 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/business/StockOrderController.java @@ -401,8 +401,10 @@ public class StockOrderController { String oldOrderId = originOrder.getId(); String replicateNo = originOrder.getReplicateNo(); //复制单号 List originCodes = codesService.findByReceiptId(originOrder.getId()); - originOrder.setActDate(DateUtil.formatDate(new Date())); + originOrder.setActDate(DateUtil.formatDateTime(new Date())); originOrder.setCreateTime(originOrder.getActDate()); + originOrder.setFromSubInvCode(addStockOrderChangeRequest.getFromSubInvCode()); + originOrder.setInvWarehouseCode(addStockOrderChangeRequest.getInvWarehouseCode()); originOrder.setFromCorp(addStockOrderChangeRequest.getFromCorp()); originOrder.setFromCorpId(addStockOrderChangeRequest.getFromCorpId()); originOrder.setCorpOrderId(CustomUtil.getId() + "x"); @@ -440,6 +442,7 @@ public class StockOrderController { supplementCode.setFromCorpId(originOrder.getFromCorpId()); supplementCode.setFromCorp(originOrder.getFromCorp()); supplementCode.setLocStorageCode(originOrder.getLocStorageCode()); + supplementCode.setInvWarehouseCode(originOrder.getInvWarehouseCode()); supplementCode.setOrderId(supplementOrderNo); //查询补单设置 supplementCode.setAction(originOrder.getAction()); diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java index 2a54a7f6..f9ff807a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java @@ -22,6 +22,7 @@ import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity; import com.glxp.api.admin.entity.inout.WarehouseEntity; import com.glxp.api.admin.entity.inout.WarehouseUserEntity; import com.glxp.api.admin.entity.inventory.InvProductDetailEntity; +import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; import com.glxp.api.admin.exception.JsonException; import com.glxp.api.admin.httpclient.SpsDirectClient; import com.glxp.api.admin.req.basic.CompanyProductRelevanceRequest; @@ -45,12 +46,15 @@ import com.glxp.api.admin.service.inout.*; import com.glxp.api.admin.service.inventory.InvPreInProductDetailService; import com.glxp.api.admin.service.inventory.InvPreProductDetailService; import com.glxp.api.admin.service.inventory.InvProductDetailService; +import com.glxp.api.admin.service.inventory.InvSubWarehouseService; import com.glxp.api.admin.thread.IoTransInoutService; import com.glxp.api.admin.util.*; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.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.*; @@ -108,6 +112,8 @@ public class WareHouseController { @Resource InvWarehouseDao invWarehouseService; @Resource + InvSubWarehouseService invSubWarehouseService; + @Resource private UdiInfoService udiInfoService; @AuthRuleAnnotation("") @@ -1175,15 +1181,17 @@ public class WareHouseController { public BaseResponse saveWarehouseUser(@RequestBody Map params) { String code = String.valueOf(params.get("code")); String userListJson = String.valueOf(params.get("userList")); - if (StrUtil.isBlank(code) || StrUtil.isBlank(userListJson)) { + if (StrUtil.isBlank(code) || StrUtil.isBlank(userListJson)) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); - } List userList = JSONUtil.toList(userListJson, AuthAdmin.class); if (CollUtil.isEmpty(userList)) { return ResultVOUtils.error(500, "用户列表不能为空"); } - warehouseUserService.saveWarehouseUser(code, userList); - invWarehouseService.updateTime(code, new Date()); + + warehouseUserService.saveWarehouseUser(code, JSONUtil.toList(userListJson, AuthAdmin.class)); + InvSubWarehouseEntity invSubWarehouseEntity = + invSubWarehouseService.findByInvSubByCode(code); + invWarehouseService.updateTime(invSubWarehouseEntity.getParentId(), new Date()); return ResultVOUtils.success(); } @@ -1195,7 +1203,9 @@ public class WareHouseController { if (StrUtil.isBlank(code) || StrUtil.isBlank(bussinessTypeJson)) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); warehouseBussinessTypeService.saveWarehouseBussinessType(code, JSONUtil.toList(bussinessTypeJson, BussinessTypResponse.class)); - invWarehouseService.updateTime(code, new Date()); + InvSubWarehouseEntity invSubWarehouseEntity = + invSubWarehouseService.findByInvSubByCode(code); + invWarehouseService.updateTime(invSubWarehouseEntity.getParentId(), new Date()); return ResultVOUtils.success(); } @@ -1215,7 +1225,9 @@ public class WareHouseController { if (null == id) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); WarehouseUserEntity warehouseUserEntity = warehouseUserService.selectById(id); - invWarehouseService.updateTime(warehouseUserEntity.getCode(), new Date()); + InvSubWarehouseEntity invSubWarehouseEntity = + invSubWarehouseService.findByInvSubByCode(warehouseUserEntity.getCode()); + invWarehouseService.updateTime(invSubWarehouseEntity.getParentId(), new Date()); warehouseUserService.deleteWarehouseUser(id); return ResultVOUtils.success(); } @@ -1226,7 +1238,10 @@ public class WareHouseController { if (null == id) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); WarehouseBussinessTypeEntity warehouseBussinessTypeEntity = warehouseBussinessTypeService.selectById(id); - invWarehouseService.updateTime(warehouseBussinessTypeEntity.getCode(), new Date()); + + InvSubWarehouseEntity invSubWarehouseEntity = + invSubWarehouseService.findByInvSubByCode(warehouseBussinessTypeEntity.getCode()); + invWarehouseService.updateTime(invSubWarehouseEntity.getParentId(), new Date()); warehouseBussinessTypeService.deleteWarehouseByssuinessType(id); return ResultVOUtils.success(); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java index ff790367..fe38f917 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvSubWarehouseController.java @@ -3,12 +3,14 @@ package com.glxp.api.admin.controller.inventory; import cn.hutool.core.util.IdUtil; import com.glxp.api.admin.annotation.AuthRuleAnnotation; import com.glxp.api.admin.entity.auth.AuthAdmin; +import com.glxp.api.admin.entity.inout.WarehouseBussinessTypeEntity; import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; import com.glxp.api.admin.entity.inventory.InvWarehouseEntity; import com.glxp.api.admin.req.inout.DeleteRequest; import com.glxp.api.admin.req.inventory.FilterInvSubWarehouseRequest; import com.glxp.api.admin.req.inventory.FilterInvWarehouseRequest; import com.glxp.api.admin.service.auth.CustomerService; +import com.glxp.api.admin.service.inout.WarehouseBussinessTypeService; import com.glxp.api.admin.service.inventory.InvSubWarehouseService; import com.glxp.api.admin.service.inventory.InvWarehouseService; import com.glxp.api.common.enums.ResultEnum; @@ -22,7 +24,10 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; @RestController public class InvSubWarehouseController { @@ -33,6 +38,8 @@ public class InvSubWarehouseController { InvWarehouseService invWarehouseService; @Resource CustomerService customerService; + @Resource + WarehouseBussinessTypeService warehouseBussinessTypeService; @AuthRuleAnnotation("") @GetMapping("spms/sub/inv/warehouse/filter") @@ -45,8 +52,16 @@ public class InvSubWarehouseController { @AuthRuleAnnotation("") @GetMapping("spms/sub/inv/warehouse/findByInv") public BaseResponse findByInv(FilterInvWarehouseRequest filterInvWarehouseRequest) { + +// if (StrUtil.isEmpty(filterInvWarehouseRequest.getPcode()) || filterInvWarehouseRequest.getUserId() == null) { +// return ResultVOUtils.error(500, "用户或仓库不能未空!"); +// } + AuthAdmin authAdmin = customerService.getUserBean(); - filterInvWarehouseRequest.setUserId(authAdmin.getId().intValue()); + if (filterInvWarehouseRequest.getFilter() == null || filterInvWarehouseRequest.getFilter() == 1) { + filterInvWarehouseRequest.setUserId(authAdmin.getId().intValue()); + } + List invSubWarehouseEntities = invSubWarehouseService.filterGroupInvSub(filterInvWarehouseRequest); return ResultVOUtils.success(invSubWarehouseEntities); } @@ -106,7 +121,22 @@ public class InvSubWarehouseController { if (deleteRequest.getId() == null) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); } + + InvSubWarehouseEntity invSubWarehouseEntity = invSubWarehouseService.findById(deleteRequest.getId()); + + FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); + filterInvWarehouseRequest.setCode(invSubWarehouseEntity.getParentId()); + List warehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest); + if (!warehouseEntities.isEmpty()) { + return ResultVOUtils.error(500, "请先移除该仓库关联用户和单据类型!"); + } + + List warehouseBussinessTypeEntities = warehouseBussinessTypeService.getListByCode(invSubWarehouseEntity.getCode()); + if (!warehouseBussinessTypeEntities.isEmpty()) { + return ResultVOUtils.error(500, "请先移除该仓库关联用户和单据类型!"); + } boolean b = invSubWarehouseService.deleteById(deleteRequest.getId()); + if (!b) { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java index 0a505cac..57852cd9 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inventory/InvWarehouseController.java @@ -285,19 +285,10 @@ public class InvWarehouseController { return ResultVOUtils.error(500, "该仓库已有库存,不能删除!"); } - FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); - filterInvWarehouseRequest.setCode(invWarehouseEntity.getCode()); - List warehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest); - if (!warehouseEntities.isEmpty()) { - return ResultVOUtils.error(500, "请先移除该仓库关联用户和单据类型!"); - } - - List warehouseBussinessTypeEntities = warehouseBussinessTypeService.getListByCode(invWarehouseEntity.getCode()); - if (!warehouseBussinessTypeEntities.isEmpty()) { - return ResultVOUtils.error(500, "请先移除该仓库关联用户和单据类型!"); + List invSubWarehouseEntities = invSubWarehouseService.findByParentId(invWarehouseEntity.getCode()); + if (CollUtil.isNotEmpty(invSubWarehouseEntities)) { + return ResultVOUtils.error(500, "请先移除该仓库关联的分库!"); } - - boolean b = invWarehouseService.deleteById(deleteRequest.getId()); if (!b) { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); @@ -312,18 +303,9 @@ public class InvWarehouseController { if (request.getCode() == null) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); } - - InvWarehouseEntity invWarehouseEntity = invWarehouseService.selectByCode(request.getCode()); - FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest(); - filterInvWarehouseRequest.setCode(invWarehouseEntity.getCode()); - List warehouseEntities = invWarehouseService.filterAllByUser(filterInvWarehouseRequest); - if (!warehouseEntities.isEmpty()) { - return ResultVOUtils.error(500, "请先移除该仓库关联用户和单据类型!"); - } - - List warehouseBussinessTypeEntities = warehouseBussinessTypeService.getListByCode(invWarehouseEntity.getCode()); - if (!warehouseBussinessTypeEntities.isEmpty()) { - return ResultVOUtils.error(500, "请先移除该仓库关联用户和单据类型!"); + List invSubWarehouseEntities = invSubWarehouseService.findByParentId(request.getCode()); + if (CollUtil.isNotEmpty(invSubWarehouseEntities)) { + return ResultVOUtils.error(500, "请先移除该仓库关联的分库!"); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthAdminSaveRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthAdminSaveRequest.java index f96d06fe..32389a18 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthAdminSaveRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthAdminSaveRequest.java @@ -19,7 +19,6 @@ public class AuthAdminSaveRequest { // 登录密码 private String passWord; // 状态 - @NotNull(message = "请选择状态") private Integer userFlag; private String employeeName; diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthPermissionRuleSaveRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthPermissionRuleSaveRequest.java index 5b066045..20396bf3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthPermissionRuleSaveRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/auth/AuthPermissionRuleSaveRequest.java @@ -16,7 +16,6 @@ public class AuthPermissionRuleSaveRequest { private String name; @NotEmpty(message = "请输入规则标题") private String title; - @NotNull(message = "请选择状态") private Integer status; private String condition; private Integer listorder; diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inout/AddStockOrderChangeRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inout/AddStockOrderChangeRequest.java index 55957108..94377790 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inout/AddStockOrderChangeRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inout/AddStockOrderChangeRequest.java @@ -19,6 +19,8 @@ public class AddStockOrderChangeRequest { private String actDate; private String billType; private String locStorageCode; + private String fromSubInvCode; + private String invWarehouseCode; private String orderId; private String customerId; private String stockOrderId; diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvSubWarehouseRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvSubWarehouseRequest.java index 7a9b4bbd..e882beec 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvSubWarehouseRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvSubWarehouseRequest.java @@ -6,7 +6,7 @@ import lombok.Data; @Data public class FilterInvSubWarehouseRequest extends ListPageRequest { - private Integer id; + private String id; private String code; private String name; private String parentId; diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/basic/SpsSyncDataResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/basic/SpsSyncDataResponse.java index fe1c8326..52f2e8d6 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/basic/SpsSyncDataResponse.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/basic/SpsSyncDataResponse.java @@ -29,7 +29,6 @@ public class SpsSyncDataResponse { List thrOrderEntities; List companyProductRelevanceEntities; List udiRelevanceEntities; - List invSubWarehouseEntities; List warehouseBussinessTypeEntities; List warehouseUserEntities; diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/CodesServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/CodesServiceImpl.java index 7b4a713b..39b443b7 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/CodesServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/CodesServiceImpl.java @@ -219,6 +219,7 @@ public class CodesServiceImpl implements CodesService { filterInvProductRequest.setRelIdFk(invProductDetailEntity.getProductIdFk()); filterInvProductRequest.setSupId(invProductDetailEntity.getSupId()); filterInvProductRequest.setInvStorageCode(invProductDetailEntity.getInvStorageCode()); + filterInvProductRequest.setInvWarehouseCode(invProductDetailEntity.getInvWarehouseCode()); if (StrUtil.isBlank(invProductDetailEntity.getBatchNo())) { filterInvProductRequest.setBatchNo("empty"); } else { diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java index 2a6718be..071dc800 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/impl/OrderServiceImpl.java @@ -375,10 +375,6 @@ public class OrderServiceImpl implements OrderService { return stockOrderDao.selectWaitSubmitOrders(); } - @Override - public boolean updateReplicateNo(String orderId, String replicateNo) { - return orderDao.updateReplicateNo(orderId, replicateNo); - } @Override public List filterOrderForDelete(String billNo) { @@ -461,6 +457,10 @@ public class OrderServiceImpl implements OrderService { return orders; } + @Override + public boolean updateReplicateNo(String orderId, String replicateNo) { + return orderDao.updateReplicateNo(orderId, replicateNo); + } @Transactional(rollbackFor = Exception.class) @Override @@ -485,6 +485,7 @@ public class OrderServiceImpl implements OrderService { filterInvProductRequest.setRelIdFk(invProductDetailEntity.getProductIdFk()); filterInvProductRequest.setSupId(invProductDetailEntity.getSupId()); filterInvProductRequest.setInvStorageCode(invProductDetailEntity.getInvStorageCode()); + filterInvProductRequest.setInvWarehouseCode(invProductDetailEntity.getInvWarehouseCode()); if (StrUtil.isBlank(invProductDetailEntity.getBatchNo())) { filterInvProductRequest.setBatchNo("empty"); } else { diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvSubWarehouseService.java b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvSubWarehouseService.java index 9ebe9560..4cbdc9eb 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvSubWarehouseService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/InvSubWarehouseService.java @@ -9,6 +9,8 @@ import java.util.List; public interface InvSubWarehouseService { + InvSubWarehouseEntity findById(String id); + List filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest); List filterGroupInvSub(FilterInvWarehouseRequest filterInvSubWarehouseRequest); @@ -26,4 +28,5 @@ public interface InvSubWarehouseService { boolean deleteById(String id); boolean deleteByParentCode(String code); + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvSubWarehouseServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvSubWarehouseServiceImpl.java index af08b720..e0794d46 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvSubWarehouseServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inventory/impl/InvSubWarehouseServiceImpl.java @@ -20,6 +20,17 @@ public class InvSubWarehouseServiceImpl implements InvSubWarehouseService { @Resource InvSubWarehouseDao invSubWarehouseDao; + @Override + public InvSubWarehouseEntity findById(String id) { + FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest(); + filterInvSubWarehouseRequest.setId(id); + List data = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest); + if (CollUtil.isNotEmpty(data)) { + return data.get(0); + } + return null; + } + @Override public List filterInvSubWarehouse(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest) { if (filterInvSubWarehouseRequest == null) { diff --git a/api-admin/src/main/resources/application-pro.properties b/api-admin/src/main/resources/application-pro.properties index 29d7e0d2..f1454161 100644 --- a/api-admin/src/main/resources/application-pro.properties +++ b/api-admin/src/main/resources/application-pro.properties @@ -19,8 +19,8 @@ logging.level.com.glxp.api.admin.erp.second=debug logging.path=output/logs # 不指定的情况下默认生成在项目根目录,按照配置生成所需的日志名称 #logging.file=D:/udi.log -#file_path=D:/udi/udiwms/udiwmsfile/ -file_path=/home/glxp/udiwms +file_path=D:/udi/udiwms/udiwmsfile/ +#file_path=/home/glxp/udiwms #UDI数据下载 UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test diff --git a/api-admin/src/main/resources/logback-spring.xml b/api-admin/src/main/resources/logback-spring.xml index 229d4f07..3251a779 100644 --- a/api-admin/src/main/resources/logback-spring.xml +++ b/api-admin/src/main/resources/logback-spring.xml @@ -1,8 +1,9 @@ logback - + +