zoujiajian 1 سال پیش
والد
کامیت
93e01326fb

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/mapper/manage/statistics/StatisticsExportMapper.java

@@ -82,4 +82,6 @@ public interface StatisticsExportMapper{
 	Integer getYearNumOfRenewalsByGoodsId(@Param("goodsId") Long goodsId, @Param("lastElevMonth") String lastElevMonth, @Param("lastYearMonth") String lastYearMonth);
 
 	Integer getActualNumberOfRenewalsByGoodsId(@Param("goodsId") Long goodsId, @Param("lastElevMonth") String lastElevMonth, @Param("lastYearMonth") String lastYearMonth);
+
+	BigDecimal getWholesaleOrderMoney(@Param("startDate") String startDate, @Param("endDate") String endDate);
 }

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GroupsDataStatisticsView.java

@@ -95,4 +95,9 @@ public class GroupsDataStatisticsView {
 
 	private List<RealGoodsSourceData> realGoodsSourceDataList;
 
+	/**
+	 * 批发销售金额
+	 */
+	private BigDecimal wholesaleOrderMoney;
+
 }

+ 8 - 0
netflix-dao/src/main/resources/mapper/StatisticsExportMapper.xml

@@ -594,4 +594,12 @@
             and `status` not in ('close', 'noPayment', 'refund')
             and goods_id = #{goodsId} and user_id = o.user_id limit 1)
     </select>
+
+    <select id="getWholesaleOrderMoney" resultType="java.math.BigDecimal">
+        select ifnull((sum(money) - ifnull(sum(refund_money),0))/100,0)
+        from goods_wholesale_order_don
+        where `status` not in ('close', 'noPayment', 'refund')
+          and created_time >= #{startDate}
+          and created_time &lt; #{endDate}
+    </select>
 </mapper>

+ 2 - 0
netflix-service/src/main/java/com/cyksj/service/mange/statistics/impl/StatisticsDataServiceImpl.java

@@ -450,9 +450,11 @@ public class StatisticsDataServiceImpl implements StatisticsDataService {
 		BigDecimal unBIndGroupsAiOrderMoney = Optional.ofNullable(statisticsExportMapper.getMonthGoodsTypeAmountOfOrderByType(4, null, 1l, startDate, endDate, true)).orElse(BigDecimal.ZERO);
 		//设备销售金额
 		BigDecimal unBIndGroupsEpOrderMoney = Optional.ofNullable(statisticsExportMapper.getMonthGoodsTypeAmountOfOrderByType(4, 2, null, startDate, endDate, true)).orElse(BigDecimal.ZERO);
+		BigDecimal wholesaleOrderMoney = Optional.ofNullable(statisticsExportMapper.getWholesaleOrderMoney(startDate, endDate)).orElse(BigDecimal.ZERO);
 		groupsDataStatisticsView.setUnBIndGroupsStreamingMoney(unBIndGroupsStreamingMoney);
 		groupsDataStatisticsView.setUnBIndGroupsAiOrderMoney(unBIndGroupsAiOrderMoney);
 		groupsDataStatisticsView.setUnBIndGroupsEpOrderMoney(unBIndGroupsEpOrderMoney);
+		groupsDataStatisticsView.setWholesaleOrderMoney(wholesaleOrderMoney);
 	}
 
 	public void getNatureOrderData(GroupsDataStatisticsView groupsDataStatisticsView, String startDate, String endDate) {