魏熙美 пре 6 година
родитељ
комит
330fd397bb

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBillInvoiceMapper.java Прегледај датотеку

@@ -24,11 +24,11 @@ public interface TpBillInvoiceMapper {
24 24
     /**
25 25
      * 分页获取缴费和未缴费的数据
26 26
      * @param communityId
27
-     * @param buildingOwnerInfoId
27
+     * @param roomNoId 房间id
28 28
      * @param payType
29 29
      * @return
30 30
      */
31
-    List<Map<String, Object>> getBillsList(@Param("communityId") Integer communityId,@Param("buildingOwnerInfoId") Integer buildingOwnerInfoId,@Param("payType") Integer payType);
31
+    List<Map<String, Object>> getBillsList(@Param("communityId") Integer communityId,@Param("roomNoId") Integer roomNoId,@Param("payType") Integer payType);
32 32
     
33 33
     /**
34 34
      * 获取账单的详细信息

+ 10
- 14
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java Прегледај датотеку

@@ -54,24 +54,20 @@ public class BillServiceImpl implements BillServiceI {
54 54
 		 * 账单 关联的是房产,
55 55
  		 */
56 56
 
57
-		/**
58
-		 * 获取这个房产的业主
59
-		 */
60
-
61
-		TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddressAndRoleId(userElement.getCommunityId(),
62
-										userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(),
63
-										userElement.getLevelId(), userElement.getRoomNoId());
64
-		// 业主信息
65
-		TaUser user = taUserMapper.selectByPrimaryKey(userVerify.getUserId());
66
-
67
-		TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityAndAddressAndPhone(userElement.getCommunityId(),
68
-				userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(),
69
-				userElement.getLevelId(), userElement.getRoomNoId(), user.getLoginName());
57
+//		TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddressAndRoleId(userElement.getCommunityId(),
58
+//										userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(),
59
+//										userElement.getLevelId(), userElement.getRoomNoId());
60
+//		// 业主信息
61
+//		TaUser user = taUserMapper.selectByPrimaryKey(userVerify.getUserId());
62
+//
63
+//		TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityAndAddressAndPhone(userElement.getCommunityId(),
64
+//				userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(),
65
+//				userElement.getLevelId(), userElement.getRoomNoId(), user.getLoginName());
70 66
 
71 67
 
72 68
 		//使用分页插件
73 69
 		Page<Map<String,Object>> page = PageHelper.startPage(pageNum, pageSize);
74
-		List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(userElement.getCommunityId(), tpBuildingOwnerInfo.getId(), payType);
70
+		List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(userElement.getCommunityId(), userElement.getRoomNoId(), payType);
75 71
 		billsList.forEach(e-> {
76 72
 			String payPrice = String.valueOf(e.get("payPrice"));
77 73
 			Double payPriceDouble = Double.parseDouble(payPrice) / 100;

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml Прегледај датотеку

@@ -248,7 +248,7 @@
248 248
             AND (i.bill_status = 1 or i.bill_status = 2)
249 249
           </if>
250 250
           and i.status=1
251
-          AND i.building_owner_info_id = #{buildingOwnerInfoId,jdbcType=INTEGER}
251
+          AND i.room_no_id = #{roomNoId,jdbcType=INTEGER}
252 252
   </select>
253 253
 
254 254
   <select id="getBillInvoiceDetail" resultType="map">

+ 25
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java Прегледај датотеку

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 6
 import com.community.huiju.model.TaUserVerify;
7 7
 import org.apache.ibatis.annotations.Mapper;
8 8
 import org.apache.ibatis.annotations.Param;
9
+import org.apache.ibatis.annotations.ResultType;
10
+import org.apache.ibatis.annotations.Select;
9 11
 
10 12
 import java.util.List;
11 13
 
@@ -40,6 +42,28 @@ public interface TaUserVerifyMapper extends BaseMapper<TaUserVerify> {
40 42
      * @param roomNoId
41 43
      * @return
42 44
      */
43
-    TaUserVerify selectCommunityAndAddress(Integer communityId,Integer phaseId,Integer buildingId, Integer unitId,Integer levelId,Integer roomNoId);
45
+    TaUserVerify selectCommunityAndAddress(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId, @Param("buildingId") Integer buildingId, @Param("unitId") Integer unitId, @Param("levelId") Integer levelId, @Param("roomNoId") Integer roomNoId);
46
+
47
+    /**
48
+     * 根据 小区id 、 小区、期、栋、单元、楼层、户号 进行条件查询出 已审核通过的并且是业主
49
+     * @param communityId
50
+     * @param phaseName
51
+     * @param buildingName
52
+     * @param unitName
53
+     * @param levelName
54
+     * @param roomNoName
55
+     * @return
56
+     */
57
+    @ResultType(TaUserVerify.class)
58
+    @Select("select  *  from ta_user_verify " +
59
+            "where community_id = #{communityId} " +
60
+            "and phase_name = #{phaseName} " +
61
+            "and building_name = #{buildingName} " +
62
+            "and unit_name = #{unitName} " +
63
+            "and level_name = #{levelName} " +
64
+            "and room_no_name = #{roomNoName} " +
65
+            "and verify_status = 1 " +
66
+            "and role_id = 1")
67
+    TaUserVerify selectCommunityAndAddressName(@Param("communityId") Integer communityId, @Param("phaseName") String phaseName, @Param("buildingName") String buildingName, @Param("unitName") String unitName, @Param("levelName") String levelName, @Param("roomNoName") String roomNoName);
44 68
 
45 69
 }

+ 25
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java Прегледај датотеку

@@ -55,4 +55,29 @@ public interface TpBuildingOwnerInfoMapper extends BaseMapper<TpBuildingOwnerInf
55 55
             "AND tpio.room_no_id = #{roomNoId} " +
56 56
             "AND tpio.owner_tel = #{ownerTel}")
57 57
     TpBuildingOwnerInfo selectCommunityIdAndAddress(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId, @Param("buildingId") Integer buildingId, @Param("unitId") Integer unitId, @Param("levelId") Integer levelId, @Param("roomNoId") Integer roomNoId, @Param("ownerTel") String ownerTel);
58
+
59
+
60
+    /**
61
+     * 更具 小区、期、楼栋、单元、楼层、户号、手机号 查询
62
+     * @param communityId
63
+     * @param phaseName
64
+     * @param buildingName
65
+     * @param unitName
66
+     * @param levelName
67
+     * @param roomNoName
68
+     * @param ownerTel
69
+     * @return
70
+     */
71
+    @ResultType(TpBuildingOwnerInfo.class)
72
+    @Select("select * FROM tp_building_owner_info tpio " +
73
+            "WHERE tpio.community_id = #{communityId} " +
74
+            "and tpio.phase_name = #{phaseName} " +
75
+            "and tpio.building_name = #{buildingName} " +
76
+            "and tpio.unit_name = #{unitName} " +
77
+            "and tpio.level_name = #{levelName} " +
78
+            "AND tpio.room_no_name = #{roomNoName} " +
79
+            "AND tpio.owner_tel = #{ownerTel}")
80
+    TpBuildingOwnerInfo selectCommunityIdAndAddress(@Param("communityId") Integer communityId, @Param("phaseName") String phaseName, @Param("buildingName") Integer buildingName, @Param("unitName") Integer unitName, @Param("levelName") Integer levelName, @Param("roomNoName") Integer roomNoName, @Param("ownerTel") String ownerTel);
81
+
82
+
58 83
 }

+ 25
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpRoomNoMapper.java Прегледај датотеку

@@ -3,6 +3,9 @@ package com.community.huiju.dao;
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4
 import com.community.huiju.model.TpRoomNo;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.ResultType;
8
+import org.apache.ibatis.annotations.Select;
6 9
 
7 10
 /**
8 11
  * <p>
@@ -15,4 +18,26 @@ import org.apache.ibatis.annotations.Mapper;
15 18
 @Mapper
16 19
 public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
17 20
 
21
+
22
+    /**
23
+     * 根据 小区,期,栋,单元,楼层,房间  查询房间信息
24
+     * @param communityId
25
+     * @param phaseName
26
+     * @param buildingName
27
+     * @param unitName
28
+     * @param levelName
29
+     * @param roomNoName
30
+     * @return
31
+     */
32
+    @ResultType(TpRoomNo.class)
33
+    @Select("select * from tp_room_no " +
34
+            "where community_id = #{communityId} " +
35
+            "and phase_name = #{phaseName} " +
36
+            "and building_name = #{buildingName} " +
37
+            "and unit_name = #{unitName} " +
38
+            "and level_name = #{levelName} " +
39
+            "and name = #{roomNoName}")
40
+    TpRoomNo selectCommunityIdAndAddressName(@Param("communityId") Integer communityId, @Param("phaseName") String phaseName, @Param("buildingName") String buildingName, @Param("unitName") String unitName, @Param("levelName") String levelName, @Param("roomNoName") String roomNoName);
41
+
42
+
18 43
 }

+ 5
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/BillInvoice.java Прегледај датотеку

@@ -119,6 +119,11 @@ public class BillInvoice implements Serializable {
119 119
      */
120 120
     private String payType;
121 121
 
122
+    /**
123
+     * 房间id,账单最终绑定到房间号下
124
+     */
125
+    private Integer roomNoId;
126
+
122 127
     /**
123 128
      * 业主姓名
124 129
      */

+ 51
- 32
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java Прегледај датотеку

@@ -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();

+ 34
- 26
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java Прегледај датотеку

@@ -91,6 +91,12 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
91 91
     @Autowired
92 92
     private IMessageService iMessageService;
93 93
 
94
+    @Autowired
95
+    private TaUserVerifyMapper taUserVerifyMapper;
96
+
97
+    @Autowired
98
+    private TpRoomNoMapper tpRoomNoMapper;
99
+
94 100
     @Override
95 101
     @Transactional(rollbackFor = Exception.class)
96 102
     public ResponseBean updateBillNameAndBillExplainAndEndDate(UserElement userElement, String parameter) {
@@ -331,46 +337,48 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
331 337
                 billInvoice.setCommunityId(userElement.getCommunityId());
332 338
                 billInvoice.setBillId(bill.getId());
333 339
 
340
+                // 根据 小区,期,栋,单元,楼层,房号 -》 查询房号id
341
+                // 因为和房间关联
342
+
334 343
                 /**
335 344
                  * 需要知道这个房产的业主
336 345
                  */
337
-                // 楼栋资料库
338
-                QueryWrapper<TpBuildingOwnerInfo> queryWrapper = new QueryWrapper<>();
339
-                queryWrapper.eq("phase_id", e.getPhase());
340
-                queryWrapper.eq("building_id", e.getBuilding()); 
341
-                queryWrapper.eq("unit_id", e.getUnit());
342
-                queryWrapper.eq("level_id", e.getLevel());
343
-                queryWrapper.eq("room_no_id", e.getRoomNo());
344
-                queryWrapper.eq("community_id", userElement.getCommunityId());
345
-                TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectOne(queryWrapper);
346
-                if (null == buildingOwnerInfo) {
347
-                    throw new WisdomException("请输入正确的用户信息! ");
346
+                TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddressName(userElement.getCommunityId(), e.getPhase(), e.getBuilding(), e.getUnit(), e.getLevel(), e.getRoomNo());
347
+
348
+                TaUser ownerUser = null;
349
+                TpBuildingOwnerInfo buildingOwnerInfo = null;
350
+                if (null != userVerify) {
351
+                    // 业主个人信息
352
+                    ownerUser = taUserMapper.selectById(userVerify.getUserId());
353
+
354
+                    // 楼栋资料库
355
+                    buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityIdAndAddress(userElement.getCommunityId(),
356
+                                                userVerify.getPhaseId(), userVerify.getBuildingId(), userVerify.getUnitId(),
357
+                                                userVerify.getLevelId(), userVerify.getRoomNoId(), ownerUser.getLoginName());
358
+                    if (null == buildingOwnerInfo) {
359
+                        throw new WisdomException("手机号为:" + ownerUser.getLoginName() + " 楼栋业主资料不存在!");
360
+                    }
361
+                    billInvoice.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
362
+
348 363
                 }
349 364
 
350 365
                 /**
351
-                 * 如果用户不在 app 里面,没有关联, 那么就设置 taUserId
352
-                 * 等业主第一次登陆的时候, 再去自动匹配上去
366
+                 * 查询房号
353 367
                  */
354
-
355
-                // 查询app用户id
356
-                QueryWrapper<TaUser> userQueryWrapper = new QueryWrapper<>();
357
-                userQueryWrapper.eq("community_id", userElement.getCommunityId());
358
-                userQueryWrapper.eq("login_name", buildingOwnerInfo.getOwnerTel());
359
-                TaUser taUser = taUserMapper.selectOne(userQueryWrapper);
360
-
361
-                billInvoice.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
362
-                if (null != taUser) {
363
-                    billInvoice.setTaUserId(taUser.getId());
368
+                TpRoomNo tpRoomNo = tpRoomNoMapper.selectCommunityIdAndAddressName(userElement.getCommunityId(), e.getPhase(), e.getBuilding(), e.getUnit(), e.getLevel(), e.getRoomNo());
369
+                if (null == tpRoomNo) {
370
+                    throw new WisdomException("房产:" + e.getPhase() + e.getBuilding() + e.getUnit() + e.getLevel() + e.getRoomNo() + " 不存在!请核对!");
364 371
                 }
372
+                if (null != ownerUser) {
373
+                    billInvoice.setTaUserId(ownerUser.getId());
374
+                }
375
+                billInvoice.setRoomNoId(tpRoomNo.getId());
365 376
                 billInvoice.setBillInvoiceExplain(e.getBillExplain());
366 377
                 billInvoice.setPayPrice(e.getPayPrice());
367 378
                 billInvoice.setBillStatus("0");
368 379
                 billInvoice.setCreateUser(userElement.getId());
369 380
                 billInvoice.setCreateDate(new Date());
370 381
                 billInvoice.setStatus(1);
371
-//                Random random = new Random();
372
-//                billInvoice.setOutTradeNo(String.valueOf(System.currentTimeMillis()) + random.nextInt());
373
-
374 382
 
375 383
                 return billInvoice;
376 384
             }).collect(Collectors.toList());

+ 24
- 23
CODE/smart-community/property-api/src/main/resources/mapper/BillInvoiceMapper.xml Прегледај датотеку

@@ -7,30 +7,31 @@
7 7
         SELECT
8 8
             tpi.*,
9 9
             tboi.owner_name as ownerName,
10
-            tboi.phase as phase,
11
-            tboi.building as building,
12
-            tboi.unit as unit,
13
-            tboi.room_no as roomNo,
14
-            tpi.out_trade_no as billStatement,
10
+            tpro.phase_name as phase,
11
+            tpro.building_name as building,
12
+            tpro.unit_name as unit,
13
+            tpro.name as roomNo,
14
+            tpbo.order_bumber as billStatement,
15 15
             (SELECT user_name from tp_user tu WHERE tu.id = tpi.create_user) as createUserName,
16 16
             (SELECT user_name from tp_user tu WHERE tu.id = tpi.update_user) as updateUserName
17 17
         FROM
18 18
           tp_bill_invoice tpi
19
+        LEFT JOIN tp_room_no tpro ON tpi.room_no_id = tpro.id
20
+        LEFT JOIN tp_bill_order tpbo ON tpi.id = tpbo.tp_bill_invoice_id
19 21
         LEFT JOIN tp_building_owner_info tboi ON tpi.building_owner_info_id = tboi.id
20
-        LEFT JOIN tp_bill_statement tbs ON tpi.bill_statement_id = tbs.id
21 22
         <where>
22 23
             <trim prefixOverrides="and | or">
23 24
                 <if test="map.phase != null and map.phase != ''">
24
-                    AND tboi.phase = #{map.phase}
25
+                    AND tpro.phase_id = #{map.phase}
25 26
                 </if>
26 27
                 <if test="map.building != null and map.building != ''">
27
-                    AND tboi.building = #{map.building}
28
+                    AND tpro.building_id = #{map.building}
28 29
                 </if>
29 30
                 <if test="map.unit != null and map.unit != ''">
30
-                    AND tboi.unit = #{map.unit}
31
+                    AND tpro.unit_id = #{map.unit}
31 32
                 </if>
32 33
                 <if test="map.roomNo != null and map.roomNo != ''">
33
-                    AND tboi.room_no = #{map.roomNo}
34
+                    AND tpro.room_no_id = #{map.roomNo}
34 35
                 </if>
35 36
                 <if test="map.ownerName != null and map.ownerName != ''">
36 37
                     AND tboi.owner_name like CONCAT('%',#{map.ownerName},'%')
@@ -59,14 +60,14 @@
59 60
         SELECT
60 61
         tpi.*,
61 62
         tboi.owner_name as ownerName,
62
-        tboi.phase as phase,
63
-        tboi.building as building,
64
-        tboi.unit as unit,
65
-        tboi.room_no as roomNo
63
+        tprn.phase_name as phase,
64
+        tprn.building_name as building,
65
+        tprn.unit_name as unit,
66
+        tprn.name as roomNo
66 67
         FROM
67 68
         tp_bill_invoice tpi
68
-        LEFT JOIN tp_building_owner_info tboi ON tpi.building_owner_info_id = tboi.id
69
-        LEFT JOIN tp_bill_statement tbs ON tpi.bill_statement_id = tbs.id
69
+        LEFT JOIN tp_room_no tprn ON tpi.room_no_id = tprn.id
70
+        LEFT JOIN tp_building_owner_info tboi ON tpi.bill_statement_id = tboi.id
70 71
         <where>
71 72
             <trim prefixOverrides="and | or">
72 73
                 <if test="map.billId != null">
@@ -79,7 +80,6 @@
79 80
             </trim>
80 81
         </where>
81 82
         order by tpi.create_date DESC
82
-
83 83
     </select>
84 84
 
85 85
     <select id="selectBillInvoiceEffective" resultType="com.community.huiju.model.BillInvoice">
@@ -87,17 +87,18 @@
87 87
         SELECT
88 88
         tpi.*,
89 89
         tboi.owner_name as ownerName,
90
-        tboi.phase as phase,
91
-        tboi.building as building,
92
-        tboi.unit as unit,
93
-        tboi.room_no as roomNo,
94
-        tbs.id as billStatement,
90
+        tpro.phase_name as phase,
91
+        tpro.building_name as building,
92
+        tpro.unit_name as unit,
93
+        tpro.name as roomNo,
94
+        tpbo.order_bumber as billStatement,
95 95
         (SELECT user_name from tp_user tu WHERE tu.id = tpi.create_user) as createUserName,
96 96
         (SELECT user_name from tp_user tu WHERE tu.id = tpi.update_user) as updateUserName
97 97
         FROM
98 98
         tp_bill_invoice tpi
99
+        LEFT JOIN tp_room_no tpro ON tpi.room_no_id = tpro.id
100
+        LEFT JOIN tp_bill_order tpbo ON tpi.id = tpbo.tp_bill_invoice_id
99 101
         LEFT JOIN tp_building_owner_info tboi ON tpi.building_owner_info_id = tboi.id
100
-        LEFT JOIN tp_bill_statement tbs ON tpi.bill_statement_id = tbs.id
101 102
         <where>
102 103
             <trim prefixOverrides="and | or">
103 104
                 <if test="map.billId != null">

+ 1
- 0
VUECODE/smart-property-manage/src/api/billInvoice.js Прегледај датотеку

@@ -70,6 +70,7 @@ export function addTempBillInvoice(data) {
70 70
       phase: data.phaseId, // 期/区
71 71
       building: data.buildingId, // 栋
72 72
       unit: data.unitId, // 单元
73
+      level: data.levelId, // 楼层
73 74
       roomNo: data.roomNoId, // 户号
74 75
       worthOf: data.worthOf, // 催缴日期
75 76
       billInvoiceExplain: data.billInvoiceExplain, // 收费单说明

+ 4
- 4
VUECODE/smart-property-manage/src/views/bill/info/add/index.vue Прегледај датотеку

@@ -139,11 +139,11 @@ export default {
139 139
         this.$message.error('栋')
140 140
         return
141 141
       }
142
-      // if (this.formInline.building === '') {
143
-      //   this.$message.error('单元')
144
-      //   return
145
-      // }
146 142
       if (this.formInline.unit === '') {
143
+        this.$message.error('单元')
144
+        return
145
+      }
146
+      if (this.formInline.levelId === '') {
147 147
         this.$message.error('楼层')
148 148
         return
149 149
       }

+ 1
- 1
VUECODE/smart-property-manage/src/views/bill/info/index.vue Прегледај датотеку

@@ -124,7 +124,7 @@
124 124
         </template>
125 125
       </el-table-column>
126 126
       <el-table-column
127
-        prop="outTradeNo"
127
+        prop="billStatement"
128 128
         label="订单号"
129 129
         align="center" width="170"/>
130 130
       <el-table-column