魏超 5 years ago
parent
commit
ff5915b015

+ 8
- 4
src/main/java/com/huiju/estateagents/job/JudglActivityTimeJob.java View File

@@ -53,15 +53,17 @@ public class JudglActivityTimeJob extends BaseController {
53 53
      */
54 54
     @Scheduled(cron = "* 0/5 * * * ?")
55 55
     private void configureTasks() {
56
+        String time = DateUtils.cutSecond(LocalDateTime.now());
56 57
 
58
+        //判断活动是否开始
59
+        iTaBuildingDynamicService.updateActivityToUnStart(time);
57 60
         //未开始活动更新为已开始
58
-        String time = DateUtils.cutSecond(LocalDateTime.now());
59
-        Integer count = iTaBuildingDynamicService.updateUnStartActivity(time);
60
-        System.out.println("count" + count);
61
-        logger.debug("JudglActivityTimeJob",count);
61
+        iTaBuildingDynamicService.updateUnStartActivity(time);
62 62
         //进行中活动更新为已结束
63 63
         iTaBuildingDynamicService.updateProcessingActivity();
64 64
 
65
+        //判断拼团活动是否开始
66
+        iTaShareActivityService.updateActivityToUnStart();
65 67
         //未开始拼团活动更新为已开始
66 68
         iTaShareActivityService.updateUnStartGroupActivity();
67 69
         //进行中拼团活动更新为已结束
@@ -71,6 +73,8 @@ public class JudglActivityTimeJob extends BaseController {
71 73
         iTaShareRecordService.updateActivityProcessToEnd();
72 74
         iTaShareChildRecordService.updateActivityProcessToEnd();
73 75
 
76
+        //判断助力活动是否开始
77
+        iHelpActivityService.updateActivityToUnStart();
74 78
         //未开始助力活动更新为已开始
75 79
         iHelpActivityService.updateUnStartHelpActivity();
76 80
         //进行中助力活动更新为已结束

+ 2
- 0
src/main/java/com/huiju/estateagents/mapper/HelpActivityMapper.java View File

@@ -33,6 +33,8 @@ 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 updateActivityToUnStart();
37
+
36 38
     void updateUnStartHelpActivity();
37 39
 
38 40
     void updateProcessingHelpActivity();

+ 5
- 0
src/main/java/com/huiju/estateagents/mapper/TaBuildingDynamicMapper.java View File

@@ -72,6 +72,11 @@ public interface TaBuildingDynamicMapper extends BaseMapper<TaBuildingDynamic> {
72 72
      */
73 73
     Map<String, Object> selectBuildingDynamicEnlistStatistical(@Param("orgId") Integer orgId);
74 74
 
75
+    /**
76
+     * 更新未开始的活动
77
+     */
78
+    Integer updateActivityToUnStart(@Param("curTime") String curTime);
79
+
75 80
     /**
76 81
      * 更新未开始的活动
77 82
      */

+ 2
- 0
src/main/java/com/huiju/estateagents/mapper/TaShareActivityMapper.java View File

@@ -20,6 +20,8 @@ import java.util.List;
20 20
 public interface TaShareActivityMapper extends BaseMapper<TaShareActivity> {
21 21
     TaShareActivity selectTaShareActivityById(@Param("activityId")Integer activityId);
22 22
 
23
+    void updateActivityToUnStart();
24
+
23 25
     void updateUnStartGroupActivity();
24 26
 
25 27
     void updateProcessGroupActivity();

+ 5
- 0
src/main/java/com/huiju/estateagents/service/IHelpActivityService.java View File

@@ -115,6 +115,11 @@ public interface IHelpActivityService extends IService<HelpActivity> {
115 115
      */
116 116
     List<HelpRecordExport> getHelpRecordExportList(int i, Integer pageSize, Integer helpRecordInitiateId);
117 117
 
118
+    /**
119
+     * 未开始的助力活动
120
+     */
121
+    void updateActivityToUnStart();
122
+
118 123
     /**
119 124
      * 开始助力活动
120 125
      */

+ 5
- 0
src/main/java/com/huiju/estateagents/service/ITaBuildingDynamicService.java View File

@@ -87,6 +87,11 @@ public interface ITaBuildingDynamicService extends IService<TaBuildingDynamic> {
87 87
 
88 88
     void setExtendInfo(TaBuildingDynamic taBuildingDynamic, TaPerson taPerson);
89 89
 
90
+    /**
91
+     * 判断活动是否开始
92
+     */
93
+    Integer updateActivityToUnStart(String time);
94
+
90 95
     /**
91 96
      * 开始未进行的活动
92 97
      */

+ 5
- 0
src/main/java/com/huiju/estateagents/service/ITaShareActivityService.java View File

@@ -19,6 +19,11 @@ public interface ITaShareActivityService extends IService<TaShareActivity> {
19 19
 
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
+    /**
23
+     * 判断活动是否开始
24
+     */
25
+    void updateActivityToUnStart();
26
+
22 27
     /**
23 28
      * 活动未开始更新为进行中
24 29
      */

+ 5
- 0
src/main/java/com/huiju/estateagents/service/impl/HelpActivityServiceImpl.java View File

@@ -196,6 +196,11 @@ public class HelpActivityServiceImpl extends ServiceImpl<HelpActivityMapper, Hel
196 196
         return lsit;
197 197
     }
198 198
 
199
+    @Override
200
+    public void updateActivityToUnStart() {
201
+        taHelpActivityMapper.updateActivityToUnStart();
202
+    }
203
+
199 204
     @Override
200 205
     public void updateUnStartHelpActivity() {
201 206
         taHelpActivityMapper.updateUnStartHelpActivity();

+ 5
- 0
src/main/java/com/huiju/estateagents/service/impl/TaBuildingDynamicServiceImpl.java View File

@@ -331,6 +331,11 @@ public class TaBuildingDynamicServiceImpl extends ServiceImpl<TaBuildingDynamicM
331 331
         timeCondition(taBuildingDynamic);
332 332
     }
333 333
 
334
+    @Override
335
+    public Integer updateActivityToUnStart(String time) {
336
+        return buildingDynamicMapper.updateActivityToUnStart(time);
337
+    }
338
+
334 339
     @Override
335 340
     public Integer updateUnStartActivity(String curTime) {
336 341
         return buildingDynamicMapper.updateUnStartActivity(curTime);

+ 5
- 0
src/main/java/com/huiju/estateagents/service/impl/TaShareActivityServiceImpl.java View File

@@ -64,6 +64,11 @@ public class TaShareActivityServiceImpl extends ServiceImpl<TaShareActivityMappe
64 64
         return responseBean;
65 65
     }
66 66
 
67
+    @Override
68
+    public void updateActivityToUnStart() {
69
+        taShareActivityMapper.updateActivityToUnStart();
70
+    }
71
+
67 72
     @Override
68 73
     public void updateUnStartGroupActivity() {
69 74
         taShareActivityMapper.updateUnStartGroupActivity();

+ 8
- 2
src/main/resources/mapper/HelpActivityMapper.xml View File

@@ -37,6 +37,13 @@
37 37
                   ha.start_date asc
38 38
     </select>
39 39
 
40
+    <update id="updateActivityToUnStart">
41
+        update ta_help_activity
42
+        set activity_status = 1
43
+        where
44
+        NOW() &lt;= start_date  and activity_status != 2
45
+    </update>
46
+
40 47
     <update id="updateUnStartHelpActivity">
41 48
         update ta_help_activity t
42 49
         set activity_status = 0
@@ -48,8 +55,7 @@
48 55
         update ta_help_activity t
49 56
         set activity_status = 2
50 57
         where
51
-             t.activity_status != '2'
52
-                        and NOW() > t.end_date
58
+        t.activity_status != '2' and NOW() > t.end_date
53 59
     </update>
54 60
 
55 61
     <select id="selectWxhelpActivityAndGroup" resultType="com.huiju.estateagents.entity.HelpActivity">

+ 9
- 2
src/main/resources/mapper/TaBuildingDynamicMapper.xml View File

@@ -95,18 +95,25 @@
95 95
         where dynamic_id = #{dynamicId,jdbcType=VARCHAR}
96 96
     </update>
97 97
 
98
+    <update id="updateActivityToUnStart">
99
+        update ta_building_dynamic
100
+        set activity_status = 1
101
+        where
102
+        #{curTime} &lt;= enlist_start  and activity_status != 2
103
+    </update>
104
+
98 105
     <update id="updateUnStartActivity">
99 106
         update ta_building_dynamic
100 107
         set activity_status = 0
101 108
         where
102
-        #{curTime} &gt;= enlist_start and  #{curTime} &lt;= enlist_end and activity_status = 1
109
+        #{curTime} &gt;= enlist_start and  #{curTime} &lt;= enlist_end and  activity_status != 2
103 110
     </update>
104 111
 
105 112
     <update id="updateProcessingActivity">
106 113
         update ta_building_dynamic
107 114
         set activity_status = 2
108 115
         where
109
-        activity_status =0 and NOW() >= end_date
116
+        NOW() > enlist_end and activity_status  != 2
110 117
     </update>
111 118
 
112 119
     <select id="updateTaBuildingDynamic">

+ 10
- 16
src/main/resources/mapper/TaShareActivityMapper.xml View File

@@ -15,31 +15,25 @@
15 15
         from ta_share_activity t where t.group_activity_id = #{activityId}
16 16
     </select>
17 17
 
18
+    <update id="updateActivityToUnStart">
19
+      update ta_share_activity
20
+      set activity_status = 1
21
+      where
22
+      #{curTime} &lt; start_time and activity_status != 2
23
+    </update>
24
+
18 25
     <update id="updateUnStartGroupActivity">
19 26
         update ta_share_activity t
20 27
         set activity_status = 0
21
-        where t.activity_status != '2'
22
-            and NOW() BETWEEN t.start_time and t.end_time
28
+        where
29
+        t.activity_status != '2' and NOW() BETWEEN t.start_time and t.end_time
23 30
     </update>
24 31
 
25 32
     <update id="updateProcessGroupActivity">
26 33
         update ta_share_activity
27 34
         set activity_status = 2
28 35
         where
29
-	    group_activity_id in (
30
-            select
31
-                group_activity_id
32
-            from
33
-                (
34
-                    select
35
-                        t.group_activity_id
36
-                    from
37
-                        ta_share_activity t
38
-                    where
39
-                        t.activity_status != '2'
40
-                    and NOW() > t.end_time
41
-                ) s
42
-	    )
36
+	    NOW() > end_time and activity_status  != 2
43 37
     </update>
44 38
 
45 39
     <select id="calParticipateNum" resultType="java.lang.Integer">