|
@@ -60,6 +60,12 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
60
|
60
|
@Autowired
|
61
|
61
|
private IMessageService iMessageService;
|
62
|
62
|
|
|
63
|
+ @Autowired
|
|
64
|
+ private TpRoomNoMapper tpRoomNoMapper;
|
|
65
|
+
|
|
66
|
+ @Autowired
|
|
67
|
+ private TaUserVerifyMapper taUserVerifyMapper;
|
|
68
|
+
|
63
|
69
|
@Override
|
64
|
70
|
public ResponseBean getBillList(String parameter, UserElement userElement) {
|
65
|
71
|
ResponseBean responseBean = new ResponseBean();
|
|
@@ -187,7 +193,6 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
187
|
193
|
billInvoice.setBillStatementId(billStatement.getId());
|
188
|
194
|
billInvoice.setPayName(billStatement.getPayName());
|
189
|
195
|
billInvoice.setPayDate(new Date());
|
190
|
|
- billInvoice.setOutTradeNo(String.valueOf(System.currentTimeMillis()) + billInvoice.getId());
|
191
|
196
|
billInvoiceMapper.updateById(billInvoice);
|
192
|
197
|
|
193
|
198
|
// 修改缴费户数
|
|
@@ -231,13 +236,15 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
231
|
236
|
// 收费项ID
|
232
|
237
|
Integer billId = jsonObject.getInteger("billId");
|
233
|
238
|
// 区/期
|
234
|
|
- String phase = jsonObject.getString("phase");
|
|
239
|
+ Integer phase = jsonObject.getInteger("phase");
|
235
|
240
|
// 栋
|
236
|
|
- String building = jsonObject.getString("building");
|
|
241
|
+ Integer building = jsonObject.getInteger("building");
|
237
|
242
|
// 单元
|
238
|
|
- String unit = jsonObject.getString("unit");
|
|
243
|
+ Integer unit = jsonObject.getInteger("unit");
|
|
244
|
+ // 楼层
|
|
245
|
+ Integer level = jsonObject.getInteger("level");
|
239
|
246
|
// 户号
|
240
|
|
- String roomNo = jsonObject.getString("roomNo");
|
|
247
|
+ Integer roomNo = jsonObject.getInteger("roomNo");
|
241
|
248
|
// 催缴日期
|
242
|
249
|
// Date worthOf = jsonObject.getDate("worthOf");
|
243
|
250
|
// 收费单说明
|
|
@@ -253,39 +260,48 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
253
|
260
|
// return responseBean;
|
254
|
261
|
// }
|
255
|
262
|
|
256
|
|
- // 楼栋资料库
|
257
|
|
- QueryWrapper<TpBuildingOwnerInfo> queryWrapper = new QueryWrapper<>();
|
258
|
|
- queryWrapper.eq("phase", phase);
|
259
|
|
- queryWrapper.eq("building", building);
|
260
|
|
- queryWrapper.eq("unit", unit);
|
261
|
|
- queryWrapper.eq("room_no", roomNo);
|
262
|
|
- queryWrapper.eq("community_id", userElement.getCommunityId());
|
263
|
|
- TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectOne(queryWrapper);
|
264
|
|
-
|
265
|
|
- // 查询app用户id
|
266
|
|
- QueryWrapper<TaUser> userQueryWrapper = new QueryWrapper<>();
|
267
|
|
- userQueryWrapper.eq("community_id", userElement.getCommunityId());
|
268
|
|
- userQueryWrapper.eq("login_name", buildingOwnerInfo.getOwnerTel());
|
269
|
|
- TaUser taUser = taUserMapper.selectOne(userQueryWrapper);
|
270
|
|
-
|
271
|
263
|
BillInvoice billInvoice = new BillInvoice();
|
|
264
|
+
|
|
265
|
+ /**
|
|
266
|
+ * 缴费单挂靠在 房产下面
|
|
267
|
+ */
|
|
268
|
+
|
|
269
|
+ /**
|
|
270
|
+ * 需要知道这个房产的业主
|
|
271
|
+ */
|
|
272
|
+ TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddress(userElement.getCommunityId(), phase, building, unit, level, roomNo);
|
|
273
|
+
|
|
274
|
+ TaUser ownerUser = null;
|
|
275
|
+ TpBuildingOwnerInfo buildingOwnerInfo = null;
|
|
276
|
+ if (null != userVerify) {
|
|
277
|
+ // 业主个人信息
|
|
278
|
+ ownerUser = taUserMapper.selectById(userVerify.getUserId());
|
|
279
|
+
|
|
280
|
+ // 楼栋资料库
|
|
281
|
+ buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityIdAndAddress(userElement.getCommunityId(),
|
|
282
|
+ userVerify.getPhaseId(), userVerify.getBuildingId(), userVerify.getUnitId(),
|
|
283
|
+ userVerify.getLevelId(), userVerify.getRoomNoId(), ownerUser.getLoginName());
|
|
284
|
+ if (null == buildingOwnerInfo) {
|
|
285
|
+ throw new WisdomException("手机号为:" + ownerUser.getLoginName() + " 楼栋业主资料不存在!");
|
|
286
|
+ }
|
|
287
|
+ billInvoice.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
|
|
288
|
+ }
|
|
289
|
+
|
|
290
|
+ if (null != ownerUser) {
|
|
291
|
+ billInvoice.setTaUserId(ownerUser.getId());
|
|
292
|
+ }
|
|
293
|
+ // 设置房号
|
|
294
|
+ billInvoice.setRoomNoId(roomNo);
|
272
|
295
|
billInvoice.setBillId(billId);
|
273
|
296
|
billInvoice.setCommunityId(userElement.getCommunityId());
|
274
|
297
|
billInvoice.setBillInvoiceExplain(billInvoiceExplain);
|
275
|
298
|
billInvoice.setPayPrice(PayPriceUtils.yuanConversionPoints(payPrice));
|
276
|
|
- billInvoice.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
|
277
|
|
- if (null != taUser) {
|
278
|
|
- billInvoice.setTaUserId(taUser.getId());
|
279
|
|
- }
|
280
|
299
|
billInvoice.setBillStatus("0");
|
281
|
300
|
billInvoice.setCreateUser(userElement.getId());
|
282
|
301
|
billInvoice.setCreateDate(new Date());
|
283
|
302
|
billInvoice.setStatus(0);
|
284
|
|
- billInvoice.setOutTradeNo("");
|
285
|
303
|
|
286
|
304
|
int result = billInvoiceMapper.insert(billInvoice);
|
287
|
|
- billInvoice.setOutTradeNo(String.valueOf(System.currentTimeMillis()) + billInvoice.getId());
|
288
|
|
- result = billInvoiceMapper.updateById(billInvoice);
|
289
|
305
|
if (result <= 0) {
|
290
|
306
|
throw new WisdomException("添加失败");
|
291
|
307
|
}
|
|
@@ -552,11 +568,14 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
552
|
568
|
List<BillInvoice> records = billInvoiceIPage.getRecords();
|
553
|
569
|
records.forEach(e->{
|
554
|
570
|
TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(e.getBuildingOwnerInfoId());
|
555
|
|
- e.setOwnerName(buildingOwnerInfo.getOwnerName());
|
556
|
|
- e.setPhase(buildingOwnerInfo.getPhaseName());
|
557
|
|
- e.setBuilding(buildingOwnerInfo.getBuildingName());
|
558
|
|
- e.setUnit(buildingOwnerInfo.getUnitName());
|
559
|
|
- e.setLevel(buildingOwnerInfo.getLevelName());
|
|
571
|
+ if (null != buildingOwnerInfo) {
|
|
572
|
+ e.setOwnerName(buildingOwnerInfo.getOwnerName());
|
|
573
|
+ }
|
|
574
|
+ TpRoomNo tpRoomNo = tpRoomNoMapper.selectById(e.getRoomNoId());
|
|
575
|
+ e.setPhase(tpRoomNo.getPhaseName());
|
|
576
|
+ e.setBuilding(tpRoomNo.getBuildingName());
|
|
577
|
+ e.setUnit(tpRoomNo.getUnitName());
|
|
578
|
+ e.setLevel(tpRoomNo.getLevelName());
|
560
|
579
|
});
|
561
|
580
|
|
562
|
581
|
Map<String, Object> map = Maps.newHashMap();
|