diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiRelevanceController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiRelevanceController.java index 82b4e379..69a041eb 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiRelevanceController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/UdiRelevanceController.java @@ -299,7 +299,7 @@ public class UdiRelevanceController { } //判断父id不为空就吧值给到id里面防止id变成详情id - if (udiRelevanceResponse.getPid() != null) { + if (udiRelevanceResponse.getPid() != null && udiRelevanceResponse.getPid()!=0) { udiRelevanceResponse.setId(udiRelevanceResponse.getPid()); } //更新关联表相关信息 @@ -688,7 +688,7 @@ public class UdiRelevanceController { @GetMapping("/udiwms/udirl/di/remove") public BaseResponse removeDI(RemoveRelRequest removeRelRequest) { UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(removeRelRequest.getRelId()); - if (StrUtil.isEmpty(udiRelevanceEntity.getMainId())) { + if (udiRelevanceEntity==null || StrUtil.isEmpty(udiRelevanceEntity.getMainId())) { return ResultVOUtils.error(500, "未关联第三方产品ID,无法解除绑定!"); } List temps = udiRelevanceService.selectByMainId(udiRelevanceEntity.getMainId()); 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 d782ed83..a26cede1 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 @@ -30,6 +30,7 @@ import com.glxp.api.admin.req.basic.CompanyProductRelevanceRequest; import com.glxp.api.admin.req.inout.*; import com.glxp.api.admin.req.inventory.FilterInvBusUserRequest; import com.glxp.api.admin.req.inventory.FilterInvLinkDataRequest; +import com.glxp.api.admin.req.inventory.FilterInvUserRequest; import com.glxp.api.admin.res.PageSimpleResponse; import com.glxp.api.admin.res.basic.BussinessTypResponse; import com.glxp.api.admin.res.basic.UdiRelevanceResponse; @@ -1280,28 +1281,25 @@ public class WareHouseController { if (StrUtil.isBlank(code) || StrUtil.isBlank(userListJson)) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); List userList = JSONUtil.toList(userListJson, AuthAdmin.class); - - - //获取用户关联单据类型信息 - FilterInvBusUserRequest filterInvBusUserRequest = new FilterInvBusUserRequest(); - filterInvBusUserRequest.setSubInvCode(code); - List invBusUserEntities = invBusUserService.filterJoinInvBusUser(filterInvBusUserRequest); - Map filteBusTypes = new HashMap<>(); - for (InvBusUserResponse invBusUserEntity : invBusUserEntities) { - boolean isExit = false; - for (AuthAdmin authAdmin : userList) { - if (authAdmin.getId() == Long.parseLong(invBusUserEntity.getUserId())) { - isExit = true; - continue; - } - } - if (isExit) { - filteBusTypes.put(invBusUserEntity.getUserId(), invBusUserEntity); + //取出选中的userId + List list = userList .stream().map(AuthAdmin::getId).distinct().collect(Collectors.toList()); + //查询该仓库下面绑定的用户 + FilterInvUserRequest filterInvUserRequest=new FilterInvUserRequest(); + filterInvUserRequest.setCode(code); + filterInvUserRequest.setUserList(list); + List filterList=warehouseUserService.filterWarehouseUsers(filterInvUserRequest); + list = filterList .stream().map(WarehouseUserEntity::getUserid).distinct().collect(Collectors.toList()); + + if(list.size()>0){ + //获取用户关联单据类型信息 + FilterInvBusUserRequest filterInvBusUserRequest = new FilterInvBusUserRequest(); + filterInvBusUserRequest.setSubInvCode(code); + filterInvBusUserRequest.setUserList(list); + List invBusUserEntities = invBusUserService.filterJoinInvBusUser(filterInvBusUserRequest); + if (invBusUserEntities.size() > 0) { + return ResultVOUtils.error(500, "请先移除用户已关联单据类型!"); } } - if (filteBusTypes.size() > 0) { - return ResultVOUtils.error(500, "请先移除用户已关联单据类型!"); - } warehouseUserService.saveWarehouseUser(code, userList); InvSubWarehouseEntity invSubWarehouseEntity = diff --git a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/UdiInfoEntity.java b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/UdiInfoEntity.java index 07e136e6..a697b532 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/entity/basic/UdiInfoEntity.java +++ b/api-admin/src/main/java/com/glxp/api/admin/entity/basic/UdiInfoEntity.java @@ -57,6 +57,9 @@ public class UdiInfoEntity { private String relId;//关联ID主键 private Integer status; private String supId; + private boolean isAdavence; + private boolean isDisable; + private boolean useMuti; private Boolean isCheck; private boolean allowNoBatch; diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvBusUserRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvBusUserRequest.java index dd59eb38..232eb10f 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvBusUserRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvBusUserRequest.java @@ -3,6 +3,8 @@ package com.glxp.api.admin.req.inventory; import com.glxp.api.admin.req.ListPageRequest; import lombok.Data; +import java.util.List; + @Data public class FilterInvBusUserRequest extends ListPageRequest { @@ -10,4 +12,5 @@ public class FilterInvBusUserRequest extends ListPageRequest { private String userId; private String subInvCode; private String scAction; + private List userList; } diff --git a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvUserRequest.java b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvUserRequest.java index 640b8b79..465f8df3 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvUserRequest.java +++ b/api-admin/src/main/java/com/glxp/api/admin/req/inventory/FilterInvUserRequest.java @@ -3,6 +3,8 @@ package com.glxp.api.admin.req.inventory; import com.glxp.api.admin.req.ListPageRequest; import lombok.Data; +import java.util.List; + @Data public class FilterInvUserRequest extends ListPageRequest { @@ -16,4 +18,6 @@ public class FilterInvUserRequest extends ListPageRequest { private Boolean isDirector; private String lastUpdateTime; + private List userList; + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/SyncUdiService.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/SyncUdiService.java index 9095be50..46be200a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/SyncUdiService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/SyncUdiService.java @@ -77,11 +77,11 @@ public class SyncUdiService { if (productInfoFilterRequest.getZczbhhzbapzbh() != null && !productInfoFilterRequest.getZczbhhzbapzbh().equals("")) { return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称"); } + if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("") && productInfoFilterRequest.getCpmctymc().length() < 4) { + return ResultVOUtils.error(500, "请输入完整的产品通用名称!"); + } } - if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("") && productInfoFilterRequest.getCpmctymc().length() < 4) { - return ResultVOUtils.error(500, "请输入完整的产品通用名称!"); - } productInfoFilterRequest.setIsNewest(1); // productInfoFilterRequest.setDiType("1"); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/inout/WarehouseUserService.java b/api-admin/src/main/java/com/glxp/api/admin/service/inout/WarehouseUserService.java index 81c79011..8d306ac7 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/inout/WarehouseUserService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/inout/WarehouseUserService.java @@ -67,4 +67,6 @@ public interface WarehouseUserService { * @return */ Integer countUserBySubInvCode(String subInvCode); + + } 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 1e8f0d00..dd1b7aef 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 @@ -27,6 +27,7 @@ import com.glxp.api.admin.entity.inout.WarehouseEntity; import com.glxp.api.admin.entity.inventory.InvProductDetailEntity; import com.glxp.api.admin.entity.inventory.InvProductEntity; import com.glxp.api.admin.entity.inventory.InvSubWarehouseEntity; +import com.glxp.api.admin.entity.inventory.InvWarehouseEntity; import com.glxp.api.admin.req.business.StockOrderFilterRequest; import com.glxp.api.admin.req.inout.OrderFilterRequest; import com.glxp.api.admin.req.inout.OrderQueryRequest; @@ -314,11 +315,14 @@ public class OrderServiceImpl implements OrderService { supplementOrder.setReceiveStatus(0); //设置验收状态为未验收 supplementOrder.setCorpOrderId(CustomUtil.getId() + "x"); //修改往来单位及当前库存号 - supplementOrder.setFromCorpId(order.getLocStorageCode()); + supplementOrder.setFromCorpId(order.getInvWarehouseCode()); + supplementOrder.setSubInvCode(order.getInvStorageCode()); supplementOrder.setFromSubInvCode(order.getInvWarehouseCode()); - supplementOrder.setLocStorageCode(order.getFromCorpId()); - supplementOrder.setInvWarehouseCode(null); - String name = invWarehouseDao.getNameByCode(supplementOrder.getFromCorpId()); + //根据分库code查询总库coder + InvSubWarehouseEntity invSubWarehouseEntity=invSubWarehouseDao.filterGroupInvSubAndcode(order.getFromCorpId()); + supplementOrder.setLocStorageCode(invSubWarehouseEntity.getParentId()); + supplementOrder.setInvStorageCode(invSubWarehouseEntity.getParentId()); + String name = invWarehouseDao.getNameByCode(order.getInvStorageCode()); if (StrUtil.isNotEmpty(order.getFromSubInvCode())) { supplementOrder.setInvWarehouseCode(order.getFromSubInvCode()); } else { 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 802a1a20..a90f2604 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/UdiInfoDao.xml @@ -5,25 +5,100 @@ diff --git a/api-admin/src/main/resources/mybatis/mapper/inventory/InvBusUserDao.xml b/api-admin/src/main/resources/mybatis/mapper/inventory/InvBusUserDao.xml index 7f8f57e9..ff9f45ba 100644 --- a/api-admin/src/main/resources/mybatis/mapper/inventory/InvBusUserDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/inventory/InvBusUserDao.xml @@ -36,7 +36,12 @@ AND scAction = #{scAction} - + + AND userId in + + #{item} + + group by inv_bustype_user.id