教育训练处考试制证系统后端
“djh”
2025-03-10 ea219f4389c52d0bac442c7a351767160c9814c5
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
120
121
122
123
124
125
126
127
128
129
130
131
package com.gkhy.exam.pay.controller;
 
import com.alibaba.fastjson2.JSONObject;
import com.gkhy.exam.pay.dto.rep.CoalPayRepDto;
import com.gkhy.exam.pay.dto.rep.CoalPayStudentRep;
import com.gkhy.exam.pay.dto.req.*;
import com.gkhy.exam.pay.entity.CoalPayStudent;
import com.gkhy.exam.pay.entity.PayReqData;
import com.gkhy.exam.pay.service.CoalPayService;
import com.gkhy.exam.pay.utils.BillSignException;
import com.gkhy.exam.pay.utils.PayUtils;
import com.gkhy.exam.pay.utils.ResultVo;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.RandomUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
 
@RestController
@Api(tags = "煤矿缴费批次管理")
@RequestMapping("/pay/coalPay")
public class CoalPayController extends BaseController {
 
    @Autowired
    private CoalPayService coalPayService;
 
    /**
     * 查询煤矿缴费管理列表
     */
    @GetMapping("/list")
    @ApiOperation(value = "查询煤矿缴费管理列表")
    public TableDataInfo list(CoalPayReq coalPayReq) {
        startPage();
        List<CoalPayRepDto> list = coalPayService.selectCoalPayList(coalPayReq);
        return getDataTable(list);
    }
 
    /**
     * 获取煤矿缴费管理详细信息
     */
    @GetMapping(value = "/{id}")
    @ApiOperation(value = "获取煤矿缴费管理详细信息", httpMethod = "GET")
    @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true)
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(coalPayService.selectCoalPayById(id));
    }
 
    /**
     * 新增煤矿缴费管理
     */
    @PostMapping("/insert")
    @ApiOperation(value = "新增煤矿缴费管理")
    public AjaxResult add(@Validated @RequestBody CoalPayDto coalPayDto) {
        return toAjax(coalPayService.insertCoalPay(coalPayDto));
    }
 
    /**
     * 修改煤矿缴费管理
     */
    @PostMapping("/update")
    @ApiOperation(value = "修改煤矿缴费管理")
    public AjaxResult edit(@RequestBody CoalPayDto coalPayDto) {
        return toAjax(coalPayService.updateCoalPay(coalPayDto));
    }
 
    /**
     * 修改煤矿缴费类型
     */
    @PostMapping("/updateType")
    @ApiOperation(value = "修改煤矿缴费类型")
    public AjaxResult updateType(@RequestBody CoalPayTypeReq coalPayTypeReq) {
        return toAjax(coalPayService.updateCoalPayType(coalPayTypeReq));
    }
 
    /**
     * 删除煤矿缴费管理
     */
    @PostMapping("/delete")
    @ApiOperation(value = "删除煤矿缴费管理")
    public AjaxResult remove(@RequestBody Long[] ids) {
        return coalPayService.deleteCoalPayByIds(ids);
    }
 
    /**
     * 个人缴费接口
     */
    @GetMapping("/findStudent")
    @Anonymous
    @ApiOperation(value ="H5个人缴费查询")
    public AjaxResult findStudent(@RequestParam("idCard") String idCard,@RequestParam("phone") String phone){
        List<CoalPayStudentRep> coalPayStudentReps = coalPayService.selectCoalPay(idCard,phone);
        return success(coalPayStudentReps);
    }
 
    @GetMapping("/personPay")
    @ApiOperation(value = "个人缴费接口")
    @Anonymous
    public AjaxResult payMoney(@RequestParam("coalPayId") Long coalPayId,@RequestParam("studentId") Long studentId){
        return success(coalPayService.personPayMoney(coalPayId,studentId));
    }
 
    @PostMapping("/teamPay")
    @Anonymous
    @ApiOperation(value = "批量缴费")
    public AjaxResult teamMoney(@RequestBody CoalTeamPayReq coalTeamPayReq){
        return success(coalPayService.teamPayMoney(coalTeamPayReq));
    }
 
 
 
    @PostMapping("/topay")
    @Anonymous
    @ApiOperation(value = "缴费测试")
    public AjaxResult toPay() throws IOException, BillSignException {
        return success(coalPayService.topay());
    }
 
 
 
}