| | |
| | | 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; |
| | |
| | | // 获取化验数据 |
| | | 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()); |
| | |
| | | // 替换基础数据 |
| | | 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(); |
| | | // 遍历化验结果,存入map集合中 |
| | | String key; |
| | | for (CheckItemData item : checkLst) { |
| | | key = item.getStandardId() + "_ST"; |
| | | // checkBillItems.put(key, item.getStandardValue()); |
| | | key = item.getStandardId() + "_VAL"; |
| | | // key = item.getStandardId() + "_VAL"; |
| | | checkBillItems.put(key, item.getValue()); |
| | | } |
| | | |
| | |
| | | return htmlStr; |
| | | } |
| | | |
| | | /** |
| | | * 打印扦样单,直接返回条形码Base64图片 |
| | | * |
| | | * @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) { |
| | | List<String> result = new ArrayList<>(); |
| | | result.add("1"); |
| | |
| | | List<String> strings3 = result.subList(6, 8); |
| | | System.out.println(strings3); |
| | | } |
| | | |
| | | |
| | | } |