| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.MakeOrderDto; |
| | | import com.ruoyi.system.dto.MakeOrderResp; |
| | | import com.ruoyi.system.dto.OfflinePayDto; |
| | | import com.ruoyi.system.model.TBill; |
| | | import com.ruoyi.system.service.TBillService; |
| | | import com.ruoyi.system.service.TPayOrderService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/t-pay") |
| | |
| | | @Autowired |
| | | TPayOrderService tPayOrderService; |
| | | |
| | | @Autowired |
| | | TBillService tBillService; |
| | | @ApiOperation(value = "创建支付订单") |
| | | @PostMapping("makeOrder") |
| | | public R<MakeOrderResp> makeOrder(@Validated @RequestBody MakeOrderDto dto){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("offlinePay") |
| | | public R offlinePay(@Validated @RequestBody OfflinePayDto dto){ |
| | | List<TBill> tBills = tBillService.listByIds(dto.getBillIds()); |
| | | for (TBill tBill : tBills) { |
| | | TBill save = new TBill(); |
| | | save.setId(tBill.getId()); |
| | | save.setPayFeesType(2); |
| | | save.setVoucher(dto.getVoucher()); |
| | | save.setPayFeesStatus("2"); |
| | | tBillService.checkAndUpdate(save); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |