Showing
3 changed files
with
63 additions
and
0 deletions
| @@ -299,12 +299,24 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> { | @@ -299,12 +299,24 @@ public class GetCustomerCreditBo extends BaseBo<CustomerCredit> { | ||
| 299 | private String investigator; | 299 | private String investigator; |
| 300 | 300 | ||
| 301 | /** | 301 | /** |
| 302 | + * 调查人名称(非持久化字段) | ||
| 303 | + */ | ||
| 304 | + @ApiModelProperty("调查人名称") | ||
| 305 | + private String investigatorName; | ||
| 306 | + | ||
| 307 | + /** | ||
| 302 | * 主管审核 | 308 | * 主管审核 |
| 303 | */ | 309 | */ |
| 304 | @ApiModelProperty("主管审核") | 310 | @ApiModelProperty("主管审核") |
| 305 | private String supervisorReview; | 311 | private String supervisorReview; |
| 306 | 312 | ||
| 307 | /** | 313 | /** |
| 314 | + * 主管审核名称(非持久化字段) | ||
| 315 | + */ | ||
| 316 | + @ApiModelProperty("主管审核名称") | ||
| 317 | + private String supervisorReviewName; | ||
| 318 | + | ||
| 319 | + /** | ||
| 308 | * 年度总销量(万元) | 320 | * 年度总销量(万元) |
| 309 | */ | 321 | */ |
| 310 | @ApiModelProperty("年度总销量(万元)") | 322 | @ApiModelProperty("年度总销量(万元)") |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/customer/CustomerCreditController.java
| 1 | package com.lframework.xingyun.sc.controller.customer; | 1 | package com.lframework.xingyun.sc.controller.customer; |
| 2 | 2 | ||
| 3 | +import com.lframework.starter.common.utils.StringUtil; | ||
| 3 | import com.lframework.starter.web.core.annotations.security.HasPermission; | 4 | import com.lframework.starter.web.core.annotations.security.HasPermission; |
| 4 | import com.lframework.starter.web.core.controller.DefaultBaseController; | 5 | import com.lframework.starter.web.core.controller.DefaultBaseController; |
| 5 | import com.lframework.starter.web.inner.bo.system.user.QuerySysUserBo; | 6 | import com.lframework.starter.web.inner.bo.system.user.QuerySysUserBo; |
| 6 | import com.lframework.starter.web.inner.entity.SysUser; | 7 | import com.lframework.starter.web.inner.entity.SysUser; |
| 8 | +import com.lframework.starter.web.inner.service.system.SysUserService; | ||
| 7 | import com.lframework.xingyun.basedata.service.customer.CustomerService; | 9 | import com.lframework.xingyun.basedata.service.customer.CustomerService; |
| 8 | import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditBo; | 10 | import com.lframework.xingyun.sc.bo.customer.credit.GetCustomerCreditBo; |
| 9 | import com.lframework.xingyun.sc.entity.CorePersonnel; | 11 | import com.lframework.xingyun.sc.entity.CorePersonnel; |
| @@ -49,6 +51,8 @@ public class CustomerCreditController extends DefaultBaseController { | @@ -49,6 +51,8 @@ public class CustomerCreditController extends DefaultBaseController { | ||
| 49 | private CustomerService customerService; | 51 | private CustomerService customerService; |
| 50 | @Resource | 52 | @Resource |
| 51 | private CorePersonnelService corePersonnelService; | 53 | private CorePersonnelService corePersonnelService; |
| 54 | + @Resource | ||
| 55 | + private SysUserService sysUserService; | ||
| 52 | 56 | ||
| 53 | /** | 57 | /** |
| 54 | * 查询列表 | 58 | * 查询列表 |
| @@ -179,6 +183,16 @@ public class CustomerCreditController extends DefaultBaseController { | @@ -179,6 +183,16 @@ public class CustomerCreditController extends DefaultBaseController { | ||
| 179 | vo.setCreditId(credit.getId()); | 183 | vo.setCreditId(credit.getId()); |
| 180 | List<CorePersonnel> corePersonnel = corePersonnelService.query(vo); | 184 | List<CorePersonnel> corePersonnel = corePersonnelService.query(vo); |
| 181 | data.setCorePersonnelList(corePersonnel); | 185 | data.setCorePersonnelList(corePersonnel); |
| 186 | + //调查人 | ||
| 187 | + if (StringUtil.isNotEmpty(credit.getInvestigator())) { | ||
| 188 | + SysUser sysUser = sysUserService.findById(credit.getInvestigator()); | ||
| 189 | + data.setInvestigatorName(sysUser.getName()); | ||
| 190 | + } | ||
| 191 | + //主管审核 | ||
| 192 | + if (StringUtil.isNotEmpty(credit.getSupervisorReview())) { | ||
| 193 | + SysUser sysUser = sysUserService.findById(credit.getSupervisorReview()); | ||
| 194 | + data.setSupervisorReviewName(sysUser.getName()); | ||
| 195 | + } | ||
| 182 | return data; | 196 | return data; |
| 183 | } | 197 | } |
| 184 | } | 198 | } |
| @@ -12,6 +12,8 @@ import com.lframework.starter.web.core.components.resp.PageResult; | @@ -12,6 +12,8 @@ import com.lframework.starter.web.core.components.resp.PageResult; | ||
| 12 | import com.lframework.starter.common.utils.StringUtil; | 12 | import com.lframework.starter.common.utils.StringUtil; |
| 13 | import java.io.Serializable; | 13 | import java.io.Serializable; |
| 14 | import com.lframework.starter.common.utils.Assert; | 14 | import com.lframework.starter.common.utils.Assert; |
| 15 | +import com.lframework.starter.web.inner.entity.SysUser; | ||
| 16 | +import com.lframework.starter.web.inner.service.system.SysUserService; | ||
| 15 | import com.lframework.xingyun.basedata.entity.Customer; | 17 | import com.lframework.xingyun.basedata.entity.Customer; |
| 16 | import com.lframework.xingyun.basedata.service.customer.CustomerService; | 18 | import com.lframework.xingyun.basedata.service.customer.CustomerService; |
| 17 | import com.lframework.xingyun.sc.Label; | 19 | import com.lframework.xingyun.sc.Label; |
| @@ -39,6 +41,8 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer | @@ -39,6 +41,8 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer | ||
| 39 | 41 | ||
| 40 | @Resource | 42 | @Resource |
| 41 | private CustomerService customerService; | 43 | private CustomerService customerService; |
| 44 | + @Resource | ||
| 45 | + private SysUserService sysUserService; | ||
| 42 | // 定义不需要比较的字段 | 46 | // 定义不需要比较的字段 |
| 43 | private static final Set<String> EXCLUDED_FIELDS = new HashSet<>(Arrays.asList( | 47 | private static final Set<String> EXCLUDED_FIELDS = new HashSet<>(Arrays.asList( |
| 44 | "id", "sort", "createById", "createBy", "updateById", | 48 | "id", "sort", "createById", "createBy", "updateById", |
| @@ -287,6 +291,39 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer | @@ -287,6 +291,39 @@ public class CustomerCreditHistoryServiceImpl extends BaseMpServiceImpl<Customer | ||
| 287 | Object value2 = field.get(customerCreditHistory); | 291 | Object value2 = field.get(customerCreditHistory); |
| 288 | 292 | ||
| 289 | if (!Objects.equals(value1, value2)) { | 293 | if (!Objects.equals(value1, value2)) { |
| 294 | + //单位名称 | ||
| 295 | + if ("companyId".equals(fieldName)) { | ||
| 296 | + if (StringUtil.isNotEmpty(data.getCompanyId())) { | ||
| 297 | + Customer customer1 = customerService.findById(data.getCompanyId()); | ||
| 298 | + value1 = customer1.getName(); | ||
| 299 | + } | ||
| 300 | + if (StringUtil.isNotEmpty(customerCreditHistory.getCompanyId())) { | ||
| 301 | + Customer customer2 = customerService.findById(customerCreditHistory.getCompanyId()); | ||
| 302 | + value2 = customer2.getName(); | ||
| 303 | + } | ||
| 304 | + } | ||
| 305 | + //调查人 | ||
| 306 | + if ("investigator".equals(fieldName)) { | ||
| 307 | + if (StringUtil.isNotEmpty(data.getInvestigator())) { | ||
| 308 | + SysUser sysUser1 = sysUserService.findById(data.getInvestigator()); | ||
| 309 | + value1 = sysUser1.getName(); | ||
| 310 | + } | ||
| 311 | + if (StringUtil.isNotEmpty(customerCreditHistory.getInvestigator())) { | ||
| 312 | + SysUser sysUser2 = sysUserService.findById(customerCreditHistory.getInvestigator()); | ||
| 313 | + value2 = sysUser2.getName(); | ||
| 314 | + } | ||
| 315 | + } | ||
| 316 | + //主管审核 | ||
| 317 | + if ("supervisorReview".equals(fieldName)) { | ||
| 318 | + if (StringUtil.isNotEmpty(data.getSupervisorReview())) { | ||
| 319 | + SysUser sysUser1 = sysUserService.findById(data.getSupervisorReview()); | ||
| 320 | + value1 = sysUser1.getName(); | ||
| 321 | + } | ||
| 322 | + if (StringUtil.isNotEmpty(customerCreditHistory.getSupervisorReview())) { | ||
| 323 | + SysUser sysUser2 = sysUserService.findById(customerCreditHistory.getSupervisorReview()); | ||
| 324 | + value2 = sysUser2.getName(); | ||
| 325 | + } | ||
| 326 | + } | ||
| 290 | // 获取中文标签,优先使用 @Label,否则用字段名 | 327 | // 获取中文标签,优先使用 @Label,否则用字段名 |
| 291 | String label = getLabel(field); | 328 | String label = getLabel(field); |
| 292 | 329 |