From 1273e8c66fffb6295b210d6f380e099c4a308838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=84=89=E5=BF=AB=E7=9A=84=E5=A4=A7=E7=A6=8F?= <8790092+honest_zcy@user.noreply.gitee.com> Date: Sun, 8 Sep 2024 19:44:23 +0800 Subject: [PATCH] 11 --- .../api/EventMarketing/activeConsumption.js | 2 +- .../controller/CardValueRuleController.java | 3 +- .../cardValueRule/entity/CardValueRule.java | 156 +----------------- .../CardValueRuleMapper.java} | 6 +- .../impl/CardValueRuleServiceImpl.java | 4 +- 5 files changed, 17 insertions(+), 154 deletions(-) rename fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/{dao/CardValueRuleDao.java => mapper/CardValueRuleMapper.java} (57%) diff --git a/fuintAdmin/src/api/EventMarketing/activeConsumption.js b/fuintAdmin/src/api/EventMarketing/activeConsumption.js index 45bec0b69..f7fa966e8 100644 --- a/fuintAdmin/src/api/EventMarketing/activeConsumption.js +++ b/fuintAdmin/src/api/EventMarketing/activeConsumption.js @@ -27,7 +27,7 @@ export function listActiveConsumption(query) { //优惠券 export function listFavorable(query) { return request({ - url: 'business/marketingActivity/cardFavorable', + url: 'cardCoupon', method: 'get', params: query }) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/controller/CardValueRuleController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/controller/CardValueRuleController.java index 4805a3496..708cf806f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/controller/CardValueRuleController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/controller/CardValueRuleController.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.io.Serializable; import java.util.List; +import java.util.Optional; /** * 储值卡规则(CardValueRule)表控制层 @@ -56,7 +57,7 @@ public class CardValueRuleController extends BaseController { public ResponseObject selectOne() { LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper(); queryWrapper.eq(CardValueRule::getStoreId, TokenUtil.getNowAccountInfo().getStoreId()).last("limit 1"); - return getSuccessResult(this.cardValueRuleService.getOne(queryWrapper)); + return getSuccessResult(Optional.ofNullable(this.cardValueRuleService.getOne(queryWrapper)).orElse(new CardValueRule())); } /** diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/entity/CardValueRule.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/entity/CardValueRule.java index 4d03e4d2c..b738e84b3 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/entity/CardValueRule.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/entity/CardValueRule.java @@ -1,7 +1,12 @@ package com.fuint.business.marketingActivity.cardValueRule.entity; import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; +import lombok.Data; + import java.io.Serializable; /** @@ -10,9 +15,10 @@ import java.io.Serializable; * @author makejava * @since 2024-09-08 18:19:04 */ -@SuppressWarnings("serial") +@Data public class CardValueRule extends Model { //主键 + @TableId(type = IdType.AUTO) private Integer id; //所属连锁店id private Integer chainStoreId; @@ -47,151 +53,5 @@ public class CardValueRule extends Model { //更新时间 private Date updateTime; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Integer getChainStoreId() { - return chainStoreId; - } - - public void setChainStoreId(Integer chainStoreId) { - this.chainStoreId = chainStoreId; - } - - public Integer getStoreId() { - return storeId; - } - - public void setStoreId(Integer storeId) { - this.storeId = storeId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getQyDetail() { - return qyDetail; - } - - public void setQyDetail(String qyDetail) { - this.qyDetail = qyDetail; - } - - public String getGzDetail() { - return gzDetail; - } - - public void setGzDetail(String gzDetail) { - this.gzDetail = gzDetail; - } - - public String getOilLimit() { - return oilLimit; - } - - public void setOilLimit(String oilLimit) { - this.oilLimit = oilLimit; - } - - public String getOilNumber() { - return oilNumber; - } - - public void setOilNumber(String oilNumber) { - this.oilNumber = oilNumber; - } - - public String getProductLimit() { - return productLimit; - } - - public void setProductLimit(String productLimit) { - this.productLimit = productLimit; - } - - public String getProductIds() { - return productIds; - } - - public void setProductIds(String productIds) { - this.productIds = productIds; - } - - public String getTimeLimit() { - return timeLimit; - } - - public void setTimeLimit(String timeLimit) { - this.timeLimit = timeLimit; - } - - public Date getEffectiveDateStart() { - return effectiveDateStart; - } - - public void setEffectiveDateStart(Date effectiveDateStart) { - this.effectiveDateStart = effectiveDateStart; - } - - public Date getEffectiveDateEnd() { - return effectiveDateEnd; - } - - public void setEffectiveDateEnd(Date effectiveDateEnd) { - this.effectiveDateEnd = effectiveDateEnd; - } - - public String getCreateBy() { - return createBy; - } - - public void setCreateBy(String createBy) { - this.createBy = createBy; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getUpdateBy() { - return updateBy; - } - - public void setUpdateBy(String updateBy) { - this.updateBy = updateBy; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - /** - * 获取主键值 - * - * @return 主键值 - */ - @Override - protected Serializable pkVal() { - return this.id; - } - } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/dao/CardValueRuleDao.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/mapper/CardValueRuleMapper.java similarity index 57% rename from fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/dao/CardValueRuleDao.java rename to fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/mapper/CardValueRuleMapper.java index e462740f7..97fd08727 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/dao/CardValueRuleDao.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/mapper/CardValueRuleMapper.java @@ -1,7 +1,8 @@ -package com.fuint.business.marketingActivity.cardValueRule.dao; +package com.fuint.business.marketingActivity.cardValueRule.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.fuint.business.marketingActivity.cardValueRule.entity.CardValueRule; +import org.apache.ibatis.annotations.Mapper; /** * 储值卡规则(CardValueRule)表数据库访问层 @@ -9,7 +10,8 @@ import com.fuint.business.marketingActivity.cardValueRule.entity.CardValueRule; * @author makejava * @since 2024-09-08 18:19:04 */ -public interface CardValueRuleDao extends BaseMapper { +@Mapper +public interface CardValueRuleMapper extends BaseMapper { } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/service/impl/CardValueRuleServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/service/impl/CardValueRuleServiceImpl.java index e4607eb17..c9e272856 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/service/impl/CardValueRuleServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/marketingActivity/cardValueRule/service/impl/CardValueRuleServiceImpl.java @@ -1,7 +1,7 @@ package com.fuint.business.marketingActivity.cardValueRule.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.fuint.business.marketingActivity.cardValueRule.dao.CardValueRuleDao; +import com.fuint.business.marketingActivity.cardValueRule.mapper.CardValueRuleMapper; import com.fuint.business.marketingActivity.cardValueRule.entity.CardValueRule; import com.fuint.business.marketingActivity.cardValueRule.service.CardValueRuleService; import org.springframework.stereotype.Service; @@ -13,7 +13,7 @@ import org.springframework.stereotype.Service; * @since 2024-09-08 18:19:04 */ @Service("cardValueRuleService") -public class CardValueRuleServiceImpl extends ServiceImpl implements CardValueRuleService { +public class CardValueRuleServiceImpl extends ServiceImpl implements CardValueRuleService { }