|
@@ -284,38 +284,28 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
284
|
284
|
// return responseBean;
|
285
|
285
|
// }
|
286
|
286
|
|
|
287
|
+ // 校验 期/区/栋/单元/楼层/户号
|
|
288
|
+ QueryWrapper<TpRoomNo> roomNoQueryWrapper = new QueryWrapper<>();
|
|
289
|
+ roomNoQueryWrapper.eq("community_id", userElement.getCommunityId());
|
|
290
|
+ roomNoQueryWrapper.eq("phase_id", phase);
|
|
291
|
+ roomNoQueryWrapper.eq("building_id", building);
|
|
292
|
+ roomNoQueryWrapper.eq("unit_id", unit);
|
|
293
|
+ roomNoQueryWrapper.eq("level_id", level);
|
|
294
|
+ roomNoQueryWrapper.eq("id", roomNo);
|
|
295
|
+ TpRoomNo tpRoomNo = tpRoomNoMapper.selectOne(roomNoQueryWrapper);
|
|
296
|
+ if (null == tpRoomNo) {
|
|
297
|
+ responseBean.addError("房产不存在!");
|
|
298
|
+ return responseBean;
|
|
299
|
+ }
|
|
300
|
+
|
|
301
|
+
|
287
|
302
|
BillInvoice billInvoice = new BillInvoice();
|
288
|
303
|
|
289
|
304
|
/**
|
290
|
305
|
* 缴费单挂靠在 房产下面
|
291
|
306
|
*/
|
292
|
307
|
|
293
|
|
- /**
|
294
|
|
- * 需要知道这个房产的业主
|
295
|
|
- */
|
296
|
|
- TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddress(userElement.getCommunityId(), phase, building, unit, level, roomNo);
|
297
|
|
-
|
298
|
|
- TaUser ownerUser = null;
|
299
|
|
- TpBuildingOwnerInfo buildingOwnerInfo = null;
|
300
|
|
- if (null != userVerify) {
|
301
|
|
- // 业主个人信息
|
302
|
|
- ownerUser = taUserMapper.selectById(userVerify.getUserId());
|
303
|
|
-
|
304
|
|
- // 楼栋资料库
|
305
|
|
- buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityIdAndAddress(userElement.getCommunityId(),
|
306
|
|
- userVerify.getPhaseId(), userVerify.getBuildingId(), userVerify.getUnitId(),
|
307
|
|
- userVerify.getLevelId(), userVerify.getRoomNoId(), ownerUser.getLoginName());
|
308
|
|
- if (null == buildingOwnerInfo) {
|
309
|
|
- throw new WisdomException("手机号为:" + ownerUser.getLoginName() + " 楼栋业主资料不存在!");
|
310
|
|
- }
|
311
|
|
- billInvoice.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
|
312
|
|
- }
|
313
|
|
-
|
314
|
|
- if (null != ownerUser) {
|
315
|
|
- billInvoice.setTaUserId(ownerUser.getId());
|
316
|
|
- }
|
317
|
308
|
// 设置房号
|
318
|
|
- billInvoice.setRoomNoId(roomNo);
|
319
|
309
|
billInvoice.setBillId(billId);
|
320
|
310
|
billInvoice.setCommunityId(userElement.getCommunityId());
|
321
|
311
|
billInvoice.setBillInvoiceExplain(billInvoiceExplain);
|
|
@@ -323,6 +313,7 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
323
|
313
|
billInvoice.setBillStatus("0");
|
324
|
314
|
billInvoice.setCreateUser(userElement.getId());
|
325
|
315
|
billInvoice.setCreateDate(new Date());
|
|
316
|
+ billInvoice.setRoomNoId(roomNo);
|
326
|
317
|
billInvoice.setStatus(0);
|
327
|
318
|
|
328
|
319
|
int result = billInvoiceMapper.insert(billInvoice);
|