pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoSe/SeVirtualCardMapper.java
@@ -2,11 +2,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; import com.dy.pipIrrGlobal.voSe.VoVcRecharge; import com.dy.pipIrrGlobal.voSe.VoVirtualCard; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; /** * @author ZhuBaoMin @@ -77,4 +79,17 @@ * @return */ void updateVcCardNoUseStateByIntakeId(@Param("intakeId")Long intakeId) ; /** * 获取虚拟卡充值记录 * @return */ List<VoVcRecharge> getVcRechargeRecords(Map<?, ?> params); /** * 获取虚拟卡充值记录数 * @param params * @return */ Long getRechargeRecordCount(Map<?, ?> params); } pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoVcRecharge.java
New file @@ -0,0 +1,51 @@ package com.dy.pipIrrGlobal.voSe; import com.dy.common.po.BaseEntity; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.util.Date; /** * @author :WuZeYu * @Date :2024/6/17 11:24 * @LastEditTime :2024/6/17 11:24 * @Description */ @Data public class VoVcRecharge implements BaseEntity { @Schema(title = "充值ID") private Long id; @Schema(description = "虚拟卡ID") private Long vcId; @Schema(description = "农户ID") private Long clientId; @Schema(description = "钱包余额") private Double money; @Schema(description = "充值后余额") private Double afterRecharge; @Schema(description = "订单号") private String orderNumber; @Schema(description = "充值金额") private Integer rechargeAmount; @Schema(description = "下单时间") private Date orderTime; @Schema(description = "充值完成时间") private Date rechargeTime; @Schema(description = "订单状态") private Byte orderState; @Schema(description = "订单状态") private String orderStateName; } pipIrr-platform/pipIrr-global/src/main/resources/mapper/SeVirtualCardMapper.xml
@@ -222,4 +222,43 @@ LIMIT 0,1 </select> <!--获取虚拟卡充值记录--> <select id="getVcRechargeRecords" resultType="com.dy.pipIrrGlobal.voSe.VoVcRecharge" > SELECT CAST(id AS char) AS id, CAST(vc_id AS char) AS vcId, CAST(client_id AS char) AS clientId, money, after_recharge AS afterRecharge, order_number AS orderNumber, recharge_amount AS rechargeAmount, order_time AS orderTime, recharge_time AS rechargeTime, order_state AS orderState, (CASE WHEN order_state = 1 THEN "未支付" WHEN order_state = 2 THEN "已支付" END) AS orderStateName FROM se_vc_recharge <where> <if test = "orderState != null"> order_state = #{orderState,jdbcType=TINYINT} </if> </where> order by recharge_time DESC <if test="pageCurr != null and pageSize != null"> LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} </if> </select> <select id="getRechargeRecordCount" resultType="java.lang.Long"> SELECT COUNT(*) FROM se_vc_recharge <where> <if test = "orderState != null"> order_state = #{orderState,jdbcType=TINYINT} </if> </where> </select> </mapper> pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/VirtualCardCtrl.java
@@ -3,11 +3,15 @@ import com.dy.common.aop.SsoAop; import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; import com.dy.pipIrrGlobal.voPr.VoController; import com.dy.pipIrrGlobal.voSe.VoVcRecharge; import com.dy.pipIrrGlobal.voSe.VoVirtualCard; import com.dy.pipIrrSell.result.SellResultCode; import com.dy.pipIrrSell.util.PayHelper; import com.dy.pipIrrSell.virtualCard.dto.DtoRegist; import com.dy.pipIrrSell.virtualCard.dto.DtoVcRecharge; import com.dy.pipIrrSell.virtualCard.enums.LastOperateENUM; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; @@ -248,4 +252,19 @@ // return BaseResponseUtils.buildSuccess(true) ; //} /** * 获取虚拟卡充值记录 * @return */ @GetMapping(path = "/getVcRechargeRecords") @SsoAop() public BaseResponse<QueryResultVo<List<VoVcRecharge>>> getVcRechargeRecords(@RequestBody DtoVcRecharge dtoVcRecharge){ try { QueryResultVo<List<VoVcRecharge>> res = virtualCardSv.getVcRechargeRecords(dtoVcRecharge); return BaseResponseUtils.buildSuccess(res); } catch (Exception e) { log.error("获取虚拟卡充值记录异常", e); return BaseResponseUtils.buildException(e.getMessage()) ; } } } pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/VirtualCardSv.java
@@ -2,24 +2,30 @@ import com.dy.common.webUtil.BaseResponse; import com.dy.common.webUtil.BaseResponseUtils; import com.dy.common.webUtil.QueryResultVo; import com.dy.pipIrrGlobal.daoSe.*; import com.dy.pipIrrGlobal.pojoSe.SeVcRecharge; import com.dy.pipIrrGlobal.pojoSe.SeVcRefund; import com.dy.pipIrrGlobal.pojoSe.SeVcRefundItem; import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; import com.dy.pipIrrGlobal.voPr.VoController; import com.dy.pipIrrGlobal.voSe.VoOrders; import com.dy.pipIrrGlobal.voSe.VoVcRecharge; import com.dy.pipIrrGlobal.voSe.VoVirtualCard; import com.dy.pipIrrSell.result.SellResultCode; import com.dy.pipIrrSell.virtualCard.dto.DtoVcRecharge; import com.dy.pipIrrSell.virtualCard.dto.DtoVirtualCard; import com.dy.pipIrrSell.virtualCard.enums.LastOperateENUM; import com.dy.pipIrrSell.virtualCard.enums.OrderStateENUM; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; import java.util.Map; /** * @author ZhuBaoMin @@ -325,4 +331,23 @@ public Long getRefundIdByRefundNumber(String refundNumber) { return seVcRefundItemMapper.getRefundIdByRefundNumber(refundNumber); } /** * 获取虚拟卡充值记录 * @param dtoVcRecharge * @return */ public QueryResultVo<List<VoVcRecharge>> getVcRechargeRecords(DtoVcRecharge dtoVcRecharge){ Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(dtoVcRecharge); Long itemTotal = seVirtualCardMapper.getRechargeRecordCount(params); QueryResultVo<List<VoVcRecharge>> rsVo = new QueryResultVo<>(); rsVo.pageSize = dtoVcRecharge.pageSize; rsVo.pageCurr = dtoVcRecharge.pageCurr; rsVo.calculateAndSet(itemTotal, params); rsVo.obj = seVirtualCardMapper.getVcRechargeRecords(params); return rsVo; } } pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/virtualCard/dto/DtoVcRecharge.java
New file @@ -0,0 +1,26 @@ package com.dy.pipIrrSell.virtualCard.dto; import com.dy.common.webUtil.QueryConditionVo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import org.hibernate.validator.constraints.Length; /** * @author :WuZeYu * @Date :2024/6/17 17:15 * @LastEditTime :2024/6/17 17:15 * @Description */ @Data @EqualsAndHashCode(callSuper = false) @ToString(callSuper = true) @NoArgsConstructor @AllArgsConstructor @Builder @Schema(name = "虚拟卡充值记录查询条件") public class DtoVcRecharge extends QueryConditionVo { @Schema(description = "订单状态", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @Length(message = "订单状态不大于{max},不小于{min}", min = 1, max = 2) private Byte orderState; }