Commit 714b818c by huluobin

# 费用系统 部门审核人和最终审核人是同一个人,最终审核人自动通过

parent 17041cf2
package com.blt.other.module.cost.dao; package com.blt.other.module.cost.dao;
import com.blt.other.module.cost.model.CostCurrentReviewer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blt.other.module.cost.model.CostCurrentReviewer;
import java.util.List;
/** /**
* <p> * <p>
...@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface CostCurrentReviewerMapper extends BaseMapper<CostCurrentReviewer> { public interface CostCurrentReviewerMapper extends BaseMapper<CostCurrentReviewer> {
//查询当前审核人
List<CostCurrentReviewer> selectByCostNo(String costNo);
} }
...@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException; import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.database.model.CostCompanyDomain; import com.blt.other.database.model.CostCompanyDomain;
import com.blt.other.database.model.CostLogDomain; import com.blt.other.database.model.CostLogDomain;
import com.blt.other.module.cost.dao.CostCurrentReviewerMapper;
import com.blt.other.module.cost.dao.CostLogDao; import com.blt.other.module.cost.dao.CostLogDao;
import com.blt.other.module.cost.model.CostCurrentReviewer;
import com.blt.other.module.cost.model.CostDomain; import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.model.CostTemplate; import com.blt.other.module.cost.model.CostTemplate;
import com.blt.other.module.sys.model.CostReviewer; import com.blt.other.module.sys.model.CostReviewer;
...@@ -33,6 +35,8 @@ public class FinalCheckState extends CostState { ...@@ -33,6 +35,8 @@ public class FinalCheckState extends CostState {
UnPayState unPayState; UnPayState unPayState;
@Resource @Resource
CostLogDao costLogDao; CostLogDao costLogDao;
@Resource
CostCurrentReviewerMapper costCurrentReviewerMapper;
private void autoPass() { private void autoPass() {
CostDomain costDomain = costContext.costDomain; CostDomain costDomain = costContext.costDomain;
...@@ -63,7 +67,8 @@ public class FinalCheckState extends CostState { ...@@ -63,7 +67,8 @@ public class FinalCheckState extends CostState {
//部门审核人和最终审核人是同一个人,最终审核人自动通过。 //部门审核人和最终审核人是同一个人,最终审核人自动通过。
CostLogDomain costLogDomain = costLogDao.selectDepartmentCheckLog(costDomain.getCostNo()); CostLogDomain costLogDomain = costLogDao.selectDepartmentCheckLog(costDomain.getCostNo());
if (costLogDomain != null && costLogDomain.getUpdateUserid().equals(currentUserId)) { List<CostCurrentReviewer> costCurrentReviewerList = costCurrentReviewerMapper.selectByCostNo(costDomain.getCostNo());
if (costLogDomain != null && costCurrentReviewerList.stream().map(CostCurrentReviewer::getOaUserId).collect(Collectors.toList()).contains(costLogDomain.getUpdateUserid())) {
log.info("费用单:{}部门审核人和最终审核人是同一个人,最终审核人自动通过。", costDomain.getCostNo()); log.info("费用单:{}部门审核人和最终审核人是同一个人,最终审核人自动通过。", costDomain.getCostNo());
this.autoPass(); this.autoPass();
return; return;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
WHERE cost_no = #{costNo} WHERE cost_no = #{costNo}
ORDER BY id DESC ORDER BY id DESC
</select> </select>
<select id="selectDepartmentCheckLog" resultType="com.blt.other.database.model.CostLogDomain"> <select id="selectDepartmentCheckLog" resultType="com.blt.other.database.model.CostLogDomain">
select * select *
from cost_log from cost_log
......
...@@ -2,4 +2,9 @@ ...@@ -2,4 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.blt.other.module.cost.dao.CostCurrentReviewerMapper"> <mapper namespace="com.blt.other.module.cost.dao.CostCurrentReviewerMapper">
<select id="selectByCostNo" resultType="com.blt.other.module.cost.model.CostCurrentReviewer">
select *
from cost_current_reviewer
where cost_no = #{costNo}
</select>
</mapper> </mapper>
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