mitao
2025-02-24 879ce4e66b36daf44f79b17eb02d3578148e4545
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
package com.panzhihua.applets.api;
 
 
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.rentHouse.RentingHourseOrderVO;
import com.panzhihua.common.model.vos.community.rentHouse.WxPayNotifyOrderVO;
import com.panzhihua.common.model.vos.community.rentHouse.WxPayOrderVO;
import com.panzhihua.common.service.community.CommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
/**
 * 房屋租赁-房屋订单表(RentingHourseOrder)表控制层
 *
 * @author makejava
 * @since 2021-11-23 10:46:57
 */
@RestController
@Slf4j
@Api(tags = {"房屋租赁普通订单相关接口"})
@RequestMapping("rentingHourseOrder")
public class RentingHourseOrderApi extends BaseController {
    /**
     * 服务对象
     */
    @Resource
    private CommunityService communityService;
 
    /**
     * 分页查询所有数据
     *
     * @param commonPage 查询实体
     * @return 所有数据
     */
    @ApiOperation(value = "分页查询所有数据",response = RentingHourseOrderVO.class)
    @PostMapping("queryAll")
    public R selectAll(@RequestBody CommonPage commonPage) {
        commonPage.setCommunityId(this.getCommunityId());
        return communityService.selectRentingHourseOrderAll(commonPage);
    }
 
    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @ApiOperation(value = "分页查询所有数据")
    @GetMapping("{id}")
    public R selectOne(@PathVariable("id") Long id) {
        return communityService.selectRentingHourseOrderOne(id);
    }
 
    /**
     * 新增数据
     *
     * @param rentingHourseOrder 实体对象
     * @return 新增结果
     */
    @ApiOperation("创建订单")
    @PostMapping
    public R insert(@RequestBody RentingHourseOrderVO rentingHourseOrder) {
        rentingHourseOrder.setCommunityId(this.getCommunityId());
        return communityService.insertRentingHourseOrder(rentingHourseOrder);
    }
 
    /**
     * 修改数据
     *
     * @param rentingHourseOrdervo 实体对象
     * @return 修改结果
     */
    @PostMapping("/update")
    public R update(@RequestBody RentingHourseOrderVO rentingHourseOrdervo) {
        return communityService.updateRentingHourseOrder(rentingHourseOrdervo);
    }
 
    /**
     * 删除数据
     *
     * @param id 主键结合
     * @return 删除结果
     */
    @ApiOperation("删除")
    @GetMapping("del")
    public R delete(@RequestParam("id") Long id) {
        return communityService.deleteRentingHourseOrder(id);
    }
 
    /**
     * 支付回调处理订单状态以及房屋状态
     */
    @ApiOperation("支付回调处理订单状态以及房屋状态")
    @PostMapping("/wxNotify")
    public R wxNotify(@RequestBody WxPayNotifyOrderVO wxPayNotifyOrderVO){
        return communityService.wxNotifyRentingHourseOrder(wxPayNotifyOrderVO);
    }
 
    /**
     * 支付付款
     */
    @ApiOperation("支付付款")
    @PostMapping("/wxPay")
    public R wxPay(@RequestBody WxPayOrderVO wxPayOrderVO){
        return communityService.wxPayRentingHourseOrder(wxPayOrderVO);
    }
}