顾绍勇 5 년 전
부모
커밋
7757119250

+ 5
- 0
src/main/java/com/huiju/estateagents/common/DateUtils.java 파일 보기

29
         return LocalDateTime.now().format(formatter);
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
     public static LocalDateTime day2LocalDateime(String day) {
37
     public static LocalDateTime day2LocalDateime(String day) {
33
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
38
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
34
         return LocalDateTime.parse(day + " 00:00:00", df);
39
         return LocalDateTime.parse(day + " 00:00:00", df);

+ 6
- 1
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java 파일 보기

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

+ 1
- 1
src/main/java/com/huiju/estateagents/entity/TaPreselectionRecord.java 파일 보기

43
     /**
43
     /**
44
      * 更新时间
44
      * 更新时间
45
      */
45
      */
46
-    private String updateDate;
46
+    private LocalDateTime updateDate;
47
 
47
 
48
     /**
48
     /**
49
      * 房源id
49
      * 房源id

+ 2
- 1
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java 파일 보기

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

+ 1
- 0
src/main/java/com/huiju/estateagents/service/impl/TaRaiseRecordServiceImpl.java 파일 보기

224
         taRaiseRecord.setPayStatus(CommConstant.PAY_STATUS_UNPAID);
224
         taRaiseRecord.setPayStatus(CommConstant.PAY_STATUS_UNPAID);
225
         taRaiseRecord.setPayType(CommConstant.PAY_TYPE_ONLINE);
225
         taRaiseRecord.setPayType(CommConstant.PAY_TYPE_ONLINE);
226
         taRaiseRecord.setCreateDate(LocalDateTime.now());
226
         taRaiseRecord.setCreateDate(LocalDateTime.now());
227
+        taRaiseRecord.setUpdateDate(LocalDateTime.now());
227
         //插入认筹单信息
228
         //插入认筹单信息
228
         taRaiseRecordMapper.insert(taRaiseRecord);
229
         taRaiseRecordMapper.insert(taRaiseRecord);
229
 
230
 

+ 8
- 3
src/main/resources/mapper/TaHousingResourcesMapper.xml 파일 보기

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