wms租赁定时任务推送到bms(把获取当前登录人的一级id改为参数传入)

This commit is contained in:
zhou-hongcheng
2026-02-26 09:36:53 +08:00
parent 2a570fbefc
commit 9621deccf1
9 changed files with 70 additions and 4 deletions
@@ -418,6 +418,16 @@ public class ExpenseAccountApplicationService {
return expenseAccountDomainService.getInfoByCode(subjectCode);
}
/**
* 根据编码查询费用科目信息
*/
public ExpenseAccountPO getInfoByCode2(String subjectCode,Long topOrganizationId) {
if(!StringUtils.isNotEmpty(subjectCode)){
throw new ServiceException("费用科目编码不能为空");
}
return expenseAccountDomainService.getInfoByCode2(subjectCode,topOrganizationId);
}
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO){
setDataPermissionForSearch(searchExpenseAccountDO);
return expenseAccountDomainService.selectExpenseAccount(searchExpenseAccountDO);
@@ -1,5 +1,6 @@
package com.mhd.basic.domain.expenseAccount.service;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mhd.basic.domain.expenseAccount.entity.ExpenseAccount;
import com.mhd.basic.domain.expenseAccount.repository.facade.IExpenseAccountService;
@@ -9,7 +10,10 @@ import com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDO;
import com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDoMap;
import com.mhd.basic.domain.expenseAccount.repository.todo.SearchExpenseAccountDO;
import com.mhd.basic.interfaces.dto.expenseAccount.SearchExpenseAccountDTO;
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.model.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -81,11 +85,22 @@ public class ExpenseAccountDomainService {
public ExpenseAccountPO getInfoByCode(String subjectCode) {
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
expenseAccountDO.setSubjectCode(subjectCode);
if (SecurityUtils.getLoginUser() != null) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (!ObjectUtil.isNull(loginUser)) {
expenseAccountDO.setTopOrganizationId(SecurityUtils.getLoginUser().getUserPo().getTopOrganizationId());
}
return expenseAccountService.getInfoByCode(expenseAccountDO);
}
/**
* 根据编码查询费用科目信息
*/
public ExpenseAccountPO getInfoByCode2(String subjectCode,Long topOrganizationId) {
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
expenseAccountDO.setSubjectCode(subjectCode);
expenseAccountDO.setTopOrganizationId(topOrganizationId);
return expenseAccountService.getInfoByCode(expenseAccountDO);
}
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO){
return expenseAccountService.selectExpenseAccount(searchExpenseAccountDO);
}
@@ -284,5 +284,13 @@ public class ExpenseAccountApi extends BaseController{
return AjaxResult.success(expenseAccountPO);
}
@ApiOperation("根据code获取费用科目")
@GetMapping(value = "/getInfoByCode2")
public AjaxResult getInfoByCode2(@RequestParam("subjectCode") String subjectCode,@RequestParam("topOrganizationId") Long topOrganizationId)
{
ExpenseAccountPO expenseAccountPO = expenseAccountApplicationService.getInfoByCode2(subjectCode,topOrganizationId);
return AjaxResult.success(expenseAccountPO);
}
}