Browse Source

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into saas

yonge 2 năm trước cách đây
mục cha
commit
acc57bf021

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupActivityDao.java

@@ -74,7 +74,7 @@ public interface VipGroupActivityDao extends BaseDAO<Integer, VipGroupActivity>
 	* @date 2021/10/25 13:46
 	*/
     List<DoubleEleven2021ActivityDto> countActivityStatis();
-    List<DoubleEleven2021ActivityDto> count2022ActivityStatis();
+    List<DoubleEleven2021ActivityDto> count2022ActivityStatis(@Param("organId") String organId);
 
 	/**
 	* @description: 双十一活动统计
@@ -95,7 +95,7 @@ public interface VipGroupActivityDao extends BaseDAO<Integer, VipGroupActivity>
     * @date 2021/10/25 15:44
     */
 	DoubleEleven2021Dto countDoubleEleven2021Statis();
-	DoubleEleven2021Dto countDoubleEleven2022Statis();
+	DoubleEleven2021Dto countDoubleEleven2022Statis(@Param("organId") String organId);
 
     /**
     * @description: 双十一活动统计
@@ -104,9 +104,9 @@ public interface VipGroupActivityDao extends BaseDAO<Integer, VipGroupActivity>
     * @author zx
     * @date 2021/10/25 15:44
     */
-	List<DoubleEleven2021Dto> countOrganDoubleEleven2021Statis(@Param("organId") Integer organId);
+	List<DoubleEleven2021Dto> countOrganDoubleEleven2021Statis(@Param("organId") String organId);
 
-	List<DoubleEleven2021Dto> countOrganDoubleEleven2022Statis(@Param("organId") Integer organId);
+	List<DoubleEleven2021Dto> countOrganDoubleEleven2022Statis(@Param("organId") String organId);
 
 	/**
 	* @description: 双十一活动统计

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/OrganDoubleEleven2021StatisDto.java

@@ -2,17 +2,17 @@ package com.ym.mec.biz.dal.dto;
 
 public class OrganDoubleEleven2021StatisDto{
 
-    private Integer organId;
+    private String organId;
 
     private String order = "DESC";
 
     private String sort = "totalBuyAmount";
 
-    public Integer getOrganId() {
+    public String getOrganId() {
         return organId;
     }
 
-    public void setOrganId(Integer organId) {
+    public void setOrganId(String organId) {
         this.organId = organId;
     }
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupActivityService.java

@@ -97,7 +97,7 @@ public interface VipGroupActivityService extends BaseService<Integer, VipGroupAc
     * @author zx
     * @date 2021/10/25 12:07
     */
-    DoubleEleven2021Dto doubleEleven2022Statis();
+    DoubleEleven2021Dto doubleEleven2022Statis(String organId);
 
     /**
     * @description: 分部双11活动统计

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupActivityServiceImpl.java

@@ -309,14 +309,14 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 	}
 
 	@Override
-	public DoubleEleven2021Dto doubleEleven2022Statis() {
-		DoubleEleven2021Dto doubleEleven2022Dto = vipGroupActivityDao.countDoubleEleven2022Statis();
+	public DoubleEleven2021Dto doubleEleven2022Statis(String organId) {
+		DoubleEleven2021Dto doubleEleven2022Dto = vipGroupActivityDao.countDoubleEleven2022Statis(organId);
 		if(doubleEleven2022Dto.getTotalBuyAmount().compareTo(ZERO) > 0){
 			doubleEleven2022Dto.setAvgBuyAmount(
 					doubleEleven2022Dto.getTotalBuyAmount().divide(new BigDecimal(doubleEleven2022Dto.getTotalBuyNum()),2,BigDecimal.ROUND_CEILING));
 		}
 		//获取活动成交数据
-		this.groupTypeConvert(vipGroupActivityDao.count2022ActivityStatis(),doubleEleven2022Dto);
+		this.groupTypeConvert(vipGroupActivityDao.count2022ActivityStatis(organId),doubleEleven2022Dto);
 		//获取赠送会员数
 		Integer giveMemberNum = tempBuyDoubleElevenUserLogDao.countGiveNum(null);
 		doubleEleven2022Dto.setGiveMemberNum(giveMemberNum==null?0l:giveMemberNum.longValue());

+ 4 - 10
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -413,7 +413,7 @@
 				 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_
 		WHERE spo.group_type_ = 'ACTIVITY' AND spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2022双十一活动购买'
-		  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 FIND_IN_SET(spo.organ_id_,#{organId})
 		GROUP BY aum.activity_id_,aum.user_id_) c GROUP BY c.type_
 	</select>
 	<resultMap id="DoubleEleven2021Dto" type="com.ym.mec.biz.dal.dto.DoubleEleven2021Dto">
@@ -430,7 +430,7 @@
 	<select id="countDoubleEleven2022Statis" resultMap="DoubleEleven2021Dto">
 		SELECT SUM(spo.expect_amount_) total_buy_amount_,COUNT(DISTINCT spo.user_id_) total_buy_num_ FROM student_payment_order spo
 		WHERE spo.group_type_ = 'ACTIVITY' AND spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2022双十一活动购买'
-		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 FIND_IN_SET(spo.organ_id_,#{organId})
 	</select>
 	<select id="countGiveMemberNum" resultType="java.lang.Integer">
 		SELECT COUNT(DISTINCT student_id_) FROM cloud_teacher_order WHERE remark_ = '双十一活动赠送会员'
@@ -475,10 +475,7 @@
 		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
 		LEFT JOIN student_payment_order spo ON o.id_ = spo.organ_id_ AND spo.type_ = 'DOUBLE_ELEVEN2021' AND spo.status_ = 'SUCCESS'
-		WHERE o.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)
-		<if test="organId != null">
-			AND o.id_ = #{organId}
-		</if>
+		WHERE FIND_IN_SET(o.id_,#{organId})
 		GROUP BY o.id_
 	</select>
 	<select id="countOrganDoubleEleven2022Statis" resultMap="DoubleEleven2021Dto">
@@ -486,10 +483,7 @@
 		FROM organization o
 		LEFT JOIN student_payment_order spo ON o.id_ = spo.organ_id_
 		AND spo.group_type_ = 'ACTIVITY' AND spo.type_ = 'SMALL_CLASS_TO_BUY' AND spo.status_ = 'SUCCESS' AND spo.memo_ = '2022双十一活动购买'
-		WHERE o.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)
-		<if test="organId != null">
-			AND o.id_ = #{organId}
-		</if>
+		WHERE FIND_IN_SET(o.id_,#{organId})
 		GROUP BY o.id_
 	</select>
 	<resultMap id="DoubleEleven2021OrderDetailDto" type="com.ym.mec.biz.dal.dto.DoubleEleven2021OrderDetailDto">

+ 2 - 1
mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java

@@ -37,7 +37,8 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                         "/replacementInstrumentActivity/queryReplacementsStat", "/eduStudentRegistration/queryPreApplyList",
                         "/eduSubject/findSubSubjects", "/eduFinancialExpenditure/batchAdd", "/eduSendNotice/*",
                         "/oaContracts/*", "/eduStudent/organStudentOverView", "/activity/countCloudTeacherActive",
-                        "/activity/organDoubleEleven2021Statis", "/activity/doubleEleven2021Statis", "/activity/organDoubleEleven2022Statis", "/activity/doubleEleven2022Statis",
+                        "/activity/organDoubleEleven2021Statis", "/activity/doubleEleven2021Statis",
+                        "/activity/organDoubleEleven2022Statis", "/activity/doubleEleven2022Statis","/activity/organDoubleEleven2022Statis1", "/activity/doubleEleven2022Statis1",
                         "/questionnaireTopic/getDetail", "/questionnaireUserResult/add",
                         "/tenantInfo/info/*", "/tenantInfo/checkInfo/*", "/tenantInfo/pay/*","/tenantInfo/testCheck", "/tenantInfo/getContract/*",
                         "/tenantPreJoin/add","/imLiveBroadcastRoom/queryRoomInfo","/imLiveBroadcastRoom/test",

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

@@ -552,6 +552,9 @@ public class ExportController extends BaseController {
     @RequestMapping("export/organDoubleEleven2022Statis")
     @PreAuthorize("@pcs.hasPermissions('export/organDoubleEleven2022Statis')")
     public void organDoubleEleven2022Statis(HttpServletResponse response, OrganDoubleEleven2021StatisDto statisDto) throws IOException {
+        if(StringUtils.isEmpty(statisDto.getOrganId())){
+            statisDto.setOrganId("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");
+        }
         List<DoubleEleven2021Dto> rows = vipGroupActivityService.organDoubleEleven2022Statis(statisDto);
         if (rows.size() < 1) {
             throw new BizException("没有可导出数据");

+ 13 - 1
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java

@@ -18,6 +18,7 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
@@ -60,6 +61,9 @@ public class VipGroupActivityController extends BaseController {
     @GetMapping("/organDoubleEleven2022Statis")
     @PreAuthorize("@pcs.hasPermissions('vipGroupActivity/organDoubleEleven2022Statis')")
     public HttpResponseResult organDoubleEleven2022Statis(OrganDoubleEleven2021StatisDto queryInfo){
+        if(StringUtils.isEmpty(queryInfo.getOrganId())){
+            queryInfo.setOrganId("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");
+        }
         return succeed(vipGroupActivityService.organDoubleEleven2022Statis(queryInfo));
     }
 
@@ -80,7 +84,15 @@ public class VipGroupActivityController extends BaseController {
     @GetMapping("/doubleEleven2022Statis")
     @PreAuthorize("@pcs.hasPermissions('vipGroupActivity/doubleEleven2022Statis')")
     public HttpResponseResult doubleEleven2022Statis(){
-        return succeed(vipGroupActivityService.doubleEleven2022Statis());
+        String organId = "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";
+        return succeed(vipGroupActivityService.doubleEleven2022Statis(organId));
+    }
+    @ApiOperation(value = "双11活动统计")
+    @GetMapping("/doubleEleven2022Statis1")
+    @PreAuthorize("@pcs.hasPermissions('vipGroupActivity/doubleEleven2022Statis1')")
+    public HttpResponseResult doubleEleven2022Statis1(){
+        String organId = "4";
+        return succeed(vipGroupActivityService.doubleEleven2022Statis(organId));
     }
 
     @ApiOperation(value = "新增vip课活动方案")

+ 17 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/ActivityController.java

@@ -86,15 +86,31 @@ public class ActivityController extends BaseController {
     }
 
     @ApiOperation(value = "分部双11活动统计")
+    @GetMapping("/organDoubleEleven2022Statis1(杭州)")
+    public HttpResponseResult organDoubleEleven2022Statis1(OrganDoubleEleven2021StatisDto queryInfo){
+        queryInfo.setOrganId("4");
+        return succeed(vipGroupActivityService.organDoubleEleven2022Statis(queryInfo));
+    }
+
+    @ApiOperation(value = "分部双11活动统计")
     @GetMapping("/organDoubleEleven2022Statis")
     public HttpResponseResult organDoubleEleven2022Statis(OrganDoubleEleven2021StatisDto queryInfo){
+        if(StringUtils.isEmpty(queryInfo.getOrganId())){
+            queryInfo.setOrganId("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");
+        }
         return succeed(vipGroupActivityService.organDoubleEleven2022Statis(queryInfo));
     }
 
     @ApiOperation(value = "双11活动统计")
     @GetMapping("/doubleEleven2022Statis")
     public HttpResponseResult doubleEleven2022Statis(){
-        return succeed(vipGroupActivityService.doubleEleven2022Statis());
+        String organId = "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";
+        return succeed(vipGroupActivityService.doubleEleven2022Statis(organId));
+    }
+    @ApiOperation(value = "双11活动统计(杭州)")
+    @GetMapping("/doubleEleven2022Statis1")
+    public HttpResponseResult doubleEleven2022Statis1(){
+        return succeed(vipGroupActivityService.doubleEleven2022Statis("4"));
     }
 
     @ApiOperation(value = "分部双11活动统计")