| | |
| | | package com.kidgrow.oprationcenter.controller; |
| | | |
| | | import com.kidgrow.common.constant.PayConstants; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.utils.ExcelUtil; |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | import com.kidgrow.oprationcenter.service.ISaasClientPayService; |
| | | import com.kidgrow.oprationcenter.vo.SaasClientPayExcel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping |
| | | public ResultBody<PageResult> list(@RequestParam Map<String, Object> params) { |
| | | public PageResult list(@RequestParam Map<String, Object> params) { |
| | | if(params.size()==0){ |
| | | params.put("page",1); |
| | | params.put("limit",10); |
| | | } |
| | | return ResultBody.ok().data(saasClientPayService.findList(params)); |
| | | return saasClientPayService.findList(params); |
| | | } |
| | | /** |
| | | * 批量结算 |
| | | */ |
| | | @ApiOperation(value = "批量结算") |
| | | @PostMapping("/updateTypeList") |
| | | public ResultBody updateTypeList(@RequestBody List<String> list) { |
| | | saasClientPayService.updateTypeList(list); |
| | | return ResultBody.ok(); |
| | | } |
| | | @ApiOperation(value = "导出") |
| | | @PostMapping("/export") |
| | | public ResultBody export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException { |
| | | List<SaasClientPayExcel> saasClientPayExcel=saasClientPayService.export(params); |
| | | //导出操作 |
| | | ExcelUtil.exportExcel(saasClientPayExcel, null, "支付导出", SaasClientPayExcel.class, "saas_client_pay", response); |
| | | return ResultBody.ok().msg("导出成功"); |
| | | } |
| | | /** |
| | | * 获取微信和支付宝的二维码 |
| | | */ |
| | | @ApiOperation(value = "获取微信和支付宝的二维码") |
| | | @PostMapping("/getCode") |
| | | public ResultBody getCode(@Valid @RequestBody SaasClientPay saasClientPay, BindingResult bindingResult, HttpServletRequest request) throws Exception { |
| | | List<String> errMsg= new ArrayList<>(); |
| | | if (bindingResult.hasErrors()) { |
| | | for (ObjectError error : bindingResult.getAllErrors()) { |
| | | errMsg.add(error.getDefaultMessage()); |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } |
| | | return saasClientPayService.getCode(saasClientPay,request); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询 支付状态是否为成功 |
| | | */ |
| | | @ApiOperation(value = "查询一个诊断的支付状态") |
| | | @GetMapping("/getDepartmentPay") |
| | | public ResultBody getDepartmentPayState(@RequestParam Long hospitalId, @RequestParam Long departmentId, @RequestParam String diaId) { |
| | | SaasClientPay model = saasClientPayService.findModelByObject(hospitalId,departmentId,diaId); |
| | | if (model != null) { |
| | | return ResultBody.ok().data(model.getPayStatus().equals(PayConstants.ORDER_PAY_SUCEESS)).msg("查询成功"); |
| | | } |
| | | return ResultBody.failed().data(false).msg("没有相关数据"); |
| | | } |
| | | /** |
| | | * 删除 |
| | | */ |