diff --git a/dq-financial-api/pom.xml b/dq-financial-api/pom.xml index 90eb2948..bc2f749a 100644 --- a/dq-financial-api/pom.xml +++ b/dq-financial-api/pom.xml @@ -35,4 +35,17 @@ --> + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + \ No newline at end of file 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 b5887d1c..bf23cdb3 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 @@ -1,24 +1,24 @@ package com.daqing.financial.guarantee.service.impl; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; -import com.daqing.financial.guarantee.mapper.DgBusinessProcessStatusMapper; -import com.daqing.financial.guarantee.mapper.DgLoanNoticeMapper; -import com.daqing.financial.guarantee.mapper.DgPaymentConfirmationConsiderMapper; +import com.daqing.financial.guarantee.feign.HrmsFeignService; +import com.daqing.financial.guarantee.mapper.*; import com.daqing.financial.guarantee.model.request.LoanNoticeQueryRequest; import com.daqing.financial.guarantee.model.request.LoanNoticeUpdateRequest; +import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse; import com.daqing.financial.guarantee.model.response.LoanNoticeListResponse; import com.daqing.financial.guarantee.service.IDgLoanNoticeService; import com.daqing.financial.guarantee.util.AuditProcessUtil; import com.daqing.financial.guarantee.util.OrdinaryUtil; -import com.daqing.framework.domain.guarantee.DgBusinessProcessStatus; -import com.daqing.framework.domain.guarantee.DgLoanNotice; -import com.daqing.framework.domain.guarantee.DgPaymentConfirmationConsider; +import com.daqing.framework.domain.guarantee.*; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.PromptSuccess; +import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.util.RedisUtil; import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.excel.EasyExcelUtil; @@ -28,11 +28,12 @@ import org.springframework.stereotype.Service; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.Arrays; -import java.util.List; +import java.math.BigDecimal; +import java.util.*; /** *

@@ -51,6 +52,21 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl 0 ? "业务流程已完成" : "业务流程已完成更新失败"); - return updateById > 0; + businessProcessStatusMapper.updateById(dgBusinessProcessStatus); + //查询保后管理的相关数据 + DgApplyAmountInfo applyAmountInfo = applyAmountInfoMapper.selectById(businessId); + String bank = applyAmountInfo.getBank(); + String businessCode = applyAmountInfo.getBusinessCode(); + String businessType = applyAmountInfo.getBusinessType(); + Date createTime = applyAmountInfo.getCreateTime(); + String amountWide = applyAmountInfo.getAmountWide(); + Integer presenterId = applyAmountInfo.getPresenterId(); + DgBusinessCompany businessCompany = businessCompanyMapper.selectOne(new QueryWrapper().eq("business_id", businessId)); + String phone = businessCompany.getPhone(); + String name = businessCompany.getName(); + DgLoanCommitteeConsider loanCommitteeConsider = loanCommitteeConsiderMapper.selectOne(new QueryWrapper().eq("business_id", businessId)); + Integer loanMoney = loanCommitteeConsider.getLoanMoney(); + String loanTern = loanCommitteeConsider.getLoanTern(); + //添加数据到保后管理 + AlInsuranceList alInsuranceList = new AlInsuranceList(); + alInsuranceList.setBank(bank); + alInsuranceList.setBusinessCode(businessCode); + alInsuranceList.setBusinessType(businessType); + alInsuranceList.setApplyTime(createTime); + alInsuranceList.setPhone(phone); + alInsuranceList.setCustomerName(name); + alInsuranceList.setGuaranteeAmount(BigDecimal.valueOf(loanMoney*10000)); + alInsuranceList.setGuaranteeTime(loanTern); + alInsuranceList.setAmountWide(amountWide); + alInsuranceList.setPaymentStatus(1); + ArrayList arr = new ArrayList<>(); + arr.add(presenterId); + //根据提单人id查询其部门名称 + ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr); + List employeeMessage = null; + if(responseResult.getData() != null){ + employeeMessage = (List) responseResult.getData(); + } + if(employeeMessage!= null){ + for(LinkedHashMap res : employeeMessage){ + if(presenterId.equals(res.get("id"))){//如果提单人id相同情况下,就往对象里面赋值 + alInsuranceList.setDepartment(JSONObject.toJSONString(res.get("deptName")).replace("\"","")); + } + } + } + int insert = alInsuranceListMapper.insert(alInsuranceList); + //添加成功,返回操作结果 + log.info(insert > 0 ? "业务流程已完成,进入保后管理" : "业务流程更新失败"); + return insert > 0; } } 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 0ddf5b06..5e92ab90 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 @@ -1,5 +1,6 @@ package com.daqing.financial.guarantee.service.impl; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -99,6 +100,274 @@ 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.setOperatingStatus(StatusCode.CZ_PROCESSED); + paymentConfirmationConsider.setImgFile(imgFile); + int update = baseMapper.updateById(paymentConfirmationConsider); + //同时往审核流程进程表新增一条记录 + String account = DgApplyAmountInfoController.getAccount(); + String departmentId = OrdinaryUtil.getDepartmentId(currentUser); + AuditProcessUtil.save(currentUser,businessId,account,departmentId, + auditOpinion,9,PromptSuccess.CWB_ID,"","","",status); + Integer companyId = paymentConfirmationConsider.getCompanyId(); + //更新成功,添加法规部经理数据 + if (update > 0){ + int insert = 0; + QueryWrapper wrapperTemp = new QueryWrapper<>(); + wrapperTemp.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID); + DgPaymentConfirmationConsider paymentConfirmationTemp = baseMapper.selectOne(wrapperTemp); + if (paymentConfirmationTemp==null){ + DgPaymentConfirmationConsider dgPaymentConfirmationConsider = new DgPaymentConfirmationConsider(); + dgPaymentConfirmationConsider.setRoleId(PromptSuccess.FG_JL_ID); + dgPaymentConfirmationConsider.setBusinessId(businessId); + dgPaymentConfirmationConsider.setCompanyId(companyId); + dgPaymentConfirmationConsider.setImgFile(imgFile); + insert = baseMapper.insert(dgPaymentConfirmationConsider); + }else { + paymentConfirmationTemp.setAuditOpinion(""); + paymentConfirmationTemp.setStatus(StatusCode.SP_IN_REVIEW); + paymentConfirmationTemp.setOperatingStatus(StatusCode.CZ_ON_HAND); + insert = baseMapper.updateById(paymentConfirmationTemp); + } + //更新成功,返回操作结果 + 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_IN_REVIEW); + paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED); + paymentConfirmationConsider.setImgFile(imgFile); + int update = baseMapper.updateById(paymentConfirmationConsider); + //同时往审核流程进程表新增一条记录 + String account = DgApplyAmountInfoController.getAccount(); + String departmentId = OrdinaryUtil.getDepartmentId(currentUser); + AuditProcessUtil.save(currentUser,businessId,account,departmentId, + auditOpinion, 9,PromptSuccess.CWB_ID,"","","",status); + //更新成功,更新法规部经理数据 + 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(); + String departmentId = OrdinaryUtil.getDepartmentId(currentUser); + AuditProcessUtil.save(currentUser,businessId,account,departmentId, + auditOpinion,9,PromptSuccess.CWB_ID,"","","",status); + //更新成功,更新资产部经理数据及其他人的数据 + if (update > 0){ + //更新法规部经理数据 + //根据业务id查询法规部经理数据 + QueryWrapper guaranteeLetterAssignUserQueryWrapperFg = new QueryWrapper<>(); + guaranteeLetterAssignUserQueryWrapperFg.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserFg = guaranteeLetterAssignUserMapper.selectOne(guaranteeLetterAssignUserQueryWrapperFg); + dgGuaranteeLetterAssignUserFg.setStatus(StatusCode.SP_REJECT); + guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUserFg); + + //更新a角 + //根据业务id查询A用户数据 + QueryWrapper guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>(); + guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = guaranteeLetterAssignUserMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA); + dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT); + guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUserA); + + //更新b角 + //根据业务id查询B用户数据 + QueryWrapper guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>(); + guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); + DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = guaranteeLetterAssignUserMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB); + dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT); + guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUserB); + + 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); + dgGuaranteeLetterAssignUser.setAuditOpinion(""); + int updateById = guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUser); + //更新成功,返回操作结果 + log.info(updateById > 0 ? "驳回更新资产部经理成功" : "驳回更新资产部经理失败"); + return updateById > 0; + } + } + //其他情况均为失败 + return false; + } + + /** + * 法规部经理操作 + */ + private boolean regulationDepartmentOperating(Integer businessId,Integer currentUser,String auditOpinion,Integer status,String imgFile){ + //更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新法规部经理数据,如果审批状态为审批中,则添加法规部经理数据—_— + 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(); + String departmentId = OrdinaryUtil.getDepartmentId(currentUser); + AuditProcessUtil.save(currentUser,businessId,account,departmentId, + auditOpinion,9,PromptSuccess.FG_JL_ID,"","","",status); + Integer companyId = paymentConfirmationConsider.getCompanyId(); + //更新成功,添加法规部经理数据和更新财务部数据 + if (update > 0){ + QueryWrapper queryWrapperCwb = new QueryWrapper<>(); + queryWrapperCwb.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID); + DgPaymentConfirmationConsider paymentConfirmationConsiderCwb = baseMapper.selectOne(queryWrapperCwb); + paymentConfirmationConsiderCwb.setStatus(StatusCode.SP_REVIEWED); + baseMapper.updateById(paymentConfirmationConsiderCwb); + + int insert = 0; + QueryWrapper loanNoticeQueryWrapperFG = new QueryWrapper<>(); + loanNoticeQueryWrapperFG.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID); + DgLoanNotice loanNoticeFG = dgLoanNoticeMapper.selectOne(loanNoticeQueryWrapperFG); + if (loanNoticeFG==null){ + DgLoanNotice loanNotice = new DgLoanNotice(); + loanNotice.setCompanyId(companyId); + loanNotice.setBusinessId(businessId); + loanNotice.setRoleId(PromptSuccess.FG_JL_ID); + insert = dgLoanNoticeMapper.insert(loanNotice); + }else { + loanNoticeFG.setStatus(StatusCode.SP_IN_REVIEW); + loanNoticeFG.setOperatingStatus(StatusCode.CZ_ON_HAND); + loanNoticeFG.setAuditOpinion(""); + insert = dgLoanNoticeMapper.updateById(loanNoticeFG); + } + //更新成功,返回操作结果 + 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(); + String departmentId = OrdinaryUtil.getDepartmentId(currentUser); + AuditProcessUtil.save(currentUser,businessId,account,departmentId, + auditOpinion, 9,PromptSuccess.FG_JL_ID,"","","",status); + //更新成功,更新法规部经理数据和财务部经理数据 + if (update > 0){ + QueryWrapper queryWrapperCwb = new QueryWrapper<>(); + queryWrapperCwb.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID); + DgPaymentConfirmationConsider paymentConfirmationConsiderCwb = baseMapper.selectOne(queryWrapperCwb); + paymentConfirmationConsiderCwb.setStatus(StatusCode.SP_REVIEWED); + baseMapper.updateById(paymentConfirmationConsiderCwb); + + 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(); + String departmentId = OrdinaryUtil.getDepartmentId(currentUser); + AuditProcessUtil.save(currentUser,businessId,account,departmentId, + auditOpinion,9,PromptSuccess.FG_JL_ID,"","","",status); + //更新成功,更新财务部经理数据 + 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); + paymentConfirmationConsiderT.setAuditOpinion(""); + int updateById = baseMapper.updateById(paymentConfirmationConsiderT); + //更新成功,返回操作结果 + log.info(updateById > 0 ? "驳回更新资产部经理成功" : "驳回更新资产部经理失败"); + return updateById > 0; + } + } + //其他情况均为失败 + return false; + } + @Override public boolean updatePaymentConfirmation(PaymentConfirmationUpdateRequest paymentConfirmationUpdateRequest) { //取出条件 @@ -124,263 +393,24 @@ 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.setOperatingStatus(StatusCode.CZ_PROCESSED); - paymentConfirmationConsider.setImgFile(imgFile); - int update = baseMapper.updateById(paymentConfirmationConsider); - //同时往审核流程进程表新增一条记录 - String account = DgApplyAmountInfoController.getAccount(); - String departmentId = OrdinaryUtil.getDepartmentId(currentUser); - AuditProcessUtil.save(currentUser,businessId,account,departmentId, - auditOpinion,9,PromptSuccess.CWB_ID,"","","",status); - Integer companyId = paymentConfirmationConsider.getCompanyId(); - //更新成功,添加法规部经理数据 - if (update > 0){ - int insert = 0; - QueryWrapper wrapperTemp = new QueryWrapper<>(); - wrapperTemp.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID); - DgPaymentConfirmationConsider paymentConfirmationTemp = baseMapper.selectOne(wrapperTemp); - if (paymentConfirmationTemp==null){ - DgPaymentConfirmationConsider dgPaymentConfirmationConsider = new DgPaymentConfirmationConsider(); - dgPaymentConfirmationConsider.setRoleId(PromptSuccess.FG_JL_ID); - dgPaymentConfirmationConsider.setBusinessId(businessId); - dgPaymentConfirmationConsider.setCompanyId(companyId); - dgPaymentConfirmationConsider.setImgFile(imgFile); - insert = baseMapper.insert(dgPaymentConfirmationConsider); - }else { - paymentConfirmationTemp.setAuditOpinion(""); - paymentConfirmationTemp.setStatus(StatusCode.SP_IN_REVIEW); - paymentConfirmationTemp.setOperatingStatus(StatusCode.CZ_ON_HAND); - insert = baseMapper.updateById(paymentConfirmationTemp); - } - //更新成功,返回操作结果 - log.info(insert > 0 ? "财务部经理确认成功" : "财务部经理确认失败"); - return insert > 0; - } + //财务部经理数据是否被操作过 + QueryWrapper queryWrapperOne = new QueryWrapper<>(); + queryWrapperOne.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID); + DgPaymentConfirmationConsider paymentConfirmationConsiderOne = baseMapper.selectOne(queryWrapperOne); + Integer userId = paymentConfirmationConsiderOne.getConsiderId(); + //没有操作过则财务部经理操作 + if (ObjectUtil.isNull(userId)){ + return this.financeDepartmentOperating(businessId,currentUser,auditOpinion,status,imgFile); } - - //之前状态为驳回,同意则更新回款确认数据给法规部经理 - 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_IN_REVIEW); - paymentConfirmationConsider.setOperatingStatus(StatusCode.CZ_PROCESSED); - paymentConfirmationConsider.setImgFile(imgFile); - int update = baseMapper.updateById(paymentConfirmationConsider); - //同时往审核流程进程表新增一条记录 - String account = DgApplyAmountInfoController.getAccount(); - String departmentId = OrdinaryUtil.getDepartmentId(currentUser); - AuditProcessUtil.save(currentUser,businessId,account,departmentId, - auditOpinion, 9,PromptSuccess.CWB_ID,"","","",status); - //更新成功,更新法规部经理数据 - 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(); - String departmentId = OrdinaryUtil.getDepartmentId(currentUser); - AuditProcessUtil.save(currentUser,businessId,account,departmentId, - auditOpinion,9,PromptSuccess.CWB_ID,"","","",status); - //更新成功,更新资产部经理数据及其他人的数据 - if (update > 0){ - //更新法规部经理数据 - //根据业务id查询法规部经理数据 - QueryWrapper guaranteeLetterAssignUserQueryWrapperFg = new QueryWrapper<>(); - guaranteeLetterAssignUserQueryWrapperFg.eq("business_id",businessId).eq("role_id",PromptSuccess.FG_JL_ID); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserFg = guaranteeLetterAssignUserMapper.selectOne(guaranteeLetterAssignUserQueryWrapperFg); - dgGuaranteeLetterAssignUserFg.setStatus(StatusCode.SP_REJECT); - guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUserFg); - - //更新a角 - //根据业务id查询A用户数据 - QueryWrapper guaranteeLetterAssignUserQueryWrapperA = new QueryWrapper<>(); - guaranteeLetterAssignUserQueryWrapperA.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_A_ID); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserA = guaranteeLetterAssignUserMapper.selectOne(guaranteeLetterAssignUserQueryWrapperA); - dgGuaranteeLetterAssignUserA.setStatus(StatusCode.SP_REJECT); - guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUserA); - - //更新b角 - //根据业务id查询B用户数据 - QueryWrapper guaranteeLetterAssignUserQueryWrapperB = new QueryWrapper<>(); - guaranteeLetterAssignUserQueryWrapperB.eq("business_id",businessId).eq("role_id",PromptSuccess.DB_B_ID); - DgGuaranteeLetterAssignUser dgGuaranteeLetterAssignUserB = guaranteeLetterAssignUserMapper.selectOne(guaranteeLetterAssignUserQueryWrapperB); - dgGuaranteeLetterAssignUserB.setStatus(StatusCode.SP_REJECT); - guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUserB); - - 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); - dgGuaranteeLetterAssignUser.setAuditOpinion(""); - int updateById = guaranteeLetterAssignUserMapper.updateById(dgGuaranteeLetterAssignUser); - //更新成功,返回操作结果 - log.info(updateById > 0 ? "驳回更新资产部经理成功" : "驳回更新资产部经理失败"); - return updateById > 0; - } + //操作过,拥有法规部经理,则法规部经理操作 + if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))){ + return this.regulationDepartmentOperating(businessId,currentUser,auditOpinion,status,imgFile); } } - //角色为法规部经理回款确认操作和驳回操作 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(); - String departmentId = OrdinaryUtil.getDepartmentId(currentUser); - AuditProcessUtil.save(currentUser,businessId,account,departmentId, - auditOpinion,9,PromptSuccess.FG_JL_ID,"","","",status); - Integer companyId = paymentConfirmationConsider.getCompanyId(); - //更新成功,添加法规部经理数据和更新财务部数据 - if (update > 0){ - QueryWrapper queryWrapperCwb = new QueryWrapper<>(); - queryWrapperCwb.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID); - DgPaymentConfirmationConsider paymentConfirmationConsiderCwb = baseMapper.selectOne(queryWrapperCwb); - paymentConfirmationConsiderCwb.setStatus(StatusCode.SP_REVIEWED); - baseMapper.updateById(paymentConfirmationConsiderCwb); - - int insert = 0; - QueryWrapper loanNoticeQueryWrapperFG = new QueryWrapper<>(); - loanNoticeQueryWrapperFG.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID); - DgLoanNotice loanNoticeFG = dgLoanNoticeMapper.selectOne(loanNoticeQueryWrapperFG); - if (loanNoticeFG==null){ - DgLoanNotice loanNotice = new DgLoanNotice(); - loanNotice.setCompanyId(companyId); - loanNotice.setBusinessId(businessId); - loanNotice.setRoleId(PromptSuccess.FG_JL_ID); - insert = dgLoanNoticeMapper.insert(loanNotice); - }else { - loanNoticeFG.setStatus(StatusCode.SP_IN_REVIEW); - loanNoticeFG.setOperatingStatus(StatusCode.CZ_ON_HAND); - loanNoticeFG.setAuditOpinion(""); - insert = dgLoanNoticeMapper.updateById(loanNoticeFG); - } - //更新成功,返回操作结果 - 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(); - String departmentId = OrdinaryUtil.getDepartmentId(currentUser); - AuditProcessUtil.save(currentUser,businessId,account,departmentId, - auditOpinion, 9,PromptSuccess.FG_JL_ID,"","","",status); - //更新成功,更新法规部经理数据和财务部经理数据 - if (update > 0){ - QueryWrapper queryWrapperCwb = new QueryWrapper<>(); - queryWrapperCwb.eq("business_id",businessId).eq("role_id", PromptSuccess.CWB_ID); - DgPaymentConfirmationConsider paymentConfirmationConsiderCwb = baseMapper.selectOne(queryWrapperCwb); - paymentConfirmationConsiderCwb.setStatus(StatusCode.SP_REVIEWED); - baseMapper.updateById(paymentConfirmationConsiderCwb); - - 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(); - String departmentId = OrdinaryUtil.getDepartmentId(currentUser); - AuditProcessUtil.save(currentUser,businessId,account,departmentId, - auditOpinion,9,PromptSuccess.FG_JL_ID,"","","",status); - //更新成功,更新财务部经理数据 - 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); - paymentConfirmationConsiderT.setAuditOpinion(""); - int updateById = baseMapper.updateById(paymentConfirmationConsiderT); - //更新成功,返回操作结果 - log.info(updateById > 0 ? "驳回更新资产部经理成功" : "驳回更新资产部经理失败"); - return updateById > 0; - } - } + return this.regulationDepartmentOperating(businessId,currentUser,auditOpinion,status,imgFile); } } diff --git a/dq-financial-hrms/src/main/resources/mapper/hrms/RoleDao.xml b/dq-financial-hrms/src/main/resources/mapper/hrms/RoleDao.xml index 83b79342..01e15e1c 100644 --- a/dq-financial-hrms/src/main/resources/mapper/hrms/RoleDao.xml +++ b/dq-financial-hrms/src/main/resources/mapper/hrms/RoleDao.xml @@ -33,4 +33,12 @@ role_id = #{roleId} + + \ No newline at end of file diff --git a/dq-framework-model/pom.xml b/dq-framework-model/pom.xml index ab582637..add5b050 100644 --- a/dq-framework-model/pom.xml +++ b/dq-framework-model/pom.xml @@ -22,4 +22,17 @@ 0.0.1-SNAPSHOT + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index a1662b25..28235f8b 100644 --- a/pom.xml +++ b/pom.xml @@ -21,4 +21,17 @@ dq-financial-guarantee + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + +