魏熙美 5 yıl önce
ebeveyn
işleme
aa734dca7c

+ 33
- 2
src/main/java/com/huiju/estateagents/controller/HelpActivityController.java Dosyayı Görüntüle

@@ -110,7 +110,7 @@ public class HelpActivityController extends BaseController {
110 110
             @ApiImplicitParam(dataTypeClass = String.class, name = "endDate", paramType = "query", value = "活动结束时间"),
111 111
             @ApiImplicitParam(dataTypeClass = Integer.class, name = "activityStatus", paramType = "query", value = "活动状态")
112 112
     })
113
-    @RequestMapping(value = "admin/helpActivity/list", method = RequestMethod.GET)
113
+    @RequestMapping(value = "/admin/helpActivity/list", method = RequestMethod.GET)
114 114
     public ResponseBean helpActivityList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
115 115
                                          @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
116 116
                                          @RequestParam(value = "cityId", required = false) Integer cityId,
@@ -125,11 +125,42 @@ public class HelpActivityController extends BaseController {
125 125
         return helpActivityList;
126 126
     }
127 127
 
128
+    /**
129
+     * 活动助力列表
130
+     *
131
+     * @param pageNum
132
+     * @param pageSize
133
+     * @return
134
+     */
135
+    @ApiOperation(value = "活动助力列表 已开始 和 未开始", notes = "活动助力列表 已开始 和 未开始")
136
+    @ApiImplicitParams({
137
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageNum", paramType = "query", value = "第几页"),
138
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageSize", paramType = "query", value = "一页多少行"),
139
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "cityId", paramType = "query", value = "城市"),
140
+            @ApiImplicitParam(dataTypeClass = String.class, name = "buildingId", paramType = "query", value = "项目"),
141
+            @ApiImplicitParam(dataTypeClass = String.class, name = "title", paramType = "query", value = "标题"),
142
+            @ApiImplicitParam(dataTypeClass = String.class, name = "startDate", paramType = "query", value = "活动开始时间"),
143
+            @ApiImplicitParam(dataTypeClass = String.class, name = "endDate", paramType = "query", value = "活动结束时间")
144
+    })
145
+    @RequestMapping(value = "/admin/helpActivityEffective/list", method = RequestMethod.GET)
146
+    public ResponseBean helpActivityEffectiveList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
147
+                                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
148
+                                         @RequestParam(value = "cityId", required = false) Integer cityId,
149
+                                         @RequestParam(value = "buildingId", required = false) String buildingId,
150
+                                         @RequestParam(value = "title", required = false) String title,
151
+                                         @RequestParam(value = "startDate", required = false) String startDate,
152
+                                         @RequestParam(value = "endDate", required = false) String endDate,
153
+                                         HttpServletRequest request) {
154
+        Integer orgId = getOrgId(request);
155
+        ResponseBean helpActivityList = taHelpActivityService.helpActivityEffectiveList(pageNum, pageSize, cityId, buildingId, title, startDate, endDate, orgId);
156
+        return helpActivityList;
157
+    }
158
+
128 159
     @ApiOperation(value = "活动助力新增", notes = "活动助力新增")
129 160
     @ApiImplicitParams({
130 161
             @ApiImplicitParam(dataType = "HelpActivity", name = "parameter", paramType = "body", value = "当前对象")
131 162
     })
132
-    @RequestMapping(value = "admin/helpActivity/add", method = RequestMethod.POST)
163
+    @RequestMapping(value = "/admin/helpActivity/add", method = RequestMethod.POST)
133 164
     public ResponseBean helpActivityAdd(@RequestBody String parameter, HttpServletRequest request) {
134 165
         HelpActivity helpActivity = JSONObject.parseObject(parameter, HelpActivity.class);
135 166
         ResponseBean responseBean = new ResponseBean();

+ 25
- 0
src/main/java/com/huiju/estateagents/controller/TaShareActivityController.java Dosyayı Görüntüle

@@ -97,6 +97,31 @@ public class TaShareActivityController extends BaseController {
97 97
         return responseBean;
98 98
     }
99 99
 
100
+
101
+    /**
102
+     * 分页查询列表 已开始 和 未开始
103
+     * @param pageNum
104
+     * @param pageSize
105
+     * @return
106
+     */
107
+    @RequestMapping(value="/admin/taShareActivityEffective/list",method= RequestMethod.GET)
108
+    public ResponseBean taShareActivityList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
109
+                                            @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
110
+                                            @RequestParam(value ="buildingId",required = false) String buildingId,
111
+                                            @RequestParam(value ="activityName",required = false) String activityName,
112
+                                            @RequestParam(value ="cityId",required = false)Integer cityId,
113
+                                            HttpServletRequest request){
114
+        ResponseBean responseBean = new ResponseBean();
115
+        try {
116
+            responseBean = iTaShareActivityService.getEffectiveList(pageNum, pageSize, buildingId, activityName, null, null, cityId, getOrgId(request));
117
+        }catch (Exception e){
118
+            e.printStackTrace();
119
+            logger.error("taShareActivityList -=- {}",e.toString());
120
+            responseBean.addError(e.getMessage());
121
+        }
122
+        return responseBean;
123
+    }
124
+
100 125
     /**
101 126
      * 保存对象
102 127
      * @param parameter 实体对象json格式

+ 13
- 0
src/main/java/com/huiju/estateagents/mapper/HelpActivityMapper.java Dosyayı Görüntüle

@@ -43,4 +43,17 @@ public interface HelpActivityMapper extends BaseMapper<HelpActivity> {
43 43
      * @return
44 44
      */
45 45
     List<HelpActivity> selectWxhelpActivityAndGroup(Integer orgId);
46
+
47
+    /**
48
+     * 列表 已开始 和 未开始
49
+     * @param pg
50
+     * @param cityId
51
+     * @param buildingId
52
+     * @param title
53
+     * @param startDate
54
+     * @param endDate
55
+     * @param orgId
56
+     * @return
57
+     */
58
+    IPage<HelpActivity> helpActivityListEffectivePage(IPage<HelpActivity> pg, Integer cityId, String buildingId, String title, String startDate, String endDate, Integer orgId);
46 59
 }

+ 14
- 0
src/main/java/com/huiju/estateagents/service/IHelpActivityService.java Dosyayı Görüntüle

@@ -132,4 +132,18 @@ public interface IHelpActivityService extends IService<HelpActivity> {
132 132
      * @return
133 133
      */
134 134
     ResponseBean wxhelpActivityAndGroup(Integer orgId,Integer type,Integer buildingId);
135
+
136
+    /**
137
+     * 列表  已开始 和 未开始
138
+     * @param pageNum
139
+     * @param pageSize
140
+     * @param cityId
141
+     * @param buildingId
142
+     * @param title
143
+     * @param startDate
144
+     * @param endDate
145
+     * @param orgId
146
+     * @return
147
+     */
148
+    ResponseBean helpActivityEffectiveList(Integer pageNum, Integer pageSize, Integer cityId, String buildingId, String title, String startDate, String endDate, Integer orgId);
135 149
 }

+ 14
- 0
src/main/java/com/huiju/estateagents/service/ITaShareActivityService.java Dosyayı Görüntüle

@@ -30,4 +30,18 @@ public interface ITaShareActivityService extends IService<TaShareActivity> {
30 30
      * @param endGroupActivityId
31 31
      */
32 32
     void updateEndActivity(List<Integer> endGroupActivityId);
33
+
34
+    /**
35
+     * 查询拼团  已开始 和 未开始
36
+     * @param pageNum
37
+     * @param pageSize
38
+     * @param buildingId
39
+     * @param activityName
40
+     * @param startTime
41
+     * @param endTime
42
+     * @param cityId
43
+     * @param orgId
44
+     * @return
45
+     */
46
+    ResponseBean getEffectiveList(Integer pageNum, Integer pageSize, String buildingId, String activityName, LocalDateTime startTime, LocalDateTime endTime, Integer cityId, Integer orgId);
33 47
 }

+ 9
- 0
src/main/java/com/huiju/estateagents/service/impl/HelpActivityServiceImpl.java Dosyayı Görüntüle

@@ -236,4 +236,13 @@ public class HelpActivityServiceImpl extends ServiceImpl<HelpActivityMapper, Hel
236 236
         responseBean.addSuccess(HelpActivity);
237 237
         return responseBean;
238 238
     }
239
+
240
+    @Override
241
+    public ResponseBean helpActivityEffectiveList(Integer pageNum, Integer pageSize, Integer cityId, String buildingId, String title, String startDate, String endDate, Integer orgId) {
242
+        ResponseBean responseBean = new ResponseBean<>();
243
+        IPage<HelpActivity> pg = new Page<>(pageNum, pageSize);
244
+        IPage<HelpActivity> result = taHelpActivityMapper.helpActivityListEffectivePage(pg, cityId, buildingId, title, startDate, endDate, orgId);
245
+        responseBean.addSuccess(result);
246
+        return responseBean;
247
+    }
239 248
 }

+ 29
- 0
src/main/java/com/huiju/estateagents/service/impl/TaShareActivityServiceImpl.java Dosyayı Görüntüle

@@ -73,4 +73,33 @@ public class TaShareActivityServiceImpl extends ServiceImpl<TaShareActivityMappe
73 73
             taShareActivityMapper.updateEndGroupActivity(endGroupActivityId);
74 74
         }
75 75
     }
76
+
77
+    @Override
78
+    public ResponseBean getEffectiveList(Integer pageNum, Integer pageSize, String buildingId, String activityName, LocalDateTime startTime, LocalDateTime endTime, Integer cityId, Integer orgId) {
79
+        ResponseBean responseBean = new ResponseBean();
80
+        Page<TaShareActivity> page = new Page<>();
81
+        page.setSize(pageSize == null ? 10 : pageSize);
82
+        page.setCurrent(pageNum == null ? 1 : pageNum);
83
+
84
+        QueryWrapper<TaShareActivity> queryWrapper = new QueryWrapper<>();
85
+        queryWrapper.eq(buildingId != null, "building_id", buildingId);
86
+        queryWrapper.like(activityName != null, "activity_name", activityName);
87
+        queryWrapper.in("activity_status", 0, 1);
88
+        queryWrapper.eq(startTime != null, "start_time", startTime);
89
+        queryWrapper.eq(endTime != null, "end_time", endTime);
90
+        queryWrapper.eq(orgId != null, "org_id", orgId);
91
+        queryWrapper.eq(cityId != null, "city_id", cityId);
92
+        queryWrapper.orderByAsc("activity_status");
93
+        queryWrapper.orderByAsc("start_time");
94
+        IPage<TaShareActivity> taNewsIPage = this.page(page, queryWrapper);
95
+
96
+        List<TaShareActivity> taShareActivities = taNewsIPage.getRecords();
97
+        for (TaShareActivity taShareActivity : taShareActivities){
98
+            Integer participateNum = taShareActivityMapper.calParticipateNum(taShareActivity.getGroupActivityId());
99
+            taShareActivity.setParticipateNum(participateNum);
100
+        }
101
+        taNewsIPage.setRecords(taShareActivities);
102
+        responseBean.addSuccess(taNewsIPage);
103
+        return responseBean;
104
+    }
76 105
 }

+ 34
- 0
src/main/resources/mapper/HelpActivityMapper.xml Dosyayı Görüntüle

@@ -75,4 +75,38 @@
75 75
 					and org_id =#{orgId}
76 76
 			)
77 77
     </select>
78
+
79
+    <select id="helpActivityListEffectivePage" resultType="com.huiju.estateagents.entity.HelpActivity">
80
+        SELECT
81
+        COUNT(hir.verification) as succeedCount,
82
+        ha.*
83
+        FROM
84
+        ta_help_activity ha
85
+        LEFT JOIN ta_help_initiate_record hir ON ha.help_activity_id = hir.help_activity_id
86
+        AND (hir.verification is NULL or hir.verification != '')
87
+        <where>
88
+            <if test="cityId != null and cityId != ''">
89
+                and ha.city_id = #{cityId}
90
+            </if>
91
+            <if test="buildingId != null and buildingId != ''">
92
+                and ha.building_id = #{buildingId}
93
+            </if>
94
+            <if test="title != null and title != ''">
95
+                and ha.title like CONCAT('%',#{title}, '%')
96
+            </if>
97
+            <if test="startDate != null and startDate != ''and startDate!='Invalid date'">
98
+                and date_format(ha.start_date,'%Y-%m-%d') = date_format( #{startDate}, '%Y-%m-%d' )
99
+            </if>
100
+            <if test="endDate != null and endDate != ''and endDate!='Invalid date'">
101
+                and date_format(ha.end_date,'%Y-%m-%d') = date_format( #{endDate}, '%Y-%m-%d' )
102
+            </if>
103
+            and ha.org_id=#{orgId}
104
+            and ha.activity_status in (0, 1)
105
+        </where>
106
+        GROUP BY ha.help_activity_id
107
+        order by ha.activity_status = 0 desc,
108
+        ha.activity_status = 1 desc,
109
+        ha.activity_status = 2 desc,
110
+        ha.start_date asc
111
+    </select>
78 112
 </mapper>

+ 5
- 29
src/main/resources/mapper/TaRecommendCustomerMapper.xml Dosyayı Görüntüle

@@ -203,35 +203,11 @@ FROM
203 203
 	WHERE a.customer_id = #{customerId}
204 204
     </select>
205 205
 
206
-    <select id="getPublicCustomerList" resultType="com.huiju.estateagents.entity.TaPerson">
207
-        SELECT
208
-        b.*
209
-        FROM
210
-        ta_person b
211
-        <where>
212
-            b.status > 0
213
-            AND IFNULL(b.person_type, '') in ('estate agent', 'customer')
214
-            <if test="name != null and name !=''">
215
-                and b.nickname like CONCAT('%',#{name}, '%')
216
-            </if>
217
-            <if test="tel != null and tel!=''">
218
-                and b.phone like CONCAT('%',#{tel}, '%')
219
-            </if>
220
-            <if test="entryType != null and entryType !=''">
221
-                and b.entry_type = #{entryType}
222
-            </if>
223
-            <if test="sex != null and sex !=''">
224
-                and b.sex = #{sex}
225
-            </if>
226
-            <if test="orgId != null">
227
-                and b.org_id = #{orgId}
228
-            </if>
229
-            <if test="consultTel != null and consultTel !=''">
230
-                and b.tel like CONCAT('%',#{consultTel}, '%')
231
-            </if>
232
-            and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
233
-        </where>
234
-        order by b.create_date desc
206
+    <select id="getPublicCustomerList" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
207
+        select * from
208
+        ta_recommend_customer ta
209
+        WHERE (ta.realty_consultant is NULL OR ta.realty_consultant = '')
210
+        order by ta.create_date desc
235 211
     </select>
236 212
 
237 213
     <select id="getRecCustomerExport" resultType="com.huiju.estateagents.excel.ExcelRecommendCustomer">