Commit 714b818c by huluobin

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

parent 17041cf2
package com.blt.other.module.cost.dao;
import com.blt.other.module.cost.model.CostCurrentReviewer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blt.other.module.cost.model.CostCurrentReviewer;
import java.util.List;
/**
* <p>
......@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface CostCurrentReviewerMapper extends BaseMapper<CostCurrentReviewer> {
//查询当前审核人
List<CostCurrentReviewer> selectByCostNo(String costNo);
}
......@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.database.model.CostCompanyDomain;
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.model.CostCurrentReviewer;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.model.CostTemplate;
import com.blt.other.module.sys.model.CostReviewer;
......@@ -33,6 +35,8 @@ public class FinalCheckState extends CostState {
UnPayState unPayState;
@Resource
CostLogDao costLogDao;
@Resource
CostCurrentReviewerMapper costCurrentReviewerMapper;
private void autoPass() {
CostDomain costDomain = costContext.costDomain;
......@@ -63,7 +67,8 @@ public class FinalCheckState extends CostState {
//部门审核人和最终审核人是同一个人,最终审核人自动通过。
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());
this.autoPass();
return;
......
......@@ -17,6 +17,7 @@
WHERE cost_no = #{costNo}
ORDER BY id DESC
</select>
<select id="selectDepartmentCheckLog" resultType="com.blt.other.database.model.CostLogDomain">
select *
from cost_log
......
......@@ -2,4 +2,9 @@
<!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">
<select id="selectByCostNo" resultType="com.blt.other.module.cost.model.CostCurrentReviewer">
select *
from cost_current_reviewer
where cost_no = #{costNo}
</select>
</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