Commit bbdf5dd4 by jianan

新单跟进96

parent e088d14a
...@@ -27,6 +27,7 @@ import com.yd.csf.service.service.*; ...@@ -27,6 +27,7 @@ import com.yd.csf.service.service.*;
import com.yd.csf.service.vo.PolicyFollowDetailVO; import com.yd.csf.service.vo.PolicyFollowDetailVO;
import com.yd.csf.service.vo.PolicyFollowRecordVO; import com.yd.csf.service.vo.PolicyFollowRecordVO;
import com.yd.csf.service.vo.PolicyFollowVO; import com.yd.csf.service.vo.PolicyFollowVO;
import com.yd.product.feign.client.expectedcommissionratio.ApiExpectedCommissionRatioFeignClient;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -42,7 +43,6 @@ import javax.annotation.Resource; ...@@ -42,7 +43,6 @@ import javax.annotation.Resource;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
...@@ -81,10 +81,10 @@ public class ApiPolicyFollowController { ...@@ -81,10 +81,10 @@ public class ApiPolicyFollowController {
private PolicyFollowRecordService policyFollowRecordService; private PolicyFollowRecordService policyFollowRecordService;
@Resource @Resource
private PolicyFollowFileService policyFollowFileService; private PolicyFollowFileService policyFollowFileService;
@Resource @Resource
private PolicyReportPdfService policyReportPdfService; private PolicyReportPdfService policyReportPdfService;
@Resource
private ApiExpectedCommissionRatioFeignClient apiExpectedCommissionRatioFeignClient;
@PostMapping("/upload/excel") @PostMapping("/upload/excel")
...@@ -463,6 +463,27 @@ public class ApiPolicyFollowController { ...@@ -463,6 +463,27 @@ public class ApiPolicyFollowController {
if (policyFollow == null) { if (policyFollow == null) {
return Result.fail(ErrorCode.NOT_FOUND_ERROR.getCode(), ErrorCode.NOT_FOUND_ERROR.getMessage()); return Result.fail(ErrorCode.NOT_FOUND_ERROR.getCode(), ErrorCode.NOT_FOUND_ERROR.getMessage());
} }
// 异步查询产品上架信息表
if (StringUtils.isNotBlank(policyFollow.getPolicyNo()) && StringUtils.isBlank(policyFollow.getProductLaunchBizId())) {
// 异步查询产品上架信息表
// ApiExpectedCommissionRatioPageRequest apiExpectedCommissionRatioPageRequest = new ApiExpectedCommissionRatioPageRequest();
// apiExpectedCommissionRatioPageRequest.setPageNo(1);
// apiExpectedCommissionRatioPageRequest.setPageSize(100);
// apiExpectedCommissionRatioPageRequest.setWarrantyPeriod(String.valueOf(policyFollow.getPaymentTerm()));
// Result<Page<ApiExpectedCommissionRatioPageResponse>> result = apiExpectedCommissionRatioFeignClient.page(apiExpectedCommissionRatioPageRequest);
// if (result != null && result.getData() != null) {
// List<ApiExpectedCommissionRatioPageResponse> records = (List<ApiExpectedCommissionRatioPageResponse>) result.getData();
// if (CollectionUtils.isNotEmpty(records)) {
// policyFollow.setProductLaunchBizId(records.get(0).getProductLaunchBizId());
// }
// }
PolicyFollow updatePolicyFollow = new PolicyFollow();
updatePolicyFollow.setId(policyFollow.getId());
updatePolicyFollow.setProductLaunchBizId("product_launch_kudwRqXsz1");
policyFollowService.updateById(updatePolicyFollow);
}
// 获取封装类 // 获取封装类
return Result.success(policyFollowService.getPolicyFollowVO(policyFollow)); return Result.success(policyFollowService.getPolicyFollowVO(policyFollow));
...@@ -565,44 +586,26 @@ public class ApiPolicyFollowController { ...@@ -565,44 +586,26 @@ public class ApiPolicyFollowController {
public void previewPolicyReport(@RequestParam("policyBizId") String policyBizId, public void previewPolicyReport(@RequestParam("policyBizId") String policyBizId,
HttpServletResponse response) { HttpServletResponse response) {
PolicyFollow policyFollow = policyFollowService.getByPolicyBizId(policyBizId); PolicyReportData reportData = policyFollowService.queryPolicyReportData(policyBizId);
if (policyFollow == null) { if (reportData == null) {
throw new BusinessException(ErrorCode.NOT_FOUND_ERROR.getCode(), ErrorCode.NOT_FOUND_ERROR.getMessage()); throw new BusinessException(ErrorCode.NOT_FOUND_ERROR.getCode(), ErrorCode.NOT_FOUND_ERROR.getMessage());
} }
PolicyReportData reportData = new PolicyReportData();
// 填充数据
// reportData.setStartTime("2025-10-30"); // reportData.setStartTime("2025-10-30");
// reportData.setEndTime("2025-10-30"); // reportData.setEndTime("2025-10-30");
// reportData.setLocation("香港"); // reportData.setLocation("香港");
// reportData.setServiceManager("Vickie"); // reportData.setServiceManager("Vickie");
// reportData.setPolicyHolder(policyFollow.getPolicyHolder()); // reportData.setPolicyHolder("policyHolder");
// reportData.setPolicyNumber(policyFollow.getPolicyNo()); // reportData.setPolicyNumber("B635379588");
// reportData.setInsuranceCompany(policyFollow.getInsurer()); // reportData.setInsuranceCompany("友邦保险");
// reportData.setInsuredPerson(policyFollow.getInsured()); // reportData.setInsuredPerson("insuredPerson");
// reportData.setInsurancePlan(policyFollow.getProductName()); // reportData.setInsurancePlan("环宇盈活储蓄保险计划");
// reportData.setInsuredAge(0); // reportData.setInsuredAge(1);
// reportData.setCurrency(policyFollow.getCurrency()); // reportData.setCurrency("HKD");
// reportData.setPaymentPeriod((Integer) policyFollow.getPaymentTerm()); // reportData.setPaymentPeriod(5);
// reportData.setAnnualAmount(policyFollow.getPaymentPremium()); // reportData.setAnnualAmount(BigDecimal.valueOf(30000.08));
// reportData.setTotalPrepayment(BigDecimal.ZERO); // reportData.setTotalPrepayment(BigDecimal.valueOf(150064.70));
// reportData.setPremiumFee(BigDecimal.ZERO); // reportData.setPremiumFee(BigDecimal.valueOf(12.86));
reportData.setStartTime("2025-10-30");
reportData.setEndTime("2025-10-30");
reportData.setLocation("香港");
reportData.setServiceManager("Vickie");
reportData.setPolicyHolder("policyHolder");
reportData.setPolicyNumber("B635379588");
reportData.setInsuranceCompany("友邦保险");
reportData.setInsuredPerson("insuredPerson");
reportData.setInsurancePlan("环宇盈活储蓄保险计划");
reportData.setInsuredAge(1);
reportData.setCurrency("HKD");
reportData.setPaymentPeriod(5);
reportData.setAnnualAmount(BigDecimal.valueOf(30000.08));
reportData.setTotalPrepayment(BigDecimal.valueOf(150064.70));
reportData.setPremiumFee(BigDecimal.valueOf(12.86));
try { try {
log.info("收到PDF生成请求: {}", reportData); log.info("收到PDF生成请求: {}", reportData);
......
...@@ -99,6 +99,12 @@ ...@@ -99,6 +99,12 @@
<artifactId>yd-oss-feign</artifactId> <artifactId>yd-oss-feign</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<!-- yd-product-feign模块 -->
<dependency>
<groupId>com.yd</groupId>
<artifactId>yd-product-feign</artifactId>
<version>${project.version}</version>
</dependency>
<!-- 认证模块 --> <!-- 认证模块 -->
<dependency> <dependency>
......
package com.yd.csf.service.dao; package com.yd.csf.service.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yd.csf.service.dto.PolicyReportData;
import com.yd.csf.service.model.PolicyFollow; import com.yd.csf.service.model.PolicyFollow;
import org.apache.ibatis.annotations.Param;
/** /**
* @author Zhang Jianan * @author Zhang Jianan
...@@ -11,6 +13,7 @@ import com.yd.csf.service.model.PolicyFollow; ...@@ -11,6 +13,7 @@ import com.yd.csf.service.model.PolicyFollow;
*/ */
public interface PolicyFollowMapper extends BaseMapper<PolicyFollow> { public interface PolicyFollowMapper extends BaseMapper<PolicyFollow> {
PolicyReportData queryPolicyReportData(@Param("policyBizId") String policyBizId);
} }
......
...@@ -44,4 +44,6 @@ public interface PolicyFollowService extends IService<PolicyFollow> { ...@@ -44,4 +44,6 @@ public interface PolicyFollowService extends IService<PolicyFollow> {
Page<PolicyFollowDetailVO> getPolicyFollowDetailVOList(Page<PolicyFollow> policyFollowPage); Page<PolicyFollowDetailVO> getPolicyFollowDetailVOList(Page<PolicyFollow> policyFollowPage);
String getCurrencyValue(String currency); String getCurrencyValue(String currency);
PolicyReportData queryPolicyReportData(String policyBizId);
} }
...@@ -568,6 +568,19 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -568,6 +568,19 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
} }
@Override @Override
public PolicyReportData queryPolicyReportData(String policyBizId) {
PolicyReportData policyReportData = this.baseMapper.queryPolicyReportData(policyBizId);
// 处理服务经理
String signerList = policyReportData.getServiceManager();
if (StringUtils.isNotBlank(signerList)) {
policyReportData.setServiceManager(signerList.split(",")[0]);
}
// 处理位置
policyReportData.setLocation("香港");
return policyReportData;
}
@Override
public Boolean uploadAttachment(AttachmentUploadRequest attachmentUploadRequest) { public Boolean uploadAttachment(AttachmentUploadRequest attachmentUploadRequest) {
String policyBizId = attachmentUploadRequest.getPolicyBizId(); String policyBizId = attachmentUploadRequest.getPolicyBizId();
if (policyBizId == null) { if (policyBizId == null) {
......
...@@ -72,4 +72,28 @@ ...@@ -72,4 +72,28 @@
remark,is_deleted,creator_id,updater_id,create_time, remark,is_deleted,creator_id,updater_id,create_time,
update_time update_time
</sql> </sql>
<select id="queryPolicyReportData" resultType="com.yd.csf.service.dto.PolicyReportData">
select
t.id,
t.policy_biz_id,
t.policy_no as policyNumber,
t.insurer as insuranceCompany,
t.product_name as insurancePlan,
t.payment_term as paymentPeriod,
t.initial_premium as annualAmount,
t.prepaid_amount as totalPrepayment,
t.payment_premium as premiumFee,
t.sign_date as startTime,
t.sign_date as endTime,
t.signer_list as serviceManager,
t.policy_holder as policyHolder,
t.currency as currency,
ifnull(i.name, i.name_en) as insuredPerson
i.age as insuredAge
from policy_follow t
left join policy_insurant i on t.policy_biz_id = i.policy_biz_id
where t.policy_biz_id = #{policyBizId}
</select>
</mapper> </mapper>
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