委托方添加查不到问题修改;

This commit is contained in:
王奎兴
2026-03-20 14:52:10 +08:00
parent d6e6e2dc7c
commit 5fdd55f2de
@@ -796,6 +796,76 @@ public class UserApplicationService {
}
}
public void addUserInfoShipper(UserDO userDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.USER_NULL);
}
UserPo loginUserPo = loginUser.getUserPo();
CheckDO checkDO = userFactory.getCheckDo(userDO);
//用户密码传值
if (StringUtils.isNotEmpty(userDO.getUserPassword())) {
String userPassword = AESUtil.decrypt(userDO.getUserPassword());
checkDO.setUserPassword(userPassword);
}
//用户信息格式校验
// 生成随机8位数盐
String salt = OConvertUtils.randomGen(8);
userDO.setUserSalt(salt);
regCheck(checkDO);
//用户密码传值
if (StringUtils.isNotEmpty(userDO.getUserPassword())) {
String userPassword = AESUtil.decrypt(userDO.getUserPassword());
//加密算法,PBEWithMD5AndDES
String passwordEncode = PasswordUtil.encrypt(userDO.getUserAccount(), userPassword, salt);
userDO.setUserPassword(passwordEncode);
}
//用户账号传值
if (StringUtils.isNotEmpty(userDO.getUserAccount())) {
UserPo userPoDB = userDomainService.findByTopOrganizationIdAndUserAccount(userDO);
if (ObjectUtil.isNotNull(userPoDB)) {
throw new DigitalLogisticsException(UserError.USER_ACCOUNT_EXIST);
}
}
//用户手机号传值
if (StringUtils.isNotEmpty(userDO.getUserPhone())) {
UserPo userPoDB = userDomainService.findByTopOrganizationIdAndUserPhone(userDO);
if (ObjectUtil.isNotNull(userPoDB)) {
throw new DigitalLogisticsException(UserError.USER_PHONE_EXIST);
}
}
//用户身份证号传值
if (StringUtils.isNotEmpty(userDO.getUserIdcardNumber())) {
UserPo userPoDB = userDomainService.findByTopOrganizationIdAndIdCard(userDO);
if (ObjectUtil.isNotNull(userPoDB)) {
throw new DigitalLogisticsException(UserError.USER_IDCARD_EXIST);
}
//身份证号加密
String idCard = userDO.getUserIdcardNumber();
//身份证脱敏
String idCardDes = DesensitizedUtil.desensitizedIdNumber(idCard);
userDO.setUserIdcardNumberDes(idCardDes);
}
userDO.setCreateBy(loginUserPo.getUserId());
userDO.setCreateByName(loginUserPo.getUserName());
if (loginUserPo.getUserAccountType() != null && loginUserPo.getUserAccountType() == 5) {
userDO.setCreateBy(loginUserPo.getCreateBy());
userDO.setCreateByName(loginUserPo.getCreateByName());
}
userDO.setCreateTime(new Date());
//用户状态:0-无状态,1-正常,2-锁定
userDO.setUserStatus(1);
//用户实名认证状态:0-无状态,1-已注册未认证,2-已认证待审核,3-审核通过,4-已驳回
userDO.setUserAuthStatus(1);
//删除标记:0-无状态,1-正常,2-已删除
userDO.setDelFlag(1);
userDO.setBusinessType(1);
if (ObjectUtil.isNull(userDO.getUserAccount()) && ObjectUtil.isNotNull(userDO.getUserPhone())) {
userDO.setUserAccount(userDO.getUserPhone());
}
}
/**
* @Description 组装新增用户信息
* @Author Alex
@@ -1247,7 +1317,7 @@ public class UserApplicationService {
}
//组装新增用户信息
addUserInfo(userDO);
addUserInfoShipper(userDO);
UserEntity userEntity = userDomainService.addUser(userDO);
if ((StringUtils.isEmpty(userEntity.getRoleCode()) || !RoleEnum.PLAT_ADMIN.getCode().equals(userEntity.getRoleCode())) &&
(userDO.getUserAccountType() == null || userDO.getUserAccountType() < 4)) {