|
@@ -2,11 +2,8 @@ package com.ydtech.modules.fnc.service.impl;
|
|
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
-import cn.hutool.core.text.StrBuilder;
|
|
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
@@ -17,16 +14,13 @@ import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
|
import com.ydtech.modules.esm.service.EsmInsCompanyService;
|
|
import com.ydtech.modules.esm.service.EsmInsCompanyService;
|
|
|
-import com.ydtech.modules.fnc.entity.*;
|
|
|
|
|
import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
|
|
import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
|
|
|
|
|
+import com.ydtech.modules.fnc.entity.*;
|
|
|
import com.ydtech.modules.fnc.service.*;
|
|
import com.ydtech.modules.fnc.service.*;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
|
|
import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
|
|
|
import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
|
|
import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
|
|
|
import com.ydtech.modules.ins.model.vo.res.*;
|
|
import com.ydtech.modules.ins.model.vo.res.*;
|
|
|
-import com.ydtech.modules.inv.model.InvChannelsExternalBillsDetails;
|
|
|
|
|
import com.ydtech.modules.inv.model.dto.*;
|
|
import com.ydtech.modules.inv.model.dto.*;
|
|
|
-import com.ydtech.modules.inv.model.excel.InvDisburseExcel;
|
|
|
|
|
import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
import com.ydtech.modules.order.entity.InsOrders;
|
|
@@ -42,11 +36,9 @@ import com.ydtech.utils.SnowFlakeUtil;
|
|
|
import com.ydtech.utils.StringOperations;
|
|
import com.ydtech.utils.StringOperations;
|
|
|
import com.ydtech.utils.excel.ExcelEasypoiUtils;
|
|
import com.ydtech.utils.excel.ExcelEasypoiUtils;
|
|
|
import com.ydtech.utils.excel.ExcelStyleUtil;
|
|
import com.ydtech.utils.excel.ExcelStyleUtil;
|
|
|
-import com.ydtech.utils.excel.ExcelUtils2;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.apache.poi.ss.formula.functions.Now;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -55,11 +47,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
-import redis.clients.jedis.params.Params;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.awt.image.BandedSampleModel;
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
@@ -70,9 +60,6 @@ import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.YearMonth;
|
|
import java.time.YearMonth;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.CompletableFuture;
|
|
|
|
|
-import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* <p>
|
|
* <p>
|
|
@@ -1001,14 +988,34 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
params =this.saveParams(insPlyIncomeVo,params);
|
|
params =this.saveParams(insPlyIncomeVo,params);
|
|
|
List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
|
|
List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
|
|
|
|
|
|
|
|
- ExportParams exportParams = new ExportParams("保险跟单明细导出", null, ExcelType.HSSF);
|
|
|
|
|
- exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
|
|
- List<BxOtherDetailsExcel> resultList = new ArrayList<>();
|
|
|
|
|
- for (InsPlyIncome item :insPlyIncomes){
|
|
|
|
|
- BxOtherDetailsExcel bxOtherDetailsExcel = new BxOtherDetailsExcel();
|
|
|
|
|
- BeanUtils.copyProperties(item, bxOtherDetailsExcel);
|
|
|
|
|
- resultList.add(bxOtherDetailsExcel);
|
|
|
|
|
|
|
+ String filePathName ="";
|
|
|
|
|
+ List<BxOtherDetailsNorExcel> resultNoList=new ArrayList<>();
|
|
|
|
|
+ List<BxOtherDetailsExcel> resultList=new ArrayList<>();
|
|
|
|
|
+ //判断是否是非车 1 是非车
|
|
|
|
|
+ if("1".equals(insPlyIncomeVo.getIsNotCar())){
|
|
|
|
|
+ filePathName="非车跟单明细导出";
|
|
|
|
|
+ ExportParams exportParams = new ExportParams("非车跟单明细", null, ExcelType.HSSF);
|
|
|
|
|
+ exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
|
|
+ for (InsPlyIncome item :insPlyIncomes){
|
|
|
|
|
+ BxOtherDetailsNorExcel bxOtherDetailsNorExcel = new BxOtherDetailsNorExcel();
|
|
|
|
|
+ LocalDateTime signDate = item.getSignDate();
|
|
|
|
|
+ BeanUtils.copyProperties(item, bxOtherDetailsNorExcel);
|
|
|
|
|
+ bxOtherDetailsNorExcel.setSigndate(signDate);
|
|
|
|
|
+ resultNoList.add(bxOtherDetailsNorExcel);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ filePathName="车险跟单明细导出";
|
|
|
|
|
+ ExportParams exportParams = new ExportParams("车险跟单明细", null, ExcelType.HSSF);
|
|
|
|
|
+ exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
|
|
+ for (InsPlyIncome item :insPlyIncomes){
|
|
|
|
|
+ BxOtherDetailsExcel bxOtherDetailsExcel = new BxOtherDetailsExcel();
|
|
|
|
|
+ LocalDateTime signDate = item.getSignDate();
|
|
|
|
|
+ BeanUtils.copyProperties(item, bxOtherDetailsExcel);
|
|
|
|
|
+ bxOtherDetailsExcel.setSigndate(signDate);
|
|
|
|
|
+ resultList.add(bxOtherDetailsExcel);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
String uploadPath = this.uploadPath + "/excel/";
|
|
String uploadPath = this.uploadPath + "/excel/";
|
|
|
Path path = Paths.get(uploadPath);
|
|
Path path = Paths.get(uploadPath);
|
|
|
if (!Files.exists(path)) {
|
|
if (!Files.exists(path)) {
|
|
@@ -1018,7 +1025,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- String fileName = EasyExcelUtils.downExcel(uploadPath, "保险跟单明细导出", BxOtherDetailsExcel.class, resultList);
|
|
|
|
|
|
|
+ String fileName="";
|
|
|
|
|
+ if("1".equals(insPlyIncomeVo.getIsNotCar())){
|
|
|
|
|
+ fileName = EasyExcelUtils.downExcel(uploadPath, filePathName, BxSettlementFeesExcel.class, resultNoList);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ fileName = EasyExcelUtils.downExcel(uploadPath, filePathName, BxSettlementFeesExcel.class, resultList);
|
|
|
|
|
+ }
|
|
|
return HttpResult.ok("",uploadUrl + "excel/" + fileName);
|
|
return HttpResult.ok("",uploadUrl + "excel/" + fileName);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1710,15 +1722,34 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
params =this.saveParams(insPlyIncomeVo,params);
|
|
params =this.saveParams(insPlyIncomeVo,params);
|
|
|
List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
|
|
List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
|
|
|
|
|
|
|
|
- ExportParams exportParams = new ExportParams("保险手续费", null, ExcelType.HSSF);
|
|
|
|
|
- exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
|
|
- List<BxSettlementFeesExcel> resultList = new ArrayList<>();
|
|
|
|
|
- for (InsPlyIncome item :insPlyIncomes){
|
|
|
|
|
- BxSettlementFeesExcel bxSettlementFeesExcel = new BxSettlementFeesExcel();
|
|
|
|
|
- LocalDateTime signDate = item.getSignDate();
|
|
|
|
|
- BeanUtils.copyProperties(item, bxSettlementFeesExcel);
|
|
|
|
|
- resultList.add(bxSettlementFeesExcel);
|
|
|
|
|
|
|
+ String filePathName ="";
|
|
|
|
|
+ List<BxSettlementFeesNorExcel> resultNoList=new ArrayList<>();
|
|
|
|
|
+ List<BxSettlementFeesExcel> resultList=new ArrayList<>();
|
|
|
|
|
+ //判断是否是非车 1 是非车
|
|
|
|
|
+ if("1".equals(insPlyIncomeVo.getIsNotCar())){
|
|
|
|
|
+ filePathName="非车手续费导出";
|
|
|
|
|
+ ExportParams exportParams = new ExportParams("非车手续费", null, ExcelType.HSSF);
|
|
|
|
|
+ exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
|
|
+ for (InsPlyIncome item :insPlyIncomes){
|
|
|
|
|
+ BxSettlementFeesNorExcel bxSettlementFeesNorExcel = new BxSettlementFeesNorExcel();
|
|
|
|
|
+ LocalDateTime signDate = item.getSignDate();
|
|
|
|
|
+ BeanUtils.copyProperties(item, bxSettlementFeesNorExcel);
|
|
|
|
|
+ bxSettlementFeesNorExcel.setSigndate(signDate);
|
|
|
|
|
+ resultNoList.add(bxSettlementFeesNorExcel);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ filePathName="车险手续费导出";
|
|
|
|
|
+ ExportParams exportParams = new ExportParams("车险手续费", null, ExcelType.HSSF);
|
|
|
|
|
+ exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
|
|
+ for (InsPlyIncome item :insPlyIncomes){
|
|
|
|
|
+ BxSettlementFeesExcel bxSettlementFeesExcel = new BxSettlementFeesExcel();
|
|
|
|
|
+ LocalDateTime signDate = item.getSignDate();
|
|
|
|
|
+ BeanUtils.copyProperties(item, bxSettlementFeesExcel);
|
|
|
|
|
+ bxSettlementFeesExcel.setSigndate(signDate);
|
|
|
|
|
+ resultList.add(bxSettlementFeesExcel);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
String uploadPath = this.uploadPath + "/excel/";
|
|
String uploadPath = this.uploadPath + "/excel/";
|
|
|
Path path = Paths.get(uploadPath);
|
|
Path path = Paths.get(uploadPath);
|
|
|
if (!Files.exists(path)) {
|
|
if (!Files.exists(path)) {
|
|
@@ -1728,7 +1759,13 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- String fileName = EasyExcelUtils.downExcel(uploadPath, "保险手续费导出", BxSettlementFeesExcel.class, resultList);
|
|
|
|
|
|
|
+ String fileName="";
|
|
|
|
|
+ if("1".equals(insPlyIncomeVo.getIsNotCar())){
|
|
|
|
|
+ fileName = EasyExcelUtils.downExcel(uploadPath, filePathName, BxSettlementFeesExcel.class, resultNoList);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ fileName = EasyExcelUtils.downExcel(uploadPath, filePathName, BxSettlementFeesExcel.class, resultList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return HttpResult.ok("",uploadUrl + "excel/" + fileName);
|
|
return HttpResult.ok("",uploadUrl + "excel/" + fileName);
|
|
|
}
|
|
}
|
|
|
|
|
|