Commit e6ccf999 by jianan

新单跟进v2

parent 09b19771
...@@ -729,7 +729,7 @@ public class ApiPolicyFollowController { ...@@ -729,7 +729,7 @@ public class ApiPolicyFollowController {
*/ */
@PostMapping("/policyNos") @PostMapping("/policyNos")
@Operation(summary = "查询保单号列表") @Operation(summary = "查询保单号列表")
public Result<List<PolicyNumberResponseVO>> queryPolicyNumbers(@RequestBody PolicyNosQueryRequest policyNosQueryRequest) { public Result<Page<PolicyNumberResponseVO>> queryPolicyNumbers(@RequestBody PolicyNosQueryRequest policyNosQueryRequest) {
return Result.success(policyFollowService.queryPolicyNumbers(policyNosQueryRequest.getPolicyNo())); return Result.success(policyFollowService.queryPolicyNumbers(policyNosQueryRequest));
} }
} }
\ No newline at end of file
package com.yd.csf.service.dto; package com.yd.csf.service.dto;
import com.yd.common.dto.PageDto;
import lombok.Data; import lombok.Data;
@Data @Data
public class PolicyNosQueryRequest { public class PolicyNosQueryRequest extends PageDto {
private String policyNo; private String policyNo;
} }
...@@ -79,8 +79,8 @@ public interface PolicyFollowService extends IService<PolicyFollow> { ...@@ -79,8 +79,8 @@ public interface PolicyFollowService extends IService<PolicyFollow> {
/** /**
* 查询保单号列表 * 查询保单号列表
* *
* @param policyNo 保单号 * @param policyNosQueryRequest 保单号查询请求
* @return 保单号列表 * @return 保单号列表
*/ */
List<PolicyNumberResponseVO> queryPolicyNumbers(String policyNo); Page<PolicyNumberResponseVO> queryPolicyNumbers(PolicyNosQueryRequest policyNosQueryRequest);
} }
...@@ -814,15 +814,29 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -814,15 +814,29 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
} }
@Override @Override
public List<PolicyNumberResponseVO> queryPolicyNumbers(String policyNo) { public Page<PolicyNumberResponseVO> queryPolicyNumbers(PolicyNosQueryRequest policyNosQueryRequest) {
String policyNo = policyNosQueryRequest.getPolicyNo();
// 创建分页对象
Page<PolicyFollow> page = new Page<>(policyNosQueryRequest.getPageNo(), policyNosQueryRequest.getPageSize());
// 构建查询条件
QueryWrapper<PolicyFollow> queryWrapper = new QueryWrapper<>(); QueryWrapper<PolicyFollow> queryWrapper = new QueryWrapper<>();
queryWrapper.select("policy_no", "insurance_company", "insurance_company_biz_id", "insured", "insured_biz_id"); queryWrapper.select("policy_no", "insurance_company", "insurance_company_biz_id", "insured", "insured_biz_id");
queryWrapper.like(ObjectUtils.isNotEmpty(policyNo), "policy_no", policyNo); queryWrapper.like(ObjectUtils.isNotEmpty(policyNo), "policy_no", policyNo);
queryWrapper.isNotNull("policy_no"); queryWrapper.isNotNull("policy_no");
List<PolicyFollow> policyFollows = policyFollowService.list(queryWrapper);
return policyFollows.stream() // 执行分页查询
Page<PolicyFollow> policyFollowPage = policyFollowService.page(page, queryWrapper);
// 转换结果
Page<PolicyNumberResponseVO> resultPage = new Page<>(policyFollowPage.getCurrent(), policyFollowPage.getSize(), policyFollowPage.getTotal());
List<PolicyNumberResponseVO> voList = policyFollowPage.getRecords().stream()
.map(this::convertToPolicyNumberResponseVO) .map(this::convertToPolicyNumberResponseVO)
.collect(Collectors.toList()); .collect(Collectors.toList());
resultPage.setRecords(voList);
return resultPage;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment