Merge remote-tracking branch 'origin/master'

This commit is contained in:
@QQNZX 2024-03-04 15:55:14 +08:00
commit c0e249fc9d
40 changed files with 1077 additions and 86 deletions

View File

@ -775,8 +775,17 @@ export default {
}
if (this.ids && this.ids.length>0){
editStatus({ids:this.ids.toString(),status:val}).then(res => {
this.$message.success(name+"成功")
this.getList();
if (val=='qy') {
if (res.data > 0) {
this.$message.success(name + "成功")
this.getList();
} else {
this.$message.error("请确保上架的商品库存大于0且为商品设置零售价和会员价")
}
}else {
this.$message.success(name + "成功")
this.getList();
}
})
}else {
this.$message.error("请选择需要"+name+"的商品")

View File

@ -1171,6 +1171,10 @@ export default {
},
//
handleAddMembers() {
if (this.fixingLevelList.length==0){
this.$message.error("请先设置企业会员等级")
return;
}
this.openMembers = true;
this.title = "批量用户认证";
},

View File

@ -788,6 +788,7 @@ export default {
this.openUser = false;
this.getList();
this.getUserList();
});
}
})

View File

@ -4,7 +4,7 @@
<el-alert
title="说明"
type="error"
description="为了保证加油站商户日常在线支付业务的稳定性油客里里目前支持多通道支付
description="为了保证加油站商户日常在线支付业务的稳定性来个油惠目前支持多通道支付
可以有效的避免单支付通道带来不稳定性从而造成油站不能正常支付问题
加油站一旦出现不能正常支付的情况可以随时手工切换支付通道来保证加油站支付收款业务"
:closable="false"

View File

@ -685,7 +685,7 @@ export default {
}
if (!this.form.id) {
queryStaff({mobile:this.form.mobile}).then( response => {
if(response.data!=null){
if(response.data){
this.$modal.msgError("手机号已存在");
}else {
this.form.posPrem = JSON.stringify(this.form.posPrem);
@ -696,6 +696,8 @@ export default {
this.open = false;
this.checked = false;
this.getList();
}else {
this.$modal.msgError("新增失败");
}
});
}

View File

@ -4,7 +4,7 @@
<el-alert
title="说明"
type="error"
description="为了保证加油站商户日常在线支付业务的稳定性油客里里目前支持多通道支付
description="为了保证加油站商户日常在线支付业务的稳定性来个油惠目前支持多通道支付
可以有效的避免单支付通道带来不稳定性从而造成油站不能正常支付问题
加油站一旦出现不能正常支付的情况可以随时手工切换支付通道来保证加油站支付收款业务"
:closable="false"

View File

@ -146,8 +146,7 @@ public class LJGoodsController extends BaseController {
public ResponseObject updateStatus(@RequestBody Map<String,String> map){
String ids = map.get("ids");
String status = map.get("status");
goodsService.batchGrounding(ids,status);
return getSuccessResult("OK");
return getSuccessResult(goodsService.batchGrounding(ids,status));
}
/**

View File

@ -86,7 +86,7 @@ public interface LJGoodsService extends IService<LJGoods> {
* 批量上架下架商品信息
* @param ids
*/
void batchGrounding(String ids,String status);
int batchGrounding(String ids,String status);
/**
* 查询可兑换商品品类下的商品信息

View File

@ -212,8 +212,9 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
}
@Override
public void batchGrounding(String ids,String status) {
public int batchGrounding(String ids,String status) {
String[] split = ids.split(",");
int row = 0;
for (String s : split) {
LJGoods ljGoods = this.selectLJGoodsById(Integer.parseInt(s));
if (ObjectUtil.isNotEmpty(ljGoods)){
@ -224,8 +225,10 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
ljGoods.setStatus(status);
}
this.updateLJGoods(ljGoods);
if (ljGoods.getStatus().equals("qy")) row += 1;
}
}
return row;
}
@Override

View File

@ -40,7 +40,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @param id
* @return
*/
List<ActiveNewlywedsVO> getOneById(Serializable id);
ActiveNewlywedsVO getOneById(Serializable id);
ActiveNewlywedsVO getOneByStoreId(Serializable id);
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption);

View File

@ -115,13 +115,13 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
/**
* 分页查询所有数据
* @param page
* @param activeNewlyweds
* @param activeNewlywedss
* @return
*/
@Override
public IPage select(Page page, ActiveNewlyweds activeNewlyweds) {
public IPage select(Page page, ActiveNewlyweds activeNewlywedss) {
//构建查询条件
LambdaQueryWrapper<ActiveNewlyweds> queryWrapper = new LambdaQueryWrapper<>();
/*LambdaQueryWrapper<ActiveNewlyweds> queryWrapper = new LambdaQueryWrapper<>();
if(ObjectUtils.isNotEmpty(activeNewlyweds.getName())){
queryWrapper.like(ActiveNewlyweds::getName,activeNewlyweds.getName());
}
@ -150,24 +150,16 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
return activeNewlywedsVO;
}).collect(Collectors.toList());
page1.setRecords(activeNewlywedsVOList);
return page1;
}
/**
* 通过店铺查询单条数据
* @param id
* @return
*/
@Override
public List<ActiveNewlywedsVO> getOneById(Serializable id) {
return page1;*/
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ArrayList<ActiveNewlywedsVO> activeNewlywedsVOS = new ArrayList<>();
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
//ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
IPage page1 = page(page, lambdaQueryWrapper);
List<ActiveNewlyweds> list = page1.getRecords();
//List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
//获取兑换物品信息
if (CollectionUtils.isNotEmpty(list)){
for (ActiveNewlyweds activeNewlyweds : list) {
@ -232,8 +224,86 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
}
}
}
}
return activeNewlywedsVOS;
page1.setRecords(list);
return page1;
//return activeNewlywedsVOS;
}
/**
* 通过店铺查询单条数据
* @param id
* @return
*/
@Override
public ActiveNewlywedsVO getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
lambdaQueryWrapper.eq(ActiveNewlyweds::getId,id);
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
//List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
//获取兑换物品信息
int youhuiTed = 0;
int duihuanTed = 0;
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
activeNewlywedsVO.setCourtesyReward(new String[0]);
if (ObjectUtils.isNotEmpty(activeNewlyweds)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) {
//优惠券
if (activeNewlywedsChild.getActiveGift().equals("1")){
LambdaQueryWrapper<CardFavorableRecord> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(CardFavorableRecord::getActiveId,activeNewlywedsChild.getActiveNewlywedsId());
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeNewlywedsChild.getVouchersId());
List<CardFavorableRecord> lists = cardFavorableRecordService.list(queryWrappers);
activeNewlywedsVO.setYouhuiTotal(lists.size());
for (CardFavorableRecord cardFavorableRecord : lists) {
if (cardFavorableRecord.getStatus().equals("1")){
youhuiTed+=1;
}
}
}
//兑换券
if (activeNewlywedsChild.getActiveGift().equals("2")){
LambdaQueryWrapper<CardExchangeRecord> queryWrapperss = new LambdaQueryWrapper<>();
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeNewlywedsChild.getActiveNewlywedsId());
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeNewlywedsChild.getVouchersId());
List<CardExchangeRecord> lisst = cardExchangeRecordService.list(queryWrapperss);
activeNewlywedsVO.setDuihuanTotal(lisst.size());
for (CardExchangeRecord cardExchangeRecord : lisst) {
if (cardExchangeRecord.getStatus().equals("1")){
duihuanTed+=1;
}
}
}
}
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
//封装VO返回
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
activeNewlywedsVO.setYouhuiTotaled(youhuiTed);
activeNewlywedsVO.setDuihuanTotaled(duihuanTed);
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
//activeNewlywedsVOS.add(activeNewlywedsVO);
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
//activeNewlywedsVOS.add(activeNewlywedsVO);
}
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
activeNewlywedsVO.setDuihuanTotaled(youhuiTed);
activeNewlywedsVO.setDuihuanTotaled(duihuanTed);
activeNewlywedsVO.setDuihuanTotal(0);
activeNewlywedsVO.setDuihuanTotal(0);
//activeNewlywedsVOS.add(activeNewlywedsVO);
}
return activeNewlywedsVO;
}
/**

View File

@ -0,0 +1,92 @@
package com.fuint.business.marketingActivity.activeOneCoupon.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeOneCoupon.dtos.ActiveOneCouponDTO;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponService;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* 一键发券活动(ActiveOneCoupon)表控制层
*
* @author makejava
* @since 2024-03-02 13:22:50
*/
@RestController
@RequestMapping("business/marketingActivity/oneActiveOneCoupon")
public class ActiveOneCouponController extends BaseController {
/**
* 服务对象
*/
@Resource
private ActiveOneCouponService activeOneCouponService;
/**
* 分页查询所有数据
*
* @param activeOneCoupon 查询实体
* @return 所有数据
*/
@GetMapping
public ResponseObject selectAll(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("activeOneCoupon") ActiveOneCoupon activeOneCoupon) {
Page page = new Page(pageNo, pageSize);
return getSuccessResult(this.activeOneCouponService.select(page, new QueryWrapper<>(activeOneCoupon)));
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@GetMapping("{id}")
public ResponseObject selectOne(@PathVariable Serializable id) {
return getSuccessResult(this.activeOneCouponService.getOneById(id));
}
/**
* 新增数据
*
* @param activeOneCouponDTO 实体对象
* @return 新增结果
*/
@PostMapping
public ResponseObject insert(@RequestBody ActiveOneCouponDTO activeOneCouponDTO) {
return getSuccessResult(this.activeOneCouponService.add(activeOneCouponDTO));
}
/**
* 修改数据
*
* @param activeOneCouponDTO 实体对象
* @return 修改结果
*/
@PutMapping
public ResponseObject update(@RequestBody ActiveOneCouponDTO activeOneCouponDTO) {
return getSuccessResult(this.activeOneCouponService.updateOneById(activeOneCouponDTO));
}
/**
* 删除数据
*
* @param idList 主键结合
* @return 删除结果
*/
@DeleteMapping
public ResponseObject delete(@RequestParam("idList") List<Long> idList) {
return getSuccessResult(this.activeOneCouponService.removeByIds(idList));
}
}

View File

@ -0,0 +1,17 @@
package com.fuint.business.marketingActivity.activeOneCoupon.dtos;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class ActiveOneCouponDTO extends ActiveOneCoupon implements Serializable {
//优惠券ids
private List<Integer> cardFavorableIds;
//兑换券ids
private List<Integer> cardExchangeIds;
//会员等级ids
private Integer[] gradeIds;
}

View File

@ -0,0 +1,46 @@
package com.fuint.business.marketingActivity.activeOneCoupon.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import java.io.Serializable;
/**
* 一键发券活动(ActiveOneCoupon)表实体类
*
* @author makejava
* @since 2024-03-02 13:22:50
*/
@SuppressWarnings("serial")
@Data
public class ActiveOneCoupon extends Model<ActiveOneCoupon> {
//主键id
private Integer id;
private Integer storeId;
private String activeName;
//会员等级id
private String gradeId;
private Integer condition;
//会员等级名字
private String gradeName;
//创建者
private String createBy;
//创建时间
private Date createTime;
//更新者
private String updateBy;
//更新时间
private Date updateTime;
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -0,0 +1,131 @@
package com.fuint.business.marketingActivity.activeOneCoupon.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import java.io.Serializable;
/**
* 一键发券子表(ActiveOneCouponChild)表实体类
*
* @author makejava
* @since 2024-03-02 13:23:50
*/
@SuppressWarnings("serial")
@Data
public class ActiveOneCouponChild extends Model<ActiveOneCouponChild> {
//主键id
private Integer id;
private Integer storeId;
//消费有礼活动id
private Integer activeConsumptionId;
//活动奖品 0赠送积分1赠送优惠券 2. 赠送兑换券 3赠送成长值 4. 赠送实物
private String activeGift;
//券id
private Integer vouchersId;
//赠送卡券名称
private String giftCardName;
//券详情
private String giftCardDetail;
//创建者
private String createBy;
//创建时间
private Date createTime;
//更新者
private String updateBy;
//更新时间
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getActiveConsumptionId() {
return activeConsumptionId;
}
public void setActiveConsumptionId(Integer activeConsumptionId) {
this.activeConsumptionId = activeConsumptionId;
}
public String getActiveGift() {
return activeGift;
}
public void setActiveGift(String activeGift) {
this.activeGift = activeGift;
}
public Integer getVouchersId() {
return vouchersId;
}
public void setVouchersId(Integer vouchersId) {
this.vouchersId = vouchersId;
}
public String getGiftCardName() {
return giftCardName;
}
public void setGiftCardName(String giftCardName) {
this.giftCardName = giftCardName;
}
public String getGiftCardDetail() {
return giftCardDetail;
}
public void setGiftCardDetail(String giftCardDetail) {
this.giftCardDetail = giftCardDetail;
}
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;
}
}

View File

@ -0,0 +1,15 @@
package com.fuint.business.marketingActivity.activeOneCoupon.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
/**
* 一键发券子表(ActiveOneCouponChild)表数据库访问层
*
* @author makejava
* @since 2024-03-02 13:23:50
*/
public interface ActiveOneCouponChildMapper extends BaseMapper<ActiveOneCouponChild> {
}

View File

@ -0,0 +1,15 @@
package com.fuint.business.marketingActivity.activeOneCoupon.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
/**
* 一键发券活动(ActiveOneCoupon)表数据库访问层
*
* @author makejava
* @since 2024-03-02 13:22:50
*/
public interface ActiveOneCouponMapper extends BaseMapper<ActiveOneCoupon> {
}

View File

@ -0,0 +1,15 @@
package com.fuint.business.marketingActivity.activeOneCoupon.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
/**
* 一键发券子表(ActiveOneCouponChild)表服务接口
*
* @author makejava
* @since 2024-03-02 13:23:50
*/
public interface ActiveOneCouponChildService extends IService<ActiveOneCouponChild> {
}

View File

@ -0,0 +1,29 @@
package com.fuint.business.marketingActivity.activeOneCoupon.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeOneCoupon.dtos.ActiveOneCouponDTO;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
import com.fuint.business.marketingActivity.activeOneCoupon.vo.ActiveOneCouponVO;
import java.io.Serializable;
/**
* 一键发券活动(ActiveOneCoupon)表服务接口
*
* @author makejava
* @since 2024-03-02 13:22:50
*/
public interface ActiveOneCouponService extends IService<ActiveOneCoupon> {
boolean add(ActiveOneCouponDTO activeOneCouponDTO);
IPage select(Page page, QueryWrapper<ActiveOneCoupon> activeOneCouponQueryWrapper);
ActiveOneCouponVO getOneById(Serializable id);
boolean updateOneById(ActiveOneCouponDTO activeOneCouponDTO);
}

View File

@ -0,0 +1,19 @@
package com.fuint.business.marketingActivity.activeOneCoupon.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeOneCoupon.mapper.ActiveOneCouponChildMapper;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponChildService;
import org.springframework.stereotype.Service;
/**
* 一键发券子表(ActiveOneCouponChild)表服务实现类
*
* @author makejava
* @since 2024-03-02 13:23:51
*/
@Service("activeOneCouponChildService")
public class ActiveOneCouponChildServiceImpl extends ServiceImpl<ActiveOneCouponChildMapper, ActiveOneCouponChild> implements ActiveOneCouponChildService {
}

View File

@ -0,0 +1,257 @@
package com.fuint.business.marketingActivity.activeOneCoupon.service.impl;
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.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeOneCoupon.dtos.ActiveOneCouponDTO;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
import com.fuint.business.marketingActivity.activeOneCoupon.mapper.ActiveOneCouponMapper;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponChildService;
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponService;
import com.fuint.business.marketingActivity.activeOneCoupon.vo.ActiveOneCouponVO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.marketingActivity.cardFavorable.vo.LJUserVos;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.repository.mapper.MtUserGradeMapper;
import com.fuint.repository.model.MtUserGrade;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 一键发券活动(ActiveOneCoupon)表服务实现类
*
* @author makejava
* @since 2024-03-02 13:22:50
*/
@Service("activeOneCouponService")
public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMapper, ActiveOneCoupon> implements ActiveOneCouponService {
@Resource
private MtUserGradeMapper mtUserGradeMapper;
@Resource
private CardFavorableService cardFavorableService;
@Resource
private ActiveOneCouponChildService activeOneCouponChildService;
@Resource
private CardExchangeService exchangeService;
@Resource
private LJUserService userService;
@Resource
private CardFavorableRecordService cardFavorableRecordService;
@Resource
private CardExchangeRecordService cardExchangeRecordService;
@Override
@Transactional
public boolean add(ActiveOneCouponDTO activeOneCouponDTO) {
ActiveOneCouponChild activeOneCouponChild = new ActiveOneCouponChild();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
boolean flag = false;
ActiveOneCoupon activeOneCoupon = new ActiveOneCoupon();
//会员等级
String gradeIdStr = "";
String gradeIdName = "";
Integer[] gradeIds = activeOneCouponDTO.getGradeIds();
for (Integer gradeId : gradeIds) {
gradeIdStr+=gradeId + ",";
MtUserGrade mtUserGrade = mtUserGradeMapper.selectById(gradeId);
gradeIdName += mtUserGrade.getName() + ",";
}
activeOneCoupon.setGradeId(gradeIdStr);
activeOneCoupon.setGradeName(gradeIdName);
activeOneCoupon.setStoreId(nowAccountInfo.getStoreId());
activeOneCoupon.setCondition(activeOneCouponDTO.getCondition());
flag = save(activeOneCoupon);
//优惠券
List<Integer> cardFavorableIds = activeOneCouponDTO.getCardFavorableIds();
if (ObjectUtils.isNotEmpty(cardFavorableIds)){
for (Integer cardFavorableId : cardFavorableIds) {
activeOneCouponChild.setActiveGift("1");
activeOneCouponChild.setActiveConsumptionId(activeOneCoupon.getId());
activeOneCouponChild.setVouchersId(cardFavorableId);
CardFavorable byId = cardFavorableService.getById(cardFavorableId);
activeOneCouponChild.setGiftCardName(byId.getName());
activeOneCouponChild.setStoreId(nowAccountInfo.getStoreId());
flag = activeOneCouponChildService.save(activeOneCouponChild);
}
}
//兑换券
List<Integer> cardExchangeIds = activeOneCouponDTO.getCardExchangeIds();
if (ObjectUtils.isNotEmpty(cardExchangeIds)){
for (Integer cardExahangeId : cardExchangeIds) {
activeOneCouponChild.setActiveGift("2");
activeOneCouponChild.setActiveConsumptionId(activeOneCoupon.getId());
activeOneCouponChild.setVouchersId(cardExahangeId);
CardExchange byId = exchangeService.getById(cardExahangeId);
activeOneCouponChild.setGiftCardName(byId.getName());
activeOneCouponChild.setStoreId(nowAccountInfo.getStoreId());
flag = activeOneCouponChildService.save(activeOneCouponChild);
}
}
return flag;
}
@Override
public IPage select(Page page, QueryWrapper<ActiveOneCoupon> activeOneCouponQueryWrapper) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<ActiveOneCoupon> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(nowAccountInfo.getStoreId() != null, ActiveOneCoupon::getStoreId, nowAccountInfo.getStoreId());
IPage page1 = page(page, queryWrapper);
List<ActiveOneCoupon> records = page1.getRecords();
ArrayList<ActiveOneCouponVO> activeOneCouponVOArrayList = new ArrayList<>();
ArrayList<LJUserVos> userList = new ArrayList<>();
for (ActiveOneCoupon record : records) {
ActiveOneCouponVO activeOneCouponVO = new ActiveOneCouponVO();
BeanUtils.copyProperties(record, activeOneCouponVO);
String gradeIds = record.getGradeId();
//会员存量
String[] gradeId = gradeIds.split(",");
for (String s : gradeId) {
LJUserVos ljUserVos = new LJUserVos();
MtUserGrade mtUserGrade = mtUserGradeMapper.selectById(s);
ljUserVos.setGradeName(mtUserGrade.getName());
LJUserVo ljUserVo = new LJUserVo();
ljUserVo.setGradeId(Integer.parseInt(s));
List<LJUserVo> userLists = userService.getUserCountList(ljUserVo);
ljUserVos.setCountAll(userLists.size());
ljUserVo.setDays(record.getCondition());
List<LJUserVo> userListss = userService.getUserLists(ljUserVo);
ljUserVos.setCount(userListss.size());
if (ObjectUtils.isNotEmpty(ljUserVos.getCountAll()) && ObjectUtils.isNotEmpty(ljUserVos.getCount()) && ljUserVos.getCountAll()!=0){
ljUserVos.setRate(ljUserVos.getCount()/ljUserVos.getCountAll() + "%");
}
userList.add(ljUserVos);
}
//优惠券
LambdaQueryWrapper<CardFavorableRecord> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(CardFavorableRecord::getExchangeFrom, "店铺一键送券!");
queryWrapper1.eq(CardFavorableRecord::getActiveId, record.getId());
queryWrapper1.eq(CardFavorableRecord::getStoreId, record.getStoreId());
List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper1);
activeOneCouponVO.setCouponReceiveCount(list.size());
queryWrapper1.eq(CardFavorableRecord::getStatus, "1");
List<CardFavorableRecord> list1 = cardFavorableRecordService.list(queryWrapper1);
activeOneCouponVO.setCouponUseCount(list1.size());
//兑换券
LambdaQueryWrapper<CardExchangeRecord> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(CardExchangeRecord::getExchangeFrom, "店铺一键送券!");
queryWrapper2.eq(CardExchangeRecord::getActiveId, record.getId());
queryWrapper2.eq(CardExchangeRecord::getStoreId, record.getStoreId());
List<CardExchangeRecord> list2 = cardExchangeRecordService.list(queryWrapper2);
activeOneCouponVO.setExchangeReceiveCount(list2.size());
queryWrapper2.eq(CardExchangeRecord::getStatus, "1");
List<CardExchangeRecord> list3 = cardExchangeRecordService.list(queryWrapper2);
activeOneCouponVO.setExchangeUseCount(list3.size());
//活动效果
activeOneCouponVOArrayList.add(activeOneCouponVO);
}
page1.setRecords(activeOneCouponVOArrayList);
return page1;
}
@Override
public ActiveOneCouponVO getOneById(Serializable id) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
ActiveOneCouponVO activeOneCouponVO = new ActiveOneCouponVO();
ActiveOneCoupon oneCoupon = getById(id);
BeanUtils.copyProperties(oneCoupon, activeOneCouponVO);
LambdaQueryWrapper<ActiveOneCouponChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveOneCouponChild::getActiveConsumptionId, id);
queryWrapper.eq(ActiveOneCouponChild::getStoreId, nowAccountInfo.getStoreId());
List<ActiveOneCouponChild> activeOneCouponChildren = activeOneCouponChildService.list(queryWrapper);
ArrayList<CardFavorable> cardFavorableArrayList = new ArrayList<>();
ArrayList<CardExchange> cardExchangeArrayList = new ArrayList<>();
for (ActiveOneCouponChild activeOneCouponChild : activeOneCouponChildren) {
//优惠券
if (activeOneCouponChild.getActiveGift().equals("1")){
CardFavorable byId = cardFavorableService.getById(activeOneCouponChild.getVouchersId());
cardFavorableArrayList.add(byId);
}
//兑换券
if (activeOneCouponChild.getActiveGift().equals("2")){
CardExchange byId = exchangeService.getById(activeOneCouponChild.getVouchersId());
cardExchangeArrayList.add(byId);
}
}
activeOneCouponVO.setCardFavorableList(cardFavorableArrayList);
activeOneCouponVO.setCardExchangeList(cardExchangeArrayList);
return activeOneCouponVO;
}
@Override
public boolean updateOneById(ActiveOneCouponDTO activeOneCouponDTO) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
boolean flag = false;
ActiveOneCoupon activeOneCoupon = new ActiveOneCoupon();
BeanUtils.copyProperties(activeOneCouponDTO,activeOneCoupon);
flag= updateById(activeOneCoupon);
//更新子表数据
LambdaQueryWrapper<ActiveOneCouponChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveOneCouponChild::getStoreId,nowAccountInfo.getStoreId());
queryWrapper.eq(ActiveOneCouponChild::getActiveConsumptionId,activeOneCoupon.getId());
List<ActiveOneCouponChild> list = activeOneCouponChildService.list(queryWrapper);
if (CollectionUtils.isNotEmpty(list)){
for (ActiveOneCouponChild activeOneCouponChild : list) {
activeOneCouponChildService.removeById(activeOneCouponChild.getId());
}
}
//优惠券
ActiveOneCouponChild activeOneCouponChild = new ActiveOneCouponChild();
List<Integer> cardFavorableIds = activeOneCouponDTO.getCardFavorableIds();
if (ObjectUtils.isNotEmpty(cardFavorableIds)){
for (Integer cardFavorableId : cardFavorableIds) {
activeOneCouponChild.setActiveGift("1");
activeOneCouponChild.setActiveConsumptionId(activeOneCoupon.getId());
activeOneCouponChild.setVouchersId(cardFavorableId);
CardFavorable byId = cardFavorableService.getById(cardFavorableId);
activeOneCouponChild.setGiftCardName(byId.getName());
activeOneCouponChild.setStoreId(nowAccountInfo.getStoreId());
flag = activeOneCouponChildService.save(activeOneCouponChild);
}
}
//兑换券
List<Integer> cardExchangeIds = activeOneCouponDTO.getCardExchangeIds();
if (ObjectUtils.isNotEmpty(cardExchangeIds)){
for (Integer cardExahangeId : cardExchangeIds) {
activeOneCouponChild.setActiveGift("2");
activeOneCouponChild.setActiveConsumptionId(activeOneCoupon.getId());
activeOneCouponChild.setVouchersId(cardExahangeId);
CardExchange byId = exchangeService.getById(cardExahangeId);
activeOneCouponChild.setGiftCardName(byId.getName());
activeOneCouponChild.setStoreId(nowAccountInfo.getStoreId());
flag = activeOneCouponChildService.save(activeOneCouponChild);
}
}
return flag;
}
}

View File

@ -0,0 +1,37 @@
package com.fuint.business.marketingActivity.activeOneCoupon.vo;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.vo.LJUserVos;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class ActiveOneCouponVO extends ActiveOneCoupon implements Serializable {
private List<LJUserVos> vosList;
//优惠券领取数量
private Integer couponReceiveCount;
//优惠券使用数量
private Integer couponUseCount;
//兑换券领取数量
private Integer exchangeReceiveCount;
//兑换券使用数量
private Integer exchangeUseCount;
//活动效果
//充值
private Double rechargeCount;
//加油
private Double oilCount;
//洗车
private Integer carWashCount;
//商品
private Integer productCount;
private List<ActiveOneCouponChild> activeOneCouponChildren;
private List<CardFavorable> cardFavorableList;
private List<CardExchange> cardExchangeList;
}

View File

@ -50,7 +50,7 @@ public class ActiveRecommendController extends BaseController {
@Param("cardFuelDiesel") ActiveRecommend activeRecommend) {
Page page = new Page(pageNo, pageSize);
activeRecommend.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
return getSuccessResult(this.activeRecommendService.page(page, new QueryWrapper<>(activeRecommend)));
return getSuccessResult(this.activeRecommendService.select(page, activeRecommend));
}
/**

View File

@ -3,6 +3,7 @@ package com.fuint.business.marketingActivity.activeRecommend.dto;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.business.marketingActivity.activeRecommend.entity.ActiveRecommendChild;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@ -15,13 +16,20 @@ import java.util.List;
* @since 2023-11-13 15:09:50
*/
@SuppressWarnings("serial")
@Data
public class ActiveRecommendDTO extends Model<ActiveRecommendDTO> {
//主键id
private Integer id;
//所属连锁店id
private Integer chainStoreId;
//新人有礼活动id
private Integer activeNewId;
private String activeNewName;
//所属店铺id
private Integer storeId;
//活动名称
private String activeName;
//活动图片
private String activePictureUrl;
//邀请人获得 0优惠券 1兑换券 2成长值 3积分

View File

@ -32,6 +32,8 @@ public class ActiveRecommend extends Model<ActiveRecommend> {
private String inviterGiftType;
private String activeNewName;
private Integer activeNewId;
//活动名称
private String activeName;
//赠送积分
private Integer points;
//赠送成长值

View File

@ -1,5 +1,7 @@
package com.fuint.business.marketingActivity.activeRecommend.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
@ -30,7 +32,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @param id
* @return
*/
List<ActiveRecommendVO> getOneById(Serializable id);
ActiveRecommendVO getOneById(Serializable id);
ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption);
/**
@ -45,5 +47,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @return
*/
ActiveRecommendAppletVO selectApplet(ActiveConsumption activeConsumption);
IPage select(Page page, ActiveRecommend activeRecommend);
}

View File

@ -1,7 +1,9 @@
package com.fuint.business.marketingActivity.activeRecommend.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumption;
import com.fuint.business.marketingActivity.activeRecommend.dto.ActiveRecommendDTO;
@ -102,18 +104,16 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
* @return
*/
@Override
public List<ActiveRecommendVO> getOneById(Serializable id) {
public ActiveRecommendVO getOneById(Serializable id) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ArrayList<ActiveRecommendVO> activeRecommendVOS = new ArrayList<>();
if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
//ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
List<ActiveRecommend> list = list(lambdaQueryWrapper);
for (ActiveRecommend activeRecommend : list) {
lambdaQueryWrapper.eq(ActiveRecommend::getId,id);
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
//List<ActiveRecommend> list = list(lambdaQueryWrapper);
int youhuiTed = 0;
int duihuanTed = 0;
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
@ -131,7 +131,7 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
queryWrappers.eq(CardFavorableRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeRecommendChild.getVouchersId());
List<CardFavorableRecord> lists = cardFavorableRecordService.list(queryWrappers);
activeRecommendVO.setYouhuiTotal(list.size());
activeRecommendVO.setYouhuiTotal(lists.size());
for (CardFavorableRecord cardFavorableRecord : lists) {
if (cardFavorableRecord.getStatus().equals("1")){
youhuiTed+=1;
@ -144,7 +144,7 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeRecommendChild.getVouchersId());
List<CardExchangeRecord> lisst = cardExchangeRecordService.list(queryWrapperss);
activeRecommendVO.setDuihuanTotal(list.size());
activeRecommendVO.setDuihuanTotal(lisst.size());
for (CardExchangeRecord cardExchangeRecord : lisst) {
if (cardExchangeRecord.getStatus().equals("1")){
duihuanTed+=1;
@ -158,11 +158,9 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
activeRecommendVO.setDuihuanTotaled(duihuanTed);
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
activeRecommendVOS.add(activeRecommendVO);
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
activeRecommendVOS.add(activeRecommendVO);
}
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
@ -171,11 +169,8 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
activeRecommendVO.setDuihuanTotaled(duihuanTed);
activeRecommendVO.setDuihuanTotal(0);
activeRecommendVO.setDuihuanTotal(0);
activeRecommendVOS.add(activeRecommendVO);
}
}
}
return activeRecommendVOS;
return activeRecommendVO;
}
@ -308,6 +303,83 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
return activeRecommendAppletVO;
}
@Override
public IPage select(Page page, ActiveRecommend activeRecommends) {
Integer storeId = TokenUtil.getNowAccountInfo().getStoreId();
ArrayList<ActiveRecommendVO> activeRecommendVOS = new ArrayList<>();
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,TokenUtil.getNowAccountInfo().getStoreId());
//ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
//List<ActiveRecommend> list = list(lambdaQueryWrapper);
IPage page1 = page(page, lambdaQueryWrapper);
List<ActiveRecommend> list = page1.getRecords();
for (ActiveRecommend activeRecommend : list) {
int youhuiTed = 0;
int duihuanTed = 0;
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
activeRecommendVO.setInviterGiftType(new String[0]);
//获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeRecommend)){
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId());
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime);
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper);
for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) {
//优惠券
if (activeRecommendChild.getActiveGift().equals("1")){
LambdaQueryWrapper<CardFavorableRecord> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(CardFavorableRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
queryWrappers.eq(CardFavorableRecord::getCardFavorableId,activeRecommendChild.getVouchersId());
List<CardFavorableRecord> lists = cardFavorableRecordService.list(queryWrappers);
activeRecommendVO.setYouhuiTotal(list.size());
for (CardFavorableRecord cardFavorableRecord : lists) {
if (cardFavorableRecord.getStatus().equals("1")){
youhuiTed+=1;
}
}
}
//兑换券
if (activeRecommendChild.getActiveGift().equals("2")){
LambdaQueryWrapper<CardExchangeRecord> queryWrapperss = new LambdaQueryWrapper<>();
queryWrapperss.eq(CardExchangeRecord::getActiveId,activeRecommendChild.getActiveRecommendId());
queryWrapperss.eq(CardExchangeRecord::getCardExchangeId,activeRecommendChild.getVouchersId());
List<CardExchangeRecord> lisst = cardExchangeRecordService.list(queryWrapperss);
activeRecommendVO.setDuihuanTotal(list.size());
for (CardExchangeRecord cardExchangeRecord : lisst) {
if (cardExchangeRecord.getStatus().equals("1")){
duihuanTed+=1;
}
}
}
}
BeanUtils.copyProperties(activeRecommend,activeRecommendVO);
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(","));
activeRecommendVO.setYouhuiTotaled(youhuiTed);
activeRecommendVO.setDuihuanTotaled(duihuanTed);
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
activeRecommendVOS.add(activeRecommendVO);
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
activeRecommendVOS.add(activeRecommendVO);
}
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
activeRecommendVO.setDuihuanTotaled(youhuiTed);
activeRecommendVO.setDuihuanTotaled(duihuanTed);
activeRecommendVO.setDuihuanTotal(0);
activeRecommendVO.setDuihuanTotal(0);
activeRecommendVOS.add(activeRecommendVO);
}
}
page1.setRecords(list);
return page1;
}
/**
* 数组转字符串
* @param array

View File

@ -22,6 +22,8 @@ public class ActiveRecommendVO extends Model<ActiveRecommendVO> {
private Integer id;
//所属连锁店id
private Integer chainStoreId;
private String activeNewName;
private String activeName;
//所属店铺id
private Integer storeId;
//活动图片

View File

@ -11,10 +11,14 @@ public class CardFavorableAdnUserDTO extends CardFavorable {
private List<Integer> userIds;
//优惠券ids
private List<Integer> cardFavorableIds;
//兑换券ids
private List<Integer> cardExchangeIds;
//等级ID
private List<Integer> gradeIds;
//天数
private Integer days;
//活动id
private Integer activeId;
//优惠卷名称
private String favorableName;

View File

@ -6,14 +6,18 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeDiscountRecords.entity.ActiveDiscountRecords;
import com.fuint.business.marketingActivity.activeDiscountRecords.mapper.ActiveDiscountRecordsMapper;
import com.fuint.business.marketingActivity.activeDiscountRecords.service.ActiveDiscountRecordsService;
import com.fuint.business.marketingActivity.activeExchange.dto.PaymentActiveDTO;
import com.fuint.business.marketingActivity.activeExchange.service.ActiveExchangeService;
import com.fuint.business.marketingActivity.activeExchange.vo.PaymentActiveVO;
import com.fuint.business.marketingActivity.activeFullminusRecords.entity.ActiveFullminusRecords;
import com.fuint.business.marketingActivity.activeFullminusRecords.mapper.ActiveFullminusRecordsMapper;
import com.fuint.business.marketingActivity.activeFullminusRecords.service.ActiveFullminusRecordsService;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCoupon;
import com.fuint.business.marketingActivity.activeOneCoupon.entity.ActiveOneCouponChild;
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponChildService;
import com.fuint.business.marketingActivity.activeOneCoupon.service.ActiveOneCouponService;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableAdnUserDTO;
import com.fuint.business.marketingActivity.cardFavorable.dto.IdListDTO;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
@ -55,20 +59,33 @@ import java.util.Map;
public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRecordMapper, CardFavorableRecord> implements CardFavorableRecordService {
@Resource
@Lazy
private CardFavorableRecordMapper cardFavorableRecordMapper;
@Resource
private LJUserService userService;
@Resource
@Lazy
private CardFavorableService cardFavorableService;
@Resource
private OilNameService oilNameService;
@Resource
@Lazy
private ActiveFullminusRecordsService activeFullminusRecordsService;
@Resource
@Lazy
private ActiveDiscountRecordsService activeDiscountRecordsService;
@Resource
@Lazy
private ActiveExchangeService activeExchangeService;
@Resource
@Lazy
private CardExchangeRecordService cardExchangeRecordService;
@Resource
@Lazy
private ActiveOneCouponService activeOneCouponService;
@Resource
@Lazy
private ActiveOneCouponChildService activeOneCouponChildService;
/**
* 分页查询所有数据
* @param page
@ -320,37 +337,87 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
*/
@Override
public boolean issueCardFavorable(CardFavorableAdnUserDTO cardFavorableAdnUserDTO) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer activeId = cardFavorableAdnUserDTO.getActiveId();
LambdaQueryWrapper<ActiveOneCoupon> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveOneCoupon::getId,activeId);
queryWrapper.eq(ActiveOneCoupon::getStoreId,nowAccountInfo.getStoreId());
ActiveOneCoupon activeOneCoupon = activeOneCouponService.getOne(queryWrapper);
String[] split = activeOneCoupon.getGradeId().split(",");
//查询用户列表
ArrayList<LJUserVo> ljUserVosList = new ArrayList<>();
List<Integer> gradeIds = cardFavorableAdnUserDTO.getGradeIds();
for (Integer gradeId : gradeIds) {
// List<Integer> gradeIds = cardFavorableAdnUserDTO.getGradeIds();
for (String gradeId : split) {
LJUserVo ljUserVo = new LJUserVo();
ljUserVo.setGradeId(gradeId);
ljUserVo.setDays(cardFavorableAdnUserDTO.getDays());
ljUserVo.setGradeId(Integer.parseInt(gradeId));
ljUserVo.setDays(activeOneCoupon.getCondition());
List<LJUserVo> userLists = userService.getUserLists(ljUserVo);
ljUserVosList.addAll(userLists);
}
boolean flag = false;
//油站信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
//会员ids
//List<Integer> userIds = cardFavorableAdnUserDTO.getUserIds();
//优惠券ids
List<Integer> cardIds = cardFavorableAdnUserDTO.getCardFavorableIds();
for (Integer cardId : cardIds) {
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
if (CollectionUtils.isNotEmpty(ljUserVosList)){
for (LJUserVo ljUserVo : ljUserVosList) {
LJUser userInfo = userService.queryUserByUserId(ljUserVo.getId());
cardFavorableRecord.setCardFavorableId(cardId);
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
cardFavorableRecord.setName(userInfo.getName());
cardFavorableRecord.setMobile(userInfo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("店铺一键送券!");
flag = addCardFavorableRecord(cardFavorableRecord);
LambdaQueryWrapper<ActiveOneCouponChild> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(ActiveOneCouponChild::getActiveConsumptionId,activeId);
queryWrapper1.eq(ActiveOneCouponChild::getStoreId,nowAccountInfo.getStoreId());
List<ActiveOneCouponChild> list = activeOneCouponChildService.list(queryWrapper1);
ArrayList<Integer> integers = new ArrayList<>();
for (ActiveOneCouponChild activeOneCouponChild : list) {
if(activeOneCouponChild.getActiveGift().equals("1")){
integers.add(activeOneCouponChild.getVouchersId());
}
}
//List<Integer> cardIds = cardFavorableAdnUserDTO.getCardFavorableIds();
if (ObjectUtils.isNotEmpty(integers)){
for (Integer cardId : integers) {
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
if (CollectionUtils.isNotEmpty(ljUserVosList)){
for (LJUserVo ljUserVo : ljUserVosList) {
LJUser userInfo = userService.queryUserByUserId(ljUserVo.getId());
cardFavorableRecord.setCardFavorableId(cardId);
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
cardFavorableRecord.setName(userInfo.getName());
cardFavorableRecord.setMobile(userInfo.getMobile());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("店铺一键送券!");
flag = addCardFavorableRecord(cardFavorableRecord);
}
}
}
}
//兑换券ids
LambdaQueryWrapper<ActiveOneCouponChild> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(ActiveOneCouponChild::getActiveConsumptionId,activeId);
queryWrapper2.eq(ActiveOneCouponChild::getStoreId,nowAccountInfo.getStoreId());
List<ActiveOneCouponChild> lists = activeOneCouponChildService.list(queryWrapper1);
ArrayList<Integer> integerss = new ArrayList<>();
for (ActiveOneCouponChild activeOneCouponChild : lists) {
if(activeOneCouponChild.getActiveGift().equals("2")){
integerss.add(activeOneCouponChild.getVouchersId());
}
}
//List<Integer> exchangeCardIds = cardFavorableAdnUserDTO.getCardExchangeIds();
if (ObjectUtils.isNotEmpty(integerss)){
for (Integer exchangeCardId : integerss) {
if (CollectionUtils.isNotEmpty(ljUserVosList)) {
for (LJUserVo ljUserVo : ljUserVosList) {
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setCardExchangeId(exchangeCardId);
cardExchangeRecord.setStoreId(nowAccountInfo.getStoreId());
cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("店铺一键送券!");
flag = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}
}
}

View File

@ -276,9 +276,9 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
@Autowired
private RedisLock redisLock;
@Autowired
private StaffCommissionService staffCommissionService;
//
// @Autowired
// private StaffCommissionService staffCommissionService;
private static String beforeLitres = new String("0");
/**
* 查询支付状态 修改相关关联表

View File

@ -176,6 +176,8 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
*/
@Override
public int insertStaff(LJStaff staff) {
LJStaff staff2 = this.selectStaffByMobile(staff.getMobile());
if (ObjectUtil.isNotEmpty(staff2)) return 0;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
if (ObjectUtil.isNotEmpty(staff.getStoreId())) {

View File

@ -10,6 +10,7 @@ import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.storeInformation.service.impl.LJStoreServiceImpl;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
@ -29,6 +30,7 @@ import java.io.*;
* @Version 1.0
*/
@Component
@Slf4j
public class QrCodeUtils {
@Autowired
private ILJStoreService storeService;
@ -67,7 +69,8 @@ public class QrCodeUtils {
//将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置
g.drawImage(image, (bufImg.getWidth()-360)/2, 320, null);
// 设置字体样式字体大小
g.setFont(new Font("TimesRoman", Font.BOLD, 40));
// g.setFont(new Font("TimesRoman", Font.BOLD, 40));
g.setFont(chineseFont());
//设置颜色
g.setColor(Color.BLACK);
@ -108,11 +111,40 @@ public class QrCodeUtils {
ImageIO.write(bufImg, "jpg", outImgStream);
outImgStream.flush();
outImgStream.close();
} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
}
}
public Font chineseFont() throws Exception {
// 设置中文
Font b = null;
//获取系统字体的路径
String prefixFont = "";
String os = System.getProperties().getProperty("os.name");//获取系统类型
if (os.startsWith("win") || os.startsWith("Win")) {//win下获取字体的路径
prefixFont = "C:\\Windows\\Fonts" + File.separator + "STSONG.TTF";
// Font font = Font.createFont(Font.TRUETYPE_FONT, new ClassPathResource("classpath:font/msyh.ttc").getFile());
// b = font.deriveFont(Font.BOLD, 40);
b = new Font("TimesRoman", Font.BOLD, 40);
} else {
prefixFont = "/usr/share/fonts" + File.separator + "msyh.ttc";
try {
Font font = Font.createFont(Font.TRUETYPE_FONT, new File(prefixFont));
b = font.deriveFont(Font.BOLD, 40);
// b = new Font("msyh", Font.BOLD, 40);
} catch (Exception e) {
//如果发生异常执行默认的字体
b = new Font("msyh", Font.BOLD, 40);
log.error(e.getMessage(),"找不到字体");
}
}
return b;
}
public int returnX(Graphics2D g,Integer bufImgWidth,String name){
FontMetrics fm = g.getFontMetrics();
Rectangle2D stringBounds = fm.getStringBounds(name, g);

View File

@ -5,12 +5,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.userManager.entity.LJUser;
import com.fuint.business.userManager.vo.LJUserVo;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* 会员信息 业务层
*/
@Transactional
public interface LJUserService extends IService<LJUser> {
/**
* 根据条件分页查询会员信息

View File

@ -43,6 +43,15 @@ export function getUserMobile(data) {
})
}
// 根据手机号查询会员详细
export function getUserPhone(data) {
return request({
url: '/business/userManager/user/phone' ,
method: 'post',
data: data
})
}
// 新增会员
export function addUser(data) {
return request({

View File

@ -28,17 +28,30 @@
/>
</el-form-item>
<el-form-item label="时间">
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 240px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- clearable-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<el-date-picker
v-model="dateRange"
style="width: 240px"
size="medium"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
clearable
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
v-model="beginTime"
style="width: 160px"
type="date"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item>
@ -61,13 +74,13 @@
<el-col :span="2.5">
<div class="box">
<span class="font-chinese">商品数量</span>
<span class="font-number">{{statisticsForm.exchangeQuantity}}</span>
<span class="font-number">{{statisticsForm.exchangeQuantity || 0}}</span>
</div>
</el-col>
<el-col :span="2.5">
<div class="box">
<span class="font-chinese">积分</span>
<span class="font-number">{{statisticsForm.integral}}</span>
<span class="font-number">{{statisticsForm.integral || 0}}</span>
</div>
</el-col>
<el-col :span="3">
@ -78,7 +91,7 @@
<i class="el-icon-info"></i>
</el-tooltip>
</span>
<span class="font-number">{{statisticsForm.amount}}</span>
<span class="font-number">{{statisticsForm.amount || 0}}</span>
</div>
</el-col>
</el-row>
@ -168,6 +181,8 @@ export default {
},
loading: false,
dateRange: [],
beginTime:"",
endTime:"",
defaultSort: {prop: 'createTime', order: 'descending'},
total: 0,
@ -187,6 +202,11 @@ export default {
},
methods: {
getList(){
this.dateRange = []
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
getOrderApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
this.dataList = res.data.records
this.total = res.data.total
@ -194,6 +214,11 @@ export default {
})
},
getStatistics() {
this.dateRange = []
if (this.beginTime && this.endTime) {
this.dateRange.push(this.beginTime.toLocaleDateString())
this.dateRange.push(this.endTime.toLocaleDateString())
}
getStatisticsApi(this.addDateRange(this.queryParams, this.dateRange)).then(res=>{
this.statisticsForm = res.data
})
@ -223,6 +248,8 @@ export default {
pageSize:10
},
this.dateRange = []
this.beginTime = ""
this.endTime = ""
this.getList()
this.getStatistics();

View File

@ -452,7 +452,7 @@
addUser,
delUser,
getUser,
getUserMobile,
getUserMobile, getUserPhone,
listStatistic,
listUserStatistic,
updateUser
@ -763,18 +763,16 @@
}
});
} else {
getUserMobile({mobile:this.form.mobile}).then( response => {
getUserPhone({mobile:this.form.mobile}).then( response => {
if(response.data!=null){
this.$modal.msgError("手机号已存在");
}else {
addUser(this.form).then(res => {
if (res.data==1) {
this.$modal.msgSuccess("新增会员成功");
this.open = false;
this.openUser = false;
this.getList();
this.getUserList();
}
});
}
})