Commit 079d7261 by jianan

新单跟进v2

parent 2c75dfea
...@@ -8,6 +8,7 @@ import com.yd.common.result.Result; ...@@ -8,6 +8,7 @@ import com.yd.common.result.Result;
import com.yd.csf.api.service.ApiAppointmentService; import com.yd.csf.api.service.ApiAppointmentService;
import com.yd.csf.feign.dto.appointment.ApiAppointmentInfoDto; import com.yd.csf.feign.dto.appointment.ApiAppointmentInfoDto;
import com.yd.csf.service.dto.*; import com.yd.csf.service.dto.*;
import com.yd.csf.service.enums.FnaStatusEnum;
import com.yd.csf.service.model.Fna; import com.yd.csf.service.model.Fna;
import com.yd.csf.service.service.FnaService; import com.yd.csf.service.service.FnaService;
import com.yd.csf.service.vo.FnaVO; import com.yd.csf.service.vo.FnaVO;
...@@ -147,4 +148,40 @@ public class ApiFnaController { ...@@ -147,4 +148,40 @@ public class ApiFnaController {
} }
return Result.success(fnaService.copyFna(fnaCopyRequest)); return Result.success(fnaService.copyFna(fnaCopyRequest));
} }
/**
* 更新FNA状态(手动修改状态,例如改为"已作废")
*
* @param fnaBizId FNA业务ID
* @param status 目标状态
* @return
*/
@PostMapping("/update/status")
@Operation(summary = "更新FNA状态")
public Result<Boolean> updateFnaStatus(
@RequestParam("fnaBizId") String fnaBizId,
@RequestParam("status") String status) {
if (StringUtils.isBlank(fnaBizId) || StringUtils.isBlank(status)) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "fnaBizId和status不能为空");
}
// 验证状态是否有效
boolean isValidStatus = false;
for (FnaStatusEnum statusEnum : FnaStatusEnum.values()) {
if (statusEnum.getItemValue().equals(status)) {
isValidStatus = true;
break;
}
}
if (!isValidStatus) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), "无效的状态值");
}
int rows = fnaService.updateFnaStatus(fnaBizId, status);
if (rows > 0) {
return Result.success(true);
} else {
return Result.fail(ResultCode.NULL_ERROR.getCode(), "FNA记录不存在");
}
}
} }
package com.yd.csf.api.controller; package com.yd.csf.api.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yd.auth.core.dto.AuthUserDto; import com.yd.auth.core.dto.AuthUserDto;
import com.yd.auth.core.utils.SecurityUtil; import com.yd.auth.core.utils.SecurityUtil;
import com.yd.common.enums.CommonEnum; import com.yd.common.enums.CommonEnum;
...@@ -9,14 +10,18 @@ import com.yd.common.result.Result; ...@@ -9,14 +10,18 @@ import com.yd.common.result.Result;
import com.yd.common.utils.RandomStringGenerator; import com.yd.common.utils.RandomStringGenerator;
import com.yd.csf.service.dto.FnaFormAddRequest; import com.yd.csf.service.dto.FnaFormAddRequest;
import com.yd.csf.service.dto.FnaFormUpdateRequest; import com.yd.csf.service.dto.FnaFormUpdateRequest;
import com.yd.csf.service.enums.FnaStatusEnum;
import com.yd.csf.service.model.Fna;
import com.yd.csf.service.model.FnaForm; import com.yd.csf.service.model.FnaForm;
import com.yd.csf.service.service.FnaFormService; import com.yd.csf.service.service.FnaFormService;
import com.yd.csf.service.service.FnaService;
import com.yd.csf.service.vo.FnaFormVO; import com.yd.csf.service.vo.FnaFormVO;
import com.yd.user.feign.client.sysuser.ApiSysUserFeignClient; import com.yd.user.feign.client.sysuser.ApiSysUserFeignClient;
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.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -41,6 +46,9 @@ public class ApiFnaFormController { ...@@ -41,6 +46,9 @@ public class ApiFnaFormController {
@Resource @Resource
private ApiSysUserFeignClient apiSysUserFeignClient; private ApiSysUserFeignClient apiSysUserFeignClient;
@Resource
private FnaService fnaService;
/** /**
* 创建 Fna表单 * 创建 Fna表单
* *
...@@ -49,6 +57,7 @@ public class ApiFnaFormController { ...@@ -49,6 +57,7 @@ public class ApiFnaFormController {
* @return * @return
*/ */
@PostMapping("/add") @PostMapping("/add")
@Transactional(rollbackFor = Exception.class)
public Result<Map<String, Object>> addFnaForm(@RequestBody FnaFormAddRequest fnaFormAddRequest, HttpServletRequest request) { public Result<Map<String, Object>> addFnaForm(@RequestBody FnaFormAddRequest fnaFormAddRequest, HttpServletRequest request) {
if (fnaFormAddRequest == null) { if (fnaFormAddRequest == null) {
...@@ -63,6 +72,11 @@ public class ApiFnaFormController { ...@@ -63,6 +72,11 @@ public class ApiFnaFormController {
FnaForm fnaForm = fnaFormService.getFnaForm(fnaFormAddRequest); FnaForm fnaForm = fnaFormService.getFnaForm(fnaFormAddRequest);
// 表单状态 // 表单状态
fnaForm.setFnaFormStatus("save".equals(saveType)? "1" : "0"); fnaForm.setFnaFormStatus("save".equals(saveType)? "1" : "0");
// Fna 状态
fnaService.lambdaUpdate()
.set(Fna::getStatus, "save".equals(saveType)? FnaStatusEnum.APPOINTMENT_FILLING.getItemValue() : FnaStatusEnum.FNA_FILLING.getItemValue())
.eq(Fna::getFnaFormBizId, fnaForm.getFnaFormBizId())
.update();
// 获取Security上下文当前用户的登录信息 // 获取Security上下文当前用户的登录信息
AuthUserDto authUserDto = SecurityUtil.getCurrentLoginUser(); AuthUserDto authUserDto = SecurityUtil.getCurrentLoginUser();
...@@ -121,6 +135,7 @@ public class ApiFnaFormController { ...@@ -121,6 +135,7 @@ public class ApiFnaFormController {
*/ */
@PostMapping("/update") @PostMapping("/update")
@Operation(summary = "更新 Fna表单") @Operation(summary = "更新 Fna表单")
@Transactional(rollbackFor = Exception.class)
public Result<Boolean> updateFnaForm(@RequestBody FnaFormUpdateRequest fnaUpdateRequest) { public Result<Boolean> updateFnaForm(@RequestBody FnaFormUpdateRequest fnaUpdateRequest) {
if (fnaUpdateRequest == null || StringUtils.isBlank(fnaUpdateRequest.getFnaFormBizId())) { if (fnaUpdateRequest == null || StringUtils.isBlank(fnaUpdateRequest.getFnaFormBizId())) {
throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), ResultCode.PARAMS_ERROR.getMessage()); throw new BusinessException(ResultCode.PARAMS_ERROR.getCode(), ResultCode.PARAMS_ERROR.getMessage());
...@@ -146,6 +161,13 @@ public class ApiFnaFormController { ...@@ -146,6 +161,13 @@ public class ApiFnaFormController {
if (!result) { if (!result) {
return Result.fail(ResultCode.FAIL.getCode(), ResultCode.FAIL.getMessage()); return Result.fail(ResultCode.FAIL.getCode(), ResultCode.FAIL.getMessage());
} }
// 如果是保存(非暂存),则更新关联的FNA状态为"预约资料填写"
fnaService.lambdaUpdate()
.set(Fna::getStatus, "save".equals(saveType)? FnaStatusEnum.APPOINTMENT_FILLING.getItemValue() : FnaStatusEnum.FNA_FILLING.getItemValue())
.eq(Fna::getFnaFormBizId, fnaForm.getFnaFormBizId())
.update();
return Result.success(true); return Result.success(true);
} }
......
...@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yd.auth.core.dto.AuthUserDto; import com.yd.auth.core.dto.AuthUserDto;
import com.yd.auth.core.utils.SecurityUtil; import com.yd.auth.core.utils.SecurityUtil;
import com.yd.common.enums.CommonEnum; import com.yd.common.enums.CommonEnum;
import com.yd.common.enums.ResultCode;
import com.yd.common.exception.BusinessException; import com.yd.common.exception.BusinessException;
import com.yd.common.result.Result; import com.yd.common.result.Result;
import com.yd.common.utils.RandomStringGenerator; import com.yd.common.utils.RandomStringGenerator;
...@@ -519,12 +520,12 @@ public class ApiPolicyFollowController { ...@@ -519,12 +520,12 @@ public class ApiPolicyFollowController {
public Result<Boolean> changePolicyFollowStatus(@RequestBody ChangePolicyFollowStatusRequest changePolicyFollowStatusRequest, public Result<Boolean> changePolicyFollowStatus(@RequestBody ChangePolicyFollowStatusRequest changePolicyFollowStatusRequest,
HttpServletRequest request) { HttpServletRequest request) {
if (changePolicyFollowStatusRequest == null || StringUtils.isBlank(changePolicyFollowStatusRequest.getPolicyBizId())) { if (changePolicyFollowStatusRequest == null || StringUtils.isBlank(changePolicyFollowStatusRequest.getPolicyBizId())) {
return Result.fail(ErrorCode.PARAMS_ERROR.getCode(), "policyBizId不能为空"); return Result.fail(ResultCode.PARAMS_ERROR.getCode(), "policyBizId不能为空");
} }
String policyBizId = changePolicyFollowStatusRequest.getPolicyBizId(); String policyBizId = changePolicyFollowStatusRequest.getPolicyBizId();
PolicyFollow policyFollow = policyFollowService.getByPolicyBizId(policyBizId); PolicyFollow policyFollow = policyFollowService.getByPolicyBizId(policyBizId);
if (policyFollow == null) { if (policyFollow == null) {
return Result.fail(ErrorCode.NOT_FOUND_ERROR.getCode(), ErrorCode.NOT_FOUND_ERROR.getMessage()); return Result.fail(ResultCode.NULL_ERROR.getCode(), ResultCode.NULL_ERROR.getMessage());
} }
return Result.success(policyFollowService.changePolicyFollowStatus(changePolicyFollowStatusRequest, policyFollow)); return Result.success(policyFollowService.changePolicyFollowStatus(changePolicyFollowStatusRequest, policyFollow));
} }
...@@ -539,7 +540,7 @@ public class ApiPolicyFollowController { ...@@ -539,7 +540,7 @@ public class ApiPolicyFollowController {
@Operation(summary = "新单跟进状态列表查询") @Operation(summary = "新单跟进状态列表查询")
public Result<List<PolicyFollowRecordVO>> getPolicyFollowRecordList(@RequestParam("policyBizId") String policyBizId) { public Result<List<PolicyFollowRecordVO>> getPolicyFollowRecordList(@RequestParam("policyBizId") String policyBizId) {
if (policyBizId == null) { if (policyBizId == null) {
return Result.fail(ErrorCode.PARAMS_ERROR.getCode(), "policyBizId不能为空"); return Result.fail(ResultCode.PARAMS_ERROR.getCode(), "policyBizId不能为空");
} }
QueryWrapper<PolicyFollowRecord> queryWrapper = new QueryWrapper<>(); QueryWrapper<PolicyFollowRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("policy_biz_id", policyBizId); queryWrapper.eq("policy_biz_id", policyBizId);
......
...@@ -18,6 +18,7 @@ import com.yd.csf.feign.request.appointment.*; ...@@ -18,6 +18,7 @@ import com.yd.csf.feign.request.appointment.*;
import com.yd.csf.feign.response.appointment.*; import com.yd.csf.feign.response.appointment.*;
import com.yd.csf.service.dto.PolicySigner; import com.yd.csf.service.dto.PolicySigner;
import com.yd.csf.service.enums.AppointmentStatusEnum; import com.yd.csf.service.enums.AppointmentStatusEnum;
import com.yd.csf.service.enums.FnaStatusEnum;
import com.yd.csf.service.enums.PolicyFollowStatusEnum; import com.yd.csf.service.enums.PolicyFollowStatusEnum;
import com.yd.csf.service.enums.PolicyStatusEnum; import com.yd.csf.service.enums.PolicyStatusEnum;
import com.yd.csf.service.model.*; import com.yd.csf.service.model.*;
...@@ -476,11 +477,28 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -476,11 +477,28 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
updateFnaBizIdAndNo(appointment.getFnaBizId(), appointment.getAppointmentBizId(), appointment.getAppointmentNo()); updateFnaBizIdAndNo(appointment.getFnaBizId(), appointment.getAppointmentBizId(), appointment.getAppointmentNo());
//新增新单跟进记录 //新增新单跟进记录
savePolicyFollow(appointment); savePolicyFollow(appointment);
//更新关联的FNA状态为"待签单"
updateFnaStatusToPendingSignature(appointment.getFnaBizId());
} }
return Result.success(); return Result.success();
} }
/** /**
* 更新关联的FNA状态为"待签单"
* @param fnaBizId FNA业务ID
*/
private void updateFnaStatusToPendingSignature(String fnaBizId) {
if (StringUtils.isBlank(fnaBizId)) {
return;
}
Fna fna = fnaService.queryOne(fnaBizId);
if (fna != null) {
// 更新为"待签单"
fnaService.updateFnaStatus(fnaBizId, FnaStatusEnum.PENDING_SIGNATURE.getItemValue());
}
}
/**
* 编辑预约暂存 (聚合信息编辑预约暂存) * 编辑预约暂存 (聚合信息编辑预约暂存)
* @param request * @param request
* @return * @return
...@@ -616,6 +634,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService { ...@@ -616,6 +634,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
String policyBizId = RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_POLICY.getCode()); String policyBizId = RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_POLICY.getCode());
//新单跟进唯一业务ID //新单跟进唯一业务ID
follow.setPolicyBizId(policyBizId); follow.setPolicyBizId(policyBizId);
follow.setFnaBizId(appointment.getFnaBizId());
follow.setAppointmentBizId(appointment.getAppointmentBizId()); follow.setAppointmentBizId(appointment.getAppointmentBizId());
follow.setAppointmentNo(appointment.getAppointmentNo()); follow.setAppointmentNo(appointment.getAppointmentNo());
//客户信息表唯一业务ID //客户信息表唯一业务ID
......
...@@ -16,6 +16,8 @@ public interface FnaMapper extends BaseMapper<Fna> { ...@@ -16,6 +16,8 @@ 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); int updateCustomerNameByCustomerBizId(@Param("firstNamePinyin") String firstNamePinyin, @Param("customerBizId") String customerBizId);
int updateFnaStatus(@Param("fnaBizId") String fnaBizId, @Param("status") String status);
} }
......
package com.yd.csf.service.enums; package com.yd.csf.service.enums;
/** /**
* fna状态枚举 'DRAFT'-草稿, 'UNCOMPLETED'-未完成, 'COMPLETED'-已完成 * fna状态枚举
* 'FILING'-建档中, 'FNA_FILLING'-FNA填写中, 'APPOINTMENT_FILLING'-预约资料填写,
* 'PENDING_SIGNATURE'-待签单, 'SIGNED_COMPLETED'-签单完成, 'CANCELLED'-已作废
*/ */
public enum FnaStatusEnum { public enum FnaStatusEnum {
DRAFT("草稿", "DRAFT"), FILING("建档中", "FILING"),
UNCOMPLETED("未完成", "UNCOMPLETED"), FNA_FILLING("FNA填写中", "FNA_FILLING"),
COMPLETED("已完成", "COMPLETED"), APPOINTMENT_FILLING("预约资料填写", "APPOINTMENT_FILLING"),
PENDING_SIGNATURE("待签单", "PENDING_SIGNATURE"),
SIGNED_COMPLETED("签单完成", "SIGNED_COMPLETED"),
CANCELLED("已作废", "CANCELLED"),
; ;
//字典项标签(名称) //字典项标签(名称)
private String itemLabel; private String itemLabel;
......
...@@ -36,6 +36,11 @@ public class PolicyFollow implements Serializable { ...@@ -36,6 +36,11 @@ public class PolicyFollow implements Serializable {
private String policyNo; private String policyNo;
/** /**
* FNA 业务ID
*/
private String fnaBizId;
/**
* 预约信息主表唯一业务ID * 预约信息主表唯一业务ID
*/ */
private String appointmentBizId; private String appointmentBizId;
......
...@@ -55,4 +55,12 @@ public interface FnaService extends IService<Fna> { ...@@ -55,4 +55,12 @@ public interface FnaService extends IService<Fna> {
Map<String, Object> copyFna(FnaCopyRequest fnaCopyRequest); Map<String, Object> copyFna(FnaCopyRequest fnaCopyRequest);
int updateCustomerNameByCustomerBizId(String firstNamePinyin, String customerBizId); int updateCustomerNameByCustomerBizId(String firstNamePinyin, String customerBizId);
/**
* 根据fnaBizId更新FNA状态
* @param fnaBizId FNA业务ID
* @param status 新状态
* @return 更新行数
*/
int updateFnaStatus(String fnaBizId, String status);
} }
...@@ -70,7 +70,7 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe ...@@ -70,7 +70,7 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe
fna.setFnaBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_FNA.getCode())); fna.setFnaBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_FNA.getCode()));
fna.setCreatorId(userBizId); fna.setCreatorId(userBizId);
fna.setUpdaterId(userBizId); fna.setUpdaterId(userBizId);
fna.setStatus(FnaStatusEnum.UNCOMPLETED.getItemValue()); fna.setStatus(FnaStatusEnum.FILING.getItemValue());
Date date = new Date(); Date date = new Date();
fna.setCreateTime(date); fna.setCreateTime(date);
...@@ -137,9 +137,9 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe ...@@ -137,9 +137,9 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe
queryWrapper.eq(StringUtils.isNotBlank(fnaBizId), "fna_biz_id", fnaBizId); queryWrapper.eq(StringUtils.isNotBlank(fnaBizId), "fna_biz_id", fnaBizId);
// 流程编号 // 流程编号
queryWrapper.like(StringUtils.isNotBlank(fnaNo), "fna_no", fnaNo); queryWrapper.like(StringUtils.isNotBlank(fnaNo), "fna_no", fnaNo);
// 状态 'DRAFT'-草稿, 'UNCOMPLETED'-未完成, 'COMPLETED'-已完成,默认查询未完成和已完成 // 状态 - 默认查询除已作废外的所有状态
if (StringUtils.isBlank(status)) { if (StringUtils.isBlank(status)) {
queryWrapper.in("status", "UNCOMPLETED", "COMPLETED"); queryWrapper.in("status", "FILING", "FNA_FILLING", "APPOINTMENT_FILLING", "PENDING_SIGNATURE", "SIGNED_COMPLETED");
} else { } else {
queryWrapper.eq("status", status); queryWrapper.eq("status", status);
} }
...@@ -291,17 +291,6 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe ...@@ -291,17 +291,6 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe
Customer customer = customerService.getByCustomerBizId(fnaUpdateRequest.getCustomerBizId()); Customer customer = customerService.getByCustomerBizId(fnaUpdateRequest.getCustomerBizId());
fna.setCustomerName(customer.getNamePyEn()); fna.setCustomerName(customer.getNamePyEn());
} }
// 设置 状态
String customerBizId = fnaUpdateRequest.getCustomerBizId();
String fnaFormBizId = fnaUpdateRequest.getFnaFormBizId();
if (StringUtils.isNotBlank(customerBizId) || StringUtils.isNotBlank(fnaFormBizId) || StringUtils.isBlank(appointmentNo) ) {
fna.setStatus(FnaStatusEnum.UNCOMPLETED.getItemValue());
}
if (StringUtils.isNotBlank(customerBizId) && StringUtils.isNotBlank(fnaFormBizId) && StringUtils.isBlank(appointmentNo)) {
fna.setStatus(FnaStatusEnum.COMPLETED.getItemValue());
}
// 操作数据库 // 操作数据库
fna.setAppointmentNo(appointmentNo); fna.setAppointmentNo(appointmentNo);
...@@ -331,7 +320,7 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe ...@@ -331,7 +320,7 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe
newFna.setFnaBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_FNA.getCode())); newFna.setFnaBizId(RandomStringGenerator.generateBizId16(CommonEnum.UID_TYPE_FNA.getCode()));
newFna.setCreatorId(userBizId); newFna.setCreatorId(userBizId);
newFna.setUpdaterId(userBizId); newFna.setUpdaterId(userBizId);
newFna.setStatus(FnaStatusEnum.UNCOMPLETED.getItemValue()); newFna.setStatus(FnaStatusEnum.FILING.getItemValue());
Date date = new Date(); Date date = new Date();
newFna.setCreateTime(date); newFna.setCreateTime(date);
...@@ -389,4 +378,9 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe ...@@ -389,4 +378,9 @@ public class FnaServiceImpl extends ServiceImpl<FnaMapper, Fna> implements FnaSe
return newFnaForm.getFnaFormBizId(); return newFnaForm.getFnaFormBizId();
} }
@Override
public int updateFnaStatus(String fnaBizId, String status) {
return baseMapper.updateFnaStatus(fnaBizId, status);
}
} }
...@@ -16,6 +16,7 @@ import com.yd.common.exception.BusinessException; ...@@ -16,6 +16,7 @@ import com.yd.common.exception.BusinessException;
import com.yd.common.utils.RandomStringGenerator; import com.yd.common.utils.RandomStringGenerator;
import com.yd.csf.service.common.ErrorCode; import com.yd.csf.service.common.ErrorCode;
import com.yd.csf.service.dto.*; import com.yd.csf.service.dto.*;
import com.yd.csf.service.enums.FnaStatusEnum;
import com.yd.csf.service.enums.PolicyFollowStatusEnum; import com.yd.csf.service.enums.PolicyFollowStatusEnum;
import com.yd.csf.service.model.*; import com.yd.csf.service.model.*;
import com.yd.csf.service.service.*; import com.yd.csf.service.service.*;
...@@ -74,6 +75,10 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -74,6 +75,10 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
private IExpectedFortuneService expectedFortuneService; private IExpectedFortuneService expectedFortuneService;
@Autowired @Autowired
private CommissionExpectedService commissionExpectedService; private CommissionExpectedService commissionExpectedService;
@Resource
private IAppointmentService appointmentService;
@Resource
private FnaService fnaService;
@Override @Override
public PolicyFollow getByPolicyBizId(String policyBizId) { public PolicyFollow getByPolicyBizId(String policyBizId) {
...@@ -184,6 +189,11 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -184,6 +189,11 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
// 复制属性,排除系统字段 // 复制属性,排除系统字段
BeanUtils.copyProperties(policyFollowDto, policyFollow, "id", "policyBizId", "brokerList", "signerList"); BeanUtils.copyProperties(policyFollowDto, policyFollow, "id", "policyBizId", "brokerList", "signerList");
// 检查保单号是否从空变为有值
String oldPolicyNo = policyFollow.getPolicyNo();
String newPolicyNo = policyFollowDto.getPolicyNo();
boolean isPolicyNoUpdated = StringUtils.isBlank(oldPolicyNo) && StringUtils.isNotBlank(newPolicyNo);
// 计算冷却期结束日期 // 计算冷却期结束日期
if (policyFollowDto.getCoolingOffDays() != null && policyFollowDto.getEffectiveDate() != null) { if (policyFollowDto.getCoolingOffDays() != null && policyFollowDto.getEffectiveDate() != null) {
policyFollow.setCoolingOffEndDate(DateUtil.offset(policyFollowDto.getEffectiveDate(), DateField.DAY_OF_MONTH, policyFollowDto.getCoolingOffDays())); policyFollow.setCoolingOffEndDate(DateUtil.offset(policyFollowDto.getEffectiveDate(), DateField.DAY_OF_MONTH, policyFollowDto.getCoolingOffDays()));
...@@ -197,6 +207,13 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol ...@@ -197,6 +207,13 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
boolean result = updateById(policyFollow); boolean result = updateById(policyFollow);
// 如果保单号从空变为有值,更新关联的FNA状态为"签单完成"
if (isPolicyNoUpdated && result) {
fnaService.lambdaUpdate()
.eq(Fna::getFnaBizId, policyFollow.getFnaBizId())
.set(Fna::getStatus, FnaStatusEnum.SIGNED_COMPLETED.getItemValue())
.update();
}
return result; return result;
} }
......
package com.yd.csf.service.vo; package com.yd.csf.service.vo;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yd.csf.service.enums.PolicyFollowStatusEnum; import com.yd.csf.service.enums.PolicyFollowStatusEnum;
import com.yd.csf.service.model.PolicyBroker; import com.yd.csf.service.model.PolicyBroker;
import com.yd.csf.service.model.PolicyFollow; import com.yd.csf.service.model.PolicyFollow;
...@@ -37,6 +38,12 @@ public class PolicyFollowDetailVO implements Serializable { ...@@ -37,6 +38,12 @@ public class PolicyFollowDetailVO implements Serializable {
private String policyNo; private String policyNo;
/** /**
* 流程业务ID
*/
@Schema(description = "流程业务ID")
private String fnaBizId;
/**
* 预约信息主表唯一业务ID * 预约信息主表唯一业务ID
*/ */
@Schema(description = "预约信息主表唯一业务ID") @Schema(description = "预约信息主表唯一业务ID")
...@@ -58,6 +65,7 @@ public class PolicyFollowDetailVO implements Serializable { ...@@ -58,6 +65,7 @@ public class PolicyFollowDetailVO implements Serializable {
* 递交日期 * 递交日期
*/ */
@Schema(description = "递交日期") @Schema(description = "递交日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date submitDate; private Date submitDate;
/** /**
...@@ -70,6 +78,7 @@ public class PolicyFollowDetailVO implements Serializable { ...@@ -70,6 +78,7 @@ public class PolicyFollowDetailVO implements Serializable {
* 签单日期 * 签单日期
*/ */
@Schema(description = "签单日期") @Schema(description = "签单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date signDate; private Date signDate;
/** /**
...@@ -100,12 +109,14 @@ public class PolicyFollowDetailVO implements Serializable { ...@@ -100,12 +109,14 @@ public class PolicyFollowDetailVO implements Serializable {
* 缮发日期 * 缮发日期
*/ */
@Schema(description = "缮发日期") @Schema(description = "缮发日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date issueDate; private Date issueDate;
/** /**
* 冷静期结束日期 * 冷静期结束日期
*/ */
@Schema(description = "冷静期结束日期") @Schema(description = "冷静期结束日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date coolingOffEndDate; private Date coolingOffEndDate;
/** /**
...@@ -118,24 +129,28 @@ public class PolicyFollowDetailVO implements Serializable { ...@@ -118,24 +129,28 @@ public class PolicyFollowDetailVO implements Serializable {
* 核保日期 * 核保日期
*/ */
@Schema(description = "核保日期") @Schema(description = "核保日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date underwritingDate; private Date underwritingDate;
/** /**
* 生效日期 * 生效日期
*/ */
@Schema(description = "生效日期") @Schema(description = "生效日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date effectiveDate; private Date effectiveDate;
/** /**
* 续保日期 * 续保日期
*/ */
@Schema(description = "续保日期") @Schema(description = "续保日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date renewalDate; private Date renewalDate;
/** /**
* 保单回执日期 * 保单回执日期
*/ */
@Schema(description = "保单回执日期") @Schema(description = "保单回执日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date receiptDate; private Date receiptDate;
/** /**
...@@ -196,6 +211,7 @@ public class PolicyFollowDetailVO implements Serializable { ...@@ -196,6 +211,7 @@ public class PolicyFollowDetailVO implements Serializable {
* 回溯日期 * 回溯日期
*/ */
@Schema(description = "回溯日期") @Schema(description = "回溯日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date retroactiveDate; private Date retroactiveDate;
/** /**
...@@ -220,6 +236,7 @@ public class PolicyFollowDetailVO implements Serializable { ...@@ -220,6 +236,7 @@ public class PolicyFollowDetailVO implements Serializable {
* 保单截止日期 * 保单截止日期
*/ */
@Schema(description = "保单截止日期") @Schema(description = "保单截止日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date policyExpirationDate; private Date policyExpirationDate;
/** /**
...@@ -394,24 +411,28 @@ public class PolicyFollowDetailVO implements Serializable { ...@@ -394,24 +411,28 @@ public class PolicyFollowDetailVO implements Serializable {
* 最晚缴费日期 * 最晚缴费日期
*/ */
@Schema(description = "最晚缴费日期") @Schema(description = "最晚缴费日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date latestPaymentDate; private Date latestPaymentDate;
/** /**
* 经纪公司签收日期 * 经纪公司签收日期
*/ */
@Schema(description = "经纪公司签收日期") @Schema(description = "经纪公司签收日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date brokerSignDate; private Date brokerSignDate;
/** /**
* 保险公司寄出日期 * 保险公司寄出日期
*/ */
@Schema(description = "保险公司寄出日期") @Schema(description = "保险公司寄出日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date insurerMailingDate; private Date insurerMailingDate;
/** /**
* 客户签收日期 * 客户签收日期
*/ */
@Schema(description = "客户签收日期") @Schema(description = "客户签收日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date customerSignDate; private Date customerSignDate;
/** /**
......
...@@ -45,4 +45,8 @@ ...@@ -45,4 +45,8 @@
<update id="updateCustomerNameByCustomerBizId"> <update id="updateCustomerNameByCustomerBizId">
update fna set customer_name = #{firstNamePinyin} where customer_biz_id = #{customerBizId} update fna set customer_name = #{firstNamePinyin} where customer_biz_id = #{customerBizId}
</update> </update>
<update id="updateFnaStatus">
update fna set status = #{status} where fna_biz_id = #{fnaBizId}
</update>
</mapper> </mapper>
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<id property="id" column="id" /> <id property="id" column="id" />
<result property="policyBizId" column="policy_biz_id" /> <result property="policyBizId" column="policy_biz_id" />
<result property="policyNo" column="policy_no" /> <result property="policyNo" column="policy_no" />
<result property="fnaBizId" column="fna_biz_id" />
<result property="appointmentBizId" column="appointment_biz_id" /> <result property="appointmentBizId" column="appointment_biz_id" />
<result property="appointmentNo" column="appointment_no" /> <result property="appointmentNo" column="appointment_no" />
<result property="customerBizId" column="customer_biz_id" /> <result property="customerBizId" column="customer_biz_id" />
...@@ -81,7 +82,7 @@ ...@@ -81,7 +82,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,policy_biz_id,policy_no,appointment_biz_id,appointment_no,customer_biz_id, id,policy_biz_id,policy_no,fna_biz_id,appointment_biz_id,appointment_no,customer_biz_id,
submit_date,customer_name,sign_date,signer,signer_biz_id, submit_date,customer_name,sign_date,signer,signer_biz_id,
signer_reg_no,sign_location,issue_date,cooling_off_end_date,cooling_off_days, signer_reg_no,sign_location,issue_date,cooling_off_end_date,cooling_off_days,
underwriting_date,effective_date,renewal_date,receipt_date,receipt_status, underwriting_date,effective_date,renewal_date,receipt_date,receipt_status,
......
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