Index: ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java =================================================================== diff -u -r12553 -r12587 --- ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java (.../InvoiceManagerImpl.java) (revision 12553) +++ ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java (.../InvoiceManagerImpl.java) (revision 12587) @@ -1200,9 +1200,9 @@ if (barcodeDevice instanceof TousseInstance) { TousseInstance tousseInstance = ((TousseInstance) barcodeDevice); TousseDefinition td = tousseInstance.getTousseDefinition(); - if(td.isDisinfection() && !td.cleanedEntirely()){ + if(td.isDisinfection() && "否".equals(td.getIsApplyEntireTousse())){ if(StringUtils.isBlank(submitInvoiceItem.getTousseType())){ - amount = 1;// 若是消毒物品,并且是拆包清洗,那么amount是材料总数,应重设为1(包数)。 + amount = 1;// 若是消毒物品,并且是拆包申请,那么amount是材料总数,应重设为1(包数)。 } } // 验证包状态是否正常 @@ -1426,9 +1426,8 @@ writeBackInventoryHelper.writeBackForInvoice( Collections.singleton(invoice.getId())); }*/ - writeBackInventoryHelper.writeBackForInvoice( - Collections.singleton(invoice.getId())); - } + writeBackInventoryHelper.writeBackForInvoice( + Collections.singleton(invoice.getId())); } } } @@ -1722,7 +1721,7 @@ thisBarcodeSendAmount -= diposableGoodsItem.getAmount(); BigDecimal fluctuationPrice = MathTools.mul( identification.getPrice(), floatPercent).setScale( - 2, BigDecimal.ROUND_HALF_UP); + 4, BigDecimal.ROUND_HALF_UP); diposableGoodsItem.setFluctuationPrice(fluctuationPrice .doubleValue()); diposableGoodsItem.setPrice(identification.getPrice()); @@ -1750,10 +1749,10 @@ // 发货物品单项总价 BigDecimal itemPrice = fluctuationPrice.multiply( new BigDecimal(diposableGoodsItem.getAmount())) - .setScale(2, BigDecimal.ROUND_HALF_UP); + .setScale(4, BigDecimal.ROUND_HALF_UP); // 发货物品统计总价 - totalPrice = totalPrice.add(itemPrice).setScale(2, + totalPrice = totalPrice.add(itemPrice).setScale(4, BigDecimal.ROUND_HALF_UP); double tmpSettlementPrice = invoiceItem .getSettlementPrice() + itemPrice.doubleValue(); @@ -1892,7 +1891,7 @@ for (LostMaterialItem vo : lostMaterialItems) { // 统计总价 totalPrice = totalPrice.add( - new BigDecimal(vo.getTotalPrice())).setScale(2, + new BigDecimal(vo.getTotalPrice())).setScale(4, BigDecimal.ROUND_HALF_UP); } } @@ -1906,10 +1905,10 @@ for (GridDataVo vo : recyclingDamageList) { BigDecimal itemPrice = new BigDecimal(vo.getCount()) .multiply(new BigDecimal(vo.getPrice())) - .setScale(2, BigDecimal.ROUND_HALF_UP); + .setScale(4, BigDecimal.ROUND_HALF_UP); // 统计总价 - totalPrice = totalPrice.add(itemPrice).setScale(2, + totalPrice = totalPrice.add(itemPrice).setScale(4, BigDecimal.ROUND_HALF_UP); } } @@ -1927,10 +1926,10 @@ if(price == null){ price = 0d; } - BigDecimal itemPrice = new BigDecimal(price).multiply(new BigDecimal(amount)).setScale(2, + BigDecimal itemPrice = new BigDecimal(price).multiply(new BigDecimal(amount)).setScale(4, BigDecimal.ROUND_HALF_UP); // 统计总价 - totalPrice = totalPrice.add(itemPrice).setScale(2, + totalPrice = totalPrice.add(itemPrice).setScale(4, BigDecimal.ROUND_HALF_UP); return totalPrice; } @@ -2404,9 +2403,9 @@ // 不追溯的消毒物品,名字去掉下划线 result.addProperty("tousseName", TousseDefinitionUtils.getTousseRawName(goodsName)); } - result.addProperty("isCleanedEntirely", td.getIsCleanedEntirely()); + result.addProperty("isCleanedEntirely", td.getIsApplyEntireTousse()); if(TousseDefinition.PACKAGE_TYPE_DISINFECTION.equals(td.getTousseType()) - && "否".endsWith(td.getIsCleanedEntirely())){ + && "否".endsWith(td.getIsApplyEntireTousse())){ // 非整包清洗的消毒物品,显示材料数量 result.addProperty("materialAmount", CssdUtils.getMaterialTotalAmount(td,false)); } @@ -2472,8 +2471,8 @@ TousseDefinition td = tousseInstance.getTousseDefinition(); if(TousseDefinition.PACKAGE_TYPE_DISINFECTION.equals(td.getTousseType()) - && "否".endsWith(td.getIsCleanedEntirely())){ - // 非整包清洗的消毒物品,显示材料数量 + && "否".endsWith(td.getIsApplyEntireTousse())){ + // 非整包申请的消毒物品,显示材料数量 result.addProperty("materialAmount", CssdUtils.getMaterialTotalAmount(td,false)); } return result; @@ -3013,11 +3012,11 @@ result.addProperty("barcode", barcode); result.addProperty("type", "tousseInstance"); result.add("data", buildJSONObjectForTousseInstance(tousseInstance)); -// result.addProperty("type", "tousseInstanceList"); -// result.add("fixedBarcodeInfo", getFixedBarcodeInfo(tousseInstance, resultTousseInstanceList)); -// result.add( -// "data", -// buildJSONArrayForTousseInstances(resultTousseInstanceList)); +// result.addProperty("type", "tousseInstanceList"); +// result.add("fixedBarcodeInfo", getFixedBarcodeInfo(tousseInstance, resultTousseInstanceList)); +// result.add( +// "data", +// buildJSONArrayForTousseInstances(resultTousseInstanceList)); return result; } @@ -3052,11 +3051,11 @@ result.addProperty("barcode", barcode); result.addProperty("type", "tousseInstance"); result.add("data", buildJSONObjectForTousseInstance(tousseInstance)); -// result.addProperty("type", "tousseInstanceList"); -// result.add("fixedBarcodeInfo", getFixedBarcodeInfo(tousseInstance, resultTousseInstanceList)); -// result.add( -// "data", -// buildJSONArrayForTousseInstances(resultTousseInstanceList)); +// result.addProperty("type", "tousseInstanceList"); +// result.add("fixedBarcodeInfo", getFixedBarcodeInfo(tousseInstance, resultTousseInstanceList)); +// result.add( +// "data", +// buildJSONArrayForTousseInstances(resultTousseInstanceList)); return result; } @@ -3546,12 +3545,12 @@ vo.setBeforeToday(vo.isBeforeToday() || beforeToday); // 设置是否含有今天前申请的物品 if(applicationItem.isDisinfection()){ - // 非整包清洗的消毒物品,显示材料数量,并且将材料明细设置到tousseVO里面 - if(tousseDefinition != null && StringUtils.equals("否", tousseDefinition.getIsCleanedEntirely())){ + // 非整包申请的消毒物品,显示材料数量,并且将材料明细设置到tousseVO里面 + if(tousseDefinition != null && StringUtils.equals("否", tousseDefinition.getIsApplyEntireTousse())){ int materialTotalAmount = vo.getMaterialAmount(); materialTotalAmount += CssdUtils.getMaterialTotalAmount(tousseDefinition,false); vo.setMaterialAmount(materialTotalAmount); - vo.setIsCleanedEntirely(tousseDefinition.getIsCleanedEntirely()); + vo.setIsCleanedEntirely(tousseDefinition.getIsApplyEntireTousse()); // 将材料明细设置到tousseVO里面 List materialInstances = tousseDefinition.getMaterialInstances(); if(materialInstances != null){ @@ -4671,10 +4670,11 @@ String batchNumber = goodsItem.getBatch();// 批次 String specification = "";// 规格 String goodsName = goodsItem.getName(); - if (goodsName.lastIndexOf("[") > 0) { - specification = goodsName.substring( - goodsName.lastIndexOf("[") + 1, + int spIndex = goodsName.lastIndexOf("["); + if (spIndex > 0) { + specification = goodsName.substring(spIndex + 1, goodsName.length() - 1); + goodsName = goodsName.substring(0, spIndex); } List voList = map.get(goodsItem.getName()); Double totalPrice = new BigDecimal(goodsItem.getFluctuationPrice())