|
|
@@ -3,6 +3,7 @@ package com.ydtech.modules.fnc.service.impl;
|
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
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.fasterxml.jackson.core.JsonProcessingException;
|
|
|
@@ -10,6 +11,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.ydtech.constants.enums.dict.agreement.ProductsType;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
|
@@ -25,11 +27,10 @@ import com.ydtech.modules.fnc.service.SettlementDocumentaryFeesService;
|
|
|
import com.ydtech.modules.fnc.service.SettlementDocumentaryLogService;
|
|
|
import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
|
|
|
import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
|
|
|
-import com.ydtech.modules.ins.model.vo.res.BxOtherExcel;
|
|
|
-import com.ydtech.modules.ins.model.vo.res.BxSettlementFeesExcel;
|
|
|
-import com.ydtech.modules.ins.model.vo.res.InsCmainNocarDetailResVo;
|
|
|
-import com.ydtech.modules.ins.model.vo.res.SettlementFeesExcel;
|
|
|
+import com.ydtech.modules.ins.model.vo.res.*;
|
|
|
import com.ydtech.modules.inv.model.InvChannelsExternalBillsDetails;
|
|
|
+import com.ydtech.modules.inv.model.dto.InsBxNoPlyIncomeExcelDto;
|
|
|
+import com.ydtech.modules.inv.model.dto.InsBxPlyIncomeExcelDto;
|
|
|
import com.ydtech.modules.inv.model.dto.InsPlyIncomeExcelDto;
|
|
|
import com.ydtech.modules.inv.model.dto.InvChannelExcelDto;
|
|
|
import com.ydtech.modules.inv.model.excel.InvDisburseExcel;
|
|
|
@@ -142,16 +143,16 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
if ("1".equals(agreeType)) {
|
|
|
this.savePinTai(order,insFeeOrderNew,insAreaCompany); //手续费不分非车不非车 跟单也不分
|
|
|
}else { // 保险 逻辑: 手续费生成一条 跟单费生成一条 非车手续费一条 非车跟单费一条
|
|
|
- if (insFeeOrderNew.getJqSuperviseCostsPremiums() != null || insFeeOrderNew.getSySuperviseCostsPremiums() != null) { //手续费
|
|
|
+ if (((insFeeOrderNew.getJqSuperviseCostsPremiums() != null && insFeeOrderNew.getJqSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0)) || (insFeeOrderNew.getSySuperviseCostsPremiums() != null && insFeeOrderNew.getSySuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0)) { //手续费
|
|
|
this.saveInsuranceProcedures(order,insFeeOrderNew,insAreaCompany);
|
|
|
}
|
|
|
- if(insFeeOrderNew.getJqOtherCostsPremiums()!=null ){ //跟单费
|
|
|
+ if(insFeeOrderNew.getJqOtherCostsPremiums()!=null && insFeeOrderNew.getJqOtherCostsPremiums().compareTo(BigDecimal.ZERO) != 0){ //跟单费
|
|
|
this.saveOtherAmount(order,insFeeOrderNew,insAreaCompany);
|
|
|
}
|
|
|
- if(insFeeOrderNew.getNoSuperviseCostsPremiums() !=null){ // 非车手续费
|
|
|
+ if(insFeeOrderNew.getNoSuperviseCostsPremiums() !=null && insFeeOrderNew.getNoSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) { // 非车手续费
|
|
|
this.saveNoSupervise(order,insFeeOrderNew,insAreaCompany);
|
|
|
}
|
|
|
- if(insFeeOrderNew.getNoOtherCostsPremiums() !=null){ // 非车跟单费
|
|
|
+ if(insFeeOrderNew.getNoOtherCostsPremiums() !=null && insFeeOrderNew.getNoOtherCostsPremiums().compareTo(BigDecimal.ZERO) != 0){ // 非车跟单费
|
|
|
this.saveNoOtherAmount(order,insFeeOrderNew,insAreaCompany);
|
|
|
}
|
|
|
}
|
|
|
@@ -168,7 +169,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
insPlyIncome.setOtherFeevalue(insFeeOrderNew.getNoOtherCostsPremiums()); //非车跟单费
|
|
|
insPlyIncome.setOtherFeerate(insFeeOrderNew.getNoOtherCostsProportion()); //非车跟单费用比例
|
|
|
insPlyIncome.setDeptId(insFeeOrderNew.getDeptId());
|
|
|
- insPlyIncome.setRiskcode(order.getProductid());
|
|
|
+ this.saveRiskCode(order.getProductid(),insPlyIncome);
|
|
|
insPlyIncome.setPayDate(insAreaCompany.getPayDate());
|
|
|
insPlyIncome.setSignDate(insAreaCompany.getSigningTime());
|
|
|
insPlyIncome.setCompanyId(insAreaCompany.getCompanyId());
|
|
|
@@ -196,8 +197,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
if(StringUtils.isNotEmpty(noPolicyno)){
|
|
|
insPlyIncome.setNoPolicyno(noPolicyno); // 非车保单号
|
|
|
}
|
|
|
+
|
|
|
insPlyIncome.setDeptId(insFeeOrderNew.getDeptId());
|
|
|
- insPlyIncome.setRiskcode(order.getProductid());
|
|
|
+ this.saveRiskCode(order.getProductid(),insPlyIncome);
|
|
|
insPlyIncome.setPayDate(insAreaCompany.getPayDate());
|
|
|
insPlyIncome.setSignDate(insAreaCompany.getSigningTime());
|
|
|
insPlyIncome.setCompanyId(insAreaCompany.getCompanyId());
|
|
|
@@ -218,6 +220,26 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
baseMapper.insert(insPlyIncome);
|
|
|
}
|
|
|
|
|
|
+ private void saveRiskCode(String productid,InsPlyIncome insPlyIncome) {
|
|
|
+ if(ProductsType.PT_0330.getCode().equals(productid)){
|
|
|
+ insPlyIncome.setRiskcode(ProductsType.PT_0330.getDesc());
|
|
|
+ }
|
|
|
+ if(ProductsType.PT_034001.getCode().equals(productid)){
|
|
|
+ insPlyIncome.setRiskcode(ProductsType.PT_034001.getDesc());
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ProductsType.PT_034002.getCode().equals(productid)){
|
|
|
+ insPlyIncome.setRiskcode(ProductsType.PT_034002.getDesc());
|
|
|
+ }
|
|
|
+ if(ProductsType.PT_0330034002.getCode().equals(productid)){
|
|
|
+ insPlyIncome.setRiskcode(ProductsType.PT_0330034002.getDesc());
|
|
|
+ }
|
|
|
+ if(ProductsType.PT_0330034001.getCode().equals(productid)){
|
|
|
+ insPlyIncome.setRiskcode(ProductsType.PT_0330034001.getDesc());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void saveOtherAmount(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
|
|
|
BigDecimal otherAmount = this.calculateTotal(insFeeOrderNew.getJqOtherCostsPremiums(), insFeeOrderNew.getSyOtherCostsPremiums(),null);
|
|
|
BigDecimal otherProportion = this.calculateTotal(insFeeOrderNew.getSyOtherCostsProportion(), insFeeOrderNew.getJqOtherCostsProportion(),null);
|
|
|
@@ -227,7 +249,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
|
|
|
InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getId(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),
|
|
|
allNoTaxPremium,null,otherProportion,null,otherAmount,otherAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","1");
|
|
|
-
|
|
|
+ this.saveRiskCode(order.getProductid(),insPlyIncome);
|
|
|
insPlyIncome.setTaxPremium(allPremium);
|
|
|
insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
|
|
|
insPlyIncome.setSyPremium(insFeeOrderNew.getSyPremium());
|
|
|
@@ -259,10 +281,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
insPlyIncome.setJqSuperviseCostsPremiums(insFeeOrderNew.getJqSuperviseCostsPremiums());
|
|
|
insPlyIncome.setSySuperviseCostsProportion(insFeeOrderNew.getSySuperviseCostsProportion());
|
|
|
insPlyIncome.setSySuperviseCostsPremiums(insFeeOrderNew.getSySuperviseCostsPremiums());
|
|
|
+ this.saveRiskCode(order.getProductid(),insPlyIncome);
|
|
|
insPlyIncome.setTaxPremium(allTaxPremium);
|
|
|
insPlyIncome.setUserId(insFeeOrderNew.getUserId());
|
|
|
this.saveByCompanyId(insFeeOrderNew ,insAreaCompany.getCompanyId(),insPlyIncome);
|
|
|
-
|
|
|
baseMapper.insert(insPlyIncome);
|
|
|
}
|
|
|
|
|
|
@@ -341,9 +363,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
insPlyIncome.setPartnerCompaniesName(name);
|
|
|
insPlyIncome.setPartnerCompaniesId(ptlAgreementQueryVo.getPartnerCompaniesId());
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(ptlAgreementQueryVo.getAssociationCompaniesId())){
|
|
|
- String associationCompaniesId = ptlAgreementQueryVo.getAssociationCompaniesId();
|
|
|
- EsmInsCompany esmInsCompany = EsmInsCompanyService.getById(associationCompaniesId);
|
|
|
+ if(StringUtils.isNotEmpty(ptlAgreementQueryVo.getInsuranceCompanyId())){
|
|
|
+ String insuranceCompanyId = ptlAgreementQueryVo.getInsuranceCompanyId();
|
|
|
+ EsmInsCompany esmInsCompany = EsmInsCompanyService.getById(insuranceCompanyId);
|
|
|
String name = esmInsCompany.getName(); //保险公司名称
|
|
|
insPlyIncome.setCompanyName(name);
|
|
|
}
|
|
|
@@ -470,7 +492,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
params.put("agreementType",insPlyIncomeVo.getAgreementType());
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(insPlyIncomeVo.getLicenseno())){
|
|
|
- params.put("licenseno", insPlyIncomeVo.getLicenseno().split(","));
|
|
|
+ params.put("licenseno", insPlyIncomeVo.getLicenseno());
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(insPlyIncomeVo.getUserId())){
|
|
|
params.put("userId",insPlyIncomeVo.getUserId());
|
|
|
@@ -518,6 +540,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
if(StringUtils.isNotEmpty(insPlyIncomeVo.getSignDateStart())){
|
|
|
params.put("signDateStart",insPlyIncomeVo.getSignDateStart());
|
|
|
}
|
|
|
+ if(StringUtils.isNotEmpty(insPlyIncomeVo.getCompanyName())){
|
|
|
+ params.put("companyName",insPlyIncomeVo.getCompanyName());
|
|
|
+ }
|
|
|
return params;
|
|
|
}
|
|
|
|
|
|
@@ -557,13 +582,13 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
@Override
|
|
|
public HttpResult<List<InsPlyIncome>> nonSettldetail(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
try {
|
|
|
- String ids = insPlyIncomeVo.getIncomeIds();
|
|
|
+ String ids = insPlyIncomeVo.getIds();
|
|
|
ArrayList<InsPlyIncome> resultList = new ArrayList<>();
|
|
|
if (ObjectUtils.isNotEmpty(ids)) {
|
|
|
String[] split = ids.split(",");
|
|
|
for (int i =0; i <split.length ; i++) {
|
|
|
String id = split[i];
|
|
|
- resultList.add(baseMapper.selectById(id));
|
|
|
+ resultList.add(this.baseMapper.getById(id));
|
|
|
}
|
|
|
}
|
|
|
return HttpResult.ok(resultList);
|
|
|
@@ -574,11 +599,11 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void importData(MultipartFile MultipartFile) {
|
|
|
+ public void importData(MultipartFile multipartFile) {
|
|
|
List<InsPlyIncome> list = null;
|
|
|
HashMap<String, Object> params = new HashMap<>();
|
|
|
try {
|
|
|
- List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(MultipartFile, InsPlyIncomeExcelDto.class, 0, 1, 1);
|
|
|
+ List<InsPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsPlyIncomeExcelDto.class, 0, 1, 1);
|
|
|
for (InsPlyIncomeExcelDto excelItem : dtoList) {
|
|
|
params.clear();
|
|
|
String licenseno = excelItem.getLicenseno();//车牌号
|
|
|
@@ -604,6 +629,167 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HashMap<String, Object> bxImportData(MultipartFile multipartFile) {
|
|
|
+ BigDecimal totalAmount=BigDecimal.ZERO;
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ StringBuffer strBuilder = new StringBuffer();
|
|
|
+ String ids="";
|
|
|
+ try {
|
|
|
+ List<InsBxPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsBxPlyIncomeExcelDto.class, 0, 1, 1);
|
|
|
+ for (InsBxPlyIncomeExcelDto excelItem : dtoList) {
|
|
|
+ params.clear();
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getLicenseno())){
|
|
|
+ String licenseno = excelItem.getLicenseno();//车牌号
|
|
|
+ params.put("licenseno",licenseno);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getPolicyno())){
|
|
|
+ String policyno = excelItem.getPolicyno(); //交强保单号
|
|
|
+ params.put("policyno",policyno);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getSyPolicyno())){
|
|
|
+ String syPolicyno = excelItem.getSyPolicyno(); //商业保单号
|
|
|
+ params.put("syPolicyno",syPolicyno);
|
|
|
+ }
|
|
|
+// 只查手续费
|
|
|
+ params.put("isOther","0");
|
|
|
+ params.put("isNotCar","0");
|
|
|
+ InsPlyIncome insPlyIncome = baseMapper.findByBxLicenseno(params);
|
|
|
+ strBuilder.append(insPlyIncome.getId()).append(",");
|
|
|
+ if( insPlyIncome.getCommissionFeevalue()!=null && insPlyIncome.getCommissionFeevalue().compareTo(BigDecimal.ZERO)!=0){
|
|
|
+ totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue()); //添加总手续费
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(strBuilder.length() >0){
|
|
|
+ ids = strBuilder.deleteCharAt(strBuilder.length() - 1).toString();
|
|
|
+ }
|
|
|
+ resultMap.put("ids",ids);
|
|
|
+ resultMap.put("totalAmount",totalAmount);
|
|
|
+ return resultMap;
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new SystemException("导入失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HashMap<String, Object> bxImportNoData(MultipartFile multipartFile) {
|
|
|
+ BigDecimal totalAmount=BigDecimal.ZERO;
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
+ HashMap<String, Object> resultMap = new HashMap<>();
|
|
|
+ StringBuffer strBuilder = new StringBuffer();
|
|
|
+ String ids="";
|
|
|
+ try {
|
|
|
+ List<InsBxNoPlyIncomeExcelDto> dtoList = ExcelEasypoiUtils.importExcel(multipartFile, InsBxNoPlyIncomeExcelDto.class, 0, 1, 1);
|
|
|
+ for (InsBxNoPlyIncomeExcelDto excelItem : dtoList) {
|
|
|
+ params.clear();
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getLicenseno())){
|
|
|
+ String licenseno = excelItem.getLicenseno();//车牌号
|
|
|
+ params.put("licenseno",licenseno);
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(excelItem.getNoPolicyno())){
|
|
|
+ String policyno = excelItem.getNoPolicyno(); //非车保单号
|
|
|
+ params.put("policyno",policyno);
|
|
|
+ }
|
|
|
+// 只查手续费
|
|
|
+ params.put("isOther","1");
|
|
|
+ InsPlyIncome insPlyIncome = baseMapper.findByBxLicenseno(params);
|
|
|
+ strBuilder.append(insPlyIncome.getId()).append(",");
|
|
|
+ totalAmount = totalAmount.add(insPlyIncome.getCommissionFeevalue()); //添加总手续费
|
|
|
+ }
|
|
|
+ if(strBuilder.length() >0){
|
|
|
+ ids = strBuilder.deleteCharAt(strBuilder.length() - 1).toString();
|
|
|
+ }
|
|
|
+ resultMap.put("ids",ids);
|
|
|
+ resultMap.put("totalAmount",totalAmount);
|
|
|
+ return resultMap;
|
|
|
+ } catch (IOException e) {
|
|
|
+ throw new SystemException("导入失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HttpResult bxOtherDetailsExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
+ params =this.saveParams(insPlyIncomeVo,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 uploadPath = this.uploadPath + "/excel/";
|
|
|
+ Path path = Paths.get(uploadPath);
|
|
|
+ if (!Files.exists(path)) {
|
|
|
+ try {
|
|
|
+ Files.createDirectories(path);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String fileName = EasyExcelUtils.downExcel(uploadPath, "保险跟单明细导出", BxOtherDetailsExcel.class, resultList);
|
|
|
+ return HttpResult.ok("",uploadUrl + "excel/" + fileName);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param insPlyIncomeVo 传参字段
|
|
|
+ * ids 通过ids中的id进行开票分组
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult<List<HashMap<String,Object>>> invicdetail(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
+ if(StringUtils.isNotEmpty(insPlyIncomeVo.getIds())){
|
|
|
+ String ids = insPlyIncomeVo.getIds();
|
|
|
+ String[] idArr = ids.split(",");
|
|
|
+ List<HashMap<String,Object>> result= this.baseMapper.groupByInvoic(idArr);
|
|
|
+ return HttpResult.ok(result);
|
|
|
+ }
|
|
|
+ return HttpResult.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /***
|
|
|
+ *
|
|
|
+ * @param insPlyIncomeVo
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @return 保险非车跟单明细导出
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public HttpResult bxNoOtherDetailsExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
+ params =this.saveParams(insPlyIncomeVo,params);
|
|
|
+ List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
|
|
|
+
|
|
|
+ ExportParams exportParams = new ExportParams("保险非车跟单明细导出", null, ExcelType.HSSF);
|
|
|
+ exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
+ List<BxNoOtherDetailsExcel> resultList = new ArrayList<>();
|
|
|
+ for (InsPlyIncome item :insPlyIncomes){
|
|
|
+ BxNoOtherDetailsExcel bxNoOtherDetailsExcel = new BxNoOtherDetailsExcel();
|
|
|
+ BeanUtils.copyProperties(item, bxNoOtherDetailsExcel);
|
|
|
+ resultList.add(bxNoOtherDetailsExcel);
|
|
|
+ }
|
|
|
+ String uploadPath = this.uploadPath + "/excel/";
|
|
|
+ Path path = Paths.get(uploadPath);
|
|
|
+ if (!Files.exists(path)) {
|
|
|
+ try {
|
|
|
+ Files.createDirectories(path);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String fileName = EasyExcelUtils.downExcel(uploadPath, "保险非车跟单明细导出", BxNoOtherDetailsExcel.class, resultList);
|
|
|
+ return HttpResult.ok("",uploadUrl + "excel/" + fileName);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void updateByEntity(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
@@ -707,6 +893,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
public void uodateBalance(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
InsPlyIncome insPlyIncome = new InsPlyIncome();
|
|
|
insPlyIncomeVo.setHandlingFeesStatus("1");
|
|
|
+ insPlyIncomeVo.setSettlementTime(LocalDate.now());
|
|
|
BeanUtils.copyProperties(insPlyIncomeVo, insPlyIncome);
|
|
|
baseMapper.uopdateByOrderno(insPlyIncome);
|
|
|
|
|
|
@@ -802,14 +989,16 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
@Transactional
|
|
|
public HttpResult<Object> batchInvoicing(InsPlyIncomeVo insPlyIncomeVo) {
|
|
|
// 开票时生成 记录 用来合计已经开票数据
|
|
|
- HashMap<String, Object> params = new HashMap<>();
|
|
|
- params = this.saveParams(insPlyIncomeVo, params);
|
|
|
- List<InsPlyIncome> list= this.baseMapper.queryNew(params);
|
|
|
- for (InsPlyIncome item : list){
|
|
|
- item.setHandlingFeesStatus("2"); //已开票
|
|
|
- item.setInvoicTime(LocalDate.now());
|
|
|
- item.setInvoicAmount(item.getCommissionFeevalue());
|
|
|
- baseMapper.updateById(item);
|
|
|
+ String ids = insPlyIncomeVo.getIds();
|
|
|
+ if(StringUtils.isNotEmpty(ids)){
|
|
|
+ String[] split = ids.split(",");
|
|
|
+ for (String id : split){
|
|
|
+ InsPlyIncome insPlyIncome = baseMapper.selectById(id);
|
|
|
+ insPlyIncome.setInvoicTime(LocalDate.now()); //开票时间
|
|
|
+ insPlyIncome.setInvoicId(insPlyIncomeVo.getInvoicId()); //开票号
|
|
|
+ insPlyIncome.setHandlingFeesStatus("2"); //2为开票
|
|
|
+ baseMapper.updateById(insPlyIncome);
|
|
|
+ }
|
|
|
}
|
|
|
return HttpResult.ok();
|
|
|
}
|
|
|
@@ -911,7 +1100,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
params =this.saveParams(insPlyIncomeVo,params);
|
|
|
List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
|
|
|
|
|
|
- ExportParams exportParams = new ExportParams("保险手续费导出", null, ExcelType.HSSF);
|
|
|
+ ExportParams exportParams = new ExportParams("平台手续费", null, ExcelType.HSSF);
|
|
|
exportParams.setStyle(ExcelStyleUtil.class);
|
|
|
List<SettlementFeesExcel> resultList = new ArrayList<>();
|
|
|
for (InsPlyIncome item :insPlyIncomes){
|
|
|
@@ -928,9 +1117,8 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- String fileName = EasyExcelUtils.downExcel(uploadPath, "保险手续费导出", SettlementFeesExcel.class, resultList);
|
|
|
+ String fileName = EasyExcelUtils.downExcel(uploadPath, "平台手续费导出", SettlementFeesExcel.class, resultList);
|
|
|
return HttpResult.ok("",uploadUrl + "excel/" + fileName);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -939,11 +1127,12 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
params =this.saveParams(insPlyIncomeVo,params);
|
|
|
List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
|
|
|
|
|
|
- ExportParams exportParams = new ExportParams("平台手续费", null, ExcelType.HSSF);
|
|
|
+ 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);
|
|
|
}
|
|
|
@@ -956,7 +1145,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- String fileName = EasyExcelUtils.downExcel(uploadPath, "平台手续费导出", BxSettlementFeesExcel.class, resultList);
|
|
|
+ String fileName = EasyExcelUtils.downExcel(uploadPath, "保险手续费导出", BxSettlementFeesExcel.class, resultList);
|
|
|
return HttpResult.ok("",uploadUrl + "excel/" + fileName);
|
|
|
}
|
|
|
|
|
|
@@ -1000,4 +1189,5 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|