|
@@ -360,93 +360,30 @@ public class DepotItemController {
|
|
//拓展信息
|
|
//拓展信息
|
|
diEx.setMaterialOther(depotItemService.getOtherInfo(mpArr, diEx));
|
|
diEx.setMaterialOther(depotItemService.getOtherInfo(mpArr, diEx));
|
|
//库存
|
|
//库存
|
|
- diEx.setStock(materialService.getMaterialStockByMid(diEx.getMaterialId()));
|
|
|
|
|
|
+ diEx.setStock(materialService.getCurrentStockByMaterialIdAndDepotId(diEx.getMaterialId(), diEx.getDepotId()));
|
|
//原数量
|
|
//原数量
|
|
diEx.setPreNumber(diEx.getOperNumber());
|
|
diEx.setPreNumber(diEx.getOperNumber());
|
|
//完成数量
|
|
//完成数量
|
|
Unit unitInfo = materialService.findUnit(diEx.getMaterialId()); //查询多单位信息
|
|
Unit unitInfo = materialService.findUnit(diEx.getMaterialId()); //查询多单位信息
|
|
String materialUnit = diEx.getMaterialUnit();
|
|
String materialUnit = diEx.getMaterialUnit();
|
|
diEx.setFinishNumber(depotItemService.getFinishNumber(diEx.getMaterialExtendId(), diEx.getId(), diEx.getHeaderId(), unitInfo, materialUnit, linkType));
|
|
diEx.setFinishNumber(depotItemService.getFinishNumber(diEx.getMaterialExtendId(), diEx.getId(), diEx.getHeaderId(), unitInfo, materialUnit, linkType));
|
|
- JSONObject item = new JSONObject();
|
|
|
|
- item.put("id", diEx.getId());
|
|
|
|
- item.put("materialExtendId", diEx.getMaterialExtendId() == null ? "" : diEx.getMaterialExtendId());
|
|
|
|
-// item.put("barCode", diEx.getBarCode());
|
|
|
|
- item.put("name", diEx.getMName());
|
|
|
|
- item.put("standard", diEx.getMStandard());
|
|
|
|
- item.put("model", diEx.getMModel());
|
|
|
|
- item.put("color", diEx.getMColor());
|
|
|
|
- item.put("brand", diEx.getBrand());
|
|
|
|
-// item.put("mfrs", diEx.getMMfrs());
|
|
|
|
- item.put("materialOther", depotItemService.getOtherInfo(mpArr, diEx));
|
|
|
|
- BigDecimal stock;
|
|
|
|
- if(StringUtil.isNotEmpty(diEx.getSku())){
|
|
|
|
- stock = depotItemService.getSkuStockByParam(diEx.getDepotId(),diEx.getMaterialExtendId(),null,null);
|
|
|
|
- } else {
|
|
|
|
- stock = depotItemService.getCurrentStockByParam(diEx.getDepotId(),diEx.getMaterialId());
|
|
|
|
- if (StringUtil.isNotEmpty(unitInfo.getName())) {
|
|
|
|
- stock = unitService.parseStockByUnit(stock, unitInfo, materialUnit);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- item.put("stock", stock);
|
|
|
|
- item.put("unit", diEx.getMaterialUnit());
|
|
|
|
- item.put("snList", diEx.getSnList());
|
|
|
|
-// item.put("batchNumber", diEx.getBatchNumber());
|
|
|
|
- item.put("expirationDate", Tools.parseDateToStr(diEx.getExpirationDate()));
|
|
|
|
- item.put("sku", diEx.getSku());
|
|
|
|
- item.put("enableSerialNumber", diEx.getEnableSerialNumber());
|
|
|
|
-// item.put("enableBatchNumber", diEx.getEnableBatchNumber());
|
|
|
|
- item.put("operNumber", diEx.getOperNumber());
|
|
|
|
- item.put("basicNumber", diEx.getBasicNumber());
|
|
|
|
- item.put("preNumber", diEx.getOperNumber()); //原数量
|
|
|
|
- item.put("finishNumber", depotItemService.getFinishNumber(diEx.getMaterialExtendId(), diEx.getId(), diEx.getHeaderId(), unitInfo, materialUnit, linkType)); //已入库|已出库
|
|
|
|
- item.put("purchaseDecimal", roleService.parseBillPriceByLimit(diEx.getPurchaseDecimal(), billCategory, priceLimit, request)); //采购价
|
|
|
|
|
|
+// item.put("purchaseDecimal", roleService.parseBillPriceByLimit(diEx.getPurchaseDecimal(), billCategory, priceLimit, request)); //采购价
|
|
if("basic".equals(linkType) || "1".equals(isReadOnly)) {
|
|
if("basic".equals(linkType) || "1".equals(isReadOnly)) {
|
|
//正常情况显示金额,而以销定购的情况不能显示金额
|
|
//正常情况显示金额,而以销定购的情况不能显示金额
|
|
- item.put("unitPrice", roleService.parseBillPriceByLimit(diEx.getUnitPrice(), billCategory, priceLimit, request));
|
|
|
|
- item.put("taxUnitPrice", roleService.parseBillPriceByLimit(diEx.getTaxUnitPrice(), billCategory, priceLimit, request));
|
|
|
|
- item.put("allPrice", roleService.parseBillPriceByLimit(diEx.getAllPrice(), billCategory, priceLimit, request));
|
|
|
|
- item.put("taxRate", roleService.parseBillPriceByLimit(diEx.getTaxRate(), billCategory, priceLimit, request));
|
|
|
|
- item.put("taxMoney", roleService.parseBillPriceByLimit(diEx.getTaxMoney(), billCategory, priceLimit, request));
|
|
|
|
- item.put("taxLastMoney", roleService.parseBillPriceByLimit(diEx.getTaxLastMoney(), billCategory, priceLimit, request));
|
|
|
|
|
|
+// item.put("unitPrice", roleService.parseBillPriceByLimit(diEx.getUnitPrice(), billCategory, priceLimit, request));
|
|
|
|
+ diEx.setUnitPrice(roleService.parseBillPriceByLimit(diEx.getUnitPrice(), billCategory, priceLimit, request));
|
|
|
|
+// item.put("taxUnitPrice", roleService.parseBillPriceByLimit(diEx.getTaxUnitPrice(), billCategory, priceLimit, request));
|
|
|
|
+ diEx.setTaxUnitPrice(roleService.parseBillPriceByLimit(diEx.getTaxUnitPrice(), billCategory, priceLimit, request));
|
|
|
|
+// item.put("allPrice", roleService.parseBillPriceByLimit(diEx.getAllPrice(), billCategory, priceLimit, request));
|
|
|
|
+ diEx.setAllPrice(roleService.parseBillPriceByLimit(diEx.getAllPrice(), billCategory, priceLimit, request));
|
|
|
|
+// item.put("taxRate", roleService.parseBillPriceByLimit(diEx.getTaxRate(), billCategory, priceLimit, request));
|
|
|
|
+ diEx.setTaxRate(roleService.parseBillPriceByLimit(diEx.getTaxRate(), billCategory, priceLimit, request));
|
|
|
|
+// item.put("taxMoney", roleService.parseBillPriceByLimit(diEx.getTaxMoney(), billCategory, priceLimit, request));
|
|
|
|
+ diEx.setTaxMoney(roleService.parseBillPriceByLimit(diEx.getTaxMoney(), billCategory, priceLimit, request));
|
|
|
|
+// item.put("taxLastMoney", roleService.parseBillPriceByLimit(diEx.getTaxLastMoney(), billCategory, priceLimit, request));
|
|
|
|
+ diEx.setTaxLastMoney(roleService.parseBillPriceByLimit(diEx.getTaxLastMoney(), billCategory, priceLimit, request));
|
|
}
|
|
}
|
|
BigDecimal allWeight = diEx.getBasicNumber()==null||diEx.getWeight()==null?BigDecimal.ZERO:diEx.getBasicNumber().multiply(diEx.getWeight());
|
|
BigDecimal allWeight = diEx.getBasicNumber()==null||diEx.getWeight()==null?BigDecimal.ZERO:diEx.getBasicNumber().multiply(diEx.getWeight());
|
|
- item.put("weight", allWeight);
|
|
|
|
- item.put("position", diEx.getPosition());
|
|
|
|
- item.put("remark", diEx.getRemark());
|
|
|
|
- item.put("imgName", diEx.getImgName());
|
|
|
|
- if(fileUploadType == 2) {
|
|
|
|
- item.put("imgSmall", "small");
|
|
|
|
- item.put("imgLarge", "large");
|
|
|
|
- } else {
|
|
|
|
- item.put("imgSmall", "");
|
|
|
|
- item.put("imgLarge", "");
|
|
|
|
- }
|
|
|
|
- item.put("linkId", diEx.getLinkId());
|
|
|
|
- item.put("depotId", diEx.getDepotId() == null ? "" : diEx.getDepotId());
|
|
|
|
- item.put("depotName", diEx.getDepotId() == null ? "" : diEx.getDepotName());
|
|
|
|
- item.put("anotherDepotId", diEx.getAnotherDepotId() == null ? "" : diEx.getAnotherDepotId());
|
|
|
|
- item.put("anotherDepotName", diEx.getAnotherDepotId() == null ? "" : diEx.getAnotherDepotName());
|
|
|
|
- item.put("mType", diEx.getMaterialType());
|
|
|
|
- item.put("op", 1);
|
|
|
|
- String productionDate = diEx.getProductionDate() == null ? null : DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",diEx.getProductionDate());
|
|
|
|
- item.put("productionDate",productionDate);
|
|
|
|
- item.put("expiryNum",diEx.getExpiryNum());
|
|
|
|
- item.put("supplierId",diEx.getSupplierId());
|
|
|
|
- item.put("batchNumber",diEx.getBatchNumber());
|
|
|
|
- item.put("inventory",materialService.getMaterialStockByMid(diEx.getMaterialId()));
|
|
|
|
- item.put("supplierName",diEx.getSupplierName());
|
|
|
|
- item.put("unitId",diEx.getUnitId());
|
|
|
|
- item.put("unitList",diEx.getUnitId() == null ? null : unitService.getUnitListByID(diEx.getUnitId()));
|
|
|
|
- item.put("unitName", diEx.getUnitName());
|
|
|
|
- item.put("actualQuantityInStorage",diEx.getActualQuantityInStorage());
|
|
|
|
- item.put("warehousingVariance",diEx.getWarehousingVariance());
|
|
|
|
- item.put("reasonOfDifference",diEx.getReasonOfDifference());
|
|
|
|
- item.put("warehousingUser",diEx.getWarehousingUser());
|
|
|
|
- item.put("warehousingTime",diEx.getWarehousingTime());
|
|
|
|
- item.put("warehousingUserName",diEx.getWarehousingUserName());
|
|
|
|
- item.put("wholesaleDecimal",diEx.getWholesaleDecimal());
|
|
|
|
- item.put("defaultPurchaseDecimal",diEx.getDefaultPurchaseDecimal());
|
|
|
|
- item.put("defaultWholesaleDecimal",diEx.getDefaultWholesaleDecimal());
|
|
|
|
dataArray.add(diEx);
|
|
dataArray.add(diEx);
|
|
//合计数据汇总
|
|
//合计数据汇总
|
|
totalOperNumber = totalOperNumber.add(diEx.getOperNumber()==null?BigDecimal.ZERO:diEx.getOperNumber());
|
|
totalOperNumber = totalOperNumber.add(diEx.getOperNumber()==null?BigDecimal.ZERO:diEx.getOperNumber());
|