Commit 3321b553 authored by hongguangwu's avatar hongguangwu

MVP1.7.17-商险续签待办3

parent e139adaf
......@@ -119,4 +119,11 @@ public class TAutoMainRel extends BaseEntity {
@TableField(exist = false)
private String csUserName;
/**
* 前端客服——登录名——商险续签专用
*/
@Schema(description = "前端客服登录名")
@TableField(exist = false)
private String csLoginName;
}
......@@ -40,6 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.AutoDeptDetailVO;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.AutoDeptVO;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
......@@ -1526,18 +1527,23 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
**/
@Override
public AutoDeptVO getAutoDeptMap() {
Map<String, Integer> returnMap = new HashMap<>();
Map<String, AutoDeptDetailVO> returnMap = new HashMap<>();
List<TAutoMainRel> list = baseMapper.getAutoDeptMap();
if(Common.isNotNull(list)) {
AutoDeptDetailVO detailVO;
Integer month;
for(TAutoMainRel vo :list) {
detailVO = new AutoDeptDetailVO();
try {
month = Integer.parseInt(vo.getId());
} catch (Exception e) {
month = CommonConstants.ONE_INT;
log.info("转化周期失败,默认1月: {}", e);
}
returnMap.put(vo.getDeptNo(), month);
detailVO.setNum( month);
detailVO.setCustomerUsername(vo.getCsUserName());
detailVO.setCustomerUserLoginame(vo.getCsLoginName());
returnMap.put(vo.getDeptNo(), detailVO);
}
}
AutoDeptVO returnVo = new AutoDeptVO();
......
......@@ -123,9 +123,10 @@
<!-- 获取全量自动化项目与商险续保周期 -->
<select id="getAutoDeptMap" resultType="com.yifu.cloud.plus.v1.yifu.archives.entity.TAutoMainRel">
SELECT
ifnull(r.RENEWAL_PERIOD,1) ID,d.DEPT_NO
ifnull(r.RENEWAL_PERIOD,1) id,d.DEPT_NO deptNo,IFNULL(b.cs_name,'') csUserName,IFNULL(b.cs_login_name,'') csLoginName
FROM t_auto_main_rel d
left join t_auto_insur_rule_info r on r.MAIN_ID=d.id
left join t_settle_domain b on d.DEPT_ID = b.id
</select>
......
......@@ -341,4 +341,14 @@ public class TInsurancePreRenewDetail extends BaseEntity {
@Schema(description = "状态,0待确认,1待派单,2派单失败,3待投保,4投保中,5投保退回,6已投保")
private String processStatus;
@Schema(description = "前端客服")
private String customerUsername;
@Schema(description = "前端客服登录名")
private String customerUserLoginname;
// 是否离职确认:0否1是,1时,消失。
@Schema(description = "是否离职确认:0否1是,1时,消失。")
private String isLeave;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
/**
* @Description: 自动化项目Map
* @Author: hgw
* @Date: 2025-11-12 18:01:49
* @return:
**/
@Data
public class AutoDeptDetailVO implements Serializable {
private static final long serialVersionUID = -6673220061558171816L;
// 自动化项目Map,value是续保周期,默认1个月
private Integer num;
@Schema(description = "前端客服")
private String customerUsername;
@Schema(description = "前端客服登录名")
private String customerUserLoginame;
}
......@@ -16,6 +16,6 @@ public class AutoDeptVO implements Serializable {
private static final long serialVersionUID = -6673220061558171816L;
// 自动化项目Map,value是续保周期,默认1个月
private Map<String, Integer> deptMap;
private Map<String, AutoDeptDetailVO> deptMap;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.Data;
/**
* 新-商险续签待办导出
*
* @author hgw
* @date 2025-11-14 17:49:45
*/
@Data
@ColumnWidth(10)
public class TInsuranceAlertExportVO extends BaseEntity {
private static final long serialVersionUID = 1L;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "项目名称")
private String deptName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "项目编码")
private String deptNo;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工姓名")
private String empName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "身份证号")
private String empIdcardNo;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "购买地")
private String insuranceCityName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "办理地")
private String insuranceHandleCityName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保险公司")
private String insuranceCompanyName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "险种")
private String insuranceTypeName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "生效时间")
private String policyEffect;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单起止日期")
private String policyStart;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "到期状态")
private String isOverdue;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "距离到期剩余工作日")
private String haveWorkDay;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "是否忽略")
private String expireIgnoreFlag;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "派单申请人")
private String createName;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "到期提醒人")
private String alerter;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "预计续保发起时间")
private String expectedCollectionTime;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "状态")
private String processStatus;
}
......@@ -16,11 +16,13 @@
*/
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDate;
import java.util.List;
/**
* 商险到期提醒明细表
......@@ -37,6 +39,26 @@ public class TInsuranceAlertSearchVo extends TInsuranceAlert {
@Schema(description = "选中ID,多个逗号分割")
private String ids;
private List<String> idList;
@Schema(description = "项目权限数组")
@TableField(exist = false)
private List<String> deptNoList;
@Schema(description = "保单结束时间起")
private LocalDate policyEndStart;
@Schema(description = "保单结束时间止")
private LocalDate policyEndEnd;
@Schema(description = "状态多个")
@TableField(exist = false)
private String[] processStatusArray;
/**
* @Author fxj
* 导出选择的ID
**/
private String idStr;
/**
* @Author fxj
* 查询数据起
......
......@@ -3,16 +3,21 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceWarnService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.BatchIgnoreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAlertSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -43,12 +48,29 @@ public class TInsurancesWarnController {
@Resource
private TInsuranceWarnService insuranceWarnService;
private final MenuUtil menuUtil;
@Operation(description = "商险待续保列表查询")
@GetMapping("/getTInsuranceAlertPage")
public R<IPage<TInsuranceAlert>> getTInsuranceAlertPage(Page<TInsuranceAlert> page, InsuranceSearchVo tInsuranceAlert) {
public R<IPage<TInsuranceAlert>> getTInsuranceAlertPage(Page<TInsuranceAlert> page, TInsuranceAlertSearchVo tInsuranceAlert) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tInsuranceAlert);
return R.ok(insuranceWarnService.getTInsuranceAlertPage(page, tInsuranceAlert));
}
@Operation(summary = "商险待续保导出", description = "商险待续保导出")
@SysLog("商险待续保导出")
@PostMapping("/exportTInsuranceAlert")
public void exportTInsuranceAlert(@RequestBody(required = false) TInsuranceAlertSearchVo searchVo,
HttpServletResponse response) {
if (Common.isEmpty(searchVo)) {
searchVo = new TInsuranceAlertSearchVo();
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
insuranceWarnService.exportTInsuranceAlert(searchVo, response);
}
/**
* @Author fxj
* @Description 商险到期提醒分页查询
......
......@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAlertWx;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAlertExportVO;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAlertSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -20,7 +22,11 @@ import java.util.List;
@Mapper
public interface TInsuranceWarnMapper extends BaseMapper<TInsuranceAlert> {
IPage<TInsuranceAlert> getTInsuranceAlertPage(Page<TInsuranceAlert> page, @Param("tInsuranceAlert") InsuranceSearchVo tInsuranceAlert);
IPage<TInsuranceAlert> getTInsuranceAlertPage(Page<TInsuranceAlert> page, @Param("tInsuranceAlert") TInsuranceAlertSearchVo tInsuranceAlert);
int getTInsuranceAlertExportCount(@Param("tInsuranceAlert") TInsuranceAlertSearchVo tInsuranceAlert);
List<TInsuranceAlertExportVO> getTInsuranceAlertExport(@Param("tInsuranceAlert") TInsuranceAlertSearchVo tInsuranceAlert);
/**
* 查询商险到期提醒信息
......
......@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAlertSearchVo;
import javax.servlet.http.HttpServletResponse;
/**
* @author huych
......@@ -14,7 +17,10 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceSearchVo;
*/
public interface TInsuranceWarnService extends IService<TInsuranceAlert> {
IPage<TInsuranceAlert> getTInsuranceAlertPage(Page<TInsuranceAlert> page, InsuranceSearchVo tInsuranceAlert);
IPage<TInsuranceAlert> getTInsuranceAlertPage(Page<TInsuranceAlert> page, TInsuranceAlertSearchVo tInsuranceAlert);
// 商险待续保导出
void exportTInsuranceAlert(TInsuranceAlertSearchVo searchVo, HttpServletResponse response);
void createInsuranceAlert();
......
......@@ -84,6 +84,9 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Autowired
private TEmployeeInsurancePreQwDetailService tEmployeeInsurancePreQwDetailService;
@Autowired
private TInsurancePreRenewDetailService tInsurancePreRenewDetailService;
/**
* 商险待办任务表简单分页查询
*
......@@ -707,6 +710,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
.set(TEmployeeInsurancePre::getCustomerUsername, updateVo.getCustomerUserName())
.set(TEmployeeInsurancePre::getCustomerUserLoginname, updateVo.getCustomerUserLoginName());
this.update(updateWrapper);
// 更新商险续签待办的前端客服
LambdaUpdateWrapper<TInsurancePreRenewDetail> updateWrapper2 = new LambdaUpdateWrapper<>();
updateWrapper2.eq(TInsurancePreRenewDetail::getDeptNo, updateVo.getDeptNo())
.set(TInsurancePreRenewDetail::getCustomerUsername, updateVo.getCustomerUserName())
.set(TInsurancePreRenewDetail::getCustomerUserLoginname, updateVo.getCustomerUserLoginName());
tInsurancePreRenewDetailService.update(updateWrapper2);
}
}
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUsersVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportAuditVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.log.util.SysLogUtils;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.SysConfig;
......@@ -35,8 +41,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -63,10 +72,98 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
private WxConfig wxConfig;
@Override
public IPage<TInsuranceAlert> getTInsuranceAlertPage(Page<TInsuranceAlert> page, InsuranceSearchVo tInsuranceAlert) {
public IPage<TInsuranceAlert> getTInsuranceAlertPage(Page<TInsuranceAlert> page, TInsuranceAlertSearchVo tInsuranceAlert) {
//权限赋值
initSearchVo(tInsuranceAlert);
return baseMapper.getTInsuranceAlertPage(page, tInsuranceAlert);
}
@Override
public void exportTInsuranceAlert(TInsuranceAlertSearchVo searchVo, HttpServletResponse response) {
String fileName = "商险待续保导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TInsuranceAlertExportVO> list = null;
//获取要导出的列表
if (Common.isNotNull(searchVo.getIdStr())) {
searchVo.setIdList(Common.getList(searchVo.getIdStr()));
}
//权限赋值
initSearchVo(searchVo);
long count = baseMapper.getTInsuranceAlertExportCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcelFactory.write(out, EmployeeContractExportAuditVO.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTInsuranceAlertExport(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("商险待续保" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("商险待续保导出" + index).build();
excelWriter.write(list, writeSheet);
}
if (list != null && !list.isEmpty()) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
public void initSearchVo(TInsuranceAlertSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId);
if (isSsc || CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
searchVo.setAuthSql(null);
return;
}
//if (Common.isNotNull(searchVo.getType()) && CommonConstants.ONE_STRING.equals(searchVo.getType())) {
searchVo.setAuthSql(null);
//获取项目信息
R<TSettleDomainRegistListVo> domainR = archivesDaprUtil.getAllDeptByCustomerLoginName(user.getUsername());
if (null != domainR && null != domainR.getData() && null != domainR.getData().getDeptNos() && !domainR.getData().getDeptNos().isEmpty()) {
searchVo.setDeptNoList(domainR.getData().getDeptNos());
} else {
searchVo.setId(CommonConstants.ONE_STRING_NEGATE);
}
//}
}
public boolean haveRole(YifuUser user, long roleId) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) {
if (role == roleId) {
return true;
}
}
return false;
}
@Override
public void createInsuranceAlert() {
//批量删除所有未忽略的提醒数据
......@@ -136,7 +233,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
String days;
Integer dayInt;
//获取自动化项目Map,后面放周期,默认1个月
Map<String, Integer> deptMap = new HashMap<>();
Map<String, AutoDeptDetailVO> deptMap = new HashMap<>();
// 获取全量自动化项目,value里是续保周期
R<AutoDeptVO> deptMapR = archivesDaprUtil.getAutoDeptVO();
if (null != deptMapR && Common.isNotNull(deptMapR.getData()) && Common.isNotNull(deptMapR.getData().getDeptMap())) {
......@@ -195,7 +292,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
// 设置续签待办数据
private void setRenewDetailBaseInfo(TInsuranceAlert vo, String renewId, List<TInsurancePreRenewDetail> detailList
, Map<String, Integer> holidayMap, Map<String, Integer> deptMap) {
, Map<String, Integer> holidayMap, Map<String, AutoDeptDetailVO> deptMap) {
TInsurancePreRenewDetail detail = new TInsurancePreRenewDetail();
detail.setId(renewId);
detail.setInsurancesId(vo.getId());
......@@ -220,6 +317,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
detail.setBuyStandard(vo.getBuyStandard());
detail.setInsuranceProvinceName(vo.getInsuranceProvinceName());
detail.setInsuranceCityName(vo.getInsuranceCityName());
AutoDeptDetailVO detailVO = deptMap.get(vo.getDeptNo());
// 预计派单时间
if (Common.isNotNull(vo.getPolicyEnd())) {
LocalDate days = calculateThreeWorkDays(vo.getPolicyEnd(), holidayMap);
......@@ -228,7 +326,10 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
detail.setExpectedCollectionTime(days.atTime(15, 20));
detail.setPolicyStart(days.plusDays(CommonConstants.ONE_INT));
detail.setPolicyEffect(detail.getPolicyStart());
Integer month = deptMap.get(vo.getDeptNo());
Integer month = CommonConstants.ONE_INT;
if (detailVO != null && Common.isNotNull(detailVO.getNum())) {
month = detailVO.getNum();
}
if (Common.isEmpty(month)) {
month = CommonConstants.ONE_INT;
}
......@@ -238,6 +339,10 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
detail.setConfirmDate(days);
}
}
if (detailVO != null) {
detail.setCustomerUsername(detailVO.getCustomerUsername());
detail.setCustomerUserLoginname(detailVO.getCustomerUserLoginame());
}
detail.setUnitName(vo.getUnitName());
detail.setUnitNo(vo.getUnitNo());
detail.setIsAddress(vo.getIsAddress());
......@@ -247,19 +352,13 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
detailList.add(detail);
}
// 保单截止日期,如果是1号:加一月减一天,如果不是1号:减一天加一月
// 保单截止日期,如果是1号:加一月减一天,如果不是1号:减一天加一月——不用这个逻辑了,倩倩与业务沟通后,统一:加月-1天
private LocalDate doPolicyEnd(LocalDate policyStart, Integer month) {
if (policyStart.getDayOfMonth() == CommonConstants.ONE_INT) {
// 如果是1号:加一月减一天
return policyStart
.plusMonths(month)
.minusDays(CommonConstants.ONE_INT);
} else {
// 如果不是1号:减一天加一月
return policyStart
.minusDays(CommonConstants.ONE_INT)
.plusMonths(month);
}
// 2025-11-14 09:46:13 倩倩:统一为:加一月减一天
return policyStart
.plusMonths(month)
.minusDays(CommonConstants.ONE_INT);
}
// 保单截止日期B + 1天,向之前推3个工作日。得到预计派单日期
......
......@@ -67,6 +67,7 @@
<result property="replaceDeptNo" column="replace_dept_no"/>
<result property="processStatus" column="process_status"/>
<result property="confirmDate" column="confirm_date"/>
<result property="isLeave" column="is_leave"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -111,7 +112,8 @@
a.replace_emp_idcard,
a.replace_dept_no,
a.process_status,
a.confirm_date
a.confirm_date,
a.is_leave
</sql>
<sql id="tInsurancePreRenewDetail_where">
<if test="tInsurancePreRenewDetail != null">
......
......@@ -100,7 +100,7 @@
a.ALERTER,
a.ALERT_ID,
a.HAVE_WORK_DAY,
a.INSURANCES_ID,
a.INSURANCES_PRE_RENEW_DETAIL_ID,
b.process_status,
b.error_info,
b.error_time
......@@ -110,6 +110,12 @@
<if test="tInsuranceAlert.id != null and tInsuranceAlert.id.trim() != ''">
AND a.ID = #{tInsuranceAlert.id}
</if>
<if test="tInsuranceAlert.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="tInsuranceAlert.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tInsuranceAlert.empName != null and tInsuranceAlert.empName.trim() != ''">
AND a.EMP_NAME like concat('%', #{tInsuranceAlert.empName}, '%')
</if>
......@@ -239,6 +245,13 @@
<if test="tInsuranceAlert.haveWorkDay != null and tInsuranceAlert.haveWorkDay.trim() != ''">
AND a.HAVE_WORK_DAY = #{tInsuranceAlert.haveWorkDay}
</if>
<if test="tInsuranceAlert.deptNoList != null and tInsuranceAlert.deptNoList.size > 0">
AND a.DEPT_NO in
<foreach item="idStr" index="index" collection="tInsuranceAlert.deptNoList" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
</if>
</sql>
<!--tInsuranceAlert简单分页查询-->
......@@ -246,11 +259,32 @@
SELECT
<include refid="Alert_Column_List"/>
FROM t_insurance_alert a
LEFT JOIN t_insurance_pre_renew_detail b ON a.ID = b.INSURANCES_ID
JOIN t_insurance_pre_renew_detail b ON a.INSURANCES_PRE_RENEW_DETAIL_ID = b.ID
<where>
1=1
a.EXPIRE_IGNORE_FLAG = '1' and a.DELETE_FLAG=0 and b.is_leave = '0' and a.IS_OVERDUE = 0
<include refid="tInsuranceAlert_where"/>
<if test="tInsuranceAlert != null">
<if test="tInsuranceAlert.processStatusArray != null and tInsuranceAlert.processStatusArray.length > 0">
AND b.PROCESS_STATUS in
<foreach item="statusStr" index="index" collection="tInsuranceAlert.processStatusArray" open="("
separator="," close=")">
#{statusStr}
</foreach>
</if>
</if>
</where>
order by a.POLICY_END asc,a.id asc
</select>
<!-- 导出 -->
<select id="getTInsuranceAlertExportCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_insurance_alert a
JOIN t_insurance_pre_renew_detail b ON a.INSURANCES_PRE_RENEW_DETAIL_ID = b.ID
<where>
a.EXPIRE_IGNORE_FLAG = '1' and a.DELETE_FLAG=0 and b.is_leave = '0' and a.IS_OVERDUE = 0
<include refid="tInsuranceAlert_where"/>
<if test="tInsuranceAlert != null">
<if test="tInsuranceAlert.processStatusArray != null and tInsuranceAlert.processStatusArray.length > 0">
AND b.PROCESS_STATUS in
......@@ -260,8 +294,40 @@
</foreach>
</if>
</if>
</where>
</select>
<!-- 导出 -->
<select id="getTInsuranceAlertExport" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAlertExportVO">
SELECT
a.DEPT_NAME,a.DEPT_NO,a.EMP_NAME,a.EMP_IDCARD_NO,a.INSURANCE_CITY_NAME,a.INSURANCE_HANDLE_CITY_NAME
,a.INSURANCE_COMPANY_NAME,a.INSURANCE_TYPE_NAME,DATE_FORMAT(a.POLICY_EFFECT,'%Y-%m-%d') POLICY_EFFECT
,concat(DATE_FORMAT(a.POLICY_START,'%Y-%m-%d'),'-',DATE_FORMAT(a.POLICY_END,'%Y-%m-%d')) POLICY_START
,'临期' isOverdue,a.HAVE_WORK_DAY,'否' EXPIRE_IGNORE_FLAG,a.CREATE_NAME,a.ALERTER
,DATE_FORMAT(b.expected_collection_time,'%Y-%m-%d %H:%i') expected_collection_time
,case b.process_status when '0' then '待确认' when '1' then '待派单' when '2' then '派单失败'
when '3' then '待投保' when '4' then '投保中' when '5' then '投保退回' when '6' then '已投保' else '-' end process_status
FROM t_insurance_alert a
JOIN t_insurance_pre_renew_detail b ON a.INSURANCES_PRE_RENEW_DETAIL_ID = b.ID
<where>
a.EXPIRE_IGNORE_FLAG = '1' and a.DELETE_FLAG=0 and b.is_leave = '0' and a.IS_OVERDUE = 0
<include refid="tInsuranceAlert_where"/>
<if test="tInsuranceAlert != null">
<if test="tInsuranceAlert.processStatusArray != null and tInsuranceAlert.processStatusArray.length > 0">
AND b.PROCESS_STATUS in
<foreach item="statusStr" index="index" collection="tInsuranceAlert.processStatusArray" open="("
separator="," close=")">
#{statusStr}
</foreach>
</if>
</if>
</where>
order by a.POLICY_END asc,a.id asc
<if test="tInsuranceAlert != null">
<if test="tInsuranceAlert.limitStart != null">
limit #{tInsuranceAlert.limitStart},#{tInsuranceAlert.limitEnd}
</if>
</if>
</select>
<select id="selectInsuranceAlert" resultMap="BaseResultMap">
......
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