Merge remote-tracking branch 'origin/master'

master
shijie 4 years ago
commit 08a54f70a3
  1. 13
      dq-financial-api/pom.xml
  2. 82
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgLoanNoticeServiceImpl.java
  3. 86
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgPaymentConfirmationConsiderServiceImpl.java
  4. 8
      dq-financial-hrms/src/main/resources/mapper/hrms/RoleDao.xml
  5. 13
      dq-framework-model/pom.xml
  6. 13
      pom.xml

@ -35,4 +35,17 @@
</dependency>-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -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.*;
/**
* <p>
@ -51,6 +52,21 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl<DgLoanNoticeMapper, DgL
@Autowired
private DgBusinessProcessStatusMapper businessProcessStatusMapper;
@Autowired
private DgApplyAmountInfoMapper applyAmountInfoMapper;
@Autowired
private DgBusinessCompanyMapper businessCompanyMapper;
@Autowired
private DgLoanCommitteeConsiderMapper loanCommitteeConsiderMapper;
@Autowired
private AlInsuranceListMapper alInsuranceListMapper;
@Autowired
private HrmsFeignService hrmsFeignService;
/**
* 获取当前登录用户信息
*/
@ -122,10 +138,52 @@ public class DgLoanNoticeServiceImpl extends ServiceImpl<DgLoanNoticeMapper, DgL
businessProcessStatusQueryWrapper.eq("business_id",businessId);
DgBusinessProcessStatus dgBusinessProcessStatus = businessProcessStatusMapper.selectOne(businessProcessStatusQueryWrapper);
dgBusinessProcessStatus.setBusinessStatus(StatusCode.YW_COMPLETED);
int updateById = businessProcessStatusMapper.updateById(dgBusinessProcessStatus);
//更新成功,返回操作结果
log.info(updateById > 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<DgBusinessCompany>().eq("business_id", businessId));
String phone = businessCompany.getPhone();
String name = businessCompany.getName();
DgLoanCommitteeConsider loanCommitteeConsider = loanCommitteeConsiderMapper.selectOne(new QueryWrapper<DgLoanCommitteeConsider>().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<Integer> arr = new ArrayList<>();
arr.add(presenterId);
//根据提单人id查询其部门名称
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr);
List<LinkedHashMap> employeeMessage = null;
if(responseResult.getData() != null){
employeeMessage = (List<LinkedHashMap>) 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;
}
}

@ -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,31 +100,10 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
EasyExcelUtil.download(response,PaymentConfirmationListResponse.class,excelDataList,"回款确认列表","第一页");
}
@Override
public boolean updatePaymentConfirmation(PaymentConfirmationUpdateRequest paymentConfirmationUpdateRequest) {
//取出条件
Integer businessId = paymentConfirmationUpdateRequest.getBusinessId();
//获取当前登录用户id
Integer currentUser = Integer.parseInt(this.getUserId());
String auditOpinion = paymentConfirmationUpdateRequest.getAuditOpinion();
String imgFile = paymentConfirmationUpdateRequest.getImgFile();
//状态为2表示通过,为4表示驳回
Integer status = paymentConfirmationUpdateRequest.getStatus();
//获取当前用户拥有的角色ids
String roleIds = RedisUtil.get("dq:userRole:" + currentUser);
List<String> roleIdList = null;
if(roleIds != null) {
String[] ids = roleIds.split(",");
roleIdList = Arrays.asList(ids);
}
//*************************************************根据角色更新数据************************************************
//角色不为空
if (roleIdList!=null){
//角色为财务部经理回款确认操作和驳回操作
if (roleIdList.contains(String.valueOf(PromptSuccess.CWB_ID))){
/**
* 财务部经理操作
*/
private boolean financeDepartmentOperating(Integer businessId,Integer currentUser,String auditOpinion,Integer status,String imgFile){
//回款确认无驳回操作
//更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新法规部经理数据,如果审批状态为审批中,则添加法规部经理数据—_—
QueryWrapper<DgPaymentConfirmationConsider> queryWrapperTemp = new QueryWrapper<>();
@ -257,11 +237,14 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
return updateById > 0;
}
}
//其他情况均为失败
return false;
}
//角色为法规部经理回款确认操作和驳回操作
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))){
/**
* 法规部经理操作
*/
private boolean regulationDepartmentOperating(Integer businessId,Integer currentUser,String auditOpinion,Integer status,String imgFile){
//更新之前,获取此数据的审批状态,如果审批状态为驳回,则更新法规部经理数据,如果审批状态为审批中,则添加法规部经理数据—_—
QueryWrapper<DgPaymentConfirmationConsider> queryWrapperTemp = new QueryWrapper<>();
queryWrapperTemp.eq("business_id",businessId).eq("role_id", PromptSuccess.FG_JL_ID);
@ -381,6 +364,53 @@ public class DgPaymentConfirmationConsiderServiceImpl extends ServiceImpl<DgPaym
return updateById > 0;
}
}
//其他情况均为失败
return false;
}
@Override
public boolean updatePaymentConfirmation(PaymentConfirmationUpdateRequest paymentConfirmationUpdateRequest) {
//取出条件
Integer businessId = paymentConfirmationUpdateRequest.getBusinessId();
//获取当前登录用户id
Integer currentUser = Integer.parseInt(this.getUserId());
String auditOpinion = paymentConfirmationUpdateRequest.getAuditOpinion();
String imgFile = paymentConfirmationUpdateRequest.getImgFile();
//状态为2表示通过,为4表示驳回
Integer status = paymentConfirmationUpdateRequest.getStatus();
//获取当前用户拥有的角色ids
String roleIds = RedisUtil.get("dq:userRole:" + currentUser);
List<String> roleIdList = null;
if(roleIds != null) {
String[] ids = roleIds.split(",");
roleIdList = Arrays.asList(ids);
}
//*************************************************根据角色更新数据************************************************
//角色不为空
if (roleIdList!=null){
//角色为财务部经理回款确认操作和驳回操作
if (roleIdList.contains(String.valueOf(PromptSuccess.CWB_ID))){
//财务部经理数据是否被操作过
QueryWrapper<DgPaymentConfirmationConsider> 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 (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))){
return this.regulationDepartmentOperating(businessId,currentUser,auditOpinion,status,imgFile);
}
}

@ -33,4 +33,12 @@
role_id = #{roleId}
</select>
<select id="selectUserRole" resultType="java.lang.Integer">
SELECT count(*)
FROM
hrms_employee_role
WHERE
role_id = #{roleId} and user_id = #{userId}
</select>
</mapper>

@ -22,4 +22,17 @@
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -21,4 +21,17 @@
<!--<module>dq-financial-workflow</module>-->
<module>dq-financial-guarantee</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

Loading…
Cancel
Save