From 69cd9f59a0fabf12f8c9147fcba7f69817a870b3 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期一, 06 十一月 2023 23:40:59 +0800 Subject: [PATCH] 更新仓内抓拍2 --- igds-inout/src/main/java/com/ld/igds/inout/manager/InoutReportManager.java | 170 +++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 131 insertions(+), 39 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 86003d3..f1e57fb 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 @@ -5,6 +5,7 @@ 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.FoodLevel; import com.ld.igds.constant.FoodVariety; import com.ld.igds.inout.InoutBill; import com.ld.igds.inout.InoutConstant; @@ -83,6 +84,14 @@ if ("5322".equals(data.getCompanyId())) { htmlStr = InoutBill.IN_WEIGHT_5322; } + // 鐪夊北甯傚簱浣跨敤 + if ("5005".equals(data.getCompanyId())) { + htmlStr = InoutBill.IN_WEIGHT_5005; + } + // 涓规1搴撲娇鐢� + if ("5012".equals(data.getCompanyId())) { + htmlStr = InoutBill.IN_WEIGHT_5012; + } htmlStr = htmlStr.replace("billTitle", bill.getBillTitle()); @@ -103,6 +112,7 @@ htmlStr = htmlStr.replace("foodVariety", bill.getFoodVariety()); htmlStr = htmlStr.replace("depotName", bill.getDepotName()); htmlStr = htmlStr.replace("foodLocation", bill.getFoodLocation()); + htmlStr = htmlStr.replace("plateNum", bill.getPlateNum()); htmlStr = htmlStr.replace("fullWeight", @@ -134,8 +144,17 @@ htmlStr = htmlStr.replace("remark", bill.getRemark()); htmlStr = htmlStr.replace("moneyName", bill.getMoneyName()); - htmlStr = htmlStr.replace("handleUser", bill.getHandleUser()); + htmlStr = htmlStr.replace("unitName", bill.getUnitName()); + htmlStr = htmlStr.replace("time", bill.getRegisterTime()); + htmlStr = htmlStr.replace("handleStart", ""); + htmlStr = htmlStr.replace("handleEnd", ""); + htmlStr = htmlStr.replaceAll("weightUser", + bill.getWeightUser() == null ? "" : bill.getWeightUser()); + htmlStr = htmlStr.replaceAll("handleUser", + bill.getHandleUser() == null ? "" : bill.getHandleUser()); + htmlStr = htmlStr.replaceAll("keeperName", + bill.getKeeperUser() == null ? "" : bill.getKeeperUser()); return htmlStr; } @@ -147,7 +166,7 @@ */ public String outWeightBill(InoutData data) { // 鑾峰彇琛ㄥ崟鏁版嵁 - WeightBill bill = this.createBillData(data, "鍑哄簱绉伴噸鍗�"); + WeightBill bill = this.createBillData(data, "鍑哄簱鍒掔爜鍗�"); //榛樿妯$増 String htmlStr = InoutBill.OUT_WEIGHT_DEFAULT; @@ -181,7 +200,14 @@ if ("5322".equals(data.getCompanyId())) { htmlStr = InoutBill.OUT_WEIGHT_5322; } - + // 鐪夊北甯傚簱浣跨敤 + if ("5005".equals(data.getCompanyId())) { + htmlStr = InoutBill.OUT_WEIGHT_5005; + } + // 涓规1搴撲娇鐢� + if ("5012".equals(data.getCompanyId())) { + htmlStr = InoutBill.OUT_WEIGHT_5012; + } htmlStr = htmlStr.replace("billTitle", bill.getBillTitle()); htmlStr = htmlStr.replace("registerTime", bill.getRegisterTime()); @@ -189,7 +215,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()); @@ -211,19 +237,33 @@ new DecimalFormat("0").format(bill.getNetWeight())); htmlStr = htmlStr.replace("remark", bill.getRemark()); - htmlStr = htmlStr.replace("deWet", bill.getDeWet() + ""); +// htmlStr = htmlStr.replace("deWet", bill.getDeWet() + ""); htmlStr = htmlStr.replace("settleWeight", new DecimalFormat("0").format(bill.getSettleWeight())); + htmlStr = htmlStr.replace("deHandle", bill.getDeHandle() + ""); - htmlStr = htmlStr.replace("handleUser", bill.getHandleUser()); htmlStr = htmlStr.replace("deSum", bill.getDeSum() + ""); - + htmlStr = htmlStr.replace("deOther", bill.getDeOther() + ""); htmlStr = htmlStr.replace("price", bill.getPrice()); htmlStr = htmlStr.replace("settleMoney", bill.getSettleMoney() + ""); htmlStr = htmlStr.replace("wet", bill.getWet() + ""); htmlStr = htmlStr.replace("impurity", bill.getImpurity() + ""); + htmlStr = htmlStr.replace("unitName", getValue(bill.getUnitName())); + htmlStr = htmlStr.replace("time", bill.getRegisterTime()); + htmlStr = htmlStr.replace("handleStart", ""); + htmlStr = htmlStr.replace("handleEnd", ""); + + htmlStr = htmlStr.replaceAll("weightUser", getValue(bill.getWeightUser())); + htmlStr = htmlStr.replace("handleUser", getValue(bill.getHandleUser())); + htmlStr = htmlStr.replaceAll("keeperName", getValue(bill.getKeeperUser())); return htmlStr; + } + + + public String getValue(String value) { + if (null == value) return ""; + return value; } /** @@ -320,7 +360,16 @@ } bill.setSettleMoney(data.getSettleMoney() == null ? "" : data.getSettleMoney() + ""); bill.setRemark(data.getRemarks() == null ? "" : data.getRemarks()); + bill.setDeSum(data.getDeCheck() + data.getDeOther() + data.getDeHandle() + data.getDePackage()); + if (InoutConstant.TYPE_IN.equals(data.getType())) { + bill.setWeightUser(data.getFullWeightUser()); + } + if (InoutConstant.TYPE_OUT.equals(data.getType())) { + bill.setWeightUser(data.getEmptyWeightUser()); + } + bill.setHandleUser(data.getHandleUser()); + bill.setKeeperUser(depot.getStoreKeeperName()); return bill; } @@ -343,13 +392,13 @@ String mark = data.getFoodVariety().substring(0, 3); // 璋冩暣妯$増鏁版嵁骞惰繑鍥� String htmlStr = ""; - if (mark == FoodVariety.FOOD_VARIETY_WHEAT) { + if (FoodVariety.FOOD_VARIETY_WHEAT.equals(mark)) { htmlStr = InoutBill.IN_CHECK_WHEAT; - } else if (mark == FoodVariety.FOOD_VARIETY_PADDY) { + } else if (FoodVariety.FOOD_VARIETY_PADDY.equals(mark)) { htmlStr = InoutBill.IN_CHECK_PADDY; - } else if (mark == FoodVariety.FOOD_VARIETY_CORN) { + } else if (FoodVariety.FOOD_VARIETY_CORN.equals(mark)) { htmlStr = InoutBill.IN_CHECK_CORN; - } else if (data.getFoodVariety() == FoodVariety.FOOD_VARIETY_SOYBEAN) { + } else if (FoodVariety.FOOD_VARIETY_SOYBEAN.equals(data.getFoodVariety())) { htmlStr = InoutBill.IN_CHECK_SOYBEAN; } else { return "妯℃澘鏆傛湭纭畾锛侊紒"; @@ -363,25 +412,37 @@ (dept == null ? "鍏ュ簱鍖栭獙鍗�" : dept.getName() + "鍏ュ簱鍖栭獙鍗�")); // 鏇挎崲鍩虹鏁版嵁 - String time = DateFormatUtils.format(data.getRegisterTime(), - "yyyy-MM-dd"); +// String time = DateFormatUtils.format(data.getRegisterTime(), +// "yyyy-MM-dd"); + String checkTime = data.getCheckTime() == null ? "-" : DateFormatUtils.format(data.getCheckTime(), "yyyy-MM-dd HH:mm:ss"); + String sampleTime = data.getSampleTime() == null ? "-" : DateFormatUtils.format(data.getSampleTime(), "yyyy-MM-dd HH:mm:ss"); + String reportTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"); // htmlStr = htmlStr.replace("time", time); htmlStr = htmlStr.replace("customerName", data.getCustomerName()); - htmlStr = htmlStr.replace("serId", data.getId()); + htmlStr = htmlStr.replace("serId", data.getId().substring(2)); 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()); + 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("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()); + htmlStr = htmlStr.replace("foodLocation", data.getFoodLocation() == null ? "-" : data.getFoodLocation()); + htmlStr = htmlStr.replace("foodLevel", data.getFoodLevel() == null ? "-" : FoodLevel.getMsg(data.getFoodLevel())); + htmlStr = htmlStr.replace("hwmc", ""); + + htmlStr = htmlStr.replace("unit", ""); + htmlStr = htmlStr.replace("sampleUser", data.getSampleUser() == null ? "-" : data.getSampleUser()); + htmlStr = htmlStr.replace("checkTime", checkTime); + htmlStr = htmlStr.replace("sampleTime", sampleTime); + htmlStr = htmlStr.replace("bgcjsj", reportTime); + htmlStr = htmlStr.replace("remark", data.getRemarks() == null ? "鏃�" : data.getRemarks()); + Map<String, String> checkBillItems = getCheckBillItems(); // 閬嶅巻鍖栭獙缁撴灉锛屽瓨鍏ap闆嗗悎涓� String key; @@ -413,44 +474,76 @@ */ private Map<String, String> getCheckBillItems() { Map<String, String> map = new HashMap<>(); - map.put("C03_ST", ""); - map.put("C03_VAL", ""); map.put("C01_ST", ""); map.put("C01_VAL", ""); map.put("C02_ST", ""); map.put("C02_VAL", ""); + map.put("C03_ST", ""); + map.put("C03_VAL", ""); + map.put("C04_ST", ""); + map.put("C04_VAL", ""); + map.put("C05_ST", ""); + map.put("C05_VAL", ""); + map.put("C06_ST", ""); + map.put("C06_VAL", ""); + map.put("C07_ST", ""); + map.put("C07_VAL", ""); + map.put("C08_ST", ""); + map.put("C08_VAL", ""); map.put("C09_ST", ""); map.put("C09_VAL", ""); + map.put("C10_ST", ""); + map.put("C10_VAL", ""); + map.put("C11_ST", ""); + map.put("C11_VAL", ""); + map.put("C12_ST", ""); + map.put("C12_VAL", ""); + map.put("C13_ST", ""); + map.put("C13_VAL", ""); + map.put("C14_ST", ""); + map.put("C14_VAL", ""); + map.put("C15_ST", ""); + map.put("C15_VAL", ""); + map.put("C16_ST", ""); + map.put("C16_VAL", ""); + map.put("C17_ST", ""); + map.put("C17_VAL", ""); + map.put("C18_ST", ""); + map.put("C18_VAL", ""); + map.put("C19_ST", ""); + map.put("C19_VAL", ""); + map.put("C20_ST", ""); + map.put("C20_VAL", ""); + map.put("C21_ST", ""); + map.put("C21_VAL", ""); map.put("C22_ST", ""); map.put("C22_VAL", ""); map.put("C23_ST", ""); map.put("C23_VAL", ""); - map.put("C10_ST", ""); - map.put("C10_VAL", ""); - map.put("C04_ST", ""); - map.put("C04_VAL", ""); map.put("C24_ST", ""); map.put("C24_VAL", ""); - map.put("C08_ST", ""); - map.put("C08_VAL", ""); - map.put("C12_ST", ""); - map.put("C12_VAL", ""); map.put("C25_ST", ""); map.put("C25_VAL", ""); - map.put("C14_ST", ""); - map.put("C14_VAL", ""); - map.put("C29_ST", ""); - map.put("C29_VAL", ""); - map.put("C11_ST", ""); - map.put("C11_VAL", ""); + map.put("C26_ST", ""); + map.put("C26_VAL", ""); map.put("C27_ST", ""); map.put("C27_VAL", ""); map.put("C28_ST", ""); map.put("C28_VAL", ""); + map.put("C29_ST", ""); + map.put("C29_VAL", ""); map.put("C30_ST", ""); map.put("C30_VAL", ""); map.put("C31_ST", ""); map.put("C31_VAL", ""); + map.put("C32_ST", ""); + map.put("C32_VAL", ""); + map.put("C33_ST", ""); + map.put("C33_VAL", ""); + map.put("C34_ST", ""); + map.put("C34_VAL", ""); + map.put("C35_ST", ""); + map.put("C35_VAL", ""); return map; } @@ -530,12 +623,12 @@ } // htmlStr = htmlStr.replace("driverName", settle.getUserName() + ""); // htmlStr = htmlStr.replace("otherSum", settle.getOtherSum() + ""); - htmlStr = htmlStr.replace("paySum", settle.getPaySum() + ""); + htmlStr = htmlStr.replace("paySum", settle.getPayMoney() + ""); htmlStr = htmlStr.replace("remark", settle.getRemarks() == null ? "" : settle.getRemarks()); htmlStr = htmlStr.replace("moneyName", - MoneyUtil.formatToCN(new BigDecimal(settle.getPaySum()))); + MoneyUtil.formatToCN(new BigDecimal(settle.getPayMoney()))); return htmlStr; } @@ -759,6 +852,5 @@ List<String> strings3 = result.subList(6, 8); System.out.println(strings3); } - } \ No newline at end of file -- Gitblit v1.9.3