From 2c1bf421812d18bb83770d26acc2987a8f80cf9a Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Thu, 19 Nov 2020 17:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=85=E4=BF=9D=E9=83=A8=E8=B0=83=E6=9F=A5?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CrmsCompanyPersonalController.java | 5 + .../mapper/crms/CrmsCompanyPersonalMapper.xml | 1 + .../DgApplyAmountInfoController.java | 19 +- .../DgGuaranteeApplyController.java | 20 -- .../DgGuaranteeApplyLastController.java | 20 -- .../DgGuaranteeAssignUserController.java | 168 +++++++++++++- .../guarantee/feign/HrmsFeignService.java | 12 + .../mapper/DgGuaranteeApplyLastMapper.java | 18 -- .../mapper/DgGuaranteeApplyMapper.java | 18 -- .../mapper/DgGuaranteeAssignUserMapper.java | 7 + .../request/ApprovalGuaranteeRequest.java | 36 +++ .../model/request/GuaranteeRequest.java | 30 +++ .../request/InvestigateGuaranteeRequest.java | 68 ++++++ .../response/GuaranteeDetailResponse.java | 44 ++++ .../model/response/GuaranteeListResponse.java | 89 +++++++ .../service/IDgGuaranteeApplyLastService.java | 16 -- .../service/IDgGuaranteeApplyService.java | 16 -- .../IDgGuaranteeAssignUserService.java | 13 ++ .../impl/DgApplyAmountInfoServiceImpl.java | 11 +- .../impl/DgGuaranteeApplyLastServiceImpl.java | 20 -- .../impl/DgGuaranteeApplyServiceImpl.java | 20 -- .../DgGuaranteeAssignUserServiceImpl.java | 217 ++++++++++++++++++ .../guarantee/DgGuaranteeApplyLastMapper.xml | 19 -- .../guarantee/DgGuaranteeApplyMapper.xml | 19 -- .../guarantee/DgGuaranteeAssignUserMapper.xml | 21 ++ .../service/impl/UserLoginServiceImpl.java | 25 +- .../hrms/controller/DeptController.java | 4 +- .../hrms/controller/EmployeeController.java | 15 ++ .../financial/hrms/dao/EmployeeDao.java | 7 + .../financial/hrms/service/DeptService.java | 2 +- .../hrms/service/EmployeeService.java | 5 + .../hrms/service/impl/DeptServiceImpl.java | 20 +- .../service/impl/EmployeeServiceImpl.java | 11 + .../resources/mapper/hrms/EmployeeDao.xml | 30 +++ .../com/daqing/framework/util/JwtUtils.java | 8 + .../domain/crms/CrmsCompanyPersonal.java | 6 + .../domain/guarantee/DgGuaranteeApply.java | 67 ------ .../guarantee/DgGuaranteeApplyLast.java | 67 ------ .../guarantee/DgGuaranteeAssignUser.java | 10 + .../domain/guarantee/po/DgGuaranteePO.java | 20 ++ .../framework/domain/hrms/DepartmentVO.java | 3 + .../framework/domain/hrms/ext/UserDeptVO.java | 28 +++ 42 files changed, 907 insertions(+), 348 deletions(-) delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyController.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyLastController.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyLastMapper.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyMapper.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalGuaranteeRequest.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeRequest.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InvestigateGuaranteeRequest.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeDetailResponse.java create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeListResponse.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyLastService.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyService.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyLastServiceImpl.java delete mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyServiceImpl.java delete mode 100644 dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyLastMapper.xml delete mode 100644 dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyMapper.xml delete mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeApply.java delete mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/DgGuaranteeApplyLast.java create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/guarantee/po/DgGuaranteePO.java create mode 100644 dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/ext/UserDeptVO.java diff --git a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java index 7290e587..35769148 100644 --- a/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.java +++ b/dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CrmsCompanyPersonalController.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(); } diff --git a/dq-financial-crms/src/main/resources/mapper/crms/CrmsCompanyPersonalMapper.xml b/dq-financial-crms/src/main/resources/mapper/crms/CrmsCompanyPersonalMapper.xml index 4cd6ed18..14d08185 100644 --- a/dq-financial-crms/src/main/resources/mapper/crms/CrmsCompanyPersonalMapper.xml +++ b/dq-financial-crms/src/main/resources/mapper/crms/CrmsCompanyPersonalMapper.xml @@ -23,6 +23,7 @@ + update crms_company_customer set is_exist_related=#{isExistRelated} where id=#{id} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java index 94b72f4a..bd7dbb44 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java @@ -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 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); + } + } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyController.java deleted file mode 100644 index 2e9b4a66..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.daqing.financial.guarantee.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 担保审核 前端控制器 - *

- * - * @author Qyq - * @since 2020-11-05 - */ -@RestController -@RequestMapping("/dg-guarantee-apply") -public class DgGuaranteeApplyController { - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyLastController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyLastController.java deleted file mode 100644 index ce526109..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeApplyLastController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.daqing.financial.guarantee.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -/** - *

- * 担保经理审核 前端控制器 - *

- * - * @author Qyq - * @since 2020-11-05 - */ -@RestController -@RequestMapping("/dg-guarantee-apply-last") -public class DgGuaranteeApplyLastController { - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java index 216a1340..573fed99 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeAssignUserController.java @@ -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; /** *

@@ -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 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().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 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().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,"审核失败!"); + } + + + } 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 a44b40ce..286b9155 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 @@ -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 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 list); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyLastMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyLastMapper.java deleted file mode 100644 index 4ef006cb..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyLastMapper.java +++ /dev/null @@ -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; - -/** - *

- * 担保经理审核 Mapper 接口 - *

- * - * @author Qyq - * @since 2020-11-05 - */ -@Mapper -public interface DgGuaranteeApplyLastMapper extends BaseMapper { - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyMapper.java deleted file mode 100644 index bcd6dc6f..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeApplyMapper.java +++ /dev/null @@ -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; - -/** - *

- * 担保审核 Mapper 接口 - *

- * - * @author Qyq - * @since 2020-11-05 - */ -@Mapper -public interface DgGuaranteeApplyMapper extends BaseMapper { - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeAssignUserMapper.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeAssignUserMapper.java index aa8985fb..3d1b033b 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeAssignUserMapper.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/mapper/DgGuaranteeAssignUserMapper.java @@ -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; /** *

@@ -15,4 +21,5 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DgGuaranteeAssignUserMapper extends BaseMapper { + IPage pageByCondition(Page page,@Param("customerNumberOrName") String customerNumberOrName,@Param("roleIdlist") List roleIdlist,@Param("userId") String userId); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalGuaranteeRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalGuaranteeRequest.java new file mode 100644 index 00000000..eba6d0ee --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/ApprovalGuaranteeRequest.java @@ -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; + + + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeRequest.java new file mode 100644 index 00000000..326b3d05 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/GuaranteeRequest.java @@ -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; + + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InvestigateGuaranteeRequest.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InvestigateGuaranteeRequest.java new file mode 100644 index 00000000..1c928120 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/request/InvestigateGuaranteeRequest.java @@ -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 companyCreditList; + + @ApiModelProperty(value = "企业法人夫妇信用报告,实际经营者信用报告") + private List creditReportList; + + @ApiModelProperty(value = "征信业务授权书,承诺书") + private List certificateAuthorizationList; + + @ApiModelProperty(value = "增值税纳税申报表首表复印件/完税证明") + private List taxCertificateList;*/ + + @ApiModelProperty(value = "股东会会议纪要") + private String[] meetingMinutes; + +/* @ApiModelProperty(value = "反担保资料和评估报告") + private List assessmentReportList;*/ + + @ApiModelProperty(value = "谈话纪要") + private String[] conversationSummary; + + @ApiModelProperty(value = "考察照片") + private String[] inspectionPhotos; + + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeDetailResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeDetailResponse.java new file mode 100644 index 00000000..52346fa5 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeDetailResponse.java @@ -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; + + + + +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeListResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeListResponse.java new file mode 100644 index 00000000..5eab7732 --- /dev/null +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/GuaranteeListResponse.java @@ -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; +} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyLastService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyLastService.java deleted file mode 100644 index 55bbebf4..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyLastService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.daqing.financial.guarantee.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.daqing.framework.domain.guarantee.DgGuaranteeApplyLast; - -/** - *

- * 担保经理审核 服务类 - *

- * - * @author Qyq - * @since 2020-11-05 - */ -public interface IDgGuaranteeApplyLastService extends IService { - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyService.java deleted file mode 100644 index 038e8aaa..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeApplyService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.daqing.financial.guarantee.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.daqing.framework.domain.guarantee.DgGuaranteeApply; - -/** - *

- * 担保审核 服务类 - *

- * - * @author Qyq - * @since 2020-11-05 - */ -public interface IDgGuaranteeApplyService extends IService { - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java index ebfbc22a..cc11e2b8 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/IDgGuaranteeAssignUserService.java @@ -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; /** *

@@ -13,4 +19,11 @@ import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser; */ public interface IDgGuaranteeAssignUserService extends IService { + PageUtils queryPage(Integer page, Integer size, String customerNumberOrName, List roleIdlist, String userId); + + GuaranteeDetailResponse guaranteeDetail(Integer id); + + int investigateGuarantee(InvestigateGuaranteeRequest investigateGuaranteeRequest); + + int approvalGuarantee(ApprovalGuaranteeRequest approvalGuaranteeRequest); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java index ea3c826b..b70dc205 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java @@ -203,12 +203,15 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl(); for(int i=0;i0){ + List arr1List; + if(list.get(i)!=null){ String a1 = list.get(i).substring(1,list.get(i).length()-1); String arr1[]=a1.split(","); - List 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) arr1List2.get(0)); @@ -260,7 +263,6 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl().eq("business_id",businessApplication.getId())); - System.out.println("来了附件删除操作================================="); //附件新增 return dgEnclosureInfoMapper.insert(dgEnclosureInfo); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyLastServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyLastServiceImpl.java deleted file mode 100644 index 29b59449..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyLastServiceImpl.java +++ /dev/null @@ -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; - -/** - *

- * 担保经理审核 服务实现类 - *

- * - * @author Qyq - * @since 2020-11-05 - */ -@Service -public class DgGuaranteeApplyLastServiceImpl extends ServiceImpl implements IDgGuaranteeApplyLastService { - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyServiceImpl.java deleted file mode 100644 index 777d77d6..00000000 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeApplyServiceImpl.java +++ /dev/null @@ -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; - -/** - *

- * 担保审核 服务实现类 - *

- * - * @author Qyq - * @since 2020-11-05 - */ -@Service -public class DgGuaranteeApplyServiceImpl extends ServiceImpl implements IDgGuaranteeApplyService { - -} diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java index 372e999d..148ea0e7 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgGuaranteeAssignUserServiceImpl.java @@ -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.*; /** *

@@ -17,4 +42,196 @@ import org.springframework.stereotype.Service; @Service public class DgGuaranteeAssignUserServiceImpl extends ServiceImpl 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 roleIdlist, String userId) { + //分页参数 + if (page <= 0) { + page = 1; + } + if (size <= 0) { + size = 10; + } + IPage 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 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()); + + Listlist = 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;i0){ + String a1 = list.get(i).substring(1,list.get(i).length()-1); + String arr1[]=a1.split(","); + List arr1List = Arrays.asList(arr1); + arr1List2.add(i,arr1List); + + } + } + dgEnclosureInfo.setAccountingFirmList((List) arr1List2.get(0)); + dgEnclosureInfo.setAssessmentReportList((List) arr1List2.get(1)); + dgEnclosureInfo.setBusinessLicenseList((List) arr1List2.get(2)); + dgEnclosureInfo.setCertificateAuthorizationList((List) arr1List2.get(3)); + dgEnclosureInfo.setCompanyConstitutionList((List) arr1List2.get(4)); + dgEnclosureInfo.setCompanyCreditList((List) arr1List2.get(5)); + dgEnclosureInfo.setConversationSummaryList((List) arr1List2.get(6)); + dgEnclosureInfo.setCreditReportList((List) arr1List2.get(7)); + dgEnclosureInfo.setInspectionPhotosList((List) arr1List2.get(8)); + dgEnclosureInfo.setLegalCardCopyList((List) arr1List2.get(9)); + dgEnclosureInfo.setLegalCopyList((List) arr1List2.get(10)); + dgEnclosureInfo.setTaxCertificateList((List) arr1List2.get(11)); + dgEnclosureInfo.setMeetingMinutesList((List) arr1List2.get(12)); + dgEnclosureInfo.setMarriageCopyList((List) 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().eq("business_id",guaranteeAssignUser.getBusinessId())); + //附件新增 + dgEnclosureInfoMapper.insert(dgEnclosureInfo); + + //判断A角和B角是否都调查通过,如果都审核通过,则往担保部经理添加一条需要审核的记录 + int i = this.baseMapper.selectCount(new QueryWrapper().eq("business_id",guaranteeAssignUser.getBusinessId()) + .eq("type",1).eq("status",4)); + int n = this.baseMapper.selectCount(new QueryWrapper().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; + } + + } diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyLastMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyLastMapper.xml deleted file mode 100644 index 56f17ddc..00000000 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyLastMapper.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyMapper.xml deleted file mode 100644 index b6c9e93b..00000000 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeApplyMapper.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeAssignUserMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeAssignUserMapper.xml index 09037df2..9941020f 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeAssignUserMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgGuaranteeAssignUserMapper.xml @@ -17,4 +17,25 @@ + + diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java index f4208f20..1e828573 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java @@ -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 @Autowired private HrmsFeignService hrmsFeignService; + @Resource + private AuthEmployeeRoleDao authEmployeeRoleDao; + /* @Autowired private OdcProperties properties;*/ @@ -117,6 +121,17 @@ public class UserLoginServiceImpl extends ServiceImpl //删除redis里面的userEntity JwtUtils.removeUserEntityByUserId(userEntity.getId()); } + //根据userId获取roleId + List> roleList = authEmployeeRoleDao.selectMaps(new QueryWrapper().eq("user_id", userEntity.getId())); + List 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 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().eq("user_id", userEntity.getId())); diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java index 3790d289..d7e5d127 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/DeptController.java @@ -101,11 +101,10 @@ public class DeptController implements DeptControllerApi { /** *所有部门及员工 */ - /*@Override @GetMapping("/trees") public ResponseResult trees() { return new ResponseResult>().SUCCESS(deptService.listDepartmentAndEmployeeTree()); - }*/ + } /** * 该部门下所有子部门及部门下员工 @@ -135,4 +134,5 @@ public class DeptController implements DeptControllerApi { return ResponseResult.SUCCESS(deptService.listEmployeeById(id)); } + } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java index 4e24f365..20f8adf2 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java @@ -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().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 list) { + return new ResponseResult<>().SUCCESS(employeeService.insertUsrRole(list)); + } } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java index c176b135..06f67e78 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java @@ -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 { List listEmployeeByDeptId(Long id); + List employeeListByDeptId(Long id); + List listEmployeeName(); IPage pageByCondition(Page page, @Param("employee") EmployeeEntity employee); @@ -94,4 +97,8 @@ public interface EmployeeDao extends BaseMapper { EmployeeRepetition getEmployeeRepetitionByEmpId(Long empId); EmployeeMessageResponse getAccountAndDeptNameById(Long userId); + + boolean insertUserRole(Long userId, Long roleId); + + boolean insertUsrRole(@Param("list") List list); } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java index 4c1434f0..03086e5b 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/DeptService.java @@ -26,7 +26,7 @@ public interface DeptService extends IService { boolean deleteByIds(Long[] ids); - /*List listDepartmentAndEmployeeTree();*/ + List listDepartmentAndEmployeeTree(); DepartmentVO getDepartmentAndEmployee(Long id); 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 b26cad11..3bd5853f 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 @@ -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 getEmployeeByUserId(Long userId); EmployeeMessageResponse getAccountAndDeptNameById(Long userId); + + boolean insertUserRole(Long userId, Long roleId); + + boolean insertUsrRole(List list); } diff --git a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java index fe15f5b5..db4880f6 100644 --- a/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java +++ b/dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/DeptServiceImpl.java @@ -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 implements DeptService { - @Autowired + @Resource private DeptDao deptDao; - @Autowired + @Resource private EmployeeDao employeeDao; /** @@ -160,7 +162,7 @@ public class DeptServiceImpl extends ServiceImpl implements * 获取所有的部门及部门下的员工信息 * @return */ - /* @Override + @Override public List listDepartmentAndEmployeeTree() { return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L); } @@ -169,11 +171,19 @@ public class DeptServiceImpl extends ServiceImpl 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 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()); - }*/ + } + + /** * 获取该部门下子部门及部门下的员工 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 e2c2ec33..8587cfc8 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 @@ -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 list) { + return this.getBaseMapper().insertUsrRole(list); + } } \ No newline at end of file diff --git a/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml b/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml index 40d390f0..762eeea3 100644 --- a/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml +++ b/dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml @@ -184,6 +184,21 @@ AND d.id = #{id} + + + +