魏超 5 年 前
コミット
157ed41978
共有25 個のファイルを変更した200 個の追加213 個の削除を含む
  1. 21
    78
      src/main/java/com/huiju/estateagents/job/JudglActivityTimeJob.java
  2. 2
    2
      src/main/java/com/huiju/estateagents/mapper/HelpActivityMapper.java
  3. 1
    1
      src/main/java/com/huiju/estateagents/mapper/HelpInitiateRecordMapper.java
  4. 2
    4
      src/main/java/com/huiju/estateagents/mapper/TaBuildingDynamicMapper.java
  5. 2
    4
      src/main/java/com/huiju/estateagents/mapper/TaShareActivityMapper.java
  6. 1
    1
      src/main/java/com/huiju/estateagents/mapper/TaShareChildRecordMapper.java
  7. 1
    1
      src/main/java/com/huiju/estateagents/mapper/TaShareRecordMapper.java
  8. 2
    3
      src/main/java/com/huiju/estateagents/service/IHelpActivityService.java
  9. 1
    1
      src/main/java/com/huiju/estateagents/service/IHelpInitiateRecordService.java
  10. 2
    4
      src/main/java/com/huiju/estateagents/service/ITaBuildingDynamicService.java
  11. 4
    6
      src/main/java/com/huiju/estateagents/service/ITaShareActivityService.java
  12. 1
    1
      src/main/java/com/huiju/estateagents/service/ITaShareChildRecordService.java
  13. 1
    1
      src/main/java/com/huiju/estateagents/service/ITaShareRecordService.java
  14. 4
    8
      src/main/java/com/huiju/estateagents/service/impl/HelpActivityServiceImpl.java
  15. 2
    10
      src/main/java/com/huiju/estateagents/service/impl/HelpInitiateRecordServiceImpl.java
  16. 4
    8
      src/main/java/com/huiju/estateagents/service/impl/TaBuildingDynamicServiceImpl.java
  17. 4
    9
      src/main/java/com/huiju/estateagents/service/impl/TaShareActivityServiceImpl.java
  18. 2
    11
      src/main/java/com/huiju/estateagents/service/impl/TaShareChildRecordServiceImpl.java
  19. 2
    11
      src/main/java/com/huiju/estateagents/service/impl/TaShareRecordServiceImpl.java
  20. 37
    11
      src/main/resources/mapper/HelpActivityMapper.xml
  21. 12
    6
      src/main/resources/mapper/HelpInitiateRecordMapper.xml
  22. 36
    11
      src/main/resources/mapper/TaBuildingDynamicMapper.xml
  23. 36
    11
      src/main/resources/mapper/TaShareActivityMapper.xml
  24. 9
    5
      src/main/resources/mapper/TaShareChildRecordMapper.xml
  25. 11
    5
      src/main/resources/mapper/TaShareRecordMapper.xml

+ 21
- 78
src/main/java/com/huiju/estateagents/job/JudglActivityTimeJob.java ファイルの表示

@@ -1,25 +1,13 @@
1 1
 package com.huiju.estateagents.job;
2 2
 
3
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.baomidou.mybatisplus.core.metadata.IPage;
5 3
 import com.huiju.estateagents.base.BaseController;
6
-import com.huiju.estateagents.base.ResponseBean;
7
-import com.huiju.estateagents.common.StringUtils;
8
-import com.huiju.estateagents.entity.HelpActivity;
9
-import com.huiju.estateagents.entity.TaBuildingDynamic;
10
-import com.huiju.estateagents.entity.TaShareActivity;
11 4
 import com.huiju.estateagents.service.*;
12
-import io.swagger.models.auth.In;
13 5
 import org.springframework.beans.factory.annotation.Autowired;
14 6
 import org.springframework.context.annotation.Configuration;
15 7
 import org.springframework.scheduling.annotation.EnableScheduling;
16 8
 import org.springframework.scheduling.annotation.Scheduled;
17 9
 import org.springframework.stereotype.Component;
18 10
 
19
-import java.time.LocalDateTime;
20
-import java.util.ArrayList;
21
-import java.util.List;
22
-
23 11
 /**
24 12
  * @author admin
25 13
  * @Title: JudglActivityTimeJob
@@ -56,74 +44,29 @@ public class JudglActivityTimeJob extends BaseController {
56 44
      * 开启定时任务,每天12:30执行
57 45
      */
58 46
     @Scheduled(cron = "* 0/5 ** * * ?")
59
-//    @Scheduled(cron = "0/5 * * * * ?")
60 47
     private void configureTasks() {
61 48
 
62
-        //活动列表
63
-        QueryWrapper<TaBuildingDynamic> buildingDynamicQueryWrapper = new QueryWrapper<>();
64
-        buildingDynamicQueryWrapper.ne("activity_status", "2");
65
-        List<TaBuildingDynamic> taBuildingDynamics = iTaBuildingDynamicService.list(buildingDynamicQueryWrapper);
66
-
67
-        //拼团活动列表
68
-        QueryWrapper<TaShareActivity> shareActivityQueryWrapper = new QueryWrapper<>();
69
-        shareActivityQueryWrapper.ne("activity_status", "2");
70
-        List<TaShareActivity> taShareActivities = iTaShareActivityService.list(shareActivityQueryWrapper);
71
-
72
-        //助力活动列表
73
-        QueryWrapper<HelpActivity> activityQueryWrapper = new QueryWrapper<>();
74
-        activityQueryWrapper.ne("activity_status", "2");
75
-        List<HelpActivity> helpActivities = iHelpActivityService.list(activityQueryWrapper);
76
-
77
-        LocalDateTime nowTime = LocalDateTime.now();
78
-
79
-        List<String> startActivityIds = new ArrayList<>();
80
-        List<String> endActivityIds = new ArrayList<>();
81
-        for (TaBuildingDynamic taBuildingDynamic : taBuildingDynamics){
82
-            LocalDateTime startTime = taBuildingDynamic.getStartDate();
83
-            LocalDateTime endTime = taBuildingDynamic.getEndDate();
84
-            if (nowTime.isAfter(startTime) && endTime.isAfter(nowTime)){
85
-                startActivityIds.add(taBuildingDynamic.getDynamicId());
86
-            }
87
-            if (nowTime.isAfter(endTime)){
88
-                endActivityIds.add(taBuildingDynamic.getDynamicId());
89
-            }
90
-        }
91
-        iTaBuildingDynamicService.updateUnStartActivity(startActivityIds);
92
-        iTaBuildingDynamicService.updateEndActivity(endActivityIds);
93
-
94
-
95
-        List<Integer> startGroupActivityIds = new ArrayList<>();
96
-        List<Integer> endGroupActivityIds = new ArrayList<>();
97
-        for (TaShareActivity taShareActivity : taShareActivities){
98
-            LocalDateTime startTime = taShareActivity.getStartTime();
99
-            LocalDateTime endTime = taShareActivity.getEndTime();
100
-            if (nowTime.isAfter(startTime) && endTime.isAfter(nowTime)){
101
-                startGroupActivityIds.add(taShareActivity.getGroupActivityId());
102
-            }
103
-            if (nowTime.isAfter(endTime)){
104
-                endGroupActivityIds.add(taShareActivity.getGroupActivityId());
105
-            }
106
-        }
107
-        iTaShareActivityService.updateUnStartActivity(startGroupActivityIds);
108
-        iTaShareActivityService.updateEndActivity(endGroupActivityIds);
109
-        iTaShareRecordService.updateEndActivity(endGroupActivityIds);
110
-        iTaShareChildRecordService.updateEndActivity(endGroupActivityIds);
111
-
112
-        List<Integer> startHelpActivityIds = new ArrayList<>();
113
-        List<Integer> endHelpActivityIds = new ArrayList<>();
114
-        for (HelpActivity helpActivity : helpActivities){
115
-            LocalDateTime startTime = helpActivity.getStartDate();
116
-            LocalDateTime endTime = helpActivity.getEndDate();
117
-            if (nowTime.isAfter(startTime) && endTime.isAfter(nowTime)){
118
-                startHelpActivityIds.add(helpActivity.getHelpActivityId());
119
-            }
120
-            if (nowTime.isAfter(endTime)){
121
-                endHelpActivityIds.add(helpActivity.getHelpActivityId());
122
-            }
123
-        }
124
-        iHelpActivityService.updateUnStartActivity(startHelpActivityIds);
125
-        iHelpActivityService.updateEndActivity(endHelpActivityIds);
126
-        iHelpInitiateRecordService.updateEndActivity(endHelpActivityIds);
49
+        //未开始活动更新为已开始
50
+        iTaBuildingDynamicService.updateUnStartActivity();
51
+        //进行中活动更新为已结束
52
+        iTaBuildingDynamicService.updateProcessingActivity();
53
+
54
+        //未开始拼团活动更新为已开始
55
+        iTaShareActivityService.updateUnStartGroupActivity();
56
+        //进行中拼团活动更新为已结束
57
+        iTaShareActivityService.updateProcessingGroupActivity();
58
+
59
+        //更新拼团者和参团者数据为已结束
60
+        iTaShareRecordService.updateActivityProcessToEnd();
61
+        iTaShareChildRecordService.updateActivityProcessToEnd();
62
+
63
+        //未开始助力活动更新为已开始
64
+        iHelpActivityService.updateUnStartHelpActivity();
65
+        //进行中助力活动更新为已结束
66
+        iHelpActivityService.updateProcessingHelpActivity();
67
+
68
+        //更新助力者和发起者数据为已结束
69
+        iHelpInitiateRecordService.updateHelpActivityProcessToEnd();
127 70
     }
128 71
 
129 72
 }

+ 2
- 2
src/main/java/com/huiju/estateagents/mapper/HelpActivityMapper.java ファイルの表示

@@ -33,9 +33,9 @@ public interface HelpActivityMapper extends BaseMapper<HelpActivity> {
33 33
      */
34 34
     IPage<HelpActivity> helpActivityListPage(IPage<HelpActivity> pg, @Param("cityId")Integer cityId, @Param("buildingId")String buildingId, @Param("title")String title, @Param("startDate")String startDate, @Param("endDate") String endDate, @Param("activityStatus")Integer activityStatus, @Param("orgId")Integer orgId);
35 35
 
36
-    void updateUnStartHelpActivity(@Param("list") List<Integer> startHelpActivityId);
36
+    void updateUnStartHelpActivity();
37 37
 
38
-    void updateEndHelpActivity(@Param("list")List<Integer> endHelpActivityId);
38
+    void updateProcessingHelpActivity();
39 39
 
40 40
     /**
41 41
      * 微信端查询拼团和助力推首页的活动的

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/HelpInitiateRecordMapper.java ファイルの表示

@@ -56,7 +56,7 @@ public interface HelpInitiateRecordMapper extends BaseMapper<HelpInitiateRecord>
56 56
 
57 57
     List<HelpInitiateRecordSucceed> getHelpInitiateRecordSucceedExportList(@Param("pageCode") int i, @Param("pageSize") Integer pageSize, @Param("tel") Integer tel, @Param("helpActivityId") Integer helpActivityId);
58 58
 
59
-    void updateEndGroupActivity(List<Integer> endHelpActivityIds);
59
+    void updateHelpActivityProcessToEnd();
60 60
 	/**
61 61
 	 * 获取我的助力列表
62 62
 	 * @param pg

+ 2
- 4
src/main/java/com/huiju/estateagents/mapper/TaBuildingDynamicMapper.java ファイルの表示

@@ -74,13 +74,11 @@ public interface TaBuildingDynamicMapper extends BaseMapper<TaBuildingDynamic> {
74 74
 
75 75
     /**
76 76
      * 更新未开始的活动
77
-     * @param startActivityIds
78 77
      */
79
-    void updateUnStartActivity(@Param("list") List<String> startActivityIds);
78
+    void updateUnStartActivity();
80 79
 
81 80
     /**
82 81
      * 更新结束的活动
83
-     * @param endActivityIds
84 82
      */
85
-    void updateEndActivity(@Param("list") List<String> endActivityIds);
83
+    void updateProcessingActivity();
86 84
 }

+ 2
- 4
src/main/java/com/huiju/estateagents/mapper/TaShareActivityMapper.java ファイルの表示

@@ -20,11 +20,9 @@ import java.util.List;
20 20
 public interface TaShareActivityMapper extends BaseMapper<TaShareActivity> {
21 21
     TaShareActivity selectTaShareActivityById(@Param("activityId")Integer activityId);
22 22
 
23
-    void updateJoinPeople(@Param("activityId") Integer activityId);
23
+    void updateUnStartGroupActivity();
24 24
 
25
-    void updateUnStartGroupActivity(@Param("list") List<Integer> startGroupActivityId);
26
-
27
-    void updateEndGroupActivity(@Param("list")List<Integer> endGroupActivityId);
25
+    void updateProcessGroupActivity();
28 26
 
29 27
     Integer calParticipateNum(@Param("groupActivityId") Integer groupActivityId);
30 28
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaShareChildRecordMapper.java ファイルの表示

@@ -21,5 +21,5 @@ import java.util.List;
21 21
 public interface TaShareChildRecordMapper extends BaseMapper<TaShareChildRecord> {
22 22
     IPage<TaShareChildRecord> getList(IPage<TaShareChildRecord> pg, @Param("groupActivityId") Integer groupActivityId, @Param("status") Integer status, @Param("recordId") Integer recordId, @Param("orgId") Integer orgId);
23 23
     List<ShareChildRecordExport> getShareRecordExportList(@Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("recordId") Integer recordId , @Param("status")Integer status, @Param("groupActivityId") Integer groupActivityId);
24
-    void updateEndGroupActivity(List<Integer> endGroupActivityIds);
24
+    void updateEndGroupActivity();
25 25
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaShareRecordMapper.java ファイルの表示

@@ -28,5 +28,5 @@ public interface TaShareRecordMapper extends BaseMapper<TaShareRecord> {
28 28
     List<ShareRecordSuccessExport> getShareRecordSuccessExportList(@Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("recordId") Integer recordId , @Param("status")Integer status, @Param("groupActivityId") Integer groupActivityId);
29 29
     List<ShareRecordFailExport> getShareRecordFailExportList(@Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("recordId") Integer recordId , @Param("status")Integer status, @Param("groupActivityId") Integer groupActivityId);
30 30
 	List<TaShareRecord> getShareRecordList(Page<TaShareRecord> pg,@Param("orgId") Integer orgId,@Param("personId") String personId);
31
-    void updateEndGroupActivity(@Param("list")List<Integer> endGroupActivityIds);
31
+    void updateEndGroupActivity();
32 32
 }

+ 2
- 3
src/main/java/com/huiju/estateagents/service/IHelpActivityService.java ファイルの表示

@@ -118,13 +118,12 @@ public interface IHelpActivityService extends IService<HelpActivity> {
118 118
     /**
119 119
      * 开始助力活动
120 120
      */
121
-    void updateUnStartActivity(List<Integer> startGroupActivityIds);
121
+    void updateUnStartHelpActivity();
122 122
 
123 123
     /**
124 124
      * 结束助力活动
125
-     * @param endGroupActivityIds
126 125
      */
127
-    void updateEndActivity(List<Integer> endGroupActivityIds);
126
+    void updateProcessingHelpActivity();
128 127
 
129 128
     /**
130 129
      * 微信端查询拼团和助力推首页的活动的

+ 1
- 1
src/main/java/com/huiju/estateagents/service/IHelpInitiateRecordService.java ファイルの表示

@@ -26,5 +26,5 @@ public interface IHelpInitiateRecordService extends IService<HelpInitiateRecord>
26 26
 	 */
27 27
 	ResponseBean getInitiateRecord(Integer pageNum, Integer pageSize, Integer orgId, String personId);
28 28
 
29
-	void updateEndActivity(List<Integer> endHelpActivityIds);
29
+	void updateHelpActivityProcessToEnd();
30 30
 }

+ 2
- 4
src/main/java/com/huiju/estateagents/service/ITaBuildingDynamicService.java ファイルの表示

@@ -89,15 +89,13 @@ public interface ITaBuildingDynamicService extends IService<TaBuildingDynamic> {
89 89
 
90 90
     /**
91 91
      * 开始未进行的活动
92
-     * @param startActivityId
93 92
      */
94
-    void updateUnStartActivity(List<String> startActivityId);
93
+    void updateUnStartActivity();
95 94
 
96 95
     /**
97 96
      * 结束过期的活动
98
-     * @param endActivityId
99 97
      */
100
-    void updateEndActivity(List<String> endActivityId);
98
+    void updateProcessingActivity();
101 99
 
102 100
     /**
103 101
      * 报名记录导出当前总数

+ 4
- 6
src/main/java/com/huiju/estateagents/service/ITaShareActivityService.java ファイルの表示

@@ -20,16 +20,14 @@ public interface ITaShareActivityService extends IService<TaShareActivity> {
20 20
     ResponseBean getList(Integer pageNum, Integer pageSize, String buildingId, String activityName, String status, LocalDateTime startTime, LocalDateTime endTime, Integer cityId, Integer orgId);
21 21
 
22 22
     /**
23
-     * 开始未进行的活动
24
-     * @param startGroupActivityId
23
+     * 活动未开始更新为进行中
25 24
      */
26
-    void updateUnStartActivity(List<Integer> startGroupActivityId);
25
+    void updateUnStartGroupActivity();
27 26
 
28 27
     /**
29
-     * 结束过期的活动
30
-     * @param endGroupActivityId
28
+     * 活动进行中更新为已结束
31 29
      */
32
-    void updateEndActivity(List<Integer> endGroupActivityId);
30
+    void updateProcessingGroupActivity();
33 31
 
34 32
     /**
35 33
      * 查询拼团  已开始 和 未开始

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaShareChildRecordService.java ファイルの表示

@@ -22,7 +22,7 @@ public interface ITaShareChildRecordService extends IService<TaShareChildRecord>
22 22
     ResponseBean validateRule(TaShareChildRecord taShareChildRecord);
23 23
     Integer getShareRecord(Integer recordId, Integer status);
24 24
     List<ShareChildRecordExport> getShareRecordExportList(Integer pageCode, Integer pageSize, Integer recordId, Integer status, Integer groupActivityId);
25
-	void updateEndActivity(List<Integer> endGroupActivityIds);
25
+	void updateActivityProcessToEnd();
26 26
 	/**
27 27
 	 * 微信端成为团员
28 28
 	 *

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaShareRecordService.java ファイルの表示

@@ -29,7 +29,7 @@ public interface ITaShareRecordService extends IService<TaShareRecord> {
29 29
     Integer getShareRecord(Integer recordId, Integer status);
30 30
     List<ShareRecordSuccessExport>  getShareRecordSuccessExportList(Integer pageCode, Integer pageSize, Integer recordId, Integer status, Integer groupActivityId);
31 31
     List<ShareRecordFailExport>  getShareRecordFailExportList(Integer pageCode, Integer pageSize, Integer recordId, Integer status, Integer groupActivityId);
32
-	void updateEndActivity(List<Integer> endGroupActivityIds);
32
+	void updateActivityProcessToEnd();
33 33
     /**
34 34
 	 * 分页获取微信端发起拼团记录
35 35
 	 * @param pageNum

+ 4
- 8
src/main/java/com/huiju/estateagents/service/impl/HelpActivityServiceImpl.java ファイルの表示

@@ -197,17 +197,13 @@ public class HelpActivityServiceImpl extends ServiceImpl<HelpActivityMapper, Hel
197 197
     }
198 198
 
199 199
     @Override
200
-    public void updateUnStartActivity(List<Integer> startHelpActivityIds) {
201
-        if (CollectionUtils.isNotEmpty(startHelpActivityIds)){
202
-            taHelpActivityMapper.updateUnStartHelpActivity(startHelpActivityIds);
203
-        }
200
+    public void updateUnStartHelpActivity() {
201
+        taHelpActivityMapper.updateUnStartHelpActivity();
204 202
     }
205 203
 
206 204
     @Override
207
-    public void updateEndActivity(List<Integer> endHelpActivityIds) {
208
-        if (CollectionUtils.isNotEmpty(endHelpActivityIds)){
209
-            taHelpActivityMapper.updateEndHelpActivity(endHelpActivityIds);
210
-        }
205
+    public void updateProcessingHelpActivity() {
206
+        taHelpActivityMapper.updateProcessingHelpActivity();
211 207
     }
212 208
 
213 209
     @Override

+ 2
- 10
src/main/java/com/huiju/estateagents/service/impl/HelpInitiateRecordServiceImpl.java ファイルの表示

@@ -45,15 +45,7 @@ public class HelpInitiateRecordServiceImpl extends ServiceImpl<HelpInitiateRecor
45 45
 	}
46 46
 
47 47
 	@Override
48
-	public void updateEndActivity(List<Integer> endHelpActivityIds) {
49
-		if (CollectionUtils.isNotEmpty(endHelpActivityIds)){
50
-			List<HelpInitiateRecord> helpInitiateRecords = helpInitiateRecordMapper.selectBatchIds(endHelpActivityIds);
51
-			for (HelpInitiateRecord helpInitiateRecord : helpInitiateRecords){
52
-				helpInitiateRecord.setStatus(2);
53
-				if (helpInitiateRecord.getStatus() != 0){
54
-					helpInitiateRecordMapper.updateById(helpInitiateRecord);
55
-				}
56
-			}
57
-		}
48
+	public void updateHelpActivityProcessToEnd() {
49
+		helpInitiateRecordMapper.updateHelpActivityProcessToEnd();
58 50
 	}
59 51
 }

+ 4
- 8
src/main/java/com/huiju/estateagents/service/impl/TaBuildingDynamicServiceImpl.java ファイルの表示

@@ -328,17 +328,13 @@ public class TaBuildingDynamicServiceImpl extends ServiceImpl<TaBuildingDynamicM
328 328
     }
329 329
 
330 330
     @Override
331
-    public void updateUnStartActivity(List<String> startActivityIds) {
332
-        if (CollectionUtils.isNotEmpty(startActivityIds)){
333
-            buildingDynamicMapper.updateUnStartActivity(startActivityIds);
334
-        }
331
+    public void updateUnStartActivity() {
332
+        buildingDynamicMapper.updateUnStartActivity();
335 333
     }
336 334
 
337 335
     @Override
338
-    public void updateEndActivity(List<String> endActivityIds) {
339
-        if (CollectionUtils.isNotEmpty(endActivityIds)){
340
-            buildingDynamicMapper.updateEndActivity(endActivityIds);
341
-        }
336
+    public void updateProcessingActivity() {
337
+        buildingDynamicMapper.updateProcessingActivity();
342 338
     }
343 339
 
344 340
     @Override

+ 4
- 9
src/main/java/com/huiju/estateagents/service/impl/TaShareActivityServiceImpl.java ファイルの表示

@@ -60,18 +60,13 @@ public class TaShareActivityServiceImpl extends ServiceImpl<TaShareActivityMappe
60 60
     }
61 61
 
62 62
     @Override
63
-    public void updateUnStartActivity(List<Integer> startGroupActivityId) {
64
-        if (CollectionUtils.isNotEmpty(startGroupActivityId)){
65
-            taShareActivityMapper.updateUnStartGroupActivity(startGroupActivityId);
66
-        }
63
+    public void updateUnStartGroupActivity() {
64
+        taShareActivityMapper.updateUnStartGroupActivity();
67 65
     }
68 66
 
69 67
     @Override
70
-    public void updateEndActivity(List<Integer> endGroupActivityId) {
71
-
72
-        if (CollectionUtils.isNotEmpty(endGroupActivityId)){
73
-            taShareActivityMapper.updateEndGroupActivity(endGroupActivityId);
74
-        }
68
+    public void updateProcessingGroupActivity() {
69
+        taShareActivityMapper.updateProcessGroupActivity();
75 70
     }
76 71
 
77 72
     @Override

+ 2
- 11
src/main/java/com/huiju/estateagents/service/impl/TaShareChildRecordServiceImpl.java ファイルの表示

@@ -80,7 +80,6 @@ public class TaShareChildRecordServiceImpl extends ServiceImpl<TaShareChildRecor
80 80
             //扣取积分,更新参团人数
81 81
             taPerson.setPoints(taPerson.getPoints() - taShareActivity.getIntegral());
82 82
             taPersonMapper.updateById(taPerson);
83
-            activityMapper.updateJoinPeople(taShareChildRecord.getGroupActivityId());
84 83
             responseBean.addSuccess("您已成功参团");
85 84
 
86 85
         }catch (Exception e){
@@ -106,16 +105,8 @@ public class TaShareChildRecordServiceImpl extends ServiceImpl<TaShareChildRecor
106 105
     }
107 106
 
108 107
     @Override
109
-    public void updateEndActivity(List<Integer> endGroupActivityIds) {
110
-        if (CollectionUtils.isNotEmpty(endGroupActivityIds)){
111
-            List<TaShareChildRecord> taShareChildRecords = taShareChildRecordMapper.selectBatchIds(endGroupActivityIds);
112
-            for (TaShareChildRecord taShareChildRecord : taShareChildRecords){
113
-                taShareChildRecord.setStatus(2);
114
-                if (taShareChildRecord.getStatus() != 0){
115
-                    taShareChildRecordMapper.updateById(taShareChildRecord);
116
-                }
117
-            }
118
-        }
108
+    public void updateActivityProcessToEnd() {
109
+        taShareChildRecordMapper.updateEndGroupActivity();
119 110
     }
120 111
 
121 112
     /**

+ 2
- 11
src/main/java/com/huiju/estateagents/service/impl/TaShareRecordServiceImpl.java ファイルの表示

@@ -79,7 +79,6 @@ public class TaShareRecordServiceImpl extends ServiceImpl<TaShareRecordMapper, T
79 79
             //扣取积分,更新参团人数
80 80
             taPerson.setPoints(taPerson.getPoints() - taShareActivity.getIntegral());
81 81
             taPersonMapper.updateById(taPerson);
82
-            activityMapper.updateJoinPeople(taShareRecord.getGroupActivityId());
83 82
             responseBean.addSuccess("您已成功发起拼团,赶快邀请好友参团吧");
84 83
 
85 84
         }catch (Exception e){
@@ -151,16 +150,8 @@ public class TaShareRecordServiceImpl extends ServiceImpl<TaShareRecordMapper, T
151 150
     }
152 151
 
153 152
     @Override
154
-    public void updateEndActivity(List<Integer> endGroupActivityIds) {
155
-        if (CollectionUtils.isNotEmpty(endGroupActivityIds)){
156
-            List<TaShareRecord> taShareRecords = taShareRecordMapper.selectBatchIds(endGroupActivityIds);
157
-            for (TaShareRecord taShareRecord : taShareRecords){
158
-                taShareRecord.setStatus(2);
159
-                if (taShareRecord.getStatus() != 0){
160
-                    taShareRecordMapper.updateById(taShareRecord);
161
-                }
162
-            }
163
-        }
153
+    public void updateActivityProcessToEnd() {
154
+        taShareRecordMapper.updateEndGroupActivity();
164 155
     }
165 156
 
166 157
     /**

+ 37
- 11
src/main/resources/mapper/HelpActivityMapper.xml ファイルの表示

@@ -38,20 +38,46 @@
38 38
     </select>
39 39
 
40 40
     <update id="updateUnStartHelpActivity">
41
-        update ta_help_activity t set t.activity_status = 0
42
-        where t.help_activity_id in
43
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
44
-            #{item}
45
-        </foreach>
41
+        update ta_help_activity
42
+        set activity_status = 0
43
+        where
44
+        help_activity_id in (
45
+            select
46
+            help_activity_id
47
+            from
48
+            (
49
+            select
50
+            t.help_activity_id
51
+            from
52
+            ta_help_activity t
53
+            where
54
+            t.activity_status != '2'
55
+            and NOW() > t.start_date
56
+            and NOW() &lt; t.end_date
57
+            ) s
58
+        )
46 59
     </update>
47 60
 
48
-    <update id="updateEndHelpActivity">
49
-        update ta_help_activity t set t.activity_status = 2
50
-        where t.help_activity_id in
51
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
52
-            #{item}
53
-        </foreach>
61
+    <update id="updateProcessingHelpActivity">
62
+        update ta_help_activity
63
+        set activity_status = 2
64
+        where
65
+            help_activity_id in (
66
+                select
67
+                    help_activity_id
68
+                from
69
+                    (
70
+                        select
71
+                            t.help_activity_id
72
+                        from
73
+                            ta_help_activity t
74
+                        where
75
+                            t.activity_status != '2'
76
+                        and NOW() > t.end_date
77
+                    ) s
78
+            )
54 79
     </update>
80
+
55 81
     <select id="selectWxhelpActivityAndGroup" resultType="com.huiju.estateagents.entity.HelpActivity">
56 82
 		(
57 83
 			SELECT

+ 12
- 6
src/main/resources/mapper/HelpInitiateRecordMapper.xml ファイルの表示

@@ -2,12 +2,18 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.huiju.estateagents.mapper.HelpInitiateRecordMapper">
4 4
 
5
-    <update id="updateEndGroupActivity">
6
-        update ta_help_initiate_record t set t.status = 2
7
-        where t.help_activity_id in
8
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
9
-            #{item}
10
-        </foreach>
5
+    <update id="updateHelpActivityProcessToEnd">
6
+      update ta_help_initiate_record a
7
+        set a.`status` = '2'
8
+        where
9
+            a.help_activity_id in (
10
+                select
11
+                    t.help_activity_id
12
+                from
13
+                    ta_help_activity t
14
+                where (NOW() > t.end_date or t.activity_status = '2')
15
+            )
16
+        and a.`status` = '1'
11 17
     </update>
12 18
 
13 19
     <select id="selectPageList" resultType="com.huiju.estateagents.entity.HelpInitiateRecord">

+ 36
- 11
src/main/resources/mapper/TaBuildingDynamicMapper.xml ファイルの表示

@@ -96,19 +96,44 @@
96 96
     </update>
97 97
 
98 98
     <update id="updateUnStartActivity">
99
-      update ta_building_dynamic t set t.activity_status = 0
100
-      where t.dynamic_id in
101
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
102
-            #{item}
103
-        </foreach>
99
+        update ta_building_dynamic
100
+        set activity_status = 0
101
+        where
102
+        dynamic_id in (
103
+            select
104
+            dynamic_id
105
+            from
106
+            (
107
+            select
108
+            t.dynamic_id
109
+            from
110
+            ta_building_dynamic t
111
+            where
112
+            t.activity_status != '2'
113
+            and NOW() > t.create_date
114
+            and NOW() &lt; t.end_date
115
+            ) s
116
+        )
104 117
     </update>
105 118
 
106
-    <update id="updateEndActivity">
107
-        update ta_building_dynamic t set t.activity_status = 2
108
-        where t.dynamic_id in
109
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
110
-            #{item}
111
-        </foreach>
119
+    <update id="updateProcessingActivity">
120
+        update ta_building_dynamic
121
+        set activity_status = 2
122
+        where
123
+            dynamic_id in (
124
+                select
125
+                    dynamic_id
126
+                from
127
+                    (
128
+                        select
129
+                            t.dynamic_id
130
+                        from
131
+                            ta_building_dynamic t
132
+                        where
133
+                            t.activity_status != '2'
134
+                        and NOW() > t.end_date
135
+                    ) s
136
+            );
112 137
     </update>
113 138
 
114 139
     <select id="updateTaBuildingDynamic">

+ 36
- 11
src/main/resources/mapper/TaShareActivityMapper.xml ファイルの表示

@@ -16,19 +16,44 @@
16 16
     </select>
17 17
 
18 18
     <update id="updateUnStartGroupActivity">
19
-        update ta_share_activity t set t.activity_status = 0
20
-        where t.group_activity_id in
21
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
22
-            #{item}
23
-        </foreach>
19
+        update ta_share_activity
20
+        set activity_status = 0
21
+        where
22
+        group_activity_id in (
23
+            select
24
+            group_activity_id
25
+            from
26
+            (
27
+            select
28
+            t.group_activity_id
29
+            from
30
+            ta_share_activity t
31
+            where
32
+            t.activity_status != '2'
33
+            and NOW() > t.start_time
34
+            and NOW() &lt; t.end_time
35
+            ) s
36
+        )
24 37
     </update>
25 38
 
26
-    <update id="updateEndGroupActivity">
27
-        update ta_share_activity t set t.activity_status = 2
28
-        where t.group_activity_id in
29
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
30
-            #{item}
31
-        </foreach>
39
+    <update id="updateProcessGroupActivity">
40
+        update ta_share_activity
41
+        set activity_status = 2
42
+        where
43
+	    group_activity_id in (
44
+            select
45
+                group_activity_id
46
+            from
47
+                (
48
+                    select
49
+                        t.group_activity_id
50
+                    from
51
+                        ta_share_activity t
52
+                    where
53
+                        t.activity_status != '2'
54
+                    and NOW() > t.end_time
55
+                ) s
56
+	    )
32 57
     </update>
33 58
 
34 59
     <select id="calParticipateNum" resultType="java.lang.Integer">

+ 9
- 5
src/main/resources/mapper/TaShareChildRecordMapper.xml ファイルの表示

@@ -3,11 +3,15 @@
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaShareChildRecordMapper">
4 4
 
5 5
     <update id="updateEndGroupActivity">
6
-        update ta_share_child_record t set t.status = 2
7
-        where t.group_activity_id in
8
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
9
-            #{item}
10
-        </foreach>
6
+        update ta_share_child_record a
7
+        set a.`status` = '2'
8
+        where a.group_activity_id in (
9
+            select
10
+                    t.group_activity_id
11
+                from
12
+                    ta_share_activity t
13
+                where (NOW() > t.end_time or t.activity_status = '2')
14
+        ) and a.`status` = '1';
11 15
     </update>
12 16
 
13 17
     <select id="getList" resultType="com.huiju.estateagents.entity.TaShareChildRecord">

+ 11
- 5
src/main/resources/mapper/TaShareRecordMapper.xml ファイルの表示

@@ -3,11 +3,17 @@
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaShareRecordMapper">
4 4
 
5 5
     <update id="updateEndGroupActivity">
6
-        update ta_share_record t set t.status = 2
7
-        where t.group_activity_id in
8
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
9
-            #{item}
10
-        </foreach>
6
+        update ta_share_record a
7
+        set a.`status` = '2'
8
+        where
9
+            a.group_activity_id in (
10
+                select
11
+                    t.group_activity_id
12
+                from
13
+                    ta_share_activity t
14
+                where (NOW() > t.end_time or t.activity_status = '2')
15
+            )
16
+        and a.`status` = '1';
11 17
     </update>
12 18
 
13 19
     <select id="recordSuccessList" resultType="com.huiju.estateagents.entity.TaShareRecord">