教育训练处考试制证系统后端
heheng
2025-02-20 c269821bdd06a8eb452b09c1effe14efd646b9d7
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
package com.gkhy.exam.pay.controller;
 
import com.gkhy.exam.pay.dto.rep.NonCoalPayPageRepDto;
import com.gkhy.exam.pay.dto.req.NonCoalPayReqDto;
import com.gkhy.exam.pay.dto.req.NonCoalPayStuImport;
import com.gkhy.exam.pay.dto.req.NonCoalPayStudentReqDto;
import com.gkhy.exam.pay.dto.req.NonCoalPayTypeEditReqDto;
import com.gkhy.exam.pay.entity.NonCoalPay;
import com.gkhy.exam.pay.entity.NonCoalPayStudent;
import com.gkhy.exam.pay.service.NonCoalPayService;
import com.gkhy.exam.pay.service.NonCoalPayStudentService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.RepeatSubmit;
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.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
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 org.springframework.web.multipart.MultipartFile;
 
import java.util.List;
 
 
/**
 * 非煤缴费管理Controller
 *
 * @author hh
 * @date 2025-01-16
 */
@RestController
@Api(tags = "非煤缴费管理")
@RequestMapping("/pay/nonCoalPay")
public class NonCoalPayController extends BaseController {
    @Autowired
    private NonCoalPayService nonCoalPayService;
 
    @Autowired
    private NonCoalPayStudentService nonCoalPayStudentService;
 
    /**
     * 查询非煤缴费管理列表
     */
    @GetMapping("/list")
    @ApiOperation(value = "查询非煤缴费管理列表")
    public TableDataInfo list(NonCoalPay nonCoalPay) {
        startPage();
 
        List<NonCoalPayPageRepDto> list = nonCoalPayService.selectNonCoalPayList(nonCoalPay);
        return getDataTable(list);
    }
 
    /**
     * 导出非煤缴费管理列表
     */
 
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, NonCoalPay nonCoalPay) {
//        List<NonCoalPay> list = nonCoalPayService.selectNonCoalPayList(nonCoalPay);
//        ExcelUtil<NonCoalPay> util = new ExcelUtil<NonCoalPay>(NonCoalPay.class);
//        util.exportExcel(response, list, "非煤缴费管理数据");
//    }
 
    /**
     * 获取非煤缴费管理详细信息
     */
 
    @GetMapping(value = "/getInfo/{id}")
    @ApiOperation(value = "获取非煤缴费管理详细信息", httpMethod = "GET")
    @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true)
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(nonCoalPayService.selectNonCoalPayById(id));
    }
 
    @GetMapping(value = "/getNonCoalPayStudentByPayId/{id}")
    @ApiOperation(value = "获取非煤缴费管理学员相关详细信息", httpMethod = "GET")
    @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true)
    public AjaxResult getNonCoalPayStudentByPayId(@PathVariable("id") Long id) {
        return success(nonCoalPayService.getNonCoalPayStudentByPayId(id));
    }
 
 
    /**
     * 新增非煤缴费管理
     */
    @PostMapping("/add")
    //@PreAuthorize("@ss.hasPermi('noncoal:nonpay:add')")
    @ApiOperation(value = "新增非煤缴费管理")
    public AjaxResult add(@Validated @RequestBody NonCoalPayReqDto nonCoalPay) {
        return toAjax(nonCoalPayService.insertNonCoalPay(nonCoalPay));
    }
 
    /**
     * 修改非煤缴费管理
     */
 
    @PostMapping("/edit")
    @ApiOperation(value = "修改非煤缴费管理")
    public AjaxResult edit(@Validated @RequestBody NonCoalPayReqDto nonCoalPay) {
        return toAjax(nonCoalPayService.updateNonCoalPay(nonCoalPay));
    }
 
    @PostMapping("/editPayTypeInfo")
    @ApiOperation(value = "修改非煤缴费类型管理信息")
    public AjaxResult updateNonCoalPayType(@Validated @RequestBody NonCoalPayTypeEditReqDto nonCoalPay) {
        return toAjax(nonCoalPayService.updateNonCoalPayType(nonCoalPay));
    }
 
    @GetMapping("/editPayTypeStatus")
    @ApiOperation(value = "修改非煤缴费类型状态")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "payPersonType", dataTypeClass = Integer.class, value = "缴费类型1个人2团体", required = true),
            @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true),
    })
    public AjaxResult updateNonCoalPayTypeStatus(@RequestParam("payPersonType") Integer payPersonType, @RequestParam("id") Long id) {
        return toAjax(nonCoalPayService.updateNonCoalPayTypeStatus(payPersonType, id));
    }
 
    /**
     * 删除非煤缴费管理
     */
    @DeleteMapping("/{id}")
    @ApiOperation(value = "删除非煤缴费管理")
    @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true)
    public AjaxResult remove(@PathVariable Long id) {
        return toAjax(nonCoalPayService.deleteNonCoalPayById(id));
    }
 
 
    /**
     * 新增【请填写功能名称】
     */
    @PostMapping("/addNonCoalStu")
    @ApiOperation(value = "新增非煤缴费学员")
    public AjaxResult addNonCoalStu(@Validated @RequestBody NonCoalPayStudent nonCoalPayStudent) {
        return toAjax(nonCoalPayStudentService.insertNonCoalPayStudent(nonCoalPayStudent));
    }
 
    /**
     * 修改【请填写功能名称】
     */
    @PostMapping("/editNonCoalStu")
    @ApiOperation(value = "修改非煤缴费学员")
    public AjaxResult editNonCoalStu(@Validated @RequestBody NonCoalPayStudent nonCoalPayStudent) {
        return toAjax(nonCoalPayStudentService.updateNonCoalPayStudent(nonCoalPayStudent));
    }
 
    /**
     * 删除【请填写功能名称】
     */
    @DeleteMapping("/delNonCalStu/{id}")
    @ApiOperation(value = "删除非煤缴费学员")
    @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "id", required = true)
    public AjaxResult delNonCalStu(@PathVariable Long id) {
        return toAjax(nonCoalPayStudentService.deleteNonCoalPayStudentById(id));
    }
 
 
    @PostMapping("/stuImportData")
    @ApiOperation(value = "导入学员")
    @ApiImplicitParam(name = "nonCoalPayId", dataTypeClass = Long.class, value = "nonCoalPayId", required = true)
    public AjaxResult importData(MultipartFile file, Long nonCoalPayId) throws Exception {
        ExcelUtil<NonCoalPayStuImport> util = new ExcelUtil<NonCoalPayStuImport>(NonCoalPayStuImport.class);
        List<NonCoalPayStuImport> nonCoalPayStudents = util.importExcel(file.getInputStream());
        String operName = getUsername();
        String message = nonCoalPayStudentService.importData(nonCoalPayStudents, operName, nonCoalPayId);
        return success(message);
    }
 
    @PostMapping("/updateNonCoalStu")
    @ApiOperation(value = "更新财政缴款码")
    public AjaxResult updateNonCoalStu(@RequestBody NonCoalPayStudentReqDto nonCoalPayStudent) {
        return toAjax(nonCoalPayStudentService.updateNonCoalStu(nonCoalPayStudent));
    }
 
 
    @GetMapping("/nonCoalSelectH5")
    @ApiOperation(value = "非煤H5查询缴费信息")
    @Anonymous
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phone", dataTypeClass = String.class, value = "电话", required = true),
            @ApiImplicitParam(name = "idCard", dataTypeClass = String.class, value = "idCard", required = true),
    })
    @RepeatSubmit
    public AjaxResult nonCoalSelectH5(@RequestParam("phone") String phone, @RequestParam("idCard") String idCard) {
        return success(nonCoalPayService.selectNonCoalPayByStu(phone, idCard));
    }
 
 
    @PostMapping("/sendOrder")
    @ApiOperation(value = "生成财政订单")
    @Anonymous
    @RepeatSubmit
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "个人缴费学员数据id,团队缴费数据id", required = true),
            @ApiImplicitParam(name = "payType", dataTypeClass = String.class, value = "1个人2是团队", required = true),
    })
    public AjaxResult sendOrder(@RequestParam("id") Long id, @RequestParam("payType") String payType) {
        return success(nonCoalPayStudentService.sendOrder(id, payType));
    }
 
 
    @PostMapping("/queryOrder")
    @ApiOperation(value = "查询是否缴费成功")
    @Anonymous
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "个人缴费学员数据id,团队缴费数据id", required = true),
            @ApiImplicitParam(name = "payType", dataTypeClass = String.class, value = "1个人2是团队", required = true),
    })
    public AjaxResult queryOrder(@RequestParam("id") Long id, @RequestParam("payType") String payType) {
        return success(nonCoalPayStudentService.queryOrder(id, payType));
    }
 
 
}