From af532f936eb997ddde7708415bdbb2a124c6757b Mon Sep 17 00:00:00 2001
From: chen <1251790704@qq.com>
Date: Wed, 2 Dec 2020 16:07:18 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/DgLoanNoticeController.java | 1 -
.../PaymentConfirmationListResponse.java | 4 +
.../service/impl/DgLoanNoticeServiceImpl.java | 2 +-
...aymentConfirmationConsiderServiceImpl.java | 284 ++++++++++++------
.../DgPaymentConfirmationConsiderMapper.xml | 3 +-
5 files changed, 204 insertions(+), 90 deletions(-)
diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java
index 279aebcf..1680fd97 100644
--- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java
+++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.util.List;
/**
*
diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PaymentConfirmationListResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PaymentConfirmationListResponse.java
index 3534bbbe..a739af06 100644
--- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PaymentConfirmationListResponse.java
+++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PaymentConfirmationListResponse.java
@@ -45,6 +45,10 @@ public class PaymentConfirmationListResponse {
@ApiModelProperty("附件(会议记录)")
private String file;
+ @ExcelIgnore
+ @ApiModelProperty("回单图片")
+ private String imgFile;
+
@ApiModelProperty("业务编号")
@ExcelProperty(value = "业务编号",index = 0)
private String businessCode;
diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java
index 8e16cc5a..c0268cfb 100644
--- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java
+++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java
@@ -146,7 +146,7 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl 0){
QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
+ queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
DgPaymentConfirmationConsider paymentConfirmationConsider = paymentConfirmationConsiderMapper.selectOne(queryWrapper);
paymentConfirmationConsider.setStatus(StatusCode.SP_REJECT);
paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_ON_HAND);
diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java
index a372002e..bce34480 100644
--- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java
+++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java
@@ -104,97 +104,207 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl queryWrapperTemp = new QueryWrapper<>();
- queryWrapperTemp.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
- DgPaymentConfirmationConsider paymentConfirmationConsiderTemp = baseMapper.selectOne(queryWrapperTemp);
- Integer approveStatus = paymentConfirmationConsiderTemp.getStatus();
-
- //之前状态为审批中,同意则添加放款通知数据给法规部经理
- if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
- DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
- paymentConfirmationConsider.setAuditOpinion(auditOpinion);
- paymentConfirmationConsider.setConsiderId(currentUser);
- paymentConfirmationConsider.setStatus(StatusCode.SP_REVIEWED);
- paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
- paymentConfirmationConsider.setImgFile(imgFile);
- int update = baseMapper.updateById(paymentConfirmationConsider);
- //同时往审核流程进程表新增一条记录
- String account = DgApplyAmountInfoController.getAccount();
- AuditProcessUtil.save(businessId,account,"财务部经理",auditOpinion,9);
- Integer companyId = paymentConfirmationConsider.getCompanyId();
- //更新成功,添加法规部经理数据
- if (update > 0){
- DgLoanNotice loanNotice = new DgLoanNotice();
- loanNotice.setCompanyId(companyId);
- loanNotice.setBusinessId(businessId);
- loanNotice.setRoleId(PromptSuccess.FG_JL_ID);
- int insert = dgLoanNoticeMapper.insert(loanNotice);
- //更新成功,返回操作结果
- log.info(insert > 0 ? "财务部经理确认成功" : "财务部经理确认失败");
- return insert > 0;
- }
+ //获取当前用户拥有的角色ids
+ String roleIds = RedisUtil.get("dq:userRole:" + currentUser);
+ List roleIdList = null;
+ if(roleIds != null) {
+ String[] ids = roleIds.split(",");
+ roleIdList = Arrays.asList(ids);
}
- //之前状态为驳回,同意则更新放款通知数据给法规部经理
- if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
- DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
- paymentConfirmationConsider.setAuditOpinion(auditOpinion);
- paymentConfirmationConsider.setConsiderId(currentUser);
- paymentConfirmationConsider.setStatus(StatusCode.SP_REVIEWED);
- paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
- paymentConfirmationConsider.setImgFile(imgFile);
- int update = baseMapper.updateById(paymentConfirmationConsider);
- //同时往审核流程进程表新增一条记录
- String account = DgApplyAmountInfoController.getAccount();
- AuditProcessUtil.save(businessId,account,"财务部经理",auditOpinion, 9);
- //更新成功,更新法规部经理数据
- if (update > 0){
- QueryWrapper loanNoticeQueryWrapper = new QueryWrapper<>();
- loanNoticeQueryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
- DgLoanNotice loanNotice = dgLoanNoticeMapper.selectOne(loanNoticeQueryWrapper);
- //清空审批意见
- loanNotice.setAuditOpinion("");
- loanNotice.setStatus(StatusCode.SP_IN_REVIEW);
- loanNotice.setOperatingStatus(StatusCode.CZ_ON_HAND);
- int updateById = dgLoanNoticeMapper.updateById(loanNotice);
- //更新成功,返回操作结果
- log.info(updateById > 0 ? "驳回后再次财务部经理确认成功" : "驳回后再次财务部经理确认失败");
- return updateById > 0;
+ //*************************************************根据角色更新数据************************************************
+
+ //角色不为空
+ if (roleIdList!=null){
+
+ //角色为财务部经理回款确认操作和驳回操作
+ if (roleIdList.contains(String.valueOf(PromptSuccess.CWB_ID))){
+ //回款确认无驳回操作
+ //更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新法规部经理数据,如果审批状态为审批中,则添加法规部经理数据—_—
+ QueryWrapper queryWrapperTemp = new QueryWrapper<>();
+ queryWrapperTemp.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsiderTemp = baseMapper.selectOne(queryWrapperTemp);
+ Integer approveStatus = paymentConfirmationConsiderTemp.getStatus();
+
+ //之前状态为审批中,同意则添加回款确认数据给法规部经理
+ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
+ paymentConfirmationConsider.setAuditOpinion(auditOpinion);
+ paymentConfirmationConsider.setConsiderId(currentUser);
+ paymentConfirmationConsider.setStatus(StatusCode.SP_REVIEWED);
+ paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
+ paymentConfirmationConsider.setImgFile(imgFile);
+ int update = baseMapper.updateById(paymentConfirmationConsider);
+ //同时往审核流程进程表新增一条记录
+ String account = DgApplyAmountInfoController.getAccount();
+ AuditProcessUtil.save(businessId,account,"财务部经理",auditOpinion,9);
+ Integer companyId = paymentConfirmationConsider.getCompanyId();
+ //更新成功,添加法规部经理数据
+ if (update > 0){
+ DgPaymentConfirmationConsider dgPaymentConfirmationConsider = new DgPaymentConfirmationConsider();
+ dgPaymentConfirmationConsider.setRoleId(PromptSuccess.FG_JL_ID);
+ dgPaymentConfirmationConsider.setBusinessId(businessId);
+ dgPaymentConfirmationConsider.setCompanyId(companyId);
+ dgPaymentConfirmationConsider.setImgFile(imgFile);
+ int insert = baseMapper.insert(dgPaymentConfirmationConsider);
+ //更新成功,返回操作结果
+ log.info(insert > 0 ? "财务部经理确认成功" : "财务部经理确认失败");
+ return insert > 0;
+ }
+ }
+
+ //之前状态为驳回,同意则更新回款确认数据给法规部经理
+ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
+ paymentConfirmationConsider.setAuditOpinion(auditOpinion);
+ paymentConfirmationConsider.setConsiderId(currentUser);
+ paymentConfirmationConsider.setStatus(StatusCode.SP_REVIEWED);
+ paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
+ paymentConfirmationConsider.setImgFile(imgFile);
+ int update = baseMapper.updateById(paymentConfirmationConsider);
+ //同时往审核流程进程表新增一条记录
+ String account = DgApplyAmountInfoController.getAccount();
+ AuditProcessUtil.save(businessId,account,"财务部经理",auditOpinion, 9);
+ //更新成功,更新法规部经理数据
+ if (update > 0){
+ QueryWrapper wrapperTemp = new QueryWrapper<>();
+ wrapperTemp.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
+ DgPaymentConfirmationConsider paymentConfirmationTemp = baseMapper.selectOne(wrapperTemp);
+ paymentConfirmationTemp.setAuditOpinion("");
+ paymentConfirmationTemp.setStatus(StatusCode.SP_IN_REVIEW);
+ paymentConfirmationTemp.setOperatingStatus(StatusCode.CZ_ON_HAND);
+ int updateById = baseMapper.updateById(paymentConfirmationTemp);
+ //更新成功,返回操作结果
+ log.info(updateById > 0 ? "驳回后再次财务部经理确认成功" : "驳回后再次财务部经理确认失败");
+ return updateById > 0;
+ }
+ }
+
+ //驳回操作,更新数据和资产部经理数据及返回上一流程
+ if (StatusCode.SP_REJECT.equals(status)){
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
+ paymentConfirmationConsider.setAuditOpinion(auditOpinion);
+ paymentConfirmationConsider.setConsiderId(currentUser);
+ paymentConfirmationConsider.setStatus(StatusCode.SP_REJECT);
+ paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
+ paymentConfirmationConsider.setImgFile(imgFile);
+ int update = baseMapper.updateById(paymentConfirmationConsider);
+ //同时往审核流程进程表新增一条记录
+ String account = DgApplyAmountInfoController.getAccount();
+ AuditProcessUtil.save(businessId,account,"财务部经理",auditOpinion,9);
+ //更新成功,更新资产部经理数据
+ if (update > 0){
+ QueryWrapper guaranteeLetterAssignUserQueryWrapper = new QueryWrapper<>();
+ guaranteeLetterAssignUserQueryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.ZC_JL_ID);
+ DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = guaranteeLetterAssignUserMapper.selectOne(guaranteeLetterAssignUserQueryWrapper);
+ dgGuaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT);
+ dgGuaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);
+ int updateById = guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUser);
+ //更新成功,返回操作结果
+ log.info(updateById > 0 ? "驳回更新资产部经理成功" : "驳回更新资产部经理失败");
+ return updateById > 0;
+ }
+ }
}
- }
- //驳回操作,更新数据和资产部经理数据及返回上一流程
- if (StatusCode.SP_REJECT.equals(status)){
- QueryWrapper queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
- DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
- paymentConfirmationConsider.setAuditOpinion(auditOpinion);
- paymentConfirmationConsider.setConsiderId(currentUser);
- paymentConfirmationConsider.setStatus(StatusCode.SP_REJECT);
- paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
- paymentConfirmationConsider.setImgFile(imgFile);
- int update = baseMapper.updateById(paymentConfirmationConsider);
- //同时往审核流程进程表新增一条记录
- String account = DgApplyAmountInfoController.getAccount();
- AuditProcessUtil.save(businessId,account,"财务部经理",auditOpinion,9);
- //更新成功,更新资产部经理数据
- if (update > 0){
- QueryWrapper guaranteeLetterAssignUserQueryWrapper = new QueryWrapper<>();
- guaranteeLetterAssignUserQueryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.ZC_JL_ID);
- DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUser = guaranteeLetterAssignUserMapper.selectOne(guaranteeLetterAssignUserQueryWrapper);
- dgGuaranteeLetterAssignUser.setStatus(StatusCode.SP_REJECT);
- dgGuaranteeLetterAssignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);
- int updateById = guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUser);
- //更新成功,返回操作结果
- log.info(updateById > 0 ? "驳回更新资产部经理成功" : "驳回更新资产部经理失败");
- return updateById > 0;
+
+ //角色为法规部经理回款确认操作和驳回操作
+ if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))){
+ //更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新法规部经理数据,如果审批状态为审批中,则添加法规部经理数据—_—
+ QueryWrapper queryWrapperTemp = new QueryWrapper<>();
+ queryWrapperTemp.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsiderTemp = baseMapper.selectOne(queryWrapperTemp);
+ Integer approveStatus = paymentConfirmationConsiderTemp.getStatus();
+
+ //之前状态为审批中,同意则添加放款通知数据给法规部经理
+ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_IN_REVIEW.equals(approveStatus)){
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
+ paymentConfirmationConsider.setAuditOpinion(auditOpinion);
+ paymentConfirmationConsider.setConsiderId(currentUser);
+ paymentConfirmationConsider.setStatus(StatusCode.SP_REVIEWED);
+ paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
+ int update = baseMapper.updateById(paymentConfirmationConsider);
+
+ //同时往审核流程进程表新增一条记录
+ String account = DgApplyAmountInfoController.getAccount();
+ AuditProcessUtil.save(businessId,account,"法规部经理",auditOpinion,9);
+ Integer companyId = paymentConfirmationConsider.getCompanyId();
+ //更新成功,添加法规部经理数据
+ if (update > 0){
+ DgLoanNotice loanNotice = new DgLoanNotice();
+ loanNotice.setCompanyId(companyId);
+ loanNotice.setBusinessId(businessId);
+ loanNotice.setRoleId(PromptSuccess.FG_JL_ID);
+ int insert = dgLoanNoticeMapper.insert(loanNotice);
+ //更新成功,返回操作结果
+ log.info(insert > 0 ? "法规部经理确认成功" : "法规部经理确认失败");
+ return insert > 0;
+ }
+ }
+
+ //之前状态为驳回,同意则更新放款通知数据给法规部经理
+ if (StatusCode.SP_REVIEWED.equals(status) && StatusCode.SP_REJECT.equals(approveStatus)){
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
+ paymentConfirmationConsider.setAuditOpinion(auditOpinion);
+ paymentConfirmationConsider.setConsiderId(currentUser);
+ paymentConfirmationConsider.setStatus(StatusCode.SP_REVIEWED);
+ paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
+ int update = baseMapper.updateById(paymentConfirmationConsider);
+ //同时往审核流程进程表新增一条记录
+ String account = DgApplyAmountInfoController.getAccount();
+ AuditProcessUtil.save(businessId,account,"法规部经理",auditOpinion, 9);
+ //更新成功,更新法规部经理数据
+ if (update > 0){
+ QueryWrapper loanNoticeQueryWrapper = new QueryWrapper<>();
+ loanNoticeQueryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
+ DgLoanNotice loanNotice = dgLoanNoticeMapper.selectOne(loanNoticeQueryWrapper);
+ //清空审批意见
+ loanNotice.setAuditOpinion("");
+ loanNotice.setStatus(StatusCode.SP_IN_REVIEW);
+ loanNotice.setOperatingStatus(StatusCode.CZ_ON_HAND);
+ int updateById = dgLoanNoticeMapper.updateById(loanNotice);
+ //更新成功,返回操作结果
+ log.info(updateById > 0 ? "驳回后再次财务部经理确认成功" : "驳回后再次财务部经理确认失败");
+ return updateById > 0;
+ }
+ }
+
+ //驳回操作,更新数据和财务部经理数据及返回上一流程
+ if (StatusCode.SP_REJECT.equals(status)){
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsider = baseMapper.selectOne(queryWrapper);
+ paymentConfirmationConsider.setAuditOpinion(auditOpinion);
+ paymentConfirmationConsider.setConsiderId(currentUser);
+ paymentConfirmationConsider.setStatus(StatusCode.SP_REJECT);
+ paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED);
+ int update = baseMapper.updateById(paymentConfirmationConsider);
+ //同时往审核流程进程表新增一条记录
+ String account = DgApplyAmountInfoController.getAccount();
+ AuditProcessUtil.save(businessId,account,"法规部经理",auditOpinion,9);
+ //更新成功,更新财务部经理数据
+ if (update > 0){
+ QueryWrapper queryWrapperT = new QueryWrapper<>();
+ queryWrapperT.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID);
+ DgPaymentConfirmationConsider paymentConfirmationConsiderT = baseMapper.selectOne(queryWrapperT);
+ paymentConfirmationConsiderT.setOperatingStatus(StatusCode.CZ_ON_HAND);
+ paymentConfirmationConsiderT.setStatus(StatusCode.SP_REJECT);
+ int updateById = baseMapper.updateById(paymentConfirmationConsiderT);
+ //更新成功,返回操作结果
+ log.info(updateById > 0 ? "驳回更新资产部经理成功" : "驳回更新资产部经理失败");
+ return updateById > 0;
+ }
+ }
}
}
diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml
index 776ba2b4..8db37165 100644
--- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml
+++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgPaymentConfirmationConsiderMapper.xml
@@ -31,11 +31,12 @@
+