| | |
| | | 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()); |
| | |
| | | |
| | | 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())); |
| | |
| | | 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()); |
| | | |
| | |
| | | bill.setFullTime(DateFormatUtils.format(data.getFullWeightTime(), |
| | | "yyyy-MM-dd HH:mm:ss")); |
| | | bill.setSerId(data.getId()); |
| | | 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)); |
| | |
| | | } |
| | | |
| | | //客户信息 |
| | | 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()); |
| | |
| | | |
| | | //从通知单中获取收发货单位信息 |
| | | 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()); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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()); |
| | | } |
| | |
| | | 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()); |
| | | } |
| | | |
| | | // 调整模版数据并返回 |
| | |
| | | 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(), |
| | |
| | | |
| | | 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())); |
| | |
| | | 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 ? "" |
| | |
| | | } |
| | | |
| | | 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); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取船运打印模板数据 |
| | | * |
| | | * @param data 流水信息 |
| | | * @param list 车辆信息,数量不大于30 |
| | | * @param moreTag 结算标签,true-代表结算页;false-不是结算页 |
| | |
| | | |
| | | //调整模版数据并返回 |
| | | String htmlStr = InoutBill.SHIP_WEIGHT_DEFAULT_MORE; |
| | | if(moreTag){ |
| | | if (moreTag) { |
| | | htmlStr = InoutBill.SHIP_WEIGHT_DEFAULT; |
| | | } |
| | | |
| | |
| | | |
| | | //表头 |
| | | String billTitle = (dept == null ? "船运过磅单" : dept.getName() + "船运过磅单"); |
| | | if(0 != pageNum){ |
| | | if (0 != pageNum) { |
| | | billTitle += " - 第" + pageNum + "页"; |
| | | } |
| | | htmlStr = htmlStr.replace("billTitle", billTitle); |
| | |
| | | } |
| | | |
| | | //添加结算信息 |
| | | 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())); |