解决出入库统计报表计算的bug
This commit is contained in:
@@ -531,8 +531,8 @@ public class DepotItemController {
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "采购", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price");
|
||||
BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "采购退货", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price");
|
||||
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "采购", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
|
||||
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "采购退货", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
|
||||
BigDecimal realityPriceTotal = inSumPriceTotal.subtract(outSumPriceTotal);
|
||||
map.put("rows", dataArray);
|
||||
map.put("realityPriceTotal", realityPriceTotal);
|
||||
@@ -615,8 +615,8 @@ public class DepotItemController {
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "零售", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price");
|
||||
BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "零售退货", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price");
|
||||
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "零售", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
|
||||
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "零售退货", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
|
||||
BigDecimal realityPriceTotal = outSumPriceTotal.subtract(inSumPriceTotal);
|
||||
map.put("rows", dataArray);
|
||||
map.put("realityPriceTotal", realityPriceTotal);
|
||||
@@ -700,8 +700,8 @@ public class DepotItemController {
|
||||
dataArray.add(item);
|
||||
}
|
||||
}
|
||||
BigDecimal outSumPriceTotal = depotItemService.buyOrSale("出库", "销售", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price");
|
||||
BigDecimal inSumPriceTotal = depotItemService.buyOrSale("入库", "销售退货", null, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag, "price");
|
||||
BigDecimal outSumPriceTotal = depotItemService.buyOrSalePriceTotal("出库", "销售", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
|
||||
BigDecimal inSumPriceTotal = depotItemService.buyOrSalePriceTotal("入库", "销售退货", StringUtil.toNull(materialParam), beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
|
||||
BigDecimal realityPriceTotal = outSumPriceTotal.subtract(inSumPriceTotal);
|
||||
map.put("rows", dataArray);
|
||||
map.put("realityPriceTotal", realityPriceTotal);
|
||||
|
||||
@@ -121,6 +121,18 @@ public interface DepotItemMapperEx {
|
||||
@Param("forceFlag") Boolean forceFlag,
|
||||
@Param("sumType") String sumType);
|
||||
|
||||
BigDecimal buyOrSalePriceTotal(
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
@Param("materialParam") String materialParam,
|
||||
@Param("beginTime") String beginTime,
|
||||
@Param("endTime") String endTime,
|
||||
@Param("creatorArray") String[] creatorArray,
|
||||
@Param("organId") Long organId,
|
||||
@Param("organArray") String [] organArray,
|
||||
@Param("depotList") List<Long> depotList,
|
||||
@Param("forceFlag") Boolean forceFlag);
|
||||
|
||||
BigDecimal inOrOutPrice(
|
||||
@Param("type") String type,
|
||||
@Param("subType") String subType,
|
||||
|
||||
@@ -354,6 +354,17 @@ public class DepotItemService {
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public BigDecimal buyOrSalePriceTotal(String type, String subType, String materialParam, String beginTime, String endTime,
|
||||
String[] creatorArray, Long organId, String [] organArray, List<Long> depotList, Boolean forceFlag) throws Exception{
|
||||
BigDecimal result= BigDecimal.ZERO;
|
||||
try{
|
||||
result= depotItemMapperEx.buyOrSalePriceTotal(type, subType, materialParam, beginTime, endTime, creatorArray, organId, organArray, depotList, forceFlag);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user