|
@@ -580,51 +580,73 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
580
|
580
|
return responseBean;
|
581
|
581
|
}
|
582
|
582
|
|
|
583
|
+// @Override
|
|
584
|
+// @Transactional(rollbackFor = Exception.class)
|
|
585
|
+// @Deprecated
|
|
586
|
+// public ResponseBean deleteIds(List<Integer> ids, Integer propertyUserId) {
|
|
587
|
+//
|
|
588
|
+// ResponseBean responseBean = new ResponseBean();
|
|
589
|
+//
|
|
590
|
+// List<TpBuildingOwnerInfo> infoList = ids.stream().map(e->{
|
|
591
|
+// TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
|
|
592
|
+// tpBuildingOwnerInfo.setId(e);
|
|
593
|
+// tpBuildingOwnerInfo.setVerifyStatus("2");
|
|
594
|
+// tpBuildingOwnerInfo.setUpdateUser(propertyUserId);
|
|
595
|
+// tpBuildingOwnerInfo.setUpdateDate(LocalDateTime.now());
|
|
596
|
+// return tpBuildingOwnerInfo;
|
|
597
|
+// }).collect(Collectors.toList());
|
|
598
|
+// boolean result = updateBatchById(infoList);
|
|
599
|
+//
|
|
600
|
+// // APP 端用户
|
|
601
|
+// List<TaUser> taUserList = Lists.newArrayList();
|
|
602
|
+//
|
|
603
|
+// ids.forEach(e-> {
|
|
604
|
+// TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(e);
|
|
605
|
+// if (null != tpBuildingOwnerInfo) {
|
|
606
|
+// // 查询 APP 端业主
|
|
607
|
+// TaUser appOwnerUser = getByIdAndCommunityId(tpBuildingOwnerInfo.getOwnerTel(), tpBuildingOwnerInfo.getCommunityId());
|
|
608
|
+// if (null != appOwnerUser) {
|
|
609
|
+// appOwnerUser.setVerifyStatus(2+"");
|
|
610
|
+// appOwnerUser.setUpdateDate(LocalDateTime.now());
|
|
611
|
+// taUserList.add(appOwnerUser);
|
|
612
|
+// }
|
|
613
|
+//
|
|
614
|
+// }
|
|
615
|
+// });
|
|
616
|
+//
|
|
617
|
+// if (null != taUserList && taUserList.size() > 0) {
|
|
618
|
+// result = iTaUserService.updateBatchById(taUserList);
|
|
619
|
+// }
|
|
620
|
+//
|
|
621
|
+//
|
|
622
|
+// if (result) {
|
|
623
|
+// responseBean.addSuccess("操作成功!");
|
|
624
|
+// }else {
|
|
625
|
+// responseBean.addError("操作失败!");
|
|
626
|
+// }
|
|
627
|
+//
|
|
628
|
+//
|
|
629
|
+// return responseBean;
|
|
630
|
+// }
|
|
631
|
+
|
|
632
|
+
|
583
|
633
|
@Override
|
584
|
634
|
@Transactional(rollbackFor = Exception.class)
|
585
|
635
|
public ResponseBean deleteIds(List<Integer> ids, Integer propertyUserId) {
|
586
|
636
|
|
587
|
637
|
ResponseBean responseBean = new ResponseBean();
|
588
|
|
-
|
589
|
|
- List<TpBuildingOwnerInfo> infoList = ids.stream().map(e->{
|
590
|
|
- TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
|
591
|
|
- tpBuildingOwnerInfo.setId(e);
|
592
|
|
- tpBuildingOwnerInfo.setVerifyStatus("2");
|
593
|
|
- tpBuildingOwnerInfo.setUpdateUser(propertyUserId);
|
594
|
|
- tpBuildingOwnerInfo.setUpdateDate(LocalDateTime.now());
|
595
|
|
- return tpBuildingOwnerInfo;
|
596
|
|
- }).collect(Collectors.toList());
|
597
|
|
- boolean result = updateBatchById(infoList);
|
598
|
|
-
|
599
|
|
- // APP 端用户
|
600
|
|
- List<TaUser> taUserList = Lists.newArrayList();
|
601
|
|
-
|
602
|
|
- ids.forEach(e-> {
|
603
|
|
- TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(e);
|
604
|
|
- if (null != tpBuildingOwnerInfo) {
|
605
|
|
- // 查询 APP 端业主
|
606
|
|
- TaUser appOwnerUser = getByIdAndCommunityId(tpBuildingOwnerInfo.getOwnerTel(), tpBuildingOwnerInfo.getCommunityId());
|
607
|
|
- if (null != appOwnerUser) {
|
608
|
|
- appOwnerUser.setVerifyStatus(2+"");
|
609
|
|
- appOwnerUser.setUpdateDate(LocalDateTime.now());
|
610
|
|
- taUserList.add(appOwnerUser);
|
611
|
|
- }
|
612
|
|
-
|
|
638
|
+ ids.stream().forEach(e->{
|
|
639
|
+ TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(e);
|
|
640
|
+ if ("1".equals(buildingOwnerInfo.getVerifyStatus())) {
|
|
641
|
+ throw new WisdomException("不能删除已认证的楼栋资料!");
|
|
642
|
+ /**
|
|
643
|
+ * 批量删除的时候,只要存在一个已认证的楼栋资料, 就停止删除!
|
|
644
|
+ */
|
613
|
645
|
}
|
|
646
|
+ tpBuildingOwnerInfoMapper.deleteById(buildingOwnerInfo.getId());
|
614
|
647
|
});
|
615
|
648
|
|
616
|
|
- if (null != taUserList && taUserList.size() > 0) {
|
617
|
|
- result = iTaUserService.updateBatchById(taUserList);
|
618
|
|
- }
|
619
|
|
-
|
620
|
|
-
|
621
|
|
- if (result) {
|
622
|
|
- responseBean.addSuccess("操作成功!");
|
623
|
|
- }else {
|
624
|
|
- responseBean.addError("操作失败!");
|
625
|
|
- }
|
626
|
|
-
|
627
|
|
-
|
|
649
|
+ responseBean.addSuccess("操作成功!");
|
628
|
650
|
return responseBean;
|
629
|
651
|
}
|
630
|
652
|
|