顾绍勇 5 年之前
父節點
當前提交
7757119250

+ 5
- 0
src/main/java/com/huiju/estateagents/common/DateUtils.java 查看文件

@@ -29,6 +29,11 @@ public class DateUtils {
29 29
         return LocalDateTime.now().format(formatter);
30 30
     }
31 31
 
32
+    public static String localDateTimeToString(LocalDateTime d) {
33
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
34
+        return d.format(formatter);
35
+    }
36
+
32 37
     public static LocalDateTime day2LocalDateime(String day) {
33 38
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
34 39
         return LocalDateTime.parse(day + " 00:00:00", df);

+ 6
- 1
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java 查看文件

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 7
 import com.huiju.estateagents.base.BaseController;
8 8
 import com.huiju.estateagents.base.ResponseBean;
9 9
 import com.huiju.estateagents.bo.request.PresecretRecordRequestBO;
10
+import com.huiju.estateagents.common.DateUtils;
10 11
 import com.huiju.estateagents.entity.TaPreselectionRecord;
11 12
 import com.huiju.estateagents.service.ITaPreselectionRecordService;
12 13
 import org.apache.commons.lang3.StringUtils;
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
17 18
 import org.springframework.web.bind.annotation.*;
18 19
 
19 20
 import javax.servlet.http.HttpServletRequest;
21
+import java.time.LocalDateTime;
20 22
 import java.util.List;
21 23
 
22 24
 /**
@@ -132,9 +134,12 @@ public class TaPreselectionRecordController extends BaseController {
132 134
      */
133 135
     @RequestMapping(value = "/taPreselectionRecord/{id}", method = RequestMethod.PUT)
134 136
     public ResponseBean taPreselectionRecordUpdate(@PathVariable Integer id,
135
-                                                   @RequestBody TaPreselectionRecord taPreselectionRecord) {
137
+                                                   @RequestBody TaPreselectionRecord taPreselectionRecord,
138
+                                                   HttpServletRequest request) {
136 139
         ResponseBean responseBean = new ResponseBean();
137 140
         try {
141
+            taPreselectionRecord.setUpdateDate(LocalDateTime.now());
142
+            taPreselectionRecord.setUpdateUser(getUserId(request));
138 143
             if (iTaPreselectionRecordService.updateById(taPreselectionRecord)) {
139 144
                 responseBean.addSuccess(taPreselectionRecord);
140 145
             } else {

+ 1
- 1
src/main/java/com/huiju/estateagents/entity/TaPreselectionRecord.java 查看文件

@@ -43,7 +43,7 @@ public class TaPreselectionRecord implements Serializable {
43 43
     /**
44 44
      * 更新时间
45 45
      */
46
-    private String updateDate;
46
+    private LocalDateTime updateDate;
47 47
 
48 48
     /**
49 49
      * 房源id

+ 2
- 1
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java 查看文件

@@ -183,6 +183,7 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
183 183
         taPreselectionRecord.setSalesBatchId(resourcesPO.getSalesBatchId());
184 184
         taPreselectionRecord.setStatus(1);
185 185
         taPreselectionRecord.setCreateDate(LocalDateTime.now());
186
+        taPreselectionRecord.setUpdateDate(LocalDateTime.now());
186 187
         save(taPreselectionRecord);
187 188
 
188 189
         // 更新房源表热度
@@ -228,7 +229,7 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
228 229
         TaPreselectionRecord record = new TaPreselectionRecord();
229 230
         record.setPreselectionRecordId(preselectionRecord.getPreselectionRecordId());
230 231
         record.setStatus(0);
231
-        record.setUpdateDate(DateUtils.today());
232
+        record.setUpdateDate(LocalDateTime.now());
232 233
         updateById(record);
233 234
 
234 235
         // 更新房源表热度

+ 1
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRaiseRecordServiceImpl.java 查看文件

@@ -224,6 +224,7 @@ public class TaRaiseRecordServiceImpl extends ServiceImpl<TaRaiseRecordMapper, T
224 224
         taRaiseRecord.setPayStatus(CommConstant.PAY_STATUS_UNPAID);
225 225
         taRaiseRecord.setPayType(CommConstant.PAY_TYPE_ONLINE);
226 226
         taRaiseRecord.setCreateDate(LocalDateTime.now());
227
+        taRaiseRecord.setUpdateDate(LocalDateTime.now());
227 228
         //插入认筹单信息
228 229
         taRaiseRecordMapper.insert(taRaiseRecord);
229 230
 

+ 8
- 3
src/main/resources/mapper/TaHousingResourcesMapper.xml 查看文件

@@ -190,14 +190,16 @@
190 190
 
191 191
     <update id="updateForAddHeat" parameterType="java.lang.Integer">
192 192
         UPDATE ta_housing_resources t
193
-        SET t.real_heat = IFNULL(t.real_heat, 0) + 1
193
+        SET t.real_heat = IFNULL(t.real_heat, 0) + 1,
194
+            t.update_date = now()
194 195
         WHERE
195 196
             t.house_id = #{houseId}
196 197
     </update>
197 198
 
198 199
     <update id="updateForSubtractHeat" parameterType="java.lang.Integer">
199 200
         UPDATE ta_housing_resources t
200
-        SET t.real_heat = IFNULL(t.real_heat, 0) - 1
201
+        SET t.real_heat = IFNULL(t.real_heat, 0) - 1,
202
+            t.update_date = now()
201 203
         WHERE
202 204
             t.house_id = #{houseId}
203 205
             AND t.real_heat > 0
@@ -205,7 +207,8 @@
205 207
 
206 208
     <update id="updateForSubtractRaiseHeat" parameterType="java.lang.Integer">
207 209
         UPDATE ta_housing_resources t
208
-        SET t.raise_real_heat = IFNULL( t.raise_real_heat, 0 ) - 1
210
+        SET t.raise_real_heat = IFNULL( t.raise_real_heat, 0 ) - 1,
211
+            t.update_date = now()
209 212
         WHERE
210 213
             t.house_id IN ( SELECT tr.house_id FROM ta_raise_house tr WHERE tr.raise_record_id = #{raiseRecordId})
211 214
             AND t.raise_real_heat > 0
@@ -299,6 +302,8 @@
299 302
         <if test="actulEndHot != '' and actulEndHot != null">
300 303
             and t.real_heat &lt;= #{actulEndHot}
301 304
         </if>
305
+        ORDER BY
306
+            t.create_date DESC
302 307
     </select>
303 308
 
304 309
     <select id="selectHousingList" resultType="com.huiju.estateagents.entity.TaHousingResources">