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;
|
|
/**
|
* 查询煤矿缴费管理列表
|
*/
|
@PostMapping("/list")
|
@ApiOperation(value = "查询煤矿缴费管理列表")
|
public TableDataInfo list(@RequestBody 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());
|
}
|
|
|
|
}
|