解决首页销售额统计的bug

This commit is contained in:
季圣华 2020-01-15 00:13:19 +08:00
parent 6465b9662d
commit 69aaa15b6b
4 changed files with 39 additions and 2 deletions

View File

@ -479,11 +479,11 @@ public class DepotHeadController {
String firstDay = Tools.getCurrentMonth() + "-01 00:00:00";
BigDecimal todaySale = depotHeadService.getBuyAndSaleStatistics("出库", "销售",
1, today, getNow3()); //今日销售出库
BigDecimal todayRetailSale = depotHeadService.getBuyAndSaleStatistics("出库", "",
BigDecimal todayRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "",
0, today, getNow3()); //今日零售出库
BigDecimal monthSale = depotHeadService.getBuyAndSaleStatistics("出库", "销售",
1,firstDay, getNow3()); //本月销售出库
BigDecimal monthRetailSale = depotHeadService.getBuyAndSaleStatistics("出库", "",
BigDecimal monthRetailSale = depotHeadService.getBuyAndSaleRetailStatistics("出库", "",
0,firstDay, getNow3()); //本月零售出库
BigDecimal monthBuy = depotHeadService.getBuyAndSaleStatistics("入库", "采购",
1, firstDay, getNow3()); //本月采购入库

View File

@ -125,4 +125,11 @@ public interface DepotHeadMapperEx {
@Param("hasSupplier") Integer hasSupplier,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime);
BigDecimal getBuyAndSaleRetailStatistics(
@Param("type") String type,
@Param("subType") String subType,
@Param("hasSupplier") Integer hasSupplier,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime);
}

View File

@ -642,4 +642,8 @@ public class DepotHeadService {
public BigDecimal getBuyAndSaleStatistics(String type, String subType, Integer hasSupplier, String beginTime, String endTime) {
return depotHeadMapperEx.getBuyAndSaleStatistics(type, subType, hasSupplier, beginTime, endTime);
}
public BigDecimal getBuyAndSaleRetailStatistics(String type, String subType, Integer hasSupplier, String beginTime, String endTime) {
return depotHeadMapperEx.getBuyAndSaleRetailStatistics(type, subType, hasSupplier, beginTime, endTime);
}
}

View File

@ -424,4 +424,30 @@
</if>
and ifnull(delete_Flag,'0') !='1'
</select>
<select id="getBuyAndSaleRetailStatistics" resultType="java.math.BigDecimal">
SELECT
ifnull(sum(TotalPrice),0)
FROM jsh_depothead
WHERE 1=1
<if test="type != null">
and Type='${type}'
</if>
<if test="subType != null">
and SubType='${subType}'
</if>
<if test="hasSupplier == 1">
and OrganId is not null
</if>
<if test="hasSupplier == 0">
and OrganId is null
</if>
<if test="beginTime != null">
and OperTime >= '${beginTime}'
</if>
<if test="endTime != null">
and OperTime &lt;= '${endTime}'
</if>
and ifnull(delete_Flag,'0') !='1'
</select>
</mapper>