| | |
| | | import com.dy.pipIrrGlobal.pojoBa.BaClient; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeCardOperate; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.util.AmountToChinese; |
| | | import com.dy.pipIrrGlobal.util.Constant; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoActiveCardNew; |
| | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | |
| | | seCardOperate.setCardId(cardId); |
| | | seCardOperate.setClientId(clientId); |
| | | seCardOperate.setMoney(money); |
| | | seCardOperate.setNoTradeAmount(refund); |
| | | //seCardOperate.setNoTradeAmount(refund); |
| | | seCardOperate.setRefundAmount(refund); |
| | | seCardOperate.setOperateType(OperateTypeENUM.REFUND.getCode()); |
| | | seCardOperate.setRemarks(remarks); |
| | | seCardOperate.setOperator(operator); |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取交易汇总记录 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获得交易汇总记录", description = "返回交易汇总记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页农户数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = BaClient.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "getStatistics") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getStatistics(QoTransactionStatistics vo){ |
| | | try { |
| | | Map res = cardOperateSv.getTransactionStatistics(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询交易汇总记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据指定条件获取开卡记录 |
| | | * @param vo |
| | | * @return |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据指定条件获取收据列表 |
| | | * @param vo |
| | | * @return |
| | | */ |
| | | @Operation(summary = "获取收据记录", description = "返回收据记录") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "返回一页补卡数据(BaseResponse.content:QueryResultVo[{}])", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = VoActiveCard.class))} |
| | | ) |
| | | }) |
| | | @GetMapping(path = "/get_receipts") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getReceipts(QoReceipt vo){ |
| | | try { |
| | | Map res = Optional.ofNullable(cardOperateSv.getReceipts(vo)).orElse(new HashMap()); |
| | | if(res.size() == 0) { |
| | | return BaseResponseUtils.buildFail(SellResultCode.No_RECEIPTS.getMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("获取电子钱包账户记录", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 金额转大写 |
| | | * @param amount |
| | | * @return |
| | | */ |
| | | |
| | | @GetMapping(path = "/amount_to_chinese") |
| | | public BaseResponse<Boolean> amountToChinese(BigDecimal amount) { |
| | | try { |
| | | AmountToChinese amountToChinese = new AmountToChinese(); |
| | | String chinese = amountToChinese.toChinese(amount); |
| | | return BaseResponseUtils.buildSuccess(chinese) ; |
| | | } catch (Exception e) { |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | |
| | | } |
| | | } |