|
@@ -3,7 +3,11 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alipay.sofa.runtime.api.annotation.SofaReference;
|
|
import com.alipay.sofa.runtime.api.annotation.SofaReference;
|
|
import com.alipay.sofa.runtime.api.annotation.SofaService;
|
|
import com.alipay.sofa.runtime.api.annotation.SofaService;
|
|
|
|
+import com.aliyun.oss.OSSClient;
|
|
|
|
+import com.aliyun.oss.model.ObjectMetadata;
|
|
|
|
+import com.aliyun.oss.model.PutObjectRequest;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.winsea.svc.base.base.entity.CommonCompany;
|
|
import com.winsea.svc.base.base.entity.CommonCompany;
|
|
@@ -19,15 +23,19 @@ import com.winsea.svc.base.workflow.entity.Workflow;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.view.ExportVView;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.view.PaymentView;
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.YException;
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.YException;
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.PaymentManagementMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.PaymentManagementMapper;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.service.*;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
import com.yh.saas.plugin.yiliangyiyun.util.QRCodeUtil;
|
|
import com.yh.saas.plugin.yiliangyiyun.util.QRCodeUtil;
|
|
|
|
+import lombok.Getter;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.httpclient.util.DateUtil;
|
|
import org.apache.commons.httpclient.util.DateUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.apache.http.entity.ContentType;
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
import org.apache.poi.ss.usermodel.Font;
|
|
import org.apache.poi.ss.usermodel.Font;
|
|
@@ -36,17 +44,19 @@ import org.apache.poi.ss.usermodel.Workbook;
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
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;
|
|
|
|
+import org.springframework.mock.web.MockMultipartFile;
|
|
import org.springframework.stereotype.Service;
|
|
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 javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
-import java.io.ByteArrayOutputStream;
|
|
|
|
-import java.io.File;
|
|
|
|
-import java.io.IOException;
|
|
|
|
|
|
+import java.io.*;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.net.URLDecoder;
|
|
import java.net.URLDecoder;
|
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
|
+import java.text.DateFormat;
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -104,6 +114,13 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
private String localPath;
|
|
private String localPath;
|
|
@Autowired
|
|
@Autowired
|
|
private QRCodeUtil qrCodeUtil ;
|
|
private QRCodeUtil qrCodeUtil ;
|
|
|
|
+ @Autowired
|
|
|
|
+ private OSSClient ossClient;
|
|
|
|
+ @Value("${oss.endpoint.internal:}")
|
|
|
|
+ private String baseUrl;
|
|
|
|
+ @Getter
|
|
|
|
+ @Value("${oss.bucket.name:}")
|
|
|
|
+ private String bucket;
|
|
/**
|
|
/**
|
|
* 付款管理列表
|
|
* 付款管理列表
|
|
*
|
|
*
|
|
@@ -1125,7 +1142,6 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
imperfectGrainTotal = imperfectGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getImperfectGrain()!=null?paymentManagement1.getQualityInspectionManagement().getImperfectGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
imperfectGrainTotal = imperfectGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getImperfectGrain()!=null?paymentManagement1.getQualityInspectionManagement().getImperfectGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
bulkDensityTotal = bulkDensityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getBulkDensity()!=null?paymentManagement1.getQualityInspectionManagement().getBulkDensity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
bulkDensityTotal = bulkDensityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getBulkDensity()!=null?paymentManagement1.getQualityInspectionManagement().getBulkDensity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
jiaorenliTotal = jiaorenliTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getJiaorenli()!=null?paymentManagement1.getQualityInspectionManagement().getJiaorenli():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
jiaorenliTotal = jiaorenliTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getJiaorenli()!=null?paymentManagement1.getQualityInspectionManagement().getJiaorenli():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
-// netWeightPriceTotal = netWeightPriceTotal + (Double.valueOf(String.valueOf(paymentManagement1.getTidalGrainPrice())));
|
|
|
|
netWeightTotal = netWeightTotal + (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight())));
|
|
netWeightTotal = netWeightTotal + (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight())));
|
|
amountIngPayableTotal = amountIngPayableTotal + paymentManagement1.getAmountIngPayable();
|
|
amountIngPayableTotal = amountIngPayableTotal + paymentManagement1.getAmountIngPayable();
|
|
}
|
|
}
|
|
@@ -1326,21 +1342,8 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
|
|
|
|
// 详情信息
|
|
// 详情信息
|
|
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(paymentManagement.getPaymentManagementList())) {
|
|
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(paymentManagement.getPaymentManagementList())) {
|
|
-
|
|
|
|
-
|
|
|
|
for (int i = 0; i < paymentManagement.getPaymentManagementList().size(); i++) {
|
|
for (int i = 0; i < paymentManagement.getPaymentManagementList().size(); i++) {
|
|
PaymentManagement paymentManagement1 = paymentManagement.getPaymentManagementList().get(i);
|
|
PaymentManagement paymentManagement1 = paymentManagement.getPaymentManagementList().get(i);
|
|
- paymentManagement1.setIdentityAuthenticationInfo(iIdentityAuthenticationInfoService.selectById(paymentManagement1.getIdentityId()));
|
|
|
|
- paymentManagement1.setQualityInspectionManagement(qualityInspectionManagementService.selectOne(
|
|
|
|
- new EntityWrapper<QualityInspectionManagement>()
|
|
|
|
- .eq("relation_id", paymentManagement1.getRelationId())
|
|
|
|
- .eq("comp_id", paymentManagement1.getCompId())
|
|
|
|
- ));
|
|
|
|
- paymentManagement1.setWeighingManagement(weighingManagementService.selectOne(
|
|
|
|
- new EntityWrapper<WeighingManagement>()
|
|
|
|
- .eq("relation_id", paymentManagement1.getRelationId())
|
|
|
|
- .eq("comp_id", paymentManagement1.getCompId())
|
|
|
|
- ));
|
|
|
|
HSSFRow rowx = sheet.createRow((int) rownum);
|
|
HSSFRow rowx = sheet.createRow((int) rownum);
|
|
rowx.setHeightInPoints(20);
|
|
rowx.setHeightInPoints(20);
|
|
cell = rowx.createCell(1);
|
|
cell = rowx.createCell(1);
|
|
@@ -1451,17 +1454,6 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
cell.setCellValue(editString(paymentManagement1.getIdentityAuthenticationInfo().getBankDeposit() + "-" +paymentManagement1.getIdentityAuthenticationInfo().getBankDepositBranch()));
|
|
cell.setCellValue(editString(paymentManagement1.getIdentityAuthenticationInfo().getBankDeposit() + "-" +paymentManagement1.getIdentityAuthenticationInfo().getBankDepositBranch()));
|
|
cell.setCellStyle(styleDetail);
|
|
cell.setCellStyle(styleDetail);
|
|
|
|
|
|
-// //水分累计和
|
|
|
|
-// waterContentTotal = waterContentTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getWaterContent()!=null?paymentManagement1.getQualityInspectionManagement().getWaterContent():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
-// impurityTotal = impurityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getImpurity()!=null?paymentManagement1.getQualityInspectionManagement().getImpurity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
-// mildewGrainTotal = mildewGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getMildewGrain()!=null?paymentManagement1.getQualityInspectionManagement().getMildewGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
-// imperfectGrainTotal = imperfectGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getImperfectGrain()!=null?paymentManagement1.getQualityInspectionManagement().getImperfectGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
-// bulkDensityTotal = bulkDensityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getBulkDensity()!=null?paymentManagement1.getQualityInspectionManagement().getBulkDensity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
-// jiaorenliTotal = jiaorenliTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getJiaorenli()!=null?paymentManagement1.getQualityInspectionManagement().getJiaorenli():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
-//// netWeightPriceTotal = netWeightPriceTotal + (Double.valueOf(String.valueOf(paymentManagement1.getTidalGrainPrice())));
|
|
|
|
-// netWeightTotal = netWeightTotal + (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight())));
|
|
|
|
-// amountIngPayableTotal = amountIngPayableTotal + paymentManagement1.getAmountIngPayable();
|
|
|
|
-
|
|
|
|
rownum++;
|
|
rownum++;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1493,6 +1485,938 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 手机审核文件下载
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public String exportPhone(PaymentManagement paymentManagement, HttpServletResponse response) throws Exception {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ // 查询
|
|
|
|
+// Page<ContractManagementInfo> contractManagementInfoPage = this.selectInfo(example);
|
|
|
|
+// List<ContractManagementInfo> contractManagementInfos = contractManagementInfoPage.getRecords();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 1.Excel的头部信息
|
|
|
|
+ String headerTitle = "";
|
|
|
|
+
|
|
|
|
+ // 2.创建一个webbook 对应一个Excel文件
|
|
|
|
+ HSSFWorkbook wb = new HSSFWorkbook();
|
|
|
|
+
|
|
|
|
+ // 3.在webbook中添加一个sheet,对应Excel文件中的sheet
|
|
|
|
+ HSSFSheet sheet;
|
|
|
|
+
|
|
|
|
+ sheet = wb.createSheet("付款管理信息");
|
|
|
|
+ headerTitle = "付款管理信息";
|
|
|
|
+
|
|
|
|
+ // 4.设置打印参数
|
|
|
|
+ sheet.setMargin(HSSFSheet.TopMargin, (short) 1);// 页边距(上)
|
|
|
|
+ sheet.setMargin(HSSFSheet.BottomMargin, (short) 1);// 页边距(下)
|
|
|
|
+ sheet.setMargin(HSSFSheet.LeftMargin, (short) 1);// 页边距(左)
|
|
|
|
+ sheet.setMargin(HSSFSheet.RightMargin, (short) 1);// 页边距(右)
|
|
|
|
+
|
|
|
|
+ // 不显示网格
|
|
|
|
+ sheet.setDisplayGridlines(false);
|
|
|
|
+ // 设置水平居中
|
|
|
|
+ sheet.setHorizontallyCenter(true);
|
|
|
|
+
|
|
|
|
+ /**************** 数据行样式 start ****************/
|
|
|
|
+ HSSFFont fontTitle = wb.createFont();
|
|
|
|
+ fontTitle.setFontName("宋体");
|
|
|
|
+ fontTitle.setFontHeightInPoints((short) 14);
|
|
|
|
+ // 设置字体加粗
|
|
|
|
+ fontTitle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
|
|
|
+
|
|
|
|
+ HSSFFont fontComp = wb.createFont();
|
|
|
|
+ fontComp.setFontName("宋体");
|
|
|
|
+ fontComp.setFontHeightInPoints((short) 16);
|
|
|
|
+ // 设置字体加粗
|
|
|
|
+ fontComp.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
|
|
|
+
|
|
|
|
+ HSSFFont fontDetail = wb.createFont();
|
|
|
|
+ fontDetail.setFontName("宋体");
|
|
|
|
+ fontDetail.setFontHeightInPoints((short) 12);
|
|
|
|
+
|
|
|
|
+ HSSFFont fontDetail1 = wb.createFont();
|
|
|
|
+ fontDetail1.setFontName("宋体");
|
|
|
|
+ fontDetail1.setFontHeightInPoints((short) 12);
|
|
|
|
+ fontDetail1.setColor(HSSFColor.RED.index);
|
|
|
|
+
|
|
|
|
+ // title
|
|
|
|
+ HSSFCellStyle styleTitle = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ styleTitle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ styleTitle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ styleTitle.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ styleTitle.setFont(fontTitle);
|
|
|
|
+ // 右边框
|
|
|
|
+ styleTitle.setBorderRight(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 左边框
|
|
|
|
+ styleTitle.setBorderLeft(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 上边框
|
|
|
|
+ styleTitle.setBorderTop(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 下边框
|
|
|
|
+ styleTitle.setBorderBottom(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+
|
|
|
|
+ // title
|
|
|
|
+ HSSFCellStyle styleComp = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ styleComp.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ styleComp.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ styleComp.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ styleComp.setFont(fontComp);
|
|
|
|
+ // 右边框
|
|
|
|
+ styleComp.setBorderRight(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 左边框
|
|
|
|
+ styleComp.setBorderLeft(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 上边框
|
|
|
|
+ styleComp.setBorderTop(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 下边框
|
|
|
|
+ styleComp.setBorderBottom(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+
|
|
|
|
+ HSSFCellStyle styleInfo = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ styleInfo.setAlignment(HSSFCellStyle.ALIGN_LEFT);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ styleInfo.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ styleInfo.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ styleInfo.setFont(fontDetail);
|
|
|
|
+ // 右边框
|
|
|
|
+ styleInfo.setBorderRight(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 左边框
|
|
|
|
+ styleInfo.setBorderLeft(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 上边框
|
|
|
|
+ styleInfo.setBorderTop(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+ // 下边框
|
|
|
|
+ styleInfo.setBorderBottom(HSSFCellStyle.BORDER_NONE);
|
|
|
|
+
|
|
|
|
+ HSSFCellStyle styleDetail = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ styleDetail.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ styleDetail.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ styleDetail.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ styleDetail.setFont(fontDetail);
|
|
|
|
+ // 右边框
|
|
|
|
+ styleDetail.setBorderRight(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 左边框
|
|
|
|
+ styleDetail.setBorderLeft(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 上边框
|
|
|
|
+ styleDetail.setBorderTop(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 下styleDetailTitle
|
|
|
|
+ styleDetail.setBorderBottom(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+
|
|
|
|
+ HSSFCellStyle styleDetail1 = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ styleDetail1.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ styleDetail1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ styleDetail1.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ styleDetail1.setFont(fontDetail1);
|
|
|
|
+ // 右边框
|
|
|
|
+ styleDetail1.setBorderRight(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 左边框
|
|
|
|
+ styleDetail1.setBorderLeft(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 上边框
|
|
|
|
+ styleDetail1.setBorderTop(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 下styleDetailTitle
|
|
|
|
+ styleDetail1.setBorderBottom(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+
|
|
|
|
+ HSSFCellStyle contextstyle = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ contextstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ contextstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ contextstyle.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ contextstyle.setFont(fontDetail);
|
|
|
|
+ // 右边框
|
|
|
|
+ contextstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 左边框
|
|
|
|
+ contextstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 上边框
|
|
|
|
+ contextstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 下styleDetailTitle
|
|
|
|
+ contextstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+
|
|
|
|
+ HSSFCellStyle contextstyle1 = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ contextstyle1.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ contextstyle1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ contextstyle1.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ contextstyle1.setFont(fontDetail1);
|
|
|
|
+ // 右边框
|
|
|
|
+ contextstyle1.setBorderRight(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 左边框
|
|
|
|
+ contextstyle1.setBorderLeft(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 上边框
|
|
|
|
+ contextstyle1.setBorderTop(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 下styleDetailTitle
|
|
|
|
+ contextstyle1.setBorderBottom(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+
|
|
|
|
+ HSSFCellStyle styleDetailYellow = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ styleDetailYellow.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ styleDetailYellow.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ styleDetailYellow.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ styleDetailYellow.setFont(fontDetail);
|
|
|
|
+ // 右边框
|
|
|
|
+ styleDetailYellow.setBorderRight(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 左边框
|
|
|
|
+ styleDetailYellow.setBorderLeft(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 上边框
|
|
|
|
+ styleDetailYellow.setBorderTop(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 下styleDetailTitle
|
|
|
|
+ styleDetailYellow.setBorderBottom(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ styleDetailYellow.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
|
|
|
|
+ styleDetailYellow.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ HSSFCellStyle styleDetailLeft = wb.createCellStyle();
|
|
|
|
+ // 指定单元格居中对齐
|
|
|
|
+ styleDetailLeft.setAlignment(HSSFCellStyle.ALIGN_LEFT);
|
|
|
|
+ // 指定单元格垂直居中对齐
|
|
|
|
+ styleDetailLeft.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
|
|
|
+ // 指定单元格自动换行
|
|
|
|
+ styleDetailLeft.setWrapText(true);
|
|
|
|
+ // 设置单元格字体
|
|
|
|
+ styleDetailLeft.setFont(fontDetail);
|
|
|
|
+ // 右边框
|
|
|
|
+ styleDetailLeft.setBorderRight(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 左边框
|
|
|
|
+ styleDetailLeft.setBorderLeft(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 上边框
|
|
|
|
+ styleDetailLeft.setBorderTop(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ // 下styleDetailTitle
|
|
|
|
+ styleDetailLeft.setBorderBottom(HSSFCellStyle.BORDER_THIN);
|
|
|
|
+ /**************** 数据行样式 end ****************/
|
|
|
|
+
|
|
|
|
+ // 设置列宽
|
|
|
|
+ sheet.setColumnWidth(0, 1 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(1, "采购公司".getBytes().length*3*256);
|
|
|
|
+ sheet.setColumnWidth(2, "收货仓库".getBytes().length*25/10*256);
|
|
|
|
+ sheet.setColumnWidth(3, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(4, "开票日期".getBytes().length*2*256);
|
|
|
|
+ sheet.setColumnWidth(5, "业务编号".getBytes().length*2*256);
|
|
|
|
+ sheet.setColumnWidth(6, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(7, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(8, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(9, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(10, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(11, "货名".getBytes().length*3*256);
|
|
|
|
+ sheet.setColumnWidth(12, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(13, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(14, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(15, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(16, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(17, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(18, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(19, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(20, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(21, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(22, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(23, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(24, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(25, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(26, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(27, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(28, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(29, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(30, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(31, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(32, 12 * 256 + 184);
|
|
|
|
+ sheet.setColumnWidth(33, "卡号".getBytes().length*4*256);
|
|
|
|
+ sheet.setColumnWidth(34, "开户支行".getBytes().length*4*256);
|
|
|
|
+ sheet.setColumnWidth(35, 1 * 256 + 184);
|
|
|
|
+
|
|
|
|
+ // 创建单元格对象
|
|
|
|
+ HSSFCell cell = null;
|
|
|
|
+
|
|
|
|
+ // 创建打印设置对象
|
|
|
|
+ HSSFPrintSetup ps = sheet.getPrintSetup();
|
|
|
|
+ // 打印方向,true:横向,false:纵向(默认)
|
|
|
|
+ ps.setLandscape(false);
|
|
|
|
+ // // 打印质量
|
|
|
|
+ // ps.setVResolution((short) 700)
|
|
|
|
+ // 设置缩放比例
|
|
|
|
+ ps.setScale((short) 80);
|
|
|
|
+ // 纸张类型
|
|
|
|
+ ps.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ int rownum = 1;
|
|
|
|
+ HSSFRow row0 = sheet.createRow((int) rownum);
|
|
|
|
+ row0.setHeightInPoints(25);
|
|
|
|
+ cell = row0.createCell(1);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell.setCellValue("付款信息");
|
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, (short) 1, (short) 22));
|
|
|
|
+ cell = row0.createCell(2);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(3);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(4);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(5);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(6);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(7);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(8);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(9);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(10);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(11);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(12);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(13);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(14);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(15);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(16);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(17);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(18);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(19);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(20);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(21);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(22);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(23);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(24);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(25);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(26);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(27);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(28);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(29);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(30);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(31);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(32);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(33);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ cell = row0.createCell(34);
|
|
|
|
+ cell.setCellStyle(styleTitle);
|
|
|
|
+ rownum++;
|
|
|
|
+
|
|
|
|
+ List<String> businessKeys = null;
|
|
|
|
+ if ("1".equals(paymentManagement.getSearchType())) {
|
|
|
|
+ businessKeys = workflowService.getTaskBusinessKeysByCode("PAYMENT-MANAGEMENT-APPROVE");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
|
+ // 仓库名称
|
|
|
|
+ pageView.put("warehouseName", paymentManagement.getWarehouseName());
|
|
|
|
+ pageView.put("businessKeys", businessKeys);
|
|
|
|
+ // 查询付款总数
|
|
|
|
+ List<PaymentManagement> dataList = baseMapper.getListByConditionOut(pageView);
|
|
|
|
+
|
|
|
|
+// String para = "";
|
|
|
|
+// if (!CollectionUtils.isEmpty(businessKeys)){
|
|
|
|
+// for(int i=0;i<businessKeys.size();i++){
|
|
|
|
+// para +=businessKeys.get(i);
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// Wrapper<PaymentManagement> paymentManagementWrapper = new EntityWrapper<>();
|
|
|
|
+// paymentManagementWrapper.in("id",para);
|
|
|
|
+// paymentManagementWrapper.eq("warehouse_name",paymentManagement.getWarehouseName());
|
|
|
|
+// paymentManagementWrapper.eq("delete_flag","0");
|
|
|
|
+// List<PaymentManagement> paymentManagements = this.selectList(paymentManagementWrapper);
|
|
|
|
+
|
|
|
|
+ Double waterContentTotal = 0d;//水分合计
|
|
|
|
+ Double impurityTotal = 0d;//杂质合计
|
|
|
|
+ Double mildewGrainTotal = 0d;//霉变粒合计
|
|
|
|
+ Double imperfectGrainTotal = 0d;//不完善粒合计
|
|
|
|
+ Double bulkDensityTotal = 0d;//容重合计
|
|
|
|
+ Double jiaorenliTotal = 0d;//热损伤合计
|
|
|
|
+ Double netWeightTotal = 0d;//净重合计
|
|
|
|
+ Double amountIngPayableTotal = 0d;//应收合计
|
|
|
|
+ for (int i = 0; i < dataList.size(); i++) {
|
|
|
|
+ PaymentManagement paymentManagement1 = dataList.get(i);
|
|
|
|
+// paymentManagement1.setIdentityAuthenticationInfo(iIdentityAuthenticationInfoService.selectById(paymentManagement1.getIdentityId()));
|
|
|
|
+// Wrapper<IdentityAuthenticationInfo> identityAuthenticationInfoWrapper = new EntityWrapper<>();
|
|
|
|
+// identityAuthenticationInfoWrapper.eq("customer_name",paymentManagement1.getCustomerName());
|
|
|
|
+// identityAuthenticationInfoWrapper.eq("customer_phone",paymentManagement1.getCustomerPhone());
|
|
|
|
+// identityAuthenticationInfoWrapper.eq("customer_number_card",paymentManagement1.getCustomerNumberCard());
|
|
|
|
+// identityAuthenticationInfoWrapper.eq("delete_flag","0");
|
|
|
|
+// if (identityAuthenticationInfoWrapper != null){
|
|
|
|
+// paymentManagement1.setIdentityAuthenticationInfo(iIdentityAuthenticationInfoService.selectOne(identityAuthenticationInfoWrapper));
|
|
|
|
+// }
|
|
|
|
+// Wrapper<QualityInspectionManagement> qualityInspectionManagementWrapper = new EntityWrapper<>();
|
|
|
|
+// qualityInspectionManagementWrapper.eq("relation_id", paymentManagement1.getRelationId());
|
|
|
|
+// qualityInspectionManagementWrapper.eq("comp_id", paymentManagement1.getCompId());
|
|
|
|
+// if (qualityInspectionManagementWrapper != null){
|
|
|
|
+// paymentManagement1.setQualityInspectionManagement(qualityInspectionManagementService.selectOne(qualityInspectionManagementWrapper));
|
|
|
|
+// }
|
|
|
|
+// Wrapper<WeighingManagement> weighingManagementWrapper = new EntityWrapper<>();
|
|
|
|
+// weighingManagementWrapper.eq("relation_id", paymentManagement1.getRelationId());
|
|
|
|
+// weighingManagementWrapper.eq("comp_id", paymentManagement1.getCompId());
|
|
|
|
+// if (weighingManagementWrapper != null){
|
|
|
|
+// paymentManagement1.setWeighingManagement(weighingManagementService.selectOne(weighingManagementWrapper));
|
|
|
|
+// }
|
|
|
|
+ //水分累计和
|
|
|
|
+ waterContentTotal = waterContentTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getWaterContent()!=null?paymentManagement1.getWaterContent():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ impurityTotal = impurityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getImpurity()!=null?paymentManagement1.getImpurity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ mildewGrainTotal = mildewGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getMildewGrain()!=null?paymentManagement1.getMildewGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ imperfectGrainTotal = imperfectGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getImperfectGrain()!=null?paymentManagement1.getImperfectGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ bulkDensityTotal = bulkDensityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getBulkDensity()!=null?paymentManagement1.getBulkDensity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ jiaorenliTotal = jiaorenliTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getJiaorenli()!=null?paymentManagement1.getJiaorenli():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ netWeightTotal = netWeightTotal + (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight())));
|
|
|
|
+ amountIngPayableTotal = amountIngPayableTotal + paymentManagement1.getAmountIngPayable();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ HSSFRow rowp = sheet.createRow((int)(rownum));
|
|
|
|
+ rowp.setHeightInPoints(20);
|
|
|
|
+ cell = rowp.createCell(1);
|
|
|
|
+ cell.setCellValue("平均值/合计");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(2);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(3);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(4);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(5);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(6);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(7);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(8);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(9);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(10);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(11);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(12);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(13);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ //水分平均值
|
|
|
|
+ cell = rowp.createCell(14);
|
|
|
|
+ cell.setCellValue(waterContentTotal/netWeightTotal);
|
|
|
|
+ cell.setCellStyle(contextstyle1);
|
|
|
|
+ cell = rowp.createCell(15);
|
|
|
|
+ cell.setCellValue(impurityTotal/netWeightTotal);
|
|
|
|
+ cell.setCellStyle(contextstyle1);
|
|
|
|
+ cell = rowp.createCell(16);
|
|
|
|
+ cell.setCellValue(mildewGrainTotal/netWeightTotal);
|
|
|
|
+ cell.setCellStyle(contextstyle1);
|
|
|
|
+ cell = rowp.createCell(17);
|
|
|
|
+ cell.setCellValue(imperfectGrainTotal/netWeightTotal);
|
|
|
|
+ cell.setCellStyle(contextstyle1);
|
|
|
|
+ cell = rowp.createCell(18);
|
|
|
|
+ cell.setCellValue(bulkDensityTotal/netWeightTotal);
|
|
|
|
+ cell.setCellStyle(contextstyle1);
|
|
|
|
+ cell = rowp.createCell(19);
|
|
|
|
+ cell.setCellValue(jiaorenliTotal/netWeightTotal);
|
|
|
|
+ cell.setCellStyle(contextstyle1);
|
|
|
|
+ cell = rowp.createCell(20);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(21);
|
|
|
|
+ cell.setCellValue(dataList.size());
|
|
|
|
+ cell.setCellStyle(styleDetail1);
|
|
|
|
+ cell = rowp.createCell(22);
|
|
|
|
+ cell.setCellValue(amountIngPayableTotal/netWeightTotal);
|
|
|
|
+ cell.setCellStyle(contextstyle1);
|
|
|
|
+ cell = rowp.createCell(23);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(24);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(25);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ //净重合计
|
|
|
|
+ cell = rowp.createCell(26);
|
|
|
|
+ cell.setCellValue(netWeightTotal);
|
|
|
|
+ cell.setCellStyle(styleDetail1);
|
|
|
|
+ cell = rowp.createCell(27);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(28);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(29);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(30);
|
|
|
|
+ cell.setCellValue(amountIngPayableTotal);
|
|
|
|
+ cell.setCellStyle(styleDetail1);
|
|
|
|
+ cell = rowp.createCell(31);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(32);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(33);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowp.createCell(34);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ rownum++;
|
|
|
|
+
|
|
|
|
+ HSSFRow row1 = sheet.createRow((int) rownum);
|
|
|
|
+ row1.setHeightInPoints(30);
|
|
|
|
+ cell = row1.createCell(1);
|
|
|
|
+ cell.setCellValue("采购公司");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(2);
|
|
|
|
+ cell.setCellValue("收货仓库");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(3);
|
|
|
|
+ cell.setCellValue("仓位号");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(4);
|
|
|
|
+ cell.setCellValue("开票日期");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(5);
|
|
|
|
+ cell.setCellValue("业务编号");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(6);
|
|
|
|
+ cell.setCellValue("客户");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(7);
|
|
|
|
+ cell.setCellValue("供应商");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(8);
|
|
|
|
+ cell.setCellValue("初检员");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(9);
|
|
|
|
+ cell.setCellValue("复检员");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(10);
|
|
|
|
+ cell.setCellValue("检斤员");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(11);
|
|
|
|
+ cell.setCellValue("货名");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(12);
|
|
|
|
+ cell.setCellValue("类型");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(13);
|
|
|
|
+ cell.setCellValue("等级");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(14);
|
|
|
|
+ cell.setCellValue("水分");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(15);
|
|
|
|
+ cell.setCellValue("杂质");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(16);
|
|
|
|
+ cell.setCellValue("霉变粒");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(17);
|
|
|
|
+ cell.setCellValue("不完善粒");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(18);
|
|
|
|
+ cell.setCellValue("容重");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(19);
|
|
|
|
+ cell.setCellValue("热损伤");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(20);
|
|
|
|
+ cell.setCellValue("车牌号");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(21);
|
|
|
|
+ cell.setCellValue("车数");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(22);
|
|
|
|
+ cell.setCellValue("净重单价");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(23);
|
|
|
|
+ cell.setCellValue("毛重");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(24);
|
|
|
|
+ cell.setCellValue("皮重");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(25);
|
|
|
|
+ cell.setCellValue("扣重");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(26);
|
|
|
|
+ cell.setCellValue("净重");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(27);
|
|
|
|
+ cell.setCellValue("扣单价");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(28);
|
|
|
|
+ cell.setCellValue("纯重单价");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(29);
|
|
|
|
+ cell.setCellValue("纯重");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(30);
|
|
|
|
+ cell.setCellValue("合计应付");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(31);
|
|
|
|
+ cell.setCellValue("实付金额");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(32);
|
|
|
|
+ cell.setCellValue("姓名");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(33);
|
|
|
|
+ cell.setCellValue("卡号");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = row1.createCell(34);
|
|
|
|
+ cell.setCellValue("开户支行");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ rownum++;
|
|
|
|
+
|
|
|
|
+ DecimalFormat decimalFormat=new DecimalFormat(".00");
|
|
|
|
+ String compName = commonCompanyService.selectById(AuthSecurityUtils.getCurrentUserInfo().getCompId()).getCompName();
|
|
|
|
+
|
|
|
|
+ // 详情信息
|
|
|
|
+ if (org.apache.commons.collections.CollectionUtils.isNotEmpty(dataList)) {
|
|
|
|
+ for (int i = 0; i < dataList.size(); i++) {
|
|
|
|
+ PaymentManagement paymentManagement1 = dataList.get(i);
|
|
|
|
+
|
|
|
|
+ HSSFRow rowx = sheet.createRow((int) rownum);
|
|
|
|
+ rowx.setHeightInPoints(20);
|
|
|
|
+ cell = rowx.createCell(1);
|
|
|
|
+ cell.setCellValue(compName);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(2);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getWarehouseName()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(3);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getBinNumber()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(4);
|
|
|
|
+ String date = addDateOneDay(paymentManagement1.getCreateDate());
|
|
|
|
+ cell.setCellValue(date);
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(5);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getPaymentNo()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(6);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getCustomerName()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(7);
|
|
|
|
+ if (paymentManagement1 != null){
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getSupplier()));
|
|
|
|
+ }
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(8);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getQualityInspector()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(9);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getReInspector()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(10);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getSkinInspector()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(11);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getGoodsName()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(12);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getType()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(13);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getGrade()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ HSSFDataFormat df = wb.createDataFormat(); // 此处设置数据格式
|
|
|
|
+ contextstyle.setDataFormat(df.getBuiltinFormat("#,##0.00"));//保留两位小数点
|
|
|
|
+ HSSFDataFormat df1 = wb.createDataFormat(); // 此处设置数据格式
|
|
|
|
+ contextstyle1.setDataFormat(df1.getBuiltinFormat("#,##0.00"));//保留两位小数点
|
|
|
|
+ cell = rowx.createCell(14);
|
|
|
|
+ cell.setCellValue(Double.parseDouble(paymentManagement1.getWaterContent()!=null?paymentManagement1.getWaterContent():"0"));
|
|
|
|
+ cell.setCellStyle(contextstyle);
|
|
|
|
+ cell = rowx.createCell(15);
|
|
|
|
+ cell.setCellValue(Double.parseDouble(paymentManagement1.getImpurity()!=null?paymentManagement1.getImpurity():"0"));
|
|
|
|
+ cell.setCellStyle(contextstyle);
|
|
|
|
+ cell = rowx.createCell(16);
|
|
|
|
+ cell.setCellValue(Double.parseDouble(paymentManagement1.getMildewGrain()!=null?paymentManagement1.getMildewGrain():"0"));
|
|
|
|
+ cell.setCellStyle(contextstyle);
|
|
|
|
+ cell = rowx.createCell(17);
|
|
|
|
+ cell.setCellValue(Double.parseDouble(paymentManagement1.getImperfectGrain()!=null?paymentManagement1.getImperfectGrain():"0"));
|
|
|
|
+ cell.setCellStyle(contextstyle);
|
|
|
|
+ cell = rowx.createCell(18);
|
|
|
|
+ cell.setCellValue(Double.parseDouble(paymentManagement1.getBulkDensity()!=null?paymentManagement1.getBulkDensity():"0"));
|
|
|
|
+ cell.setCellStyle(contextstyle);
|
|
|
|
+ cell = rowx.createCell(19);
|
|
|
|
+ cell.setCellValue(Double.parseDouble(paymentManagement1.getJiaorenli()!=null?paymentManagement1.getJiaorenli():"0"));
|
|
|
|
+ cell.setCellStyle(contextstyle);
|
|
|
|
+ cell = rowx.createCell(20);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getCarNo()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(21);
|
|
|
|
+ cell.setCellValue("1");
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(22);
|
|
|
|
+ cell.setCellValue(new Formatter().format("%.3f", editFloat(paymentManagement1.getTidalGrainPrice())).toString());
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(23);
|
|
|
|
+ cell.setCellValue(editFloat(paymentManagement1.getGrossWeight()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(24);
|
|
|
|
+ cell.setCellValue(editFloat(paymentManagement1.getTare()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(25);
|
|
|
|
+ cell.setCellValue(new Formatter().format("%.2f", editFloat(paymentManagement1.getWeightDeduction())).toString());
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(26);
|
|
|
|
+ cell.setCellValue(editFloat(paymentManagement1.getNetWeight()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(27);
|
|
|
|
+ cell.setCellValue(editDouble(paymentManagement1.getUnitDeduction()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(28);
|
|
|
|
+ cell.setCellValue(new Formatter().format("%.2f", editFloat(paymentManagement1.getSolidGrainPrice())).toString());
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(29);
|
|
|
|
+ cell.setCellValue(editFloat(paymentManagement1.getPureWeight()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(30);
|
|
|
|
+ cell.setCellValue(editDouble(paymentManagement1.getAmountIngPayable()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(31);
|
|
|
|
+ cell.setCellValue(editDouble(paymentManagement1.getAmountEdPayable()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(32);
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getCustomerName()));
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(33);
|
|
|
|
+ if(paymentManagement1 != null){
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getBankCard()));
|
|
|
|
+ }
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ cell = rowx.createCell(34);
|
|
|
|
+ if(paymentManagement1 != null){
|
|
|
|
+ cell.setCellValue(editString(paymentManagement1.getBankDeposit() + "-" +paymentManagement1.getBankDepositBranch()));
|
|
|
|
+ }
|
|
|
|
+ cell.setCellStyle(styleDetail);
|
|
|
|
+ rownum++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ String path = null;
|
|
|
|
+ String tempPath = null;
|
|
|
|
+ String excelPath = null;
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ // 取得绝对路径
|
|
|
|
+ tempPath = URLDecoder.decode((localPath), "utf-8");
|
|
|
|
+
|
|
|
|
+ // EXCEL路径
|
|
|
|
+ excelPath = "/web/temp/pay/" + DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYYMMDD_NS) + '/'
|
|
|
|
+ + UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
|
+
|
|
|
|
+ path = tempPath + excelPath + '/' + "仓库信息"
|
|
|
|
+ + ".xlsx";
|
|
|
|
+
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.debug(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ // 下载
|
|
|
|
+// DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
+// df.setRoundingMode(RoundingMode.HALF_UP);
|
|
|
|
+// DecimalFormat df1 = new DecimalFormat("0.000");
|
|
|
|
+// df1.setRoundingMode(RoundingMode.HALF_UP);
|
|
|
|
+//
|
|
|
|
+// PaymentView paymentView = new PaymentView();
|
|
|
|
+// paymentView.setAmountIngPayableTotal(Double.valueOf(df.format(amountIngPayableTotal)));
|
|
|
|
+// paymentView.setCarTotal(Double.valueOf(paymentManagements.size()));
|
|
|
|
+// paymentView.setNetWeightTotal(Double.valueOf(df1.format(netWeightTotal)));
|
|
|
|
+// paymentView.setAverageUnitPrice(Double.valueOf(df.format(amountIngPayableTotal/netWeightTotal)));
|
|
|
|
+// paymentView.setWaterContentTotal(Double.valueOf(df.format(waterContentTotal/netWeightTotal)));
|
|
|
|
+// paymentView.setImpurityTotal(Double.valueOf(df.format(impurityTotal/netWeightTotal)));
|
|
|
|
+// paymentView.setMildewGrainTotal(Double.valueOf(df.format(mildewGrainTotal/netWeightTotal)));
|
|
|
|
+// paymentView.setImperfectGrainTotal(Double.valueOf(df.format(imperfectGrainTotal/netWeightTotal)));
|
|
|
|
+// paymentView.setBulkDensityTotal(Double.valueOf(df.format(bulkDensityTotal/netWeightTotal)));
|
|
|
|
+// paymentView.setJiaorenliTotal(Double.valueOf(df.format(jiaorenliTotal/netWeightTotal)));
|
|
|
|
+// paymentView.setAddressUrl(a);
|
|
|
|
+
|
|
|
|
+ return downloadPhone(path, response, wb);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 手机审核数据
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public PaymentView exportPhoneData(PaymentManagement paymentManagement){
|
|
|
|
+
|
|
|
|
+ List<String> businessKeys = null;
|
|
|
|
+ if ("1".equals(paymentManagement.getSearchType())) {
|
|
|
|
+ businessKeys = workflowService.getTaskBusinessKeysByCode("PAYMENT-MANAGEMENT-APPROVE");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
|
+ // 仓库名称
|
|
|
|
+ pageView.put("warehouseName", paymentManagement.getWarehouseName());
|
|
|
|
+ pageView.put("businessKeys", businessKeys);
|
|
|
|
+ // 查询付款总数
|
|
|
|
+ List<PaymentManagement> dataList = baseMapper.getListByConditionOut(pageView);
|
|
|
|
+
|
|
|
|
+ Double waterContentTotal = 0d;//水分合计
|
|
|
|
+ Double impurityTotal = 0d;//杂质合计
|
|
|
|
+ Double mildewGrainTotal = 0d;//霉变粒合计
|
|
|
|
+ Double imperfectGrainTotal = 0d;//不完善粒合计
|
|
|
|
+ Double bulkDensityTotal = 0d;//容重合计
|
|
|
|
+ Double jiaorenliTotal = 0d;//热损伤合计
|
|
|
|
+ Double netWeightTotal = 0d;//净重合计
|
|
|
|
+ Double amountIngPayableTotal = 0d;//应收合计
|
|
|
|
+ for (int i = 0; i < dataList.size(); i++) {
|
|
|
|
+ PaymentManagement paymentManagement1 = dataList.get(i);
|
|
|
|
+
|
|
|
|
+ //水分累计和
|
|
|
|
+ waterContentTotal = waterContentTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getWaterContent()!=null?paymentManagement1.getWaterContent():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ impurityTotal = impurityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getImpurity()!=null?paymentManagement1.getImpurity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ mildewGrainTotal = mildewGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getMildewGrain()!=null?paymentManagement1.getMildewGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ imperfectGrainTotal = imperfectGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getImperfectGrain()!=null?paymentManagement1.getImperfectGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ bulkDensityTotal = bulkDensityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getBulkDensity()!=null?paymentManagement1.getBulkDensity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ jiaorenliTotal = jiaorenliTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getJiaorenli()!=null?paymentManagement1.getJiaorenli():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
|
|
|
|
+ netWeightTotal = netWeightTotal + (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight())));
|
|
|
|
+ amountIngPayableTotal = amountIngPayableTotal + paymentManagement1.getAmountIngPayable();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 返回数据
|
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00");
|
|
|
|
+ df.setRoundingMode(RoundingMode.HALF_UP);
|
|
|
|
+ DecimalFormat df1 = new DecimalFormat("0.000");
|
|
|
|
+ df1.setRoundingMode(RoundingMode.HALF_UP);
|
|
|
|
+
|
|
|
|
+ PaymentView paymentView = new PaymentView();
|
|
|
|
+ paymentView.setAmountIngPayableTotal(Double.valueOf(df.format(amountIngPayableTotal)));
|
|
|
|
+ paymentView.setCarTotal(Double.valueOf(dataList.size()));
|
|
|
|
+ paymentView.setNetWeightTotal(Double.valueOf(df1.format(netWeightTotal)));
|
|
|
|
+ paymentView.setAverageUnitPrice(Double.valueOf(df.format(amountIngPayableTotal/netWeightTotal)));
|
|
|
|
+ paymentView.setWaterContentTotal(Double.valueOf(df.format(waterContentTotal/netWeightTotal)));
|
|
|
|
+ paymentView.setImpurityTotal(Double.valueOf(df.format(impurityTotal/netWeightTotal)));
|
|
|
|
+ paymentView.setMildewGrainTotal(Double.valueOf(df.format(mildewGrainTotal/netWeightTotal)));
|
|
|
|
+ paymentView.setImperfectGrainTotal(Double.valueOf(df.format(imperfectGrainTotal/netWeightTotal)));
|
|
|
|
+ paymentView.setBulkDensityTotal(Double.valueOf(df.format(bulkDensityTotal/netWeightTotal)));
|
|
|
|
+ paymentView.setJiaorenliTotal(Double.valueOf(df.format(jiaorenliTotal/netWeightTotal)));
|
|
|
|
+ return paymentView;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 下载
|
|
|
|
+ *
|
|
|
|
+ * @param path
|
|
|
|
+ * @param response
|
|
|
|
+ */
|
|
|
|
+ private String downloadPhone(String path, HttpServletResponse response, Workbook wb) {
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ // path是指欲下载的文件的路径。
|
|
|
|
+// File file = new File(path);
|
|
|
|
+// File file = new File( new String(("templates" + File.separator + "仓库信息"+".xlsx").getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8));
|
|
|
|
+ // 取得文件名。
|
|
|
|
+ String fileName = "excel";
|
|
|
|
+ // 给文件名编码
|
|
|
|
+ fileName = new String(fileName.getBytes("GBK"), "ISO-8859-1");
|
|
|
|
+
|
|
|
|
+ response.setContentType("application/vnd.ms-excel");
|
|
|
|
+ response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
|
|
|
|
+
|
|
|
|
+ // 定义byte输出流
|
|
|
|
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
|
|
+
|
|
|
|
+ // 写导出文件
|
|
|
|
+ wb.write(out);
|
|
|
|
+
|
|
|
|
+ // 取得模板文件中的数据
|
|
|
|
+ byte[] result = out.toByteArray();
|
|
|
|
+
|
|
|
|
+ // 设置输出数据类型
|
|
|
|
+ response.setContentType("application/vnd.ms-excel");
|
|
|
|
+ // 设置输出数据长度
|
|
|
|
+ response.setContentLength(result.length);
|
|
|
|
+
|
|
|
|
+ // 设置文件名称
|
|
|
|
+ response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
|
|
|
|
+ // 将文件流输出到画面
|
|
|
|
+// response.getOutputStream().write(result);
|
|
|
|
+
|
|
|
|
+ out.flush();
|
|
|
|
+ out.close();
|
|
|
|
+ //生成的新文件路径
|
|
|
|
+ String outputFile = "templates" + File.separator + fileName + ".xlsx";
|
|
|
|
+ File file1 = new File(new String(outputFile.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8));
|
|
|
|
+ try (FileOutputStream fos = new FileOutputStream(file1)) {
|
|
|
|
+ wb.write(fos);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ FileInputStream fileInputStream = new FileInputStream(file1.getAbsoluteFile());
|
|
|
|
+
|
|
|
|
+ MultipartFile multipartFile = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
|
|
|
|
+ String result1 = upload(multipartFile, fileName);
|
|
|
|
+ file1.delete();
|
|
|
|
+ return result1;
|
|
|
|
+ } catch (IOException ex) {
|
|
|
|
+ log.debug(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+ return "ng";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 后台通过服务器间接传文件
|
|
|
|
+ *
|
|
|
|
+ * @param file
|
|
|
|
+ * @return
|
|
|
|
+ * @throws IOException
|
|
|
|
+ */
|
|
|
|
+ public String upload(MultipartFile file, String name) throws IOException {
|
|
|
|
+ ObjectMetadata objectMetadata = new ObjectMetadata();
|
|
|
|
+ objectMetadata.setContentLength(file.getSize());
|
|
|
|
+ objectMetadata.setContentType(file.getContentType());
|
|
|
|
+ PutObjectRequest putObjectRequest = new PutObjectRequest(bucket, "pcfiles/" + name + ".xlsx", file.getInputStream(), objectMetadata);
|
|
|
|
+ ossClient.putObject(putObjectRequest);
|
|
|
|
+ return baseUrl + "pcfiles/" + name + ".xlsx";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
private String addDateOneDay(Date date) {
|
|
private String addDateOneDay(Date date) {
|
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|
|
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
|