YYC
2023-06-27 995b0d803cad76839d2d3e2308d9725cdeee4145
igds-inout/src/main/java/com/ld/igds/inout/manager/InoutReportManager.java
@@ -93,7 +93,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());
@@ -261,7 +261,7 @@
        bill.setFullTime(DateFormatUtils.format(data.getFullWeightTime(),
                "yyyy-MM-dd HH:mm:ss"));
        bill.setSerId(data.getId());
        bill.setSpecType(StringUtils.isEmpty(data.getSpecType())?"散粮":data.getSpecType());
//        bill.setSpecType(StringUtils.isEmpty(data.getSpecType()) ? "散粮" : data.getSpecType());
        if ("5016".equals(data.getCompanyId())) {
            bill.setCompleteTime(DateFormatUtils.format(data.getCompleteTime(), "yyyy-MM-dd"));
            bill.setSerId(data.getId().substring(2));
@@ -269,7 +269,7 @@
        }
        //客户信息
        bill.setCustomerId(data.getCustomerId() == null ? "" : data.getCustomerId());
        // 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 +277,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());
        }
@@ -301,27 +301,27 @@
        bill.setEmptyWeight(data.getEmptyWeight());
        bill.setNetWeight(data.getNetWeight());
        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.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()+"");
        }
//        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;
@@ -373,7 +373,7 @@
        String key;
        for (CheckItemData item : checkLst) {
            key = item.getStandardId() + "_ST";
            checkBillItems.put(key, item.getStandardValue());
            // checkBillItems.put(key, item.getStandardValue());
            key = item.getStandardId() + "_VAL";
            checkBillItems.put(key, item.getValue());
        }
@@ -449,13 +449,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 +473,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 +500,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 +514,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 +614,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 +636,7 @@
    /**
     * 获取船运打印模板数据
     *
     * @param data    流水信息
     * @param list    车辆信息,数量不大于30
     * @param moreTag 结算标签,true-代表结算页;false-不是结算页
@@ -646,7 +647,7 @@
        //调整模版数据并返回
        String htmlStr = InoutBill.SHIP_WEIGHT_DEFAULT_MORE;
        if(moreTag){
        if (moreTag) {
            htmlStr = InoutBill.SHIP_WEIGHT_DEFAULT;
        }
@@ -654,7 +655,7 @@
        //表头
        String billTitle = (dept == null ? "船运过磅单" : dept.getName() + "船运过磅单");
        if(0 != pageNum){
        if (0 != pageNum) {
            billTitle += " - 第" + pageNum + "页";
        }
        htmlStr = htmlStr.replace("billTitle", billTitle);
@@ -695,7 +696,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()));