dingxin 5 years ago
parent
commit
ababa857fe

+ 1
- 1
pom.xml View File

10
 	</parent>
10
 	</parent>
11
 	<groupId>com.huiju</groupId>
11
 	<groupId>com.huiju</groupId>
12
 	<artifactId>estateagents</artifactId>
12
 	<artifactId>estateagents</artifactId>
13
-	<version>v3.5</version>
13
+	<version>v3.5.1</version>
14
 	<name>estateages</name>
14
 	<name>estateages</name>
15
 	<description>置业经纪人</description>
15
 	<description>置业经纪人</description>
16
 
16
 

+ 2
- 1
src/main/java/com/huiju/estateagents/controller/HelpActivityController.java View File

142
     public ResponseBean helpActivityEffectiveList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
142
     public ResponseBean helpActivityEffectiveList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
143
                                          @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
143
                                          @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
144
                                          @RequestParam(value = "cityId", required = false) Integer cityId,
144
                                          @RequestParam(value = "cityId", required = false) Integer cityId,
145
+                                         @RequestParam(value = "buildingId", required = false) String buildingId,
145
                                          HttpServletRequest request) {
146
                                          HttpServletRequest request) {
146
         Integer orgId = getOrgId(request);
147
         Integer orgId = getOrgId(request);
147
-        ResponseBean helpActivityList = taHelpActivityService.helpActivityEffectiveList(pageNum, pageSize, cityId, orgId);
148
+        ResponseBean helpActivityList = taHelpActivityService.helpActivityEffectiveList(pageNum, pageSize, cityId, orgId, buildingId);
148
         return helpActivityList;
149
         return helpActivityList;
149
     }
150
     }
150
 
151
 

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

54
      * @param orgId
54
      * @param orgId
55
      * @return
55
      * @return
56
      */
56
      */
57
-    IPage<HelpActivity> helpActivityListEffectivePage(IPage<HelpActivity> pg, Integer cityId, Integer orgId);
57
+    IPage<HelpActivity> helpActivityListEffectivePage(IPage<HelpActivity> pg, Integer cityId, Integer orgId, String buildingId);
58
 }
58
 }

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

145
      * @param orgId
145
      * @param orgId
146
      * @return
146
      * @return
147
      */
147
      */
148
-    ResponseBean helpActivityEffectiveList(Integer pageNum, Integer pageSize, Integer cityId, Integer orgId);
148
+    ResponseBean helpActivityEffectiveList(Integer pageNum, Integer pageSize, Integer cityId, Integer orgId, String buildingId);
149
 }
149
 }

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

221
     }
221
     }
222
 
222
 
223
     @Override
223
     @Override
224
-    public ResponseBean helpActivityEffectiveList(Integer pageNum, Integer pageSize, Integer cityId, Integer orgId) {
224
+    public ResponseBean helpActivityEffectiveList(Integer pageNum, Integer pageSize, Integer cityId, Integer orgId, String buildingId) {
225
         ResponseBean responseBean = new ResponseBean<>();
225
         ResponseBean responseBean = new ResponseBean<>();
226
         IPage<HelpActivity> pg = new Page<>(pageNum, pageSize);
226
         IPage<HelpActivity> pg = new Page<>(pageNum, pageSize);
227
-        IPage<HelpActivity> result = taHelpActivityMapper.helpActivityListEffectivePage(pg, cityId, orgId);
227
+        IPage<HelpActivity> result = taHelpActivityMapper.helpActivityListEffectivePage(pg, cityId, orgId, buildingId);
228
         responseBean.addSuccess(result);
228
         responseBean.addSuccess(result);
229
         return responseBean;
229
         return responseBean;
230
     }
230
     }

+ 1
- 3
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java View File

98
                 queryWrapper.eq("building_id", taBuilding.getBuildingId());
98
                 queryWrapper.eq("building_id", taBuilding.getBuildingId());
99
                 queryWrapper.eq("img_type", "banner");
99
                 queryWrapper.eq("img_type", "banner");
100
                 queryWrapper.orderByAsc("create_date");
100
                 queryWrapper.orderByAsc("create_date");
101
+
101
                 List<TaBuildingImg> buildingImg = taBuildingImgMapper.selectList(queryWrapper);
102
                 List<TaBuildingImg> buildingImg = taBuildingImgMapper.selectList(queryWrapper);
102
                 taBuilding.setBuildingImg(buildingImg);
103
                 taBuilding.setBuildingImg(buildingImg);
103
             }
104
             }
322
         String imgStr = object.getString("img");
323
         String imgStr = object.getString("img");
323
         List<TaBuildingImg> buildingImgs = JSONObject.parseArray(imgStr, TaBuildingImg.class);
324
         List<TaBuildingImg> buildingImgs = JSONObject.parseArray(imgStr, TaBuildingImg.class);
324
 
325
 
325
-//        building.setOpeningDate(DateUtils.date2LocalDateTime(object.getDate("openingDate")));
326
-//        building.setCreateDate(LocalDateTime.now());
327
-//        building.setStatus(0);
328
         if (CollectionUtils.isNotEmpty(buildingImgs)) {
326
         if (CollectionUtils.isNotEmpty(buildingImgs)) {
329
             insertImgBatch(buildingImgs, building.getBuildingId());
327
             insertImgBatch(buildingImgs, building.getBuildingId());
330
         }
328
         }

+ 3
- 0
src/main/resources/mapper/HelpActivityMapper.xml View File

111
             <if test="cityId != null and cityId != ''">
111
             <if test="cityId != null and cityId != ''">
112
                 and ha.city_id = #{cityId}
112
                 and ha.city_id = #{cityId}
113
             </if>
113
             </if>
114
+            <if test="buildingId != null">
115
+                and building_id = #{buildingId}
116
+            </if>
114
             and ha.org_id=#{orgId}
117
             and ha.org_id=#{orgId}
115
             and ha.activity_status in (0, 1)
118
             and ha.activity_status in (0, 1)
116
         </where>
119
         </where>

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

4
     <select id="buildingList" resultType="com.huiju.estateagents.entity.TaBuilding">
4
     <select id="buildingList" resultType="com.huiju.estateagents.entity.TaBuilding">
5
         SELECT * FROM ta_building
5
         SELECT * FROM ta_building
6
         <where>
6
         <where>
7
-            status > -1
7
+            status > 0
8
             <if test="Name != null and Name != ''">
8
             <if test="Name != null and Name != ''">
9
                 and  (ta_building.name like concat('%',#{Name,jdbcType=VARCHAR},'%') or ta_building.building_name like concat('%',#{Name,jdbcType=VARCHAR},'%'))
9
                 and  (ta_building.name like concat('%',#{Name,jdbcType=VARCHAR},'%') or ta_building.building_name like concat('%',#{Name,jdbcType=VARCHAR},'%'))
10
             </if>
10
             </if>
30
                 and  ta_building.org_id = #{orgId}
30
                 and  ta_building.org_id = #{orgId}
31
             </if>
31
             </if>
32
         </where>
32
         </where>
33
-        ORDER BY create_date DESC
33
+        ORDER BY status ASC, create_date DESC
34
     </select>
34
     </select>
35
 
35
 
36
     <select id="buildingListSelect" resultType="com.huiju.estateagents.entity.TaBuilding">
36
     <select id="buildingListSelect" resultType="com.huiju.estateagents.entity.TaBuilding">

+ 5
- 5
src/main/resources/mapper/TaPersonMapper.xml View File

418
         FROM
418
         FROM
419
         (
419
         (
420
             SELECT
420
             SELECT
421
-            DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date,
421
+            DATE_FORMAT( DATE_SUB( <if test="endDate != null">#{endDate}</if><if test="endDate == null">now()</if>, INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date,
422
             tempf.from_name as from_name,
422
             tempf.from_name as from_name,
423
             tempf.from_code as from_code
423
             tempf.from_code as from_code
424
             FROM
424
             FROM
438
         (
438
         (
439
             SELECT
439
             SELECT
440
                 ifnull(COUNT(1), 0) as count,
440
                 ifnull(COUNT(1), 0) as count,
441
-                tps.create_date as create_date,
441
+                DATE_FORMAT( tps.create_date, '%Y-%m-%d' ) as create_date,
442
                 tpfs.from_code as from_code,
442
                 tpfs.from_code as from_code,
443
                 tpfs.from_name as from_name
443
                 tpfs.from_name as from_name
444
             FROM ta_person tps
444
             FROM ta_person tps
449
             and tps.person_type IN ('customer','drift','estate agent')
449
             and tps.person_type IN ('customer','drift','estate agent')
450
             AND tps.create_date BETWEEN #{startDate} AND #{endDate}
450
             AND tps.create_date BETWEEN #{startDate} AND #{endDate}
451
 
451
 
452
-            GROUP BY tpfs.from_code
452
+            GROUP BY tpfs.from_code, DATE_FORMAT( tps.create_date, '%Y-%m-%d' )
453
         ) as user_count
453
         ) as user_count
454
         ON DATE_FORMAT(user_count.create_date,'%Y-%m-%d') =  temp_date.date and temp_date.from_code = user_count.from_code
454
         ON DATE_FORMAT(user_count.create_date,'%Y-%m-%d') =  temp_date.date and temp_date.from_code = user_count.from_code
455
         LEFT JOIN
455
         LEFT JOIN
456
         (
456
         (
457
             SELECT
457
             SELECT
458
                 ifnull(COUNT(1), 0) as count,
458
                 ifnull(COUNT(1), 0) as count,
459
-                tps.create_date as create_date,
459
+                DATE_FORMAT( tps.create_date, '%Y-%m-%d' ) as create_date,
460
                 tpfs.from_code as from_code,
460
                 tpfs.from_code as from_code,
461
                 tpfs.from_name as from_name
461
                 tpfs.from_name as from_name
462
             FROM ta_person tps
462
             FROM ta_person tps
467
                 and tps.person_type IN ('customer','drift','estate agent')
467
                 and tps.person_type IN ('customer','drift','estate agent')
468
                 AND tps.create_date BETWEEN #{startDate} AND #{endDate}
468
                 AND tps.create_date BETWEEN #{startDate} AND #{endDate}
469
                 and tps.phone is not null
469
                 and tps.phone is not null
470
-            GROUP BY tpfs.from_code
470
+            GROUP BY tpfs.from_code,DATE_FORMAT( tps.create_date, '%Y-%m-%d' )
471
         ) as registered_count
471
         ) as registered_count
472
         ON DATE_FORMAT(user_count.create_date,'%Y-%m-%d') =  temp_date.date and temp_date.from_code = registered_count.from_code
472
         ON DATE_FORMAT(user_count.create_date,'%Y-%m-%d') =  temp_date.date and temp_date.from_code = registered_count.from_code
473
         order by temp_date.date DESC
473
         order by temp_date.date DESC