diff --git a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java index 6a639b98..c99b58ab 100644 --- a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java +++ b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java @@ -441,20 +441,26 @@ public class InvWarehouseController extends BaseController { //1.先查出已存在关联单据类型 List exitEntitys = warehouseBussinessTypeService.getListByCode(relBusRequset.getInvCode()); - List actionList =new ArrayList<>(); - actionList.addAll(exitEntitys); - //获取关联单据在选入单据的差集 - for (WarehouseBussinessTypeEntity obj:actionList){ - for(String str:relBusRequset.getSelectActions()){ - if(str.equals(obj.getAction())){ - exitEntitys.remove(obj); - } + List removeLists = new ArrayList<>(); + for (WarehouseBussinessTypeEntity warehouseBussinessTypeEntity : exitEntitys) { + //2.过滤出被移除单据类型 + if (!isExitBusType(relBusRequset.getSelectActions(), warehouseBussinessTypeEntity)) { + removeLists.add(warehouseBussinessTypeEntity); } } - if(exitEntitys.size()>0){ - return ResultVOUtils.error(999,"存在用户关联单据!"); - } + List removeList = new ArrayList<>(); + for (WarehouseBussinessTypeEntity warehouseBussinessTypeEntity : removeLists) { + removeList.add(warehouseBussinessTypeEntity.getAction()); + } + if (CollUtil.isNotEmpty(removeList)) { + FilterInvBusUserRequest filterInvBusUserRequest = new FilterInvBusUserRequest(); + filterInvBusUserRequest.setSubInvCode(relBusRequset.getInvCode()); + filterInvBusUserRequest.setSelectedCodes(relBusRequset.getSelectActions()); + List invBusUserEntities = invBusUserService.filterInvBusUser(filterInvBusUserRequest); + if (CollUtil.isNotEmpty(invBusUserEntities)) + return ResultVOUtils.error(999, "请先移除用户关联单据类型!"); + } boolean b = warehouseBussinessTypeService.deleteByCode(relBusRequset.getInvCode()); if (CollUtil.isNotEmpty(relBusRequset.getSelectActions())) { List basicBussinessTypeResponses = new ArrayList<>(); diff --git a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java index b8b43a29..bfcad6d1 100644 --- a/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java +++ b/src/main/java/com/glxp/api/res/inout/IoOrderDetailBizResponse.java @@ -157,5 +157,7 @@ public class IoOrderDetailBizResponse { private boolean checkSuccess; + private String filePath; + }