业务申请模块整体调整

master
shijie 4 years ago
parent 6f884fcf9c
commit f2f5ee7112
  1. 42
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  2. 21
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountListController.java
  3. 24
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgApplyAmountListMapper.java
  4. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalGuaranteeRequest.java
  5. 10
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/BusinessApplicationRequest.java
  6. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InvestigateGuaranteeRequest.java
  7. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/BusinessApplicationListResponse.java
  8. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountInfoService.java
  9. 21
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgApplyAmountListService.java
  10. 151
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  11. 39
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountListServiceImpl.java
  12. 14
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java
  13. 1
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java
  14. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/MyBatisPlusCodeGenerator.java
  15. 3
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountInfoMapper.xml
  16. 41
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgApplyAmountListMapper.xml
  17. 3
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeAssignUserMapper.xml
  18. 6
      dq-framework-common/src/main/java/com/daqing/framework/model/StatusCode.java
  19. 15
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountInfo.java
  20. 84
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgApplyAmountList.java
  21. 5
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeAssignUser.java

@ -8,8 +8,8 @@ import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest;
import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.daqing.financial.guarantee.service.IDgApplyAmountListService;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;
@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
@ -56,6 +57,9 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
@Resource
private HrmsFeignService hrmsFeignService;
@Autowired
private IDgApplyAmountListService applyAmountListService;
/**
* 根据客户编号/客户名称获取企业信息
* @param applyAmountInfo
@ -155,20 +159,34 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
public ResponseResult businessApplicationList(@RequestParam(value="page",required=false) Integer page,@RequestParam(value="size",required=false) Integer size,
@RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){
//获取当前登录用户id
String userId = getUserId();
//根据userId获取用户名以及部门名称
ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(5L);
//String userId = getUserId();
String userId = "5";
//根据角色查询资产部调查列表
String roleIds = RedisUtil.get("dq:userRole:" + userId);
PageUtils data = null;
if(roleIds != null) {
String[] ids = roleIds.split(",");
List<String> roleIdlist = Arrays.asList(ids);
data = applyAmountListService.queryPage(page, size, CustomerNumberOrName, roleIdlist, userId);
}
PageUtils data = applyAmountInfoService.queryPage(page, size,CustomerNumberOrName);
//PageUtils data = applyAmountInfoService.queryPage(page, size,CustomerNumberOrName);
//遍历data里面的数据提单人id,找出匹配id,将用户名以及部门名称赋值进去
List<BusinessApplicationListResponse> list = (List<BusinessApplicationListResponse>) data.getList();
Integer presenterId = list.get(0).getPresenterId();
//根据提单人id查询其部门名称
ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(presenterId.longValue());
for (BusinessApplicationListResponse response:list) {
if(response.getPresenterId().equals(employeeMessage.getData().getId())){//如果userId相同情况下,就往对象里面赋值
response.setAccount(employeeMessage.getData().getAccount());
response.setDeptName(employeeMessage.getData().getDeptName());
if(employeeMessage.getData() != null){
if(response.getPresenterId().equals(employeeMessage.getData().getId())){//如果提单人id相同情况下,就往对象里面赋值
response.setAccount(employeeMessage.getData().getAccount());
response.setDeptName(employeeMessage.getData().getDeptName());
}
}
}
return new ResponseResult<PageUtils>().SUCCESS(data);
}
@ -228,9 +246,9 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
@PostMapping("/approvalBusinessApplication")
@ApiOperation(value = "根据业务id审核业务申请内容")
public ResponseResult approvalBusinessApplication(@RequestParam("id") Integer id,@RequestParam("status") Integer status,
@RequestParam(value = "remark", required = false) String remark){
int result = applyAmountInfoService.approvalBusinessApplication(id,status,remark);
return result>0 ? ResponseResult.SUCCESS("撤销成功!"):ResponseResult.FAIL(40006,"撤销失败!");
@RequestParam(value = "remark", required = false) String remark, @RequestParam("companyId") Integer companyId){
int result = applyAmountInfoService.approvalBusinessApplication(id,status,remark,companyId);
return result>0 ? ResponseResult.SUCCESS("审核成功!"):ResponseResult.FAIL(40006,"审核失败!");
}
/**

@ -0,0 +1,21 @@
package com.daqing.financial.guarantee.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author Qyq
* @since 2020-11-24
*/
@RestController
@RequestMapping("/dg-apply-amount-list")
public class DgApplyAmountListController {
}

@ -0,0 +1,24 @@
package com.daqing.financial.guarantee.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.framework.domain.guarantee.DgApplyAmountList;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author Qyq
* @since 2020-11-24
*/
@Mapper
public interface DgApplyAmountListMapper extends BaseMapper<DgApplyAmountList> {
IPage<BusinessApplicationListResponse> pageByCondition(Page page, String customerNumberOrName, List<String> roleIdlist, String userId);
}

@ -31,6 +31,9 @@ public class ApprovalGuaranteeRequest {
@ApiModelProperty(value = "补充调查原因")
private String[] remark;
@ApiModelProperty(value = "其他原因")
private String otherRemark;
}

@ -21,6 +21,12 @@ public class BusinessApplicationRequest implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 业务id
*/
@ApiModelProperty(value = "业务id")
private Integer businessId;
/**
* 企业id
*/
@ -179,10 +185,10 @@ public class BusinessApplicationRequest implements Serializable {
private String[] inspectionPhotos;
/**
* 区分保存和提交按钮 true->commit
* 区分保存和提交按钮 1->commit
*/
@ApiModelProperty(value = "区分保存和提交按钮")
private boolean isSaveOrCommit;
private Integer isSaveOrCommit;
/**
* 关联人id

@ -3,6 +3,7 @@ package com.daqing.financial.guarantee.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
@ -11,7 +12,7 @@ import java.util.List;
* @Version 1.0
*/
@Data
public class InvestigateGuaranteeRequest {
public class InvestigateGuaranteeRequest implements Serializable {
@ApiModelProperty(value = "主键id")
private Integer id;

@ -30,6 +30,9 @@ public class BusinessApplicationListResponse extends BaseRowModel implements Ser
@ApiModelProperty(value = "企业id")
private Integer companyId;
@ApiModelProperty(value = "业务id")
private Integer businessId;
/**
* 提单人id
*/

@ -31,5 +31,5 @@ public interface IDgApplyAmountInfoService extends IService<DgApplyAmountInfo> {
Boolean excelExport(HttpServletResponse response);
int approvalBusinessApplication(Integer id, Integer status, String remark);
int approvalBusinessApplication(Integer id, Integer status, String remark, Integer companyId);
}

@ -0,0 +1,21 @@
package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.framework.domain.guarantee.DgApplyAmountList;
import com.daqing.framework.utils.PageUtils;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author Qyq
* @since 2020-11-24
*/
public interface IDgApplyAmountListService extends IService<DgApplyAmountList> {
PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, List<String> roleIdlist, String userId);
}

@ -5,8 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.financial.guarantee.feign.CrmsFeignService;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.mapper.DgApplyAmountInfoMapper;
import com.daqing.financial.guarantee.mapper.DgEnclosureInfoMapper;
import com.daqing.financial.guarantee.mapper.*;
import com.daqing.financial.guarantee.model.request.BusinessApplicationRequest;
import com.daqing.financial.guarantee.model.response.BusinessApplicationDetailResponse;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
@ -18,10 +17,11 @@ import com.daqing.financial.guarantee.util.ArraysUtil;
import com.daqing.framework.domain.crms.CrmsCustomerRelated;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.crms.response.CrmsCode;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgEnclosureInfo;
import com.daqing.framework.domain.guarantee.*;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.exception.ExceptionCast;
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.RandomUtil;
import com.daqing.framework.util.RedisUtil;
@ -66,6 +66,18 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
@Resource
private HrmsFeignService hrmsFeignService;
@Resource
private DgGuaranteeAssignUserMapper dgGuaranteeAssignUserMapper;
@Resource
private DgAssetsInvestigationMapper dgAssetsInvestigationMapper;
@Resource
private DgMessageInvestigationMapper dgMessageInvestigationMapper;
@Resource
private DgApplyAmountListMapper dgApplyAmountListMapper;
@Override
@Transactional
@ -82,8 +94,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
log.error("LogAspect 操作失败:" + e.getMessage());
e.printStackTrace();
}
System.out.println("反担保措施======"+ Arrays.toString(businessApplication.getEnGuaranteeMeasures()));
System.out.println("反担保措施======"+ ArraysUtil.toString(businessApplication.getEnGuaranteeMeasures()));
//申请贷款相关信息
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo();
dgApplyAmountInfo.setCompanyId(businessApplication.getCompanyId());
@ -97,16 +107,26 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
dgApplyAmountInfo.setBusinessCode(RandomUtil.getRandomNum(12));
dgApplyAmountInfo.setCreateTime(new Date());
dgApplyAmountInfo.setUpdateTime(new Date());
if(businessApplication.isSaveOrCommit()==true){
dgApplyAmountInfo.setStatus(1);//状态设置为审核中
}else{
dgApplyAmountInfo.setStatus(0);//保存为草稿
}
dgApplyAmountInfoMapper.insert(dgApplyAmountInfo);
//新增到业务列表
DgApplyAmountList dgApplyAmountList = new DgApplyAmountList();
dgApplyAmountList.setBusinessId(dgApplyAmountInfo.getId());
dgApplyAmountList.setPresenterId(5);//Integer.parseInt(userId)
dgApplyAmountList.setRoleId(PromptSuccess.DB_YWY_ID);
dgApplyAmountList.setType(1);//类型为担保业务员
if(businessApplication.getIsSaveOrCommit()==1){//提交
dgApplyAmountList.setStatus(StatusCode.SP_IN_REVIEW);//审批状态 设置为审核中
dgApplyAmountList.setOperatingStatus(StatusCode.CZ_LAUNCH);//操作状态设置为已发起
}else{//保存
dgApplyAmountList.setStatus(StatusCode.SP_DRAFT);//审批状态 保存为草稿
dgApplyAmountList.setOperatingStatus(StatusCode.CZ_TO_BE_SUBMITTED);//操作状态设置为待提交
}
dgApplyAmountListMapper.insert(dgApplyAmountList);
//修改是否存在关联人
crmsFeignService.updateIsExistRelated(dgApplyAmountInfo.getCompanyId(),businessApplication.getIsExistRelated());
@ -134,7 +154,21 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgEnclosureInfo.setAssessmentReport(ArraysUtil.toString(businessApplication.getAssessmentReport()));//反担保资料和评估报告
dgEnclosureInfo.setConversationSummary(ArraysUtil.toString(businessApplication.getConversationSummary()));
dgEnclosureInfo.setInspectionPhotos(ArraysUtil.toString(businessApplication.getInspectionPhotos()));
return dgEnclosureInfoMapper.insert(dgEnclosureInfo);
dgEnclosureInfoMapper.insert(dgEnclosureInfo);
//如果审批状态为审核中,操作状态为已发起,则往担保部经理添加一条待审核的记录
if(dgApplyAmountList.getStatus().equals(StatusCode.SP_IN_REVIEW) && dgApplyAmountList.getOperatingStatus().equals(StatusCode.CZ_LAUNCH)){
DgApplyAmountList applyAmountList = new DgApplyAmountList();
applyAmountList.setBusinessId(dgApplyAmountInfo.getId());//主键id
applyAmountList.setPresenterId(5);//Integer.parseInt(userId) 提单人id
applyAmountList.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理角色id
applyAmountList.setType(2);//设置类型
applyAmountList.setStatus(StatusCode.SP_IN_REVIEW);//状态设置为审核中
applyAmountList.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
dgApplyAmountListMapper.insert(applyAmountList);
}
return 1;
}
@Override
@ -153,9 +187,11 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
@Override
public BusinessApplicationDetailResponse businessApplicationDetail(Integer id) {
//根据id查询业务id
DgApplyAmountList dgApplyAmountList = dgApplyAmountListMapper.selectById(id);
//根据主键id查询业务申请详细信息
//DgApplyAmountInfo dgApplyAmountInfo = this.baseMapper.selectById(id);
DgApplyAmountInfoResponse dgApplyAmountInfo = this.baseMapper.selectApplyAmountInfoById(id);
DgApplyAmountInfoResponse dgApplyAmountInfo = this.baseMapper.selectApplyAmountInfoById(dgApplyAmountList.getBusinessId());
String measures=dgApplyAmountInfo.getEnGuaranteeMeasures();
if(measures.length()>0){
String a = measures.substring(1,measures.length()-1);
@ -176,7 +212,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
System.out.println("企业详细============"+linkedList);
//查询附件详细,附件关联业务主键id
DgEnclosureInfoResponse dgEnclosureInfo = dgEnclosureInfoMapper.selectByCompanyId(id);
DgEnclosureInfoResponse dgEnclosureInfo = dgEnclosureInfoMapper.selectByCompanyId(dgApplyAmountList.getBusinessId());
List<String>list = new ArrayList<>();
list.add(dgEnclosureInfo.getAccountingFirm());
@ -244,8 +280,8 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
public int updateBusinessApplication(BusinessApplicationRequest businessApplication) {
//申请贷款相关信息
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo();
dgApplyAmountInfo.setId(businessApplication.getId());
dgApplyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId());
dgApplyAmountInfo.setId(businessApplication.getBusinessId());
dgApplyAmountInfo.setCompanyId(businessApplication.getCompanyId());
dgApplyAmountInfo.setApplyAmount(businessApplication.getApplyAmount());//申请额度
dgApplyAmountInfo.setApplyTime(businessApplication.getApplyTime());//申请期限
dgApplyAmountInfo.setBank(businessApplication.getBank());//贷款银行
@ -254,7 +290,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setEnGuaranteeMeasures(ArraysUtil.toString(businessApplication.getEnGuaranteeMeasures()));//反担保措施
dgApplyAmountInfo.setDescription(businessApplication.getDescription());//反担保措施描述
dgApplyAmountInfo.setBusinessType(businessApplication.getBusinessType());//业务类型
dgApplyAmountInfo.setUpdateTime(new Date());
//根据业务id修改申请贷款信息
this.baseMapper.updateById(dgApplyAmountInfo);
@ -271,7 +306,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
//上传附件信息
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo();
dgEnclosureInfo.setBusinessId(businessApplication.getId());//业务id
dgEnclosureInfo.setBusinessId(businessApplication.getBusinessId());//业务id
dgEnclosureInfo.setCompanyId(businessApplication.getCompanyId());//企业Id
dgEnclosureInfo.setBusinessLicense(ArraysUtil.toString(businessApplication.getBusinessLicense()));//营业执照复印件
dgEnclosureInfo.setLegalCardCopy(ArraysUtil.toString(businessApplication.getLegalCardCopy()));//上传法定代表人夫妻及企业实际经营者身份证复印件
@ -289,18 +324,33 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgEnclosureInfo.setInspectionPhotos(ArraysUtil.toString(businessApplication.getInspectionPhotos()));
//根据业务id删除对应的附件信息
dgEnclosureInfoMapper.delete(new QueryWrapper<DgEnclosureInfo>().eq("business_id",businessApplication.getId()));
dgEnclosureInfoMapper.delete(new QueryWrapper<DgEnclosureInfo>().eq("business_id",businessApplication.getBusinessId()));
//附件新增
return dgEnclosureInfoMapper.insert(dgEnclosureInfo);
}
@Override
public int revokeBusinessApplication(Integer id) {
//根据id查询业务id
DgApplyAmountList dgApplyAmountList1 = dgApplyAmountListMapper.selectById(id);
//根据id修改当前业务状态
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo();
dgApplyAmountInfo.setStatus(5);//状态为已撤销
dgApplyAmountInfo.setUpdateTime(new Date());
return this.baseMapper.update(dgApplyAmountInfo, new QueryWrapper<DgApplyAmountInfo>().eq("id", id));
DgApplyAmountList dgApplyAmountList = new DgApplyAmountList();
dgApplyAmountList.setId(id);
dgApplyAmountList.setStatus(StatusCode.SP_RESCINDED);//状态为已撤销
dgApplyAmountList.setOperatingStatus(StatusCode.CZ_TO_BE_SUBMITTED);//操作状态为待提交
dgApplyAmountListMapper.updateById(dgApplyAmountList);
//修改担保部经理审核状态
DgApplyAmountList applyAmountList = new DgApplyAmountList();
applyAmountList.setBusinessId(dgApplyAmountList1.getBusinessId());//业务id
applyAmountList.setType(2);//类型为担保部经理审核
applyAmountList.setStatus(StatusCode.SP_RESCINDED);//状态为已撤销
applyAmountList.setOperatingStatus(StatusCode.CZ_TO_BE_DEFINED);//操作状态为待定义,目前前端不展示
dgApplyAmountListMapper.update(applyAmountList,new QueryWrapper<DgApplyAmountList>()
.eq("business_id",applyAmountList.getBusinessId()).eq("type",applyAmountList.getType()));
//将业务流程状态设置为已撤销
return 1;
}
@Transactional
@ -336,8 +386,9 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
}
}
@Transactional
@Override
public int approvalBusinessApplication(Integer id, Integer status, String remark) {
public int approvalBusinessApplication(Integer id, Integer status, String remark, Integer companyId) {
//获取当前登录用户(审批人)id
String userId = null;
try{
@ -348,13 +399,47 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
} catch (Exception e) {
e.printStackTrace();
}
//根据id修改当前业务状态
DgApplyAmountInfo dgApplyAmountInfo = new DgApplyAmountInfo();
dgApplyAmountInfo.setStatus(status);
dgApplyAmountInfo.setRemark(remark);
dgApplyAmountInfo.setApprovalId(Integer.parseInt(userId));
dgApplyAmountInfo.setUpdateTime(new Date());
return dgApplyAmountInfoMapper.update(dgApplyAmountInfo,new QueryWrapper<DgApplyAmountInfo>().eq("id",id));
//根据dg_apply_amount_list表的id修改当前业务状态
DgApplyAmountList dgApplyAmountList = new DgApplyAmountList();
dgApplyAmountList.setStatus(status);
dgApplyAmountList.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态改为已处理
dgApplyAmountList.setApplyContent(remark);
dgApplyAmountList.setEmpId(5);//Integer.parseInt(userId)
dgApplyAmountListMapper.update(dgApplyAmountList,new QueryWrapper<DgApplyAmountList>().eq("id",id));
//如果审批状态为已审核,并且操作状态为已处理,则同时新增数据到担保部,资产部和信息部,让这三个模块去审
if(dgApplyAmountList.getStatus().equals(StatusCode.SP_REVIEWED) && dgApplyAmountList.getOperatingStatus().equals(StatusCode.CZ_PROCESSED)){
//新增一条记录到担保部
DgGuaranteeAssignUser guaranteeAssignUser = new DgGuaranteeAssignUser();
guaranteeAssignUser.setBusinessId(id);//业务id
guaranteeAssignUser.setCompanyId(companyId);//企业id
guaranteeAssignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理角色id
guaranteeAssignUser.setType(3);//角色类型
guaranteeAssignUser.setStatus(StatusCode.SP_TO_BE_ASSIGNED);//状态为待指派
guaranteeAssignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态为待处理
dgGuaranteeAssignUserMapper.insert(guaranteeAssignUser);
//新增一条记录到资产部
DgAssetsInvestigation dgAssetsInvestigation = new DgAssetsInvestigation();
dgAssetsInvestigation.setBusinessId(id);//业务id
dgAssetsInvestigation.setCompanyId(companyId);//企业id
dgAssetsInvestigation.setRoleId(PromptSuccess.ZC_JL_ID);//资产部经理角色id
dgAssetsInvestigation.setType(2);//角色类型
dgAssetsInvestigation.setStatus(StatusCode.SP_TO_BE_ASSIGNED);//状态为待指派
dgAssetsInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态为待处理
dgAssetsInvestigationMapper.insert(dgAssetsInvestigation);
//新增一条记录到信息部
DgMessageInvestigation dgMessageInvestigation = new DgMessageInvestigation();
dgMessageInvestigation.setBusinessId(id);//业务id
dgMessageInvestigation.setCompanyId(companyId);//企业id
dgMessageInvestigation.setRoleId(PromptSuccess.XX_JL_ID);//信息部经理角色id
dgMessageInvestigation.setType(2);//角色类型
dgMessageInvestigation.setStatus(StatusCode.SP_TO_BE_ASSIGNED);//状态为待指派
dgMessageInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态为待处理
dgMessageInvestigationMapper.insert(dgMessageInvestigation);
}
return 1;
}

@ -0,0 +1,39 @@
package com.daqing.financial.guarantee.service.impl;
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.mapper.DgApplyAmountListMapper;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.service.IDgApplyAmountListService;
import com.daqing.framework.domain.guarantee.DgApplyAmountList;
import com.daqing.framework.utils.PageUtils;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author Qyq
* @since 2020-11-24
*/
@Service
public class DgApplyAmountListServiceImpl extends ServiceImpl<DgApplyAmountListMapper, DgApplyAmountList> implements IDgApplyAmountListService {
@Override
public PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, List<String> roleIdlist, String userId) {
//分页参数
if (page <= 0) {
page = 1;
}
if (size <= 0) {
size = 10;
}
IPage<BusinessApplicationListResponse> positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,roleIdlist,userId);
return new PageUtils(positionVO);
}
}

@ -120,12 +120,14 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvest
assetsResponse.setAssessmentList(assessmentlist);
String files=assetsResponse.getFile();
if(files.length()>0){
String a = files.substring(1,files.length()-1);
String arry[]=a.split(",");
List<String> demoList = Arrays.asList(arry);
assetsResponse.setFileList(demoList);
System.out.println("arry==============="+demoList);
if(files != null){
if(files.length()>0){
String a = files.substring(1,files.length()-1);
String arry[]=a.split(",");
List<String> demoList = Arrays.asList(arry);
assetsResponse.setFileList(demoList);
System.out.println("arry==============="+demoList);
}
}
//根据业务id查询业务申请详细信息

@ -211,6 +211,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
dgGuaranteeAssignUser.setId(approvalGuaranteeRequest.getId());
dgGuaranteeAssignUser.setEmpId(5);//Integer.parseInt(dgApplyAmountInfoController.getUserId())
dgGuaranteeAssignUser.setRemark(ArraysUtil.toString(approvalGuaranteeRequest.getRemark()));//补充调查原因
dgGuaranteeAssignUser.setOtherRemark(approvalGuaranteeRequest.getOtherRemark());//其他原因
dgGuaranteeAssignUser.setStatus(approvalGuaranteeRequest.getStatus());
dgGuaranteeAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);//状态设置为已处理
dgGuaranteeAssignUser.setAmount(approvalGuaranteeRequest.getAmount());//金额

@ -25,7 +25,7 @@ public class MyBatisPlusCodeGenerator {
public static final String PACKAGE_NAME = "com.daqing.financial.guarantee";
public static void main(String[] args) {
String[] tables = new String[] {"dg_assets_investigation"};//表名数组
String[] tables = new String[] {"dg_apply_amount_list"};//表名数组
String[] tablePrefixs = new String[] {""};//去掉前缀
executeCode(PACKAGE_NAME,tables,tablePrefixs);
}

@ -16,6 +16,9 @@
<result column="business_type" property="businessType" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="operating_status" property="operatingStatus" />
<result column="role_id" property="roleId" />
<result column="type" property="type" />
</resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse">
select ai.id,ai.company_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daqing.financial.guarantee.mapper.DgApplyAmountListMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgApplyAmountList">
<result column="id" property="id" />
<result column="business_id" property="businessId" />
<result column="presenter_id" property="presenterId" />
<result column="role_id" property="roleId" />
<result column="emp_id" property="empId" />
<result column="type" property="type" />
<result column="status" property="status" />
<result column="apply_content" property="applyContent" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse">
select au.id,ai.company_id,au.business_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_apply_amount_list au
left join dg_apply_amount_info ai on au.business_id = ai.id
left join crms_company_customer ccl on ai.company_id = ccl.id
left join crms_customer cc on cc.id = ccl.customer_id
left JOIN dg_business_process_status ps ON ps.business_id = au.business_id
<where>
au.role_id in
<foreach collection="roleIdlist" open="(" separator="," close=")" item="id">
#{id}
</foreach>
<if test="customerNumberOrName != null and customerNumberOrName != ''">
AND (ai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%'))
</if>
<if test="userId != null and userId != ''">
AND (au.emp_id =#{userId} or au.emp_id is null)
</if>
</where>
</select>
</mapper>

@ -13,6 +13,7 @@
<result column="amount" property="amount" />
<result column="term" property="term" />
<result column="remark" property="remark" />
<result column="other_remark" property="otherRemark" />
<result column="apply_content" property="applyContent" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
@ -38,7 +39,7 @@
AND au.status = #{status}
</if>
<if test="userId != null and userId != ''">
AND au.emp_id =#{userId} or au.emp_id is null
AND (au.emp_id =#{userId} or au.emp_id is null)
</if>
</where>
</select>

@ -28,6 +28,8 @@ public class StatusCode {
/**
* 业务流程状态
*/
public static final Integer YW_RESCINDED = 0;//已撤销
public static final Integer YW_IN_PROGRESS = 1;//进行中
public static final Integer YW_COMPLETED = 2;//已完成
@ -43,4 +45,8 @@ public class StatusCode {
public static final Integer CZ_PROCESSED = 2;//已处理
public static final Integer CZ_TO_BE_SUBMITTED = 3;//待提交
public static final Integer CZ_TO_BE_DEFINED = 4;//待定义
}

@ -38,6 +38,16 @@ public class DgApplyAmountInfo implements Serializable {
*/
private Integer presenterId;
/**
* 角色id
*/
private Integer roleId;
/**
* 类型1->担保部业务员2->担保部经理审核
*/
private Integer type;
/**
* 申请额度
*/
@ -91,6 +101,11 @@ public class DgApplyAmountInfo implements Serializable {
*/
private Integer status;
/**
* 操作状态: 0->已发起1->待处理2->已处理
*/
private Integer operatingStatus;
/**
* 审批人Id
*/

@ -0,0 +1,84 @@
package com.daqing.framework.domain.guarantee;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author Qyq
* @since 2020-11-24
*/
@Data
@TableName("dg_apply_amount_list")
public class DgApplyAmountList implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Integer id;
/**
* 业务id
*/
private Integer businessId;
/**
* 提单人id
*/
private Integer presenterId;
/**
* 角色id
*/
private Integer roleId;
/**
* 审批人id
*/
private Integer empId;
/**
* 类型1->担保部业务员2->担保部经理审核
*/
private Integer type;
/**
* 状态(1待指派 2审核中 3审核通过 4审核不通过 5驳回)
*/
private Integer status;
/**
* 操作状态
*/
private Integer operatingStatus;
/**
* 审核意见
*/
private String applyContent;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -78,6 +78,11 @@ public class DgGuaranteeAssignUser implements Serializable {
*/
private String remark;
/**
* 其他原因
*/
private String otherRemark;
/**
* 审核意见
*/

Loading…
Cancel
Save