Browse Source

Merge remote-tracking branch 'origin/master'

yubin 1 week ago
parent
commit
6c1b84bb45

+ 0 - 13
cif-service/src/main/java/com/txz/cif/dao/PaymentPriceConfigMapper.java

@@ -1,13 +0,0 @@
-package com.txz.cif.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.txz.cif.model.PaymentPriceConfig;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * @author: MTD®️
- * @date: 2025/8/28
- */
-@Mapper
-public interface PaymentPriceConfigMapper extends BaseMapper<PaymentPriceConfig> {
-}

+ 35 - 34
cif-service/src/main/java/com/txz/cif/model/Goods.java

@@ -6,9 +6,9 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
 
+import javax.persistence.*;
 import java.math.BigDecimal;
 import java.util.Date;
-import javax.persistence.*;
 
 @Getter
 @Setter
@@ -16,78 +16,79 @@ import javax.persistence.*;
 @AllArgsConstructor
 @Builder
 
-@ApiModel(value="com.txz.cif.model.Goods")
+@ApiModel(value = "com.txz.cif.model.Goods")
 @Table(name = "c_goods")
 public class Goods {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @ApiModelProperty(value="id")
+    @ApiModelProperty(value = "id")
     private Integer id;
-
+    
     /**
      * 商品名称
      */
-    @ApiModelProperty(value="name商品名称")
+    @ApiModelProperty(value = "name商品名称")
     private String name;
-
+    
     /**
      * 均价说明
      */
-    @ApiModelProperty(value="intro均价说明")
+    @ApiModelProperty(value = "intro均价说明")
     private String intro;
-
+    
     /**
      * 小图
      */
-    @ApiModelProperty(value="pic小图")
+    @ApiModelProperty(value = "pic小图")
     private String pic;
-
-    @ApiModelProperty(value="折扣金额")
+    
+    @ApiModelProperty(value = "折扣金额")
     private BigDecimal discount;
-
-    @ApiModelProperty(value="折扣率")
+    
+    @ApiModelProperty(value = "折扣率")
     private BigDecimal discountRate;
-
-
+    
+    /**
+     * 渠道id
+     */
+    private Long methodId;
+    
     /**
      * 大图
      */
     @Column(name = "big_pic")
-    @ApiModelProperty(value="bigPic大图")
+    @ApiModelProperty(value = "bigPic大图")
     private String bigPic;
-
-
-
+    
+    
     /**
      * 状态 0未启用 1正常 2停用
      */
-    @ApiModelProperty(value="status状态 0未启用 1正常 2停用")
+    @ApiModelProperty(value = "status状态 0未启用 1正常 2停用")
     private Byte status;
-
+    
     /**
      * 定价
      */
-    @ApiModelProperty(value="amount定价")
+    @ApiModelProperty(value = "amount定价")
     private BigDecimal amount;
-
-
-
+    
+    
     @Column(name = "sort_num")
-    @ApiModelProperty(value="sortNum")
+    @ApiModelProperty(value = "sortNum")
     private Integer sortNum;
-
+    
     @Column(name = "create_time")
-    @ApiModelProperty(value="createTime")
+    @ApiModelProperty(value = "createTime")
     private Date createTime;
-
+    
     @Column(name = "update_time")
-    @ApiModelProperty(value="updateTime")
+    @ApiModelProperty(value = "updateTime")
     private Date updateTime;
-
-
-
+    
+    
     public GoodsBO generator() {
-        GoodsBO bo = BeanUtil.toBean(this,GoodsBO.class);
+        GoodsBO bo = BeanUtil.toBean(this, GoodsBO.class);
         bo.setGoodsId(this.id);
         return bo;
     }

+ 0 - 61
cif-service/src/main/java/com/txz/cif/model/PaymentPriceConfig.java

@@ -1,61 +0,0 @@
-package com.txz.cif.model;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.util.Date;
-
-/**
- * @author: MTD®️
- * @date: 2025/8/28
- */
-@Data
-@TableName("c_payment_price_config")
-@EqualsAndHashCode(callSuper = true)
-public class PaymentPriceConfig extends Model<PaymentPriceConfig> {
-    
-    /**
-     * null
-     */
-    @TableId(type = IdType.AUTO)
-    private Long id;
-    
-    /**
-     * 有效标识 1是0否
-     */
-    private Integer isValid;
-    
-    /**
-     * 渠道id
-     */
-    private Long paymentId;
-    
-    /**
-     * 金额
-     */
-    private Integer priceVal;
-    
-    /**
-     * 创建人
-     */
-    private String createUser;
-    
-    /**
-     * 更新人
-     */
-    private String updateUser;
-    
-    /**
-     * 更新时间
-     */
-    private Date updateTime;
-    
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-}

+ 0 - 12
cif-service/src/main/java/com/txz/cif/service/PaymentPriceConfigService.java

@@ -1,12 +0,0 @@
-package com.txz.cif.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.txz.cif.model.PaymentPriceConfig;
-
-/**
- * @author: MTD®️
- * @date: 2025/8/28
- */
-
-public interface PaymentPriceConfigService extends IService<PaymentPriceConfig> {
-}

+ 0 - 17
cif-service/src/main/java/com/txz/cif/service/impl/PaymentPriceConfigServiceImpl.java

@@ -1,17 +0,0 @@
-package com.txz.cif.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.txz.cif.dao.PaymentPriceConfigMapper;
-import com.txz.cif.model.PaymentPriceConfig;
-import com.txz.cif.service.PaymentPriceConfigService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-/**
- * @author: MTD®️
- * @date: 2025/8/28
- */
-@Slf4j
-@Service
-public class PaymentPriceConfigServiceImpl extends ServiceImpl<PaymentPriceConfigMapper, PaymentPriceConfig> implements PaymentPriceConfigService {
-}

+ 195 - 179
cif-service/src/main/java/com/txz/cif/web/RechargeRecordApiController.java

@@ -1,4 +1,5 @@
 package com.txz.cif.web;
+
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONObject;
@@ -14,6 +15,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.cif.core.AuthService;
 import com.txz.cif.web.para.RecordParam;
+import com.txz.cif.web.vo.PaymentPriceVO;
 import org.springframework.web.bind.annotation.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -25,198 +27,212 @@ import tk.mybatis.mapper.entity.Example.Criteria;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
-* Created by CodeGenerator on 2025/07/15.
-*/
+ * Created by CodeGenerator on 2025/07/15.
+ */
 @Api(tags = "[api]充值记录")
 @RestController
 @RequestMapping("/api/recharge/record")
 public class RechargeRecordApiController {
-
-	private static Logger log = LoggerFactory.getLogger(RechargeRecordApiController.class);
-
+    
+    private static Logger log = LoggerFactory.getLogger(RechargeRecordApiController.class);
+    
     @Resource
     private RechargeRecordService rechargeRecordService;
-
-	@Resource
-	private GoodsService goodsService;
-
-	@Resource
-	private AuthService authService;
-
-	@Resource
-	private UserService userService;
-
-	@Resource
-	private BizLogService bizLogService;
-
-	@Resource
-	private SequenceService sequenceService;
-
-	@Resource
-	private  PaymentChannelService paymentChannelService;
-
-	@GetMapping("/goodsList")
-	@ApiOperation(value = "充值商品",httpMethod = "GET")
-	public Result<List<Goods>> goodsList() {
-		Condition c = new Condition(Goods.class);
-		c.createCriteria().andEqualTo("status",1);
-		List<Goods> goods = goodsService.findByCondition(c);
-		return ResultGenerator.genSuccessResult(goods);
-	}
-
-
-	@GetMapping("/add")
-	@ApiOperation(value = "创建充值订单",httpMethod = "GET")
-    public Result add(@RequestParam Integer goodsId,@RequestParam Long methodId, HttpServletRequest request) {
-		Long userId = authService.getTokenUserId(request);
-		if(goodsId == null){
-			return ResultGenerator.genFailResult(ResultCode.OAUTH_INVALID_ACCESS_TOKEN);
-		}
-		try {
-			Goods goods = goodsService.findById(goodsId);
-			if (goods == null){
-				return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
-			}
-			if (goods.getStatus() != 1){
-				return ResultGenerator.genFailResult(ResultCode.STATUS_IS_NULL);
-			}
-			User user = userService.findById(userId);
-			if (user == null){
-				return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
-			}
-			PaymentChannel paymentChannel = paymentChannelService.paymentChannelReturnsByWeight(methodId);
-
-//			long id = IdUtil.getSnowflake(1, 1).nextId();
-			String orderNo = sequenceService.genSerialNumber("recharge_rule",null);
-			RechargeRecord rechargeRecord = RechargeRecord.builder()
-					.discount(goods.getDiscount())
-					.amount(goods.getAmount())
-					.currency("BDT").userId(userId)
-					.userName(user.getName()).userPhone(user.getPhoneNo())
-					.bank(user.getBank())
-					.methodId(methodId)
-					.channelId(paymentChannel == null? null:paymentChannel.getId())
-					.bankAccount(user.getBankAccount())
-					.bankAccountName(user.getBankAccountName())
-					.orderNo(orderNo).goodsId(goodsId)
-					.createUser(user.getName())
-					.status(1).createTime(DateUtil.date())
-					.build();
-    		rechargeRecordService.save(rechargeRecord);
-			//TODO 发起第三方支付
-
-
-			try{
-				//新增日志
-				bizLogService.save(BizLog.builder().bizType(1).bizNo(orderNo)
-						.type(1).createTime(DateUtil.date()).createUser(user.getName())
-						.memo("提交充值订单").build());
-			}catch (Exception e){
-				log.error("新增充值提交订单日志失败",e);
-			}
-			return ResultGenerator.genSuccessResult(rechargeRecord);
-		} catch (Exception e) {
-			log.error("新增对象操作异常e:{}",e);
-			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-		}
-
+    
+    @Resource
+    private GoodsService goodsService;
+    
+    @Resource
+    private AuthService authService;
+    
+    @Resource
+    private UserService userService;
+    
+    @Resource
+    private BizLogService bizLogService;
+    
+    @Resource
+    private SequenceService sequenceService;
+    
+    @Resource
+    private PaymentChannelService paymentChannelService;
+    
+    @Resource
+    private PaymentMethodService paymentMethodService;
+    
+    @GetMapping("/goodsList/{methodId:^\\d+$}")
+    @ApiOperation(value = "充值商品", httpMethod = "GET")
+    public Result<PaymentPriceVO> goodsList(@PathVariable("methodId") Long methodId) {
+        Condition c = new Condition(Goods.class);
+        c.createCriteria().andEqualTo("status", 1);
+        c.createCriteria().andEqualTo("methodId", methodId);
+        c.setOrderByClause("amount asc");
+        List<Goods> goods = goodsService.findByCondition(c);
+        
+        PaymentMethod paymentMethod = paymentMethodService.findById(methodId);
+        return Result.success(PaymentPriceVO.builder()
+                .list(goods)
+                .miniPrice(paymentMethod.getMiniPrice())
+                .maxPrice(paymentMethod.getMaxPrice())
+                .build()
+        );
     }
-
-	@GetMapping("/callback")
-	@ApiOperation(value = "三方回调",httpMethod = "GET")
-	public Result<RechargeRecord> detail(@RequestParam String data) {
-		//TODO 回调成功
-		JSONObject json = JSONUtil.parseObj(data);
-		String orderNo = json.getStr("orderNo");
-		RechargeRecord record = rechargeRecordService.findBy("orderNo", orderNo);
-		if (record == null){
-			return ResultGenerator.genFailResult("订单未找到");
-		}
-		if (StrUtil.equals("1",json.getStr("status"))){
-			rechargeRecordService.success(record);
-		} else {
-			rechargeRecordService.fail(record);
-		}
-		try{
-			//新增充值回调日志
-			bizLogService.save(BizLog.builder().bizType(1).bizNo(orderNo)
-					.type(3).createTime(DateUtil.date()).createUser("第三方")
-					.memo("充值回调").build());
-		}catch (Exception e){
-			log.error("新增充值回调日志失败",e);
-		}
-		return ResultGenerator.genSuccessResult();
-	}
-
-
+    
+    
+    @GetMapping("/add")
+    @ApiOperation(value = "创建充值订单", httpMethod = "GET")
+    public Result add(@RequestParam BigDecimal amount, @RequestParam Long methodId, HttpServletRequest request) {
+        Long userId = authService.getTokenUserId(request);
+        // if (goodsId == null) {
+        //     return ResultGenerator.genFailResult(ResultCode.OAUTH_INVALID_ACCESS_TOKEN);
+        // }
+        try {
+            // Goods goods = goodsService.findById(goodsId);
+            // if (goods == null) {
+            //     return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
+            // }
+            // if (goods.getStatus() != 1) {
+            //     return ResultGenerator.genFailResult(ResultCode.STATUS_IS_NULL);
+            // }
+            User user = userService.findById(userId);
+            if (user == null) {
+                return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
+            }
+            PaymentChannel paymentChannel = paymentChannelService.paymentChannelReturnsByWeight(methodId);
+            
+            //			long id = IdUtil.getSnowflake(1, 1).nextId();
+            String orderNo = sequenceService.genSerialNumber("recharge_rule", null);
+            RechargeRecord rechargeRecord = RechargeRecord.builder()
+                    .discount(BigDecimal.ZERO)
+                    .amount(amount)
+                    .currency("BDT").userId(userId)
+                    .userName(user.getName()).userPhone(user.getPhoneNo())
+                    .bank(user.getBank())
+                    .methodId(methodId)
+                    .channelId(paymentChannel == null ? null : paymentChannel.getId())
+                    .bankAccount(user.getBankAccount())
+                    .bankAccountName(user.getBankAccountName())
+                    .orderNo(orderNo)
+                    .goodsId(-1)
+                    .createUser(user.getName())
+                    .status(1).createTime(DateUtil.date())
+                    .build();
+            rechargeRecordService.save(rechargeRecord);
+            // TODO 发起第三方支付
+            
+            
+            try {
+                // 新增日志
+                bizLogService.save(BizLog.builder().bizType(1).bizNo(orderNo)
+                        .type(1).createTime(DateUtil.date()).createUser(user.getName())
+                        .memo("提交充值订单").build());
+            } catch (Exception e) {
+                log.error("新增充值提交订单日志失败", e);
+            }
+            return ResultGenerator.genSuccessResult(rechargeRecord);
+        } catch (Exception e) {
+            log.error("新增对象操作异常e:{}", e);
+            return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        
+    }
+    
+    @GetMapping("/callback")
+    @ApiOperation(value = "三方回调", httpMethod = "GET")
+    public Result<RechargeRecord> detail(@RequestParam String data) {
+        // TODO 回调成功
+        JSONObject json = JSONUtil.parseObj(data);
+        String orderNo = json.getStr("orderNo");
+        RechargeRecord record = rechargeRecordService.findBy("orderNo", orderNo);
+        if (record == null) {
+            return ResultGenerator.genFailResult("订单未找到");
+        }
+        if (StrUtil.equals("1", json.getStr("status"))) {
+            rechargeRecordService.success(record);
+        } else {
+            rechargeRecordService.fail(record);
+        }
+        try {
+            // 新增充值回调日志
+            bizLogService.save(BizLog.builder().bizType(1).bizNo(orderNo)
+                    .type(3).createTime(DateUtil.date()).createUser("第三方")
+                    .memo("充值回调").build());
+        } catch (Exception e) {
+            log.error("新增充值回调日志失败", e);
+        }
+        return ResultGenerator.genSuccessResult();
+    }
+    
+    
     @GetMapping("/detail")
-	@ApiOperation(value = "rechargeRecord获取详情",httpMethod = "GET")
+    @ApiOperation(value = "rechargeRecord获取详情", httpMethod = "GET")
     public Result<RechargeRecord> detail(@RequestParam Integer id) {
-    	if(id == null){
-    		return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
-    	}
-
-    	RechargeRecord rechargeRecord = null;
-    	try {
-    		rechargeRecord = rechargeRecordService.findById(id);
-		} catch (Exception e) {
-			log.error("查询对象操作异常e:{}",e);
-			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-		}
-
+        if (id == null) {
+            return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
+        }
+        
+        RechargeRecord rechargeRecord = null;
+        try {
+            rechargeRecord = rechargeRecordService.findById(id);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        
         return ResultGenerator.genSuccessResult(rechargeRecord);
     }
-
+    
     @PostMapping("/list")
-	@ApiOperation(value = "rechargeRecord获取列表",httpMethod = "POST")
-	public Result<List<RechargeRecord>> list(@RequestBody RecordParam param, HttpServletRequest request) {
-		Long userId = authService.getTokenUserId(request);
-		if (userId == null ){
-			ResultGenerator.genFailResult(ResultCode.OAUTH_INVALID_ACCESS_TOKEN);
-		}
-		PageHelper.startPage(param.getPage(), param.getSize());
-
-		Condition condition = new Condition(RechargeRecord.class);
-		Criteria criteria = condition.createCriteria();
-		criteria.andEqualTo("userId", userId);
-		if (StrUtil.isNotBlank(param.getChannel())){
-			criteria.andEqualTo("channel", param.getChannel());
-		}
-		if (StrUtil.isNotBlank(param.getUserName())){
-			criteria.andEqualTo("userName", param.getUserName());
-		}
-		if (StrUtil.isNotBlank(param.getUserPhone())){
-			criteria.andEqualTo("userPhone", param.getUserPhone());
-		}
-		if (StrUtil.isNotBlank(param.getOrderNo())){
-			criteria.andEqualTo("orderNo", param.getOrderNo());
-		}
-		if (param.getStatus() != null){
-			criteria.andEqualTo("status", param.getStatus());
-		}
-		if (param.getTimeType() != null){
-			if (param.getTimeType() ==1 ){
-				if (StrUtil.isNotBlank(param.getStartTime())){
-					criteria.andBetween("createTime", param.getStartTime(),param.getEndTime());
-				}
-			} else  if (param.getTimeType() ==2 ){
-				if (StrUtil.isNotBlank(param.getStartTime())){
-					criteria.andBetween("successTime", param.getStartTime(),param.getEndTime());
-				}
-			}
-		}
-		PageInfo pageInfo = null;
-		try {
-			condition.setOrderByClause("create_time desc");
-			List<RechargeRecord> list = rechargeRecordService.findByCondition(condition);
-			pageInfo = new PageInfo(list);
-		} catch (Exception e) {
-			log.error("查询对象操作异常e:{}",e);
-			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-		}
-		return ResultGenerator.genSuccessResult(pageInfo);
-	}
+    @ApiOperation(value = "rechargeRecord获取列表", httpMethod = "POST")
+    public Result<List<RechargeRecord>> list(@RequestBody RecordParam param, HttpServletRequest request) {
+        Long userId = authService.getTokenUserId(request);
+        if (userId == null) {
+            ResultGenerator.genFailResult(ResultCode.OAUTH_INVALID_ACCESS_TOKEN);
+        }
+        PageHelper.startPage(param.getPage(), param.getSize());
+        
+        Condition condition = new Condition(RechargeRecord.class);
+        Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("userId", userId);
+        if (StrUtil.isNotBlank(param.getChannel())) {
+            criteria.andEqualTo("channel", param.getChannel());
+        }
+        if (StrUtil.isNotBlank(param.getUserName())) {
+            criteria.andEqualTo("userName", param.getUserName());
+        }
+        if (StrUtil.isNotBlank(param.getUserPhone())) {
+            criteria.andEqualTo("userPhone", param.getUserPhone());
+        }
+        if (StrUtil.isNotBlank(param.getOrderNo())) {
+            criteria.andEqualTo("orderNo", param.getOrderNo());
+        }
+        if (param.getStatus() != null) {
+            criteria.andEqualTo("status", param.getStatus());
+        }
+        if (param.getTimeType() != null) {
+            if (param.getTimeType() == 1) {
+                if (StrUtil.isNotBlank(param.getStartTime())) {
+                    criteria.andBetween("createTime", param.getStartTime(), param.getEndTime());
+                }
+            } else if (param.getTimeType() == 2) {
+                if (StrUtil.isNotBlank(param.getStartTime())) {
+                    criteria.andBetween("successTime", param.getStartTime(), param.getEndTime());
+                }
+            }
+        }
+        PageInfo pageInfo = null;
+        try {
+            condition.setOrderByClause("create_time desc");
+            List<RechargeRecord> list = rechargeRecordService.findByCondition(condition);
+            pageInfo = new PageInfo(list);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return ResultGenerator.genSuccessResult(pageInfo);
+    }
 }

+ 128 - 89
cif-service/src/main/java/com/txz/cif/web/mng/GoodsController.java

@@ -1,22 +1,22 @@
 package com.txz.cif.web.mng;
-import cn.hutool.core.util.StrUtil;
+
 import com.txz.cif.core.Result;
+import com.txz.cif.core.ResultCode;
 import com.txz.cif.core.ResultGenerator;
 import com.txz.cif.model.Goods;
+import com.txz.cif.model.PaymentMethod;
 import com.txz.cif.model.RechargeRecord;
 import com.txz.cif.service.GoodsService;
-
-import com.txz.cif.core.ResultCode;
-
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
+import com.txz.cif.service.PaymentMethodService;
 import com.txz.cif.web.para.GoodsParam;
-import org.springframework.web.bind.annotation.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.txz.cif.web.ro.PaymentPriceConfigRO;
+import com.txz.cif.web.vo.PaymentPriceVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
 import tk.mybatis.mapper.entity.Example.Criteria;
 
@@ -24,95 +24,134 @@ import javax.annotation.Resource;
 import java.util.List;
 
 /**
-* Created by CodeGenerator on 2025/07/15.
-*/
+ * Created by CodeGenerator on 2025/07/15.
+ */
 @Api(tags = "[后台]充值商品管理")
 @RestController
 @RequestMapping("/goods")
 public class GoodsController {
-
-	private static Logger log = LoggerFactory.getLogger(GoodsController.class);
-
-	@Resource
-	private GoodsService goodsService;
-
-	@PostMapping("/update")
-	@ApiOperation(value = "更新",httpMethod = "POST")
-	public Result update(@RequestBody Goods goods) {
-		if (goods.getId() == null) {
-			return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
-		}
-		goodsService.update(goods);
-		return ResultGenerator.genSuccessResult();
-	}
-
-	@PostMapping("/add")
-	@ApiOperation(value = "新增",httpMethod = "POST")
-	public Result add(@RequestBody Goods goods) {
-		goods.setId(null);
-		goodsService.save(goods);
-		return ResultGenerator.genSuccessResult();
-	}
-
-	@GetMapping("/delete")
-	@ApiOperation(value = "删除",httpMethod = "GET")
-	public Result<Goods> delete(@RequestParam Long id) {
-		if(id == null){
-			return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
-		}
-		try {
-			goodsService.deleteById(id);
-			return ResultGenerator.genSuccessResult();
-		} catch (Exception e) {
-			log.error("查询对象操作异常e:{}",e);
-			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-		}
-
-	}
-
+    
+    private static Logger log = LoggerFactory.getLogger(GoodsController.class);
+    
+    @Resource
+    private GoodsService goodsService;
+    
+    @Resource
+    private PaymentMethodService paymentMethodService;
+    
+    @PostMapping("/update")
+    @ApiOperation(value = "更新", httpMethod = "POST")
+    public Result update(@RequestBody Goods goods) {
+        if (goods.getId() == null) {
+            return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
+        }
+        goodsService.update(goods);
+        return ResultGenerator.genSuccessResult();
+    }
+    
+    @PostMapping("/add")
+    @ApiOperation(value = "新增", httpMethod = "POST")
+    public Result add(@RequestBody Goods goods) {
+        goods.setId(null);
+        goodsService.save(goods);
+        return ResultGenerator.genSuccessResult();
+    }
+    
+    @GetMapping("/delete")
+    @ApiOperation(value = "删除", httpMethod = "GET")
+    public Result<Goods> delete(@RequestParam Long id) {
+        if (id == null) {
+            return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
+        }
+        try {
+            goodsService.deleteById(id);
+            return ResultGenerator.genSuccessResult();
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        
+    }
+    
     @GetMapping("/detail")
-	@ApiOperation(value = "获取详情",httpMethod = "GET")
+    @ApiOperation(value = "获取详情", httpMethod = "GET")
     public Result<Goods> detail(@RequestParam Long id) {
-    	if(id == null){
-    		return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
-    	}
-
-    	try {
-			Goods goods = goodsService.findById(id);
-			if (goods == null){
-				return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
-			}
-			return ResultGenerator.genSuccessResult(goods);
-		} catch (Exception e) {
-			log.error("查询对象操作异常e:{}",e);
-			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-		}
-
+        if (id == null) {
+            return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
+        }
+        
+        try {
+            Goods goods = goodsService.findById(id);
+            if (goods == null) {
+                return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
+            }
+            return ResultGenerator.genSuccessResult(goods);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        
     }
-
+    
     @PostMapping("/list")
-	@ApiOperation(value = "获取列表",httpMethod = "POST")
+    @ApiOperation(value = "获取列表", httpMethod = "POST")
     public Result<List<Goods>> list(@RequestBody GoodsParam param) {
-
-        PageHelper.startPage(param.getPage(), param.getSize());
-
+        
+        PaymentMethod paymentMethod = paymentMethodService.findById(param.getMethodId());
+        
         Condition condition = new Condition(RechargeRecord.class);
         Criteria criteria = condition.createCriteria();
-		if (param.getStatus() != null){
-			criteria.andEqualTo("status", param.getStatus());
-		}
-		if (StrUtil.isNotBlank(param.getStartTime())){
-			criteria.andBetween("createTime", param.getStartTime(),param.getEndTime());
-		}
-		PageInfo pageInfo = null;
-		try {
-			condition.setOrderByClause("create_time desc");
-    		 List<Goods> list = goodsService.findByCondition(condition);
-    		 pageInfo = new PageInfo(list);
-		} catch (Exception e) {
-			log.error("查询对象操作异常e:{}",e);
-			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-		}
-        return ResultGenerator.genSuccessResult(pageInfo);
+        criteria.andEqualTo("methodId", param.getMethodId());
+        if (param.getStatus() != null) {
+            criteria.andEqualTo("status", param.getStatus());
+        }
+        condition.setOrderByClause("create_time desc");
+        List<Goods> list = goodsService.findByCondition(condition);
+        
+        return Result.success(PaymentPriceVO.builder()
+                .list(list)
+                .miniPrice(paymentMethod.getMiniPrice())
+                .maxPrice(paymentMethod.getMaxPrice())
+                .build()
+        );
+    }
+    
+    /**
+     * 修改区间
+     */
+    @PatchMapping("editInterval/{paymentId:^\\d+$}")
+    public Result editInterval(@PathVariable("paymentId") Long paymentId, @RequestBody @Validated({PaymentPriceConfigRO.EditInterval.class}) PaymentPriceConfigRO ro) {
+        // PaymentPriceConfig mini = paymentPriceConfigService.getOne(Wrappers.<PaymentPriceConfig>lambdaQuery()
+        //         .eq(PaymentPriceConfig::getPaymentId, paymentId)
+        //         .lt(PaymentPriceConfig::getPriceVal, ro.getMiniPrice())
+        //         .eq(PaymentPriceConfig::getIsValid, 1)
+        //         .last("limit 1")
+        // );
+        // if (ObjectUtil.isNotEmpty(mini)) {
+        //     return Result.fail("最小金额不能小于已配置金额");
+        // }
+        //
+        // PaymentPriceConfig max = paymentPriceConfigService.getOne(Wrappers.<PaymentPriceConfig>lambdaQuery()
+        //         .eq(PaymentPriceConfig::getPaymentId, paymentId)
+        //         .gt(PaymentPriceConfig::getPriceVal, ro.getMaxPrice())
+        //         .eq(PaymentPriceConfig::getIsValid, 1)
+        //         .last("limit 1")
+        // );
+        // if (ObjectUtil.isNotEmpty(max)) {
+        //     return Result.fail("最大金额不能大于已配置金额");
+        // }
+        
+        if (ro.getMiniPrice() > ro.getMaxPrice()) {
+            return Result.fail("最小金额不能大于最大金额");
+        }
+        
+        PaymentMethod updateMethod = new PaymentMethod();
+        updateMethod.setId(paymentId);
+        updateMethod.setMiniPrice(ro.getMiniPrice());
+        updateMethod.setMaxPrice(ro.getMaxPrice());
+        
+        paymentMethodService.update(updateMethod);
+        
+        return Result.success();
     }
 }

+ 0 - 152
cif-service/src/main/java/com/txz/cif/web/mng/PaymentPriceConfigController.java

@@ -1,152 +0,0 @@
-package com.txz.cif.web.mng;
-
-
-import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.txz.cif.core.Result;
-import com.txz.cif.model.PaymentMethod;
-import com.txz.cif.model.PaymentPriceConfig;
-import com.txz.cif.service.PaymentMethodService;
-import com.txz.cif.service.PaymentPriceConfigService;
-import com.txz.cif.web.ro.PaymentPriceConfigRO;
-import com.txz.cif.web.vo.PaymentPriceVO;
-import lombok.RequiredArgsConstructor;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-/**
- * [后台]充值金额配置
- *
- * @author: MTD®️
- * @date: 2025/8/28
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("paymentPriceConfig")
-public class PaymentPriceConfigController {
-    
-    private final PaymentPriceConfigService paymentPriceConfigService;
-    
-    private final PaymentMethodService paymentMethodService;
-    
-    /**
-     * 列表
-     */
-    @GetMapping("list/{paymentId:^\\d+$}")
-    public Result<PaymentPriceVO> list(@PathVariable("paymentId") Long paymentId) {
-        PaymentMethod paymentMethod = paymentMethodService.findById(paymentId);
-        return Result.success(PaymentPriceVO.builder()
-                .list(paymentPriceConfigService.list(
-                        Wrappers.<PaymentPriceConfig>lambdaQuery()
-                                .eq(PaymentPriceConfig::getPaymentId, paymentId)
-                                .eq(PaymentPriceConfig::getIsValid, 1)
-                                .orderByAsc(PaymentPriceConfig::getPriceVal)
-                ))
-                .miniPrice(paymentMethod.getMiniPrice())
-                .maxPrice(paymentMethod.getMaxPrice())
-                .build()
-        );
-    }
-    
-    /**
-     * 新增
-     */
-    @PostMapping("add/{paymentId:^\\d+$}")
-    public Result add(@PathVariable("paymentId") Long paymentId, @RequestBody @Validated({PaymentPriceConfigRO.Add.class}) PaymentPriceConfigRO ro) {
-        if (paymentPriceConfigService.count(
-                Wrappers.<PaymentPriceConfig>lambdaQuery()
-                        .eq(PaymentPriceConfig::getPaymentId, paymentId)
-                        .eq(PaymentPriceConfig::getIsValid, 1)) >= 9L
-        ) {
-            return Result.fail("最多添加9个");
-        }
-        PaymentPriceConfig exist = paymentPriceConfigService.getOne(Wrappers.<PaymentPriceConfig>lambdaQuery()
-                .eq(PaymentPriceConfig::getPriceVal, ro.getPriceVal())
-                .eq(PaymentPriceConfig::getPaymentId, paymentId)
-                .eq(PaymentPriceConfig::getIsValid, 1)
-        );
-        if (ObjectUtil.isNotEmpty(exist)) {
-            return Result.fail("该金额已存在");
-        }
-        PaymentPriceConfig addInfo = new PaymentPriceConfig();
-        addInfo.setPaymentId(paymentId);
-        addInfo.setPriceVal(ro.getPriceVal());
-        addInfo.setIsValid(1);
-        paymentPriceConfigService.save(addInfo);
-        return Result.success();
-    }
-    
-    /**
-     * 修改
-     */
-    @PatchMapping("edit/{id:^\\d+$}")
-    public Result edit(@PathVariable("id") Long id, @RequestBody @Validated({PaymentPriceConfigRO.Edit.class}) PaymentPriceConfigRO ro) {
-        PaymentPriceConfig exist = paymentPriceConfigService.getOne(Wrappers.<PaymentPriceConfig>lambdaQuery()
-                .eq(PaymentPriceConfig::getPriceVal, ro.getPriceVal())
-                .ne(PaymentPriceConfig::getId, id)
-                .eq(PaymentPriceConfig::getIsValid, 1)
-        );
-        if (ObjectUtil.isNotEmpty(exist)) {
-            return Result.fail("该金额已存在");
-        }
-        paymentPriceConfigService.update(Wrappers.<PaymentPriceConfig>lambdaUpdate()
-                .eq(PaymentPriceConfig::getId, id)
-                .set(PaymentPriceConfig::getPriceVal, ro.getPriceVal())
-        
-        );
-        return Result.success();
-    }
-    
-    /**
-     * 删除
-     */
-    @DeleteMapping("del/{id:^\\d+$}")
-    public Result del(@PathVariable("id") Long id) {
-        paymentPriceConfigService.update(Wrappers.<PaymentPriceConfig>lambdaUpdate()
-                .eq(PaymentPriceConfig::getId, id)
-                .set(PaymentPriceConfig::getIsValid, 0)
-        
-        );
-        return Result.success();
-    }
-    
-    /**
-     * 修改区间
-     */
-    @PatchMapping("editInterval/{paymentId:^\\d+$}")
-    public Result editInterval(@PathVariable("paymentId") Long paymentId, @RequestBody @Validated({PaymentPriceConfigRO.EditInterval.class}) PaymentPriceConfigRO ro) {
-        // PaymentPriceConfig mini = paymentPriceConfigService.getOne(Wrappers.<PaymentPriceConfig>lambdaQuery()
-        //         .eq(PaymentPriceConfig::getPaymentId, paymentId)
-        //         .lt(PaymentPriceConfig::getPriceVal, ro.getMiniPrice())
-        //         .eq(PaymentPriceConfig::getIsValid, 1)
-        //         .last("limit 1")
-        // );
-        // if (ObjectUtil.isNotEmpty(mini)) {
-        //     return Result.fail("最小金额不能小于已配置金额");
-        // }
-        //
-        // PaymentPriceConfig max = paymentPriceConfigService.getOne(Wrappers.<PaymentPriceConfig>lambdaQuery()
-        //         .eq(PaymentPriceConfig::getPaymentId, paymentId)
-        //         .gt(PaymentPriceConfig::getPriceVal, ro.getMaxPrice())
-        //         .eq(PaymentPriceConfig::getIsValid, 1)
-        //         .last("limit 1")
-        // );
-        // if (ObjectUtil.isNotEmpty(max)) {
-        //     return Result.fail("最大金额不能大于已配置金额");
-        // }
-        
-        if (ro.getMiniPrice() > ro.getMaxPrice()) {
-            return Result.fail("最小金额不能大于最大金额");
-        }
-        
-        PaymentMethod updateMethod = new PaymentMethod();
-        updateMethod.setId(paymentId);
-        updateMethod.setMiniPrice(ro.getMiniPrice());
-        updateMethod.setMaxPrice(ro.getMaxPrice());
-        
-        paymentMethodService.update(updateMethod);
-        
-        return Result.success();
-    }
-    
-}

+ 0 - 51
cif-service/src/main/java/com/txz/cif/web/mng/appcontroller/AppPaymentPriceConfigController.java

@@ -1,51 +0,0 @@
-package com.txz.cif.web.mng.appcontroller;
-
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.txz.cif.core.Result;
-import com.txz.cif.model.PaymentMethod;
-import com.txz.cif.model.PaymentPriceConfig;
-import com.txz.cif.service.PaymentMethodService;
-import com.txz.cif.service.PaymentPriceConfigService;
-import com.txz.cif.web.vo.PaymentPriceVO;
-import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * app端充值金额配置
- *
- * @author: MTD®️
- * @date: 2025/8/28
- */
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("app/paymentPriceConfig")
-public class AppPaymentPriceConfigController {
-    
-    private final PaymentPriceConfigService paymentPriceConfigService;
-    
-    private final PaymentMethodService paymentMethodService;
-    
-    
-    /**
-     * 获取配置
-     */
-    @GetMapping("priceInfo/{paymentId:^\\d+$}")
-    public Result<PaymentPriceVO> list(@PathVariable("paymentId") Long paymentId) {
-        PaymentMethod paymentMethod = paymentMethodService.findById(paymentId);
-        return Result.success(PaymentPriceVO.builder()
-                .list(paymentPriceConfigService.list(
-                        Wrappers.<PaymentPriceConfig>lambdaQuery()
-                                .eq(PaymentPriceConfig::getPaymentId, paymentId)
-                                .eq(PaymentPriceConfig::getIsValid, 1)
-                                .orderByAsc(PaymentPriceConfig::getPriceVal)
-                ))
-                .miniPrice(paymentMethod.getMiniPrice())
-                .maxPrice(paymentMethod.getMaxPrice())
-                .build()
-        );
-    }
-    
-}

+ 21 - 19
cif-service/src/main/java/com/txz/cif/web/para/GoodsParam.java

@@ -4,46 +4,48 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
 
-import java.math.BigDecimal;
-import java.util.Date;
-import javax.persistence.*;
 @Getter
 @Setter
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
 
-@ApiModel(value="充值集合查询")
+@ApiModel(value = "充值集合查询")
 public class GoodsParam {
-
-
+    
+    
     /**
+     *
      */
-    @ApiModelProperty(value="status状态 1正常 2禁用")
+    @ApiModelProperty(value = "status状态 1正常 2禁用")
     private Integer status;
-
-
+    
+    
     /**
      * 交易时间
      */
-    @ApiModelProperty(value="开始时间")
+    @ApiModelProperty(value = "开始时间")
     private String startTime;
-
+    
     /**
      * 交易成功时间
      */
-    @ApiModelProperty(value="结束时间")
+    @ApiModelProperty(value = "结束时间")
     private String endTime;
-
-
+    
+    /**
+     * 渠道id
+     */
+    private Long methodId;
+    
     /**
      * 商品id
      */
-    @ApiModelProperty(value="page")
+    @ApiModelProperty(value = "page")
     private Integer page;
-
-    @ApiModelProperty(value="size")
+    
+    @ApiModelProperty(value = "size")
     private Integer size;
-
-
+    
+    
 }

+ 0 - 11
cif-service/src/main/java/com/txz/cif/web/ro/PaymentPriceConfigRO.java

@@ -12,11 +12,6 @@ import javax.validation.constraints.NotNull;
 @Data
 public class PaymentPriceConfigRO {
     
-    @NotNull(message = "金额不能为空", groups = {Add.class, Edit.class})
-    @Min(value = 1, message = "金额不能为空不能小于1", groups = {Add.class, Edit.class})
-    // @Max(value = Integer.MAX_VALUE, message = "金额不能为空不能大于")
-    private Integer priceVal;
-    
     @NotNull(message = "金额不能为空", groups = {EditInterval.class})
     @Min(value = 1, message = "金额不能为空不能小于1", groups = {EditInterval.class})
     private Integer miniPrice;
@@ -25,12 +20,6 @@ public class PaymentPriceConfigRO {
     @Min(value = 1, message = "金额不能为空不能小于1", groups = {EditInterval.class})
     private Integer maxPrice;
     
-    public interface Add {
-    }
-    
-    public interface Edit {
-    }
-    
     public interface EditInterval {
     }
     

+ 2 - 2
cif-service/src/main/java/com/txz/cif/web/vo/PaymentPriceVO.java

@@ -1,6 +1,6 @@
 package com.txz.cif.web.vo;
 
-import com.txz.cif.model.PaymentPriceConfig;
+import com.txz.cif.model.Goods;
 import lombok.Builder;
 import lombok.Data;
 
@@ -17,7 +17,7 @@ public class PaymentPriceVO {
     /**
      * 配置列表
      */
-    private List<PaymentPriceConfig> list;
+    private List<Goods> list;
     
     /**
      * 充值最低限额