RentingApi.java 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. package com.java110.user.api;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.java110.dto.rentingConfig.RentingConfigDto;
  4. import com.java110.dto.rentingPool.RentingPoolDto;
  5. import com.java110.dto.rentingPoolAttr.RentingPoolAttrDto;
  6. import com.java110.po.rentingConfig.RentingConfigPo;
  7. import com.java110.po.rentingPool.RentingPoolPo;
  8. import com.java110.po.rentingPoolAttr.RentingPoolAttrPo;
  9. import com.java110.user.bmo.rentingConfig.IDeleteRentingConfigBMO;
  10. import com.java110.user.bmo.rentingConfig.IGetRentingConfigBMO;
  11. import com.java110.user.bmo.rentingConfig.ISaveRentingConfigBMO;
  12. import com.java110.user.bmo.rentingConfig.IUpdateRentingConfigBMO;
  13. import com.java110.user.bmo.rentingPool.IDeleteRentingPoolBMO;
  14. import com.java110.user.bmo.rentingPool.IGetRentingPoolBMO;
  15. import com.java110.user.bmo.rentingPool.ISaveRentingPoolBMO;
  16. import com.java110.user.bmo.rentingPool.IUpdateRentingPoolBMO;
  17. import com.java110.user.bmo.rentingPoolAttr.IDeleteRentingPoolAttrBMO;
  18. import com.java110.user.bmo.rentingPoolAttr.IGetRentingPoolAttrBMO;
  19. import com.java110.user.bmo.rentingPoolAttr.ISaveRentingPoolAttrBMO;
  20. import com.java110.user.bmo.rentingPoolAttr.IUpdateRentingPoolAttrBMO;
  21. import com.java110.utils.util.Assert;
  22. import com.java110.utils.util.BeanConvertUtil;
  23. import org.springframework.beans.factory.annotation.Autowired;
  24. import org.springframework.http.ResponseEntity;
  25. import org.springframework.web.bind.annotation.*;
  26. @RestController
  27. @RequestMapping(value = "/renting")
  28. public class RentingApi {
  29. @Autowired
  30. private ISaveRentingConfigBMO saveRentingConfigBMOImpl;
  31. @Autowired
  32. private IUpdateRentingConfigBMO updateRentingConfigBMOImpl;
  33. @Autowired
  34. private IDeleteRentingConfigBMO deleteRentingConfigBMOImpl;
  35. @Autowired
  36. private IGetRentingConfigBMO getRentingConfigBMOImpl;
  37. @Autowired
  38. private ISaveRentingPoolBMO saveRentingPoolBMOImpl;
  39. @Autowired
  40. private IUpdateRentingPoolBMO updateRentingPoolBMOImpl;
  41. @Autowired
  42. private IDeleteRentingPoolBMO deleteRentingPoolBMOImpl;
  43. @Autowired
  44. private IGetRentingPoolBMO getRentingPoolBMOImpl;
  45. @Autowired
  46. private ISaveRentingPoolAttrBMO saveRentingPoolAttrBMOImpl;
  47. @Autowired
  48. private IUpdateRentingPoolAttrBMO updateRentingPoolAttrBMOImpl;
  49. @Autowired
  50. private IDeleteRentingPoolAttrBMO deleteRentingPoolAttrBMOImpl;
  51. @Autowired
  52. private IGetRentingPoolAttrBMO getRentingPoolAttrBMOImpl;
  53. /**
  54. * 微信保存消息模板
  55. *
  56. * @param reqJson
  57. * @return
  58. * @serviceCode /renting/saveRentingConfig
  59. * @path /app/renting/saveRentingConfig
  60. */
  61. @RequestMapping(value = "/saveRentingConfig", method = RequestMethod.POST)
  62. public ResponseEntity<String> saveRentingConfig(@RequestBody JSONObject reqJson) {
  63. Assert.hasKeyAndValue(reqJson, "rentingType", "请求报文中未包含rentingType");
  64. Assert.hasKeyAndValue(reqJson, "rentingFormula", "请求报文中未包含rentingFormula");
  65. Assert.hasKeyAndValue(reqJson, "servicePrice", "请求报文中未包含servicePrice");
  66. Assert.hasKeyAndValue(reqJson, "serviceOwnerRate", "请求报文中未包含serviceOwnerRate");
  67. Assert.hasKeyAndValue(reqJson, "serviceTenantRate", "请求报文中未包含serviceTenantRate");
  68. Assert.hasKeyAndValue(reqJson, "adminSeparateRate", "请求报文中未包含adminSeparateRate");
  69. Assert.hasKeyAndValue(reqJson, "proxySeparateRate", "请求报文中未包含proxySeparateRate");
  70. Assert.hasKeyAndValue(reqJson, "propertySeparateRate", "请求报文中未包含propertySeparateRate");
  71. RentingConfigPo rentingConfigPo = BeanConvertUtil.covertBean(reqJson, RentingConfigPo.class);
  72. return saveRentingConfigBMOImpl.save(rentingConfigPo);
  73. }
  74. /**
  75. * 微信修改消息模板
  76. *
  77. * @param reqJson
  78. * @return
  79. * @serviceCode /renting/updateRentingConfig
  80. * @path /app/renting/updateRentingConfig
  81. */
  82. @RequestMapping(value = "/updateRentingConfig", method = RequestMethod.POST)
  83. public ResponseEntity<String> updateRentingConfig(@RequestBody JSONObject reqJson) {
  84. Assert.hasKeyAndValue(reqJson, "rentingType", "请求报文中未包含rentingType");
  85. Assert.hasKeyAndValue(reqJson, "rentingFormula", "请求报文中未包含rentingFormula");
  86. Assert.hasKeyAndValue(reqJson, "servicePrice", "请求报文中未包含servicePrice");
  87. Assert.hasKeyAndValue(reqJson, "serviceOwnerRate", "请求报文中未包含serviceOwnerRate");
  88. Assert.hasKeyAndValue(reqJson, "serviceTenantRate", "请求报文中未包含serviceTenantRate");
  89. Assert.hasKeyAndValue(reqJson, "adminSeparateRate", "请求报文中未包含adminSeparateRate");
  90. Assert.hasKeyAndValue(reqJson, "proxySeparateRate", "请求报文中未包含proxySeparateRate");
  91. Assert.hasKeyAndValue(reqJson, "propertySeparateRate", "请求报文中未包含propertySeparateRate");
  92. Assert.hasKeyAndValue(reqJson, "rentingConfigId", "rentingConfigId不能为空");
  93. RentingConfigPo rentingConfigPo = BeanConvertUtil.covertBean(reqJson, RentingConfigPo.class);
  94. return updateRentingConfigBMOImpl.update(rentingConfigPo);
  95. }
  96. /**
  97. * 微信删除消息模板
  98. *
  99. * @param reqJson
  100. * @return
  101. * @serviceCode /renting/deleteRentingConfig
  102. * @path /app/renting/deleteRentingConfig
  103. */
  104. @RequestMapping(value = "/deleteRentingConfig", method = RequestMethod.POST)
  105. public ResponseEntity<String> deleteRentingConfig(@RequestBody JSONObject reqJson) {
  106. Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
  107. Assert.hasKeyAndValue(reqJson, "rentingConfigId", "rentingConfigId不能为空");
  108. RentingConfigPo rentingConfigPo = BeanConvertUtil.covertBean(reqJson, RentingConfigPo.class);
  109. return deleteRentingConfigBMOImpl.delete(rentingConfigPo);
  110. }
  111. /**
  112. * 微信删除消息模板
  113. *
  114. * @return
  115. * @serviceCode /renting/queryRentingConfig
  116. * @path /app/renting/queryRentingConfig
  117. */
  118. @RequestMapping(value = "/queryRentingConfig", method = RequestMethod.GET)
  119. public ResponseEntity<String> queryRentingConfig(
  120. @RequestParam(value = "page") int page,
  121. @RequestParam(value = "row") int row) {
  122. RentingConfigDto rentingConfigDto = new RentingConfigDto();
  123. rentingConfigDto.setPage(page);
  124. rentingConfigDto.setRow(row);
  125. return getRentingConfigBMOImpl.get(rentingConfigDto);
  126. }
  127. /**
  128. * 微信保存消息模板
  129. *
  130. * @param reqJson
  131. * @return
  132. * @serviceCode /renting/saveRentingPool
  133. * @path /app/renting/saveRentingPool
  134. */
  135. @RequestMapping(value = "/saveRentingPool", method = RequestMethod.POST)
  136. public ResponseEntity<String> saveRentingPool(@RequestBody JSONObject reqJson) {
  137. Assert.hasKeyAndValue(reqJson, "rentingTitle", "请求报文中未包含rentingTitle");
  138. Assert.hasKeyAndValue(reqJson, "roomId", "请求报文中未包含roomId");
  139. Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
  140. Assert.hasKeyAndValue(reqJson, "price", "请求报文中未包含price");
  141. Assert.hasKeyAndValue(reqJson, "paymentType", "请求报文中未包含paymentType");
  142. Assert.hasKeyAndValue(reqJson, "checkInDate", "请求报文中未包含checkInDate");
  143. Assert.hasKeyAndValue(reqJson, "rentingConfigId", "请求报文中未包含rentingConfigId");
  144. Assert.hasKeyAndValue(reqJson, "ownerName", "请求报文中未包含ownerName");
  145. Assert.hasKeyAndValue(reqJson, "ownerTel", "请求报文中未包含ownerTel");
  146. RentingPoolPo rentingPoolPo = BeanConvertUtil.covertBean(reqJson, RentingPoolPo.class);
  147. return saveRentingPoolBMOImpl.save(rentingPoolPo);
  148. }
  149. /**
  150. * 微信修改消息模板
  151. *
  152. * @param reqJson
  153. * @return
  154. * @serviceCode /renting/updateRentingPool
  155. * @path /app/renting/updateRentingPool
  156. */
  157. @RequestMapping(value = "/updateRentingPool", method = RequestMethod.POST)
  158. public ResponseEntity<String> updateRentingPool(@RequestBody JSONObject reqJson) {
  159. Assert.hasKeyAndValue(reqJson, "rentingTitle", "请求报文中未包含rentingTitle");
  160. Assert.hasKeyAndValue(reqJson, "roomId", "请求报文中未包含roomId");
  161. Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
  162. Assert.hasKeyAndValue(reqJson, "price", "请求报文中未包含price");
  163. Assert.hasKeyAndValue(reqJson, "paymentType", "请求报文中未包含paymentType");
  164. Assert.hasKeyAndValue(reqJson, "checkInDate", "请求报文中未包含checkInDate");
  165. Assert.hasKeyAndValue(reqJson, "rentingConfigId", "请求报文中未包含rentingConfigId");
  166. Assert.hasKeyAndValue(reqJson, "ownerName", "请求报文中未包含ownerName");
  167. Assert.hasKeyAndValue(reqJson, "ownerTel", "请求报文中未包含ownerTel");
  168. Assert.hasKeyAndValue(reqJson, "rentingId", "rentingId不能为空");
  169. RentingPoolPo rentingPoolPo = BeanConvertUtil.covertBean(reqJson, RentingPoolPo.class);
  170. return updateRentingPoolBMOImpl.update(rentingPoolPo);
  171. }
  172. /**
  173. * 微信删除消息模板
  174. *
  175. * @param reqJson
  176. * @return
  177. * @serviceCode /renting/deleteRentingPool
  178. * @path /app/renting/deleteRentingPool
  179. */
  180. @RequestMapping(value = "/deleteRentingPool", method = RequestMethod.POST)
  181. public ResponseEntity<String> deleteRentingPool(@RequestBody JSONObject reqJson) {
  182. Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
  183. Assert.hasKeyAndValue(reqJson, "rentingId", "rentingId不能为空");
  184. RentingPoolPo rentingPoolPo = BeanConvertUtil.covertBean(reqJson, RentingPoolPo.class);
  185. return deleteRentingPoolBMOImpl.delete(rentingPoolPo);
  186. }
  187. /**
  188. * 微信删除消息模板
  189. *
  190. * @param communityId 小区ID
  191. * @return
  192. * @serviceCode /renting/queryRentingPool
  193. * @path /app/renting/queryRentingPool
  194. */
  195. @RequestMapping(value = "/queryRentingPool", method = RequestMethod.GET)
  196. public ResponseEntity<String> queryRentingPool(@RequestParam(value = "communityId") String communityId,
  197. @RequestParam(value = "page") int page,
  198. @RequestParam(value = "row") int row) {
  199. RentingPoolDto rentingPoolDto = new RentingPoolDto();
  200. rentingPoolDto.setPage(page);
  201. rentingPoolDto.setRow(row);
  202. rentingPoolDto.setCommunityId(communityId);
  203. return getRentingPoolBMOImpl.get(rentingPoolDto);
  204. }
  205. /**
  206. * 微信保存消息模板
  207. *
  208. * @param reqJson
  209. * @return
  210. * @serviceCode /renting/saveRentingPoolAttr
  211. * @path /app/renting/saveRentingPoolAttr
  212. */
  213. @RequestMapping(value = "/saveRentingPoolAttr", method = RequestMethod.POST)
  214. public ResponseEntity<String> saveRentingPoolAttr(@RequestBody JSONObject reqJson) {
  215. Assert.hasKeyAndValue(reqJson, "rentingId", "请求报文中未包含rentingId");
  216. Assert.hasKeyAndValue(reqJson, "specCd", "请求报文中未包含specCd");
  217. RentingPoolAttrPo rentingPoolAttrPo = BeanConvertUtil.covertBean(reqJson, RentingPoolAttrPo.class);
  218. return saveRentingPoolAttrBMOImpl.save(rentingPoolAttrPo);
  219. }
  220. /**
  221. * 微信修改消息模板
  222. *
  223. * @param reqJson
  224. * @return
  225. * @serviceCode /renting/updateRentingPoolAttr
  226. * @path /app/renting/updateRentingPoolAttr
  227. */
  228. @RequestMapping(value = "/updateRentingPoolAttr", method = RequestMethod.POST)
  229. public ResponseEntity<String> updateRentingPoolAttr(@RequestBody JSONObject reqJson) {
  230. Assert.hasKeyAndValue(reqJson, "rentingId", "请求报文中未包含rentingId");
  231. Assert.hasKeyAndValue(reqJson, "specCd", "请求报文中未包含specCd");
  232. Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空");
  233. RentingPoolAttrPo rentingPoolAttrPo = BeanConvertUtil.covertBean(reqJson, RentingPoolAttrPo.class);
  234. return updateRentingPoolAttrBMOImpl.update(rentingPoolAttrPo);
  235. }
  236. /**
  237. * 微信删除消息模板
  238. *
  239. * @param reqJson
  240. * @return
  241. * @serviceCode /renting/deleteRentingPoolAttr
  242. * @path /app/renting/deleteRentingPoolAttr
  243. */
  244. @RequestMapping(value = "/deleteRentingPoolAttr", method = RequestMethod.POST)
  245. public ResponseEntity<String> deleteRentingPoolAttr(@RequestBody JSONObject reqJson) {
  246. Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
  247. Assert.hasKeyAndValue(reqJson, "attrId", "attrId不能为空");
  248. RentingPoolAttrPo rentingPoolAttrPo = BeanConvertUtil.covertBean(reqJson, RentingPoolAttrPo.class);
  249. return deleteRentingPoolAttrBMOImpl.delete(rentingPoolAttrPo);
  250. }
  251. /**
  252. * 微信删除消息模板
  253. *
  254. * @param communityId 小区ID
  255. * @return
  256. * @serviceCode /renting/queryRentingPoolAttr
  257. * @path /app/renting/queryRentingPoolAttr
  258. */
  259. @RequestMapping(value = "/queryRentingPoolAttr", method = RequestMethod.GET)
  260. public ResponseEntity<String> queryRentingPoolAttr(@RequestParam(value = "communityId") String communityId,
  261. @RequestParam(value = "page") int page,
  262. @RequestParam(value = "row") int row) {
  263. RentingPoolAttrDto rentingPoolAttrDto = new RentingPoolAttrDto();
  264. rentingPoolAttrDto.setPage(page);
  265. rentingPoolAttrDto.setRow(row);
  266. rentingPoolAttrDto.setCommunityId(communityId);
  267. return getRentingPoolAttrBMOImpl.get(rentingPoolAttrDto);
  268. }
  269. }