Commit 035c615f by huluobin

update

parent 3426385d
......@@ -2,9 +2,9 @@ package com.blt.other.module.auth.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blt.other.module.auth.model.OaDepartment;
import com.blt.other.module.sys.dto.request.DepartmentReviewerListReq;
import com.blt.other.module.sys.dto.response.DepartmentReviewerListItem;
import com.blt.other.module.auth.model.OaDepartment;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -34,6 +34,7 @@ public interface OaDepartmentMapper extends BaseMapper<OaDepartment> {
OaDepartment selectByName(String name);
List<OaDepartment> allOaDepartment();
List<OaDepartment> selectByIds(@Param("collect") List<Integer> collect);
}
......@@ -25,4 +25,6 @@ public class CheckCostListReq {
@ApiModelProperty("1- 全部 2-待审核 3-已手动审核 4-已自动审核")
Integer status;
private String costNo;
private String bankCardUser;
}
......@@ -2,12 +2,12 @@ package com.blt.other.module.cost.service.impl.costcheck;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blt.other.common.exception.BizRuntimeException;
import com.blt.other.module.sys.model.CostReviewer;
import com.blt.other.database.model.CostCompanyDomain;
import com.blt.other.database.model.CostLogDomain;
import com.blt.other.module.cost.dao.CostLogDao;
import com.blt.other.module.cost.model.CostDomain;
import com.blt.other.module.cost.model.CostTemplate;
import com.blt.other.database.model.CostCompanyDomain;
import com.blt.other.database.model.CostLogDomain;
import com.blt.other.module.sys.model.CostReviewer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
......@@ -88,7 +88,7 @@ public class FinalCheckState extends CostState {
if (costContext.currentUserId != null) {
//人工审核通过
if (!costCurrentReviewerService.canAudit(currentUserId, costDomain.getCostNo())) {
if (costCurrentReviewerService.canAudit(currentUserId, costDomain.getCostNo())) {
costDomain.setCostStatus(CostDomain.STATUS_UN_PAY);
costDomain.setLastModifyDate(LocalDateTime.now());
costDao.updateById(costDomain);
......
......@@ -53,14 +53,20 @@ public class DepartmentReviewerServiceImpl extends ServiceImpl<DepartmentReviewe
public IPage<DepartmentReviewerListItem> departmentReviewerList(DepartmentReviewerListReq req) {
IPage<DepartmentReviewerListItem> page = new Page<>(req.getPageNum(), req.getPageSize());
page = baseMapper.departmentReviewerList(page, req);
if (ListUtil.isNotEmpty(page.getRecords())) {
Map<Integer, List<CostReviewer>> cMap = costReviewerMapper.selectList(new LambdaQueryWrapper<CostReviewer>()
.in(CostReviewer::getReferId, page.getRecords().stream().map(DepartmentReviewerListItem::getId).collect(Collectors.toList())))
.stream()
.collect(Collectors.groupingBy(CostReviewer::getReferId));
page.getRecords().forEach(departmentReviewerListItem -> departmentReviewerListItem.setCostReviewerList(cMap.get(departmentReviewerListItem.getId())));
Map<Integer, OaDepartment> dMap = oaDepartmentMapper.selectByIds(page.getRecords().stream().map(DepartmentReviewerListItem::getPrimaryDepartmentId).collect(Collectors.toList()))
.stream()
.collect(Collectors.toMap(OaDepartment::getDepartmentId, oaDepartment -> oaDepartment));
page.getRecords().forEach(departmentReviewerListItem -> departmentReviewerListItem.setCompanyName(dMap.get(departmentReviewerListItem.getPrimaryDepartmentId()).getCompanyName()));
}
return page;
}
......@@ -71,6 +77,8 @@ public class DepartmentReviewerServiceImpl extends ServiceImpl<DepartmentReviewe
DepartmentReviewer departmentReviewer = this.getById(req.getId());
departmentReviewer.setAutoReviewAmount(req.getAutoReviewerAmount());
departmentReviewer.setUpdateUserId(SessionUtils.getCurrentUserId());
departmentReviewer.setUpdateUserName(SessionUtils.getSysUser().getUserName());
if (ListUtil.isNotEmpty(req.getDepartmentReviewerUserIdList())) {
costReviewerMapper.delete(new LambdaQueryWrapper<CostReviewer>()
......
......@@ -470,6 +470,9 @@
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status = 6
and t3.id is not null
<if test="req.bankCardUser !=null and req.bankCardUser !=''">
and t1.bank_card_user like concat('%',#{req.bankCardUser},'%')
</if>
</select>
<!--待我部门审核 + 我已经部门手动审核 + 我已经部门自动审核-->
......@@ -485,6 +488,9 @@
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status = 6
and t3.id is not null
<if test="req.bankCardUser !=null and req.bankCardUser !=''">
and t1.bank_card_user like concat('%',#{req.bankCardUser},'%')
</if>
</select>
<!--我手动部门审核过的 -->
......@@ -495,6 +501,9 @@
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status not in (0, 3, 5)
and t2.id is not null
<if test="req.bankCardUser !=null and req.bankCardUser !=''">
and t1.bank_card_user like concat('%',#{req.bankCardUser},'%')
</if>
</select>
<!--我部门自动审核过的 -->
......@@ -505,6 +514,9 @@
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status not in (0, 3, 5)
and t2.id is not null
<if test="req.bankCardUser !=null and req.bankCardUser !=''">
and t1.bank_card_user like concat('%',#{req.bankCardUser},'%')
</if>
</select>
<!--需要我财务审核的-->
......@@ -514,6 +526,9 @@
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status = 6
and t3.id is not null
<if test="req.bankCardUser !=null and req.bankCardUser !=''">
and t1.bank_card_user like concat('%',#{req.bankCardUser},'%')
</if>
</select>
<!--需要我人事审核的-->
......@@ -523,6 +538,9 @@
left join cost_current_reviewer t3 on t1.cost_no = t3.cost_no and t3.oa_user_id = #{req.userid}
where t1.cost_status = 9
and t3.id is not null
</select>
<if test="req.bankCardUser !=null and req.bankCardUser !=''">
and t1.bank_card_user like concat('%',#{req.bankCardUser},'%')
</if>
</select>
</mapper>
......@@ -49,6 +49,16 @@
from oa_department
where name = #{name}
</select>
<select id="selectByIds" resultType="com.blt.other.module.auth.model.OaDepartment">
select t1.*,
t2.name company_name
from oa_department t1
left join oa_company t2 on t1.company_id = t2.oa_company_id
where department_id in
<foreach collection="collect" item="departmentId" index="index" open="(" close=")" separator=",">
<if test="departmentId != null and departmentId != 0">#{departmentId}</if>
</foreach>
</select>
</mapper>
......@@ -4,12 +4,9 @@
<select id="departmentReviewerList"
resultType="com.blt.other.module.sys.dto.response.DepartmentReviewerListItem">
select t1.*,
t4.name company_name
select t1.*
from department_reviewer t1
left join cost_reviewer t2 on t1.id = t2.refer_id
left join oa_department t3 on t1.primary_department_id =t3.department_id
left join oa_company t4 on t3.company_id = t4.oa_company_id
where true
<if test="req.reviewerUserId !=null">
and t2.reviewer_user_id =#{req.reviewerUserId}
......
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