From f3a9c450a9416b7e49c759c48817c3a3f586c1eb Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期五, 30 六月 2023 20:26:24 +0800
Subject: [PATCH] 质检管理下拉框
---
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutReportManager.java | 161 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 99 insertions(+), 62 deletions(-)
diff --git a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutReportManager.java b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutReportManager.java
index 4219d59..e8e762e 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutReportManager.java
+++ b/igds-inout/src/main/java/com/ld/igds/inout/manager/InoutReportManager.java
@@ -4,13 +4,11 @@
import com.ld.igds.check.dto.CheckItemData;
import com.ld.igds.check.service.CoreCheckStandardService;
import com.ld.igds.common.CoreCommonService;
+import com.ld.igds.common.bar.BarCodeUtils;
import com.ld.igds.constant.FoodVariety;
import com.ld.igds.inout.InoutBill;
import com.ld.igds.inout.InoutConstant;
-import com.ld.igds.inout.dto.InoutData;
-import com.ld.igds.inout.dto.InoutRecordItemData;
-import com.ld.igds.inout.dto.InoutRecordItemParam;
-import com.ld.igds.inout.dto.WeightBill;
+import com.ld.igds.inout.dto.*;
import com.ld.igds.inout.service.InoutRecordItemService;
import com.ld.igds.m.dto.NoticeDto;
import com.ld.igds.m.service.HInoutNoticeService;
@@ -93,7 +91,7 @@
htmlStr = htmlStr.replace("fullTime", bill.getFullTime());
htmlStr = htmlStr.replace("emptyTime", bill.getEmptyTime());
htmlStr = htmlStr.replace("serId", bill.getSerId());
- htmlStr = htmlStr.replace("specType", bill.getSpecType());
+// htmlStr = htmlStr.replace("specType", bill.getSpecType());
htmlStr = htmlStr.replace("customerName", bill.getCustomerName());
htmlStr = htmlStr.replace("deptName", bill.getUnitName());
@@ -116,6 +114,11 @@
htmlStr = htmlStr.replace("deImpurity", bill.getDeImpurity() + "");
htmlStr = htmlStr.replace("deWet", bill.getDeWet() + "");
+
+ htmlStr = htmlStr.replace("recordWeight", bill.getRecordWeight() + "");
+ htmlStr = htmlStr.replace("deCheck", bill.getDeCheck() + "");
+ htmlStr = htmlStr.replace("addCheck", bill.getAddCheck() + "");
+
htmlStr = htmlStr.replace("deSum", bill.getDeSum() + "");
htmlStr = htmlStr.replace("settleWeight",
new DecimalFormat("0").format(bill.getSettleWeight()));
@@ -127,6 +130,7 @@
htmlStr = htmlStr.replace("wet", bill.getWet() + "");
htmlStr = htmlStr.replace("impurity", bill.getImpurity() + "");
+ htmlStr = htmlStr.replace("checkStatus", bill.getCheckStatus());
htmlStr = htmlStr.replace("remark", bill.getRemark());
htmlStr = htmlStr.replace("moneyName", bill.getMoneyName());
@@ -261,7 +265,6 @@
bill.setFullTime(DateFormatUtils.format(data.getFullWeightTime(),
"yyyy-MM-dd HH:mm:ss"));
bill.setSerId(data.getId());
- bill.setSpecType(StringUtils.isEmpty(data.getSpecType())?"鏁g伯":data.getSpecType());
if ("5016".equals(data.getCompanyId())) {
bill.setCompleteTime(DateFormatUtils.format(data.getCompleteTime(), "yyyy-MM-dd"));
bill.setSerId(data.getId().substring(2));
@@ -269,7 +272,6 @@
}
//瀹㈡埛淇℃伅
- bill.setCustomerId(data.getCustomerId() == null ? "" : data.getCustomerId());
bill.setCustomerName(data.getCustomerName() == null ? "" : data.getCustomerName());
bill.setUserId(data.getUserId() == null ? "" : data.getUserId());
bill.setUserAddress(data.getUserAddress() == null ? "" : data.getUserAddress());
@@ -277,7 +279,7 @@
//浠庨�氱煡鍗曚腑鑾峰彇鏀跺彂璐у崟浣嶄俊鎭�
NoticeDto noticeDto = noticeService.queryNoticeById(data.getNoticeId(), data.getType());
- if(null != noticeDto && StringUtils.isNotEmpty(noticeDto.getUnitName())){
+ if (null != noticeDto && StringUtils.isNotEmpty(noticeDto.getUnitName())) {
bill.setUnitName(noticeDto.getUnitName());
}
@@ -300,28 +302,23 @@
bill.setFullWeight(data.getFullWeight());
bill.setEmptyWeight(data.getEmptyWeight());
bill.setNetWeight(data.getNetWeight());
+ bill.setDeCheck(data.getDeCheck());
+ bill.setAddCheck(data.getAddCheck());
+ bill.setRecordWeight(data.getRecordWeight());
+ bill.setCheckStatus(data.getCheckStatus().equals(InoutConstant.STATUS_PASS) ? "鍚堟牸" : "涓嶅悎鏍�");
- bill.setDeWet(data.getDeWet());
- bill.setDeImpurity(data.getDeImpurity());
bill.setDeHandle(data.getDeHandle());
bill.setDeOther(data.getDeOther());
- bill.setDeSum(data.getDeSum() == null ? 0.0 :data.getDeSum());
bill.setSettleWeight(data.getSettleWeight());
-// if(data.getWet() != null && data.getWet() > 0){
-// bill.setWet(data.getWet() +"");
-// }
-// if(data.getImpurity() != null && data.getImpurity() > 0){
-// bill.setImpurity(data.getImpurity()+"");
-// }
- bill.setPrice(data.getPrice()== null ? "" :data.getPrice() + "");
- if(data.getSettleMoney() <= 0){
- if(null != data.getPrice() && null != data.getRecordWeight()){
- data.setSettleMoney(NumberUtil.keepPrecision(data.getPrice()*data.getRecordWeight(),2));
+ bill.setPrice(data.getPrice() == null ? "" : data.getPrice() + "");
+ if (data.getSettleMoney() <= 0) {
+ if (null != data.getPrice() && null != data.getRecordWeight()) {
+ data.setSettleMoney(NumberUtil.keepPrecision(data.getPrice() * data.getRecordWeight(), 2));
}
}
- bill.setSettleMoney(data.getSettleMoney()== null ? "" :data.getSettleMoney()+"");
+ bill.setSettleMoney(data.getSettleMoney() == null ? "" : data.getSettleMoney() + "");
bill.setRemark(data.getRemarks() == null ? "" : data.getRemarks());
return bill;
@@ -338,15 +335,26 @@
// 鑾峰彇鍖栭獙鏁版嵁
List<CheckItemData> checkLst = data.getCheckItems();
if (null == checkLst)
- checkStandardService.getCheckItemById(data.getCheckId(),
- data.getCompanyId());
+ checkStandardService.getCheckItemById(data.getCheckId(), data.getCompanyId());
if (checkLst == null || checkLst.size() < 1) {
return "鏃犲寲楠屾暟鎹紝涓嶆墦鍗帮紒";
}
-
+ String mark = data.getFoodVariety().substring(0, 3);
// 璋冩暣妯$増鏁版嵁骞惰繑鍥�
- String htmlStr = InoutBill.IN_CHECK_DEFAULT;
+ String htmlStr = "";
+ if (mark == FoodVariety.FOOD_VARIETY_WHEAT) {
+ htmlStr = InoutBill.IN_CHECK_WHEAT;
+ } else if (mark == FoodVariety.FOOD_VARIETY_PADDY) {
+ htmlStr = InoutBill.IN_CHECK_PADDY;
+ } else if (mark == FoodVariety.FOOD_VARIETY_CORN) {
+ htmlStr = InoutBill.IN_CHECK_CORN;
+ } else if (data.getFoodVariety() == FoodVariety.FOOD_VARIETY_SOYBEAN) {
+ htmlStr = InoutBill.IN_CHECK_SOYBEAN;
+ } else {
+ return "妯℃澘鏆傛湭纭畾锛侊紒";
+ }
+
DefaultDept dept = sysDeptService.getCacheDept(data.getCompanyId(),
data.getDeptId());
@@ -357,24 +365,30 @@
// 鏇挎崲鍩虹鏁版嵁
String time = DateFormatUtils.format(data.getRegisterTime(),
"yyyy-MM-dd");
- htmlStr = htmlStr.replace("time", time);
+// htmlStr = htmlStr.replace("time", time);
htmlStr = htmlStr.replace("customerName", data.getCustomerName());
htmlStr = htmlStr.replace("serId", data.getId());
+ htmlStr = htmlStr.replace("deptName", dept.getName());
htmlStr = htmlStr.replace("foodVariety", FoodVariety.getMsg(data.getFoodVariety()));
htmlStr = htmlStr.replace("plateNum", data.getPlateNum());
htmlStr = htmlStr.replace("userName", data.getUserName());
htmlStr = htmlStr.replace("foodYear", data.getFoodYear() == null ? "/" : data.getFoodYear());
Depot depot = commonService.getCacheDepot(data.getCompanyId(), data.getDepotId());
+ htmlStr = htmlStr.replace("storeKeeperName", depot == null ? "" : (depot.getStoreKeeperName() == null ? "" : depot.getStoreKeeperName()));
htmlStr = htmlStr.replace("depotName", depot == null ? "/" : depot.getName());
htmlStr = htmlStr.replace("checkUser", data.getCheckUser() == null ? "/" : data.getCheckUser());
-
+ htmlStr = htmlStr.replace("foodType", data.getFoodType() == null ? "/" : data.getFoodType());
+ htmlStr = htmlStr.replace("foodNumber", data.getSettleWeight() + "");
+ htmlStr = htmlStr.replace("checkNum", data.getDeCheck() + "");
+ htmlStr = htmlStr.replace("foodLocation", data.getFoodLocation() == null ? "/" : data.getFoodLocation());
+ htmlStr = htmlStr.replace("foodLevel", data.getFoodLevel() == null ? "/" : data.getFoodLevel());
Map<String, String> checkBillItems = getCheckBillItems();
// 閬嶅巻鍖栭獙缁撴灉锛屽瓨鍏ap闆嗗悎涓�
String key;
for (CheckItemData item : checkLst) {
key = item.getStandardId() + "_ST";
- checkBillItems.put(key, item.getStandardValue());
- key = item.getStandardId() + "_VAL";
+ // checkBillItems.put(key, item.getStandardValue());
+// key = item.getStandardId() + "_VAL";
checkBillItems.put(key, item.getValue());
}
@@ -449,13 +463,13 @@
public String inSettleBill(InoutData data, InoutSettle settle) {
if (null != data) {
- settle.setCompleteTime(data.getCompleteTime());
+ // settle.setCompleteTime(data.getCompleteTime());
settle.setDepotId(data.getDepotId());
settle.setDeptId(data.getDeptId());
- settle.setUserName(data.getUserName());
- settle.setPlateNum(data.getPlateNum());
- settle.setFoodLevel(data.getFoodLevel());
- settle.setFoodVariety(data.getFoodVariety());
+// settle.setUserName(data.getUserName());
+// settle.setPlateNum(data.getPlateNum());
+// settle.setFoodLevel(data.getFoodLevel());
+// settle.setFoodVariety(data.getFoodVariety());
}
// 璋冩暣妯$増鏁版嵁骞惰繑鍥�
@@ -473,26 +487,26 @@
htmlStr = htmlStr.replace("payTime", time);
htmlStr = htmlStr.replace("serId", settle.getId());
- htmlStr = htmlStr.replace(
- "customerName",
- settle.getCustomerName() == null ? "" : settle
- .getCustomerName());
+// htmlStr = htmlStr.replace(
+// "customerName",
+// settle.getCustomerName() == null ? "" : settle
+// .getCustomerName());
htmlStr = htmlStr.replace("deptName",
dept == null ? "" : dept.getName());
htmlStr = htmlStr.replace("bank", settle.getBank() == null ? ""
: settle.getBank());
- htmlStr = htmlStr.replace("fullWeight",
- new DecimalFormat("0").format(settle.getFullWeight()));
- htmlStr = htmlStr.replace("emptyWeight",
- new DecimalFormat("0").format(settle.getEmptyWeight()));
+// htmlStr = htmlStr.replace("fullWeight",
+// new DecimalFormat("0").format(settle.getFullWeight()));
+// htmlStr = htmlStr.replace("emptyWeight",
+// new DecimalFormat("0").format(settle.getEmptyWeight()));
htmlStr = htmlStr.replace("banNum", settle.getBankNum() == null ? ""
: settle.getBankNum());
- htmlStr = htmlStr.replace("netWeight",
- new DecimalFormat("0").format(settle.getNetWeight()));
- htmlStr = htmlStr.replace("deSum",
- new DecimalFormat("0").format(settle.getDeSum()));
+// htmlStr = htmlStr.replace("netWeight",
+// new DecimalFormat("0").format(settle.getNetWeight()));
+// htmlStr = htmlStr.replace("deSum",
+// new DecimalFormat("0").format(settle.getDeSum()));
// 鑾峰彇浠撳簱淇℃伅
Depot depot = commonService.getCacheDepot(settle.getCompanyId(),
@@ -500,8 +514,8 @@
htmlStr = htmlStr.replace("depotName",
depot == null ? "" : depot.getName());
- htmlStr = htmlStr.replace("foodVariety",
- FoodVariety.getMsg(settle.getFoodVariety()));
+// htmlStr = htmlStr.replace("foodVariety",
+// FoodVariety.getMsg(settle.getFoodVariety()));
htmlStr = htmlStr.replace("payPrice", settle.getPayPrice() + "");
htmlStr = htmlStr.replace("settleWeight",
new DecimalFormat("0").format(settle.getSettleWeight()));
@@ -514,8 +528,8 @@
depot.getStoreKeeperName() == null ? "" : depot
.getStoreKeeperName());
}
- htmlStr = htmlStr.replace("driverName", settle.getUserName() + "");
- htmlStr = htmlStr.replace("otherSum", settle.getOtherSum() + "");
+// htmlStr = htmlStr.replace("driverName", settle.getUserName() + "");
+// htmlStr = htmlStr.replace("otherSum", settle.getOtherSum() + "");
htmlStr = htmlStr.replace("paySum", settle.getPaySum() + "");
htmlStr = htmlStr.replace("remark", settle.getRemarks() == null ? ""
@@ -614,18 +628,18 @@
}
String htmlStr;
- if(list.size() <= 30){
+ if (list.size() <= 30) {
//鍙湁涓�椤垫椂
- htmlStr = getShipBill(data, list, true,0);
+ htmlStr = getShipBill(data, list, true, 0);
result.add(htmlStr);
- }else {
+ } else {
//鏈夊椤垫椂
- int page = list.size()/30 + 1;
+ int page = list.size() / 30 + 1;
for (int i = 1; i <= page; i++) {
- if(i == page){
- htmlStr = getShipBill(data, list.subList((i-1)*30, list.size()),true, i);
- }else {
- htmlStr = getShipBill(data, list.subList((i-1)*30, i*30),false, i);
+ if (i == page) {
+ htmlStr = getShipBill(data, list.subList((i - 1) * 30, list.size()), true, i);
+ } else {
+ htmlStr = getShipBill(data, list.subList((i - 1) * 30, i * 30), false, i);
}
result.add(htmlStr);
}
@@ -636,6 +650,7 @@
/**
* 鑾峰彇鑸硅繍鎵撳嵃妯℃澘鏁版嵁
+ *
* @param data 娴佹按淇℃伅
* @param list 杞﹁締淇℃伅锛屾暟閲忎笉澶т簬30
* @param moreTag 缁撶畻鏍囩锛宼rue-浠h〃缁撶畻椤碉紱false-涓嶆槸缁撶畻椤�
@@ -646,7 +661,7 @@
//璋冩暣妯$増鏁版嵁骞惰繑鍥�
String htmlStr = InoutBill.SHIP_WEIGHT_DEFAULT_MORE;
- if(moreTag){
+ if (moreTag) {
htmlStr = InoutBill.SHIP_WEIGHT_DEFAULT;
}
@@ -654,7 +669,7 @@
//琛ㄥご
String billTitle = (dept == null ? "鑸硅繍杩囩鍗�" : dept.getName() + "鑸硅繍杩囩鍗�");
- if(0 != pageNum){
+ if (0 != pageNum) {
billTitle += " - 绗�" + pageNum + "椤�";
}
htmlStr = htmlStr.replace("billTitle", billTitle);
@@ -695,7 +710,7 @@
}
//娣诲姞缁撶畻淇℃伅
- if(moreTag){
+ if (moreTag) {
htmlStr = htmlStr.replace("handleUser", depot == null ? "" : (depot.getStoreKeeperName() == null ? "" : depot.getStoreKeeperName()));
htmlStr = htmlStr.replace("remarks", data.getRemarks() == null ? "" : data.getRemarks());
htmlStr = htmlStr.replace("fullWeight", new DecimalFormat("0").format(data.getFullWeight()));
@@ -704,6 +719,26 @@
}
return htmlStr;
+ }
+
+ /**
+ * 鎵撳嵃鎵︽牱鍗曪紝鐩存帴杩斿洖鏉″舰鐮丅ase64鍥剧墖
+ *
+ * @param data
+ * @return
+ */
+ public String simpleBill(InoutCheckData data) {
+
+ if (null == data.getId()) return null;
+ if (null == data.getCheckId()) return null;
+
+ if (null == data.getCheckTime()) {
+ data.setCheckTime(new Date());
+ }
+
+ String imgBase64 = BarCodeUtils.getBarCodeImageBase64(data.getId(), data.getCheckId(), "绮簱鎵︽牱鍗曟潯鐮�", DateFormatUtils.format(data.getCheckTime(), "yyyy-MM-dd HH:mm"));
+
+ return imgBase64;
}
public static void main(String[] args) {
@@ -724,4 +759,6 @@
List<String> strings3 = result.subList(6, 8);
System.out.println(strings3);
}
+
+
}
\ No newline at end of file
--
Gitblit v1.9.3