浏览代码

双十一明细导出

zouxuan 2 年之前
父节点
当前提交
0f878ddb8a

+ 8 - 7
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -402,7 +402,7 @@
 		FROM student_payment_order spo
 		FROM student_payment_order spo
 				 LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_ AND spo.user_id_ = aum.user_id_
 				 LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_ AND spo.user_id_ = aum.user_id_
 				 LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
 				 LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
-		WHERE spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
+		WHERE spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.group_type_ = 'ACTIVITY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2021双十一活动购买'
 		  AND spo.organ_id_ IN (10,11,12,13,14,19,21,23,26,28,34,1,7,9,17,20,37,40,6,3,57,58,8,15,16,4)
 		  AND spo.organ_id_ IN (10,11,12,13,14,19,21,23,26,28,34,1,7,9,17,20,37,40,6,3,57,58,8,15,16,4)
 		GROUP BY aum.activity_id_,aum.user_id_) c GROUP BY c.type_
 		GROUP BY aum.activity_id_,aum.user_id_) c GROUP BY c.type_
 	</select>
 	</select>
@@ -424,7 +424,7 @@
 	</resultMap>
 	</resultMap>
 	<select id="countDoubleEleven2021Statis" resultMap="DoubleEleven2021Dto">
 	<select id="countDoubleEleven2021Statis" resultMap="DoubleEleven2021Dto">
 		SELECT SUM(expect_amount_) total_buy_amount_,COUNT(DISTINCT user_id_) total_buy_num_ FROM student_payment_order
 		SELECT SUM(expect_amount_) total_buy_amount_,COUNT(DISTINCT user_id_) total_buy_num_ FROM student_payment_order
-		WHERE type_ = 'DOUBLE_ELEVEN2021' AND status_ = 'SUCCESS'
+		WHERE type_ = 'SMALL_CLASS_TO_BUY' AND group_type_ = 'ACTIVITY' AND status_ = 'SUCCESS' AND memo_ = '2021双十一活动购买'
 		AND organ_id_ IN (10,11,12,13,14,19,21,23,26,28,34,1,7,9,17,20,37,40,6,3,57,58,8,15,16,4)
 		AND organ_id_ IN (10,11,12,13,14,19,21,23,26,28,34,1,7,9,17,20,37,40,6,3,57,58,8,15,16,4)
 	</select>
 	</select>
 	<select id="countDoubleEleven2022Statis" resultMap="DoubleEleven2021Dto">
 	<select id="countDoubleEleven2022Statis" resultMap="DoubleEleven2021Dto">
@@ -451,7 +451,7 @@
 		FROM student_payment_order spo
 		FROM student_payment_order spo
 		LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_ AND spo.user_id_ = aum.user_id_
 		LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_ AND spo.user_id_ = aum.user_id_
 		LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
 		LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
-		WHERE spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
+		WHERE spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.group_type_ = 'ACTIVITY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2021双十一活动购买'
 		AND spo.organ_id_ IN
 		AND spo.organ_id_ IN
 		<foreach collection="organIdList" open="(" close=")" item="organId" separator=",">
 		<foreach collection="organIdList" open="(" close=")" item="organId" separator=",">
 			#{organId}
 			#{organId}
@@ -474,7 +474,8 @@
 	<select id="countOrganDoubleEleven2021Statis" resultMap="DoubleEleven2021Dto">
 	<select id="countOrganDoubleEleven2021Statis" resultMap="DoubleEleven2021Dto">
 		SELECT SUM(spo.expect_amount_) total_buy_amount_,COUNT(DISTINCT spo.user_id_) total_buy_num_,o.name_ organ_name_,o.id_ organ_id_
 		SELECT SUM(spo.expect_amount_) total_buy_amount_,COUNT(DISTINCT spo.user_id_) total_buy_num_,o.name_ organ_name_,o.id_ organ_id_
 		FROM organization o
 		FROM organization o
-		LEFT JOIN student_payment_order spo ON o.id_ = spo.organ_id_ AND spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
+		LEFT JOIN student_payment_order spo ON o.id_ = spo.organ_id_
+		AND spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.group_type_ = 'ACTIVITY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2021双十一活动购买'
 		WHERE FIND_IN_SET(o.id_,#{organId})
 		WHERE FIND_IN_SET(o.id_,#{organId})
 		GROUP BY o.id_
 		GROUP BY o.id_
 	</select>
 	</select>
@@ -499,7 +500,7 @@
 	<sql id="queryDoubleEleven2021OrderDetailSql">
 	<sql id="queryDoubleEleven2021OrderDetailSql">
 		WHERE
 		WHERE
 		<if test="year == '2021'">
 		<if test="year == '2021'">
-			spo.status_ = 'SUCCESS' AND spo.type_ = 'DOUBLE_ELEVEN2021' and spo.tenant_id_ = #{tenantId}
+			spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.group_type_ = 'ACTIVITY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2021双十一活动购买'
 		</if>
 		</if>
 		<if test="year == '2022'">
 		<if test="year == '2022'">
 			spo.group_type_ = 'ACTIVITY' AND spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2022双十一活动购买'
 			spo.group_type_ = 'ACTIVITY' AND spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2022双十一活动购买'
@@ -527,8 +528,8 @@
 		</if>
 		</if>
 	</sql>
 	</sql>
 	<select id="queryDoubleEleven2021OrderDetail" resultMap="DoubleEleven2021OrderDetailDto">
 	<select id="queryDoubleEleven2021OrderDetail" resultMap="DoubleEleven2021OrderDetailDto">
-		SELECT spo.user_id_,su.username_,spo.order_no_,SUM(aum.actual_price_) amount_,spo.create_time_,spo.pay_time_,GROUP_CONCAT(vga.attribute1_) type_,
-			   CASE WHEN cto.id_ IS NULL THEN 0 ELSE 1 END give_member_
+		SELECT spo.user_id_,su.username_,spo.order_no_,SUM(aum.actual_price_) amount_,
+		       spo.create_time_,spo.pay_time_,GROUP_CONCAT(vga.attribute1_) type_
 		FROM student_payment_order spo
 		FROM student_payment_order spo
 				 LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_
 				 LEFT JOIN activity_user_mapper aum ON spo.id_ = aum.payment_order_id_
 				 LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_
 				 LEFT JOIN vip_group_activity vga ON vga.id_ = aum.activity_id_

+ 2 - 3
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -489,9 +489,8 @@ public class ExportController extends BaseController {
         OutputStream outputStream = response.getOutputStream();
         OutputStream outputStream = response.getOutputStream();
         try {
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员姓名", "订单号", "交易金额",
             HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员姓名", "订单号", "交易金额",
-                    "交易时间", "订单创建时间", "购买课程", "赠送会员"}, new String[]{
-                    "userId", "username", "orderNo", "amount", "payTime", "createTime", "type",
-                    "giveMember==0?'否':'是'"}, rows);
+                    "交易时间", "订单创建时间", "购买课程"}, new String[]{
+                    "userId", "username", "orderNo", "amount", "payTime", "createTime", "type"}, rows);
             response.setContentType("application/octet-stream");
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attac:wq" +
             response.setHeader("Content-Disposition", "attac:wq" +
                     "hment;filename=classGroup-" + DateUtil.getDate(new Date()) + ".xls");
                     "hment;filename=classGroup-" + DateUtil.getDate(new Date()) + ".xls");