Commit 9d52c47a by huluobin

hr check

parent dd9d1615
...@@ -47,6 +47,13 @@ public class CostReviewerController { ...@@ -47,6 +47,13 @@ public class CostReviewerController {
return CostResult.success(oaDepartmentIPage); return CostResult.success(oaDepartmentIPage);
} }
@ApiOperation("获取财务审核人、最终审核人呢、行政审核人配置列表")
@GetMapping("/companyReviewerList")
public CostResult<IPage<CostCompanyDomain>> companyReviewerList(CompanyReviewerListReq req) {
IPage<CostCompanyDomain> costCompanyDomainIPage = costCompanyService.reviewerList(req);
return CostResult.success(costCompanyDomainIPage);
}
@ApiOperation("/修改最终审核人") @ApiOperation("/修改最终审核人")
@GetMapping("/modifyFinalReviewer") @GetMapping("/modifyFinalReviewer")
...@@ -63,20 +70,20 @@ public class CostReviewerController { ...@@ -63,20 +70,20 @@ public class CostReviewerController {
public CostResult<Void> modifyFinancialReviewer(@RequestParam Integer userId, public CostResult<Void> modifyFinancialReviewer(@RequestParam Integer userId,
@RequestParam @ApiParam("财务公司主体 逗号分隔") List<String> companyNoList, @RequestParam @ApiParam("财务公司主体 逗号分隔") List<String> companyNoList,
@RequestParam @ApiParam("oa用户id 逗号分隔") List<Integer> financialReviewerUserIdList) { @RequestParam @ApiParam("oa用户id 逗号分隔") List<Integer> financialReviewerUserIdList) {
costCompanyService.modifyFinancialReviewer(userId, companyNoList, financialReviewerUserIdList); costCompanyService.modifyFinancialReviewer(userId, companyNoList, financialReviewerUserIdList);
return CostResult.success(); return CostResult.success();
} }
@ApiOperation("获取财务审核人配置列表") @ApiOperation("/修改行政审核")
@GetMapping("/companyReviewerList") @GetMapping("/modifyHrReviewer")
public CostResult<IPage<CostCompanyDomain>> companyReviewerList(CompanyReviewerListReq req) { public CostResult<Void> modifyHrReviewer(@RequestParam Integer userId,
IPage<CostCompanyDomain> costCompanyDomainIPage = costCompanyService.reviewerList(req); @RequestParam @ApiParam("财务公司主体 逗号分隔") List<String> companyNoList,
return CostResult.success(costCompanyDomainIPage); @RequestParam @ApiParam("oa用户id 逗号分隔") List<Integer> hrReviewerUserIdList) {
costCompanyService.modifyHrReviewer(userId, companyNoList, hrReviewerUserIdList);
return CostResult.success();
} }
@ApiOperation("/修改部门审核人") @ApiOperation("/修改部门审核人")
@GetMapping("/modifyDepartmentReviewer") @GetMapping("/modifyDepartmentReviewer")
public CostResult<Void> modifyDepartmentReviewer(@RequestParam Integer userId, public CostResult<Void> modifyDepartmentReviewer(@RequestParam Integer userId,
......
...@@ -29,6 +29,9 @@ public class CompanyReviewerListReq { ...@@ -29,6 +29,9 @@ public class CompanyReviewerListReq {
@ApiModelProperty("财务审核人id") @ApiModelProperty("财务审核人id")
private Integer financialReviewerUserId; private Integer financialReviewerUserId;
@ApiModelProperty("行政审核人id")
private Integer hrReviewerUserId;
@ApiModelProperty("修改人id") @ApiModelProperty("修改人id")
private Integer modifyUserId; private Integer modifyUserId;
......
...@@ -66,4 +66,15 @@ public interface CostCompanyService extends IService<CostCompanyDomain> { ...@@ -66,4 +66,15 @@ public interface CostCompanyService extends IService<CostCompanyDomain> {
* @param financialReviewerUserIdList 财务审核核人oa userid * @param financialReviewerUserIdList 财务审核核人oa userid
*/ */
void modifyFinancialReviewer(Integer userId, List<String> companyNoList, List<Integer> financialReviewerUserIdList); void modifyFinancialReviewer(Integer userId, List<String> companyNoList, List<Integer> financialReviewerUserIdList);
/**
* <p>
* 修改行政审核
* </p>
*
* @param userId 当前用户oa userid
* @param companyNoList 公司财务主体自编No list
* @param hrReviewerUserIdList 财务审核核人oa userid
*/
void modifyHrReviewer(Integer userId, List<String> companyNoList, List<Integer> hrReviewerUserIdList);
} }
...@@ -126,6 +126,16 @@ public class CostCompanyServiceImpl extends ServiceImpl<CostCompanyDao, CostComp ...@@ -126,6 +126,16 @@ public class CostCompanyServiceImpl extends ServiceImpl<CostCompanyDao, CostComp
page.getRecords().forEach(record -> { page.getRecords().forEach(record -> {
record.setFinancialReviewer(financialReviewerMap.get(record.getId())); record.setFinancialReviewer(financialReviewerMap.get(record.getId()));
}); });
//行政审核人
List<CostReviewer> hrCostReviewerList = costReviewerMapper.selectList(new LambdaQueryWrapper<CostReviewer>()
.in(CostReviewer::getReferId, costCompanyIds)
.eq(CostReviewer::getType, CostReviewer.hrReviewer));
Map<Integer, List<CostReviewer>> htReviewerMap = hrCostReviewerList.stream().collect(Collectors.groupingBy(CostReviewer::getReferId));
page.getRecords().forEach(record -> {
record.setHrReviewer(htReviewerMap.get(record.getId()));
});
} }
return page; return page;
...@@ -199,6 +209,39 @@ public class CostCompanyServiceImpl extends ServiceImpl<CostCompanyDao, CostComp ...@@ -199,6 +209,39 @@ public class CostCompanyServiceImpl extends ServiceImpl<CostCompanyDao, CostComp
} }
@Override
public void modifyHrReviewer(Integer userId, List<String> companyNoList, List<Integer> hrReviewerUserIdList) {
companyNoList.forEach(companyNo -> {
OaUser currentOaUser = oaUserMapper.selectByOaUserId(userId);
CostCompanyDomain costCompanyDomain = baseMapper.selectByNo(companyNo);
//记录更新时间
costCompanyDomain.setLastUpdateTime(LocalDateTime.now());
costCompanyDomain.setUpdateUserId(userId);
costCompanyDomain.setUpdateUserName(currentOaUser.getUserName());
baseMapper.updateById(costCompanyDomain);
//删除旧审核人
costReviewerMapper.delete(new LambdaQueryWrapper<CostReviewer>()
.eq(CostReviewer::getType, CostReviewer.hrReviewer)
.eq(CostReviewer::getReferId, costCompanyDomain.getId()));
hrReviewerUserIdList.forEach(hrReviewerUserId -> {
//新增审核人
OaUser financialReviewerOaUser = oaUserMapper.selectByOaUserId(hrReviewerUserId);
CostReviewer costReviewer = CostReviewer.builder()
.reviewerUserId(hrReviewerUserId)
.reviewerUserName(financialReviewerOaUser.getUserName())
.referId(costCompanyDomain.getId())
.type(CostReviewer.hrReviewer)
.build();
costReviewerMapper.insert(costReviewer);
});
});
}
/** /**
* 生成唯一的主体编号 * 生成唯一的主体编号
* *
......
...@@ -26,8 +26,7 @@ public class UnSubmitState extends CostState { ...@@ -26,8 +26,7 @@ public class UnSubmitState extends CostState {
CostDomain costDomain = costContext.costDomain; CostDomain costDomain = costContext.costDomain;
//校验费用单状态 和 当前处理用户 //校验费用单状态 和 当前处理用户
if (costDomain.getCostStatus() != CostDomain.STATUS_UN_SUBMIT || if ((costDomain.getCostStatus() != CostDomain.STATUS_UN_SUBMIT && costDomain.getCostStatus() != CostDomain.STATUS_REJECT) ||
costDomain.getCostStatus() != CostDomain.STATUS_REJECT ||
!costDomain.getCreateUserid().equals(costContext.currentUserId)) { !costDomain.getCreateUserid().equals(costContext.currentUserId)) {
throw new BizRuntimeException("invalid status"); throw new BizRuntimeException("invalid status");
} }
......
...@@ -45,5 +45,8 @@ public class CostCompanyDomain { ...@@ -45,5 +45,8 @@ public class CostCompanyDomain {
@TableField(exist = false) @TableField(exist = false)
private List<CostReviewer> financialReviewer; private List<CostReviewer> financialReviewer;
@ApiModelProperty("行政审核人")
@TableField(exist = false)
private List<CostReviewer> hrReviewer;
} }
...@@ -58,6 +58,9 @@ ...@@ -58,6 +58,9 @@
<if test="req.finalReviewerUserId !=null"> <if test="req.finalReviewerUserId !=null">
left join cost_reviewer t3 on t1.id = t3.refer_id and t3.type = 3 left join cost_reviewer t3 on t1.id = t3.refer_id and t3.type = 3
</if> </if>
<if test="req.hrReviewerUserId !=null">
left join cost_reviewer t3 on t1.id = t3.refer_id and t3.type = 4
</if>
where true where true
/*财务审核人*/ /*财务审核人*/
<if test="req.financialReviewerUserId !=null"> <if test="req.financialReviewerUserId !=null">
...@@ -67,6 +70,10 @@ ...@@ -67,6 +70,10 @@
<if test="req.finalReviewerUserId !=null"> <if test="req.finalReviewerUserId !=null">
and t3.reviewer_user_id =#{req.finalReviewerUserId} and t3.reviewer_user_id =#{req.finalReviewerUserId}
</if> </if>
/*行政审核人*/
<if test="req.hrReviewerUserId !=null">
and t3.reviewer_user_id =#{req.hrReviewerUserId}
</if>
/*最后修改时间*/ /*最后修改时间*/
<if test="req.startTime !=null"> <if test="req.startTime !=null">
and t1.last_update_time &gt; #{req.startTime} and t1.last_update_time &gt; #{req.startTime}
......
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