Browse Source

Merge remote-tracking branch 'origin/dev' into dev

顾绍勇 5 years ago
parent
commit
3d625e2974

+ 26
- 0
src/main/java/com/huiju/estateagents/controller/TaLiveActivityController.java View File

1
 package com.huiju.estateagents.controller;
1
 package com.huiju.estateagents.controller;
2
 
2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.huiju.estateagents.base.BaseController;
5
 import com.huiju.estateagents.base.BaseController;
5
 import com.huiju.estateagents.base.ResponseBean;
6
 import com.huiju.estateagents.base.ResponseBean;
7
+import com.huiju.estateagents.common.CommConstant;
8
+import com.huiju.estateagents.entity.ExtendContent;
6
 import com.huiju.estateagents.entity.TaLiveActivity;
9
 import com.huiju.estateagents.entity.TaLiveActivity;
10
+import com.huiju.estateagents.service.IExtendContentService;
7
 import com.huiju.estateagents.service.ITaLiveActivityService;
11
 import com.huiju.estateagents.service.ITaLiveActivityService;
8
 import org.slf4j.Logger;
12
 import org.slf4j.Logger;
9
 import org.slf4j.LoggerFactory;
13
 import org.slf4j.LoggerFactory;
11
 import org.springframework.web.bind.annotation.*;
15
 import org.springframework.web.bind.annotation.*;
12
 
16
 
13
 import javax.servlet.http.HttpServletRequest;
17
 import javax.servlet.http.HttpServletRequest;
18
+import java.time.LocalDateTime;
14
 import java.util.List;
19
 import java.util.List;
15
 
20
 
16
 /**
21
 /**
30
     @Autowired
35
     @Autowired
31
     public ITaLiveActivityService iTaLiveActivityService;
36
     public ITaLiveActivityService iTaLiveActivityService;
32
 
37
 
38
+    @Autowired
39
+    public IExtendContentService iExtendContentService;
40
+
33
     /**
41
     /**
34
      * 分页查询列表
42
      * 分页查询列表
35
      *
43
      *
115
         ResponseBean responseBean = new ResponseBean();
123
         ResponseBean responseBean = new ResponseBean();
116
         try {
124
         try {
117
             taLiveActivity.setLiveActivityId(id);
125
             taLiveActivity.setLiveActivityId(id);
126
+            QueryWrapper<ExtendContent> queryWrapper = new QueryWrapper<>();
127
+            queryWrapper.eq("org_id",taLiveActivity.getOrgId());
128
+            queryWrapper.eq("content_type",CommConstant.LIVE);
129
+            queryWrapper.eq("target_id",taLiveActivity.getLiveActivityId());
130
+            List<ExtendContent> list = iExtendContentService.list(queryWrapper);
131
+            if (CommConstant.NOT_PUBLISH.equals(taLiveActivity.getStatus())){
132
+                list.forEach(e -> {
133
+                    e.setStatus(CommConstant.NOT_PUBLISH);
134
+                });
135
+            }else{
136
+                list.forEach(e -> {
137
+                    e.setStatus(CommConstant.IS_PUBLISH);
138
+                });
139
+            }
140
+            if (list.size() > 0){
141
+                iExtendContentService.updateBatchById(list);
142
+            }
143
+
118
             if (iTaLiveActivityService.updateById(taLiveActivity)) {
144
             if (iTaLiveActivityService.updateById(taLiveActivity)) {
119
                 responseBean.addSuccess(taLiveActivity);
145
                 responseBean.addSuccess(taLiveActivity);
120
             } else {
146
             } else {

+ 3
- 2
src/main/java/com/huiju/estateagents/entity/TaLiveActivity.java View File

93
     /**
93
     /**
94
      * 状态
94
      * 状态
95
      */
95
      */
96
+
96
     private Integer status;
97
     private Integer status;
97
 
98
 
98
     /**
99
     /**
103
     /**
104
     /**
104
      * 直播开始时间
105
      * 直播开始时间
105
      */
106
      */
106
-    private LocalDateTime liveStartDate;
107
+    private String liveStartDate;
107
 
108
 
108
     /**
109
     /**
109
      * 直播结束时间
110
      * 直播结束时间
110
      */
111
      */
111
-    private LocalDateTime liveEndDate;
112
+    private String liveEndDate;
112
 
113
 
113
     /**
114
     /**
114
      * 创建时间
115
      * 创建时间

+ 2
- 1
src/main/resources/mapper/TaLiveActivityMapper.xml View File

26
      left join ta_building a on t.building_id = a.building_id
26
      left join ta_building a on t.building_id = a.building_id
27
      LEFT JOIN td_city b on t.city_id = b.id
27
      LEFT JOIN td_city b on t.city_id = b.id
28
      where t.org_id = #{orgId} and t.status != -1
28
      where t.org_id = #{orgId} and t.status != -1
29
-     <if test="status != null and status != ''">
29
+     <if test="status != null">
30
          and t.status = #{status}
30
          and t.status = #{status}
31
      </if>
31
      </if>
32
      <if test="liveActivityTitle != null and liveActivityTitle != ''">
32
      <if test="liveActivityTitle != null and liveActivityTitle != ''">
37
      </if><if test="buildingId != null and buildingId != ''">
37
      </if><if test="buildingId != null and buildingId != ''">
38
          and t.building_id = #{buildingId}
38
          and t.building_id = #{buildingId}
39
     </if>
39
     </if>
40
+        order by t.weight desc
40
     </select>
41
     </select>
41
 
42
 
42
 </mapper>
43
 </mapper>