担保部调查模块处理

master
shijie 4 years ago
parent 9d742f9508
commit 2c1bf42181
  1. 5
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java
  2. 1
      dq-financial-crms/src/main/resources/mapper/crms/CrmsCompanyPersonalMapper.xml
  3. 19
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  4. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyController.java
  5. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyLastController.java
  6. 168
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java
  7. 12
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java
  8. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyLastMapper.java
  9. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyMapper.java
  10. 7
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeAssignUserMapper.java
  11. 36
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalGuaranteeRequest.java
  12. 30
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeRequest.java
  13. 68
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InvestigateGuaranteeRequest.java
  14. 44
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeDetailResponse.java
  15. 89
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeListResponse.java
  16. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyLastService.java
  17. 16
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyService.java
  18. 13
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java
  19. 11
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  20. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyLastServiceImpl.java
  21. 20
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyServiceImpl.java
  22. 217
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java
  23. 19
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyLastMapper.xml
  24. 19
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyMapper.xml
  25. 21
      dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeAssignUserMapper.xml
  26. 25
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  27. 4
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java
  28. 15
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  29. 7
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java
  30. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java
  31. 5
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/EmployeeService.java
  32. 20
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java
  33. 11
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java
  34. 30
      dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml
  35. 8
      dq-framework-common/src/main/java/com/daqing/framework/util/JwtUtils.java
  36. 6
      dq-framework-model/src/main/java/com/daqing/framework/domain/crms/CrmsCompanyPersonal.java
  37. 67
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeApply.java
  38. 67
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeApplyLast.java
  39. 10
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeAssignUser.java
  40. 20
      dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/po/DgGuaranteePO.java
  41. 3
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/DepartmentVO.java
  42. 28
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/ext/UserDeptVO.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.daqing.financial.crms.service.ICrmsCompanyPersonalService;
import com.daqing.financial.crms.service.ICrmsCustomerRelatedService;
import com.daqing.framework.domain.crms.CrmsCompanyPersonal;
import com.daqing.framework.domain.crms.CrmsCustomerRelated;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.utils.PageUtils;
import io.swagger.annotations.Api;
@ -52,6 +53,10 @@ public class CrmsCompanyPersonalController {
@ApiOperation(value = "新增个人/企业关联人")
public ResponseResult insertCompanyPersonal(@RequestBody @Valid CrmsCompanyPersonal crmsCompanyPersonal) {
boolean result = crmsCompanyPersonalService.save(crmsCompanyPersonal);
CrmsCustomerRelated crmsCustomerRelated = new CrmsCustomerRelated();
crmsCustomerRelated.setRelatedId(crmsCompanyPersonal.getId().intValue());//关联人Id
crmsCustomerRelated.setCustomerId(crmsCompanyPersonal.getRelatedCompanyId());//企业id
boolean bindRelated = crmsCustomerRelatedService.save(crmsCustomerRelated);
return result ? ResponseResult.SUCCESS("返回的关联人id="+crmsCompanyPersonal.getId()) : ResponseResult.FAIL();
}

@ -23,6 +23,7 @@
<result column="employer" property="employer" />
<result column="position" property="position" />
<result column="type" property="type" />
<result column="related_company_id" property="relatedCompanyId" />
</resultMap>
<update id="updateIsExistRelated" parameterType="int">
update crms_company_customer set is_exist_related=#{isExistRelated} where id=#{id}

@ -155,15 +155,7 @@ 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 = null;
try{
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
userId = RedisUtil.get("dq:token:"+token);
System.out.println(userId);
} catch (Exception e) {
e.printStackTrace();
}
String userId = getUserId();
//根据userId获取用户名以及部门名称
ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(5L);
@ -241,4 +233,13 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
return result>0 ? ResponseResult.SUCCESS("撤销成功!"):ResponseResult.FAIL(40006,"撤销失败!");
}
/**
* 获取当前登录用户信息
*/
public static String getUserId(){
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
return RedisUtil.get("dq:token:"+token);
}
}

@ -1,20 +0,0 @@
package com.daqing.financial.guarantee.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 担保审核 前端控制器
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@RestController
@RequestMapping("/dg-guarantee-apply")
public class DgGuaranteeApplyController {
}

@ -1,20 +0,0 @@
package com.daqing.financial.guarantee.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 担保经理审核 前端控制器
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@RestController
@RequestMapping("/dg-guarantee-apply-last")
public class DgGuaranteeApplyLastController {
}

@ -1,9 +1,29 @@
package com.daqing.financial.guarantee.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.mapper.DgGuaranteeAssignUserMapper;
import com.daqing.financial.guarantee.model.request.ApprovalGuaranteeRequest;
import com.daqing.financial.guarantee.model.request.GuaranteeRequest;
import com.daqing.financial.guarantee.model.request.InvestigateGuaranteeRequest;
import com.daqing.financial.guarantee.model.response.GuaranteeDetailResponse;
import com.daqing.financial.guarantee.service.IDgGuaranteeAssignUserService;
import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser;
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO;
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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* <p>
@ -13,8 +33,152 @@ import org.springframework.web.bind.annotation.RestController;
* @author Qyq
* @since 2020-11-05
*/
@Api(tags = {"担保部调查信息"})
@RestController
@RequestMapping("/dg-guarantee-assign-user")
public class DgGuaranteeAssignUserController {
@Autowired
private DgApplyAmountInfoController dgApplyAmountInfoController;
@Autowired
private IDgGuaranteeAssignUserService dgGuaranteeAssignUserService;
@Resource
private DgGuaranteeAssignUserMapper dgGuaranteeAssignUserMapper;
@Resource
private HrmsFeignService hrmsFeignService;
/**
* 担保部调查列表
* @param
* @return
*/
@GetMapping("/guaranteeList")
@ApiOperation(value = "担保部调查列表")
public ResponseResult businessApplicationList(@RequestParam(value="page",required=false) Integer page, @RequestParam(value="size",required=false) Integer size,
@RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){
//获取当前登录用户userId
String userId = dgApplyAmountInfoController.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);
String A = String.valueOf(PromptSuccess.DB_A_ID);
String B = String.valueOf(PromptSuccess.DB_B_ID);
//判断角色数组中是否包含A角或者B角元素
Boolean f = Arrays.asList(ids).contains(A);
Boolean g = Arrays.asList(ids).contains(B);
if (f.equals(true) || g.equals(true)) {//如果存在A,B元素,则要根据角色以及用户id查询列表
data = dgGuaranteeAssignUserService.queryPage(page, size, CustomerNumberOrName, roleIdlist, userId);
} else {
data = dgGuaranteeAssignUserService.queryPage(page, size, CustomerNumberOrName, roleIdlist, null);
}
}
return new ResponseResult<PageUtils>().SUCCESS(data);
}
/**
* 指派A,B角
* @param
* @return
*/
@PostMapping("/assignCorners")
@ApiOperation(value = "指派A,B角")
@Transactional
public ResponseResult assignCorners(@RequestBody GuaranteeRequest guaranteeRequest){
//根据主键id修改当前记录状态为已指派,设置审批人id为当前用户id
//获取当前登录用户userId
//String userId = dgApplyAmountInfoController.getUserId();
String userId ="5";
DgGuaranteeAssignUser guaranteeAssignUser = new DgGuaranteeAssignUser();
guaranteeAssignUser.setStatus(2);//状态设置为已指派
guaranteeAssignUser.setEmpId(Integer.parseInt(userId));
guaranteeAssignUser.setId(guaranteeRequest.getId());
dgGuaranteeAssignUserMapper.updateById(guaranteeAssignUser);
//新增A角记录到担保部记录表
DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser();
dgGuaranteeAssignUser.setBusinessId(guaranteeRequest.getBusinessId());//业务id
dgGuaranteeAssignUser.setCompanyId(guaranteeRequest.getCompanyId());//企业id
dgGuaranteeAssignUser.setEmpId(guaranteeRequest.getEmpAId());//用户A角id
dgGuaranteeAssignUser.setRoleId(PromptSuccess.DB_A_ID);//角色设置为A角
dgGuaranteeAssignUser.setType(1);//A角操作
dgGuaranteeAssignUser.setStatus(3);//状态为调查中
dgGuaranteeAssignUserMapper.insert(dgGuaranteeAssignUser);
//新增B角记录到担保部记录表
DgGuaranteeAssignUser dgGuaranteeAssignUser2 = new DgGuaranteeAssignUser();
dgGuaranteeAssignUser2.setBusinessId(guaranteeRequest.getBusinessId());//业务id
dgGuaranteeAssignUser2.setCompanyId(guaranteeRequest.getCompanyId());//企业id
dgGuaranteeAssignUser2.setEmpId(guaranteeRequest.getEmpBId());//用户B角id
dgGuaranteeAssignUser2.setRoleId(PromptSuccess.DB_B_ID);//角色设置为B角
dgGuaranteeAssignUser2.setType(2);//B角操作
dgGuaranteeAssignUser2.setStatus(3);//状态为调查中
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);
//hrmsFeignService.insertUserRole(guaranteeRequest.getEmpAId().longValue(),PromptSuccess.DB_A_ID.longValue());
//hrmsFeignService.insertUserRole(guaranteeRequest.getEmpBId().longValue(),PromptSuccess.DB_B_ID.longValue());
return new ResponseResult<PageUtils>().SUCCESS();
}
/**
* 根据担保id查询担保部记录详情
* @param id
* @return
*/
@GetMapping("/guaranteeDetail")
@ApiOperation(value = "根据担保id查询担保部记录详情")
public ResponseResult guaranteeDetail(Integer id){
GuaranteeDetailResponse response = dgGuaranteeAssignUserService.guaranteeDetail(id);
return ResponseResult.SUCCESS(response);
}
/**
* 根据担保id调查担保记录
* @param investigateGuaranteeRequest
* @return
*/
@PostMapping("/investigateGuarantee")
@ApiOperation(value = "根据担保id调查担保记录")
public ResponseResult investigateGuarantee(@RequestBody InvestigateGuaranteeRequest investigateGuaranteeRequest){
int result = dgGuaranteeAssignUserService.investigateGuarantee(investigateGuaranteeRequest);
return result>0 ? ResponseResult.SUCCESS("调查成功!"):ResponseResult.FAIL(41001,"调查失败!");
}
/**
* 根据担保id审核担保记录包括担保部经理审核以及担保部分管领导审核
* @param approvalGuaranteeRequest
* @return
*/
@PostMapping("/approvalGuarantee")
@ApiOperation(value = "根据担保id审核担保记录,包括担保部经理审核以及担保部分管领导审核")
public ResponseResult approvalGuarantee(@RequestBody ApprovalGuaranteeRequest approvalGuaranteeRequest){
int result = dgGuaranteeAssignUserService.approvalGuarantee(approvalGuaranteeRequest);
return result>0 ? ResponseResult.SUCCESS("审核成功!"):ResponseResult.FAIL(41002,"审核失败!");
}
}

@ -1,11 +1,14 @@
package com.daqing.financial.guarantee.feign;
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.ext.EmployeeTO;
import com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.model.response.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@ -39,4 +42,13 @@ public interface HrmsFeignService {
*/
@GetMapping("hrms/employee/getAccountAndDeptNameById")
ResponseResult<EmployeeMessageResponse> getAccountAndDeptNameById(@RequestParam("userId") Long userId);
/**
* 新增用户角色
*/
@GetMapping("hrms/employee/insertUserRole")
ResponseResult insertUserRole(@RequestParam("userId") Long userId,@RequestParam("roleId")Long roleId);
@PostMapping("hrms/employee/insertUsrRole")
ResponseResult insertUsrRole(@RequestBody List<DgGuaranteePO> list);
}

@ -1,18 +0,0 @@
package com.daqing.financial.guarantee.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.daqing.framework.domain.guarantee.DgGuaranteeApplyLast;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 担保经理审核 Mapper 接口
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@Mapper
public interface DgGuaranteeApplyLastMapper extends BaseMapper<DgGuaranteeApplyLast> {
}

@ -1,18 +0,0 @@
package com.daqing.financial.guarantee.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.daqing.framework.domain.guarantee.DgGuaranteeApply;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 担保审核 Mapper 接口
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@Mapper
public interface DgGuaranteeApplyMapper extends BaseMapper<DgGuaranteeApply> {
}

@ -1,8 +1,14 @@
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.GuaranteeListResponse;
import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
@ -15,4 +21,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DgGuaranteeAssignUserMapper extends BaseMapper<DgGuaranteeAssignUser> {
IPage<GuaranteeListResponse> pageByCondition(Page page,@Param("customerNumberOrName") String customerNumberOrName,@Param("roleIdlist") List<String> roleIdlist,@Param("userId") String userId);
}

@ -0,0 +1,36 @@
package com.daqing.financial.guarantee.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @Author chen
* @DATE 2020/11/12 17:14
* @Version 1.0
*/
@Data
public class ApprovalGuaranteeRequest {
@ApiModelProperty(value = "主键id")
private Integer id;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "审核意见")
private String applyContent;
@ApiModelProperty(value = "审核金额")
private BigDecimal amount;
@ApiModelProperty(value = "期限")
private String term;
@ApiModelProperty(value = "补充调查原因")
private String[] remark;
}

@ -0,0 +1,30 @@
package com.daqing.financial.guarantee.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author chen
* @DATE 2020/11/12 17:14
* @Version 1.0
*/
@Data
public class GuaranteeRequest {
@ApiModelProperty(value = "主键id")
private Integer id;
@ApiModelProperty(value = "业务id")
private Integer businessId;
@ApiModelProperty(value = "企业id")
private Integer companyId;
@ApiModelProperty(value = "被指派人A角id")
private Integer empAId;
@ApiModelProperty(value = "被指派人B角id")
private Integer empBId;
}

@ -0,0 +1,68 @@
package com.daqing.financial.guarantee.model.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Author chen
* @DATE 2020/11/12 17:14
* @Version 1.0
*/
@Data
public class InvestigateGuaranteeRequest {
@ApiModelProperty(value = "主键id")
private Integer id;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "审核意见")
private String applyContent;
@ApiModelProperty(value = "营业执照复印件")
private String[] businessLicense;
@ApiModelProperty(value = "上传法定代表人夫妻及企业实际经营者身份证复印件")
private String[] legalCardCopy;
@ApiModelProperty(value = "法定代表人夫妻户口本,结婚证(离婚证)复印件")
private String[] marriageCopy;
@ApiModelProperty(value = "法定代表人身份证明")
private String[] legalCopy;
@ApiModelProperty(value = "公司章程")
private String[] companyConstitution;
@ApiModelProperty(value = "会计师事务所审计的上一年度及本年度审计报告")
private String[] accountingFirm;
/* @ApiModelProperty(value = "企业信用报告")
private List<String> companyCreditList;
@ApiModelProperty(value = "企业法人夫妇信用报告,实际经营者信用报告")
private List<String> creditReportList;
@ApiModelProperty(value = "征信业务授权书,承诺书")
private List<String> certificateAuthorizationList;
@ApiModelProperty(value = "增值税纳税申报表首表复印件/完税证明")
private List<String> taxCertificateList;*/
@ApiModelProperty(value = "股东会会议纪要")
private String[] meetingMinutes;
/* @ApiModelProperty(value = "反担保资料和评估报告")
private List<String> assessmentReportList;*/
@ApiModelProperty(value = "谈话纪要")
private String[] conversationSummary;
@ApiModelProperty(value = "考察照片")
private String[] inspectionPhotos;
}

@ -0,0 +1,44 @@
package com.daqing.financial.guarantee.model.response;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.LinkedHashMap;
@Data
@ToString
public class GuaranteeDetailResponse implements Serializable {
/**
* 主键id
*/
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 业务申请详细
*/
@ApiModelProperty(value = "业务申请详细")
private DgApplyAmountInfoResponse dgApplyAmountInfo;
/**
* 企业详细
*/
@ApiModelProperty(value = "企业详细")
private LinkedHashMap linkedHashMap;
/**
* 附件详细
*/
@ApiModelProperty(value = "附件详细")
private DgEnclosureInfoResponse dgEnclosureInfo;
}

@ -0,0 +1,89 @@
package com.daqing.financial.guarantee.model.response;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ToString
public class GuaranteeListResponse extends BaseRowModel implements Serializable {
/**
* 主键id
*/
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
private Integer companyId;
/**
* 申请额度
*/
@ExcelProperty(value = "申请额度",index = 4)
@ApiModelProperty(value = "申请额度")
private BigDecimal applyAmount;
/**
* 申请期限
*/
@ExcelProperty(value = "申请期限",index = 5)
@ApiModelProperty(value = "申请期限")
private String applyTime;
/**
* 申请时间
*/
@ExcelProperty(value = "申请日期",index = 6)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty(value = "申请时间")
private Date createTime;
/**
* 业务类型
*/
@ExcelProperty(value = "业务类别",index = 3)
@ApiModelProperty(value = "业务类型")
private String businessType;
/**
* 业务编号
*/
@ExcelProperty(value = "业务编号",index = 0)
@ApiModelProperty(value = "业务编号")
private String businessCode;
/**
* 客户名称
*/
@ExcelProperty(value = "客户名称",index = 1)
@ApiModelProperty(value = "客户名称")
private String name;
/**
* 联系电话
*/
@ExcelProperty(value = "联系电话",index = 2)
@ApiModelProperty(value = "联系电话")
private String phone;
/**
* 状态
*/
@ExcelProperty(value = "状态",index = 7)
@ApiModelProperty(value = "状态")
private Integer status;
}

@ -1,16 +0,0 @@
package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.framework.domain.guarantee.DgGuaranteeApplyLast;
/**
* <p>
* 担保经理审核 服务类
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
public interface IDgGuaranteeApplyLastService extends IService<DgGuaranteeApplyLast> {
}

@ -1,16 +0,0 @@
package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.framework.domain.guarantee.DgGuaranteeApply;
/**
* <p>
* 担保审核 服务类
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
public interface IDgGuaranteeApplyService extends IService<DgGuaranteeApply> {
}

@ -1,7 +1,13 @@
package com.daqing.financial.guarantee.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.financial.guarantee.model.request.ApprovalGuaranteeRequest;
import com.daqing.financial.guarantee.model.request.InvestigateGuaranteeRequest;
import com.daqing.financial.guarantee.model.response.GuaranteeDetailResponse;
import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser;
import com.daqing.framework.utils.PageUtils;
import java.util.List;
/**
* <p>
@ -13,4 +19,11 @@ import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser;
*/
public interface IDgGuaranteeAssignUserService extends IService<DgGuaranteeAssignUser> {
PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, List<String> roleIdlist, String userId);
GuaranteeDetailResponse guaranteeDetail(Integer id);
int investigateGuarantee(InvestigateGuaranteeRequest investigateGuaranteeRequest);
int approvalGuarantee(ApprovalGuaranteeRequest approvalGuaranteeRequest);
}

@ -203,12 +203,15 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
List arr1List2 = new ArrayList<>();
for(int i=0;i<list.size();i++){
if(list.get(i).length()>0){
List<String> arr1List;
if(list.get(i)!=null){
String a1 = list.get(i).substring(1,list.get(i).length()-1);
String arr1[]=a1.split(",");
List<String> arr1List = Arrays.asList(arr1);
arr1List = Arrays.asList(arr1);
arr1List2.add(i,arr1List);
System.out.println("arr1LIst===="+arr1List);
}else{
arr1List2.add(i,null);
}
}
dgEnclosureInfo.setAccountingFirmList((List<String>) arr1List2.get(0));
@ -260,7 +263,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
dgApplyAmountInfo.setUpdateTime(new Date());
//根据业务id修改申请贷款信息
this.baseMapper.updateById(dgApplyAmountInfo);
//上传附件信息
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo();
dgEnclosureInfo.setBusinessId(businessApplication.getId());//业务id
@ -282,7 +284,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
//根据业务id删除对应的附件信息
dgEnclosureInfoMapper.delete(new QueryWrapper<DgEnclosureInfo>().eq("business_id",businessApplication.getId()));
System.out.println("来了附件删除操作=================================");
//附件新增
return dgEnclosureInfoMapper.insert(dgEnclosureInfo);
}

@ -1,20 +0,0 @@
package com.daqing.financial.guarantee.service.impl;
import com.daqing.financial.guarantee.mapper.DgGuaranteeApplyLastMapper;
import com.daqing.financial.guarantee.service.IDgGuaranteeApplyLastService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.framework.domain.guarantee.DgGuaranteeApplyLast;
import org.springframework.stereotype.Service;
/**
* <p>
* 担保经理审核 服务实现类
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@Service
public class DgGuaranteeApplyLastServiceImpl extends ServiceImpl<DgGuaranteeApplyLastMapper, DgGuaranteeApplyLast> implements IDgGuaranteeApplyLastService {
}

@ -1,20 +0,0 @@
package com.daqing.financial.guarantee.service.impl;
import com.daqing.financial.guarantee.mapper.DgGuaranteeApplyMapper;
import com.daqing.financial.guarantee.service.IDgGuaranteeApplyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.framework.domain.guarantee.DgGuaranteeApply;
import org.springframework.stereotype.Service;
/**
* <p>
* 担保审核 服务实现类
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@Service
public class DgGuaranteeApplyServiceImpl extends ServiceImpl<DgGuaranteeApplyMapper, DgGuaranteeApply> implements IDgGuaranteeApplyService {
}

@ -1,10 +1,35 @@
package com.daqing.financial.guarantee.service.impl;
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.daqing.financial.guarantee.controller.DgApplyAmountInfoController;
import com.daqing.financial.guarantee.feign.CrmsFeignService;
import com.daqing.financial.guarantee.mapper.DgApplyAmountInfoMapper;
import com.daqing.financial.guarantee.mapper.DgEnclosureInfoMapper;
import com.daqing.financial.guarantee.mapper.DgGuaranteeAssignUserMapper;
import com.daqing.financial.guarantee.model.request.ApprovalGuaranteeRequest;
import com.daqing.financial.guarantee.model.request.InvestigateGuaranteeRequest;
import com.daqing.financial.guarantee.model.response.*;
import com.daqing.financial.guarantee.service.IDgGuaranteeAssignUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo;
import com.daqing.framework.domain.guarantee.DgEnclosureInfo;
import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* <p>
@ -17,4 +42,196 @@ import org.springframework.stereotype.Service;
@Service
public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl<DgGuaranteeAssignUserMapper, DgGuaranteeAssignUser> implements IDgGuaranteeAssignUserService {
@Autowired
private DgApplyAmountInfoController dgApplyAmountInfoController;
@Resource
private DgApplyAmountInfoMapper dgApplyAmountInfoMapper;
@Resource
private CrmsFeignService crmsFeignService;
@Resource
private DgEnclosureInfoMapper dgEnclosureInfoMapper;
@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<GuaranteeListResponse> positionVO = this.getBaseMapper().pageByCondition(new Page(page, size),customerNumberOrName,roleIdlist,userId);
return new PageUtils(positionVO);
}
@Override
public GuaranteeDetailResponse guaranteeDetail(Integer id) {
//根据主键id查询业务id
DgGuaranteeAssignUser guaranteeAssignUser = this.getBaseMapper().selectById(id);
//根据业务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);
}
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());
List<String>list = new ArrayList<>();
list.add(dgEnclosureInfo.getAccountingFirm());
list.add(dgEnclosureInfo.getAssessmentReport());
list.add(dgEnclosureInfo.getBusinessLicense());
list.add(dgEnclosureInfo.getCertificateAuthorization());
list.add(dgEnclosureInfo.getCompanyConstitution());
list.add(dgEnclosureInfo.getCompanyCredit());
list.add(dgEnclosureInfo.getConversationSummary());
list.add(dgEnclosureInfo.getCreditReport());
list.add(dgEnclosureInfo.getInspectionPhotos());
list.add(dgEnclosureInfo.getLegalCardCopy());
list.add(dgEnclosureInfo.getLegalCopy());
list.add(dgEnclosureInfo.getTaxCertificate());
list.add(dgEnclosureInfo.getMeetingMinutes());
list.add(dgEnclosureInfo.getMarriageCopy());
List arr1List2 = new ArrayList<>();
for(int i=0;i<list.size();i++){
if(list.get(i).length()>0){
String a1 = list.get(i).substring(1,list.get(i).length()-1);
String arr1[]=a1.split(",");
List<String> arr1List = Arrays.asList(arr1);
arr1List2.add(i,arr1List);
}
}
dgEnclosureInfo.setAccountingFirmList((List<String>) arr1List2.get(0));
dgEnclosureInfo.setAssessmentReportList((List<String>) arr1List2.get(1));
dgEnclosureInfo.setBusinessLicenseList((List<String>) arr1List2.get(2));
dgEnclosureInfo.setCertificateAuthorizationList((List<String>) arr1List2.get(3));
dgEnclosureInfo.setCompanyConstitutionList((List<String>) arr1List2.get(4));
dgEnclosureInfo.setCompanyCreditList((List<String>) arr1List2.get(5));
dgEnclosureInfo.setConversationSummaryList((List<String>) arr1List2.get(6));
dgEnclosureInfo.setCreditReportList((List<String>) arr1List2.get(7));
dgEnclosureInfo.setInspectionPhotosList((List<String>) arr1List2.get(8));
dgEnclosureInfo.setLegalCardCopyList((List<String>) arr1List2.get(9));
dgEnclosureInfo.setLegalCopyList((List<String>) arr1List2.get(10));
dgEnclosureInfo.setTaxCertificateList((List<String>) arr1List2.get(11));
dgEnclosureInfo.setMeetingMinutesList((List<String>) arr1List2.get(12));
dgEnclosureInfo.setMarriageCopyList((List<String>) arr1List2.get(13));
System.out.println("附件详细=============="+dgEnclosureInfo);
GuaranteeDetailResponse guaranteeDetailResponse= new GuaranteeDetailResponse();
guaranteeDetailResponse.setDgApplyAmountInfo(dgApplyAmountInfo);
guaranteeDetailResponse.setDgEnclosureInfo(dgEnclosureInfo);
guaranteeDetailResponse.setLinkedHashMap(linkedList);
return guaranteeDetailResponse;
}
@Transactional
@Override
public int investigateGuarantee(InvestigateGuaranteeRequest investigateGuaranteeRequest) {
//根据主键id查询业务id
DgGuaranteeAssignUser guaranteeAssignUser = this.getBaseMapper().selectById(investigateGuaranteeRequest.getId());
//AB角调查,修改审核意见以及状态
DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser();
dgGuaranteeAssignUser.setId(investigateGuaranteeRequest.getId());//主键id
dgGuaranteeAssignUser.setStatus(investigateGuaranteeRequest.getStatus());//状态
dgGuaranteeAssignUser.setRemark(investigateGuaranteeRequest.getApplyContent());//审核意见
this.baseMapper.updateById(dgGuaranteeAssignUser);
//上传附件信息
DgEnclosureInfo dgEnclosureInfo = new DgEnclosureInfo();
dgEnclosureInfo.setBusinessId(guaranteeAssignUser.getBusinessId());//业务id
dgEnclosureInfo.setCompanyId(guaranteeAssignUser.getCompanyId());//企业Id
dgEnclosureInfo.setBusinessLicense(Arrays.toString(investigateGuaranteeRequest.getBusinessLicense()));//营业执照复印件
dgEnclosureInfo.setLegalCardCopy(Arrays.toString(investigateGuaranteeRequest.getLegalCardCopy()));//上传法定代表人夫妻及企业实际经营者身份证复印件
dgEnclosureInfo.setMarriageCopy(Arrays.toString(investigateGuaranteeRequest.getMarriageCopy()));//法定代表人夫妻户口本,结婚证(离婚证)复印件
dgEnclosureInfo.setLegalCopy(Arrays.toString(investigateGuaranteeRequest.getLegalCopy()));//法定代表人身份证明
dgEnclosureInfo.setCompanyConstitution(Arrays.toString(investigateGuaranteeRequest.getCompanyConstitution()));//公司章程
dgEnclosureInfo.setAccountingFirm(Arrays.toString(investigateGuaranteeRequest.getAccountingFirm()));//会计师事务所审计的上一年度及本年度审计报告
dgEnclosureInfo.setMeetingMinutes(Arrays.toString(investigateGuaranteeRequest.getMeetingMinutes()));//股东会会议纪要
dgEnclosureInfo.setConversationSummary(Arrays.toString(investigateGuaranteeRequest.getConversationSummary()));
dgEnclosureInfo.setInspectionPhotos(Arrays.toString(investigateGuaranteeRequest.getInspectionPhotos()));
//根据业务id删除对应的附件信息
dgEnclosureInfoMapper.delete(new QueryWrapper<DgEnclosureInfo>().eq("business_id",guaranteeAssignUser.getBusinessId()));
//附件新增
dgEnclosureInfoMapper.insert(dgEnclosureInfo);
//判断A角和B角是否都调查通过,如果都审核通过,则往担保部经理添加一条需要审核的记录
int i = this.baseMapper.selectCount(new QueryWrapper<DgGuaranteeAssignUser>().eq("business_id",guaranteeAssignUser.getBusinessId())
.eq("type",1).eq("status",4));
int n = this.baseMapper.selectCount(new QueryWrapper<DgGuaranteeAssignUser>().eq("business_id",guaranteeAssignUser.getBusinessId())
.eq("type",2).eq("status",4));
int sum = i+n;
if(sum==2){
DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser();
assignUser.setBusinessId(guaranteeAssignUser.getBusinessId());
assignUser.setCompanyId(guaranteeAssignUser.getCompanyId());
assignUser.setRoleId(PromptSuccess.DB_JL_ID);//担保部经理
assignUser.setType(3);
assignUser.setStatus(5);//状态设置为审核中
this.baseMapper.insert(assignUser);
}
return 1;
}
@Transactional
@Override
public int approvalGuarantee(ApprovalGuaranteeRequest approvalGuaranteeRequest) {
DgGuaranteeAssignUser dgGuaranteeAssignUser = new DgGuaranteeAssignUser();
dgGuaranteeAssignUser.setId(approvalGuaranteeRequest.getId());
dgGuaranteeAssignUser.setEmpId(Integer.parseInt(dgApplyAmountInfoController.getUserId()));
dgGuaranteeAssignUser.setRemark(Arrays.toString(approvalGuaranteeRequest.getRemark()));//补充调查原因
dgGuaranteeAssignUser.setStatus(approvalGuaranteeRequest.getStatus());
dgGuaranteeAssignUser.setAmount(approvalGuaranteeRequest.getAmount());//金额
dgGuaranteeAssignUser.setTerm(approvalGuaranteeRequest.getTerm());//期限
dgGuaranteeAssignUser.setApplyContent(approvalGuaranteeRequest.getApplyContent());//审核意见
//根据主键id修改担保部记录
this.baseMapper.updateById(dgGuaranteeAssignUser);
//根据主键id查询担保部记录
DgGuaranteeAssignUser guaranteeUser = this.baseMapper.selectById(approvalGuaranteeRequest.getId());
//如果担保部经理审核通过,则往担保部分管领导处加一条记录,由分管领导审核
if(approvalGuaranteeRequest.getStatus()==6 && guaranteeUser.getType()==3){//担保部经理审核通过
//根据主键id查询业务id
DgGuaranteeAssignUser guaranteeAssignUser = this.getBaseMapper().selectById(approvalGuaranteeRequest.getId());
DgGuaranteeAssignUser assignUser = new DgGuaranteeAssignUser();
assignUser.setBusinessId(guaranteeAssignUser.getBusinessId());
assignUser.setCompanyId(guaranteeAssignUser.getCompanyId());
assignUser.setRoleId(PromptSuccess.DB_LD_ID);//担保部分管领导
assignUser.setType(4);
assignUser.setStatus(5);//状态设置为审核中
this.baseMapper.insert(assignUser);
}
return 1;
}
}

@ -1,19 +0,0 @@
<?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.DgGuaranteeApplyLastMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgGuaranteeApplyLast">
<id column="id" property="id" />
<result column="company_id" property="companyId" />
<result column="emp_id" property="empId" />
<result column="amount" property="amount" />
<result column="term" property="term" />
<result column="remark" property="remark" />
<result column="apply_content" property="applyContent" />
<result column="status" property="status" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
</mapper>

@ -1,19 +0,0 @@
<?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.DgGuaranteeApplyMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgGuaranteeApply">
<id column="id" property="id" />
<result column="company_id" property="companyId" />
<result column="emp_id" property="empId" />
<result column="amount" property="amount" />
<result column="term" property="term" />
<result column="remark" property="remark" />
<result column="apply_content" property="applyContent" />
<result column="status" property="status" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
</mapper>

@ -17,4 +17,25 @@
<result column="update_time" property="updateTime" />
</resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.GuaranteeListResponse">
select ai.id,ai.company_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
ai.status,cc.name,cc.phone
from dg_guarantee_assign_user 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
<where>
au.role_id in
<foreach collection="roleIdlist" open="(" separator="," close=")" item="id">
#{id}
</foreach>
<if test="userId != null and userId != ''">
AND au.emp_id =#{userId}
</if>
<if test="customerNumberOrName != null and customerNumberOrName != ''">
AND ai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%')
</if>
</where>
</select>
</mapper>

@ -3,15 +3,13 @@ package com.daqing.financial.hrauth.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daqing.financial.hrauth.config.WeChatConfig;
import com.daqing.financial.hrauth.dao.AuthEmployeeRoleDao;
import com.daqing.financial.hrauth.dao.UserLoginDao;
import com.daqing.financial.hrauth.feign.HrmsFeignService;
import com.daqing.financial.hrauth.service.LoginLogService;
import com.daqing.financial.hrauth.service.TokenService;
import com.daqing.financial.hrauth.service.UserLoginService;
import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.daqing.framework.domain.hrms.LoginLog;
import com.daqing.framework.domain.hrms.Token;
import com.daqing.framework.domain.hrms.UserEntity;
import com.daqing.framework.domain.hrms.*;
import com.daqing.framework.domain.hrms.request.*;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.domain.hrms.response.LoginResponse;
@ -29,7 +27,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @auther River
@ -53,6 +54,9 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
@Autowired
private HrmsFeignService hrmsFeignService;
@Resource
private AuthEmployeeRoleDao authEmployeeRoleDao;
/* @Autowired
private OdcProperties properties;*/
@ -117,6 +121,17 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
//删除redis里面的userEntity
JwtUtils.removeUserEntityByUserId(userEntity.getId());
}
//根据userId获取roleId
List<Map<String, Object>> roleList = authEmployeeRoleDao.selectMaps(new QueryWrapper<EmployeeRoleEntity>().eq("user_id", userEntity.getId()));
List<String> list = new ArrayList<>();
for (Map map:roleList) {
list.add(map.get("role_id").toString());
}
String roleIds = StringUtils.join(list,",");
if(userEntity != null){
//删除redis里面的roleId
JwtUtils.removeRoleIdByUserId(userEntity.getId());
}
if(loginRequest.getType() == 1){//手机号码登录
if(userEntity == null){
@ -160,6 +175,8 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
JwtUtils.putTokenToRedis(userEntity.getId(), token, times);
//设置userEntity到redis
JwtUtils.putUserEntityToRedis(userEntity.getId(),userEntity,times);
//设置最新的roleId到redis
JwtUtils.putRoleIdToRedis(userEntity.getId(), roleIds, times);
//新增登录日志
LoginLog loginLog = loginLogService.getOne(new QueryWrapper<LoginLog>().eq("user_id", userEntity.getId()));

@ -101,11 +101,10 @@ public class DeptController implements DeptControllerApi {
/**
*所有部门及员工
*/
/*@Override
@GetMapping("/trees")
public ResponseResult trees() {
return new ResponseResult<List<DepartmentVO>>().SUCCESS(deptService.listDepartmentAndEmployeeTree());
}*/
}
/**
* 该部门下所有子部门及部门下员工
@ -135,4 +134,5 @@ public class DeptController implements DeptControllerApi {
return ResponseResult.SUCCESS(deptService.listEmployeeById(id));
}
}

@ -4,6 +4,7 @@ package com.daqing.financial.hrms.controller;
import com.daqing.financial.hrms.EmployeeControllerApi;
import com.daqing.financial.hrms.service.EmployeeService;
import com.daqing.framework.domain.crms.request.EmployeeDisableRequest;
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.daqing.framework.domain.hrms.UserEntity;
@ -241,4 +242,18 @@ public class EmployeeController implements EmployeeControllerApi {
return new ResponseResult<EmployeeMessageResponse>().SUCCESS(employeeService.getAccountAndDeptNameById(userId));
}
/**
* 新增用户角色
* @param userId
* @return
*/
@GetMapping("/insertUserRole")
public ResponseResult insertUserRole(@RequestParam("userId") Long userId,@RequestParam("roleId")Long roleId) {
return new ResponseResult<>().SUCCESS(employeeService.insertUserRole(userId,roleId));
}
@PostMapping("/insertUsrRole")
public ResponseResult insertUsrRole(@RequestBody List<DgGuaranteePO> list) {
return new ResponseResult<>().SUCCESS(employeeService.insertUsrRole(list));
}
}

@ -2,6 +2,7 @@ package com.daqing.financial.hrms.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -31,6 +32,8 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
List<EmployeeVO> listEmployeeByDeptId(Long id);
List<UserDeptVO> employeeListByDeptId(Long id);
List<EmployeeVO> listEmployeeName();
IPage<EmployeeVO> pageByCondition(Page page, @Param("employee") EmployeeEntity employee);
@ -94,4 +97,8 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
EmployeeRepetition getEmployeeRepetitionByEmpId(Long empId);
EmployeeMessageResponse getAccountAndDeptNameById(Long userId);
boolean insertUserRole(Long userId, Long roleId);
boolean insertUsrRole(@Param("list") List<DgGuaranteePO> list);
}

@ -26,7 +26,7 @@ public interface DeptService extends IService<DeptEntity> {
boolean deleteByIds(Long[] ids);
/*List<DepartmentVO> listDepartmentAndEmployeeTree();*/
List<DepartmentVO> listDepartmentAndEmployeeTree();
DepartmentVO getDepartmentAndEmployee(Long id);

@ -2,6 +2,7 @@ package com.daqing.financial.hrms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.daqing.framework.domain.crms.request.EmployeeDisableRequest;
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.UserEntity;
import com.daqing.framework.domain.hrms.ext.EmployeeAndUserVO;
@ -64,5 +65,9 @@ public interface EmployeeService extends IService<EmployeeEntity> {
EmployeeEntity getEmployeeByUserId(Long userId);
EmployeeMessageResponse getAccountAndDeptNameById(Long userId);
boolean insertUserRole(Long userId, Long roleId);
boolean insertUsrRole(List<DgGuaranteePO> list);
}

@ -9,6 +9,7 @@ import com.daqing.framework.domain.hrms.DepartmentVO;
import com.daqing.framework.domain.hrms.DeptEntity;
import com.daqing.framework.domain.hrms.EmployeeEntity;
import com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.domain.hrms.ext.UserDeptVO;
import com.daqing.framework.domain.hrms.request.DeptAddRequest;
import com.daqing.framework.domain.hrms.response.HrmsCode;
import com.daqing.framework.exception.ExceptionCast;
@ -18,6 +19,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
@ -28,10 +30,10 @@ import java.util.stream.Collectors;
@Service("deptService")
public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements DeptService {
@Autowired
@Resource
private DeptDao deptDao;
@Autowired
@Resource
private EmployeeDao employeeDao;
/**
@ -160,7 +162,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
* 获取所有的部门及部门下的员工信息
* @return
*/
/* @Override
@Override
public List<DepartmentVO> listDepartmentAndEmployeeTree() {
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L);
}
@ -169,11 +171,19 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements
.filter(dept -> parentId.equals(dept.getParentId())) // 过滤出部门id为所选id的部门信息(也为递归的结果条件,找不到所对应的部门id)
.peek(dept -> {
dept.setChildren(getListDepartmentAndEmployeeTree(list, dept.getId())); // 设置该部门的子部门:递归调用
dept.setEmployee(employeeDao.listEmployeeByDeptId(dept.getId())); // 设置该部门下面的所有员工
List<UserDeptVO> empList = employeeDao.employeeListByDeptId(dept.getId());
System.out.println("empList========================"+empList);
dept.setUserDept(employeeDao.employeeListByDeptId(dept.getId()));
//dept.setEmployee(employeeDao.listEmployeeByDeptId(dept.getId())); // 设置该部门下面的所有员工
})
.sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))) // 根据所选排序信息进行排序
.collect(Collectors.toList());
}*/
}
/**
* 获取该部门下子部门及部门下的员工

@ -7,6 +7,7 @@ import com.daqing.financial.hrms.dao.*;
import com.daqing.financial.hrms.service.EmployeeService;
import com.daqing.framework.domain.crms.request.EmployeeDisableRequest;
import com.daqing.framework.domain.crms.response.CrmsCode;
import com.daqing.framework.domain.guarantee.po.DgGuaranteePO;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.*;
import com.daqing.framework.domain.hrms.ext.*;
@ -594,4 +595,14 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
public EmployeeMessageResponse getAccountAndDeptNameById(Long userId) {
return this.getBaseMapper().getAccountAndDeptNameById(userId);
}
@Override
public boolean insertUserRole(Long userId, Long roleId) {
return this.getBaseMapper().insertUserRole(userId,roleId);
}
@Override
public boolean insertUsrRole(List<DgGuaranteePO> list) {
return this.getBaseMapper().insertUsrRole(list);
}
}

@ -184,6 +184,21 @@
AND d.id = #{id}
</select>
<!-- 根据部门id获取该部门下面所有的员工 -->
<select id="employeeListByDeptId" parameterType="long" resultType="com.daqing.framework.domain.hrms.ext.UserDeptVO">
SELECT u.id,u.account
FROM hrms_employee e
LEFT JOIN hrms_employee_dept ed
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND d.id = #{id}
</select>
<!-- 查询所有的员工姓名和id -->
<select id="listEmployeeName" resultType="com.daqing.framework.domain.hrms.ext.EmployeeVO">
SELECT e.id id,e.name name
@ -418,6 +433,21 @@
</foreach>
</insert>
<insert id="insertUsrRole">
INSERT INTO hrms_employee_role
(user_id,role_id)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.userId},#{item.roleId})
</foreach>
</insert>
<insert id="insertUserRole">
INSERT INTO hrms_employee_role
(user_id,role_id)
VALUES (#{userId},#{roleId})
</insert>
<insert id="insertEmployee" keyProperty="id" useGeneratedKeys="true" parameterType="com.daqing.framework.domain.hrms.EmployeeEntity">
INSERT INTO hrms_employee (name,job_number,gender,birthday,phone,company_mail,user_id)
VALUES (#{name},#{jobNumber},#{gender},#{birthday},#{phone},#{companyMail},#{userId})

@ -97,10 +97,18 @@ public class JwtUtils {
RedisUtil.setEx("dq:userId:"+userId, JSONObject.toJSONString(userEntity), times);
}
public static void putRoleIdToRedis(Long userId, String roleId, long times) {
RedisUtil.setEx("dq:userRole:"+userId, roleId, times);
}
public static void removeUserEntityByUserId(Long userId) {
RedisUtil.del("dq:userId:"+userId);
}
public static void removeRoleIdByUserId(Long userId) {
RedisUtil.del("dq:userRole:"+userId);
}
public static void removeTokenByToken(String token) {
RedisUtil.del("dq:token:"+token);
}

@ -137,4 +137,10 @@ public class CrmsCompanyPersonal implements Serializable {
*/
@ApiModelProperty(value = "关联人类型")
private String type;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
private Integer relatedCompanyId;
}

@ -1,67 +0,0 @@
package com.daqing.framework.domain.guarantee;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 担保审核
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@Data
@TableName("dg_guarantee_apply")
public class DgGuaranteeApply implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.ID_WORKER)
private Integer id;
private Integer companyId;
/**
* 审核人
*/
private Integer empId;
/**
* 审核金额
*/
private BigDecimal amount;
/**
* 期限
*/
private String term;
/**
* 补充调查原因
*/
private String remark;
/**
* 审核意见
*/
private String applyContent;
/**
* 状态1待审核 2审核通过 3拒绝 4驳回
*/
private Integer status;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -1,67 +0,0 @@
package com.daqing.framework.domain.guarantee;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 担保经理审核
* </p>
*
* @author Qyq
* @since 2020-11-05
*/
@Data
@TableName("dg_guarantee_apply_last")
public class DgGuaranteeApplyLast implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.ID_WORKER)
private Integer id;
private Integer companyId;
/**
* 审核人
*/
private Integer empId;
/**
* 审核金额
*/
private BigDecimal amount;
/**
* 期限
*/
private String term;
/**
* 补充调查原因
*/
private String remark;
/**
* 审核意见
*/
private String applyContent;
/**
* 状态1待审核 2审核通过 3拒绝 4驳回
*/
private Integer status;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -28,6 +28,16 @@ public class DgGuaranteeAssignUser implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 业务id
*/
private Integer businessId;
/**
* 角色id
*/
private Integer roleId;
/**
* 企业id
*/

@ -0,0 +1,20 @@
package com.daqing.framework.domain.guarantee.po;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.util.Date;
/**
* @auther River
* @date 2020/11/6 14:32
*/
@Data
@ToString
public class DgGuaranteePO implements Serializable {
private Long userId;
private Long roleId;
}

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.daqing.framework.domain.hrms.ext.EmployeeVO;
import com.daqing.framework.domain.hrms.ext.UserDeptVO;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.ToString;
@ -56,4 +57,6 @@ public class DepartmentVO implements Serializable{
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableField(exist = false)
private List<EmployeeVO> employee;
private List<UserDeptVO> userDept;
}

@ -0,0 +1,28 @@
package com.daqing.framework.domain.hrms.ext;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
/**
* @auther River
* @date 2020/9/15 16:46
*/
@Data
@ToString
public class UserDeptVO implements Serializable{
/**
* 用户id
*/
@ApiModelProperty("用户id")
private Long id;
/**
* 账号
*/
@ApiModelProperty("账号")
private String account;
}
Loading…
Cancel
Save