dingxin 6 yıl önce
ebeveyn
işleme
c5b9233ead
19 değiştirilmiş dosya ile 246 ekleme ve 107 silme
  1. 2
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/HkController.java
  2. 2
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBillInvoiceMapper.java
  3. 10
    14
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java
  4. 0
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/HKServiceImpl.java
  5. 1
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml
  6. 25
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java
  7. 25
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java
  8. 25
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpRoomNoMapper.java
  9. 9
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/feign/TaUserFeignService.java
  10. 9
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/feign/impl/TaUserFeignFallBack.java
  11. 5
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/BillInvoice.java
  12. 51
    32
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillInvoiceServiceImpl.java
  13. 34
    26
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java
  14. 8
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java
  15. 10
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServiceImpl.java
  16. 24
    23
      CODE/smart-community/property-api/src/main/resources/mapper/BillInvoiceMapper.xml
  17. 1
    0
      VUECODE/smart-property-manage/src/api/billInvoice.js
  18. 4
    4
      VUECODE/smart-property-manage/src/views/bill/info/add/index.vue
  19. 1
    1
      VUECODE/smart-property-manage/src/views/bill/info/index.vue

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/HkController.java Dosyayı Görüntüle

43
 		return hkResponseBean;
43
 		return hkResponseBean;
44
 	}
44
 	}
45
 
45
 
46
-	@RequestMapping(value = "推送HK人员", method = RequestMethod.POST)
47
-	public ResponseBean pushHKPerson(@RequestParam("appUserId") String appUserId) {
46
+	@RequestMapping(value = "/pushHKPerson/{appUserId}", method = RequestMethod.POST)
47
+	public ResponseBean pushHKPerson(@PathVariable("appUserId") String appUserId) {
48
 		ResponseBean responseBean = new ResponseBean();
48
 		ResponseBean responseBean = new ResponseBean();
49
 		responseBean = ihkService.pushPerson(appUserId);
49
 		responseBean = ihkService.pushPerson(appUserId);
50
 		return responseBean;
50
 		return responseBean;

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBillInvoiceMapper.java Dosyayı Görüntüle

24
     /**
24
     /**
25
      * 分页获取缴费和未缴费的数据
25
      * 分页获取缴费和未缴费的数据
26
      * @param communityId
26
      * @param communityId
27
-     * @param buildingOwnerInfoId
27
+     * @param roomNoId 房间id
28
      * @param payType
28
      * @param payType
29
      * @return
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 Dosyayı Görüntüle

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
 		Page<Map<String,Object>> page = PageHelper.startPage(pageNum, pageSize);
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
 		billsList.forEach(e-> {
71
 		billsList.forEach(e-> {
76
 			String payPrice = String.valueOf(e.get("payPrice"));
72
 			String payPrice = String.valueOf(e.get("payPrice"));
77
 			Double payPriceDouble = Double.parseDouble(payPrice) / 100;
73
 			Double payPriceDouble = Double.parseDouble(payPrice) / 100;

+ 0
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/HKServiceImpl.java Dosyayı Görüntüle

70
             return responseBean;
70
             return responseBean;
71
         }
71
         }
72
         responseBean.addError("操作失败!");
72
         responseBean.addError("操作失败!");
73
-        responseBean.addError("操作失败!");
74
         return responseBean;
73
         return responseBean;
75
     }
74
     }
76
 
75
 

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpBillInvoiceMapper.xml Dosyayı Görüntüle

248
             AND (i.bill_status = 1 or i.bill_status = 2)
248
             AND (i.bill_status = 1 or i.bill_status = 2)
249
           </if>
249
           </if>
250
           and i.status=1
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
   </select>
252
   </select>
253
 
253
 
254
   <select id="getBillInvoiceDetail" resultType="map">
254
   <select id="getBillInvoiceDetail" resultType="map">

+ 25
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java Dosyayı Görüntüle

6
 import com.community.huiju.model.TaUserVerify;
6
 import com.community.huiju.model.TaUserVerify;
7
 import org.apache.ibatis.annotations.Mapper;
7
 import org.apache.ibatis.annotations.Mapper;
8
 import org.apache.ibatis.annotations.Param;
8
 import org.apache.ibatis.annotations.Param;
9
+import org.apache.ibatis.annotations.ResultType;
10
+import org.apache.ibatis.annotations.Select;
9
 
11
 
10
 import java.util.List;
12
 import java.util.List;
11
 
13
 
40
      * @param roomNoId
42
      * @param roomNoId
41
      * @return
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 Dosyayı Görüntüle

55
             "AND tpio.room_no_id = #{roomNoId} " +
55
             "AND tpio.room_no_id = #{roomNoId} " +
56
             "AND tpio.owner_tel = #{ownerTel}")
56
             "AND tpio.owner_tel = #{ownerTel}")
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);
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 Dosyayı Görüntüle

3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
 import com.community.huiju.model.TpRoomNo;
4
 import com.community.huiju.model.TpRoomNo;
5
 import org.apache.ibatis.annotations.Mapper;
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
  * <p>
11
  * <p>
15
 @Mapper
18
 @Mapper
16
 public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
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
 }

+ 9
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/feign/TaUserFeignService.java Dosyayı Görüntüle

3
 import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.mode.ResponseBean;
4
 import com.community.huiju.feign.impl.TaUserFeignFallBack;
4
 import com.community.huiju.feign.impl.TaUserFeignFallBack;
5
 import org.springframework.cloud.openfeign.FeignClient;
5
 import org.springframework.cloud.openfeign.FeignClient;
6
+import org.springframework.web.bind.annotation.PathVariable;
6
 import org.springframework.web.bind.annotation.RequestBody;
7
 import org.springframework.web.bind.annotation.RequestBody;
7
 import org.springframework.web.bind.annotation.RequestMapping;
8
 import org.springframework.web.bind.annotation.RequestMapping;
8
 import org.springframework.web.bind.annotation.RequestMethod;
9
 import org.springframework.web.bind.annotation.RequestMethod;
21
     @RequestMapping(value = "/user/register",method = RequestMethod.POST)
22
     @RequestMapping(value = "/user/register",method = RequestMethod.POST)
22
     ResponseBean register(@RequestBody String parameter);
23
     ResponseBean register(@RequestBody String parameter);
23
 
24
 
25
+    /**
26
+     * 推送海康人员添加
27
+     * @param appUserId
28
+     * @return
29
+     */
30
+    @RequestMapping(value = "/pushHKPerson/{appUserId}", method = RequestMethod.POST)
31
+    ResponseBean pushHKPerson(@PathVariable("appUserId") Integer appUserId);
32
+
24
 }
33
 }

+ 9
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/feign/impl/TaUserFeignFallBack.java Dosyayı Görüntüle

9
 
9
 
10
     @Override
10
     @Override
11
     public ResponseBean register(String parameter) {
11
     public ResponseBean register(String parameter) {
12
+        return back();
13
+    }
14
+
15
+    @Override
16
+    public ResponseBean pushHKPerson(Integer appUserId) {
17
+        return back();
18
+    }
19
+
20
+    private ResponseBean back() {
12
         log.error("app-api 远端服务请求失败!");
21
         log.error("app-api 远端服务请求失败!");
13
         ResponseBean responseBean = new ResponseBean();
22
         ResponseBean responseBean = new ResponseBean();
14
         responseBean.addError("app-api 远端服务请求失败!");
23
         responseBean.addError("app-api 远端服务请求失败!");

+ 5
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/BillInvoice.java Dosyayı Görüntüle

119
      */
119
      */
120
     private String payType;
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 Dosyayı Görüntüle

60
     @Autowired
60
     @Autowired
61
     private IMessageService iMessageService;
61
     private IMessageService iMessageService;
62
 
62
 
63
+    @Autowired
64
+    private TpRoomNoMapper tpRoomNoMapper;
65
+
66
+    @Autowired
67
+    private TaUserVerifyMapper taUserVerifyMapper;
68
+
63
     @Override
69
     @Override
64
     public ResponseBean getBillList(String parameter, UserElement userElement) {
70
     public ResponseBean getBillList(String parameter, UserElement userElement) {
65
         ResponseBean responseBean = new ResponseBean();
71
         ResponseBean responseBean = new ResponseBean();
187
                 billInvoice.setBillStatementId(billStatement.getId());
193
                 billInvoice.setBillStatementId(billStatement.getId());
188
                 billInvoice.setPayName(billStatement.getPayName());
194
                 billInvoice.setPayName(billStatement.getPayName());
189
                 billInvoice.setPayDate(new Date());
195
                 billInvoice.setPayDate(new Date());
190
-                billInvoice.setOutTradeNo(String.valueOf(System.currentTimeMillis()) + billInvoice.getId());
191
                 billInvoiceMapper.updateById(billInvoice);
196
                 billInvoiceMapper.updateById(billInvoice);
192
 
197
 
193
                 // 修改缴费户数
198
                 // 修改缴费户数
231
         // 收费项ID
236
         // 收费项ID
232
         Integer billId = jsonObject.getInteger("billId");
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
         // Date worthOf = jsonObject.getDate("worthOf");
249
         // Date worthOf = jsonObject.getDate("worthOf");
243
         // 收费单说明
250
         // 收费单说明
253
 //            return responseBean;
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
         BillInvoice billInvoice = new BillInvoice();
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
         billInvoice.setBillId(billId);
295
         billInvoice.setBillId(billId);
273
         billInvoice.setCommunityId(userElement.getCommunityId());
296
         billInvoice.setCommunityId(userElement.getCommunityId());
274
         billInvoice.setBillInvoiceExplain(billInvoiceExplain);
297
         billInvoice.setBillInvoiceExplain(billInvoiceExplain);
275
         billInvoice.setPayPrice(PayPriceUtils.yuanConversionPoints(payPrice));
298
         billInvoice.setPayPrice(PayPriceUtils.yuanConversionPoints(payPrice));
276
-        billInvoice.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
277
-        if (null != taUser) {
278
-            billInvoice.setTaUserId(taUser.getId());
279
-        }
280
         billInvoice.setBillStatus("0");
299
         billInvoice.setBillStatus("0");
281
         billInvoice.setCreateUser(userElement.getId());
300
         billInvoice.setCreateUser(userElement.getId());
282
         billInvoice.setCreateDate(new Date());
301
         billInvoice.setCreateDate(new Date());
283
         billInvoice.setStatus(0);
302
         billInvoice.setStatus(0);
284
-        billInvoice.setOutTradeNo("");
285
 
303
 
286
         int result = billInvoiceMapper.insert(billInvoice);
304
         int result = billInvoiceMapper.insert(billInvoice);
287
-        billInvoice.setOutTradeNo(String.valueOf(System.currentTimeMillis()) + billInvoice.getId());
288
-        result = billInvoiceMapper.updateById(billInvoice);
289
         if (result <= 0) {
305
         if (result <= 0) {
290
             throw new WisdomException("添加失败");
306
             throw new WisdomException("添加失败");
291
         }
307
         }
552
         List<BillInvoice> records = billInvoiceIPage.getRecords();
568
         List<BillInvoice> records = billInvoiceIPage.getRecords();
553
         records.forEach(e->{
569
         records.forEach(e->{
554
             TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(e.getBuildingOwnerInfoId());
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
         Map<String, Object> map = Maps.newHashMap();
581
         Map<String, Object> map = Maps.newHashMap();

+ 34
- 26
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java Dosyayı Görüntüle

91
     @Autowired
91
     @Autowired
92
     private IMessageService iMessageService;
92
     private IMessageService iMessageService;
93
 
93
 
94
+    @Autowired
95
+    private TaUserVerifyMapper taUserVerifyMapper;
96
+
97
+    @Autowired
98
+    private TpRoomNoMapper tpRoomNoMapper;
99
+
94
     @Override
100
     @Override
95
     @Transactional(rollbackFor = Exception.class)
101
     @Transactional(rollbackFor = Exception.class)
96
     public ResponseBean updateBillNameAndBillExplainAndEndDate(UserElement userElement, String parameter) {
102
     public ResponseBean updateBillNameAndBillExplainAndEndDate(UserElement userElement, String parameter) {
331
                 billInvoice.setCommunityId(userElement.getCommunityId());
337
                 billInvoice.setCommunityId(userElement.getCommunityId());
332
                 billInvoice.setBillId(bill.getId());
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
                 billInvoice.setBillInvoiceExplain(e.getBillExplain());
376
                 billInvoice.setBillInvoiceExplain(e.getBillExplain());
366
                 billInvoice.setPayPrice(e.getPayPrice());
377
                 billInvoice.setPayPrice(e.getPayPrice());
367
                 billInvoice.setBillStatus("0");
378
                 billInvoice.setBillStatus("0");
368
                 billInvoice.setCreateUser(userElement.getId());
379
                 billInvoice.setCreateUser(userElement.getId());
369
                 billInvoice.setCreateDate(new Date());
380
                 billInvoice.setCreateDate(new Date());
370
                 billInvoice.setStatus(1);
381
                 billInvoice.setStatus(1);
371
-//                Random random = new Random();
372
-//                billInvoice.setOutTradeNo(String.valueOf(System.currentTimeMillis()) + random.nextInt());
373
-
374
 
382
 
375
                 return billInvoice;
383
                 return billInvoice;
376
             }).collect(Collectors.toList());
384
             }).collect(Collectors.toList());

+ 8
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java Dosyayı Görüntüle

107
     @Autowired
107
     @Autowired
108
     @Qualifier("phoneCodeImpl")
108
     @Qualifier("phoneCodeImpl")
109
     private ICode iCode;
109
     private ICode iCode;
110
+
111
+    @Autowired
112
+    private TaUserFeignService taUserFeignService;
110
     
113
     
111
     public static final Logger logger = LoggerFactory.getLogger(BuildingOwnerInfoServiceImpl.class);
114
     public static final Logger logger = LoggerFactory.getLogger(BuildingOwnerInfoServiceImpl.class);
112
     
115
     
184
             insertTpBuildingOwnerInfo(userVerify.getPhaseId(), userVerify.getBuildingId(), userVerify.getUnitId(),
187
             insertTpBuildingOwnerInfo(userVerify.getPhaseId(), userVerify.getBuildingId(), userVerify.getUnitId(),
185
                     userVerify.getLevelId(), userVerify.getRoomNoId(), userElement.getCommunityId(), userElement.getId(),
188
                     userVerify.getLevelId(), userVerify.getRoomNoId(), userElement.getCommunityId(), userElement.getId(),
186
                     userVerify.getGender(), user.getUserName(), user.getLoginName());
189
                     userVerify.getGender(), user.getUserName(), user.getLoginName());
190
+            // 推送海康
191
+            ResponseBean pushHKPerson = taUserFeignService.pushHKPerson(userVerify.getUserId());
192
+            if (!"0".equals(pushHKPerson.getCode())) {
193
+                throw new WisdomException("设备推送失败!");
194
+            }
187
         }
195
         }
188
 
196
 
189
 
197
 

+ 10
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServiceImpl.java Dosyayı Görüntüle

8
 import com.community.commom.mode.ResponseBean;
8
 import com.community.commom.mode.ResponseBean;
9
 import com.community.commom.session.UserElement;
9
 import com.community.commom.session.UserElement;
10
 import com.community.huiju.dao.*;
10
 import com.community.huiju.dao.*;
11
+import com.community.huiju.exception.WisdomException;
12
+import com.community.huiju.feign.TaUserFeignService;
11
 import com.community.huiju.model.*;
13
 import com.community.huiju.model.*;
12
 import com.community.huiju.service.ITaUserVerifyService;
14
 import com.community.huiju.service.ITaUserVerifyService;
13
 import org.apache.commons.lang.StringUtils;
15
 import org.apache.commons.lang.StringUtils;
54
     @Autowired
56
     @Autowired
55
     private TpRoomNoMapper tpRoomNoMapper;
57
     private TpRoomNoMapper tpRoomNoMapper;
56
 
58
 
59
+    @Autowired
60
+    private TaUserFeignService taUserFeignService;
61
+
57
     @Override
62
     @Override
58
     public ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize) {
63
     public ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize) {
59
         ResponseBean responseBean = new ResponseBean();
64
         ResponseBean responseBean = new ResponseBean();
173
                 // 添加楼栋数据
178
                 // 添加楼栋数据
174
                 insertBuildingOwnerInfo(userVerify, user);
179
                 insertBuildingOwnerInfo(userVerify, user);
175
             }
180
             }
181
+            // 推送海康
182
+            ResponseBean pushHKPerson = taUserFeignService.pushHKPerson(userVerify.getUserId());
183
+            if (!"0".equals(pushHKPerson.getCode())) {
184
+                throw new WisdomException("设备推送失败!");
185
+            }
176
         }
186
         }
177
         taUserVerifyMapper.updateById(userVerify);
187
         taUserVerifyMapper.updateById(userVerify);
178
 
188
 

+ 24
- 23
CODE/smart-community/property-api/src/main/resources/mapper/BillInvoiceMapper.xml Dosyayı Görüntüle

7
         SELECT
7
         SELECT
8
             tpi.*,
8
             tpi.*,
9
             tboi.owner_name as ownerName,
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
             (SELECT user_name from tp_user tu WHERE tu.id = tpi.create_user) as createUserName,
15
             (SELECT user_name from tp_user tu WHERE tu.id = tpi.create_user) as createUserName,
16
             (SELECT user_name from tp_user tu WHERE tu.id = tpi.update_user) as updateUserName
16
             (SELECT user_name from tp_user tu WHERE tu.id = tpi.update_user) as updateUserName
17
         FROM
17
         FROM
18
           tp_bill_invoice tpi
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
         LEFT JOIN tp_building_owner_info tboi ON tpi.building_owner_info_id = tboi.id
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
         <where>
22
         <where>
22
             <trim prefixOverrides="and | or">
23
             <trim prefixOverrides="and | or">
23
                 <if test="map.phase != null and map.phase != ''">
24
                 <if test="map.phase != null and map.phase != ''">
24
-                    AND tboi.phase = #{map.phase}
25
+                    AND tpro.phase_id = #{map.phase}
25
                 </if>
26
                 </if>
26
                 <if test="map.building != null and map.building != ''">
27
                 <if test="map.building != null and map.building != ''">
27
-                    AND tboi.building = #{map.building}
28
+                    AND tpro.building_id = #{map.building}
28
                 </if>
29
                 </if>
29
                 <if test="map.unit != null and map.unit != ''">
30
                 <if test="map.unit != null and map.unit != ''">
30
-                    AND tboi.unit = #{map.unit}
31
+                    AND tpro.unit_id = #{map.unit}
31
                 </if>
32
                 </if>
32
                 <if test="map.roomNo != null and map.roomNo != ''">
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
                 </if>
35
                 </if>
35
                 <if test="map.ownerName != null and map.ownerName != ''">
36
                 <if test="map.ownerName != null and map.ownerName != ''">
36
                     AND tboi.owner_name like CONCAT('%',#{map.ownerName},'%')
37
                     AND tboi.owner_name like CONCAT('%',#{map.ownerName},'%')
59
         SELECT
60
         SELECT
60
         tpi.*,
61
         tpi.*,
61
         tboi.owner_name as ownerName,
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
         FROM
67
         FROM
67
         tp_bill_invoice tpi
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
         <where>
71
         <where>
71
             <trim prefixOverrides="and | or">
72
             <trim prefixOverrides="and | or">
72
                 <if test="map.billId != null">
73
                 <if test="map.billId != null">
79
             </trim>
80
             </trim>
80
         </where>
81
         </where>
81
         order by tpi.create_date DESC
82
         order by tpi.create_date DESC
82
-
83
     </select>
83
     </select>
84
 
84
 
85
     <select id="selectBillInvoiceEffective" resultType="com.community.huiju.model.BillInvoice">
85
     <select id="selectBillInvoiceEffective" resultType="com.community.huiju.model.BillInvoice">
87
         SELECT
87
         SELECT
88
         tpi.*,
88
         tpi.*,
89
         tboi.owner_name as ownerName,
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
         (SELECT user_name from tp_user tu WHERE tu.id = tpi.create_user) as createUserName,
95
         (SELECT user_name from tp_user tu WHERE tu.id = tpi.create_user) as createUserName,
96
         (SELECT user_name from tp_user tu WHERE tu.id = tpi.update_user) as updateUserName
96
         (SELECT user_name from tp_user tu WHERE tu.id = tpi.update_user) as updateUserName
97
         FROM
97
         FROM
98
         tp_bill_invoice tpi
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
         LEFT JOIN tp_building_owner_info tboi ON tpi.building_owner_info_id = tboi.id
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
         <where>
102
         <where>
102
             <trim prefixOverrides="and | or">
103
             <trim prefixOverrides="and | or">
103
                 <if test="map.billId != null">
104
                 <if test="map.billId != null">

+ 1
- 0
VUECODE/smart-property-manage/src/api/billInvoice.js Dosyayı Görüntüle

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

+ 4
- 4
VUECODE/smart-property-manage/src/views/bill/info/add/index.vue Dosyayı Görüntüle

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

+ 1
- 1
VUECODE/smart-property-manage/src/views/bill/info/index.vue Dosyayı Görüntüle

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