|
@@ -1,6 +1,7 @@
|
1
|
1
|
package com.huiju.estateagents.property.service.impl;
|
2
|
2
|
|
3
|
3
|
import com.alibaba.fastjson.JSONObject;
|
|
4
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
4
|
5
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
5
|
6
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
6
|
7
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
@@ -450,12 +451,16 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
450
|
451
|
ResponseBean responseBean = new ResponseBean();
|
451
|
452
|
responseBean = getExcelData(file);
|
452
|
453
|
|
|
454
|
+ if (responseBean.getCode() != 1000){
|
|
455
|
+ return responseBean;
|
|
456
|
+ }
|
453
|
457
|
//获取要上传的数据
|
454
|
458
|
Map<String,Object> map = (Map<String, Object>) responseBean.getData();
|
455
|
459
|
List<TpBuildingOwnerInfo> list = (List<TpBuildingOwnerInfo>) map.get("list");
|
456
|
460
|
|
457
|
461
|
//批量插入
|
458
|
462
|
list.forEach(e -> {
|
|
463
|
+ // 校验是否存在重复房源
|
459
|
464
|
e.setOrgId(userElement.getOrgId());
|
460
|
465
|
e.setVerifyStatus("0");
|
461
|
466
|
e.setPairStatus("0");
|
|
@@ -711,7 +716,15 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
711
|
716
|
responseBean.addError("第" + currentRow + "行" + "身份不能为空!");
|
712
|
717
|
return responseBean;
|
713
|
718
|
}
|
714
|
|
-
|
|
719
|
+ LambdaQueryWrapper<TpBuildingOwnerInfo> ownerInfoQueryWrapper = new LambdaQueryWrapper<>();
|
|
720
|
+ ownerInfoQueryWrapper.eq(TpBuildingOwnerInfo::getOwnerTel,ownerTel);
|
|
721
|
+ ownerInfoQueryWrapper.eq(TpBuildingOwnerInfo::getRoomNoId,roomNoId);
|
|
722
|
+ TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectOne(ownerInfoQueryWrapper);
|
|
723
|
+ if (null != tpBuildingOwnerInfo){
|
|
724
|
+ responseBean.addError("第" + currentRow + "行" + "户主已存在!");
|
|
725
|
+ return responseBean;
|
|
726
|
+ }
|
|
727
|
+
|
715
|
728
|
// if (temBuildingList.contains(roomNoId)){
|
716
|
729
|
// logger.info("存在重复房源:{}",roomNoId);
|
717
|
730
|
// responseBean.addError("第"+ currentRow +"行存在重复房源");
|
|
@@ -864,13 +877,13 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
864
|
877
|
|
865
|
878
|
ResponseBean responseBean = new ResponseBean();
|
866
|
879
|
ids.stream().forEach(e->{
|
867
|
|
- QueryWrapper<TpBuildingOwnerInfo> buildingOwnerInfoQueryWrapper = new QueryWrapper<>();
|
868
|
|
- buildingOwnerInfoQueryWrapper.eq("ta_user_verify_id", e);
|
869
|
|
- TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectOne(buildingOwnerInfoQueryWrapper);
|
|
880
|
+ TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(e);
|
870
|
881
|
if (null != tpBuildingOwnerInfo) {
|
871
|
882
|
tpBuildingOwnerInfoMapper.deleteById(tpBuildingOwnerInfo.getId());
|
872
|
883
|
}
|
873
|
|
- taUserVerifyMapper.deleteById(e);
|
|
884
|
+ if (null != tpBuildingOwnerInfo.getTaUserVerifyId()){
|
|
885
|
+ taUserVerifyMapper.deleteById(tpBuildingOwnerInfo.getTaUserVerifyId());
|
|
886
|
+ }
|
874
|
887
|
|
875
|
888
|
// 作废话题
|
876
|
889
|
// tpTransactionMapper.invalidByUuidAndUuidType(e, "app");
|