张延森 3 years ago
parent
commit
7ce42aa144

+ 1
- 1
pom.xml View File

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.huiju</groupId>
12 12
 	<artifactId>xiangsong</artifactId>
13
-	<version>1.1.8</version>
13
+	<version>1.2.1</version>
14 14
 	<name>xiangsong</name>
15 15
 	<description>香颂</description>
16 16
 

+ 8
- 0
src/main/java/com/huiju/estateagents/controller/TaBuildingDynamicController.java View File

@@ -19,6 +19,7 @@ import com.huiju.estateagents.excel.HelpInitiateRecordSucceed;
19 19
 import com.huiju.estateagents.excel.TaActivityDynamicEnlistExport;
20 20
 import com.huiju.estateagents.excel.handler.CustomCellWriteHandler;
21 21
 import com.huiju.estateagents.mapper.*;
22
+import com.huiju.estateagents.property.service.ITaUserVerifyService;
22 23
 import com.huiju.estateagents.reportCustomerAop.ReportCustomer;
23 24
 import com.huiju.estateagents.service.*;
24 25
 import io.swagger.annotations.Api;
@@ -103,6 +104,7 @@ public class TaBuildingDynamicController extends BaseController {
103 104
     @Autowired
104 105
     private IExtendContentService iExtendContentService;
105 106
 
107
+
106 108
     @InitBinder
107 109
     protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
108 110
         DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
@@ -422,6 +424,12 @@ public class TaBuildingDynamicController extends BaseController {
422 424
             return ResponseBean.error("报名失败,超过活动报名的最大人数!", ResponseBean.ERROR_UNAVAILABLE);
423 425
         }
424 426
 
427
+        // 已报名家庭不允许重复报名
428
+        Integer hasExists = taActivityDynamicEnlistMapper.countEnlistBy(orgId, taActivityDynamicEnlist.getHouseInfo());
429
+        if (hasExists > 0) {
430
+             return ResponseBean.error("您的家庭已有人报名当前活动!", ResponseBean.ERROR_UNAVAILABLE);
431
+         }
432
+
425 433
         TaPerson person = taPersons.get(0);
426 434
 
427 435
         // 反向更新TaSharePersonFrom 的 status

+ 5
- 0
src/main/java/com/huiju/estateagents/entity/TaActivityDynamicEnlist.java View File

@@ -57,6 +57,11 @@ public class TaActivityDynamicEnlist implements Serializable {
57 57
 
58 58
     private String sharePersonType;
59 59
 
60
+    /**
61
+     * 房产信息
62
+     */
63
+    private String houseInfo;
64
+
60 65
     /**
61 66
      * 报名人数
62 67
      */

+ 2
- 0
src/main/java/com/huiju/estateagents/mapper/TaActivityDynamicEnlistMapper.java View File

@@ -49,4 +49,6 @@ public interface TaActivityDynamicEnlistMapper extends BaseMapper<TaActivityDyna
49 49
     List<HelpInitiateRecordSucceed> getTaActivityDynamicEnlistExport(@Param("pageCode") int i, @Param("pageSize") Integer pageSize, @Param("dynamicId") String dynamicId, @Param("isCheckin") String isCheckin, @Param("name") String name, @Param("phone") String phone,@Param("orgId") Integer orgId);
50 50
 
51 51
     Map<String, Integer> getLastActEnlistNum(Integer orgId);
52
+
53
+    Integer countEnlistBy(@Param("orgId") Integer orgId, @Param("houseInfo") String houseInfo);
52 54
 }

+ 3
- 2
src/main/java/com/huiju/estateagents/property/controller/AnnouncementTelController.java View File

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6 6
 import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8 8
 import com.huiju.estateagents.center.taUser.entity.TaUser;
9
+import com.huiju.estateagents.common.StringUtils;
9 10
 import com.huiju.estateagents.property.common.UserElement;
10 11
 import com.huiju.estateagents.property.model.AnnouncementTel;
11 12
 import com.huiju.estateagents.property.service.IAnnouncementTelService;
@@ -176,10 +177,10 @@ public class AnnouncementTelController extends BaseController {
176 177
 
177 178
 	 @ApiOperation(value = "获取物业号码", notes = "获取物业号码")
178 179
 	@RequestMapping(value = "/wx/tels",method = RequestMethod.GET)
179
-	public ResponseBean getWxTelList(@RequestParam(value = "type") String type ,@RequestParam(value = "communityId") String communityId ,HttpServletRequest request){
180
+	public ResponseBean getWxTelList(@RequestParam(value = "type") String type ,@RequestParam(value = "communityId", required = false) String communityId ,HttpServletRequest request){
180 181
 		LambdaQueryWrapper<AnnouncementTel> queryWrapper = new LambdaQueryWrapper<>();
181 182
 		 queryWrapper.eq(AnnouncementTel::getType,type);
182
-		 queryWrapper.eq(AnnouncementTel::getCommunityId,communityId);
183
+		 queryWrapper.eq(!StringUtils.isEmpty(communityId), AnnouncementTel::getCommunityId,communityId);
183 184
 		return ResponseBean.success(announcementTelService.list(queryWrapper));
184 185
 	}
185 186
 }

+ 5
- 2
src/main/java/com/huiju/estateagents/property/controller/TpTicketController.java View File

@@ -7,6 +7,7 @@ import com.huiju.estateagents.base.BaseController;
7 7
 import com.huiju.estateagents.base.ResponseBean;
8 8
 import com.huiju.estateagents.center.taUser.entity.TaUser;
9 9
 import com.huiju.estateagents.center.taUser.service.ITaUserService;
10
+import com.huiju.estateagents.common.StringUtils;
10 11
 import com.huiju.estateagents.entity.TaPerson;
11 12
 import com.huiju.estateagents.property.common.Constant;
12 13
 import com.huiju.estateagents.property.common.UserElement;
@@ -361,10 +362,12 @@ public class TpTicketController extends BaseController {
361 362
     @RequestMapping(value = "/wx/life/ticket/list", method = RequestMethod.GET)
362 363
     public ResponseBean getWorkerList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
363 364
                                       @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
364
-                                      @RequestParam(value = "communityId", required = false) Integer communityId,
365
+                                      @RequestParam(value = "communityId", required = false) String communityId,
365 366
                                       HttpServletRequest request){
367
+        Integer community = StringUtils.isEmpty(communityId) ? null : Integer.parseInt(communityId);
368
+
366 369
         TaUser taUser = getPropUserByPersonId(getPersonId(request));
367
-        ResponseBean  responseBean = tpTicketService.getWorkerList(pageNum,pageSize,taUser.getUserId(),taUser.getOrgId(),communityId);
370
+        ResponseBean  responseBean = tpTicketService.getWorkerList(pageNum,pageSize,taUser.getUserId(),taUser.getOrgId(), community);
368 371
         return responseBean;
369 372
     }
370 373
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/property/service/impl/TpTicketServiceImpl.java View File

@@ -1302,7 +1302,7 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
1302 1302
         LambdaQueryWrapper<TpTicket> tpTicketLambdaQueryWrapper = new LambdaQueryWrapper<>();
1303 1303
         tpTicketLambdaQueryWrapper.eq(TpTicket::getOrgId,orgId);
1304 1304
         tpTicketLambdaQueryWrapper.eq(TpTicket::getTpUserId,userId);
1305
-        tpTicketLambdaQueryWrapper.eq(TpTicket::getCommunityId,communityId);
1305
+        tpTicketLambdaQueryWrapper.eq(null != communityId, TpTicket::getCommunityId,communityId);
1306 1306
         tpTicketLambdaQueryWrapper.orderByDesc(TpTicket::getCreateDate);
1307 1307
         IPage<TpTicket> tpTicketIPage = tpTicketMapper.selectPage(page, tpTicketLambdaQueryWrapper);
1308 1308
         List<TpTicket> tpTicketList = tpTicketIPage.getRecords();

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

@@ -70,8 +70,9 @@ public class TaNewsServiceImpl extends ServiceImpl<TaNewsMapper, TaNews> impleme
70 70
         taNewsQueryWrapper.eq(cityId != null, "city_id", cityId);
71 71
         taNewsQueryWrapper.like(title!=null,"news_name", title);
72 72
         taNewsQueryWrapper.in(personBuildingList.size() > 0,"building_id",personBuildingList.stream().map(TaPersonBuilding::getBuildingId).collect(Collectors.toList()));
73
+        taNewsQueryWrapper.orderByDesc("create_date");
73 74
         taNewsQueryWrapper.orderByAsc("news_status");
74
-        taNewsQueryWrapper.orderByDesc("weight","create_date");
75
+//        taNewsQueryWrapper.orderByDesc("weight","create_date");
75 76
         IPage<TaNews> taNewsIPage = this.page(page, taNewsQueryWrapper);
76 77
 
77 78
         injectType(taNewsIPage.getRecords());

+ 24
- 12
src/main/java/com/huiju/estateagents/service/impl/TaPointsRecordsServiceImpl.java View File

@@ -108,7 +108,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
108 108
         TaPerson person = taPersonMapper.selectById(taShare.getPersonId());
109 109
 
110 110
         // 2021年2月1日 只有业主有积分
111
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
111
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
112
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
112 113
             return;
113 114
         }
114 115
 
@@ -138,7 +139,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
138 139
         }
139 140
 
140 141
         // 2021年2月1日 只有业主有积分
141
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
142
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
143
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
142 144
             return;
143 145
         }
144 146
 
@@ -183,7 +185,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
183 185
         TaPerson person = taPersonMapper.selectById(taPersonSign.getPersonId());
184 186
 
185 187
         // 2021年2月1日 只有业主有积分
186
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
188
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
189
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
187 190
             return;
188 191
         }
189 192
 
@@ -219,7 +222,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
219 222
         TaPerson person = taPersonMapper.selectById(taActivityDynamicEnlist.getPersonId());
220 223
 
221 224
         // 2021年2月1日 只有业主有积分
222
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
225
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
226
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
223 227
             return;
224 228
         }
225 229
 
@@ -231,7 +235,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
231 235
     @Override
232 236
     public void signUpPoints(TaPerson taPerson, Integer orgId) {
233 237
         // 2021年2月1日 只有业主有积分
234
-        if (!CommConstant.PERSON_PROPRIETOR.equals(taPerson.getPersonType())) {
238
+        if (!CommConstant.PERSON_PROPRIETOR.equals(taPerson.getPersonType())
239
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(taPerson.getPersonType())) {
235 240
             return;
236 241
         }
237 242
 
@@ -287,7 +292,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
287 292
         TaPerson taPerson = taPersonMapper.getById(taRecommendCustomer.getRecommendPerson());
288 293
 
289 294
         // 2021年2月1日 只有业主有积分
290
-        if (!CommConstant.PERSON_PROPRIETOR.equals(taPerson.getPersonType())) {
295
+        if (!CommConstant.PERSON_PROPRIETOR.equals(taPerson.getPersonType())
296
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(taPerson.getPersonType())) {
291 297
             return;
292 298
         }
293 299
 
@@ -316,7 +322,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
316 322
         }
317 323
 
318 324
         // 2021年2月1日 只有业主有积分
319
-        if (!CommConstant.PERSON_PROPRIETOR.equals(taPerson.getPersonType())) {
325
+        if (!CommConstant.PERSON_PROPRIETOR.equals(taPerson.getPersonType())
326
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(taPerson.getPersonType())) {
320 327
             return;
321 328
         }
322 329
 
@@ -426,7 +433,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
426 433
         TaPerson person = taPersonMapper.selectById(taDocumentVerify.getPersonId());
427 434
 
428 435
         // 2021年2月1日 只有业主有积分
429
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
436
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
437
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
430 438
             return;
431 439
         }
432 440
 
@@ -461,7 +469,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
461 469
         TaPerson person = taPersonMapper.selectById(helpInitiateRecord.getPersonId());
462 470
 
463 471
         // 2021年2月1日 只有业主有积分
464
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
472
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
473
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
465 474
             return;
466 475
         }
467 476
 
@@ -525,7 +534,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
525 534
         TaPerson person = taPersonMapper.selectById(userVerify.getPersonId());
526 535
 
527 536
         // 2021年2月1日 只有业主有积分
528
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
537
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
538
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
529 539
             return;
530 540
         }
531 541
 
@@ -560,7 +570,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
560 570
         TaPerson person = taPersonMapper.selectById(source.getPersonId());
561 571
 
562 572
         // 2021年2月1日 只有业主有积分
563
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
573
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
574
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
564 575
             return;
565 576
         }
566 577
 
@@ -595,7 +606,8 @@ public class TaPointsRecordsServiceImpl extends ServiceImpl<TaPointsRecordsMappe
595 606
         TaPerson person = taPersonMapper.selectById(source.getCreateUser());
596 607
 
597 608
         // 2021年2月1日 只有业主有积分
598
-        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())) {
609
+        if (!CommConstant.PERSON_PROPRIETOR.equals(person.getPersonType())
610
+                && !CommConstant.PERSON_LIFE_CONSULTANT.equals(person.getPersonType())) {
599 611
             return;
600 612
         }
601 613
 

+ 6
- 0
src/main/resources/mapper/TaActivityDynamicEnlistMapper.xml View File

@@ -86,4 +86,10 @@
86 86
             t.end_date DESC
87 87
         LIMIT 1
88 88
     </select>
89
+    <select id="countEnlistBy" resultType="java.lang.Integer">
90
+        SELECT COUNT(1)
91
+        FROM ta_activity_dynamic_enlist t
92
+        WHERE t.org_id = #{orgId}
93
+            AND t.house_info = #{houseInfo}
94
+    </select>
89 95
 </mapper>