dingxin 5 vuotta sitten
vanhempi
commit
ace275b967

+ 10
- 8
src/main/java/com/huiju/estateagents/controller/HelpActivityController.java Näytä tiedosto

@@ -133,7 +133,7 @@ public class HelpActivityController extends BaseController {
133 133
         helpActivity.setCityId(cityId);
134 134
         // 活动暂且定位为未开始
135 135
         helpActivity.setActivityStatus(1);
136
-        helpActivity.setStatus(0);
136
+        helpActivity.setStatus(1);
137 137
         helpActivity.setWeight(0);
138 138
         helpActivity.setIsMain(false);
139 139
         taHelpActivityService.helpActivityAdd(helpActivity, orgId);
@@ -235,14 +235,16 @@ public class HelpActivityController extends BaseController {
235 235
             @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageNum", paramType = "query", value = "第几页"),
236 236
             @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageSize", paramType = "query", value = "一页多少行"),
237 237
             @ApiImplicitParam(dataTypeClass = String.class, name = "helpActivityId", paramType = "query", value = "助力ID"),
238
+            @ApiImplicitParam(dataTypeClass = String.class, name = "tel", paramType = "query", value = "tel"),
238 239
             @ApiImplicitParam(dataTypeClass = Integer.class, name = "status", paramType = "query", value = "status: helpSucceed助力成功,helpUnderway进行中,helpUnfinished助力失败")
239 240
     })
240 241
     @RequestMapping(value = "admin/helpRecord", method = RequestMethod.GET)
241 242
     public ResponseBean helpRecord(@RequestParam(value = "helpActivityId", required = false) Integer helpActivityId,
242 243
                                    @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
243 244
                                    @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
244
-                                   @RequestParam(value = "status", required = false) String status) {
245
-        ResponseBean helpRecord = taHelpActivityService.helpRecord(helpActivityId, status, pageNum, pageSize);
245
+                                   @RequestParam(value = "status", required = false) String status,
246
+                                   @RequestParam(value = "tel", required = false) String tel) {
247
+        ResponseBean helpRecord = taHelpActivityService.helpRecord(helpActivityId, status, pageNum, pageSize,tel);
246 248
         return helpRecord;
247 249
     }
248 250
 
@@ -275,7 +277,7 @@ public class HelpActivityController extends BaseController {
275 277
     }
276 278
 
277 279
     /**
278
-     * 导出数据 客户列表 公客/私客
280
+     * 导出数据 成功/进行/失败
279 281
      *
280 282
      * @param request
281 283
      * @param response
@@ -286,7 +288,7 @@ public class HelpActivityController extends BaseController {
286 288
                                       HttpServletResponse response,
287 289
                                       @RequestParam(value = "tel", required = false) String tel,
288 290
                                       @RequestParam(value = "helpActivityId", required = false) Integer helpActivityId,
289
-                                      @RequestParam(value = "code", required = false) int code) throws IOException {
291
+                                      @RequestParam(value = "condition", required = false) String condition) throws IOException {
290 292
         //        response.setContentType("application/vnd.ms-excel");
291 293
         response.setContentType("application/octet-stream");
292 294
         response.setCharacterEncoding("utf-8");
@@ -303,8 +305,8 @@ public class HelpActivityController extends BaseController {
303 305
          * 助力活动发起者
304 306
          */
305 307
         // 设置读取的class
306
-
307
-        if (1==code){
308
+       // code:helpSucceed助力成功,helpUnderway进行中,helpUnfinished助力失败
309
+        if ("helpSucceed".equals(condition)){
308 310
             ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), HelpInitiateRecordSucceed.class).registerWriteHandler(new CustomCellWriteHandler()).build();
309 311
             // 设置 sheet, 同一个sheet只需要设置一次
310 312
             WriteSheet writeSheet = EasyExcel.writerSheet("助力成功").build();
@@ -328,7 +330,7 @@ public class HelpActivityController extends BaseController {
328 330
             pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
329 331
             List<HelpProceedAndFinish> publicList = null;
330 332
             do {
331
-                publicList = taHelpActivityService.getHelpProceedAndFinishExportList(pageCode * pageSize, pageSize,tel,helpActivityId);
333
+                publicList = taHelpActivityService.getHelpProceedAndFinishExportList(pageCode * pageSize, pageSize,tel,helpActivityId,condition);
332 334
                 excelWriter.write(publicList, writeSheet);
333 335
 
334 336
                 pageCode++;

+ 1
- 1
src/main/java/com/huiju/estateagents/entity/HelpActivity.java Näytä tiedosto

@@ -112,7 +112,7 @@ public class HelpActivity implements Serializable {
112 112
     /**
113 113
      * 活动状态
114 114
      */
115
-    private int activityStatus;
115
+    private Integer activityStatus;
116 116
     
117 117
     /**
118 118
      * Initiate 发起者  Booster 助力者

+ 11
- 2
src/main/java/com/huiju/estateagents/mapper/HelpInitiateRecordMapper.java Näytä tiedosto

@@ -31,7 +31,7 @@ public interface HelpInitiateRecordMapper extends BaseMapper<HelpInitiateRecord>
31 31
      * @param status
32 32
      * @return
33 33
      */
34
-    IPage<HelpInitiateRecord> selectPageList(IPage<HelpInitiateRecord> pg, @Param("helpActivityId") Integer helpActivityId, @Param("status") String status);
34
+    IPage<HelpInitiateRecord> selectPageList(IPage<HelpInitiateRecord> pg, @Param("helpActivityId") Integer helpActivityId, @Param("status") String status,@Param("tel")String tel);
35 35
 
36 36
     /**
37 37
      * 助力成功记录导出
@@ -43,7 +43,16 @@ public interface HelpInitiateRecordMapper extends BaseMapper<HelpInitiateRecord>
43 43
 
44 44
     List<HelpInitiateRecordSucceed> getHelpInitiateRecordSucceedExportList(@Param("pageCode") int i, @Param("pageSize") Integer pageSize, @Param("tel") String tel, @Param("helpActivityId") Integer helpActivityId);
45 45
 
46
-    List<HelpProceedAndFinish> getHelpProceedAndFinishExportList(@Param("pageCode") int i, @Param("pageSize")Integer pageSize, @Param("tel")String tel, @Param("helpActivityId")Integer helpActivityId);
46
+	/***
47
+	 * 助力 进行中/失败导出
48
+	 * @param i
49
+	 * @param pageSize
50
+	 * @param tel
51
+	 * @param helpActivityId
52
+	 * @param condition
53
+	 * @return
54
+	 */
55
+    List<HelpProceedAndFinish> getHelpProceedAndFinishExportList(@Param("pageCode") int i, @Param("pageSize")Integer pageSize, @Param("tel")String tel, @Param("helpActivityId")Integer helpActivityId,@Param("condition")String condition);
47 56
 
48 57
     List<HelpInitiateRecordSucceed> getHelpInitiateRecordSucceedExportList(@Param("pageCode") int i, @Param("pageSize") Integer pageSize, @Param("tel") Integer tel, @Param("helpActivityId") Integer helpActivityId);
49 58
 	

+ 2
- 2
src/main/java/com/huiju/estateagents/service/IHelpActivityService.java Näytä tiedosto

@@ -52,7 +52,7 @@ public interface IHelpActivityService extends IService<HelpActivity> {
52 52
      * @param helpActivityId
53 53
      * @return
54 54
      */
55
-    ResponseBean helpRecord(Integer helpActivityId,String status,Integer pageNum,Integer pageSize);
55
+    ResponseBean helpRecord(Integer helpActivityId,String status,Integer pageNum,Integer pageSize,String tel);
56 56
 
57 57
     /**
58 58
      * 当前发起人的助力人数
@@ -97,7 +97,7 @@ public interface IHelpActivityService extends IService<HelpActivity> {
97 97
      * @param helpActivityId
98 98
      * @return
99 99
      */
100
-    List<HelpProceedAndFinish> getHelpProceedAndFinishExportList(int i, Integer pageSize, String tel, Integer helpActivityId);
100
+    List<HelpProceedAndFinish> getHelpProceedAndFinishExportList(int i, Integer pageSize, String tel, Integer helpActivityId,String condition);
101 101
 
102 102
     /**
103 103
      * 查询当前导出数据的总数

+ 4
- 4
src/main/java/com/huiju/estateagents/service/impl/HelpActivityServiceImpl.java Näytä tiedosto

@@ -66,7 +66,7 @@ public class HelpActivityServiceImpl extends ServiceImpl<HelpActivityMapper, Hel
66 66
     }
67 67
 
68 68
     @Override
69
-    public ResponseBean helpRecord(Integer helpActivityId, String status,Integer pageNum,Integer pageSize) {
69
+    public ResponseBean helpRecord(Integer helpActivityId, String status,Integer pageNum,Integer pageSize,String tel) {
70 70
         ResponseBean responseBean = new ResponseBean<>();
71 71
         //  status: helpSucceed助力成功,helpUnderway进行中,helpUnfinished助力失败
72 72
 
@@ -75,7 +75,7 @@ public class HelpActivityServiceImpl extends ServiceImpl<HelpActivityMapper, Hel
75 75
         // 得到活动限制助力的总数
76 76
         int persionNumCount = helpActivity.getPersonNum();
77 77
         IPage<HelpInitiateRecord> pg = new Page<>(pageNum, pageSize);
78
-        IPage<HelpInitiateRecord> list = helpInitiateRecordMapper.selectPageList(pg,helpActivityId,status);
78
+        IPage<HelpInitiateRecord> list = helpInitiateRecordMapper.selectPageList(pg,helpActivityId,status,tel);
79 79
 
80 80
         List<HelpInitiateRecord>  helpInitiateRecordList= list.getRecords();
81 81
         for (HelpInitiateRecord helpInitiateRecord : helpInitiateRecordList) {
@@ -163,8 +163,8 @@ public class HelpActivityServiceImpl extends ServiceImpl<HelpActivityMapper, Hel
163 163
     }
164 164
 
165 165
     @Override
166
-    public List<HelpProceedAndFinish> getHelpProceedAndFinishExportList(int i, Integer pageSize, String tel, Integer helpActivityId) {
167
-        List<HelpProceedAndFinish> lsit= helpInitiateRecordMapper.getHelpProceedAndFinishExportList(i,pageSize,tel,helpActivityId);
166
+    public List<HelpProceedAndFinish> getHelpProceedAndFinishExportList(int i, Integer pageSize, String tel, Integer helpActivityId,String condition) {
167
+        List<HelpProceedAndFinish> lsit= helpInitiateRecordMapper.getHelpProceedAndFinishExportList(i,pageSize,tel,helpActivityId,condition);
168 168
         return lsit;
169 169
     }
170 170
 

+ 20
- 3
src/main/resources/mapper/HelpInitiateRecordMapper.xml Näytä tiedosto

@@ -14,14 +14,18 @@
14 14
             AND hi.verification !=''
15 15
         </if>
16 16
        <if test="status == 'helpUnderway'">
17
-           and (hi.verification = 'null' OR hi.verification = '')
17
+           and (hi.verification is null OR hi.verification = '')
18 18
            AND hi.`status` = 1
19 19
        </if>
20 20
 
21
-       <if test="status == 'helpUnfinished '">
22
-           and (hi.verification = 'null' OR hi.verification = '')
21
+       <if test="status == 'helpUnfinished'">
22
+           and (hi.verification is null
23
+           OR hi.verification = '')
23 24
            AND hi.`status` =  2
24 25
        </if>
26
+           <if test="tel != null and tel != ''">
27
+               AND hi.phone = #{tel}
28
+           </if>
25 29
        </where>
26 30
     </select>
27 31
 
@@ -34,6 +38,10 @@
34 38
     if(b.verification_status = 0, '未核销', if(b.verification_status = 1, '已核销', '未知')) as verificationStatus
35 39
     from ta_help_initiate_record b
36 40
     where b.help_activity_id =  #{helpActivityId}
41
+    and b.`status` =  0
42
+    <if test="tel != null and tel != ''">
43
+        AND b.phone = #{tel}
44
+    </if>
37 45
      order by b.create_date desc
38 46
      limit #{pageCode}, #{pageSize}
39 47
     </select>
@@ -45,6 +53,15 @@
45 53
     b.phone as phone
46 54
     from ta_help_initiate_record b
47 55
     where b.help_activity_id =  #{helpActivityId}
56
+    <if test="condition == 'helpSucceed'">
57
+        and b.status = 1
58
+    </if>
59
+    <if test="condition == 'helpUnfinished'">
60
+        and b.status = 2
61
+    </if>
62
+    <if test="tel != null and tel != ''">
63
+        AND b.phone = #{tel}
64
+    </if>
48 65
      order by b.create_date desc
49 66
      limit #{pageCode}, #{pageSize}
50 67
     </select>