|
@@ -1156,8 +1156,7 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
|
@RequestMapping(value = "previewFzsq", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
@RemotingExclude
|
|
|
- public void previewFzsq(@RequestParam String fzcsbh,
|
|
|
- HttpServletResponse response, HttpServletRequest req) {
|
|
|
+ public void previewFzsq(@RequestParam String fzcsbh,HttpServletResponse response, HttpServletRequest req) {
|
|
|
try {
|
|
|
try {
|
|
|
if (fzcsbh != null) {
|
|
@@ -1168,22 +1167,18 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
|
}
|
|
|
response.setCharacterEncoding("utf-8");
|
|
|
response.setContentType("image/JPEG");
|
|
|
- BufferedImage image = ImageIO
|
|
|
- .read(GkwxhwzyfzblhhzController.class.getClassLoader()
|
|
|
- .getResourceAsStream("chPrint/fzsq-1.png"));
|
|
|
+ BufferedImage image = ImageIO.read(GkwxhwzyfzblhhzController.class.getClassLoader().getResourceAsStream("chPrint/fzsq-1.png"));
|
|
|
// boolean twoSides = true;
|
|
|
Graphics2D g = (Graphics2D) image.getGraphics();
|
|
|
g.setColor(new Color(0, 0, 0));
|
|
|
g.setFont(new Font("宋体", Font.PLAIN, 14));
|
|
|
|
|
|
- List<GkwxhwzyfzblFzEntity> fzxxList = gkwxhwzyfzblhhzService
|
|
|
- .findByFzcsbh(fzcsbh);
|
|
|
+ List<GkwxhwzyfzblFzEntity> fzxxList = gkwxhwzyfzblhhzService.findByFzcsbh(fzcsbh);
|
|
|
GkwxhwzyfzblFzEntity fzxx = null;
|
|
|
GkwxhwzyfzblhhzEntity fzsq = null;
|
|
|
String pm = "";
|
|
|
if (fzxxList != null && fzxxList.size() > 0) {
|
|
|
- InputStream in = GkwxhwzyfzblhhzController.class
|
|
|
- .getResourceAsStream("/chPrint/preview.properties");
|
|
|
+ InputStream in = GkwxhwzyfzblhhzController.class.getResourceAsStream("/chPrint/preview.properties");
|
|
|
if (in != null) {
|
|
|
Properties p = new Properties();
|
|
|
try {
|
|
@@ -1196,39 +1191,39 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
|
fzsq = fzxx.getFzsq();
|
|
|
// 港口经营人
|
|
|
g.drawString(fzsq.getJyrVo().getGkjyr(),
|
|
|
- Integer.parseInt(p.get("gkjyr-x").toString()),
|
|
|
- Integer.parseInt(p.get("gkjyr-y").toString()));
|
|
|
+ Integer.parseInt(p.get("gkjyr-x").toString()),
|
|
|
+ Integer.parseInt(p.get("gkjyr-y").toString()));
|
|
|
// 作业区域范围
|
|
|
String zyfw = "";
|
|
|
- if (Constants.GGDM_ID_ZYDD_BW
|
|
|
- .equals(fzsq.getZycs().getId()))
|
|
|
+ if (Constants.GGDM_ID_ZYDD_BW.equals(fzsq.getZycs().getId())){
|
|
|
zyfw = "码头泊位";
|
|
|
- else if (Constants.GGDM_ID_ZYDD_CG.equals(fzsq.getZycs()
|
|
|
- .getId()))
|
|
|
+ }
|
|
|
+ else if (Constants.GGDM_ID_ZYDD_CG.equals(fzsq.getZycs().getId())){
|
|
|
zyfw = "储罐";
|
|
|
- else if (Constants.GGDM_ID_ZYDD_CK.equals(fzsq.getZycs()
|
|
|
- .getId()))
|
|
|
+ }
|
|
|
+ else if (Constants.GGDM_ID_ZYDD_CK.equals(fzsq.getZycs().getId())){
|
|
|
zyfw = "仓库";
|
|
|
- else if (Constants.GGDM_ID_ZYDD_DC.equals(fzsq.getZycs()
|
|
|
- .getId()))
|
|
|
+ }
|
|
|
+ else if (Constants.GGDM_ID_ZYDD_DC.equals(fzsq.getZycs().getId())){
|
|
|
zyfw = "堆场";
|
|
|
- else if (Constants.GGDM_ID_ZYDD_GBQ.equals(fzsq.getZycs()
|
|
|
- .getId()))
|
|
|
+ }
|
|
|
+ else if (Constants.GGDM_ID_ZYDD_GBQ.equals(fzsq.getZycs().getId())){
|
|
|
zyfw = "过驳区";
|
|
|
- if (!"".equals(fzxx.getQynbmc())
|
|
|
- && !"null".equals(fzxx.getQynbmc())) {
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!"".equals(fzxx.getQynbmc())&& !"null".equals(fzxx.getQynbmc())) {
|
|
|
zyfw = zyfw + "_" + fzxx.getQynbmc();
|
|
|
}
|
|
|
+
|
|
|
g.drawString(zyfw,
|
|
|
- Integer.parseInt(p.get("zyqyfw-x").toString()),
|
|
|
- Integer.parseInt(p.get("zyqyfw-y").toString()));
|
|
|
+ Integer.parseInt(p.get("zyqyfw-x").toString()),
|
|
|
+ Integer.parseInt(p.get("zyqyfw-y").toString()));
|
|
|
// 附证编号
|
|
|
int fzbhLen = 220;
|
|
|
- if (g.getFontMetrics().charsWidth(fzcsbh.toCharArray(), 0,
|
|
|
- fzcsbh.length()) <= fzbhLen) {
|
|
|
+ if (g.getFontMetrics().charsWidth(fzcsbh.toCharArray(), 0,fzcsbh.length()) <= fzbhLen) {
|
|
|
g.drawString(fzcsbh,
|
|
|
- Integer.parseInt(p.get("fzcsbh-x").toString()),
|
|
|
- Integer.parseInt(p.get("fzcsbh-y").toString()));
|
|
|
+ Integer.parseInt(p.get("fzcsbh-x").toString()),
|
|
|
+ Integer.parseInt(p.get("fzcsbh-y").toString()));
|
|
|
} else {
|
|
|
char[] fzChars = fzcsbh.toCharArray();
|
|
|
int len = 0;
|
|
@@ -1242,23 +1237,20 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
|
line2 += String.valueOf(c);
|
|
|
}
|
|
|
}
|
|
|
- g.drawString(
|
|
|
- line1,
|
|
|
- Integer.parseInt(p.get("fzcsbh-x").toString()),
|
|
|
- Integer.parseInt(p.get("fzcsbh-y").toString()) - 8);
|
|
|
- g.drawString(
|
|
|
- line2,
|
|
|
- Integer.parseInt(p.get("fzcsbh-x").toString()),
|
|
|
- Integer.parseInt(p.get("fzcsbh-y").toString()) + 8);
|
|
|
+ g.drawString(line1,
|
|
|
+ Integer.parseInt(p.get("fzcsbh-x").toString()),
|
|
|
+ Integer.parseInt(p.get("fzcsbh-y").toString()) - 8);
|
|
|
+ g.drawString(line2,
|
|
|
+ Integer.parseInt(p.get("fzcsbh-x").toString()),
|
|
|
+ Integer.parseInt(p.get("fzcsbh-y").toString()) + 8);
|
|
|
}
|
|
|
// 作业方式
|
|
|
int zyfsLen = 240;
|
|
|
String zyfs = fzsq.getZyfs()==null?"":fzsq.getZyfs();
|
|
|
- if (g.getFontMetrics().charsWidth(zyfs.toCharArray(), 0,
|
|
|
- zyfs.length()) <= zyfsLen) {
|
|
|
+ if (g.getFontMetrics().charsWidth(zyfs.toCharArray(), 0,zyfs.length()) <= zyfsLen) {
|
|
|
g.drawString(zyfs,
|
|
|
- Integer.parseInt(p.get("zyfs-x").toString()),
|
|
|
- Integer.parseInt(p.get("zyfs-y").toString()));
|
|
|
+ Integer.parseInt(p.get("zyfs-x").toString()),
|
|
|
+ Integer.parseInt(p.get("zyfs-y").toString()));
|
|
|
} else {
|
|
|
char[] zyfsChars = zyfs.toCharArray();
|
|
|
int len = 0;
|
|
@@ -1281,6 +1273,8 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
|
Integer.parseInt(p.get("zyfs-x").toString()),
|
|
|
Integer.parseInt(p.get("zyfs-y").toString()) + 8);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
// 二维码
|
|
|
String content = Constants.FZ_QRCODE + fzcsbh;
|
|
|
try {
|
|
@@ -1413,8 +1407,7 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- g.drawString("(更多危货品名见背面)", pm_x, pm_y + row
|
|
|
- * rowHeight + 5);
|
|
|
+ g.drawString("(更多危货品名见背面)", pm_x, pm_y + row * rowHeight + 5);
|
|
|
// // 反面
|
|
|
// int pm_rev_x = Integer.parseInt(p.get("wxhwpm-rev-x")
|
|
|
// .toString());
|