From 92fec016a6deefc4300335ab6ac4a1df039be1b9 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 27 八月 2020 19:14:30 +0800
Subject: [PATCH] 加入房屋出租属性
---
service-user/src/main/java/com/java110/user/api/RentingApi.java | 94 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 94 insertions(+), 0 deletions(-)
diff --git a/service-user/src/main/java/com/java110/user/api/RentingApi.java b/service-user/src/main/java/com/java110/user/api/RentingApi.java
index eea41de..98797b2 100644
--- a/service-user/src/main/java/com/java110/user/api/RentingApi.java
+++ b/service-user/src/main/java/com/java110/user/api/RentingApi.java
@@ -3,8 +3,10 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.dto.rentingConfig.RentingConfigDto;
import com.java110.dto.rentingPool.RentingPoolDto;
+import com.java110.dto.rentingPoolAttr.RentingPoolAttrDto;
import com.java110.po.rentingConfig.RentingConfigPo;
import com.java110.po.rentingPool.RentingPoolPo;
+import com.java110.po.rentingPoolAttr.RentingPoolAttrPo;
import com.java110.user.bmo.rentingConfig.IDeleteRentingConfigBMO;
import com.java110.user.bmo.rentingConfig.IGetRentingConfigBMO;
import com.java110.user.bmo.rentingConfig.ISaveRentingConfigBMO;
@@ -13,6 +15,10 @@
import com.java110.user.bmo.rentingPool.IGetRentingPoolBMO;
import com.java110.user.bmo.rentingPool.ISaveRentingPoolBMO;
import com.java110.user.bmo.rentingPool.IUpdateRentingPoolBMO;
+import com.java110.user.bmo.rentingPoolAttr.IDeleteRentingPoolAttrBMO;
+import com.java110.user.bmo.rentingPoolAttr.IGetRentingPoolAttrBMO;
+import com.java110.user.bmo.rentingPoolAttr.ISaveRentingPoolAttrBMO;
+import com.java110.user.bmo.rentingPoolAttr.IUpdateRentingPoolAttrBMO;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +50,16 @@
@Autowired
private IGetRentingPoolBMO getRentingPoolBMOImpl;
+
+ @Autowired
+ private ISaveRentingPoolAttrBMO saveRentingPoolAttrBMOImpl;
+ @Autowired
+ private IUpdateRentingPoolAttrBMO updateRentingPoolAttrBMOImpl;
+ @Autowired
+ private IDeleteRentingPoolAttrBMO deleteRentingPoolAttrBMOImpl;
+
+ @Autowired
+ private IGetRentingPoolAttrBMO getRentingPoolAttrBMOImpl;
/**
* 寰俊淇濆瓨娑堟伅妯℃澘
@@ -223,4 +239,82 @@
rentingPoolDto.setCommunityId(communityId);
return getRentingPoolBMOImpl.get(rentingPoolDto);
}
+
+
+ /**
+ * 寰俊淇濆瓨娑堟伅妯℃澘
+ *
+ * @param reqJson
+ * @return
+ * @serviceCode /renting/saveRentingPoolAttr
+ * @path /app/renting/saveRentingPoolAttr
+ */
+ @RequestMapping(value = "/saveRentingPoolAttr", method = RequestMethod.POST)
+ public ResponseEntity<String> saveRentingPoolAttr(@RequestBody JSONObject reqJson) {
+
+ Assert.hasKeyAndValue(reqJson, "rentingId", "璇锋眰鎶ユ枃涓湭鍖呭惈rentingId");
+ Assert.hasKeyAndValue(reqJson, "specCd", "璇锋眰鎶ユ枃涓湭鍖呭惈specCd");
+
+
+ RentingPoolAttrPo rentingPoolAttrPo = BeanConvertUtil.covertBean(reqJson, RentingPoolAttrPo.class);
+ return saveRentingPoolAttrBMOImpl.save(rentingPoolAttrPo);
+ }
+
+ /**
+ * 寰俊淇敼娑堟伅妯℃澘
+ *
+ * @param reqJson
+ * @return
+ * @serviceCode /renting/updateRentingPoolAttr
+ * @path /app/renting/updateRentingPoolAttr
+ */
+ @RequestMapping(value = "/updateRentingPoolAttr", method = RequestMethod.POST)
+ public ResponseEntity<String> updateRentingPoolAttr(@RequestBody JSONObject reqJson) {
+
+ Assert.hasKeyAndValue(reqJson, "rentingId", "璇锋眰鎶ユ枃涓湭鍖呭惈rentingId");
+ Assert.hasKeyAndValue(reqJson, "specCd", "璇锋眰鎶ユ枃涓湭鍖呭惈specCd");
+ Assert.hasKeyAndValue(reqJson, "attrId", "attrId涓嶈兘涓虹┖");
+
+
+ RentingPoolAttrPo rentingPoolAttrPo = BeanConvertUtil.covertBean(reqJson, RentingPoolAttrPo.class);
+ return updateRentingPoolAttrBMOImpl.update(rentingPoolAttrPo);
+ }
+
+ /**
+ * 寰俊鍒犻櫎娑堟伅妯℃澘
+ *
+ * @param reqJson
+ * @return
+ * @serviceCode /renting/deleteRentingPoolAttr
+ * @path /app/renting/deleteRentingPoolAttr
+ */
+ @RequestMapping(value = "/deleteRentingPoolAttr", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteRentingPoolAttr(@RequestBody JSONObject reqJson) {
+ Assert.hasKeyAndValue(reqJson, "communityId", "灏忓尯ID涓嶈兘涓虹┖");
+
+ Assert.hasKeyAndValue(reqJson, "attrId", "attrId涓嶈兘涓虹┖");
+
+
+ RentingPoolAttrPo rentingPoolAttrPo = BeanConvertUtil.covertBean(reqJson, RentingPoolAttrPo.class);
+ return deleteRentingPoolAttrBMOImpl.delete(rentingPoolAttrPo);
+ }
+
+ /**
+ * 寰俊鍒犻櫎娑堟伅妯℃澘
+ *
+ * @param communityId 灏忓尯ID
+ * @return
+ * @serviceCode /renting/queryRentingPoolAttr
+ * @path /app/renting/queryRentingPoolAttr
+ */
+ @RequestMapping(value = "/queryRentingPoolAttr", method = RequestMethod.GET)
+ public ResponseEntity<String> queryRentingPoolAttr(@RequestParam(value = "communityId") String communityId,
+ @RequestParam(value = "page") int page,
+ @RequestParam(value = "row") int row) {
+ RentingPoolAttrDto rentingPoolAttrDto = new RentingPoolAttrDto();
+ rentingPoolAttrDto.setPage(page);
+ rentingPoolAttrDto.setRow(row);
+ rentingPoolAttrDto.setCommunityId(communityId);
+ return getRentingPoolAttrBMOImpl.get(rentingPoolAttrDto);
+ }
}
--
Gitblit v1.8.0