配置管理
This commit is contained in:
parent
25f06fbe76
commit
82724d8fce
@ -106,3 +106,19 @@ export function looklooklook(id) {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getInfoActivity() {
|
||||||
|
return request({
|
||||||
|
url: 'business/marketingActivity/activeConsumption/getInfo',
|
||||||
|
method: 'get',
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addActivity(data) {
|
||||||
|
return request({
|
||||||
|
url: 'business/marketingActivity/activeConsumption/add',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -110,6 +110,25 @@ public class ActiveConsumptionController extends BaseController {
|
|||||||
return getSuccessResult(this.activeConsumptionService.add(activeConsumptionDTO));
|
return getSuccessResult(this.activeConsumptionService.add(activeConsumptionDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*
|
||||||
|
* @param activeConsumption 实体对象
|
||||||
|
* @return 新增结果
|
||||||
|
*/
|
||||||
|
@PostMapping("add")
|
||||||
|
public ResponseObject add(@RequestBody ActiveConsumption activeConsumption) {
|
||||||
|
try {
|
||||||
|
SysLog sysLog =new SysLog();
|
||||||
|
sysLog.setSystemName("2");
|
||||||
|
sysLog.setMoudle("营销中心");
|
||||||
|
sysLog.setContent("新增名称为"+activeConsumption.getName()+"消费有礼活动");
|
||||||
|
sysLogService.saveVo(sysLog);
|
||||||
|
}catch (Exception ignored){}
|
||||||
|
|
||||||
|
return getSuccessResult(this.activeConsumptionService.insertActiveConsumption(activeConsumption));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改数据
|
* 修改数据
|
||||||
*
|
*
|
||||||
@ -219,5 +238,15 @@ public class ActiveConsumptionController extends BaseController {
|
|||||||
return getSuccessResult(this.activeConsumptionChildService.detailCount(id));
|
return getSuccessResult(this.activeConsumptionChildService.detailCount(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统计
|
||||||
|
*
|
||||||
|
* @return 单条数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/getInfo")
|
||||||
|
public ResponseObject selectByStoreId() {
|
||||||
|
return getSuccessResult(this.activeConsumptionService.selectByStoreId());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消费有礼活动(ActiveConsumption)表实体类
|
* 消费有礼活动(ActiveConsumption)表实体类
|
||||||
@ -36,10 +37,10 @@ public class ActiveConsumption extends Model<ActiveConsumption> {
|
|||||||
//满足金额
|
//满足金额
|
||||||
private Double participationConditionMoney;
|
private Double participationConditionMoney;
|
||||||
//活动开始时间
|
//活动开始时间
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date activeStartTime;
|
private Date activeStartTime;
|
||||||
//活动结束时间
|
//活动结束时间
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date activeEndTime;
|
private Date activeEndTime;
|
||||||
//适用油品0:92# 1: 95# 2:98# 3:0# 4:-10# 5: LNG 6;CNG 7:京92# 8:京95# 9:京0#
|
//适用油品0:92# 1: 95# 2:98# 3:0# 4:-10# 5: LNG 6;CNG 7:京92# 8:京95# 9:京0#
|
||||||
private String adaptOil;
|
private String adaptOil;
|
||||||
@ -72,15 +73,76 @@ public class ActiveConsumption extends Model<ActiveConsumption> {
|
|||||||
//创建者
|
//创建者
|
||||||
private String createBy;
|
private String createBy;
|
||||||
//创建时间
|
//创建时间
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
//更新者
|
//更新者
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
//更新时间
|
//更新时间
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
//描述信息
|
//描述信息
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String exchangeFrom;
|
private String exchangeFrom;
|
||||||
}
|
/**
|
||||||
|
*活动时间类型:0永久有效;1自定义
|
||||||
|
*/
|
||||||
|
private String activityTimeType;
|
||||||
|
/**
|
||||||
|
*活动时间前
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date activityTimeFront;
|
||||||
|
/**
|
||||||
|
*活动时间后
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date activityTimeAfter;
|
||||||
|
/**
|
||||||
|
*适用时间段类型:0每周、1每月
|
||||||
|
*/
|
||||||
|
private String suitTimeSlotType;
|
||||||
|
/**
|
||||||
|
*适用时间段:周/月
|
||||||
|
*/
|
||||||
|
private String suitDate;
|
||||||
|
/**
|
||||||
|
*适用时间段前
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
|
||||||
|
private Date suitTimeSlotFront;
|
||||||
|
/**
|
||||||
|
*适用时间段后
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
|
||||||
|
private Date suitTimeSlotAfter;
|
||||||
|
/**
|
||||||
|
*会员标签id
|
||||||
|
*/
|
||||||
|
private String userLabelIds;
|
||||||
|
/**
|
||||||
|
*每人每天参与上限
|
||||||
|
*/
|
||||||
|
private String everyDayCeiling;
|
||||||
|
/**
|
||||||
|
*每人每月参与上限
|
||||||
|
*/
|
||||||
|
private Integer monthlyCeiling;
|
||||||
|
/**
|
||||||
|
*每人累计参与上限
|
||||||
|
*/
|
||||||
|
private Integer accumulateCeiling;
|
||||||
|
/**
|
||||||
|
*通知内容
|
||||||
|
*/
|
||||||
|
private String noticeContent;
|
||||||
|
/**
|
||||||
|
*活动详情
|
||||||
|
*/
|
||||||
|
private String activityDetails;
|
||||||
|
/**
|
||||||
|
* 活动奖品子表信息
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<ActiveConsumptionChild> activityPrize;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -86,4 +86,20 @@ public class ActiveConsumptionChild {
|
|||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
/**
|
||||||
|
*订单类型:0订单金额、1实收金额、3加油升数
|
||||||
|
*/
|
||||||
|
private String orderType;
|
||||||
|
/**
|
||||||
|
*消费金额
|
||||||
|
*/
|
||||||
|
private String consumeAmount;
|
||||||
|
/**
|
||||||
|
*赠送积分
|
||||||
|
*/
|
||||||
|
private String givePoints;
|
||||||
|
/**
|
||||||
|
*赠送成长值
|
||||||
|
*/
|
||||||
|
private String giveGrowthValue;
|
||||||
}
|
}
|
||||||
|
@ -63,5 +63,13 @@ public interface ActiveConsumptionService extends IService<ActiveConsumption> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ActiveConsumptionAppletVO> selectAllApplet(ActiveConsumption activeConsumption);
|
List<ActiveConsumptionAppletVO> selectAllApplet(ActiveConsumption activeConsumption);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据storeId查询消费有礼信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ActiveConsumption selectByStoreId();
|
||||||
|
|
||||||
|
int insertActiveConsumption(ActiveConsumption activeConsumption);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.activeConsumption.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -109,6 +110,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Boolean add(ActiveConsumptionDTO activeConsumptionDTO) {
|
public Boolean add(ActiveConsumptionDTO activeConsumptionDTO) {
|
||||||
|
ActiveConsumption activeConsumption1 = selectByStoreId();
|
||||||
|
if (ObjectUtil.isNotEmpty(activeConsumption1)) return false;
|
||||||
|
|
||||||
boolean save = false;
|
boolean save = false;
|
||||||
ActiveApplet activeApplet = new ActiveApplet();
|
ActiveApplet activeApplet = new ActiveApplet();
|
||||||
activeApplet.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
activeApplet.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||||
@ -560,6 +564,34 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
|||||||
return appletVOList;
|
return appletVOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActiveConsumption selectByStoreId() {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
|
||||||
|
ActiveConsumption activeConsumption = baseMapper.selectOne(queryWrapper);
|
||||||
|
List<ActiveConsumptionChild> activeConsumptionChildren = activeConsumptionChildService.selectList(activeConsumption.getId());
|
||||||
|
activeConsumption.setActivityPrize(activeConsumptionChildren);
|
||||||
|
return activeConsumption;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertActiveConsumption(ActiveConsumption activeConsumption) {
|
||||||
|
ActiveConsumption activeConsumption1 = selectByStoreId();
|
||||||
|
if (ObjectUtil.isNotEmpty(activeConsumption1)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int row = baseMapper.insert(activeConsumption);
|
||||||
|
activeConsumption1 = selectByStoreId();
|
||||||
|
if (ObjectUtil.isNotEmpty(activeConsumption.getActivityPrize())){
|
||||||
|
for (ActiveConsumptionChild activeConsumptionChild : activeConsumption.getActivityPrize()) {
|
||||||
|
activeConsumptionChild.setActiveConsumptionId(activeConsumption1.getId());
|
||||||
|
activeConsumptionChildService.save(activeConsumptionChild);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数组转字符串
|
* 数组转字符串
|
||||||
* @param array
|
* @param array
|
||||||
|
@ -194,5 +194,10 @@ public class ActiveNewlywedsController extends BaseController {
|
|||||||
}catch (Exception ignored){}
|
}catch (Exception ignored){}
|
||||||
return getSuccessResult(activeNewlywedsChildService.removeByIds(idList));
|
return getSuccessResult(activeNewlywedsChildService.removeByIds(idList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("getInfo")
|
||||||
|
public ResponseObject selectByStoreId(){
|
||||||
|
return getSuccessResult(activeNewlywedsService.selectByStoreId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,11 +3,15 @@ package com.fuint.business.marketingActivity.activeNewlyweds.entity;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新人有礼活动(ActiveNewlyweds)表实体类
|
* 新人有礼活动(ActiveNewlyweds)表实体类
|
||||||
@ -16,6 +20,8 @@ import java.io.Serializable;
|
|||||||
* @since 2023-11-13 13:15:58
|
* @since 2023-11-13 13:15:58
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
|
@Data
|
||||||
|
@TableName("active_newlyweds")
|
||||||
public class ActiveNewlyweds extends Model<ActiveNewlyweds> {
|
public class ActiveNewlyweds extends Model<ActiveNewlyweds> {
|
||||||
//主键id
|
//主键id
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
@ -26,11 +32,13 @@ public class ActiveNewlyweds extends Model<ActiveNewlyweds> {
|
|||||||
private Integer storeId;
|
private Integer storeId;
|
||||||
//活动名称
|
//活动名称
|
||||||
private String name;
|
private String name;
|
||||||
|
//活动时间类型:0永久有效;1自定义
|
||||||
|
private String activeTimeType;
|
||||||
//活动开始时间
|
//活动开始时间
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date activeStartTime;
|
private Date activeStartTime;
|
||||||
//活动结束时间
|
//活动结束时间
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date activeEndTime;
|
private Date activeEndTime;
|
||||||
//有礼奖励 0:优惠券 1:兑换券 2:成长值 3:积分
|
//有礼奖励 0:优惠券 1:兑换券 2:成长值 3:积分
|
||||||
private String courtesyReward;
|
private String courtesyReward;
|
||||||
@ -51,13 +59,23 @@ public class ActiveNewlyweds extends Model<ActiveNewlyweds> {
|
|||||||
//创建者
|
//创建者
|
||||||
private String createBy;
|
private String createBy;
|
||||||
//创建时间
|
//创建时间
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
//更新者
|
//更新者
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
//更新时间
|
//更新时间
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
//通知内容
|
||||||
|
private String noticeContent;
|
||||||
|
//活动详情
|
||||||
|
private String activityDetails;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 优惠券列表信息
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<ActiveNewlywedsChild> couponList;
|
||||||
|
|
||||||
public String getActiveCode() {
|
public String getActiveCode() {
|
||||||
return activeCode;
|
return activeCode;
|
||||||
@ -212,5 +230,5 @@ public class ActiveNewlyweds extends Model<ActiveNewlyweds> {
|
|||||||
protected Serializable pkVal() {
|
protected Serializable pkVal() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -18,6 +19,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
@Data
|
@Data
|
||||||
|
@TableName("active_newlyweds_child")
|
||||||
public class ActiveNewlywedsChild extends Model<ActiveNewlywedsChild> {
|
public class ActiveNewlywedsChild extends Model<ActiveNewlywedsChild> {
|
||||||
//主键id
|
//主键id
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
|
@ -3,6 +3,8 @@ package com.fuint.business.marketingActivity.activeNewlyweds.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
|
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新人有礼活动子表(ActiveNewlywedsChild)表服务接口
|
* 新人有礼活动子表(ActiveNewlywedsChild)表服务接口
|
||||||
*
|
*
|
||||||
@ -10,6 +12,11 @@ import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywe
|
|||||||
* @since 2023-11-13 13:17:14
|
* @since 2023-11-13 13:17:14
|
||||||
*/
|
*/
|
||||||
public interface ActiveNewlywedsChildService extends IService<ActiveNewlywedsChild> {
|
public interface ActiveNewlywedsChildService extends IService<ActiveNewlywedsChild> {
|
||||||
|
/**
|
||||||
|
* 根据新人有礼id查询子表列表信息
|
||||||
|
* @param activeNewlywedsId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ActiveNewlywedsChild> selectByActiveId(Integer activeNewlywedsId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,5 +64,11 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ActiveNewlywedsAppletVO> selectApplet(ActiveConsumption activeConsumption);
|
List<ActiveNewlywedsAppletVO> selectApplet(ActiveConsumption activeConsumption);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据店铺id查询新人有礼信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ActiveNewlyweds selectByStoreId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
package com.fuint.business.marketingActivity.activeNewlyweds.service.impl;
|
package com.fuint.business.marketingActivity.activeNewlyweds.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
|
import com.fuint.business.marketingActivity.activeNewlyweds.entity.ActiveNewlywedsChild;
|
||||||
import com.fuint.business.marketingActivity.activeNewlyweds.mapper.ActiveNewlywedsChildMapper;
|
import com.fuint.business.marketingActivity.activeNewlyweds.mapper.ActiveNewlywedsChildMapper;
|
||||||
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsChildService;
|
import com.fuint.business.marketingActivity.activeNewlyweds.service.ActiveNewlywedsChildService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新人有礼活动子表(ActiveNewlywedsChild)表服务实现类
|
* 新人有礼活动子表(ActiveNewlywedsChild)表服务实现类
|
||||||
*
|
*
|
||||||
@ -16,5 +19,11 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service("activeNewlywedsChildService")
|
@Service("activeNewlywedsChildService")
|
||||||
public class ActiveNewlywedsChildServiceImpl extends ServiceImpl<ActiveNewlywedsChildMapper, ActiveNewlywedsChild> implements ActiveNewlywedsChildService {
|
public class ActiveNewlywedsChildServiceImpl extends ServiceImpl<ActiveNewlywedsChildMapper, ActiveNewlywedsChild> implements ActiveNewlywedsChildService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ActiveNewlywedsChild> selectByActiveId(Integer activeNewlywedsId) {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("active_newlyweds_id",activeNewlywedsId);
|
||||||
|
return baseMapper.selectList(queryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package com.fuint.business.marketingActivity.activeNewlyweds.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -81,6 +82,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Boolean add(ActiveNewlywedsDTO activeNewlywedsDTO) {
|
public Boolean add(ActiveNewlywedsDTO activeNewlywedsDTO) {
|
||||||
|
// 查看是否存在活动,存在则返回
|
||||||
|
ActiveNewlyweds activeNewlyweds1 = selectByStoreId();
|
||||||
|
if (ObjectUtil.isNotEmpty(activeNewlyweds1)) return false;
|
||||||
|
|
||||||
boolean save = false;
|
boolean save = false;
|
||||||
ActiveApplet activeApplet = new ActiveApplet();
|
ActiveApplet activeApplet = new ActiveApplet();
|
||||||
activeApplet.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
activeApplet.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||||
@ -640,6 +645,18 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
|
|||||||
return arrayList;
|
return arrayList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActiveNewlyweds selectByStoreId() {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id",TokenUtil.getNowAccountInfo().getStoreId());
|
||||||
|
ActiveNewlyweds activeNewlyweds = baseMapper.selectOne(queryWrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(activeNewlyweds)) {
|
||||||
|
List<ActiveNewlywedsChild> activeNewlywedsChildren = activeNewlywedsChildService.selectByActiveId(activeNewlyweds.getId());
|
||||||
|
activeNewlyweds.setCouponList(activeNewlywedsChildren);
|
||||||
|
}
|
||||||
|
return activeNewlyweds;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数组转字符串
|
* 数组转字符串
|
||||||
* @param array
|
* @param array
|
||||||
|
Loading…
Reference in New Issue
Block a user