Commit 3a9956cc authored by fangxinjiang's avatar fangxinjiang

结算主体ID

parent 53fc3ca9
...@@ -64,7 +64,7 @@ public class TConfigSalaryController { ...@@ -64,7 +64,7 @@ public class TConfigSalaryController {
@Operation(description = "简单分页查询") @Operation(description = "简单分页查询")
@GetMapping("/page") @GetMapping("/page")
public R<IPage<TConfigSalary>> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary) { public R<IPage<TConfigSalary>> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary) {
return new R<>(tConfigSalaryService.getTConfigSalaryPage(page, tConfigSalary)); return tConfigSalaryService.getTConfigSalaryPage(page, tConfigSalary);
} }
......
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TConfigSalary; import com.yifu.cloud.plus.v1.yifu.salary.entity.TConfigSalary;
/** /**
...@@ -19,7 +20,7 @@ public interface TConfigSalaryService extends IService<TConfigSalary> { ...@@ -19,7 +20,7 @@ public interface TConfigSalaryService extends IService<TConfigSalary> {
* @param tConfigSalary 工资报账配置 * @param tConfigSalary 工资报账配置
* @return * @return
*/ */
IPage<TConfigSalary> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary); R<IPage<TConfigSalary>> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary);
} }
...@@ -34,26 +34,23 @@ public class TConfigSalaryServiceImpl extends ServiceImpl<TConfigSalaryMapper, T ...@@ -34,26 +34,23 @@ public class TConfigSalaryServiceImpl extends ServiceImpl<TConfigSalaryMapper, T
* @return * @return
*/ */
@Override @Override
public IPage<TConfigSalary> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary){ public R<IPage<TConfigSalary>> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
TSettleDomainListVo vo = null; TSettleDomainListVo vo = null;
if (Common.isNotNull(user)) { if (Common.isNotNull(user)) {
R<TSettleDomainListVo> domainListVoR = archivesDaprUtil.getSettleDomainIdsByUserId(user.getId()); R<TSettleDomainListVo> domainListVoR = archivesDaprUtil.getSettleDomainIdsByUserId(user.getId());
if (Common.isEmpty(domainListVoR)) { if (Common.isEmpty(domainListVoR)) {
throw new RuntimeException("调用结算服务失败"); return R.failed("调用结算服务失败");
} }
if (CommonConstants.SUCCESS != domainListVoR.getCode()) { if (CommonConstants.SUCCESS != domainListVoR.getCode()) {
throw new RuntimeException("调用结算服务返回失败"); return R.failed("调用结算服务返回失败");
} }
vo = domainListVoR.getData(); vo = domainListVoR.getData();
if (Common.isEmpty(vo) || !Common.isNotEmpty(vo.getDeptIds())) {
throw new RuntimeException("无项目权限");
} }
if (Common.isNotNull(vo)){
return R.ok(baseMapper.getTConfigSalaryPage(page, tConfigSalary, vo.getDeptIds()));
} }
if (Common.isEmpty(vo)){ return R.ok(baseMapper.getTConfigSalaryPage(page, tConfigSalary, null));
return baseMapper.getTConfigSalaryPage(page, tConfigSalary, vo.getDeptIds());
}
return baseMapper.getTConfigSalaryPage(page, tConfigSalary, null);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment