Blame view

service-user/src/main/java/com/java110/user/api/RentingPoolFlowApi.java 5.19 KB
88e030b7   王彪总   init project
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
  package com.java110.user.api;
  
  import com.alibaba.fastjson.JSONObject;
  import com.java110.dto.renting.RentingPoolFlowDto;
  import com.java110.po.renting.RentingPoolFlowPo;
  import com.java110.user.bmo.rentingPoolFlow.IDeleteRentingPoolFlowBMO;
  import com.java110.user.bmo.rentingPoolFlow.IGetRentingPoolFlowBMO;
  import com.java110.user.bmo.rentingPoolFlow.ISaveRentingPoolFlowBMO;
  import com.java110.user.bmo.rentingPoolFlow.IUpdateRentingPoolFlowBMO;
  import com.java110.utils.util.Assert;
  import com.java110.utils.util.BeanConvertUtil;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.http.ResponseEntity;
  import org.springframework.web.bind.annotation.*;
  
  
  @RestController
  @RequestMapping(value = "/rentingPoolFlow")
  public class RentingPoolFlowApi {
  
      @Autowired
      private ISaveRentingPoolFlowBMO saveRentingPoolFlowBMOImpl;
      @Autowired
      private IUpdateRentingPoolFlowBMO updateRentingPoolFlowBMOImpl;
      @Autowired
      private IDeleteRentingPoolFlowBMO deleteRentingPoolFlowBMOImpl;
  
      @Autowired
      private IGetRentingPoolFlowBMO getRentingPoolFlowBMOImpl;
  
      /**
       * 微信保存消息模板
       *
       * @param reqJson
       * @return
       * @serviceCode /rentingPoolFlow/saveRentingPoolFlow
       * @path /app/rentingPoolFlow/saveRentingPoolFlow
       */
      @RequestMapping(value = "/saveRentingPoolFlow", method = RequestMethod.POST)
      public ResponseEntity<String> saveRentingPoolFlow(@RequestBody JSONObject reqJson) {
  
          Assert.hasKeyAndValue(reqJson, "rentingId", "请求报文中未包含rentingId");
          Assert.hasKeyAndValue(reqJson, "useName", "请求报文中未包含useName");
          Assert.hasKeyAndValue(reqJson, "useTel", "请求报文中未包含useTel");
          Assert.hasKeyAndValue(reqJson, "dealTime", "请求报文中未包含dealTime");
          Assert.hasKeyAndValue(reqJson, "userRole", "请求报文中未包含userRole");
          Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
  
  
          RentingPoolFlowPo rentingPoolFlowPo = BeanConvertUtil.covertBean(reqJson, RentingPoolFlowPo.class);
          return saveRentingPoolFlowBMOImpl.save(rentingPoolFlowPo);
      }
  
      /**
       * 微信修改消息模板
       *
       * @param reqJson
       * @return
       * @serviceCode /rentingPoolFlow/updateRentingPoolFlow
       * @path /app/rentingPoolFlow/updateRentingPoolFlow
       */
      @RequestMapping(value = "/updateRentingPoolFlow", method = RequestMethod.POST)
      public ResponseEntity<String> updateRentingPoolFlow(@RequestBody JSONObject reqJson) {
  
          Assert.hasKeyAndValue(reqJson, "rentingId", "请求报文中未包含rentingId");
          Assert.hasKeyAndValue(reqJson, "useName", "请求报文中未包含useName");
          Assert.hasKeyAndValue(reqJson, "useTel", "请求报文中未包含useTel");
          Assert.hasKeyAndValue(reqJson, "dealTime", "请求报文中未包含dealTime");
          Assert.hasKeyAndValue(reqJson, "userRole", "请求报文中未包含userRole");
          Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
          Assert.hasKeyAndValue(reqJson, "flowId", "flowId不能为空");
  
  
          RentingPoolFlowPo rentingPoolFlowPo = BeanConvertUtil.covertBean(reqJson, RentingPoolFlowPo.class);
          return updateRentingPoolFlowBMOImpl.update(rentingPoolFlowPo);
      }
  
      /**
       * 微信删除消息模板
       *
       * @param reqJson
       * @return
       * @serviceCode /rentingPoolFlow/deleteRentingPoolFlow
       * @path /app/rentingPoolFlow/deleteRentingPoolFlow
       */
      @RequestMapping(value = "/deleteRentingPoolFlow", method = RequestMethod.POST)
      public ResponseEntity<String> deleteRentingPoolFlow(@RequestBody JSONObject reqJson) {
          Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
  
          Assert.hasKeyAndValue(reqJson, "flowId", "flowId不能为空");
  
  
          RentingPoolFlowPo rentingPoolFlowPo = BeanConvertUtil.covertBean(reqJson, RentingPoolFlowPo.class);
          return deleteRentingPoolFlowBMOImpl.delete(rentingPoolFlowPo);
      }
  
      /**
       * 微信删除消息模板
       *
       * @param communityId 小区ID
       * @returnaddOwner
       * @serviceCode /rentingPoolFlow/queryRentingPoolFlow
       * @path /app/rentingPoolFlow/queryRentingPoolFlow
       */
      @RequestMapping(value = "/queryRentingPoolFlow", method = RequestMethod.GET)
      public ResponseEntity<String> queryRentingPoolFlow(@RequestParam(value = "communityId") String communityId,
                                                         @RequestParam(value = "rentingId") String rentingId,
                                                         @RequestParam(value = "state", required = false) String state,
                                                         @RequestParam(value = "page") int page,
                                                         @RequestParam(value = "row") int row) {
          RentingPoolFlowDto rentingPoolFlowDto = new RentingPoolFlowDto();
          rentingPoolFlowDto.setPage(page);
          rentingPoolFlowDto.setRow(row);
          rentingPoolFlowDto.setRentingId(rentingId);
          rentingPoolFlowDto.setState(state);
          rentingPoolFlowDto.setCommunityId(communityId);
          return getRentingPoolFlowBMOImpl.get(rentingPoolFlowDto);
      }
  }