|
@@ -128,7 +128,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
128
|
128
|
|
129
|
129
|
@Override
|
130
|
130
|
@Transactional(rollbackFor = Exception.class)
|
131
|
|
- public ResponseBean update(String parameter, Integer userId) {
|
|
131
|
+ public ResponseBean update(String parameter, UserElement userElement) {
|
132
|
132
|
ResponseBean responseBean = new ResponseBean();
|
133
|
133
|
|
134
|
134
|
TpBuildingOwnerInfo tpBuildingOwnerInfo = JSONObject.parseObject(parameter, TpBuildingOwnerInfo.class);
|
|
@@ -144,7 +144,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
144
|
144
|
}
|
145
|
145
|
|
146
|
146
|
// 物业端的用户,也就是正在操作的物业人员
|
147
|
|
- User user = userMapper.selectById(userId);
|
|
147
|
+ User user = userMapper.selectById(userElement.getId());
|
148
|
148
|
|
149
|
149
|
/**
|
150
|
150
|
* 修改的时候, 如果提交上来的数据和要被修改的数据是一样的! 直接返回操作成功!
|
|
@@ -154,7 +154,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
154
|
154
|
boolean phoneBool = false;
|
155
|
155
|
|
156
|
156
|
// 校验楼栋信息表
|
157
|
|
- TpBuildingOwnerInfo selectBuild = getBuildingInfo(tpBuildingOwnerInfo, user.getCommunityId());
|
|
157
|
+ TpBuildingOwnerInfo selectBuild = getBuildingInfo(tpBuildingOwnerInfo, tpBuildingOwnerInfo.getCommunityId());
|
158
|
158
|
// 如果数据查询到了, 并且手机号和传上来的手机号是一样的是, 代表就是原数据, 直接返回操作成功
|
159
|
159
|
if (null != selectBuild && selectBuild.getOwnerTel().equals(tpBuildingOwnerInfo.getOwnerTel())) {
|
160
|
160
|
tpBuildingOwnerInfoMapper.updateById(tpBuildingOwnerInfo);
|
|
@@ -167,7 +167,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
167
|
167
|
// 校验楼栋信息表里面的业主手机号
|
168
|
168
|
QueryWrapper<TpBuildingOwnerInfo> queryWrapperPhone = new QueryWrapper<>();
|
169
|
169
|
queryWrapperPhone.eq("owner_tel", tpBuildingOwnerInfo.getOwnerTel());
|
170
|
|
- TpBuildingOwnerInfo selectBuildPhone = getBuildingInfo(tpBuildingOwnerInfo, user.getCommunityId());
|
|
170
|
+ TpBuildingOwnerInfo selectBuildPhone = getBuildingInfo(tpBuildingOwnerInfo, tpBuildingOwnerInfo.getCommunityId());
|
171
|
171
|
|
172
|
172
|
// 如果 通过手机号查询出来的楼栋信息数据的 id 和 传上来的 楼栋,单元,楼层,单元,户号 查询出来的数据的id 匹配, 那么就表示这个手机号已经绑定了其他的楼栋信息
|
173
|
173
|
if (selectBuildPhone.getId().intValue() != selectBuild.getId().intValue()){
|
|
@@ -189,7 +189,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
189
|
189
|
BeanTools.copyProperties(tpBuildingOwnerInfo, oldTpBuildingOwnerInfo);
|
190
|
190
|
|
191
|
191
|
oldTpBuildingOwnerInfo.setUpdateDate(LocalDateTime.now());
|
192
|
|
- oldTpBuildingOwnerInfo.setUpdateUser(userId);
|
|
192
|
+ oldTpBuildingOwnerInfo.setUpdateUser(userElement.getId());
|
193
|
193
|
|
194
|
194
|
int row = tpBuildingOwnerInfoMapper.updateById(oldTpBuildingOwnerInfo);
|
195
|
195
|
if (row <= 0) {
|
|
@@ -223,12 +223,12 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
223
|
223
|
|
224
|
224
|
@Override
|
225
|
225
|
@Transactional(rollbackFor = Exception.class)
|
226
|
|
- public ResponseBean add(String parameter, Integer userId) {
|
|
226
|
+ public ResponseBean add(String parameter, UserElement userElement) {
|
227
|
227
|
ResponseBean responseBean = new ResponseBean();
|
228
|
228
|
|
229
|
229
|
TpBuildingOwnerInfo tpBuildingOwnerInfo = JSONObject.parseObject(parameter, TpBuildingOwnerInfo.class);
|
230
|
230
|
// 物业端的用户,也就是正在操作的物业人员
|
231
|
|
- User user = userMapper.selectById(userId);
|
|
231
|
+ User user = userMapper.selectById(userElement.getId());
|
232
|
232
|
if (!AccountValidatorUtil.isPhone(tpBuildingOwnerInfo.getOwnerTel())){
|
233
|
233
|
responseBean.addError("请输入正取的手机号!");
|
234
|
234
|
return responseBean;
|
|
@@ -244,7 +244,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
244
|
244
|
}
|
245
|
245
|
|
246
|
246
|
// 校验楼栋信息表
|
247
|
|
- selectBuild = getBuildingInfo(tpBuildingOwnerInfo, user.getCommunityId());
|
|
247
|
+ selectBuild = getBuildingInfo(tpBuildingOwnerInfo, userElement.getCommunityId());
|
248
|
248
|
if (null != selectBuild) {
|
249
|
249
|
responseBean.addError("该楼层的户号,已存在!");
|
250
|
250
|
return responseBean;
|
|
@@ -252,14 +252,14 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
252
|
252
|
|
253
|
253
|
// 主键是自增的, 所以设置为 null
|
254
|
254
|
tpBuildingOwnerInfo.setId(null);
|
255
|
|
- tpBuildingOwnerInfo.setUpdateUser(userId);
|
|
255
|
+ tpBuildingOwnerInfo.setUpdateUser(userElement.getId());
|
256
|
256
|
tpBuildingOwnerInfo.setUpdateDate(LocalDateTime.now());
|
257
|
257
|
tpBuildingOwnerInfo.setCreateDate(LocalDateTime.now());
|
258
|
|
- tpBuildingOwnerInfo.setCreateUser(userId);
|
|
258
|
+ tpBuildingOwnerInfo.setCreateUser(userElement.getId());
|
259
|
259
|
tpBuildingOwnerInfo.setVerifyStatus("0");
|
260
|
260
|
|
261
|
261
|
// 添加的时候, 默认是当前操作的小区
|
262
|
|
- tpBuildingOwnerInfo.setCommunityId(user.getCommunityId());
|
|
262
|
+ tpBuildingOwnerInfo.setCommunityId(userElement.getCommunityId());
|
263
|
263
|
|
264
|
264
|
int row = tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfo);
|
265
|
265
|
if (row <= 0) {
|