From 57ff35095aea605410d7c2fb456ed3143fec09b0 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Tue, 15 Dec 2020 09:24:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crms/controller/CustomerController.java | 4 ++ .../service/impl/CustomerServiceImpl.java | 24 +++++---- .../guarantee/feign/HrmsFeignService.java | 3 ++ .../DgAssetsInvestigationServiceImpl.java | 11 ++-- .../DgGuaranteeAssignUserServiceImpl.java | 52 +++++++++++-------- .../DgMessageInvestigationServiceImpl.java | 10 ++-- .../hrms/controller/EmployeeController.java | 6 +++ .../financial/hrms/dao/EmployeeDao.java | 2 + .../hrms/service/EmployeeService.java | 2 + .../service/impl/EmployeeServiceImpl.java | 5 ++ .../resources/mapper/hrms/EmployeeDao.xml | 3 ++ .../response/CompanyCustomerResponse.java | 30 +++++++++++ 12 files changed, 111 insertions(+), 41 deletions(-) diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java index efe663a8..269fff02 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java @@ -14,6 +14,8 @@ import com.daqing.framework.model.response.CommonCode; import com.daqing.framework.model.response.PromptSuccess; import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.utils.PageUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -32,6 +34,7 @@ import java.util.*; * @date 2020-09-08 09:57:32 */ @RestController +@Api(tags = {"记录客户基本信息"}) @RequestMapping("crms/customer") public class CustomerController implements CustomerControllerApi { @@ -150,6 +153,7 @@ public class CustomerController implements CustomerControllerApi { /** * 根据客户编号/客户名称获取企业信息 */ + @ApiOperation(value = "根据客户编号/客户名称获取企业信息") @PostMapping("/queryCustomerInfoById") public ResponseResult queryCustomerInfoById(@RequestBody DgApplyAmountInfoRequest applyAmountInfo){ diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java index 52a04b69..20f03db5 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java @@ -570,18 +570,20 @@ public class CustomerServiceImpl extends ServiceImpl relatedList = new ArrayList<>(); - List intList = companyCustomerReq.getRelatedId(); - - for (int i = 0; i < intList.size(); i++) { - CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); - Integer integer = intList.get(i); - crmsCustomerRelated.setCustomerId(companyCustomerEntity.getId().intValue());//企业id - crmsCustomerRelated.setRelatedId(integer);//关联人/企业id - relatedList.add(crmsCustomerRelated); + if(companyCustomerReq.getIsExistRelated()==1){//有关联人的情况下才绑定关联关系 + //绑定关联关系 + List relatedList = new ArrayList<>(); + List intList = companyCustomerReq.getRelatedId(); + + for (int i = 0; i < intList.size(); i++) { + CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated(); + Integer integer = intList.get(i); + crmsCustomerRelated.setCustomerId(companyCustomerEntity.getId().intValue());//企业id + crmsCustomerRelated.setRelatedId(integer);//关联人/企业id + relatedList.add(crmsCustomerRelated); + } + crmsCustomerRelatedService.insertCustomerRelated(relatedList); } - crmsCustomerRelatedService.insertCustomerRelated(relatedList); if (customer == true && company > 0) { return true; diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java index 07e778f6..de4bb3c7 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java @@ -63,4 +63,7 @@ public interface HrmsFeignService { */ @GetMapping("/hrms/employee/listEmpNameByUserId") ResponseResult> listEmpNameByUserId(@RequestParam("userIds") Integer[] userIds); + + @GetMapping("hrms/employee/selectUserRole") + ResponseResult selectUserRole(@RequestParam("userId") Long userId,@RequestParam("roleId")Long roleId); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java index 70169c3e..1938d0e9 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java @@ -135,10 +135,13 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl 0) { - String a = measures.substring(1, measures.length() - 1); - String arry[] = a.split(","); - List demoList = Arrays.asList(arry); - dgApplyAmountInfo.setEnGuaranteeMeasure(demoList); - System.out.println("arry===============" + demoList); + if(measures != null){ + if (measures.length() > 0) { + String a = measures.substring(1, measures.length() - 1); + String arry[] = a.split(","); + List demoList = Arrays.asList(arry); + dgApplyAmountInfo.setEnGuaranteeMeasure(demoList); + } } - System.out.println("业务申请详细=========" + dgApplyAmountInfo); - DgApplyAmountInfoRequest applyAmountInfo = new DgApplyAmountInfoRequest(); applyAmountInfo.setCompanyId(dgApplyAmountInfo.getCompanyId()); //根据企业id查询企业详情 ResponseResult result = crmsFeignService.queryCustomerInfoById(applyAmountInfo); LinkedHashMap linkedList = (LinkedHashMap) result.getData(); - System.out.println("企业详细============" + linkedList); //查询附件详细,附件关联业务主键id DgEnclosureInfoResponse dgEnclosureInfo = dgEnclosureInfoMapper.selectByCompanyId(guaranteeAssignUser.getBusinessId()); @@ -148,7 +146,6 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl) arr1List2.get(12)); dgEnclosureInfo.setMarriageCopyList((List) arr1List2.get(13)); - System.out.println("附件详细==============" + dgEnclosureInfo); //查询担保部经理审核的金额和期限 DgGuaranteeAssignUser assignUser = this.baseMapper.selectOne(new QueryWrapper() @@ -540,21 +536,31 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl list = new ArrayList(); - DgGuaranteePO dgGuaranteePO1 = new DgGuaranteePO(); - dgGuaranteePO1.setUserId(guaranteeRequest.getEmpAId().longValue()); - dgGuaranteePO1.setRoleId(PromptSuccess.DB_A_ID.longValue()); - DgGuaranteePO dgGuaranteePO2 = new DgGuaranteePO(); - dgGuaranteePO2.setUserId(guaranteeRequest.getEmpBId().longValue()); - dgGuaranteePO2.setRoleId(PromptSuccess.DB_B_ID.longValue()); - list.add(dgGuaranteePO1); - list.add(dgGuaranteePO2); - //批量绑定角色关系 - hrmsFeignService.insertUsrRole(list); + //查询用户角色表是否已绑定,如果没有绑定,则去往绑定页面 + ResponseResult i = hrmsFeignService.selectUserRole(guaranteeRequest.getEmpAId().longValue(), PromptSuccess.DB_A_ID.longValue()); + ResponseResult u = hrmsFeignService.selectUserRole(guaranteeRequest.getEmpBId().longValue(),PromptSuccess.DB_B_ID.longValue()); + int a = (int) i.getData(); + int b = (int) u.getData(); + int sum = a+b; + if(sum==0){ + List list = new ArrayList(); + DgGuaranteePO dgGuaranteePO1 = new DgGuaranteePO(); + dgGuaranteePO1.setUserId(guaranteeRequest.getEmpAId().longValue()); + dgGuaranteePO1.setRoleId(PromptSuccess.DB_A_ID.longValue()); + DgGuaranteePO dgGuaranteePO2 = new DgGuaranteePO(); + dgGuaranteePO2.setUserId(guaranteeRequest.getEmpBId().longValue()); + dgGuaranteePO2.setRoleId(PromptSuccess.DB_B_ID.longValue()); + list.add(dgGuaranteePO1); + list.add(dgGuaranteePO2); + //批量绑定角色关系 + hrmsFeignService.insertUsrRole(list); + } + + //hrmsFeignService.insertUserRole(guaranteeRequest.getEmpAId().longValue(),PromptSuccess.DB_A_ID.longValue()); //hrmsFeignService.insertUserRole(guaranteeRequest.getEmpBId().longValue(),PromptSuccess.DB_B_ID.longValue()); - return new ResponseResult(); + return ResponseResult.SUCCESS(); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java index 9997e4ad..ecb6c26b 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java @@ -131,9 +131,13 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl { List listEmpNameByUserId(@Param("userIds") List userIds); List getListEmployeeTrees(@Param("id")Long id, @Param("account")String account); + + int selectUserRole(@Param("userId") Long userId, @Param("roleId") Long roleId); } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/EmployeeService.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/EmployeeService.java index 11058309..7790ffe3 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/EmployeeService.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/EmployeeService.java @@ -73,5 +73,7 @@ public interface EmployeeService extends IService { Boolean saveUserRole(Long userId, Long roleId); List listEmpNameByUserId(List userIds); + + int selectUserRole(Long userId, Long roleId); } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java index 6856fee3..377ac881 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java @@ -634,4 +634,9 @@ public class EmployeeServiceImpl extends ServiceImpl + \ No newline at end of file diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CompanyCustomerResponse.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CompanyCustomerResponse.java index fac6f819..773473cf 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CompanyCustomerResponse.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CompanyCustomerResponse.java @@ -3,6 +3,7 @@ package com.daqing.framework.domain.crms.response; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -33,6 +34,9 @@ public class CompanyCustomerResponse implements Serializable { */ @ApiModelProperty(value = "注册资金") private String registeredCapital; + + @ApiModelProperty(value = "社会统一代码") + private String socialUnifiedCode; /** * 所属行业 */ @@ -68,11 +72,37 @@ public class CompanyCustomerResponse implements Serializable { */ @ApiModelProperty(value = "联系人") private String linkman; + + @ApiModelProperty(value = "联系人的联系电话") + private String linkPhone; /** * 业务来源 */ @ApiModelProperty(value = "业务来源") private String businessSource; + + @ApiModelProperty(value = "经营范围") + private String businessScope; + @ApiModelProperty(value = "经营地址") + private String businessAddr; + + @ApiModelProperty(value = "注册时间") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date registerTime; + @ApiModelProperty(value = "注册地址") + private String registerAddr; + @ApiModelProperty(value = "法人-身份证号") + private String legalIdNumber; + @ApiModelProperty(value = "法人-户口所在地") + private String legalHukouAddr; + @ApiModelProperty(value = "法人-联系电话") + private String legalPhone; + @ApiModelProperty(value = "法人-家庭住址") + private String legalHomeAddr; + @ApiModelProperty(value = "法人-性别 1、男,0、女") + private Integer legalGender; + @ApiModelProperty(value = "法人-姓名") + private String legalName; /** * 是否存在关联人 */