From a0be8dd44dfb4216293cfffdbb8ef1c406818b1f Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期五, 18 八月 2023 11:50:54 +0800
Subject: [PATCH] #产出计算
---
server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java | 3 +++
server/src/main/resources/mappers/SalaryParamMapper.xml | 2 ++
server/src/main/java/doumeemes/dao/ext/dto/SalaryParamDTO.java | 9 +++++++++
server/src/main/java/doumeemes/config/shiro/ShiroRealm.java | 6 +++---
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/server/src/main/java/doumeemes/config/shiro/ShiroRealm.java b/server/src/main/java/doumeemes/config/shiro/ShiroRealm.java
index 9616225..0ab3aa0 100644
--- a/server/src/main/java/doumeemes/config/shiro/ShiroRealm.java
+++ b/server/src/main/java/doumeemes/config/shiro/ShiroRealm.java
@@ -125,11 +125,11 @@
per.setType(Constants.PlatType.admin);
}else{
if(authenticationToken.getCompanyId() == null){
- throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇ヨ处鎴峰紓甯革紒");
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝璇ヨ处鎴峰垹闄わ紒");
}
com = companyExtService.getModelById(authenticationToken.getCompanyId());
- if(com == null){
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ヨ处鎴峰紓甯革紒");
+ if(com == null || Constants.equalsInteger( com.getDeleted(),Constants.ONE)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ヨ处鎴峰紓甯革紒璇疯仈绯荤鐞嗗憳");
}
if(Constants.equalsInteger( com.getStatus(),Constants.ZERO) ){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ヤ紒涓氬凡绂佺敤锛�");
diff --git a/server/src/main/java/doumeemes/dao/ext/dto/SalaryParamDTO.java b/server/src/main/java/doumeemes/dao/ext/dto/SalaryParamDTO.java
index 7d9ba3e..2c28097 100644
--- a/server/src/main/java/doumeemes/dao/ext/dto/SalaryParamDTO.java
+++ b/server/src/main/java/doumeemes/dao/ext/dto/SalaryParamDTO.java
@@ -1,8 +1,11 @@
package doumeemes.dao.ext.dto;
+import doumeemes.core.annotation.excel.ExcelColumn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
/**
* @author 姹熻箘韫�
@@ -21,4 +24,10 @@
@ApiModelProperty(value = "璁′环鏂瑰紡 0璁′欢 1璁℃椂")
private Integer type;
+ @ApiModelProperty(value = "涓荤粍缁囩紪鐮侊紙鍏宠仈department琛ㄦ牴缁勭粐锛�")
+ private Integer rootDepartId;
+
+ @ApiModelProperty(value = "宸ュ巶缂栫爜锛堝叧鑱攄epartment琛級")
+ private Integer departId;
+
}
diff --git a/server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java b/server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java
index a149ede..b83e401 100644
--- a/server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java
+++ b/server/src/main/java/doumeemes/service/business/impl/SalaryParamServiceImpl.java
@@ -155,7 +155,10 @@
@Override
public PageData<SalaryParamVO> findPage(PageWrap<SalaryParamDTO> pageWrap) {
IPage<SalaryParam> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
SalaryParamDTO model = pageWrap.getModel();
+ model.setRootDepartId(principal.getRootDepartment().getId());
+ model.setDepartId(principal.getComDepartment().getId());
IPage<SalaryParamVO> salaryParamVOIPage = salaryParamMapper.selectPage(page, model);
if (!CollectionUtils.isEmpty(salaryParamVOIPage.getRecords())){
salaryParamVOIPage.getRecords().forEach(s->s.setSalary(s.getSalary().divide(new BigDecimal(100))));
diff --git a/server/src/main/resources/mappers/SalaryParamMapper.xml b/server/src/main/resources/mappers/SalaryParamMapper.xml
index 34d04dd..9ee4b05 100644
--- a/server/src/main/resources/mappers/SalaryParamMapper.xml
+++ b/server/src/main/resources/mappers/SalaryParamMapper.xml
@@ -23,6 +23,8 @@
or m.`CODE` = #{model.keyWord})</if>
<if test="model.procedureName != null and model.procedureName != ''"> and p.`NAME` like concat('%',#{model.procedureName},'%')</if>
<if test="model.type != null"> and sp.`TYPE` = #{model.type}</if>
+ <if test="model.rootDepartId != null"> and sp.`ROOT_DEPART_ID` = #{model.rootDepartId}</if>
+ <if test="model.departId != null"> and sp.`DEPART_ID` = #{model.departId}</if>
order by sp.CREATE_TIME desc
</select>
</mapper>
--
Gitblit v1.9.3