Commit 0c290d46 by jianan

新单跟进40

parent 64b7a2bc
...@@ -489,14 +489,28 @@ public class ApiPolicyFollowController { ...@@ -489,14 +489,28 @@ public class ApiPolicyFollowController {
@PostMapping("/list/page/vo") @PostMapping("/list/page/vo")
@Operation(summary = "分页获取新单跟进列表") @Operation(summary = "分页获取新单跟进列表")
public Result<Page<PolicyFollow>> listPolicyFollowByPage(@RequestBody PolicyFollowQueryRequest policyFollowQueryRequest, public Result<Page<PolicyFollow>> listPolicyFollowByPage(@RequestBody PolicyFollowQueryRequest policyFollowQueryRequest,
HttpServletRequest request) { HttpServletRequest request) {
long current = policyFollowQueryRequest.getPageNo(); long current = policyFollowQueryRequest.getPageNo();
long size = policyFollowQueryRequest.getPageSize(); long size = policyFollowQueryRequest.getPageSize();
// 查询数据库 // 查询数据库
Page<PolicyFollow> policyFollowPage = policyFollowService.page(new Page<>(current, size), Page<PolicyFollow> policyFollowPage = policyFollowService.page(new Page<>(current, size),
policyFollowService.getQueryWrapper(policyFollowQueryRequest)); policyFollowService.getQueryWrapper(policyFollowQueryRequest));
// 获取封装类 // 处理 nextStatusList 字段
policyFollowPage.getRecords().forEach(policyFollow -> {
Object nextStatusList = policyFollow.getNextStatusList();
if (nextStatusList != null && !nextStatusList.toString().isEmpty()) {
String[] statusArr = nextStatusList.toString().split(",");
List<Map<String, String>> statusMapList = new ArrayList<>();
for (String status : statusArr) {
Map<String, String> map = new HashMap<>();
map.put("itemLabel", PolicyFollowStatusEnum.getEnumByValue(status).getItemLabel());
map.put("itemValue", status);
statusMapList.add(map);
}
policyFollow.setNextStatusList(statusMapList);
}
});
return Result.success(policyFollowPage); return Result.success(policyFollowPage);
} }
......
...@@ -101,6 +101,8 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -101,6 +101,8 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
private PolicyAdditionalService policyAdditionalService; private PolicyAdditionalService policyAdditionalService;
@Resource @Resource
private IProductPlanService iProductPlanService; private IProductPlanService iProductPlanService;
@Resource
private CustomerService customerService;
/** /**
* 预约分页查询 * 预约分页查询
...@@ -448,6 +450,12 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -448,6 +450,12 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
&& !Objects.isNull(response.getApiInsurantInfoDto())) { && !Objects.isNull(response.getApiInsurantInfoDto())) {
apiInsurantInfoDto = response.getApiInsurantInfoDto(); apiInsurantInfoDto = response.getApiInsurantInfoDto();
} }
// 查询客户信息表数据
Customer customer = customerService.getByCustomerBizId(appointment.getCustomerBizId());
// 查询产品计划信息表数据
ProductPlan productPlan = iProductPlanService.queryOne(appointment.getAppointmentBizId(), apiProductPlanMainInfoDto.getPlanBizId());
// 新增新单跟进记录
PolicyFollow follow = new PolicyFollow(); PolicyFollow follow = new PolicyFollow();
String policyBizId = RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_POLICY.getCode()); String policyBizId = RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_POLICY.getCode());
//新单跟进唯一业务ID //新单跟进唯一业务ID
...@@ -456,6 +464,10 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -456,6 +464,10 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
follow.setAppointmentNo(appointment.getAppointmentNo()); follow.setAppointmentNo(appointment.getAppointmentNo());
//客户信息表唯一业务ID //客户信息表唯一业务ID
follow.setCustomerBizId(appointment.getCustomerBizId()); follow.setCustomerBizId(appointment.getCustomerBizId());
if (customer != null) {
//客户名称
follow.setCustomerName(customer.getFirstNamePinyin());
}
//待跟进 //待跟进
follow.setStatus(PolicyFollowStatusEnum.FOLLOW_UP.getItemValue()); follow.setStatus(PolicyFollowStatusEnum.FOLLOW_UP.getItemValue());
follow.setNextStatusList(policyFollowService.getNextStatus(PolicyFollowStatusEnum.CHECKING)); follow.setNextStatusList(policyFollowService.getNextStatus(PolicyFollowStatusEnum.CHECKING));
...@@ -463,8 +475,10 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -463,8 +475,10 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
// follow.setInsurerBizId(); // follow.setInsurerBizId();
//TODO 期交保费 //TODO 期交保费
// follow.setPaymentPremium(); // follow.setPaymentPremium();
//TODO 保單持有人 // 保單持有人
// follow.setPolicyHolder(); if (apiPolicyholderInfoDto != null) {
follow.setPolicyHolder(apiPolicyholderInfoDto.getName());
}
//TODO 预缴年期 //TODO 预缴年期
// follow.setPrepaidTerm(); // follow.setPrepaidTerm();
//TODO 产品类别 //TODO 产品类别
...@@ -498,6 +512,9 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -498,6 +512,9 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
//供款年期 //供款年期
if (StringUtils.isNotBlank(apiProductPlanMainInfoDto.getPaymentTerm())) { if (StringUtils.isNotBlank(apiProductPlanMainInfoDto.getPaymentTerm())) {
follow.setPaymentTerm(Integer.getInteger(apiProductPlanMainInfoDto.getPaymentTerm())); follow.setPaymentTerm(Integer.getInteger(apiProductPlanMainInfoDto.getPaymentTerm()));
if (follow.getPaymentTerm() == null) {
follow.setPaymentTerm(productPlan.getPaymentTerm());
}
} }
//产品名称 //产品名称
follow.setProductName(apiProductPlanMainInfoDto.getProductName()); follow.setProductName(apiProductPlanMainInfoDto.getProductName());
...@@ -506,7 +523,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -506,7 +523,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
policyFollowService.saveOrUpdate(follow); policyFollowService.saveOrUpdate(follow);
// 同步保存保单(产品计划) // 同步保存保单(产品计划)
savePolicy(apiPolicyholderInfoDto, apiInsurantInfoDto, apiProductPlanMainInfoDto, policyBizId, policyTransfer); savePolicy(productPlan, apiPolicyholderInfoDto, apiInsurantInfoDto, apiProductPlanMainInfoDto, policyBizId, policyTransfer);
// 同步保存保单产品计划附加险 // 同步保存保单产品计划附加险
savePolicyAdditional(apiProductPlanAdditionalInfoDtoList, policyBizId); savePolicyAdditional(apiProductPlanAdditionalInfoDtoList, policyBizId);
// 同步保存保单投保人 // 同步保存保单投保人
...@@ -608,6 +625,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -608,6 +625,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
policyInsurant.setId(null); policyInsurant.setId(null);
policyInsurant.setPolicyBizId(policyBizId); policyInsurant.setPolicyBizId(policyBizId);
policyInsurant.setPolicyInsurantBizId(RandomStringGenerator.generateBizId16("policy_insurant")); policyInsurant.setPolicyInsurantBizId(RandomStringGenerator.generateBizId16("policy_insurant"));
policyInsurant.setName(apiInsurantInfoDto.getName());
return policyInsurantService.saveOrUpdate(policyInsurant); return policyInsurantService.saveOrUpdate(policyInsurant);
} }
...@@ -624,11 +642,13 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -624,11 +642,13 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
policyPolicyholder.setId(null); policyPolicyholder.setId(null);
policyPolicyholder.setPolicyBizId(policyBizId); policyPolicyholder.setPolicyBizId(policyBizId);
policyPolicyholder.setPolicyPolicyholderBizId(RandomStringGenerator.generateBizId16("policy_policyholder")); policyPolicyholder.setPolicyPolicyholderBizId(RandomStringGenerator.generateBizId16("policy_policyholder"));
policyPolicyholder.setName(apiPolicyholderInfoDto.getName());
return policyPolicyholderService.saveOrUpdate(policyPolicyholder); return policyPolicyholderService.saveOrUpdate(policyPolicyholder);
} }
private boolean savePolicy(ApiPolicyholderInfoDto apiPolicyholderInfoDto, private boolean savePolicy(ProductPlan productPlan,
ApiPolicyholderInfoDto apiPolicyholderInfoDto,
ApiInsurantInfoDto apiInsurantInfoDto, ApiInsurantInfoDto apiInsurantInfoDto,
ApiProductPlanMainInfoDto apiProductPlanMainInfoDto, ApiProductPlanMainInfoDto apiProductPlanMainInfoDto,
String policyBizId, String policyBizId,
...@@ -636,7 +656,6 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -636,7 +656,6 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
) { ) {
String appointmentBizId = apiProductPlanMainInfoDto.getAppointmentBizId(); String appointmentBizId = apiProductPlanMainInfoDto.getAppointmentBizId();
String planBizId = apiProductPlanMainInfoDto.getPlanBizId(); String planBizId = apiProductPlanMainInfoDto.getPlanBizId();
ProductPlan productPlan = iProductPlanService.queryOne(appointmentBizId, planBizId);
if (productPlan == null) { if (productPlan == null) {
return false; return false;
} }
......
...@@ -3,6 +3,7 @@ package com.yd.csf.service.dao; ...@@ -3,6 +3,7 @@ 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.model.Fna; import com.yd.csf.service.model.Fna;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
/** /**
* @author Zhang Jianan * @author Zhang Jianan
...@@ -13,6 +14,8 @@ import org.apache.ibatis.annotations.Param; ...@@ -13,6 +14,8 @@ import org.apache.ibatis.annotations.Param;
public interface FnaMapper extends BaseMapper<Fna> { public interface FnaMapper extends BaseMapper<Fna> {
boolean updateFnaNoById(@Param("fnaNo") String fnaNo, @Param("id") Long id); boolean updateFnaNoById(@Param("fnaNo") String fnaNo, @Param("id") Long id);
int updateCustomerNameByCustomerBizId(@Param("firstNamePinyin") String firstNamePinyin, @Param("customerBizId") String customerBizId);
} }
......
...@@ -90,7 +90,7 @@ public class PolicyFollow implements Serializable { ...@@ -90,7 +90,7 @@ public class PolicyFollow implements Serializable {
/** /**
* 供款年期 * 供款年期
*/ */
private Integer paymentTerm; private Object paymentTerm;
/** /**
* 期交保费 * 期交保费
...@@ -170,7 +170,7 @@ public class PolicyFollow implements Serializable { ...@@ -170,7 +170,7 @@ public class PolicyFollow implements Serializable {
/** /**
* 下一步跟进状态列表 * 下一步跟进状态列表
*/ */
private String nextStatusList; private Object nextStatusList;
/** /**
* 保單持有人 * 保單持有人
......
...@@ -53,4 +53,6 @@ public interface FnaService extends IService<Fna> { ...@@ -53,4 +53,6 @@ public interface FnaService extends IService<Fna> {
Boolean updateFna(FnaUpdateRequest fnaUpdateRequest, String appointmentNo); Boolean updateFna(FnaUpdateRequest fnaUpdateRequest, String appointmentNo);
Map<String, Object> copyFna(FnaCopyRequest fnaCopyRequest); Map<String, Object> copyFna(FnaCopyRequest fnaCopyRequest);
int updateCustomerNameByCustomerBizId(String firstNamePinyin, String customerBizId);
} }
...@@ -20,8 +20,10 @@ import com.yd.csf.service.dto.CustomerUpdateRequest; ...@@ -20,8 +20,10 @@ import com.yd.csf.service.dto.CustomerUpdateRequest;
import com.yd.csf.service.dto.FnaQueryRequest; import com.yd.csf.service.dto.FnaQueryRequest;
import com.yd.csf.service.model.Customer; import com.yd.csf.service.model.Customer;
import com.yd.csf.service.model.CustomerExpand; import com.yd.csf.service.model.CustomerExpand;
import com.yd.csf.service.model.Fna;
import com.yd.csf.service.service.CustomerExpandService; import com.yd.csf.service.service.CustomerExpandService;
import com.yd.csf.service.service.CustomerService; import com.yd.csf.service.service.CustomerService;
import com.yd.csf.service.service.FnaService;
import com.yd.csf.service.utils.ValidateUtil; import com.yd.csf.service.utils.ValidateUtil;
import com.yd.csf.service.vo.AddressVO; import com.yd.csf.service.vo.AddressVO;
import com.yd.csf.service.vo.CustomerExpandVO; import com.yd.csf.service.vo.CustomerExpandVO;
...@@ -54,6 +56,9 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> ...@@ -54,6 +56,9 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
@Resource @Resource
private CustomerService customerService; private CustomerService customerService;
@Resource
private FnaService fnaService;
@Override @Override
...@@ -241,6 +246,9 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> ...@@ -241,6 +246,9 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer>
customerService.validCustomer(oldCustomer); customerService.validCustomer(oldCustomer);
// 更新主表 // 更新主表
boolean result = customerService.updateById(oldCustomer); boolean result = customerService.updateById(oldCustomer);
if (StringUtils.isNotBlank(customerUpdateRequest.getFirstNamePinyin())) {
fnaService.updateCustomerNameByCustomerBizId(customerUpdateRequest.getFirstNamePinyin(), customerBizId);
}
// 获取扩展表信息 // 获取扩展表信息
CustomerExpand customerExpand = customerExpandService.getByCustomerBizId(customerBizId); CustomerExpand customerExpand = customerExpandService.getByCustomerBizId(customerBizId);
......
...@@ -356,6 +356,11 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe ...@@ -356,6 +356,11 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe
return Collections.singletonMap("fnaBizId", newFna.getFnaBizId()); return Collections.singletonMap("fnaBizId", newFna.getFnaBizId());
} }
@Override
public int updateCustomerNameByCustomerBizId(String firstNamePinyin, String customerBizId) {
return baseMapper.updateCustomerNameByCustomerBizId(firstNamePinyin, customerBizId);
}
private String copyFnaForm(String oldFnaFormBizId, String userBizId) { private String copyFnaForm(String oldFnaFormBizId, String userBizId) {
FnaForm fnaForm = fnaFormService.getByFnaFormBizId(oldFnaFormBizId); FnaForm fnaForm = fnaFormService.getByFnaFormBizId(oldFnaFormBizId);
if (fnaForm == null) { if (fnaForm == null) {
......
...@@ -92,7 +92,7 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -92,7 +92,7 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
queryWrapper.eq(ObjectUtils.isNotEmpty(policyNo), "policy_no", policyNo); queryWrapper.eq(ObjectUtils.isNotEmpty(policyNo), "policy_no", policyNo);
queryWrapper.eq(ObjectUtils.isNotEmpty(customerName), "customer_name", customerName); queryWrapper.eq(ObjectUtils.isNotEmpty(customerName), "customer_name", customerName);
queryWrapper.eq(ObjectUtils.isNotEmpty(customerBizId), "customer_biz_id", customerBizId); queryWrapper.eq(ObjectUtils.isNotEmpty(customerBizId), "customer_biz_id", customerBizId);
queryWrapper.eq(ObjectUtils.isNotEmpty(status), "status", status); queryWrapper.eq(ObjectUtils.isNotEmpty(status.trim()), "status", status);
queryWrapper.eq(ObjectUtils.isNotEmpty(insurer), "insurance", insurer); queryWrapper.eq(ObjectUtils.isNotEmpty(insurer), "insurance", insurer);
queryWrapper.eq(ObjectUtils.isNotEmpty(productName), "product_code", productName); queryWrapper.eq(ObjectUtils.isNotEmpty(productName), "product_code", productName);
queryWrapper.ge(ObjectUtils.isNotEmpty(signDateStart), "sign_date", signDateStart); queryWrapper.ge(ObjectUtils.isNotEmpty(signDateStart), "sign_date", signDateStart);
......
...@@ -32,7 +32,7 @@ public class PolicyFollowVO implements Serializable { ...@@ -32,7 +32,7 @@ public class PolicyFollowVO implements Serializable {
* 下一步跟进状态列表 * 下一步跟进状态列表
*/ */
@Schema(description = "下一步跟进状态列表, 下拉框") @Schema(description = "下一步跟进状态列表, 下拉框")
private List<String> nextStatusList; private Object nextStatusList;
/** /**
* 新单跟进Dto * 新单跟进Dto
...@@ -83,7 +83,7 @@ public class PolicyFollowVO implements Serializable { ...@@ -83,7 +83,7 @@ public class PolicyFollowVO implements Serializable {
policyFollowVO.setPolicyFollowUpdateDto(policyFollowUpdateDto); policyFollowVO.setPolicyFollowUpdateDto(policyFollowUpdateDto);
if (policyFollow.getNextStatusList() != null) { if (policyFollow.getNextStatusList() != null) {
policyFollowVO.setNextStatusList(Arrays.asList(policyFollow.getNextStatusList().split(","))); policyFollowVO.setNextStatusList(policyFollow.getNextStatusList());
} }
VerifyPolicyInfo verifyPolicyInfo = new VerifyPolicyInfo(); VerifyPolicyInfo verifyPolicyInfo = new VerifyPolicyInfo();
......
...@@ -41,4 +41,8 @@ ...@@ -41,4 +41,8 @@
<update id="updateFnaNoById"> <update id="updateFnaNoById">
update fna set fna_no = #{fnaNo} where id = #{id} update fna set fna_no = #{fnaNo} where id = #{id}
</update> </update>
<update id="updateCustomerNameByCustomerBizId">
update fna set customer_name = #{firstNamePinyin} where customer_biz_id = #{customerBizId}
</update>
</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