|
|
@@ -49,6 +49,7 @@ import com.jzg.quotation.summary.mapper.InsFeeAuditMapper;
|
|
|
import com.jzg.quotation.summary.mapper.InsOrderRightsMapper;
|
|
|
import com.jzg.quotation.summary.mapper.InsOrderRightsPackageMapper;
|
|
|
import com.jzg.quotation.summary.service.*;
|
|
|
+import com.jzg.quotation.summary.service.userinfo.UserInfoService;
|
|
|
import com.jzg.quotation.summary.state.AuditState;
|
|
|
import com.jzg.quotation.summary.state.listener.AuditStateListener;
|
|
|
import io.seata.spring.annotation.GlobalTransactional;
|
|
|
@@ -121,6 +122,8 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
|
|
|
|
|
|
@Autowired
|
|
|
InsOrdersCarInfoService insOrdersCarInfoService;
|
|
|
+ @Autowired
|
|
|
+ private UserInfoService userInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
private AuditStateListener auditStateListener;
|
|
|
@@ -177,8 +180,8 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
|
|
|
// feeAuditVo.setPartnerCompanySimplyName(allCompanyHierarchyPaths.get(Objects.toString(feeAuditVo.getPartnerCompanyId(),"")));
|
|
|
feeAuditVo.setPartnerCompanySimplyName(feeAuditVo.getPartnerCompanyName());
|
|
|
// auditUser 非空时,判断是名称还是手机号
|
|
|
- feeAuditVo.setAuditUser(getUserNameByMobile(feeAuditVo.getAuditUser()));
|
|
|
- feeAuditVo.setCreateBy(getUserNameByMobile(feeAuditVo.getCreateBy()));
|
|
|
+ feeAuditVo.setAuditUser(userInfoService.getUserNameByMobile(feeAuditVo.getAuditUser()));
|
|
|
+ feeAuditVo.setCreateBy(userInfoService.getUserNameByMobile(feeAuditVo.getCreateBy()));
|
|
|
|
|
|
// 循环每条数据,查询 ins_fee_orders 并计算权益金额
|
|
|
// 查询订单的 ins_fee_orders 数据
|
|
|
@@ -1220,36 +1223,4 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
|
|
|
return res.getRecords();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据用户手机号查询名称
|
|
|
- * @param mobile
|
|
|
- * @return
|
|
|
- */
|
|
|
- private String getUserNameByMobile(String mobile) {
|
|
|
- if (StringUtils.isNotBlank(mobile)) {
|
|
|
- // 国内手机号正则:1开头,第二位3-9,共11位数字
|
|
|
- String mobileRegex = "^1[3-9]\\d{9}$";
|
|
|
- if (ReUtil.contains(mobileRegex, mobile)) {
|
|
|
- // auditUser 是手机号:先从 sys_user 表根据 mobile 查询数据
|
|
|
- HttpResult<SysUser> sysUserResult = orgClient.getUserOnlyIdByMobile(mobile);
|
|
|
- if (sysUserResult != null && sysUserResult.isSuccess() && sysUserResult.getData() != null) {
|
|
|
- SysUser sysUser = sysUserResult.getData();
|
|
|
- String userName = sysUser.getUsername();
|
|
|
- // 如果 sys_user 的 username 字段是手机号,则再去 sys_user_jzg_info 根据 user_id 查询数据,展示 name
|
|
|
- if (StringUtils.isNotBlank(userName) && userName.matches(mobileRegex)) {
|
|
|
- HttpResult<SysUserJzgInfo> jzgInfoResult = orgClient.getUserInfo(sysUser.getId());
|
|
|
- if (jzgInfoResult != null && jzgInfoResult.isSuccess() && jzgInfoResult.getData() != null
|
|
|
- && StringUtils.isNotBlank(jzgInfoResult.getData().getName())) {
|
|
|
- return jzgInfoResult.getData().getName();
|
|
|
- }
|
|
|
- } else if (StringUtils.isNotBlank(userName)) {
|
|
|
- // 如果 sys_user 的 username 是名称,则直接展示
|
|
|
- return userName;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return StrUtil.EMPTY;
|
|
|
- }
|
|
|
}
|