Browse Source

11-20 收款bug修复 金额校验 小黄车骨架

sunjiabei/feature-20251021102635-银行接口
lijianlin 6 days ago
parent
commit
45ab3873fb
  1. 18
      src/main/java/com/example/demo/controller/bean/BeanConsumeController.java
  2. 12
      src/main/java/com/example/demo/domain/vo/bean/BeanConsumeCart.java
  3. 1
      src/main/java/com/example/demo/domain/vo/coin/Page.java
  4. 4
      src/main/java/com/example/demo/service/bean/BeanConsumeService.java
  5. 5
      src/main/java/com/example/demo/serviceImpl/bean/BeanConsumeServiceImpl.java
  6. 14
      src/main/java/com/example/demo/serviceImpl/cash/CashCollectionServiceImpl.java
  7. 13
      src/main/resources/cashMapper/CashCollectionMapper.xml

18
src/main/java/com/example/demo/controller/bean/BeanConsumeController.java

@ -111,6 +111,24 @@ public class BeanConsumeController {
return Result.error(e.toString());
}}
//筛选查询小黄车消费记录
@PostMapping("/selectCartBy")
public Result selectCartBy(@RequestBody Page page){
try {
if (ObjectUtils.isEmpty(page.getPageNum())) {
return Result.error("页码数为空!");
}
if (ObjectUtils.isEmpty(page.getPageSize())) {
return Result.error("页大小为空!");
} else {
return Result.success(beanConsumeService.selectCartBy(page.getPageNum(), page.getPageSize(), page.getBeanConsumeCart()));
}
} catch (Exception e) {
e.printStackTrace();
return Result.error(e.toString());
}
}
//消费合计数
@PostMapping("sumConsumeGold")
public BeanConsumeGold sumConsumeGold(@RequestBody Page page) {

12
src/main/java/com/example/demo/domain/vo/bean/BeanConsumeCart.java

@ -0,0 +1,12 @@
package com.example.demo.domain.vo.bean;
/**
* @program: gold-java
* @ClassName BeanConsumeCart
* @description:
* @author: Ethan
* @create: 202511-20 10:28
* @Version 1.0
**/
public class BeanConsumeCart {
}

1
src/main/java/com/example/demo/domain/vo/coin/Page.java

@ -36,6 +36,7 @@ public class Page {
private BeanConsumeLive beanConsumeLive; //直播金豆消费
private BeanConsumeFan beanConsumeFan; //铁粉金豆消费
private BeanConsumeArticle beanConsumeArticle; //文章金豆消费
private BeanConsumeCart beanConsumeCart;
private BeanSystemRechargeInfo beanSystemRechargeInfo; //金豆充值信息
private BeanOnlineRechargeInfo beanOnlineRechargeInfo; //金豆充值信息
private BeanConsumeGold beanConsumeGold; //金豆消费合计数

4
src/main/java/com/example/demo/service/bean/BeanConsumeService.java

@ -36,6 +36,6 @@ public interface BeanConsumeService {
//获取直播频道
List<String> getLiveChannel();
//筛选查询小黄车消费
Object selectCartBy(Integer pageNum, Integer pageSize, BeanConsumeCart beanConsumeCart);
}

5
src/main/java/com/example/demo/serviceImpl/bean/BeanConsumeServiceImpl.java

@ -201,6 +201,11 @@ public class BeanConsumeServiceImpl implements BeanConsumeService {
public List<String> getLiveChannel() {
return liveMapper.getLiveChannel();
}
//筛选查询小黄车消费
@Override
public Object selectCartBy(Integer pageNum, Integer pageSize, BeanConsumeCart beanConsumeCart) {
return null;
}
}

14
src/main/java/com/example/demo/serviceImpl/cash/CashCollectionServiceImpl.java

@ -61,13 +61,13 @@ public class CashCollectionServiceImpl implements CashCollectionService {
if (cashCollection.getJwcode() < 10000000 || cashCollection.getJwcode() > 99999999) {
throw new IllegalArgumentException("精网号必须为8位");
}
if (cashCollection.getName() == null) {
if (cashCollection.getName() == null || cashCollection.getName().isEmpty()){
throw new IllegalArgumentException("客户姓名不能为空");
}
if (cashCollection.getActivity() == null) {
if (cashCollection.getActivity() == null || cashCollection.getActivity().isEmpty()) {
throw new IllegalArgumentException("活动不能为空");
}
if (cashCollection.getGoodsName() == null) {
if (cashCollection.getGoodsName() == null|| cashCollection.getGoodsName().isEmpty()) {
throw new IllegalArgumentException("商品名不能为空");
}
if (cashCollection.getGoodsName().equals("金币充值")) {
@ -79,20 +79,20 @@ public class CashCollectionServiceImpl implements CashCollectionService {
if (cashCollection.getGoodNum() == 0) {
throw new IllegalArgumentException("产品数量不能为空");
}
if (cashCollection.getNumUnit() == null) {
if (cashCollection.getNumUnit() == null|| cashCollection.getNumUnit().isEmpty()) {
throw new IllegalArgumentException("数量单位不能为空");
}
}
if (cashCollection.getPaymentCurrency() == null) {
if (cashCollection.getPaymentCurrency() == null || cashCollection.getPaymentCurrency().isEmpty()) {
throw new IllegalArgumentException("支付币种不能为空");
}
if (cashCollection.getPaymentAmount() == null || cashCollection.getPaymentAmount().compareTo(BigDecimal.ZERO) == 0) {
throw new IllegalArgumentException("支付金额不能为空");
}
if (cashCollection.getPayType() == null) {
if (cashCollection.getPayType() == null|| cashCollection.getPayType().isEmpty()) {
throw new IllegalArgumentException("支付方式不能为空");
}
if (cashCollection.getReceivedMarket() == null) {
if (cashCollection.getReceivedMarket() == null||cashCollection.getReceivedMarket().isEmpty()) {
throw new IllegalArgumentException("到账地区不能为空");
}
if (cashCollection.getPayTime() == null) {

13
src/main/resources/cashMapper/CashCollectionMapper.xml

@ -62,23 +62,14 @@
<update id="complete">
UPDATE cash_record_collection
<set>
<if test="cashRecordCollection.handlingCharge != null ">
handling_charge = #{cashRecordCollection.handlingCharge},
</if>
<if test="cashRecordCollection.receivedCurrency != null and cashRecordCollection.receivedCurrency != ''">
received_currency = #{cashRecordCollection.receivedCurrency},
</if>
<if test="cashRecordCollection.receivedAmount != null and cashRecordCollection.receivedAmount != ''">
<if test="cashRecordCollection.receivedAmount != 0">
received_amount = #{cashRecordCollection.receivedAmount},
</if>
<if test="cashRecordCollection.receivedTime != null">
received_time = #{cashRecordCollection.receivedTime},
</if>
<if test="cashRecordCollection.paymentCurrency != null and cashRecordCollection.paymentCurrency != ''">
payment_currency = #{cashRecordCollection.paymentCurrency},
</if>
<!-- 关键:null 就不拼这一列 -->
<if test="cashRecordCollection.paymentAmount != null">
<if test="cashRecordCollection.paymentAmount != 0">
payment_amount = #{cashRecordCollection.paymentAmount},
</if>
<!-- 只有 这些字段全部非空才更新状态 -->

Loading…
Cancel
Save