From db67639449287bcec461916a7dca6003ee5dd03c Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期五, 05 十二月 2025 16:27:18 +0800
Subject: [PATCH] 出入库详单及补单页面及逻辑
---
fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/print/PrintManager.java | 281 -------------------------------------------------------
1 files changed, 4 insertions(+), 277 deletions(-)
diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/print/PrintManager.java b/fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/print/PrintManager.java
index a20a322..29ac315 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/print/PrintManager.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/sys/manager/print/PrintManager.java
@@ -1,21 +1,9 @@
package com.fzzy.sys.manager.print;
-import com.fzzy.igds.bill.InoutBill;
-import com.fzzy.igds.constant.Constant;
-import com.fzzy.igds.constant.FoodVariety;
-import com.fzzy.igds.data.InoutPrintBill;
-import com.fzzy.igds.domain.Depot;
import com.fzzy.igds.domain.InoutRecord;
-import com.fzzy.igds.service.DepotService;
-import com.fzzy.igds.service.SysDeptService;
-import com.fzzy.igds.utils.NumberUtil;
-import com.ruoyi.common.core.domain.entity.SysDept;
-import com.ruoyi.common.utils.StringUtils;
-import org.apache.commons.lang3.time.DateFormatUtils;
+import com.fzzy.igds.service.InoutRecordService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
-import java.text.DecimalFormat;
-import java.util.*;
/**
* @Description 鍗曟嵁鎵撳嵃
@@ -26,9 +14,7 @@
public class PrintManager {
@Resource
- private SysDeptService sysDeptService;
- @Resource
- private DepotService depotService;
+ private InoutRecordService inoutRecordService;
/**
* 鑾峰彇鍏ュ簱杩囩鍗曟暟鎹俊鎭�
@@ -37,87 +23,7 @@
* @return
*/
public String inWeightBill(InoutRecord data) {
-
- // 鑾峰彇琛ㄥ崟鏁版嵁
- InoutPrintBill bill = this.createBillData(data, "鍏ュ簱鍒掔爜鍗�");
-
- // 璋冩暣妯$増鏁版嵁骞惰繑鍥�
- String htmlStr = InoutBill.IN_WEIGHT_DEFAULT;
-
- htmlStr = htmlStr.replace("billTitle", bill.getBillTitle());
-
- htmlStr = htmlStr.replace("registerTime", bill.getRegisterTime());
- htmlStr = htmlStr.replace("completeTime", bill.getCompleteTime());
- htmlStr = htmlStr.replace("fullTime", bill.getFullTime());
- htmlStr = htmlStr.replace("emptyTime", bill.getEmptyTime());
- htmlStr = htmlStr.replace("serId", bill.getSerId());
-
- htmlStr = htmlStr.replace("customerName", bill.getCustomerName());
- htmlStr = htmlStr.replace("deptName", bill.getUnitName());
-
- htmlStr = htmlStr.replace("driverName", bill.getDriverName());
- htmlStr = htmlStr.replace("userNumberId", bill.getUserId());
- htmlStr = htmlStr.replace("userContact", bill.getUserContact());
- htmlStr = htmlStr.replace("userAddress", bill.getUserAddress());
- htmlStr = htmlStr.replace("foodVariety", bill.getFoodVariety());
- htmlStr = htmlStr.replace("depotName", bill.getDepotName());
- htmlStr = htmlStr.replace("foodLocation", bill.getFoodLocation());
-
- if ("5326".equals(data.getCompanyId())) {
- htmlStr = htmlStr.replace("recordWeight", new DecimalFormat("0").format(bill.getRecordWeight()));
- htmlStr = htmlStr.replace("settleWeight", new DecimalFormat("0").format(bill.getSettleWeight()));
- htmlStr = htmlStr.replace("fullWeight", new DecimalFormat("0").format(bill.getFullWeight()));
- htmlStr = htmlStr.replace("emptyWeight", new DecimalFormat("0").format(bill.getEmptyWeight()));
- htmlStr = htmlStr.replace("netWeight", new DecimalFormat("0").format(bill.getNetWeight()));
- }
- htmlStr = htmlStr.replace("plateNum", bill.getPlateNum());
- htmlStr = htmlStr.replace("fullWeight",
- new DecimalFormat("0.00").format(bill.getFullWeight()));
- htmlStr = htmlStr.replace("emptyWeight",
- new DecimalFormat("0.00").format(bill.getEmptyWeight()));
- htmlStr = htmlStr.replace("netWeight",
- new DecimalFormat("0.00").format(bill.getNetWeight()));
-
- htmlStr = htmlStr.replace("deImpurity", bill.getDeImpurity() + "");
- htmlStr = htmlStr.replace("deWet", bill.getDeWet() + "");
-
- htmlStr = htmlStr.replace("recordWeight", new DecimalFormat("0.00").format(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.00").format(bill.getSettleWeight()));
-
- htmlStr = htmlStr.replace("dePackage", bill.getDePackage() + "");
- htmlStr = htmlStr.replace("deHandle", bill.getDeHandle() + "");
- 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("checkStatus", bill.getCheckStatus());
- htmlStr = htmlStr.replace("remark", bill.getRemark());
- htmlStr = htmlStr.replace("moneyName", bill.getMoneyName());
-
- htmlStr = htmlStr.replace("unitName", bill.getUnitName());
- htmlStr = htmlStr.replace("time", bill.getRegisterTime());
- htmlStr = htmlStr.replace("handleStart", "");
- htmlStr = htmlStr.replace("handleEnd", "");
- htmlStr = htmlStr.replace("noticeId", bill.getNoticeId() == null ? "" : bill.getNoticeId());
- htmlStr = htmlStr.replace("phone", data.getUserContact() == null ? "" : data.getUserContact() + "");
- htmlStr = htmlStr.replace("printTime", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"));
-
- 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;
+ return inoutRecordService.inWeightBill( data);
}
/**
@@ -127,187 +33,8 @@
* @return
*/
public String outWeightBill(InoutRecord data) {
- // 鑾峰彇琛ㄥ崟鏁版嵁
- InoutPrintBill bill = this.createBillData(data, "鍑哄簱鍒掔爜鍗�");
- //榛樿妯$増
- String htmlStr = InoutBill.OUT_WEIGHT_DEFAULT;
-
- htmlStr = htmlStr.replace("billTitle", bill.getBillTitle());
-
- htmlStr = htmlStr.replace("registerTime", bill.getRegisterTime());
- htmlStr = htmlStr.replace("completeTime", bill.getCompleteTime());
- htmlStr = htmlStr.replace("fullTime", bill.getFullTime());
- htmlStr = htmlStr.replace("emptyTime", bill.getEmptyTime());
- htmlStr = htmlStr.replace("serId", bill.getSerId());
-
- htmlStr = htmlStr.replace("customerName", bill.getCustomerName());
- htmlStr = htmlStr.replace("deptName", bill.getUnitName());
-
- htmlStr = htmlStr.replace("driverName", bill.getDriverName());
- htmlStr = htmlStr.replace("userNumberId", bill.getUserId());
- htmlStr = htmlStr.replace("userContact", bill.getUserContact());
- htmlStr = htmlStr.replace("userAddress", bill.getUserAddress());
- htmlStr = htmlStr.replace("foodVariety", bill.getFoodVariety());
- htmlStr = htmlStr.replace("depotName", bill.getDepotName());
- htmlStr = htmlStr.replace("foodLocation", bill.getFoodLocation());
-
- if ("5326".equals(data.getCompanyId())) {
- htmlStr = htmlStr.replace("recordWeight", new DecimalFormat("0").format(bill.getRecordWeight()));
- htmlStr = htmlStr.replace("settleWeight", new DecimalFormat("0").format(bill.getSettleWeight()));
- htmlStr = htmlStr.replace("fullWeight", new DecimalFormat("0").format(bill.getFullWeight()));
- htmlStr = htmlStr.replace("emptyWeight", new DecimalFormat("0").format(bill.getEmptyWeight()));
- htmlStr = htmlStr.replace("netWeight", new DecimalFormat("0").format(bill.getNetWeight()));
- }
- htmlStr = htmlStr.replace("plateNum", bill.getPlateNum());
- htmlStr = htmlStr.replace("fullWeight",
- new DecimalFormat("0.00").format(bill.getFullWeight()));
- htmlStr = htmlStr.replace("emptyWeight",
- new DecimalFormat("0.00").format(bill.getEmptyWeight()));
- htmlStr = htmlStr.replace("netWeight",
- new DecimalFormat("0.00").format(bill.getNetWeight()));
- htmlStr = htmlStr.replace("dePackage",
- new DecimalFormat("0.00").format(bill.getDePackage()));
- htmlStr = htmlStr.replace("remark", bill.getRemark());
-
- htmlStr = htmlStr.replace("settleWeight",
- new DecimalFormat("0.00").format(bill.getSettleWeight()));
- htmlStr = htmlStr.replace("deHandle", bill.getDeHandle() + "");
- htmlStr = htmlStr.replace("recordWeight", new DecimalFormat("0.00").format(bill.getRecordWeight()));
- 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.replace("noticeId", bill.getNoticeId() == null ? "" : bill.getNoticeId());
- htmlStr = htmlStr.replace("phone", data.getUserContact() == null ? "" : data.getUserContact() + "");
- htmlStr = htmlStr.replace("printTime", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"));
-
- 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;
- }
-
- /**
- * 灏佽杩囩鍗曟暟鎹�
- *
- * @param data
- * @param billTitle
- * @return
- */
- private InoutPrintBill createBillData(InoutRecord data, String billTitle) {
- InoutPrintBill bill = new InoutPrintBill();
-
- bill.setBillTitle(billTitle);
-
- SysDept dept = sysDeptService.getCacheDept(data.getCompanyId(), data.getDeptId());
- if (null != dept && StringUtils.isNotEmpty(dept.getDeptName())) {
- bill.setBillTitle(dept.getDeptName() + billTitle);
- bill.setDeptId(dept.getDeptId() + "");
- bill.setDeptName(dept.getDeptName() + "");
- bill.setUnitName(dept.getDeptName());
- }
-
- //娓呰繙鍑哄彂璐у崟浣嶅強鏍囬锛屼娇鐢ㄥ叕鍙稿悕
- if ("5368".equals(data.getCompanyId())) {
- SysDept company = sysDeptService.getCacheDept(data.getCompanyId(), data.getCompanyId());
- if (null != company && StringUtils.isNotEmpty(company.getDeptName())) {
- bill.setBillTitle(company.getDeptName() + billTitle);
- bill.setUnitName(company.getDeptName());
- }
- }
-
- bill.setCompanyId(data.getCompanyId() == null ? "" : data
- .getCompanyId());
- if (null == data.getRegisterTime()) {
- data.setRegisterTime(new Date());
- }
- bill.setRegisterTime(DateFormatUtils.format(data.getRegisterTime(),
- "yyyy-MM-dd HH:mm"));
-
- if (null == data.getCompleteTime()) {
- data.setCompleteTime(new Date());
- }
- bill.setCompleteTime(DateFormatUtils.format(data.getCompleteTime(),
- "yyyy-MM-dd HH:mm"));
-
- bill.setEmptyTime(DateFormatUtils.format(data.getEmptyWeightTime(),
- "yyyy-MM-dd HH:mm:ss"));
- bill.setFullTime(DateFormatUtils.format(data.getFullWeightTime(),
- "yyyy-MM-dd HH:mm:ss"));
- bill.setSerId(data.getId());
- if ("5016".equals(data.getCompanyId()) || "5347".equals(data.getCompanyId()) || "5352".equals(data.getCompanyId())) {
- bill.setCompleteTime(DateFormatUtils.format(data.getCompleteTime(), "yyyy-MM-dd"));
- bill.setSerId(data.getId().substring(2));
-
- }
-
- //瀹㈡埛淇℃伅
- bill.setCustomerName(data.getCustomerName() == null ? "" : data.getCustomerName());
- bill.setUserId(data.getUserId() == null ? "" : data.getUserId());
- bill.setUserAddress(data.getUserAddress() == null ? "" : data.getUserAddress());
- bill.setUserContact(data.getUserContact() == null ? "" : data.getUserContact());
-
-
- bill.setNoticeId(data.getNoticeId());
-
-
- bill.setDriverName(data.getUserName() == null ? "" : data.getUserName());
-
- // 鑾峰彇浠撳簱淇℃伅
- Depot depot = depotService.getCacheDepot(data.getCompanyId(),
- data.getDepotId());
- if (depot != null) {
- bill.setDepotName(depot.getName() == null ? "" : depot.getName());
- bill.setHandleUser(depot.getStoreKeeperName() == null ? "" : depot
- .getStoreKeeperName());
- }
-
- bill.setFoodVariety(FoodVariety.getMsg(data.getFoodVariety()));
- bill.setFoodLocation(data.getFoodLocation() == null ? "" : data
- .getFoodLocation());
- bill.setPlateNum(data.getPlateNum());
-
- bill.setFullWeight(data.getFullWeight());
- bill.setEmptyWeight(data.getEmptyWeight());
- bill.setNetWeight(data.getNetWeight());
- bill.setRecordWeight(data.getRecordWeight());
- bill.setCheckStatus(data.getCheckStatus().equals(Constant.STATUS_CHECK) ? "鍚堟牸" : "涓嶅悎鏍�");
-
- bill.setDeOther(data.getDeOther());
- bill.setSettleWeight(data.getSettleWeight());
-
- 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.setRemark(data.getRemarks() == null ? "" : data.getRemarks());
-
- if (Constant.TYPE_IN.equals(data.getType())) {
- bill.setWeightUser(data.getFullWeightUser());
- }
- if (Constant.TYPE_OUT.equals(data.getType())) {
- bill.setWeightUser(data.getEmptyWeightUser());
- }
- bill.setHandleUser(data.getHandleUser());
- bill.setKeeperUser(depot.getStoreKeeperName());
- return bill;
+ return inoutRecordService.outWeightBill( data);
}
}
\ No newline at end of file
--
Gitblit v1.9.3