BMS列表“创建人、修改人”保存用户姓名,不保存账号
This commit is contained in:
+9
-1
@@ -35,7 +35,15 @@ public class ExpenseAccountAssembler {
|
||||
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();
|
||||
|
||||
|
||||
+9
-1
@@ -35,7 +35,15 @@ public class ServiceItemsManageAssembler {
|
||||
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();
|
||||
|
||||
|
||||
+3
-8
@@ -57,18 +57,13 @@ public class ExpenseAccountApi extends BaseController{
|
||||
{
|
||||
logger.info("收到查询费用科目列表请求,参数:{}", expenseAccountDTO);
|
||||
try {
|
||||
//转换实体,如果 expenseAccountDTO 为 null,创建一个新的对象
|
||||
//转换实体(查询时不需要设置创建人和更新人信息)
|
||||
if (expenseAccountDTO == null) {
|
||||
expenseAccountDTO = new ExpenseAccountDTO();
|
||||
logger.info("expenseAccountDTO 为 null,创建新对象");
|
||||
}
|
||||
ExpenseAccountDO expenseAccountDO = expenseAccountAssembler.toDO(expenseAccountDTO);
|
||||
if(StringUtils.isBlank(expenseAccountDTO.getCreateByName())){
|
||||
expenseAccountDO.setCreateByName(null);
|
||||
}
|
||||
if(StringUtils.isBlank(expenseAccountDTO.getUpdateByName())){
|
||||
expenseAccountDO.setUpdateByName(null);
|
||||
}
|
||||
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
|
||||
BeanUtils.copyProperties(expenseAccountDTO, expenseAccountDO);
|
||||
logger.info("转换后的 ExpenseAccountDO:{}", expenseAccountDO);
|
||||
startPage();
|
||||
logger.info("分页参数已设置");
|
||||
|
||||
+4
-8
@@ -9,6 +9,7 @@ import com.mhd.basic.interfaces.assember.serviceItemsManage.ServiceItemsManageAs
|
||||
import com.mhd.basic.interfaces.dto.serviceItemsManage.ServiceItemsManageDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -39,14 +40,9 @@ public class ServiceItemsManageApi extends BaseController{
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ServiceItemsManageDTO serviceItemsManageDTO)
|
||||
{
|
||||
//转换实体
|
||||
ServiceItemsManageDO serviceItemsManageDO = serviceItemsManageAssembler.toDO(serviceItemsManageDTO);
|
||||
if(StringUtils.isBlank(serviceItemsManageDTO.getCreateByName())){
|
||||
serviceItemsManageDO.setCreateByName(null);
|
||||
}
|
||||
if(StringUtils.isBlank(serviceItemsManageDTO.getUpdateByName())){
|
||||
serviceItemsManageDO.setUpdateByName(null);
|
||||
}
|
||||
//转换实体(查询时不需要设置创建人和更新人信息)
|
||||
ServiceItemsManageDO serviceItemsManageDO = new ServiceItemsManageDO();
|
||||
BeanUtils.copyProperties(serviceItemsManageDTO, serviceItemsManageDO);
|
||||
startPage();
|
||||
List<ServiceItemsManagePO> list = serviceItemsManageApplicationService.queryList(serviceItemsManageDO);
|
||||
return getDataTable(list);
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
WHERE
|
||||
a.del_flag = 1
|
||||
<include refid="common_where"/>
|
||||
order by a.update_time DESC
|
||||
order by a.create_time DESC
|
||||
</select>
|
||||
<select id="selectCostSubject" parameterType="com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDO"
|
||||
resultType="com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO">
|
||||
|
||||
+34
-4
@@ -38,10 +38,40 @@ public class ConditionalMappingApplicationService {
|
||||
|
||||
public List<ConditionalMappingPO> queryList(ConditionalMappingDO conditionalMappingDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
conditionalMappingDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||
Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
|
||||
Long frontendOrganizationId = conditionalMappingDO.getOrganizationId(); // 前端传递的 organizationId
|
||||
|
||||
// 当前登录用户的 organizationId 为 2827 时,可查全部组织数据;其他组织只能查自己且 topOrganizationId=2827
|
||||
if (userOrganizationId != null && userOrganizationId == 2827L) {
|
||||
// 南光组织(organizationId=2827):可以查询所有组织的数据
|
||||
if (frontendOrganizationId != null) {
|
||||
// 前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤
|
||||
conditionalMappingDO.setOrganizationId(frontendOrganizationId);
|
||||
conditionalMappingDO.setTopOrganizationId(null); // 明确设置为 null,避免使用 topOrganizationId 条件
|
||||
} else {
|
||||
// 前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据
|
||||
conditionalMappingDO.setOrganizationId(null);
|
||||
conditionalMappingDO.setTopOrganizationId(null);
|
||||
}
|
||||
} else {
|
||||
// 其他组织:设置organizationId为当前组织ID,并且设置topOrganizationId=2827
|
||||
// 如果前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (frontendOrganizationId != null && userOrganizationId != null) {
|
||||
// 前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (!frontendOrganizationId.equals(userOrganizationId)) {
|
||||
// 前端传递了其他组织的 organizationId,强制使用当前登录用户的组织ID,防止越权查询
|
||||
conditionalMappingDO.setOrganizationId(userOrganizationId);
|
||||
}
|
||||
// 如果前端传递的 organizationId 与当前登录用户的组织ID一致,使用前端传递的值
|
||||
} else {
|
||||
// 前端没有传递 organizationId,使用当前登录用户的组织ID
|
||||
if (userOrganizationId != null) {
|
||||
conditionalMappingDO.setOrganizationId(userOrganizationId);
|
||||
}
|
||||
}
|
||||
// 对于非2827组织,必须设置 topOrganizationId=2827
|
||||
conditionalMappingDO.setTopOrganizationId(2827L);
|
||||
}
|
||||
}
|
||||
return conditionalMappingDomainService.queryList(conditionalMappingDO);
|
||||
|
||||
+34
-4
@@ -37,10 +37,40 @@ public class MappingMethodApplicationService {
|
||||
|
||||
public List<MappingMethodPO> queryList(MappingMethodDO mappingMethodDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
mappingMethodDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||
Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
|
||||
Long frontendOrganizationId = mappingMethodDO.getOrganizationId(); // 前端传递的 organizationId
|
||||
|
||||
// 当前登录用户的 organizationId 为 2827 时,可查全部组织数据;其他组织只能查自己且 topOrganizationId=2827
|
||||
if (userOrganizationId != null && userOrganizationId == 2827L) {
|
||||
// 南光组织(organizationId=2827):可以查询所有组织的数据
|
||||
if (frontendOrganizationId != null) {
|
||||
// 前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤
|
||||
mappingMethodDO.setOrganizationId(frontendOrganizationId);
|
||||
mappingMethodDO.setTopOrganizationId(null); // 明确设置为 null,避免使用 topOrganizationId 条件
|
||||
} else {
|
||||
// 前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据
|
||||
mappingMethodDO.setOrganizationId(null);
|
||||
mappingMethodDO.setTopOrganizationId(null);
|
||||
}
|
||||
} else {
|
||||
// 其他组织:设置organizationId为当前组织ID,并且设置topOrganizationId=2827
|
||||
// 如果前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (frontendOrganizationId != null && userOrganizationId != null) {
|
||||
// 前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (!frontendOrganizationId.equals(userOrganizationId)) {
|
||||
// 前端传递了其他组织的 organizationId,强制使用当前登录用户的组织ID,防止越权查询
|
||||
mappingMethodDO.setOrganizationId(userOrganizationId);
|
||||
}
|
||||
// 如果前端传递的 organizationId 与当前登录用户的组织ID一致,使用前端传递的值
|
||||
} else {
|
||||
// 前端没有传递 organizationId,使用当前登录用户的组织ID
|
||||
if (userOrganizationId != null) {
|
||||
mappingMethodDO.setOrganizationId(userOrganizationId);
|
||||
}
|
||||
}
|
||||
// 对于非2827组织,必须设置 topOrganizationId=2827
|
||||
mappingMethodDO.setTopOrganizationId(2827L);
|
||||
}
|
||||
}
|
||||
return mappingMethodDomainService.queryList(mappingMethodDO);
|
||||
|
||||
+9
-1
@@ -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){
|
||||
|
||||
+18
-2
@@ -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){
|
||||
|
||||
+9
-1
@@ -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){
|
||||
|
||||
+9
-1
@@ -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){
|
||||
|
||||
+9
-1
@@ -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){
|
||||
|
||||
+9
-1
@@ -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);
|
||||
|
||||
@@ -16,12 +16,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHERE
|
||||
del_flag = 1
|
||||
<include refid="common_where"></include>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<sql id="common_where">
|
||||
<if test="conditionalMappingDO.topOrganizationId != null and conditionalMappingDO.topOrganizationId != ''">
|
||||
AND top_organization_id = #{conditionalMappingDO.topOrganizationId}
|
||||
</if>
|
||||
<if test="conditionalMappingDO.organizationId != null">
|
||||
AND organization_id = #{conditionalMappingDO.organizationId}
|
||||
</if>
|
||||
<if test="conditionalMappingDO.sourceContent != null and conditionalMappingDO.sourceContent != ''">
|
||||
AND source_content like concat('%', #{conditionalMappingDO.sourceContent}, '%')
|
||||
</if>
|
||||
|
||||
@@ -14,12 +14,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from mapping_method
|
||||
where del_flag = 1
|
||||
<include refid="common_where"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<sql id="common_where">
|
||||
<if test="mappingMethodDO.topOrganizationId != null and mappingMethodDO.topOrganizationId != ''">
|
||||
AND top_organization_id = #{mappingMethodDO.topOrganizationId}
|
||||
</if>
|
||||
<if test="mappingMethodDO.organizationId != null">
|
||||
AND organization_id = #{mappingMethodDO.organizationId}
|
||||
</if>
|
||||
<if test="mappingMethodDO.methodName != null and mappingMethodDO.methodName != ''">
|
||||
and method_name like concat('%', #{mappingMethodDO.methodName}, '%')
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user