Commit 035c615f by huluobin

update

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