|
|
|
@ -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<AuthAdmin> userList = JSONUtil.toList(userListJson, AuthAdmin.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//取出选中的userId
|
|
|
|
|
List<Long> list = userList .stream().map(AuthAdmin::getId).distinct().collect(Collectors.toList());
|
|
|
|
|
//查询该仓库下面绑定的用户
|
|
|
|
|
FilterInvUserRequest filterInvUserRequest=new FilterInvUserRequest();
|
|
|
|
|
filterInvUserRequest.setCode(code);
|
|
|
|
|
filterInvUserRequest.setUserList(list);
|
|
|
|
|
List<WarehouseUserEntity> 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<InvBusUserResponse> invBusUserEntities = invBusUserService.filterJoinInvBusUser(filterInvBusUserRequest);
|
|
|
|
|
Map<String, InvBusUserResponse> 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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (filteBusTypes.size() > 0) {
|
|
|
|
|
if (invBusUserEntities.size() > 0) {
|
|
|
|
|
return ResultVOUtils.error(500, "请先移除用户已关联单据类型!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
warehouseUserService.saveWarehouseUser(code, userList);
|
|
|
|
|
InvSubWarehouseEntity invSubWarehouseEntity =
|
|
|
|
|