Merge remote-tracking branch 'origin/branch20211008' into branch20211008

This commit is contained in:
梁琦涛
2021-11-01 09:49:02 +08:00
9 changed files with 636 additions and 635 deletions
@@ -1,20 +1,20 @@
package com.jero.mail.commont;
import lombok.Data;
import java.util.Date;
/**
* @author zql
* @date 2021/10/29 10:41
*/
@Data
public class BatOrder {
private String id;
private String addressName;
private String addressPhone;
private String address;
private String tracking_number;
private String filePath;
private Date mileTime;
}
//package com.jero.mail.commont;
//
//import lombok.Data;
//
//import java.util.Date;
//
///**
// * @author zql
// * @date 2021/10/29 10:41
// */
//@Data
//public class BatOrder {
// private String id;
// private String addressName;
// private String addressPhone;
// private String address;
// private String tracking_number;
// private String filePath;
// private Date mileTime;
//}
@@ -1,17 +1,17 @@
package com.jero.mail.commont;
import lombok.Data;
/**
* @author zql
* @date 2021/10/29 10:44
*/
@Data
public class HospitalInformation {
private String hospitalName;
private String phoneNumber;
private String province;
private String city;
private String county;
private String area;
}
//package com.jero.mail.commont;
//
//import lombok.Data;
//
///**
// * @author zql
// * @date 2021/10/29 10:44
// */
//@Data
//public class HospitalInformation {
// private String hospitalName;
// private String phoneNumber;
// private String province;
// private String city;
// private String county;
// private String area;
//}
@@ -1,481 +1,481 @@
package com.jero.mail.commont;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Date;
import javax.imageio.ImageIO;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import org.springframework.util.ResourceUtils;
/**
* @author zql
* @date 2021/10/29 10:31
*/
public class Print {
/**
* 生成电子面单图片工具
*
* @author chunge
* @version 1.0
* @time 2021/08/01
*/
@Slf4j
public static class EMSGenerateUtil {
//图片的宽度
public static final int IMG_WIDTH = 799;
//图片的宽度
public static final int IMG_HEIGHT = 1199;
//LOGO的宽度
public static final int LOGO_WIDTH = 220;
//LOGO高度
public static final int LOGO_HEIGHT = 70;
public static BufferedImage image;
public static void createImage(String fileLocation) {
FileOutputStream fos = null;
BufferedOutputStream bos = null;
try {
fos = new FileOutputStream(fileLocation);
bos = new BufferedOutputStream(fos);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);
encoder.encode(image);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (bos != null) bos.close();
if (fos != null) fos.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
/**
* 插入图片 自定义图片的宽高
*
* @param imgPath 插入图片的路径
* @param imgWidth 设置图片的宽度
* @param imgHeight 设置图片的高度
* @param isCompress 是否按输入的宽高定义图片的尺寸,只有为true时 输入的宽度和高度才起作用<br/>
* 为false时输入的宽高不起作用,按输入图片的默认尺寸
* @return
* @throws Exception
*/
private static Image insertImage(String imgPath, int imgWidth, int imgHeight, boolean isCompress) throws Exception {
File fileimage = new File(imgPath);
Image src = ImageIO.read(fileimage);
if (isCompress) {
Image image = src.getScaledInstance(imgWidth, imgHeight, Image.SCALE_SMOOTH);
return image;
}
return src;
}
/**
* 生成
*/
public static boolean generateOrder(String orderPath, BatOrder orderParam, HospitalInformation hospitalInformation, boolean isCompress, int imgWidth, int imgHeidht) {
if (null == orderParam)
return false;
String picPath = orderPath;
int startHeight = 0; //表格的起始高度
int startWidth = 0; //表格的起始宽度
try {
image = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_RGB);
Graphics2D g = image.createGraphics();
//以运单号为名称创建存放订单的目录
File mk = new File(picPath + orderParam.getTracking_number());
if (mk.exists()) {
FileUtils.deleteDirectory(mk);
}
FileUtils.forceMkdir(mk);
//设置背景色为白色
g.setColor(Color.WHITE);
//设置颜色区域大小
g.fillRect(0, 0, IMG_WIDTH, IMG_HEIGHT);
/*
* 绘制表格 填充内容
* */
//表格线条的颜色
g.setColor(Color.BLACK);
//边框加粗
g.setStroke(new BasicStroke(2.0f));
//消除文本出现锯齿现象
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
//设置虚线条
Stroke bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{16, 4}, 0);
g.setStroke(bs);
//表格的四个边框
g.drawLine(startWidth + 16, startHeight + 16, startWidth + 783, startHeight + 16); //上边框
g.drawLine(startWidth + 16, startHeight + 16, startWidth + 16, startHeight + 1183); //左边框
g.drawLine(startWidth + 16, startHeight + 1183, startWidth + 783, startHeight + 1183); //下边框
g.drawLine(startWidth + 783, startHeight + 16, startWidth + 783, startHeight + 1183); //右边框
//分割线左边
//标准快递
Font fontSfTyp = new Font("黑体", Font.BOLD, 45);//Font.BOLD(加粗)
g.setFont(fontSfTyp);
g.drawString("标准快递", startWidth + 78, startHeight + 120);
Font fontSfTyp2 = new Font("黑体", Font.BOLD, 16);//Font.BOLD(加粗)
g.setFont(fontSfTyp2);
g.drawString("时间:" + DateUtil.format(orderParam.getMileTime(), "yyyy-MM-dd HH:mm:ss"), startWidth + 75, startHeight + 145);
//第一行竖 分割线
g.drawLine(startWidth + 336, startHeight + 16, startWidth + 336, startHeight + 176); //右边框
//分割线右边
//生成code128a 条码
SFBarCodeGenerateUtil.generateBarCode128_a(orderParam.getTracking_number(), //运单号
picPath + orderParam.getTracking_number() + ".png", //图片名称
440, //图片宽度
100);
//导入条码图片
Image sfBarImg = insertImage(picPath + orderParam.getTracking_number() + ".png", 0, 0, false);
g.drawImage(sfBarImg, startWidth + 340, startHeight + 32, null);
g.drawString(orderParam.getTracking_number(), startWidth + 500, startHeight + 150);
//绘制表格内容 第1行
g.drawLine(startWidth + 16, startHeight + 176, startWidth + 783, startHeight + 176);
//绘制表格内容 第2行
g.drawLine(startWidth + 16, startHeight + 248, startWidth + 783, startHeight + 248);
g.setFont(fontSfTyp);
g.drawString(orderParam.getFilePath(), startWidth + 100, startHeight + 220);
Font fontSfTyp3 = new Font("黑体", Font.BOLD, 28);
g.setFont(fontSfTyp3);
//收:
g.drawString("收:" + orderParam.getAddressName() + " " + orderParam.getAddressPhone(), startWidth + 18, startHeight + 280);
if (orderParam.getAddress().length() > 22) {
g.drawString(" " + orderParam.getAddress().substring(0, 22), startWidth + 18, startHeight + 310);
g.drawString(" " + orderParam.getAddress().substring(22, orderParam.getAddress().length()), startWidth + 18, startHeight + 340);
} else {
g.drawString(" " + orderParam.getAddress().substring(0, orderParam.getAddress().length()), startWidth + 18, startHeight + 310);
}
//绘制表格内容 第3行
g.drawLine(startWidth + 16, startHeight + 408, startWidth + 783, startHeight + 408);
//寄
Font fontSfTyp4 = new Font("黑体", Font.PLAIN, 20);//Font.PLAIN(普通)
g.setFont(fontSfTyp4);
//绘制表格内容 第4行
g.drawLine(startWidth + 16, startHeight + 472, startWidth + 783, startHeight + 472);
g.drawString("寄:" + hospitalInformation.getHospitalName() + " " + hospitalInformation.getPhoneNumber(), startWidth + 18, startHeight + 430);
String address = hospitalInformation.getProvince() + hospitalInformation.getCity() + hospitalInformation.getCounty() + hospitalInformation.getArea();
if (address.length() > 30) {
g.drawString(" " + address.substring(0, 30), startWidth + 18, startHeight + 450);
g.drawString(" " + address.substring(30, address.length()), startWidth + 18, startHeight + 470);
} else {
g.drawString(" " + address.substring(0, address.length()), startWidth + 18, startHeight + 450);
}
g.drawString("付款方式:", startWidth + 18, startHeight + 500);
g.drawString("计费重量(KG):", startWidth + 18, startHeight + 530);
g.drawString("保价金额:", startWidth + 18, startHeight + 560);
//第5行竖 分割线
g.drawLine(startWidth + 464, startHeight + 472, startWidth + 464, startHeight + 583); //右边框
g.drawString("收件人\\代收人:", startWidth + 468, startHeight + 495);
g.drawString("签收时间 : 年 月 日 时", startWidth + 468, startHeight + 530);
Font fontSfTyp5 = new Font("黑体", Font.PLAIN, 16);//Font.PLAIN(普通)
g.setFont(fontSfTyp5);
g.drawString("快件送达收货人地址:经收件人或收件人允", startWidth + 468, startHeight + 560);
g.drawString("许的代收人签字,视为送达", startWidth + 468, startHeight + 580);
//绘制表格内容 第5行
g.drawLine(startWidth + 16, startHeight + 583, startWidth + 783, startHeight + 583);
g.setFont(fontSfTyp4);
g.drawString("件数: 重量(KG", startWidth + 18, startHeight + 600);
g.drawString("配货信息:物品", startWidth + 18, startHeight + 620);
//绘制表格内容 第5行
g.drawLine(startWidth + 16, startHeight + 719, startWidth + 783, startHeight + 719);
g.drawString("配货信息:物品", startWidth + 18, startHeight + 620);
g.drawLine(startWidth + 16, startHeight + 735, startWidth + 783, startHeight + 735);
//分割线右边
//生成code128a 条码
SFBarCodeGenerateUtil.generateBarCode128_a(orderParam.getTracking_number(), //运单号
picPath + orderParam.getTracking_number() + ".png", //图片名称
440, //图片宽度
60);
//导入条码图片
Image sfBarImg2 = insertImage(picPath + orderParam.getTracking_number() + ".png", 0, 0, false);
g.drawImage(sfBarImg2, startWidth + 20, startHeight + 750, null);
g.drawString(orderParam.getTracking_number(), startWidth + 180, startHeight + 830);
//插入Logo
//从springboot资源目录获取获取logo图片地址:
String logoPath = ResourceUtils.getFile("classpath:ems\\ems.png").getPath();
Image sublogoImg = insertImage(logoPath, LOGO_WIDTH, LOGO_HEIGHT, true);
g.drawImage(sublogoImg, startWidth + 480, startHeight + 750, null);
g.drawLine(startWidth + 16, startHeight + 855, startWidth + 783, startHeight + 855);
g.drawString("收:" + orderParam.getAddressName() + " " + orderParam.getAddressPhone(), startWidth + 18, startHeight + 880);
if (orderParam.getAddress().length() > 20) {
g.drawString(" " + orderParam.getAddress().substring(0, 20), startWidth + 18, startHeight + 900);
g.drawString(" " + orderParam.getAddress().substring(20, orderParam.getAddress().length()), startWidth + 18, startHeight + 920);
} else {
g.drawString(" " + orderParam.getAddress().substring(0, orderParam.getAddress().length()), startWidth + 18, startHeight + 900);
}
//竖线
g.drawLine(startWidth + 464, startHeight + 855, startWidth + 464, startHeight + 991);
g.drawString("寄:" + hospitalInformation.getHospitalName(), startWidth + 468, startHeight + 880);
g.drawString(" " + hospitalInformation.getPhoneNumber(), startWidth + 468, startHeight + 900);
if (address.length() > 14) {
g.drawString(" " + address.substring(0, 14), startWidth + 468, startHeight + 920);
g.drawString(" " + address.substring(14, address.length()), startWidth + 468, startHeight + 940);
} else {
g.drawString(" " + address.substring(0, address.length()), startWidth + 468, startHeight + 920);
}
g.drawLine(startWidth + 16, startHeight + 991, startWidth + 783, startHeight + 991);
g.drawString("备注:", startWidth + 18, startHeight + 1020);
g.drawLine(startWidth + 16, startHeight + 1127, startWidth + 783, startHeight + 1127);
g.drawString("网址:www.ems.com.cn 客服电话:11183", startWidth + 45, startHeight + 1160);
g.drawLine(startWidth + 559, startHeight + 1127, startWidth + 559, startHeight + 1183);
g.drawString("L", startWidth + 750, startHeight + 1170);
g.dispose();
File sfbarFile = new File(picPath + orderParam.getId() + ".jpg");
if (sfbarFile.exists() && sfbarFile.isFile()) {
sfbarFile.delete();
}
//生成订单图片
createImage(picPath + orderParam.getId() + ".jpg");
if (isCompress) {
compressImg(picPath + orderParam.getId() + ".jpg", imgWidth, imgHeidht);
}
log.info("订单生成成功. " + picPath + orderParam.getId() + ".jpg");
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
/**
* 水平翻转图像 顺时针旋转90度、左右翻转
*
* @param bi 目标图像
* @return
*/
private static BufferedImage rotate90DX(BufferedImage bi) {
int width = bi.getWidth();
int height = bi.getHeight();
BufferedImage biFlip = new BufferedImage(height, width, bi.getType());
for (int i = 0; i < width; i++)
for (int j = 0; j < height; j++)
biFlip.setRGB(height - 1 - j, width - 1 - i, bi.getRGB(i, j));
return biFlip;
}
/**
* 水平翻转图像 逆时针旋转90度、左右翻转
*
* @param bi 目标图像
* @return
*/
private static BufferedImage rotate90SX(BufferedImage bi) {
int width = bi.getWidth();
int height = bi.getHeight();
BufferedImage biFlip = new BufferedImage(height, width, bi.getType());
for (int i = 0; i < width; i++)
for (int j = 0; j < height; j++)
biFlip.setRGB(j, i, bi.getRGB(i, j));
return biFlip;
}
/**
* 根据规定尺寸压缩图片
*
* @param imgPath 图片路径
* @param width 图片宽度
* @param height 图片高度
*/
private static void compressImg(String imgPath, int width, int height) {
/**
* 设置条码图片的尺寸
* */
BufferedInputStream bis = null;
BufferedOutputStream out = null;
FileOutputStream fis = null;
try {
File sfFile = new File(imgPath);
if (sfFile.isFile() && sfFile.exists()) {
//读取图片
bis = new BufferedInputStream(new FileInputStream(imgPath));
//转换成图片对象
Image bi = ImageIO.read(bis).getScaledInstance(width, height, Image.SCALE_SMOOTH);
//构建图片流 设置图片宽和高
BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
//绘制改变尺寸后的图
tag.getGraphics().drawImage(bi, 0, 0, width, height, null);
//保存图片
fis = new FileOutputStream(imgPath);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fis);
JPEGEncodeParam jep = JPEGCodec.getDefaultJPEGEncodeParam(tag);
//设置压缩图片质量
jep.setQuality(3f, true);
encoder.encode(tag, jep);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (fis != null) fis.close();
if (out != null) out.close();
if (bis != null) bis.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
//创建目录
private static boolean createDir(String destDirName) {
try {
File file = new File(destDirName);
if (destDirName.endsWith(File.separator))
destDirName += File.separator;
if (file.mkdir())
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
//删除目录
public static boolean removeDir(File dir) {
File[] files = dir.listFiles();
for (File file : files) {
if (file.isDirectory()) {
return removeDir(file);
} else {
return file.delete();
}
}
return dir.delete();
}
//删除目录
public static boolean deleteMk(String dirPath) {
File dirFile = new File(dirPath);
if (dirFile.isDirectory()) {
File[] files = dirFile.listFiles();
for (int i = 0; i < files.length; i++) {
files[i].delete();
}
}
return dirFile.delete();
}
/**
* 把文件转换为byte[]
*
* @param filePath 文件路径
*/
public static byte[] getFileBytes(String filePath) {
byte[] buffer = null;
FileInputStream fis = null;
ByteArrayOutputStream bos = null;
try {
File file = new File(filePath);
fis = new FileInputStream(file);
bos = new ByteArrayOutputStream(1000);
byte[] b = new byte[1000];
int n;
while ((n = fis.read(b)) != -1) {
bos.write(b, 0, n);
}
buffer = bos.toByteArray();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (bos != null) {
bos.close();
}
if (fis != null) {
fis.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return buffer;
}
}
public static void main(String[] args) {
BatOrder param = new BatOrder();
param.setTracking_number("883987638272");
param.setTracking_number("883987638272");
param.setFilePath("310-新A-沙区02-沙区揽投-*");
param.setAddressName("春哥");
param.setAddressPhone("15261800000");
param.setAddress("重庆市重庆市南岸区南岸区测试大道重庆交通大学测试小区1栋00单元00");
HospitalInformation hospitalInformation = new HospitalInformation();
hospitalInformation.setHospitalName("江苏大学");
hospitalInformation.setPhoneNumber("025-91918230");
hospitalInformation.setProvince("江苏");
hospitalInformation.setCity("南京市市");
hospitalInformation.setCounty("栖霞区区");
hospitalInformation.setArea("南京仙林大学城199号");
EMSGenerateUtil.generateOrder(
"D:\\12345\\",
param,
hospitalInformation,
false,
600,
400);
}
}
//package com.jero.mail.commont;
//
//import java.awt.*;
//import java.awt.image.BufferedImage;
//import java.io.*;
//import java.util.Date;
//import javax.imageio.ImageIO;
//import cn.hutool.core.date.DateUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.io.FileUtils;
//import com.sun.image.codec.jpeg.JPEGCodec;
//import com.sun.image.codec.jpeg.JPEGEncodeParam;
//import com.sun.image.codec.jpeg.JPEGImageEncoder;
//import org.springframework.util.ResourceUtils;
//
//
///**
// * @author zql
// * @date 2021/10/29 10:31
// */
//public class Print {
//
// /**
// * 生成电子面单图片工具
// *
// * @author chunge
// * @version 1.0
// * @time 2021/08/01
// */
// @Slf4j
// public static class EMSGenerateUtil {
//
// //图片的宽度
// public static final int IMG_WIDTH = 799;
//
// //图片的宽度
// public static final int IMG_HEIGHT = 1199;
//
// //LOGO的宽度
// public static final int LOGO_WIDTH = 220;
// //LOGO高度
// public static final int LOGO_HEIGHT = 70;
// public static BufferedImage image;
//
// public static void createImage(String fileLocation) {
// FileOutputStream fos = null;
// BufferedOutputStream bos = null;
// try {
// fos = new FileOutputStream(fileLocation);
// bos = new BufferedOutputStream(fos);
// JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);
// encoder.encode(image);
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// try {
// if (bos != null) bos.close();
// if (fos != null) fos.close();
// } catch (Exception e2) {
// e2.printStackTrace();
// }
// }
// }
//
//
// /**
// * 插入图片 自定义图片的宽高
// *
// * @param imgPath 插入图片的路径
// * @param imgWidth 设置图片的宽度
// * @param imgHeight 设置图片的高度
// * @param isCompress 是否按输入的宽高定义图片的尺寸,只有为true时 输入的宽度和高度才起作用<br/>
// * 为false时输入的宽高不起作用,按输入图片的默认尺寸
// * @return
// * @throws Exception
// */
// private static Image insertImage(String imgPath, int imgWidth, int imgHeight, boolean isCompress) throws Exception {
// File fileimage = new File(imgPath);
// Image src = ImageIO.read(fileimage);
// if (isCompress) {
// Image image = src.getScaledInstance(imgWidth, imgHeight, Image.SCALE_SMOOTH);
// return image;
// }
// return src;
// }
//
// /**
// * 生成
// */
// public static boolean generateOrder(String orderPath, BatOrder orderParam, HospitalInformation hospitalInformation, boolean isCompress, int imgWidth, int imgHeidht) {
// if (null == orderParam)
// return false;
// String picPath = orderPath;
// int startHeight = 0; //表格的起始高度
// int startWidth = 0; //表格的起始宽度
// try {
// image = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, BufferedImage.TYPE_INT_RGB);
// Graphics2D g = image.createGraphics();
//
// //以运单号为名称创建存放订单的目录
// File mk = new File(picPath + orderParam.getTracking_number());
// if (mk.exists()) {
// FileUtils.deleteDirectory(mk);
// }
// FileUtils.forceMkdir(mk);
//
// //设置背景色为白色
// g.setColor(Color.WHITE);
// //设置颜色区域大小
// g.fillRect(0, 0, IMG_WIDTH, IMG_HEIGHT);
//
// /*
// * 绘制表格 填充内容
// * */
// //表格线条的颜色
// g.setColor(Color.BLACK);
// //边框加粗
// g.setStroke(new BasicStroke(2.0f));
// //消除文本出现锯齿现象
// g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
//
// //设置虚线条
// Stroke bs = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{16, 4}, 0);
// g.setStroke(bs);
//
// //表格的四个边框
// g.drawLine(startWidth + 16, startHeight + 16, startWidth + 783, startHeight + 16); //上边框
// g.drawLine(startWidth + 16, startHeight + 16, startWidth + 16, startHeight + 1183); //左边框
// g.drawLine(startWidth + 16, startHeight + 1183, startWidth + 783, startHeight + 1183); //下边框
// g.drawLine(startWidth + 783, startHeight + 16, startWidth + 783, startHeight + 1183); //右边框
//
// //分割线左边
// //标准快递
// Font fontSfTyp = new Font("黑体", Font.BOLD, 45);//Font.BOLD(加粗)
// g.setFont(fontSfTyp);
// g.drawString("标准快递", startWidth + 78, startHeight + 120);
//
// Font fontSfTyp2 = new Font("黑体", Font.BOLD, 16);//Font.BOLD(加粗)
// g.setFont(fontSfTyp2);
// g.drawString("时间:" + DateUtil.format(orderParam.getMileTime(), "yyyy-MM-dd HH:mm:ss"), startWidth + 75, startHeight + 145);
//
// //第一行竖 分割线
// g.drawLine(startWidth + 336, startHeight + 16, startWidth + 336, startHeight + 176); //右边框
//
// //分割线右边
// //生成code128a 条码
// SFBarCodeGenerateUtil.generateBarCode128_a(orderParam.getTracking_number(), //运单号
// picPath + orderParam.getTracking_number() + ".png", //图片名称
// 440, //图片宽度
// 100);
// //导入条码图片
// Image sfBarImg = insertImage(picPath + orderParam.getTracking_number() + ".png", 0, 0, false);
// g.drawImage(sfBarImg, startWidth + 340, startHeight + 32, null);
// g.drawString(orderParam.getTracking_number(), startWidth + 500, startHeight + 150);
//
// //绘制表格内容 第1行
// g.drawLine(startWidth + 16, startHeight + 176, startWidth + 783, startHeight + 176);
//
// //绘制表格内容 第2行
// g.drawLine(startWidth + 16, startHeight + 248, startWidth + 783, startHeight + 248);
// g.setFont(fontSfTyp);
// g.drawString(orderParam.getFilePath(), startWidth + 100, startHeight + 220);
//
// Font fontSfTyp3 = new Font("黑体", Font.BOLD, 28);
// g.setFont(fontSfTyp3);
// //收:
// g.drawString("收:" + orderParam.getAddressName() + " " + orderParam.getAddressPhone(), startWidth + 18, startHeight + 280);
// if (orderParam.getAddress().length() > 22) {
// g.drawString(" " + orderParam.getAddress().substring(0, 22), startWidth + 18, startHeight + 310);
// g.drawString(" " + orderParam.getAddress().substring(22, orderParam.getAddress().length()), startWidth + 18, startHeight + 340);
// } else {
// g.drawString(" " + orderParam.getAddress().substring(0, orderParam.getAddress().length()), startWidth + 18, startHeight + 310);
// }
//
// //绘制表格内容 第3行
// g.drawLine(startWidth + 16, startHeight + 408, startWidth + 783, startHeight + 408);
// //寄
// Font fontSfTyp4 = new Font("黑体", Font.PLAIN, 20);//Font.PLAIN(普通)
// g.setFont(fontSfTyp4);
//
// //绘制表格内容 第4行
// g.drawLine(startWidth + 16, startHeight + 472, startWidth + 783, startHeight + 472);
// g.drawString("寄:" + hospitalInformation.getHospitalName() + " " + hospitalInformation.getPhoneNumber(), startWidth + 18, startHeight + 430);
// String address = hospitalInformation.getProvince() + hospitalInformation.getCity() + hospitalInformation.getCounty() + hospitalInformation.getArea();
// if (address.length() > 30) {
// g.drawString(" " + address.substring(0, 30), startWidth + 18, startHeight + 450);
// g.drawString(" " + address.substring(30, address.length()), startWidth + 18, startHeight + 470);
// } else {
// g.drawString(" " + address.substring(0, address.length()), startWidth + 18, startHeight + 450);
// }
//
// g.drawString("付款方式:", startWidth + 18, startHeight + 500);
// g.drawString("计费重量(KG):", startWidth + 18, startHeight + 530);
// g.drawString("保价金额:", startWidth + 18, startHeight + 560);
//
// //第5行竖 分割线
// g.drawLine(startWidth + 464, startHeight + 472, startWidth + 464, startHeight + 583); //右边框
//
// g.drawString("收件人\\代收人:", startWidth + 468, startHeight + 495);
// g.drawString("签收时间 : 年 月 日 时", startWidth + 468, startHeight + 530);
// Font fontSfTyp5 = new Font("黑体", Font.PLAIN, 16);//Font.PLAIN(普通)
// g.setFont(fontSfTyp5);
// g.drawString("快件送达收货人地址:经收件人或收件人允", startWidth + 468, startHeight + 560);
// g.drawString("许的代收人签字,视为送达", startWidth + 468, startHeight + 580);
//
// //绘制表格内容 第5行
// g.drawLine(startWidth + 16, startHeight + 583, startWidth + 783, startHeight + 583);
//
// g.setFont(fontSfTyp4);
// g.drawString("件数: 重量(KG", startWidth + 18, startHeight + 600);
// g.drawString("配货信息:物品", startWidth + 18, startHeight + 620);
//
// //绘制表格内容 第5行
// g.drawLine(startWidth + 16, startHeight + 719, startWidth + 783, startHeight + 719);
//
// g.drawString("配货信息:物品", startWidth + 18, startHeight + 620);
//
// g.drawLine(startWidth + 16, startHeight + 735, startWidth + 783, startHeight + 735);
//
// //分割线右边
// //生成code128a 条码
// SFBarCodeGenerateUtil.generateBarCode128_a(orderParam.getTracking_number(), //运单号
// picPath + orderParam.getTracking_number() + ".png", //图片名称
// 440, //图片宽度
// 60);
// //导入条码图片
// Image sfBarImg2 = insertImage(picPath + orderParam.getTracking_number() + ".png", 0, 0, false);
// g.drawImage(sfBarImg2, startWidth + 20, startHeight + 750, null);
// g.drawString(orderParam.getTracking_number(), startWidth + 180, startHeight + 830);
//
// //插入Logo
// //从springboot资源目录获取获取logo图片地址:
// String logoPath = ResourceUtils.getFile("classpath:ems\\ems.png").getPath();
// Image sublogoImg = insertImage(logoPath, LOGO_WIDTH, LOGO_HEIGHT, true);
// g.drawImage(sublogoImg, startWidth + 480, startHeight + 750, null);
//
// g.drawLine(startWidth + 16, startHeight + 855, startWidth + 783, startHeight + 855);
//
// g.drawString("收:" + orderParam.getAddressName() + " " + orderParam.getAddressPhone(), startWidth + 18, startHeight + 880);
// if (orderParam.getAddress().length() > 20) {
// g.drawString(" " + orderParam.getAddress().substring(0, 20), startWidth + 18, startHeight + 900);
// g.drawString(" " + orderParam.getAddress().substring(20, orderParam.getAddress().length()), startWidth + 18, startHeight + 920);
// } else {
// g.drawString(" " + orderParam.getAddress().substring(0, orderParam.getAddress().length()), startWidth + 18, startHeight + 900);
// }
// //竖线
// g.drawLine(startWidth + 464, startHeight + 855, startWidth + 464, startHeight + 991);
//
// g.drawString("寄:" + hospitalInformation.getHospitalName(), startWidth + 468, startHeight + 880);
// g.drawString(" " + hospitalInformation.getPhoneNumber(), startWidth + 468, startHeight + 900);
// if (address.length() > 14) {
// g.drawString(" " + address.substring(0, 14), startWidth + 468, startHeight + 920);
// g.drawString(" " + address.substring(14, address.length()), startWidth + 468, startHeight + 940);
// } else {
// g.drawString(" " + address.substring(0, address.length()), startWidth + 468, startHeight + 920);
// }
//
// g.drawLine(startWidth + 16, startHeight + 991, startWidth + 783, startHeight + 991);
//
// g.drawString("备注:", startWidth + 18, startHeight + 1020);
//
// g.drawLine(startWidth + 16, startHeight + 1127, startWidth + 783, startHeight + 1127);
//
// g.drawString("网址:www.ems.com.cn 客服电话:11183", startWidth + 45, startHeight + 1160);
//
// g.drawLine(startWidth + 559, startHeight + 1127, startWidth + 559, startHeight + 1183);
//
// g.drawString("L", startWidth + 750, startHeight + 1170);
//
// g.dispose();
// File sfbarFile = new File(picPath + orderParam.getId() + ".jpg");
// if (sfbarFile.exists() && sfbarFile.isFile()) {
// sfbarFile.delete();
// }
// //生成订单图片
// createImage(picPath + orderParam.getId() + ".jpg");
// if (isCompress) {
// compressImg(picPath + orderParam.getId() + ".jpg", imgWidth, imgHeidht);
// }
// log.info("订单生成成功. " + picPath + orderParam.getId() + ".jpg");
// return true;
// } catch (Exception e) {
// e.printStackTrace();
// }
// return false;
// }
//
//
// /**
// * 水平翻转图像 顺时针旋转90度、左右翻转
// *
// * @param bi 目标图像
// * @return
// */
// private static BufferedImage rotate90DX(BufferedImage bi) {
// int width = bi.getWidth();
// int height = bi.getHeight();
//
// BufferedImage biFlip = new BufferedImage(height, width, bi.getType());
//
// for (int i = 0; i < width; i++)
// for (int j = 0; j < height; j++)
// biFlip.setRGB(height - 1 - j, width - 1 - i, bi.getRGB(i, j));
//
// return biFlip;
// }
//
//
// /**
// * 水平翻转图像 逆时针旋转90度、左右翻转
// *
// * @param bi 目标图像
// * @return
// */
// private static BufferedImage rotate90SX(BufferedImage bi) {
// int width = bi.getWidth();
// int height = bi.getHeight();
//
// BufferedImage biFlip = new BufferedImage(height, width, bi.getType());
//
// for (int i = 0; i < width; i++)
// for (int j = 0; j < height; j++)
// biFlip.setRGB(j, i, bi.getRGB(i, j));
//
// return biFlip;
// }
//
// /**
// * 根据规定尺寸压缩图片
// *
// * @param imgPath 图片路径
// * @param width 图片宽度
// * @param height 图片高度
// */
// private static void compressImg(String imgPath, int width, int height) {
// /**
// * 设置条码图片的尺寸
// * */
// BufferedInputStream bis = null;
// BufferedOutputStream out = null;
// FileOutputStream fis = null;
// try {
// File sfFile = new File(imgPath);
// if (sfFile.isFile() && sfFile.exists()) {
// //读取图片
// bis = new BufferedInputStream(new FileInputStream(imgPath));
// //转换成图片对象
// Image bi = ImageIO.read(bis).getScaledInstance(width, height, Image.SCALE_SMOOTH);
// //构建图片流 设置图片宽和高
// BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
// //绘制改变尺寸后的图
// tag.getGraphics().drawImage(bi, 0, 0, width, height, null);
// //保存图片
// fis = new FileOutputStream(imgPath);
// JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(fis);
// JPEGEncodeParam jep = JPEGCodec.getDefaultJPEGEncodeParam(tag);
// //设置压缩图片质量
// jep.setQuality(3f, true);
// encoder.encode(tag, jep);
// }
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// try {
// if (fis != null) fis.close();
// if (out != null) out.close();
// if (bis != null) bis.close();
// } catch (Exception e2) {
// e2.printStackTrace();
// }
// }
// }
//
// //创建目录
// private static boolean createDir(String destDirName) {
// try {
// File file = new File(destDirName);
// if (destDirName.endsWith(File.separator))
// destDirName += File.separator;
// if (file.mkdir())
// return true;
// } catch (Exception e) {
// e.printStackTrace();
// }
// return false;
// }
//
// //删除目录
// public static boolean removeDir(File dir) {
// File[] files = dir.listFiles();
// for (File file : files) {
// if (file.isDirectory()) {
// return removeDir(file);
// } else {
// return file.delete();
// }
// }
// return dir.delete();
// }
//
// //删除目录
// public static boolean deleteMk(String dirPath) {
// File dirFile = new File(dirPath);
// if (dirFile.isDirectory()) {
// File[] files = dirFile.listFiles();
// for (int i = 0; i < files.length; i++) {
// files[i].delete();
// }
// }
// return dirFile.delete();
// }
//
// /**
// * 把文件转换为byte[]
// *
// * @param filePath 文件路径
// */
// public static byte[] getFileBytes(String filePath) {
// byte[] buffer = null;
// FileInputStream fis = null;
// ByteArrayOutputStream bos = null;
// try {
// File file = new File(filePath);
// fis = new FileInputStream(file);
// bos = new ByteArrayOutputStream(1000);
// byte[] b = new byte[1000];
// int n;
// while ((n = fis.read(b)) != -1) {
// bos.write(b, 0, n);
// }
// buffer = bos.toByteArray();
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// } finally {
// try {
// if (bos != null) {
// bos.close();
// }
// if (fis != null) {
// fis.close();
// }
// } catch (Exception e2) {
// e2.printStackTrace();
// }
// }
// return buffer;
// }
//
//
// }
// public static void main(String[] args) {
// BatOrder param = new BatOrder();
//
// param.setTracking_number("883987638272");
// param.setTracking_number("883987638272");
// param.setFilePath("310-新A-沙区02-沙区揽投-*");
// param.setAddressName("春哥");
// param.setAddressPhone("15261800000");
// param.setAddress("重庆市重庆市南岸区南岸区测试大道重庆交通大学测试小区1栋00单元00");
//
// HospitalInformation hospitalInformation = new HospitalInformation();
// hospitalInformation.setHospitalName("江苏大学");
// hospitalInformation.setPhoneNumber("025-91918230");
// hospitalInformation.setProvince("江苏");
// hospitalInformation.setCity("南京市市");
// hospitalInformation.setCounty("栖霞区区");
// hospitalInformation.setArea("南京仙林大学城199号");
//
// EMSGenerateUtil.generateOrder(
// "D:\\12345\\",
// param,
// hospitalInformation,
// false,
// 600,
// 400);
// }
//
//
//}
@@ -1,51 +1,51 @@
package com.jero.mail.commont;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Hashtable;
/**
* @author zql
* @date 2021/10/29 10:57
*/
public class SFBarCodeGenerateUtil {
/**
* 快递单号 wayBillNo
*
* @param generatePathName 指定文件名
* @param wayBillNo 写入的内容
* @param width 尺寸宽
* @param height 尺寸高
*/
public static void generateBarCode128_a(String wayBillNo, String generatePathName, int width, int height) {
Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>();
// 字符集
hints.put(EncodeHintType.CHARACTER_SET, "GBK");// Constant.CHARACTER);
// 容错质量
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
try {
// 尺寸
BitMatrix bitMatrix;
bitMatrix = new MultiFormatWriter().encode(wayBillNo, BarcodeFormat.CODE_128, width, height, hints);
BufferedOutputStream buffer = null;
buffer = new BufferedOutputStream(new FileOutputStream(generatePathName));
// ok
MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(new File(generatePathName)));
buffer.close();
} catch (WriterException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
//package com.jero.mail.commont;
//
//import com.google.zxing.BarcodeFormat;
//import com.google.zxing.EncodeHintType;
//import com.google.zxing.MultiFormatWriter;
//import com.google.zxing.WriterException;
//import com.google.zxing.client.j2se.MatrixToImageWriter;
//import com.google.zxing.common.BitMatrix;
//import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
//
//import java.io.BufferedOutputStream;
//import java.io.File;
//import java.io.FileOutputStream;
//import java.io.IOException;
//import java.util.Hashtable;
//
///**
// * @author zql
// * @date 2021/10/29 10:57
// */
//public class SFBarCodeGenerateUtil {
// /**
// * 快递单号 wayBillNo
// *
// * @param generatePathName 指定文件名
// * @param wayBillNo 写入的内容
// * @param width 尺寸宽
// * @param height 尺寸高
// */
// public static void generateBarCode128_a(String wayBillNo, String generatePathName, int width, int height) {
// Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>();
// // 字符集
// hints.put(EncodeHintType.CHARACTER_SET, "GBK");// Constant.CHARACTER);
// // 容错质量
// hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M);
// try {
// // 尺寸
// BitMatrix bitMatrix;
// bitMatrix = new MultiFormatWriter().encode(wayBillNo, BarcodeFormat.CODE_128, width, height, hints);
// BufferedOutputStream buffer = null;
// buffer = new BufferedOutputStream(new FileOutputStream(generatePathName));
// // ok
// MatrixToImageWriter.writeToStream(bitMatrix, "png", new FileOutputStream(new File(generatePathName)));
// buffer.close();
// } catch (WriterException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
//}
@@ -25,9 +25,9 @@ import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.PasswordUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.mail.commont.BatOrder;
import com.jero.mail.commont.HospitalInformation;
import com.jero.mail.commont.Print;
//import com.jero.mail.commont.BatOrder;
//import com.jero.mail.commont.HospitalInformation;
//import com.jero.mail.commont.Print;
import com.jero.mail.commont.constant;
import com.jero.mail.entity.PayMailBill;
import com.jero.mail.entity.PayMailBillProject;
@@ -307,41 +307,41 @@ public class PayMailBillController extends JeroController<PayMailBill, IPayMailB
return Result.OK();
}
/**
* 票据邮寄打印
*
*/
@ApiOperation(value="票据邮寄打印", notes="票据邮寄打印")
@Transactional
@PostMapping(value = "/print")
public Result<?> print(@RequestParam(name="id") String id) {
PayMailBill payMailBill = payMailBillService.getById(id);
BatOrder param = new BatOrder();
param.setId("EMS票单");
param.setMileTime(payMailBill.getSendDate());
param.setTracking_number(payMailBill.getPostNo());
param.setFilePath("310-新A-沙区02-沙区揽投-*");
param.setAddressName(payMailBill.getContactName());
param.setAddressPhone(PasswordUtil.decrypt(payMailBill.getContactMobile()));
param.setAddress(payMailBill.getContactAddress());
HospitalInformation hospitalInformation = new HospitalInformation();
hospitalInformation.setHospitalName(payMailBill.getMailer());
hospitalInformation.setPhoneNumber(PasswordUtil.decrypt(payMailBill.getContactMobile()));
hospitalInformation.setProvince("江苏");
hospitalInformation.setCity("南京市市");
hospitalInformation.setCounty("栖霞区区");
hospitalInformation.setArea("南京仙林大学城199号");
Print.EMSGenerateUtil.generateOrder(
"D:\\",
param,
hospitalInformation,
false,
600,
400);
return Result.OK();
}
// /**
// * 票据邮寄打印
// *
// */
// @ApiOperation(value="票据邮寄打印", notes="票据邮寄打印")
// @Transactional
// @PostMapping(value = "/print")
// public Result<?> print(@RequestParam(name="id") String id) {
// PayMailBill payMailBill = payMailBillService.getById(id);
// BatOrder param = new BatOrder();
// param.setId("EMS票单");
// param.setMileTime(payMailBill.getSendDate());
// param.setTracking_number(payMailBill.getPostNo());
// param.setFilePath("310-新A-沙区02-沙区揽投-*");
// param.setAddressName(payMailBill.getContactName());
// param.setAddressPhone(PasswordUtil.decrypt(payMailBill.getContactMobile()));
// param.setAddress(payMailBill.getContactAddress());
//
// HospitalInformation hospitalInformation = new HospitalInformation();
// hospitalInformation.setHospitalName(payMailBill.getMailer());
// hospitalInformation.setPhoneNumber(PasswordUtil.decrypt(payMailBill.getContactMobile()));
// hospitalInformation.setProvince("江苏");
// hospitalInformation.setCity("南京市市");
// hospitalInformation.setCounty("栖霞区区");
// hospitalInformation.setArea("南京仙林大学城199号");
//
// Print.EMSGenerateUtil.generateOrder(
// "D:\\",
// param,
// hospitalInformation,
// false,
// 600,
// 400);
// return Result.OK();
// }
/**
@@ -97,9 +97,10 @@ public class AllProjectStatisticsController {
} else {
return Result.OK();
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
assert idList != null;
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageList(page,allProjectStatisticsSearch, listNew );
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageList(page,allProjectStatisticsSearch, idList );
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
@@ -169,8 +170,8 @@ public class AllProjectStatisticsController {
return Result.OK();
}
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListForProject(page,allProjectStatisticsSearch,listNew);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListForProject(page,allProjectStatisticsSearch,idList);
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
@@ -243,8 +244,8 @@ public class AllProjectStatisticsController {
String year = String.valueOf(calendar.get(Calendar.YEAR));
allProjectStatisticsSearch.setYear(year);
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, listNew);
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, idList);
if (pageList != null) {
for (AllProjectStatistics s : pageList) {
String key = String.valueOf(s.getChargeUse());
@@ -285,8 +286,8 @@ public class AllProjectStatisticsController {
String year = String.valueOf(calendar.get(Calendar.YEAR));
allProjectStatisticsSearch.setYear(year);
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, listNew,strings);
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, idList,strings);
if (pageList != null) {
for (AllProjectStatistics s : pageList) {
String key = String.valueOf(s.getChargeUse());
@@ -330,8 +331,8 @@ public class AllProjectStatisticsController {
ArrayList<AllProjectStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "企业来款统计");
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, listNew);
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, idList);
if (pageList != null) {
for (AllProjectStatistics s : pageList) {
String key = String.valueOf(s.getChargeUse());
@@ -86,8 +86,8 @@ public class CompanyComeMoneyStatisticsController {
return Result.OK();
}
Page<CompanyComeMoneyList> page = new Page<>(pageNo, pageSize);
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page,companyComeMoneySearch,listNew);
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page,companyComeMoneySearch,idList);
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
@@ -150,8 +150,8 @@ public class CompanyComeMoneyStatisticsController {
return Result.OK();
}
Page<CompanyComeMoneyDetail> page = new Page<>(pageNo, pageSize);
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
IPage<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetail(page, companyComeMoneyDetailSearch,listNew);
IPage<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetail(page, companyComeMoneyDetailSearch,idList);
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
@@ -212,8 +212,8 @@ public class CompanyComeMoneyStatisticsController {
ArrayList<CompanyComeMoneyList> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, CompanyComeMoneyList.class, "企业来款统计");
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch, listNew);
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch, idList);
return AmountUtil.exportListXls(pageList, CompanyComeMoneyList.class, "企业来款统计");
@@ -247,8 +247,8 @@ public class CompanyComeMoneyStatisticsController {
ArrayList<CompanyComeMoneyDetail> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, CompanyComeMoneyDetail.class, "企业来款详情统计");
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch, listNew);
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch, idList);
for (CompanyComeMoneyDetail s : pageList) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
@@ -95,8 +95,8 @@ public class PayWorkingGroupStatisticsController {
} else {
return Result.OK();
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
IPage<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatistics(page, payWorkingGroupSearch,listNew);
IPage<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatistics(page, payWorkingGroupSearch,idList);
List<PayWorkingGroupStatistics> records = pageList.getRecords();
for (PayWorkingGroupStatistics payWorkingGroupStatistics:records){
if(payWorkingGroupStatistics.getComeAllMoney()==null||payWorkingGroupStatistics.getComeAllMoney()==""){
@@ -162,8 +162,8 @@ public class PayWorkingGroupStatisticsController {
ArrayList<PayWorkingGroupStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, PayWorkingGroupStatistics.class, "工作组项目统计");
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, listNew);
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, idList);
//处理为空数据为0
for (PayWorkingGroupStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
@@ -200,8 +200,8 @@ public class PayWorkingGroupStatisticsController {
ArrayList<PayWorkingGroupStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, PayWorkingGroupStatistics.class, "工作组项目统计");
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, listNew,strings);
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, idList,strings);
//处理为空数据为0
for (PayWorkingGroupStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
@@ -91,8 +91,8 @@ public class PrincipalPeopleStatisticsController {
}
Page<PrincipalPeopleList> page = new Page<>(pageNo, pageSize);
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
IPage<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipal(page,principalPeopleSearch,listNew);
IPage<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipal(page,principalPeopleSearch,idList);
HashMap<String, Object> hashMap = new HashMap<>();
double sum=0;
double sumTwo =0;
@@ -203,8 +203,8 @@ public class PrincipalPeopleStatisticsController {
ArrayList<PrincipalPeopleList> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, PrincipalPeopleList.class, "个人来款");
}
List<String> listNew = new ArrayList<>(new TreeSet<>(idList));
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, listNew);
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, idList);
return AmountUtil.exportListXls(pageList, PrincipalPeopleList.class, "个人来款");