修改部分bug,包括工作台客户资源管理系统以及业务管理

master
shijie 4 years ago
parent 886a432781
commit a5f32b5795
  1. 3
      dq-financial-crms/src/main/java/com/daqing/financial/crms/dao/CustomerWorkbenchDao.java
  2. 3
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  3. 15
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerWorkbenchServiceImpl.java
  4. 19
      dq-financial-crms/src/main/resources/mapper/crms/CustomerWorkbenchDao.xml
  5. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java
  6. 44
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java
  7. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java
  8. 98
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CustomerEntityResponse.java
  9. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CustomerWorkbenchListVO.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.framework.domain.crms.CustomerEntity; import com.daqing.framework.domain.crms.CustomerEntity;
import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest;
import com.daqing.framework.domain.crms.response.CustomerEntityResponse;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -15,7 +16,7 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface CustomerWorkbenchDao extends BaseMapper<CustomerEntity> { public interface CustomerWorkbenchDao extends BaseMapper<CustomerEntity> {
IPage<CustomerEntity> queryList(Page page, @Param("cr")CustomerWorkbenchRequest customerWorkbenchRequest); IPage<CustomerEntityResponse> queryList(Page page, @Param("cr")CustomerWorkbenchRequest customerWorkbenchRequest);
Boolean passById(@Param("id")Long id,@Param("manager")Long manager); Boolean passById(@Param("id")Long id,@Param("manager")Long manager);
} }

@ -615,7 +615,10 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
crmsCustomerRelated.setRelatedId(integer);//关联人/企业id crmsCustomerRelated.setRelatedId(integer);//关联人/企业id
relatedList.add(crmsCustomerRelated); relatedList.add(crmsCustomerRelated);
} }
if(relatedList.size()>0){
crmsCustomerRelatedService.insertCustomerRelated(relatedList); crmsCustomerRelatedService.insertCustomerRelated(relatedList);
}
if(customer==true && company>0){ if(customer==true && company>0){
return true; return true;
} }

@ -11,6 +11,7 @@ import com.daqing.financial.crms.service.CustomerWorkbenchService;
import com.daqing.framework.domain.crms.CustomerEntity; import com.daqing.framework.domain.crms.CustomerEntity;
import com.daqing.framework.domain.crms.ext.*; import com.daqing.framework.domain.crms.ext.*;
import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest; import com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest;
import com.daqing.framework.domain.crms.response.CustomerEntityResponse;
import com.daqing.framework.domain.crms.response.CustomerWorkbenchListVO; import com.daqing.framework.domain.crms.response.CustomerWorkbenchListVO;
import com.daqing.framework.domain.hrms.EmployeeEntity; import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.daqing.framework.domain.hrms.ext.EmployeeTO; import com.daqing.framework.domain.hrms.ext.EmployeeTO;
@ -56,12 +57,14 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl<CustomerWorkbenchD
} }
// 校验时间参数 // 校验时间参数
this.timeCheckout(cwr.getCreateTime(), cwr.getStartTime(), cwr.getEndTime(), cwr); this.timeCheckout(cwr.getCreateTime(), cwr.getStartTime(), cwr.getEndTime(), cwr);
IPage<CustomerEntity> customerEntityIPage = this.getBaseMapper().queryList(new Page(page, size), cwr); //IPage<CustomerEntity> customerEntityIPage = this.getBaseMapper().queryList(new Page(page, size), cwr);
List<CustomerEntity> customers = customerEntityIPage.getRecords(); //List<CustomerEntity> customers = customerEntityIPage.getRecords();
IPage<CustomerEntityResponse> customerEntityIPage = this.getBaseMapper().queryList(new Page(page, size), cwr);
List<CustomerEntityResponse> customers = customerEntityIPage.getRecords();
// 获取所有的客户经理id // 获取所有的客户经理id
Long[] managerIds = customers.stream().map(CustomerEntity::getManager).toArray(Long[]::new); Long[] managerIds = customers.stream().map(CustomerEntityResponse::getManager).toArray(Long[]::new);
// 获取所有的客户id // 获取所有的客户id
Long[] customerIds = customers.stream().map(CustomerEntity::getId).toArray(Long[]::new); Long[] customerIds = customers.stream().map(CustomerEntityResponse::getId).toArray(Long[]::new);
// 返回列表实体类集合 // 返回列表实体类集合
List<CustomerWorkbenchListVO> customerWorkbenchListVOS = new ArrayList<>(); List<CustomerWorkbenchListVO> customerWorkbenchListVOS = new ArrayList<>();
for (int i = 0; i < customers.size(); i++) { for (int i = 0; i < customers.size(); i++) {
@ -248,11 +251,11 @@ public class CustomerWorkbenchServiceImpl extends ServiceImpl<CustomerWorkbenchD
/** /**
* 拼接客户及其对应的客户经理及部门信息 * 拼接客户及其对应的客户经理及部门信息
*/ */
private List<CustomerWorkbenchListVO> jointCustomerEmployee(List<CustomerEntity> customers, List<EmployeeTO> employeeTO) { private List<CustomerWorkbenchListVO> jointCustomerEmployee(List<CustomerEntityResponse> customers, List<EmployeeTO> employeeTO) {
List<CustomerWorkbenchListVO> customerWorkbenchListVOS = new ArrayList<>();// 用于拼装客户信息和员工及部门信息的集合 List<CustomerWorkbenchListVO> customerWorkbenchListVOS = new ArrayList<>();// 用于拼装客户信息和员工及部门信息的集合
CustomerWorkbenchListVO customerWorkbenchListVO; CustomerWorkbenchListVO customerWorkbenchListVO;
// 将客户信息和客户经理及部门信息拼装起来 // 将客户信息和客户经理及部门信息拼装起来
for (CustomerEntity customer : customers) { for (CustomerEntityResponse customer : customers) {
// 每一个客户对应一个不同的对象 // 每一个客户对应一个不同的对象
customerWorkbenchListVO = new CustomerWorkbenchListVO(); customerWorkbenchListVO = new CustomerWorkbenchListVO();
for (EmployeeTO anEmployeeTO : employeeTO) { for (EmployeeTO anEmployeeTO : employeeTO) {

@ -21,23 +21,24 @@
</resultMap> </resultMap>
<!-- 查询客户列表(所有)、根据创建时间筛选、根据客户类型筛选、根据客户编号或者名称搜索 --> <!-- 查询客户列表(所有)、根据创建时间筛选、根据客户类型筛选、根据客户编号或者名称搜索 -->
<select id="queryList" parameterType="com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest" resultType="com.daqing.framework.domain.crms.CustomerEntity"> <select id="queryList" parameterType="com.daqing.framework.domain.crms.request.CustomerWorkbenchRequest" resultType="com.daqing.framework.domain.crms.response.CustomerEntityResponse">
SELECT id,code,type,name,phone,manager SELECT cc.id,cc.code,cc.type,cc.name,cc.phone,cc.manager,ccc.id as companyId
FROM crms_customer FROM crms_customer cc
WHERE del_or_not = 0 LEFT JOIN crms_company_customer ccc on ccc.customer_id=cc.id
WHERE cc.del_or_not = 0
<if test="cr.codeOrName != null and cr.codeOrName != '' "> <if test="cr.codeOrName != null and cr.codeOrName != '' ">
AND (name LIKE CONCAT('%',#{cr.codeOrName},'%') OR code LIKE CONCAT('%',#{cr.codeOrName},'%')) AND (cc.name LIKE CONCAT('%',#{cr.codeOrName},'%') OR cc.code LIKE CONCAT('%',#{cr.codeOrName},'%'))
</if> </if>
<if test="cr.customerType != null"> <if test="cr.customerType != null">
AND type = #{cr.customerType} AND cc.type = #{cr.customerType}
</if> </if>
<if test="cr.startTime != null and cr.startTime != '' "> <if test="cr.startTime != null and cr.startTime != '' ">
AND create_time &gt;= #{cr.startTime} AND cc.create_time &gt;= #{cr.startTime}
</if> </if>
<if test="cr.endTime != null and cr.endTime != '' "> <if test="cr.endTime != null and cr.endTime != '' ">
AND create_time &lt;= #{cr.endTime} AND cc.create_time &lt;= #{cr.endTime}
</if> </if>
ORDER BY create_time DESC ORDER BY cc.create_time DESC
</select> </select>
<update id="passById"> <update id="passById">

@ -380,7 +380,7 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvest
//新增记录到合规调查 //新增记录到合规调查
DgComplianceInvestigation compliance =new DgComplianceInvestigation(); DgComplianceInvestigation compliance =new DgComplianceInvestigation();
compliance.setCompanyId(assetsInvestigation.getCompanyId());//企业id compliance.setCompanyId(assetsInvestigation.getCompanyId());//企业id
compliance.setRoleId(assetsInvestigation.getRoleId());//角色id compliance.setRoleId(PromptSuccess.FG_JL_ID);//角色id
compliance.setBusinessId(assetsInvestigation.getBusinessId());//业务id compliance.setBusinessId(assetsInvestigation.getBusinessId());//业务id
compliance.setOperationStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 compliance.setOperationStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
compliance.setAuditStatus(StatusCode.SP_TO_BE_ASSIGNED);//审核状态设置为待指派 compliance.setAuditStatus(StatusCode.SP_TO_BE_ASSIGNED);//审核状态设置为待指派

@ -176,12 +176,13 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
//根据主键id查询业务id //根据主键id查询业务id
DgGuaranteeAssignUser guaranteeAssignUser = this.getBaseMapper().selectById(investigateGuaranteeRequest.getId()); DgGuaranteeAssignUser guaranteeAssignUser = this.getBaseMapper().selectById(investigateGuaranteeRequest.getId());
//如果是属于驳回的数据,并且调查通过 //如果是属于驳回的数据,并且调查通过(同意)
if(guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)){ if(guaranteeAssignUser.getStatus().equals(StatusCode.SP_REJECT)){
//AB角调查,修改审核意见以及状态 //AB角调查,修改审核意见以及状态
DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser(); DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser();
dgGuaranteeAssignUser.setId(investigateGuaranteeRequest.getId());//主键id dgGuaranteeAssignUser.setId(investigateGuaranteeRequest.getId());//主键id
dgGuaranteeAssignUser.setStatus(StatusCode.SP_REJECT);//状态为驳回 dgGuaranteeAssignUser.setStatus(StatusCode.SP_REJECT);//状态为驳回(只有A,B角同时)
dgGuaranteeAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理 dgGuaranteeAssignUser.setOperatingStatus(StatusCode.CZ_PROCESSED);//操作状态设置为已处理
dgGuaranteeAssignUser.setRemark(investigateGuaranteeRequest.getApplyContent());//审核意见 dgGuaranteeAssignUser.setRemark(investigateGuaranteeRequest.getApplyContent());//审核意见
this.baseMapper.updateById(dgGuaranteeAssignUser); this.baseMapper.updateById(dgGuaranteeAssignUser);
@ -236,6 +237,28 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
.eq("business_id",guaranteeAssignUser.getBusinessId())); .eq("business_id",guaranteeAssignUser.getBusinessId()));
} }
//判断A角和B角是否都调查通过,如果都审核通过,修改担保部经理操作状态为待处理
int a = this.baseMapper.selectCount(new QueryWrapper<DgGuaranteeAssignUser>().eq("business_id",guaranteeAssignUser.getBusinessId())
.eq("type",1).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED));
int b = this.baseMapper.selectCount(new QueryWrapper<DgGuaranteeAssignUser>().eq("business_id",guaranteeAssignUser.getBusinessId())
.eq("type",2).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED));
int sum2 = a+b;
if(sum2==2){
/* if(){//合规调查驳回情况处理
}else if(){//贷审会业务流程驳回情况处理
}else{//正常情况处理*/
DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser();
assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理
assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
assignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
this.baseMapper.update(assignUser,new QueryWrapper<DgGuaranteeAssignUser>().eq("business_id",guaranteeAssignUser.getBusinessId())
.eq("type",3));
//}
}
//上传附件信息 //上传附件信息
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo(); DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo();
dgEnclosureInfo.setBusinessId(guaranteeAssignUser.getBusinessId());//业务id dgEnclosureInfo.setBusinessId(guaranteeAssignUser.getBusinessId());//业务id
@ -255,21 +278,6 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
//附件新增 //附件新增
dgEnclosureInfoMapper.insert(dgEnclosureInfo); dgEnclosureInfoMapper.insert(dgEnclosureInfo);
//判断A角和B角是否都调查通过,如果都审核通过,修改担保部经理操作状态为待处理
int a = this.baseMapper.selectCount(new QueryWrapper<DgGuaranteeAssignUser>().eq("business_id",guaranteeAssignUser.getBusinessId())
.eq("type",1).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED));
int b = this.baseMapper.selectCount(new QueryWrapper<DgGuaranteeAssignUser>().eq("business_id",guaranteeAssignUser.getBusinessId())
.eq("type",2).eq("status",StatusCode.SP_IN_REVIEW).eq("operating_status",StatusCode.CZ_PROCESSED));
int sum2 = a+b;
if(sum2==2){
DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser();
assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理
assignUser.setStatus(StatusCode.SP_IN_REVIEW);//审批状态设置为审核中
assignUser.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
this.baseMapper.update(assignUser,new QueryWrapper<DgGuaranteeAssignUser>().eq("business_id",guaranteeAssignUser.getBusinessId())
.eq("type",3));
}
//同时往审核流程进程表新增一条记录 //同时往审核流程进程表新增一条记录
String account = dgApplyAmountInfoController.getAccount(); String account = dgApplyAmountInfoController.getAccount();
AuditProcessUtil.save(guaranteeAssignUser.getBusinessId(),account,"担保部A/B角",investigateGuaranteeRequest.getApplyContent(),2); AuditProcessUtil.save(guaranteeAssignUser.getBusinessId(),account,"担保部A/B角",investigateGuaranteeRequest.getApplyContent(),2);
@ -375,7 +383,7 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
//新增记录到合规调查 //新增记录到合规调查
DgComplianceInvestigation compliance =new DgComplianceInvestigation(); DgComplianceInvestigation compliance =new DgComplianceInvestigation();
compliance.setCompanyId(guaranteeUser.getCompanyId());//企业id compliance.setCompanyId(guaranteeUser.getCompanyId());//企业id
compliance.setRoleId(guaranteeUser.getRoleId());//角色id compliance.setRoleId(PromptSuccess.FG_JL_ID);//角色id
compliance.setBusinessId(guaranteeUser.getBusinessId());//业务id compliance.setBusinessId(guaranteeUser.getBusinessId());//业务id
compliance.setOperationStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 compliance.setOperationStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
compliance.setAuditStatus(StatusCode.SP_TO_BE_ASSIGNED);//审核状态设置为待指派 compliance.setAuditStatus(StatusCode.SP_TO_BE_ASSIGNED);//审核状态设置为待指派

@ -350,7 +350,7 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl<DgMessageInve
//新增记录到合规调查 //新增记录到合规调查
DgComplianceInvestigation compliance =new DgComplianceInvestigation(); DgComplianceInvestigation compliance =new DgComplianceInvestigation();
compliance.setCompanyId(messageInvestigation.getCompanyId());//企业id compliance.setCompanyId(messageInvestigation.getCompanyId());//企业id
compliance.setRoleId(messageInvestigation.getRoleId());//角色id compliance.setRoleId(PromptSuccess.FG_JL_ID);//角色id
compliance.setBusinessId(messageInvestigation.getBusinessId());//业务id compliance.setBusinessId(messageInvestigation.getBusinessId());//业务id
compliance.setOperationStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理 compliance.setOperationStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
compliance.setAuditStatus(StatusCode.SP_TO_BE_ASSIGNED);//审核状态设置为待指派 compliance.setAuditStatus(StatusCode.SP_TO_BE_ASSIGNED);//审核状态设置为待指派

@ -0,0 +1,98 @@
package com.daqing.framework.domain.crms.response;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* 记录客户基本信息
*
* @author gongsj
* @email gongsj@gmail.com
* @date 2020-09-08 11:23:28
*/
@Data
public class CustomerEntityResponse implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@NotNull(message = "id不能为空")
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 客户编号
*/
@ApiModelProperty(value = "客户编号")
private String code;
/**
* 客户类型1企业类型0个人类型
*/
@NotNull(message = "客户类型不能为空")
@ApiModelProperty(value = "客户类型")
//@Pattern(regexp = "^\\\\d+$",message = "成立年限只能为整形数字")
private Integer type;
/**
* 客户的经理人id
*/
@ApiModelProperty(value = "客户经理人id")
private Long manager;
/**
* 客户名称
*/
@ApiModelProperty(value = "客户名称")
private String name;
/**
* 联系地址
*/
@ApiModelProperty(value = "联系地址")
private String addr;
/**
* 联系电话
*/
@NotNull(message = "联系电话不能为空")
@ApiModelProperty(value = "联系电话")
private String phone;
/**
* 密码
*/
@ApiModelProperty(value = "密码")
private String password;
/**
* 微信唯一标识
*/
@ApiModelProperty(value = "微信唯一标识")
private String wechatId;
/**
* 0未删除1已删除
*/
@ApiModelProperty(value = "是否删除")
private Integer delOrNot;
/**
* 0启用1禁用
*/
@ApiModelProperty(value = "是否禁用")
private Integer status;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
@ApiModelProperty(value = "修改时间")
private Date motifyTime;
@ApiModelProperty(value = "企业id")
private Long companyId;
}

@ -40,4 +40,7 @@ public class CustomerWorkbenchListVO implements Serializable {
@ApiModelProperty(value = "审批状态(0:通过,1:未通过,2:带审核)") @ApiModelProperty(value = "审批状态(0:通过,1:未通过,2:带审核)")
private Integer status; private Integer status;
@ApiModelProperty(value = "企业id")
private Long companyId;
} }

Loading…
Cancel
Save