From 53434efcdded8ef1cf8f30e7d0ae6bf013b9a3a2 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Fri, 18 Dec 2020 19:59:40 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.properties | 2 +- .../com/daqing/financial/hrauth/dao/UserLoginDao.java | 2 ++ .../hrauth/service/impl/UserDetailsServiceImpl.java | 9 +++++++++ .../hrauth/service/impl/UserLoginServiceImpl.java | 5 ++++- .../src/main/resources/mapper/hrauth/UserLoginMapper.xml | 6 +++++- .../framework/domain/hrms/request/LoginRequest.java | 2 +- 6 files changed, 22 insertions(+), 4 deletions(-) diff --git a/dq-financial-guarantee/src/main/resources/bootstrap.properties b/dq-financial-guarantee/src/main/resources/bootstrap.properties index e979dd87..7e9ffae0 100644 --- a/dq-financial-guarantee/src/main/resources/bootstrap.properties +++ b/dq-financial-guarantee/src/main/resources/bootstrap.properties @@ -1,5 +1,5 @@ #服务名称 -#spring.application.name=dq-financial-guarantee +spring.application.name=dq-financial-guarantee ##配置中心地址 spring.cloud.nacos.config.server-addr=192.168.31.140:8848 spring.cloud.nacos.config.namespace=58fa89c6-0e23-4530-ac13-95747e873c60 diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/UserLoginDao.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/UserLoginDao.java index ec65bf6e..943c3b31 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/UserLoginDao.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/UserLoginDao.java @@ -31,4 +31,6 @@ public interface UserLoginDao extends BaseMapper { Boolean updateUserLogin(@Param("userId") Long userId, @Param("date") Date date); Integer countWeChatId(String weChatId); + + String getNameByUserId(Long userId); } diff --git a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserDetailsServiceImpl.java b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserDetailsServiceImpl.java index e5fe5b68..61dc4d7b 100644 --- a/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserDetailsServiceImpl.java +++ b/dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserDetailsServiceImpl.java @@ -47,6 +47,8 @@ public class UserDetailsServiceImpl implements UserDetailsService { private AuthEmployeeRoleDao userRoleMapper; @Autowired private HrauthFeignService hrauthFeignService; + @Autowired + private UserLoginDao userLoginDao; /*** * 根据账号获取用户信息 @@ -57,13 +59,20 @@ public class UserDetailsServiceImpl implements UserDetailsService { public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { // 从数据库中取出用户信息 List userList = userMapper.selectList(new QueryWrapper().eq("phone_account", username)); + List userList2 = userMapper.selectList(new QueryWrapper().eq("account", username)); UserEntity user; + String name = null; // 判断用户是否存在 if (!CollectionUtils.isEmpty(userList)) { user = userList.get(0); + name = userLoginDao.getNameByUserId(userList.get(0).getId()); + } else if(!CollectionUtils.isEmpty(userList2)){ + user = userList2.get(0); + name = userLoginDao.getNameByUserId(userList2.get(0).getId()); } else { throw new UsernameNotFoundException("用户名不存在或已禁用!"); } + user.setAccount(name); // 返回UserDetails实现类 return new SecurityUser(user, getUserRoles(user.getId().intValue())); } 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 df1192d7..69c23249 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 @@ -117,7 +117,10 @@ public class UserLoginServiceImpl extends ServiceImpl public ResponseResult login(LoginRequest loginRequest) { //判断用户登录方式 UserEntity userEntity = baseMapper.login(loginRequest); + String name = null; if(userEntity != null){ + //获取员工name + name = baseMapper.getNameByUserId(userEntity.getId()); //删除redis里面的userEntity JwtUtils.removeUserEntityByUserId(userEntity.getId()); } @@ -206,7 +209,7 @@ public class UserLoginServiceImpl extends ServiceImpl //返回用户信息 LoginResponse loginResponse = new LoginResponse(); - loginResponse.setAccount(userEntity.getAccount()); + loginResponse.setAccount(name); loginResponse.setToken(token); if(headImg != null) loginResponse.setHeadPortaritUrl(headImg); diff --git a/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml b/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml index c6499ec2..958a9e0a 100644 --- a/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml +++ b/dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml @@ -28,7 +28,7 @@ select id,account,phone_account,password,login_num from hrms_user where del_or_not = 0 and status = 0 - and phone_account = #{phone} + and (phone_account = #{phone} or account = #{phone}) and wechat_id = #{wechatId} @@ -63,4 +63,8 @@ SELECT COUNT(id) FROM hrms_user WHERE wechat_id = #{weChatId} + + \ No newline at end of file diff --git a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/LoginRequest.java b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/LoginRequest.java index af330c96..03a41c9b 100644 --- a/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/LoginRequest.java +++ b/dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/request/LoginRequest.java @@ -8,7 +8,7 @@ public class LoginRequest { private int id; - @ApiModelProperty(value = "手机号码") + @ApiModelProperty(value = "手机号码/账号") private String phone; @ApiModelProperty(value = "登录类型(1:手机号 2:微信登录)") From f8b8ac1856d592780ea48a047f0d6b079434512e Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Fri, 18 Dec 2020 20:17:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/guarantee/DgAuditProcessMapper.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml index fd6ecda1..91f7603e 100644 --- a/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml +++ b/dq-financial-guarantee/src/main/resources/mapper/guarantee/DgAuditProcessMapper.xml @@ -11,10 +11,14 @@ + + + select ln.id,aai.business_code,cc.name,cc.phone,aai.business_type,lcc.loan_tern,lcc.loan_money,ln.role_id, - aai.create_time,ln.status,aai.bank,ln.audit_opinion,ln.operating_status,bps.business_status,ln.business_id + aai.create_time,ln.status,aai.bank,ln.audit_opinion,ln.operating_status,bps.business_status,ln.business_id,lcc.passing_time from dg_loan_notice ln left join dg_apply_amount_info aai on ln.business_id = aai.id left join crms_company_customer ccc on ln.company_id = ccc.id From 7a84de6f85df37008af6e87b490ad865613ebde9 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Fri, 18 Dec 2020 21:48:33 +0800 Subject: [PATCH 4/5] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CrmsCompanyPersonalController.java | 2 +- .../impl/DgApplyAmountInfoServiceImpl.java | 5 +++ .../DgAssetsInvestigationServiceImpl.java | 33 +++++++++++-------- .../DgGuaranteeAssignUserServiceImpl.java | 6 +++- .../src/main/resources/bootstrap.properties | 5 ++- .../src/main/resources/bootstrap.properties | 5 ++- 6 files changed, 38 insertions(+), 18 deletions(-) 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 35036ca2..ee2647ae 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 @@ -78,7 +78,7 @@ public class CrmsCompanyPersonalController { @ApiOperation(value = "编辑个人/企业关联人") public ResponseResult updateCompanyPersonal(@RequestBody CrmsCompanyPersonal crmsCompanyPersonal){ boolean result = crmsCompanyPersonalService.updateById(crmsCompanyPersonal); - return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL(); + return result ? ResponseResult.SUCCESS(crmsCompanyPersonal) : ResponseResult.FAIL(); } /** 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 32a1ed71..b61be868 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 @@ -396,6 +396,11 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl().eq("business_id",businessApplication.getBusinessId())); + + //同时往审核流程进程表新增一条记录 + String account = dgApplyAmountInfoController.getAccount(); + AuditProcessUtil.save(businessApplication.getBusinessId(),account,"担保业务员","",1,"","",""); + //附件新增 return dgEnclosureInfoMapper.insert(dgEnclosureInfo); } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java index 8c1d701c..06b2a305 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java @@ -164,22 +164,23 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl() .eq("business_id", assetsResponse.getBusinessId()).eq("type", 1)); - String assetsAmounts=assetsInvestigation.getAssetsAmount(); - if(assetsAmounts != null){ - if(assetsAmounts.length()>0){ - String a = assetsAmounts.substring(1,assetsAmounts.length()-1); - String arry[]=a.split(","); - List demoList = Arrays.asList(arry); - assetsResponse.setAssetsAmountList(demoList); + if(assetsInvestigation != null){ + String assetsAmounts=assetsInvestigation.getAssetsAmount(); + if(assetsAmounts != null){ + if(assetsAmounts.length()>0){ + String a = assetsAmounts.substring(1,assetsAmounts.length()-1); + String arry[]=a.split(","); + List demoList = Arrays.asList(arry); + assetsResponse.setAssetsAmountList(demoList); + } } - } - AssetsInvestigationResponse assetsInvestigationRes = new AssetsInvestigationResponse(); - if(assetsInvestigation != null){ - BeanUtils.copyProperties(assetsInvestigation,assetsInvestigationRes); - BeanUtils.copyProperties(assetsInvestigationRes,assetsResponse); + AssetsInvestigationResponse assetsInvestigationRes = new AssetsInvestigationResponse(); + if(assetsInvestigation != null){ + BeanUtils.copyProperties(assetsInvestigation,assetsInvestigationRes); + BeanUtils.copyProperties(assetsInvestigationRes,assetsResponse); + } } - //根据业务id查询评估价值List /* List assessmentlist = dgAssetsAssessmentAssetsLogMapper.selectList( new QueryWrapper().eq("business_id",assetsResponse.getBusinessId())); @@ -423,8 +424,12 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl Date: Sun, 20 Dec 2020 11:19:29 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DgGuaranteeLetterAssignUserController.java | 2 +- .../financial/guarantee/controller/DgLoanNoticeController.java | 2 +- .../controller/DgPaymentConfirmationConsiderController.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java index 58c4031a..23acd8ec 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgGuaranteeLetterAssignUserController.java @@ -78,7 +78,7 @@ public class DgGuaranteeLetterAssignUserController { @RequestBody GuaranteeLetterUpdateStatusRequest guaranteeLetterUpdateStatusRequest) { //如果为驳回操作且无审核意见,抛出异常 if (StatusCode.SP_REJECT.equals(guaranteeLetterUpdateStatusRequest.getStatus()) && guaranteeLetterUpdateStatusRequest.getAuditOpinion().length()==0){ - ExceptionCast.cast(HrmsCode.EMPTY_OPINION); + return ResponseResult.FAIL(44444,"请填写审核意见!"); } boolean result = guaranteeLetterAssignUserService.updateGuaranteeLetterStatus(guaranteeLetterUpdateStatusRequest); return result ? ResponseResult.SUCCESS("确认成功!"):ResponseResult.FAIL(40005,"确认失败!"); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java index 41c982bf..65b18fc3 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgLoanNoticeController.java @@ -72,7 +72,7 @@ public class DgLoanNoticeController { @RequestBody LoanNoticeUpdateRequest loanNoticeUpdateRequest) { //如果为驳回操作且无审核意见,抛出异常 if (StatusCode.SP_REJECT.equals(loanNoticeUpdateRequest.getStatus()) && loanNoticeUpdateRequest.getAuditOpinion().length()==0){ - ExceptionCast.cast(HrmsCode.EMPTY_OPINION); + return ResponseResult.FAIL(44444,"请填写审核意见!"); } boolean result = loanNoticeService.updateLoanNotice(loanNoticeUpdateRequest); return result ? ResponseResult.SUCCESS("更新成功!"):ResponseResult.FAIL(40005,"更新失败!"); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java index 5ceb9ae3..5fb6b6ba 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgPaymentConfirmationConsiderController.java @@ -63,7 +63,7 @@ public class DgPaymentConfirmationConsiderController { @RequestBody PaymentConfirmationUpdateRequest paymentConfirmationUpdateRequest) { //如果为驳回操作且无审核意见,抛出异常 if (StatusCode.SP_REJECT.equals(paymentConfirmationUpdateRequest.getStatus()) && paymentConfirmationUpdateRequest.getAuditOpinion().length()==0){ - ExceptionCast.cast(HrmsCode.EMPTY_OPINION); + return ResponseResult.FAIL(44444,"请填写审核意见!"); } boolean result = paymentConfirmationConsiderService.updatePaymentConfirmation(paymentConfirmationUpdateRequest); return result ? ResponseResult.SUCCESS("更新成功!"):ResponseResult.FAIL(40005,"更新失败!");