master
shijie 4 years ago
parent 6f6fac991b
commit 57ff35095a
  1. 4
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerController.java
  2. 24
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerServiceImpl.java
  3. 3
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java
  4. 11
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java
  5. 52
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java
  6. 10
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java
  7. 6
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  8. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java
  9. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/EmployeeService.java
  10. 5
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java
  11. 3
      dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml
  12. 30
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/response/CompanyCustomerResponse.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){

@ -570,18 +570,20 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerDao, CustomerEntity
boolean customer = customerDao.saveCustomer(customerEntity);
companyCustomerEntity.setCustomerId(customerEntity.getId());
int company = companyCustomerDao.insert(companyCustomerEntity);
//绑定关联关系
List<CrmsCustomerRelated> relatedList = new ArrayList<>();
List<Integer> 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<CrmsCustomerRelated> relatedList = new ArrayList<>();
List<Integer> 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;

@ -63,4 +63,7 @@ public interface HrmsFeignService {
*/
@GetMapping("/hrms/employee/listEmpNameByUserId")
ResponseResult<List<EmployeeVO>> listEmpNameByUserId(@RequestParam("userIds") Integer[] userIds);
@GetMapping("hrms/employee/selectUserRole")
ResponseResult selectUserRole(@RequestParam("userId") Long userId,@RequestParam("roleId")Long roleId);
}

@ -135,10 +135,13 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvest
dgAssetsInvestigation.setStatus(StatusCode.SP_IN_REVIEW);//审批状态为审核中
dgAssetsInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
dgAssetsInvestigationMapper.insert(dgAssetsInvestigation);
//绑定角色关系
hrmsFeignService.insertUserRole(assetsRequest.getEmpId().longValue(),PromptSuccess.ZC_ZY_ID.longValue());
//查询用户角色表是否已绑定,如果没有绑定,则去往绑定页面
ResponseResult i = hrmsFeignService.selectUserRole(assetsRequest.getEmpId().longValue(),PromptSuccess.ZC_ZY_ID.longValue());
int a = (int) i.getData();
if(a==0) {
//绑定角色关系
hrmsFeignService.insertUserRole(assetsRequest.getEmpId().longValue(), PromptSuccess.ZC_ZY_ID.longValue());
}
return true;
}

@ -102,23 +102,21 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
//根据业务id查询业务申请详细信息
DgApplyAmountInfoResponse dgApplyAmountInfo = dgApplyAmountInfoMapper.selectApplyAmountInfoById(guaranteeAssignUser.getBusinessId());
String measures = dgApplyAmountInfo.getEnGuaranteeMeasures();
if (measures.length() > 0) {
String a = measures.substring(1, measures.length() - 1);
String arry[] = a.split(",");
List<String> 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<String> 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<DgGuaranteeAss
String arr1[] = a1.split(",");
arr1List = Arrays.asList(arr1);
arr1List2.add(i, arr1List);
System.out.println("arr1LIst====" + arr1List);
} else {
arr1List2.add(i, null);
}
@ -168,7 +165,6 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
dgEnclosureInfo.setMeetingMinutesList((List<String>) arr1List2.get(12));
dgEnclosureInfo.setMarriageCopyList((List<String>) arr1List2.get(13));
System.out.println("附件详细==============" + dgEnclosureInfo);
//查询担保部经理审核的金额和期限
DgGuaranteeAssignUser assignUser = this.baseMapper.selectOne(new QueryWrapper<DgGuaranteeAssignUser>()
@ -540,21 +536,31 @@ public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAss
dgGuaranteeAssignUser2.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
dgGuaranteeAssignUserMapper.insert(dgGuaranteeAssignUser2);
List<DgGuaranteePO> 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<DgGuaranteePO> 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();
}

@ -131,9 +131,13 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl<DgMessageInve
messageInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
dgMessageInvestigationMapper.insert(messageInvestigation);
//绑定角色关系
hrmsFeignService.insertUserRole(messageRequest.getEmpId().longValue(),PromptSuccess.XX_ZY_ID.longValue());
//查询用户角色表是否已绑定,如果没有绑定,则去往绑定页面
ResponseResult i = hrmsFeignService.selectUserRole(messageRequest.getEmpId().longValue(),PromptSuccess.XX_ZY_ID.longValue());
int a = (int) i.getData();
if(a==0) {
//绑定角色关系
hrmsFeignService.insertUserRole(messageRequest.getEmpId().longValue(), PromptSuccess.XX_ZY_ID.longValue());
}
return true;
}

@ -274,4 +274,10 @@ public class EmployeeController implements EmployeeControllerApi {
public ResponseResult saveUserRole(@RequestParam("userId") Long userId, @RequestParam("roleId") Long roleId) {
return ResponseResult.SUCCESS(employeeService.saveUserRole(userId, roleId));
}
@GetMapping("/selectUserRole")
public ResponseResult selectUserRole(@RequestParam("userId") Long userId, @RequestParam("roleId") Long roleId) {
int i = employeeService.selectUserRole(userId, roleId);
return ResponseResult.SUCCESS(i);
}
}

@ -109,4 +109,6 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
List<EmployeeVO> listEmpNameByUserId(@Param("userIds") List<Long> userIds);
List<UserDeptVO> getListEmployeeTrees(@Param("id")Long id, @Param("account")String account);
int selectUserRole(@Param("userId") Long userId, @Param("roleId") Long roleId);
}

@ -73,5 +73,7 @@ public interface EmployeeService extends IService<EmployeeEntity> {
Boolean saveUserRole(Long userId, Long roleId);
List<EmployeeVO> listEmpNameByUserId(List<Integer> userIds);
int selectUserRole(Long userId, Long roleId);
}

@ -634,4 +634,9 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
}
return this.getBaseMapper().listEmpNameByUserId(userIdList);
}
@Override
public int selectUserRole(Long userId, Long roleId) {
return this.getBaseMapper().selectUserRole(userId, roleId);
}
}

@ -624,5 +624,8 @@
AND u.account LIKE CONCAT('%',#{account},'%')
</if>
</select>
<select id="selectUserRole" resultType="java.lang.Integer">
select COUNT(0) from hrms_employee_role where user_id=#{userId} and role_id=#{roleId}
</select>
</mapper>

@ -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;
/**
* 是否存在关联人
*/

Loading…
Cancel
Save