Commit 98cc04bd authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.5.3' into MVP1.5.3

parents b2cab12b 0e84ec90
......@@ -151,4 +151,7 @@ public interface CacheConstants {
String PAYMENT_DISPATCH_BATCH_REDUCE_IMPORT = "payment_dispatch_batch_reduce_import";
String PAYMENT_PRE_DISPATCH_BATCH_ADD_IMPORT = "payment_pre_dispatch_batch_add_import";
//社保公积金派单
String PAYMENT_DISPATCH_BATCH_IMPORT = "payment_dispatch_batch_import";
}
......@@ -351,6 +351,8 @@ public interface CommonConstants {
// 给量大的表导出使用
int EXCEL_EXPORT_LIMIT_3 = 30000;
int EXCEL_EXPORT_LIMIT_1 = 10000;
String USER = "用户";
/**
......
insurance.insuranceUrl=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
#insurance.insuranceUrl=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
#insurance.insuranceUrl=http://192.168.0.228:8080/api/sys-modeling/appModelRestService/addModel
insurance.insuranceUrl=http://36.7.147.19:28080/api/sys-modeling/appModelRestService/addModel
insurance.insuranceFdModelId=181d73279372e5a55438a47d7436ab7e
insurance.insuranceFdFlowId=18267f206233f29cbd3c5ee425c9408a
insurance.insuranceDocStatus=20
......
......@@ -317,9 +317,9 @@ public class InsurancesConstants {
*/
public static final String POLICY_START_NEW_SHOULD_LESS_THAN_POLICY_END_NEW = "变更后的保单开始时间需早于保单结束时间";
/**
* 保单起止时间不能超过365天
* 保单起止时间不能超过一年
*/
public static final String POLICY_DATE_NOT_MORE_THAN_365 = "保单起止时间不能超过365天";
public static final String POLICY_DATE_NOT_MORE_THAN_365 = "保单起止时间不能超过一年";
/**
* 保单结束时间不能为空
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author huyc
* @description 导出办理VO
* @date 2023-04-06 14:21:39
*/
@Data
@Schema(description = "导出办理VO")
public class InsuranceExportListOneVO implements Serializable {
private static final long serialVersionUID = -8159190612104775933L;
/**
* 主键
*/
private String id;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String projectName;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@JsonIgnore
private Integer buyHandleStatus;
/**
* 购买月数
*/
@Schema(description = "购买月数")
private Long buyMonth;
/**
* 购买天数
*/
@Schema(description = "购买天数")
private Long buyDay;
/**
* 投保岗位
*/
@Schema(description = "投保岗位")
private String post;
/**
* 商险购买地省
*/
@Schema(description = "商险购买地省")
private String insuranceProvinceName;
/**
* 商险购买地市
*/
@Schema(description = "商险购买地市")
private String insuranceCityName;
/**
* 保单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单开始时间")
private LocalDate policyStart;
/**
* 保单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单结束时间")
private LocalDate policyEnd;
/**
* 保单生效时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@JsonIgnore
private LocalDate policyEffect;
/**
* 保险公司名称(冗余字段)
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 医疗额度
*/
@Schema(description = "医疗额度")
private String medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
private String dieDisableQuota;
/**
* 结算月
*/
@Schema(description = "结算月")
private String settleMonth;
/**
* 结算类型 (0、预估 1、实缴)
*/
@Schema(description = "结算类型 (0、预估 1、实缴)")
private Integer settleType;
/**
* 保单编号
*/
@Schema(description = "保单编号")
private String policyNo;
/**
* 创建人姓名
*/
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
private String invoiceTitle;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
......@@ -12,6 +13,12 @@ import java.util.List;
*/
@Data
public class InsuranceSearchVo extends TBusinessInsuranceVo{
/**
* 商险购买地
*/
@Schema(name = "商险购买地市")
private String insuranceHandleCityName;
private List<String> idList;
/**
......
......@@ -206,6 +206,13 @@ public class InsuranceWarnExportVo implements Serializable {
@ExcelProperty(value = "商险购买地市")
@Schema(name = "商险购买地市")
private String insuranceCityName;
/**
* 商险购买地
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "商险购买地市")
@Schema(name = "商险购买地市")
private String insuranceHandleCityName;
/**
* 是否有效 0有效 1无效
*/
......
......@@ -227,6 +227,21 @@ public class TInsuranceDetailController {
return tInsuranceDetailService.getInsuranceExportList(param,mId);
}
/**
* 导出办理(新)
*
* @author huyc
* @param param
* @return {@link R<List<InsuranceExportListOneVO>>}
*/
@Operation(summary = "导出办理(新)", description = "导出办理(新)")
@PostMapping("/getInsuranceExportOneList")
@PreAuthorize("@pms.hasPermission('handle_insure_export')")
public R<List<InsuranceExportListOneVO>> getInsuranceExportOneList(@RequestBody InsuranceExportListParam param,
@RequestParam(required = false) String mId) {
return tInsuranceDetailService.getInsuranceExportOneList(param,mId);
}
/**
* 投保退回
*
......
......@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import org.apache.ibatis.annotations.Mapper;
......@@ -77,6 +76,24 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/
List<InsuranceExportListVO> getInsuranceExportList(@Param("param") InsuranceExportListParam param);
/**
* 导出办理勾选查询结果
*
* @author licancan
* @param idList
* @return {@link List<InsuranceExportListVO>}
*/
List<InsuranceExportListOneVO> getInsuranceExportOneListBySelect(@Param("idList") List<String> idList);
/**
* 导出办理非勾选查询结果
*
* @author licancan
* @param param
* @return {@link List< InsuranceExportListVO>}
*/
List<InsuranceExportListOneVO> getInsuranceExportOnetList(@Param("param") InsuranceExportListParam param);
/**
* 批量更新保单号
*
......@@ -286,8 +303,11 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
IPage<TBusinessInsuranceVo> getInsuranceExpireWarnVoPage(Page<TBusinessInsuranceVo> page,
@Param("param")InsuranceSearchVo param,
@Param("domains")List<TSettleDomainSelectVo> domains);
List<TBusinessInsuranceVo> pageDiy(@Param("param")InsuranceSearchVo searchVo,
@Param("domains")List<TSettleDomainSelectVo> domains);
List<InsuranceWarnExportVo> noPageDiy(@Param("param")InsuranceSearchVo searchVo, @Param("domains")List<TSettleDomainSelectVo> listSelectVO);
List<InsuranceWarnExportVo> noPageDiy(@Param("param")InsuranceSearchVo searchVo,
@Param("domains")List<TSettleDomainSelectVo> listSelectVO);
int noPageCountDiy(@Param("param")InsuranceSearchVo searchVo, @Param("domains")List<TSettleDomainSelectVo> listSelectVO);
......
......@@ -143,6 +143,15 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/
R<List<InsuranceExportListVO>> getInsuranceExportList(InsuranceExportListParam param, String mId);
/**
* 导出办理(新)
*
* @author huyc
* @param param
* @return {@link R<List<InsuranceExportListVO>>}
*/
R<List<InsuranceExportListOneVO>> getInsuranceExportOneList(InsuranceExportListParam param, String mId);
/**
* 投保退回
*
......
......@@ -959,6 +959,169 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return list;
}
/**
* 导出办理(新)
*
* @param param
* @return {@link List<InsuranceExportListOneVO>}
* @author huyc
*/
@Override
public R<List<InsuranceExportListOneVO>> getInsuranceExportOneList(InsuranceExportListParam param, String mId) {
YifuUser user = SecurityUtils.getUser();
if (Common.isNotNull(mId)) {
param.setMId(mId);
}
param.setCreateBy(user.getId());
//设置updateBy字段是给导出使用的
param.setUpdateBy(user.getId());
menuUtil.setAuthSql(user, param);
if (Common.isNotNull(param.getAuthSql()) && param.getAuthSql().contains("1=2 CONCAT")) {
param.setAuthSql(param.getAuthSql().replace("1=2 CONCAT", "CONCAT"));
}
List<InsuranceExportListOneVO> insuranceExportList;
//如果是待投保状态,sql中HANDLED_BY过滤条件不需要,这里强制变为null
if(param.getBuyHandleStatus() == CommonConstants.ONE_INT){
param.setUpdateBy(null);
}
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待投保」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){
insuranceExportList = baseMapper.getInsuranceExportOneListBySelect(param.getIdList());
}else {
insuranceExportList = baseMapper.getInsuranceExportOnetList(param);
}
if (CollectionUtils.isNotEmpty(insuranceExportList)){
List<TInsuranceDetail> detailList = new ArrayList<>();
//根据项目编码获取项目名称
List<String> collect = insuranceExportList.stream().map(InsuranceExportListOneVO::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
ProjectSetInfoVo jsonObject;
for (InsuranceExportListOneVO record : insuranceExportList) {
jsonObject = null;
if (data != null) {
jsonObject = data.get(record.getDeptNo());
if (null != jsonObject) {
record.setInvoiceTitle(Optional.ofNullable(jsonObject.getInvoiceTitleInsurance()).orElse(""));
}
}
//购买月数
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
//购买天数
record.setBuyDay(LocalDateUtil.betweenDay(record.getPolicyStart().toString(),record.getPolicyEnd().toString()));
//如果是批增需要重新处理购买周期,按生效日期和保单结束时间计算
if (CommonConstants.THREE_INT == record.getBuyType()){
if (Objects.isNull(record.getPolicyEffect())){
record.setBuyMonth(null);
record.setBuyDay(null);
}else {
record.setBuyMonth(LocalDateUtil.betweenMonth(record.getPolicyEffect().toString(),record.getPolicyEnd().toString()));
record.setBuyDay(LocalDateUtil.betweenDay(record.getPolicyEffect().toString(),record.getPolicyEnd().toString()));
}
}
//如果是待投保,需要处理相关逻辑,投保中、投保成功只是单纯的导出
if(param.getBuyHandleStatus() == CommonConstants.ONE_INT){
TInsuranceDetail detail = new TInsuranceDetail();
detail.setId(record.getId());
//update状态由「待投保」置为「投保中」
detail.setBuyHandleStatus(CommonConstants.TWO_INT);
if (record.getBuyType() == CommonConstants.ONE_INT){
// if 投保类型 == 新增,then 更新保单生效日期为:T+1,无需考虑节假日
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
}
detail.setHandledBy(user.getId());
detail.setHandledTime(LocalDateTime.now());
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
if (Common.isNotNull(jsonObject)){
detail.setDeptId(jsonObject.getId());
detail.setDeptName(jsonObject.getDepartName());
detail.setUnitId(jsonObject.getCustomerId());
detail.setUnitName(jsonObject.getCustomerName());
detail.setUnitNo(jsonObject.getCustomerCode());
}
detailList.add(detail);
}
}
}
//批量更新
if (CollectionUtils.isNotEmpty(detailList)){
this.saveOrUpdateBatch(detailList);
}
//操作记录
addOperate(detailList,user,InsurancesConstants.EXPORT,null,CommonConstants.ONE_INT);
//针对是替换类型的做处理,每一条替换数据对应一条被替换数据
List<InsuranceExportListOneVO> listVOS = insuranceExportList.stream().filter(e -> e.getBuyType() == CommonConstants.FOUR_INT).collect(Collectors.toList());
List<InsuranceExportListOneVO> list = new ArrayList<>();
if(CollectionUtils.isNotEmpty(listVOS)){
for (InsuranceExportListOneVO listVO : listVOS) {
listVO.setRemark(InsurancesConstants.INSERT);
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, listVO.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){
TInsuranceDetail byId = this.getById(one.getFromInsuranceDetailId());
if (Optional.ofNullable(byId).isPresent()){
InsuranceExportListOneVO vo = new InsuranceExportListOneVO();
BeanCopyUtils.copyProperties(byId,vo);
if (StringUtils.isNotBlank(byId.getPolicyNo())){
listVO.setPolicyNo(byId.getPolicyNo());
}
//购买月数
vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyStart().toString(),vo.getPolicyEnd().toString()));
//购买天数
vo.setBuyDay(LocalDateUtil.betweenDay(vo.getPolicyStart().toString(),vo.getPolicyEnd().toString()));
//如果是批增需要重新处理购买周期,按生效日期和保单结束时间计算
if (CommonConstants.THREE_INT == vo.getBuyType()){
if (Objects.isNull(vo.getPolicyEffect())){
vo.setBuyMonth(null);
vo.setBuyDay(null);
}else {
vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyEffect().toString(),vo.getPolicyEnd().toString()));
vo.setBuyDay(LocalDateUtil.betweenDay(vo.getPolicyEffect().toString(),vo.getPolicyEnd().toString()));
}
}
vo.setRemark(InsurancesConstants.QUIT);
vo.setBuyType(CommonConstants.FOUR_INT);
vo.setProjectName(byId.getDeptName());
list.add(vo);
}
}
}
if (CollectionUtils.isNotEmpty(list)){
//根据项目编码获取项目名称
List<String> collectList = list.stream().map(InsuranceExportListOneVO::getDeptNo).distinct().collect(Collectors.toList());
try{
R<SetInfoVo> setInfoByCodesList = archivesDaprUtil.getSetInfoByCodes(collectList);
if (null != setInfoByCodesList && setInfoByCodesList.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodesList.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodesList.getData().getProjectSetInfoVoMap();
if (data != null) {
for (InsuranceExportListOneVO record : list) {
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject) {
record.setInvoiceTitle(Optional.ofNullable(jsonObject.getInvoiceTitleInsurance()).orElse(""));
}
}
}
}
}catch (Exception e){
for (InsuranceExportListOneVO record : list) {
record.setProjectName(CommonConstants.EMPTY_STRING);
record.setInvoiceTitle(CommonConstants.EMPTY_STRING);
}
log.error(InsurancesConstants.GET_DEPT_DETAIL_ERROR+e);
}
insuranceExportList.removeAll(listVOS);
insuranceExportList.addAll(crossMergerOne(list,listVOS));
}
}
}
return R.ok(insuranceExportList);
}
/**
* 导出办理
*
......@@ -991,12 +1154,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceExportList = baseMapper.getInsuranceExportList(param);
}
if (CollectionUtils.isNotEmpty(insuranceExportList)){
/*if(insuranceExportList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
return R.failed(InsurancesConstants.EXPORT_TOO_LONG);
}*/
List<TInsuranceDetail> detailList = new ArrayList<>();
//根据项目编码获取项目名称
List<String> collect = insuranceExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collect = insuranceExportList.stream().map(InsuranceExportListVO::getDeptNo).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
......@@ -1095,7 +1255,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
if (CollectionUtils.isNotEmpty(list)){
//根据项目编码获取项目名称
List<String> collectList = list.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<String> collectList = list.stream().map(InsuranceExportListVO::getDeptNo).distinct().collect(Collectors.toList());
try{
R<SetInfoVo> setInfoByCodesList = archivesDaprUtil.getSetInfoByCodes(collectList);
if (null != setInfoByCodesList && setInfoByCodesList.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodesList.getData())) {
......@@ -2131,9 +2291,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
ekpUpdateParam.setFd_3b5bf030ab1a56(detail.getInvoiceNo());
}
if (policeNoFlag) {
ekpUpdateParam.setFd_3bb431933ee968(success.getInvoiceNo());
ekpUpdateParam.setFd_3bb431933ee968(success.getPolicyNo());
} else {
ekpUpdateParam.setFd_3bb431933ee968(detail.getInvoiceNo());
ekpUpdateParam.setFd_3bb431933ee968(detail.getPolicyNo());
}
ekpUpdateParam.setFd_3b5bf031b52314(detail.getBuyStandard());
ekpUpdateParam.setFd_3b5bf032d7a822(detail.getId() + "_" + detail.getDefaultSettleId());
......@@ -2540,7 +2700,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (LocalDateUtil.betweenDay(param.getPolicyStart(),param.getPolicyEnd()) > CommonConstants.ONE_YEAR){
if (DateUtil.getDateStr(DateUtil.stringToDate(param.getPolicyStart()),1).compareTo(param.getPolicyEnd().replaceAll("-","")) < CommonConstants.ZERO_INT) {
param.setErrorMessage(InsurancesConstants.POLICY_DATE_NOT_MORE_THAN_365);
listResult.add(param);
continue;
......@@ -3265,7 +3425,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if (LocalDateUtil.betweenDay(param.getPolicyStart(),param.getPolicyEnd()) > CommonConstants.ONE_YEAR){
//日期比较
if (DateUtil.getDateStr(DateUtil.stringToDate(param.getPolicyStart()),1).compareTo(param.getPolicyEnd().replaceAll("-","")) < CommonConstants.ZERO_INT){
param.setErrorMessage(InsurancesConstants.POLICY_DATE_NOT_MORE_THAN_365);
listResult.add(param);
continue;
......@@ -4112,6 +4273,35 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return list;
}
/**
* 将集合交叉合并,list1 是第一个顺序 list2 是第二个顺序
*
* @author huyc
* @param list1
* @param list2
* @return {@link List<InsuranceExportListOneVO>}
*/
private List<InsuranceExportListOneVO> crossMergerOne (List<InsuranceExportListOneVO> list1, List<InsuranceExportListOneVO> list2){
//将list放入到链表队列
LinkedList<InsuranceExportListOneVO> st1 = new LinkedList<>(list1);
LinkedList<InsuranceExportListOneVO> st2 = new LinkedList<>(list2);
//计算较大的数组长度
int max = list1.size() > list2.size() ? list1.size() : list2.size();
//新建一个最终结果的list
List<InsuranceExportListOneVO> list = new ArrayList<>(list1.size() + list2.size());
for ( int i = 0; i < max;i++){
//如果队列没取完,继续取
if (!st1.isEmpty()){
list.add(st1.poll());
}
//如果队列没取完,继续取
if (!st2.isEmpty()){
list.add(st2.poll());
}
}
return list;
}
/***********************减员办理********************************/
/**
......@@ -7451,11 +7641,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
condition.setInsuranceProvinces(provinces);
condition.setInsuranceCitys(citys);
}
IPage<TBusinessInsuranceVo> recordsPage = new Page<>();
recordsPage.setTotal(baseMapper.noPageCountDiy(condition,null));
int limitStart = (int)(page.getCurrent()-1)*(int)page.getSize();
int limitEnd = (int)page.getSize();
condition.setLimitStart(limitStart);
condition.setLimitEnd(limitEnd);
recordsPage.setPages(page.getPages());
recordsPage.setSize(page.getSize());
recordsPage.setCurrent(page.getCurrent());
if (Common.isNotNull(sdRes) && Common.isNotNull(sdRes.getData())) {
return baseMapper.getInsuranceExpireWarnVoPage(page, condition, sdRes.getData().getListSelectVO());
recordsPage.setRecords(baseMapper.pageDiy(condition, sdRes.getData().getListSelectVO()));
}else {
return baseMapper.getInsuranceExpireWarnVoPage(page, condition, null);
recordsPage.setRecords(baseMapper.pageDiy(condition, null));
}
return recordsPage;
}
@Override
......@@ -7681,10 +7882,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
int index = 0;
if (count > CommonConstants.ZERO_INT){
WriteSheet writeSheet;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT_1) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT_1);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
writeSheet = EasyExcel.writerSheet(InsurancesConstants.INSURANCE_ALERT_EXPORT+index).build();
......
......@@ -461,6 +461,101 @@
</if>
ORDER BY a.CREATE_TIME DESC
</select>
<!--导出办理勾选查询结果-->
<select id="getInsuranceExportOneListBySelect" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListOneVO">
select a.id as id,
a.DEPT_NO as deptNo,
a.DEPT_NAME as projectName,
a.EMP_NAME as empName,
a.EMP_IDCARD_NO as empIdcardNo,
a.BUY_TYPE as buyType,
a.BUY_HANDLE_STATUS as buyHandleStatus,
a.POST as post,
a.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
a.INSURANCE_CITY_NAME as insuranceCityName,
a.POLICY_START as policyStart,
a.POLICY_END as policyEnd,
a.POLICY_EFFECT as policyEffect,
a.INSURANCE_COMPANY_NAME as insuranceCompanyName,
a.INSURANCE_TYPE_NAME as insuranceTypeName,
a.BUY_STANDARD as buyStandard,
a.MEDICAL_QUOTA as medicalQuota,
a.DIE_DISABLE_QUOTA as dieDisableQuota,
a.ACTUAL_PREMIUM as actualPremium,
a.SETTLE_MONTH as settleMonth,
a.SETTLE_TYPE as settleType,
a.CREATE_NAME as createName,
a.POLICY_NO as policyNo,
a.REMARK as remark
from t_insurance_detail a
where a.DELETE_FLAG = 0 and a.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
ORDER BY a.CREATE_TIME DESC
</select>
<!--出办理非勾选查询结果-->
<select id="getInsuranceExportOnetList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListOneVO">
select a.id as id,
a.DEPT_NO as deptNo,
a.DEPT_NAME as projectName,
a.EMP_NAME as empName,
a.EMP_IDCARD_NO as empIdcardNo,
a.BUY_TYPE as buyType,
a.POST as post,
a.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
a.INSURANCE_CITY_NAME as insuranceCityName,
a.POLICY_START as policyStart,
a.POLICY_END as policyEnd,
a.POLICY_EFFECT as policyEffect,
a.INSURANCE_COMPANY_NAME as insuranceCompanyName,
a.INSURANCE_TYPE_NAME as insuranceTypeName,
a.BUY_STANDARD as buyStandard,
a.MEDICAL_QUOTA as medicalQuota,
a.DIE_DISABLE_QUOTA as dieDisableQuota,
a.ACTUAL_PREMIUM as actualPremium,
a.SETTLE_MONTH as settleMonth,
a.SETTLE_TYPE as settleType,
a.CREATE_NAME as createName,
a.POLICY_NO as policyNo,
a.REMARK as remark
from t_insurance_detail a
where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
<if test="param.empName != null and param.empName.trim() != ''">
and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and a.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and a.DEPT_NO like concat('%',replace(replace(#{param.deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and a.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyType != null">
and a.BUY_TYPE = #{param.buyType}
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and a.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and a.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and a.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.updateBy != null and param.updateBy.trim() != ''">
and a.HANDLED_BY = #{param.updateBy}
</if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
<if test="param.buyStandardMin != null">
AND a.BUY_STANDARD <![CDATA[ >= ]]> #{param.buyStandardMin}
</if>
<if test="param.buyStandardMax != null">
AND a.BUY_STANDARD <![CDATA[ <= ]]> #{param.buyStandardMax}
</if>
ORDER BY a.CREATE_TIME DESC
</select>
<!--批量更新保单号-->
<update id="updatePolicyNoBatch">
<foreach collection="details" index="index" item="item" separator=";">
......@@ -1641,17 +1736,24 @@
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
AND a.EMP_IDCARD_NO like CONCAT('%' ,#{param.empIdcardNo},'%')
</if>
<if test="param.insuranceCityName != null and param.insuranceCityName.trim() != ''">
AND a.INSURANCE_CITY_NAME like CONCAT(#{param.insuranceCityName},'%')
</if>
<if test="param.insuranceHandleCityName != null and param.insuranceHandleCityName.trim() != ''">
AND a.INSURANCE_HANDLE_CITY_NAME like CONCAT(#{param.insuranceHandleCityName},'%')
</if>
<if test="param.idList != null and param.idList.size() > 0">
and a.id in
<foreach collection="param.idList" item="param" index="index" open="(" close=")"
separator=",">
#{param}
</foreach>
</if>
<if test="param.insuranceProvinces != null and param.insuranceProvinces != null">
and (1 = 2
<if test="param.insuranceProvinces != null">
<if test="param.insuranceProvinces.size() > 0">
and a.INSURANCE_PROVINCE in
or a.INSURANCE_PROVINCE in
<foreach collection="param.insuranceProvinces" item="param" index="index" open="(" close=")"
separator=",">
#{param}
......@@ -1659,15 +1761,16 @@
</if>
</if>
<if test="param.insuranceCitys != null and param.insuranceCitys != null">
<if test="param.insuranceCitys != null">
<if test="param.insuranceCitys.size() > 0">
and a.INSURANCE_CITY in
<foreach collection="param.insuranceCitys" item="param" index="index" open="(" close=")" separator=",">
or a.INSURANCE_CITY in
<foreach collection="param.insuranceCitys" item="param" index="index" open="(" close=")"
separator=",">
#{param}
</foreach>
</if>
</if>
<if test="param.insuranceCitys != null and param.insuranceProvinces != null">
<!--<if test="param.insuranceCitys != null and param.insuranceProvinces != null">
<if test="param.insuranceCitys.size() > 0 and param.insuranceProvinces.size() > 0">
and (
a.INSURANCE_PROVINCE in
......@@ -1682,8 +1785,22 @@
</foreach>
)
</if>
</if>-->
<if test="param == null">
<!--数据权限判断-->
or a.CREATE_BY = #{param.createBy}
<if test="domains != null">
<if test="domains.size() > 0">
or a.SETTLEMENT_ORGAN in
<foreach collection="domains" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
</if>
</if>
)
</if>
<if test="param == null">
<!--数据权限判断-->
AND (a.CREATE_BY = #{param.createBy}
<if test="domains != null">
......@@ -1695,38 +1812,60 @@
</if>
</if>
)
</if>
</where>
</sql>
<select id="getInsuranceExpireWarnVoPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo">
<include refid="expire_sql_param"/>
from t_insurance_detail a
<include refid="expire_sql_param"/>,a.INSURANCE_HANDLE_CITY_NAME
from
(select * from t_insurance_detail a
<include refid="expire_sql_where"/>
) a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
</select>
<select id="noPageDiy" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceWarnExportVo">
<include refid="expire_export_sql_param"/>
from t_insurance_detail a
<select id="pageDiy" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo">
<include refid="expire_sql_param"/>,a.INSURANCE_HANDLE_CITY_NAME
from
(select * from t_insurance_detail a
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
<if test="param != null and param.limitStart != null">
limit #{param.limitStart},#{param.limitEnd}
</if>
) a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
</select>
<select id="noPageDiy" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceWarnExportVo">
<include refid="expire_export_sql_param"/>
from
(select * from t_insurance_detail a
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
<if test="param != null and param.limitStart != null">
limit #{param.limitStart},#{param.limitEnd}
</if>
)a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
group by a.id
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
select
count(1)
from t_insurance_detail a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
<!--LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id-->
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
</select>
<update id="batchexpireIgnore">
<if test="idList != null and idList.size() > 0">
......
......@@ -40,7 +40,9 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
......@@ -3364,7 +3366,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Override
public R<List<ErrorMessage>> addApplyHandle(List<String> ids, String typeSub, String handleStatus,
String handleRemark, String socialType, String remark) {
try {
YifuUser user = SecurityUtils.getUser();
if (null == user) {
return R.failed(CommonConstants.USER_FAIL);
......@@ -3382,16 +3383,32 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} else {
return R.failed("派单办理状态参数异常:0待办理 1办理通过 2办理不通过");
}
String key = CacheConstants.PAYMENT_DISPATCH_BATCH_IMPORT + CommonConstants.DOWN_LINE_STRING +user.getId() ;
// 获取redis分布式事务锁
String requestId;
try {
requestId = RedisDistributedLock.getLock(key,"10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}
if (Common.isNotNull(requestId)) {
try {
List<ErrorMessage> errorInfo = addBatchApplyHandle(ids, typeSub, user, flag, handleStatus,
Common.isNullToString(handleRemark), socialType,remark);
Common.isNullToString(handleRemark), socialType, remark);
if (errorInfo == null || errorInfo.isEmpty()) {
return R.ok(null,"办理成功!");
return R.ok(null, "办理成功!");
} else {
return R.ok(errorInfo,"派单办理结果:");
return R.ok(errorInfo, "派单办理结果:");
}
} catch (Exception e) {
log.error(DispatchConstants.DISPATCH_EXCEPTION + e.getMessage());
return R.failed("数据异常,办理失败!");
}finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
}
......
......@@ -564,7 +564,7 @@
AND a.CREATE_NAME = #{tDispatchInfo.createName}
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME like CONCAT(#{tDispatchInfo.settleDomainName}, '%')
AND a.SOCIAL_HOUSEHOLD_NAME like CONCAT(#{tDispatchInfo.socialHouseholdName}, '%')
</if>
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
AND a.PROVIDENT_HOUSEHOLD_NAME like CONCAT(#{tDispatchInfo.providentHouseholdName}, '%')
......
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