|
@ -17,7 +17,6 @@ |
|
|
|
|
|
|
|
|
package com.epmet.controller; |
|
|
package com.epmet.controller; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; |
|
|
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; |
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
import com.epmet.commons.tools.annotation.RequirePermission; |
|
|
import com.epmet.commons.tools.annotation.RequirePermission; |
|
@ -43,12 +42,7 @@ import com.epmet.send.SendMqMsgUtil; |
|
|
import com.epmet.service.AgencyService; |
|
|
import com.epmet.service.AgencyService; |
|
|
import com.epmet.service.CustomerAgencyService; |
|
|
import com.epmet.service.CustomerAgencyService; |
|
|
import com.epmet.service.IcNeighborHoodService; |
|
|
import com.epmet.service.IcNeighborHoodService; |
|
|
import com.google.zxing.BarcodeFormat; |
|
|
import org.apache.commons.io.FileUtils; |
|
|
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 org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -60,8 +54,6 @@ import javax.servlet.http.HttpServletResponse; |
|
|
import java.awt.image.BufferedImage; |
|
|
import java.awt.image.BufferedImage; |
|
|
import java.io.*; |
|
|
import java.io.*; |
|
|
import java.net.URLEncoder; |
|
|
import java.net.URLEncoder; |
|
|
import java.nio.file.FileSystems; |
|
|
|
|
|
import java.nio.file.Path; |
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
import java.time.ZoneOffset; |
|
|
import java.time.ZoneOffset; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
@ -450,4 +442,22 @@ public class AgencyController { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
try { |
|
|
|
|
|
BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区中国国歌过过过过过所多对方水电费是的发生的", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111"); |
|
|
|
|
|
//BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区", "erId=72d331139a5012b6bba18b40029a2755&123123123111");
|
|
|
|
|
|
//BufferedImage image2 = BarcodeUtils.getQRCode("小崽子社区", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111");
|
|
|
|
|
|
//BufferedImage 转 InputStream
|
|
|
|
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); |
|
|
|
|
|
ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream); |
|
|
|
|
|
ImageIO.write(image, "png", imageOutput); |
|
|
|
|
|
InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); |
|
|
|
|
|
String s = "/Users/liujianjun/Downloads/t.png"; |
|
|
|
|
|
File file= new File(s); |
|
|
|
|
|
FileUtils.copyInputStreamToFile(inputStream, file); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|