BMS列表“创建人、修改人”保存用户姓名,不保存账号

This commit is contained in:
秦鸿展
2026-02-26 11:29:00 +08:00
parent 333b21935d
commit ec4e20fbe7
17 changed files with 172 additions and 38 deletions
@@ -33,7 +33,15 @@ public class BillingRulesAssembler {
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取用户姓名,优先使用userPo中的userName,如果为空则使用realname,最后使用username
String userName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null) {
userName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null) {
userName = loginUser.getRealname();
} else {
userName = loginUser.getUsername();
}
// 获取登录人id
Long userId = loginUser.getUserid();
if(billingRulesDTO.getBillingRulesId() != null){
@@ -35,7 +35,15 @@ public class BillingStatementAssembler {
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取用户姓名,优先使用userPo中的userName,如果为空则使用realname,最后使用username
String userName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null) {
userName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null) {
userName = loginUser.getRealname();
} else {
userName = loginUser.getUsername();
}
// 获取登录人id
Long userId = loginUser.getUserid();
if(billingStatementDTO.getBillingStatementId() != null){
@@ -72,7 +80,15 @@ public class BillingStatementAssembler {
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取用户姓名,优先使用userPo中的userName,如果为空则使用realname,最后使用username
String userName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null) {
userName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null) {
userName = loginUser.getRealname();
} else {
userName = loginUser.getUsername();
}
// 获取登录人id
Long userId = loginUser.getUserid();
if(billingStatementCollectDTO.getBillingStatementId() != null){
@@ -33,7 +33,15 @@ public class ConditionalMappingAssembler {
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取用户姓名,优先使用userPo中的userName,如果为空则使用realname,最后使用username
String userName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null) {
userName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null) {
userName = loginUser.getRealname();
} else {
userName = loginUser.getUsername();
}
// 获取登录人id
Long userId = loginUser.getUserid();
if(conditionalMappingDTO.getConditionalMappingId() != null){
@@ -33,7 +33,15 @@ public class DocumentTypeAssembler {
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取用户姓名,优先使用userPo中的userName,如果为空则使用realname,最后使用username
String userName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null) {
userName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null) {
userName = loginUser.getRealname();
} else {
userName = loginUser.getUsername();
}
// 获取登录人id
Long userId = loginUser.getUserid();
if(documentTypeDTO.getDocumentTypeId() != null){
@@ -33,7 +33,15 @@ public class MappingMethodAssembler {
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取用户姓名,优先使用userPo中的userName,如果为空则使用realname,最后使用username
String userName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null) {
userName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null) {
userName = loginUser.getRealname();
} else {
userName = loginUser.getUsername();
}
// 获取登录人id
Long userId = loginUser.getUserid();
if(mappingMethodDTO.getMappingMethodId() != null){
@@ -33,7 +33,15 @@ public class SettlementCustomersAssembler {
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取用户姓名,优先使用userPo中的userName,如果为空则使用realname,最后使用username
String userName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null) {
userName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null) {
userName = loginUser.getRealname();
} else {
userName = loginUser.getUsername();
}
// 获取登录人id
Long userId = loginUser.getUserid();
if(settlementCustomersDTO.getSettlementCustomersId() != null){
@@ -4,6 +4,7 @@ import java.util.List;
import com.mhd.bms.application.server.conditionalMapping.ConditionalMappingApplicationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.mhd.bms.interfaces.dto.conditionalMapping.ConditionalMappingDTO;
@@ -37,8 +38,9 @@ public class ConditionalMappingApi extends BaseController{
@GetMapping("/list")
public TableDataInfo list(ConditionalMappingDTO conditionalMappingDTO)
{
//转换实体
ConditionalMappingDO conditionalMappingDO = conditionalMappingAssembler.toDO(conditionalMappingDTO);
//转换实体(查询时不需要设置创建人和更新人信息)
ConditionalMappingDO conditionalMappingDO = new ConditionalMappingDO();
BeanUtils.copyProperties(conditionalMappingDTO, conditionalMappingDO);
startPage();
List<ConditionalMappingPO> list = conditionalMappingApplicationService.queryList(conditionalMappingDO);
return getDataTable(list);
@@ -41,8 +41,9 @@ public class DocumentTypeApi extends BaseController{
@GetMapping("/list")
public TableDataInfo list(DocumentTypeDTO documentTypeDTO)
{
//转换实体
DocumentTypeDO documentTypeDO = documentTypeAssembler.toDO(documentTypeDTO);
//转换实体(查询时不需要设置创建人和更新人信息)
DocumentTypeDO documentTypeDO = new DocumentTypeDO();
BeanUtils.copyProperties(documentTypeDTO, documentTypeDO);
startPage();
List<DocumentTypePO> list = documentTypeApplicationService.queryList(documentTypeDO);
return getDataTable(list);