Merge remote-tracking branch 'origin/dev_WMS20260401' into dev_WMS20260401
This commit is contained in:
+9
-8
@@ -2,9 +2,6 @@ package com.mhd.basic.application.service.warehouse;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.mhd.basic.domain.areaAggregate.repository.po.SysAreaPO;
|
|
||||||
import com.mhd.basic.domain.areaAggregate.repository.todo.SysProvinceCityCountyDO;
|
|
||||||
import com.mhd.basic.domain.areaAggregate.service.SysProvinceCityCountyDomainService;
|
|
||||||
import com.mhd.basic.domain.associationWarehouse.entity.AssociationWarehouse;
|
import com.mhd.basic.domain.associationWarehouse.entity.AssociationWarehouse;
|
||||||
import com.mhd.basic.domain.associationWarehouse.repository.facade.IAssociationWarehouseService;
|
import com.mhd.basic.domain.associationWarehouse.repository.facade.IAssociationWarehouseService;
|
||||||
import com.mhd.basic.domain.warehouse.repository.po.WarehousePO;
|
import com.mhd.basic.domain.warehouse.repository.po.WarehousePO;
|
||||||
@@ -39,8 +36,6 @@ public class WarehouseApplicationService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysDictTypeService dictTypeService;
|
private ISysDictTypeService dictTypeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysProvinceCityCountyDomainService sysProvinceCityCountyDomainService;
|
|
||||||
@Autowired
|
|
||||||
private IAssociationWarehouseService associationWarehouseService;
|
private IAssociationWarehouseService associationWarehouseService;
|
||||||
|
|
||||||
|
|
||||||
@@ -180,15 +175,21 @@ public class WarehouseApplicationService {
|
|||||||
}
|
}
|
||||||
SysDictData warmLayerDictDataVo = warmLayerDictDataList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), warehouseDO.getWarmLayerCode())).findAny().orElse(null);
|
SysDictData warmLayerDictDataVo = warmLayerDictDataList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), warehouseDO.getWarmLayerCode())).findAny().orElse(null);
|
||||||
if (null == warmLayerDictDataVo) {
|
if (null == warmLayerDictDataVo) {
|
||||||
throw new ServiceException("温层类型【" + warehouseDO.getWarehouseType() + "】数据字典不存在 请联系管理员");
|
throw new ServiceException("温层类型【" + warehouseDO.getWarmLayerCode() + "】数据字典不存在 请联系管理员");
|
||||||
}
|
}
|
||||||
warehouseDO.setWarmLayerName(warmLayerDictDataVo.getDictLabel());
|
warehouseDO.setWarmLayerName(warmLayerDictDataVo.getDictLabel());
|
||||||
//翻译省市区
|
// 翻译省市区(已注释:不再根据 regionCode 回填 regionName)
|
||||||
|
/*
|
||||||
|
if (StrUtil.isNotBlank(warehouseDO.getRegionCode())) {
|
||||||
SysProvinceCityCountyDO loadingProvinceCityCountyDO = new SysProvinceCityCountyDO();
|
SysProvinceCityCountyDO loadingProvinceCityCountyDO = new SysProvinceCityCountyDO();
|
||||||
loadingProvinceCityCountyDO.setCountyCode(Long.parseLong(warehouseDO.getRegionCode()));
|
loadingProvinceCityCountyDO.setCountyCode(Long.parseLong(warehouseDO.getRegionCode().trim()));
|
||||||
SysAreaPO sysAreaPO = sysProvinceCityCountyDomainService.findAreaInfo(loadingProvinceCityCountyDO);
|
SysAreaPO sysAreaPO = sysProvinceCityCountyDomainService.findAreaInfo(loadingProvinceCityCountyDO);
|
||||||
|
if (sysAreaPO != null) {
|
||||||
warehouseDO.setRegionName(sysAreaPO.getProvinceCityCountyName());
|
warehouseDO.setRegionName(sysAreaPO.getProvinceCityCountyName());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除仓库
|
* 批量删除仓库
|
||||||
|
|||||||
+19
-2
@@ -1319,7 +1319,10 @@ public class UserApplicationService {
|
|||||||
//组装新增用户信息
|
//组装新增用户信息
|
||||||
addUserInfoShipper(userDO);
|
addUserInfoShipper(userDO);
|
||||||
UserEntity userEntity = userDomainService.addUser(userDO);
|
UserEntity userEntity = userDomainService.addUser(userDO);
|
||||||
if ((StringUtils.isEmpty(userEntity.getRoleCode()) || !RoleEnum.PLAT_ADMIN.getCode().equals(userEntity.getRoleCode())) &&
|
// 客户管理(addCustomer 等)已指定 customer/supplier 并写入 user_role,不可再覆盖为默认货主 ownerCargo
|
||||||
|
if (isCustomerManagementPresetRole(userEntity.getRoleCode())) {
|
||||||
|
// 保持插入结果,不再改 role_code / user_role
|
||||||
|
} else if ((StringUtils.isEmpty(userEntity.getRoleCode()) || !RoleEnum.PLAT_ADMIN.getCode().equals(userEntity.getRoleCode())) &&
|
||||||
(userDO.getUserAccountType() == null || userDO.getUserAccountType() < 4)) {
|
(userDO.getUserAccountType() == null || userDO.getUserAccountType() < 4)) {
|
||||||
//给用户分配默认普通角色权限
|
//给用户分配默认普通角色权限
|
||||||
RoleDo roleDo = new RoleDo();
|
RoleDo roleDo = new RoleDo();
|
||||||
@@ -1432,7 +1435,9 @@ public class UserApplicationService {
|
|||||||
//组装新增用户信息
|
//组装新增用户信息
|
||||||
addUserInfo(userDO);
|
addUserInfo(userDO);
|
||||||
UserEntity userEntity = userDomainService.addUser(userDO);
|
UserEntity userEntity = userDomainService.addUser(userDO);
|
||||||
if ((StringUtils.isEmpty(userEntity.getRoleCode()) || !RoleEnum.PLAT_ADMIN.getCode().equals(userEntity.getRoleCode())) &&
|
if (isCustomerManagementPresetRole(userEntity.getRoleCode())) {
|
||||||
|
// 保持插入结果,不再改 role_code / user_role
|
||||||
|
} else if ((StringUtils.isEmpty(userEntity.getRoleCode()) || !RoleEnum.PLAT_ADMIN.getCode().equals(userEntity.getRoleCode())) &&
|
||||||
(userDO.getUserAccountType() == null || userDO.getUserAccountType() < 4)) {
|
(userDO.getUserAccountType() == null || userDO.getUserAccountType() < 4)) {
|
||||||
//给用户分配默认普通角色权限
|
//给用户分配默认普通角色权限
|
||||||
RoleDo roleDo = new RoleDo();
|
RoleDo roleDo = new RoleDo();
|
||||||
@@ -5139,6 +5144,18 @@ public class UserApplicationService {
|
|||||||
return userShipperDO;
|
return userShipperDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理入口(如 addCustomer)已按 customer/supplier 写入角色与 user_role,
|
||||||
|
* addUser 内对「非 plat_admin」统一覆盖为默认货主时会误伤此类用户,需跳过覆盖。
|
||||||
|
*/
|
||||||
|
private static boolean isCustomerManagementPresetRole(String roleCode) {
|
||||||
|
if (roleCode == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return RoleEnum.CUSTOMER.getCode().equals(roleCode)
|
||||||
|
|| RoleEnum.SUPPLIER.getCode().equals(roleCode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return boolean
|
* @return boolean
|
||||||
* @description 判断是否开启仓配一体
|
* @description 判断是否开启仓配一体
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public class CustomerDTO extends BaseVOEntity {
|
|||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
@ApiModelProperty("联系人")
|
@ApiModelProperty("联系人")
|
||||||
@NotBlank(message = "联系人不能为空")
|
|
||||||
private String emergencyContactName;
|
private String emergencyContactName;
|
||||||
|
|
||||||
@ApiModelProperty("联系电话")
|
@ApiModelProperty("联系电话")
|
||||||
|
|||||||
Reference in New Issue
Block a user