推荐有礼
This commit is contained in:
parent
1fe8922e14
commit
223a1908f3
@ -111,14 +111,24 @@ public class ActiveConsumptionController extends BaseController {
|
|||||||
return getSuccessResult(this.activeConsumptionService.removeByIds(ids));
|
return getSuccessResult(this.activeConsumptionService.removeByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping("delById/{ids}")
|
||||||
|
public ResponseObject delete(@PathVariable Long ids) {
|
||||||
|
return getSuccessResult(this.activeConsumptionService.removeById(ids));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除数据
|
* 删除数据
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("del")
|
@DeleteMapping("del")
|
||||||
public ResponseObject del(@RequestParam("ids") List<Long> ids) {
|
public ResponseObject del(@RequestParam("ids") Long ids) {
|
||||||
return getSuccessResult(activeConsumptionChildService.removeByIds(ids));
|
return getSuccessResult(activeConsumptionChildService.removeById(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,6 +6,8 @@ import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsu
|
|||||||
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
import com.fuint.business.marketingActivity.activeConsumption.entity.ActiveConsumptionChild;
|
||||||
import com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsumptionChildMapper;
|
import com.fuint.business.marketingActivity.activeConsumption.mapper.ActiveConsumptionChildMapper;
|
||||||
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService;
|
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionChildService;
|
||||||
|
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
|
||||||
|
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
|
||||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||||
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableCountVO;
|
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableCountVO;
|
||||||
@ -31,6 +33,8 @@ public class ActiveConsumptionChildServiceImpl extends ServiceImpl<ActiveConsump
|
|||||||
private ActiveConsumptionChildMapper activeConsumptionChildMapper;
|
private ActiveConsumptionChildMapper activeConsumptionChildMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private CardFavorableRecordService cardFavorableRecordService;
|
private CardFavorableRecordService cardFavorableRecordService;
|
||||||
|
@Resource
|
||||||
|
private CardExchangeRecordService cardExchangeRecordService;
|
||||||
@Override
|
@Override
|
||||||
public List<ActiveConsumptionChild> selectList(Serializable id) {
|
public List<ActiveConsumptionChild> selectList(Serializable id) {
|
||||||
return activeConsumptionChildMapper.selectConsumptionChilds(id);
|
return activeConsumptionChildMapper.selectConsumptionChilds(id);
|
||||||
@ -72,6 +76,24 @@ public class ActiveConsumptionChildServiceImpl extends ServiceImpl<ActiveConsump
|
|||||||
cardFavorableCountVO.setCount(favorableRecords.size());
|
cardFavorableCountVO.setCount(favorableRecords.size());
|
||||||
cardFavorableCountVO.setCountEd(b);
|
cardFavorableCountVO.setCountEd(b);
|
||||||
cardFavorableCountVO.setCountLd(a);
|
cardFavorableCountVO.setCountLd(a);
|
||||||
|
|
||||||
|
// 查询兑换券领取记录
|
||||||
|
int as = 0;
|
||||||
|
int bs = 0;
|
||||||
|
LambdaQueryWrapper<CardExchangeRecord> queryWrappers = new LambdaQueryWrapper<>();
|
||||||
|
queryWrappers.eq(CardExchangeRecord::getActiveId, id);
|
||||||
|
queryWrappers.eq(CardExchangeRecord::getStoreId, nowAccountInfo.getStoreId());
|
||||||
|
List<CardExchangeRecord> list = cardExchangeRecordService.list(queryWrappers);
|
||||||
|
for (CardExchangeRecord cardExchangeRecord : list) {
|
||||||
|
if (cardExchangeRecord.getStatus().equals("0")){
|
||||||
|
as+=1;
|
||||||
|
}else {
|
||||||
|
bs+=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cardFavorableCountVO.setCounts(favorableRecords.size());
|
||||||
|
cardFavorableCountVO.setCountEds(b);
|
||||||
|
cardFavorableCountVO.setCountLds(a);
|
||||||
return cardFavorableCountVO;
|
return cardFavorableCountVO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,9 +197,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
|
|||||||
queryWrapper.eq(ActiveConsumptionChild::getActiveConsumptionId,id);
|
queryWrapper.eq(ActiveConsumptionChild::getActiveConsumptionId,id);
|
||||||
queryWrapper.orderByDesc(ActiveConsumptionChild::getCreateTime);
|
queryWrapper.orderByDesc(ActiveConsumptionChild::getCreateTime);
|
||||||
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.list(queryWrapper);
|
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.list(queryWrapper);
|
||||||
|
BeanUtils.copyProperties(consumption,activeConsumptionVO);
|
||||||
if (CollectionUtils.isNotEmpty(activeConsumptionChildList)){
|
if (CollectionUtils.isNotEmpty(activeConsumptionChildList)){
|
||||||
//封装VO返回
|
//封装VO返回
|
||||||
BeanUtils.copyProperties(consumption,activeConsumptionVO);
|
|
||||||
activeConsumptionVO.setParticipationConditionMoney(consumption.getParticipationConditionMoney().toString());
|
activeConsumptionVO.setParticipationConditionMoney(consumption.getParticipationConditionMoney().toString());
|
||||||
activeConsumptionVO.setDieselUserLevel(consumption.getDieselUserLevel().split(","));
|
activeConsumptionVO.setDieselUserLevel(consumption.getDieselUserLevel().split(","));
|
||||||
activeConsumptionVO.setGasolineUserLevel(consumption.getGasolineUserLevel().split(","));
|
activeConsumptionVO.setGasolineUserLevel(consumption.getGasolineUserLevel().split(","));
|
||||||
|
@ -17,6 +17,7 @@ import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscoun
|
|||||||
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountAppletVO;
|
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountAppletVO;
|
||||||
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountPayVO;
|
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountPayVO;
|
||||||
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
|
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
|
||||||
|
import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||||
import com.fuint.business.store.service.StoreService;
|
import com.fuint.business.store.service.StoreService;
|
||||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||||
@ -134,6 +135,16 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
|
|||||||
activeDiscountVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
|
activeDiscountVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
|
||||||
.map(Integer::valueOf)
|
.map(Integer::valueOf)
|
||||||
.toArray(Integer[]::new));
|
.toArray(Integer[]::new));
|
||||||
|
String oilName = "";
|
||||||
|
for (Integer integer : activeDiscountVO.getAdaptOil()) {
|
||||||
|
OilName oilNames = oilNameService.selectOilNameById(integer);
|
||||||
|
oilName += oilNames.getOilType() + "-"+oilNames.getOilName() + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oilName.endsWith(",")) { // 判断字符串是否以逗号结尾
|
||||||
|
oilName = oilName.substring(0, oilName.length() - 1); // 截取去除最后一个字符之前的子串
|
||||||
|
}
|
||||||
|
activeDiscountVO.setAdaptOilss(oilName);
|
||||||
//获取会员等级
|
//获取会员等级
|
||||||
String str = "";
|
String str = "";
|
||||||
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
||||||
|
@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
|
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
public class ActiveDiscountVO implements Serializable{
|
public class ActiveDiscountVO implements Serializable{
|
||||||
//主键id
|
//主键id
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
@ -27,6 +29,7 @@ public class ActiveDiscountVO implements Serializable{
|
|||||||
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[] adaptOils;
|
private String[] adaptOils;
|
||||||
|
private String adaptOilss;
|
||||||
private Integer[] adaptOil;
|
private Integer[] adaptOil;
|
||||||
//适用会员类型 0:全部用户 1:全部会员 2:等级会员
|
//适用会员类型 0:全部用户 1:全部会员 2:等级会员
|
||||||
private String adaptUserType;
|
private String adaptUserType;
|
||||||
|
@ -16,6 +16,7 @@ import com.fuint.business.marketingActivity.activeFullminus.entity.ActiveFullmin
|
|||||||
import com.fuint.business.marketingActivity.activeFullminus.service.ActiveFullminusService;
|
import com.fuint.business.marketingActivity.activeFullminus.service.ActiveFullminusService;
|
||||||
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusAppletVO;
|
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusAppletVO;
|
||||||
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusVO;
|
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusVO;
|
||||||
|
import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||||
import com.fuint.business.store.service.StoreService;
|
import com.fuint.business.store.service.StoreService;
|
||||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||||
@ -129,6 +130,16 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
|
|||||||
activeFullminusVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
|
activeFullminusVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
|
||||||
.map(Integer::valueOf)
|
.map(Integer::valueOf)
|
||||||
.toArray(Integer[]::new));
|
.toArray(Integer[]::new));
|
||||||
|
String oilName = "";
|
||||||
|
for (Integer integer : activeFullminusVO.getAdaptOil()) {
|
||||||
|
OilName oilNames = oilNameService.selectOilNameById(integer);
|
||||||
|
oilName += oilNames.getOilType() + "-"+oilNames.getOilName() + ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oilName.endsWith(",")) { // 判断字符串是否以逗号结尾
|
||||||
|
oilName = oilName.substring(0, oilName.length() - 1); // 截取去除最后一个字符之前的子串
|
||||||
|
}
|
||||||
|
activeFullminusVO.setAdaptOilss(oilName);
|
||||||
//获取会员等级
|
//获取会员等级
|
||||||
String str = "";
|
String str = "";
|
||||||
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
|
||||||
|
@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
|
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
public class ActiveFullminusVO implements Serializable {
|
public class ActiveFullminusVO implements Serializable {
|
||||||
//主键id
|
//主键id
|
||||||
@TableId(type = IdType.AUTO)
|
@TableId(type = IdType.AUTO)
|
||||||
@ -27,6 +29,7 @@ public class ActiveFullminusVO implements Serializable {
|
|||||||
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[] adaptOils;
|
private String[] adaptOils;
|
||||||
|
private String adaptOilss;
|
||||||
private Integer[] adaptOil;
|
private Integer[] adaptOil;
|
||||||
//适用会员类型 0:全部用户 1:全部会员 2:等级会员
|
//适用会员类型 0:全部用户 1:全部会员 2:等级会员
|
||||||
private String adaptUserType;
|
private String adaptUserType;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.fuint.business.marketingActivity.cardExchange.controller;
|
package com.fuint.business.marketingActivity.cardExchange.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.fuint.business.convenienceSore.service.StockStatisticService;
|
||||||
import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO;
|
import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO;
|
||||||
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
|
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchange;
|
||||||
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
|
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
|
||||||
@ -15,6 +16,7 @@ import com.fuint.common.util.TokenUtil;
|
|||||||
import com.fuint.framework.web.BaseController;
|
import com.fuint.framework.web.BaseController;
|
||||||
import com.fuint.framework.web.ResponseObject;
|
import com.fuint.framework.web.ResponseObject;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -42,6 +44,8 @@ public class CardExchangeRecordController extends BaseController {
|
|||||||
private CardExchangeService cardExchangeService;
|
private CardExchangeService cardExchangeService;
|
||||||
@Resource
|
@Resource
|
||||||
private LJOrderService ljOrderService;
|
private LJOrderService ljOrderService;
|
||||||
|
@Resource
|
||||||
|
private StockStatisticService stockStatisticService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询所有数据
|
* 分页查询所有数据
|
||||||
@ -123,20 +127,22 @@ public class CardExchangeRecordController extends BaseController {
|
|||||||
LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId());
|
LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId());
|
||||||
cardExchangeRecord.setRealName(ljStaff.getRealName());
|
cardExchangeRecord.setRealName(ljStaff.getRealName());
|
||||||
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
|
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
|
||||||
Integer cardExchangeId = cardExchangeRecord.getCardExchangeId();
|
CardExchangeRecord byId = cardExchangeRecordService.getById(cardExchangeRecord.getId());
|
||||||
|
Integer cardExchangeId = byId.getCardExchangeId();
|
||||||
CardExchange cardExchange = cardExchangeService.getById(cardExchangeId);
|
CardExchange cardExchange = cardExchangeService.getById(cardExchangeId);
|
||||||
Integer giftId = cardExchange.getGiftId();
|
Integer giftId = cardExchange.getGiftId();
|
||||||
LJOrder ljOrder = new LJOrder();
|
LJOrder ljOrder = new LJOrder();
|
||||||
ljOrder.setTerminal("pc");
|
ljOrder.setTerminal("pc");
|
||||||
ljOrder.setPayUser(cardExchangeRecord.getMobile());
|
ljOrder.setPayUser(byId.getMobile());
|
||||||
ljOrder.setStoreId(nowAccountInfo.getStoreId());
|
ljOrder.setStoreId(nowAccountInfo.getStoreId());
|
||||||
ljOrder.setUserId(cardExchangeRecord.getMtUserId());
|
ljOrder.setUserId(byId.getMtUserId());
|
||||||
ljOrder.setGoodsNum(1);
|
ljOrder.setGoodsNum(1);
|
||||||
ljOrder.setPayType("0");
|
ljOrder.setPayType("0");
|
||||||
ljOrder.setStatus("paid");
|
ljOrder.setStatus("paid");
|
||||||
ljOrder.setPayTime(new Date());
|
ljOrder.setPayTime(new Date());
|
||||||
ljOrder.setStaffId(nowAccountInfo.getStaffId());
|
ljOrder.setStaffId(nowAccountInfo.getStaffId());
|
||||||
ljOrderService.addGoodOrder(ljOrder,giftId);
|
ljOrderService.addGoodOrder(ljOrder,giftId);
|
||||||
|
stockStatisticService.insertStockStatisticTrack(giftId,0.0,"核销兑换!",1);
|
||||||
return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord));
|
return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +108,15 @@ public class CardFavorableRecordController extends BaseController {
|
|||||||
return getSuccessResult(this.cardFavorableRecordService.issueCardFavorable(cardFavorableAdnUserDTO));
|
return getSuccessResult(this.cardFavorableRecordService.issueCardFavorable(cardFavorableAdnUserDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询一键发券会员数接口
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@GetMapping("getAdaptUserList")
|
||||||
|
public ResponseObject getAdaptUserList(@Param("cardFavorableAdnUserDTO") CardFavorableAdnUserDTO cardFavorableAdnUserDTO) {
|
||||||
|
return getSuccessResult(this.cardFavorableRecordService.getAdaptUserList(cardFavorableAdnUserDTO));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询一键发券接口
|
* 查询一键发券接口
|
||||||
*
|
*
|
||||||
|
@ -8,6 +8,8 @@ import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableAdnUs
|
|||||||
import com.fuint.business.marketingActivity.cardFavorable.dto.IdListDTO;
|
import com.fuint.business.marketingActivity.cardFavorable.dto.IdListDTO;
|
||||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||||
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
|
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
|
||||||
|
import com.fuint.business.marketingActivity.cardFavorable.vo.LJUserVos;
|
||||||
|
import com.fuint.business.userManager.vo.LJUserVo;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -76,5 +78,12 @@ public interface CardFavorableRecordService extends IService<CardFavorableRecord
|
|||||||
CardFavorableAdnUserDTO getInfoById(Integer id);
|
CardFavorableAdnUserDTO getInfoById(Integer id);
|
||||||
|
|
||||||
int updateStatus(Integer id);
|
int updateStatus(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询一键发券会员数接口
|
||||||
|
* @param cardFavorableAdnUserDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<LJUserVos> getAdaptUserList(CardFavorableAdnUserDTO cardFavorableAdnUserDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRe
|
|||||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
|
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
|
||||||
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
|
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableRecordVO;
|
||||||
|
import com.fuint.business.marketingActivity.cardFavorable.vo.LJUserVos;
|
||||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||||
import com.fuint.business.userManager.entity.LJUser;
|
import com.fuint.business.userManager.entity.LJUser;
|
||||||
import com.fuint.business.userManager.service.LJUserService;
|
import com.fuint.business.userManager.service.LJUserService;
|
||||||
@ -366,5 +367,30 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
|
|||||||
public int updateStatus(Integer id) {
|
public int updateStatus(Integer id) {
|
||||||
return cardFavorableRecordMapper.updateStatus(id);
|
return cardFavorableRecordMapper.updateStatus(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LJUserVos> getAdaptUserList(CardFavorableAdnUserDTO cardFavorableAdnUserDTO) {
|
||||||
|
ArrayList<LJUserVos> ljUserVosList = new ArrayList<>();
|
||||||
|
List<Integer> gradeIds = cardFavorableAdnUserDTO.getGradeIds();
|
||||||
|
for (Integer gradeId : gradeIds) {
|
||||||
|
LJUserVo ljUserVo = new LJUserVo();
|
||||||
|
LJUserVos ljUserVos = new LJUserVos();
|
||||||
|
ljUserVo.setGradeId(gradeId);
|
||||||
|
List<LJUserVo> userLists = userService.getUserCountList(ljUserVo);
|
||||||
|
if (CollectionUtils.isNotEmpty(userLists)){
|
||||||
|
ljUserVos.setGradeName(userLists.get(0).getGradeName());
|
||||||
|
ljUserVos.setCountAll(userLists.size());
|
||||||
|
}
|
||||||
|
ljUserVo.setDays(cardFavorableAdnUserDTO.getDays());
|
||||||
|
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() + "%");
|
||||||
|
}
|
||||||
|
ljUserVosList.add(ljUserVos);
|
||||||
|
}
|
||||||
|
return ljUserVosList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,4 +13,11 @@ public class CardFavorableCountVO implements Serializable {
|
|||||||
private Integer count;
|
private Integer count;
|
||||||
private Integer countEd;
|
private Integer countEd;
|
||||||
private Integer countLd;
|
private Integer countLd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 兑换券数量
|
||||||
|
*/
|
||||||
|
private Integer counts;
|
||||||
|
private Integer countEds;
|
||||||
|
private Integer countLds;
|
||||||
}
|
}
|
||||||
|
@ -93,4 +93,5 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
|||||||
Integer userNum(Integer storeId);
|
Integer userNum(Integer storeId);
|
||||||
|
|
||||||
|
|
||||||
|
List<LJUserVo> getUserCountList(LJUserVo user);
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,9 @@
|
|||||||
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
|
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
|
||||||
left join oil_order oo on mu.id = oo.user_id
|
left join oil_order oo on mu.id = oo.user_id
|
||||||
<where>
|
<where>
|
||||||
|
<if test="user.days != null and user.days != ''">
|
||||||
oo.create_time <= DATE_SUB(NOW(), INTERVAL ${user.days} DAY)
|
oo.create_time <= DATE_SUB(NOW(), INTERVAL ${user.days} DAY)
|
||||||
|
</if>
|
||||||
<if test="user.chainStoreId != null and user.chainStoreId != ''">
|
<if test="user.chainStoreId != null and user.chainStoreId != ''">
|
||||||
and mub.chain_store_id = #{user.chainStoreId}
|
and mub.chain_store_id = #{user.chainStoreId}
|
||||||
</if>
|
</if>
|
||||||
@ -286,6 +288,14 @@
|
|||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserCountList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||||
|
select mug.`name` gradeName,mug.id gradeId
|
||||||
|
from mt_user_balance mub
|
||||||
|
left join mt_user_grade mug on mub.grade_id = mug.id
|
||||||
|
where mug.id = #{gradeId}
|
||||||
|
and mub.store_id = #{storeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectUserById" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
<select id="selectUserById" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
||||||
parameterType="java.lang.Integer">
|
parameterType="java.lang.Integer">
|
||||||
|
@ -20,6 +20,7 @@ public interface LJUserService extends IService<LJUser> {
|
|||||||
public IPage<LJUserVo> selectUserList(Page page, LJUserVo user);
|
public IPage<LJUserVo> selectUserList(Page page, LJUserVo user);
|
||||||
public IPage<LJUserVo> getUserList(Page page, LJUserVo user);
|
public IPage<LJUserVo> getUserList(Page page, LJUserVo user);
|
||||||
public List<LJUserVo> getUserLists(LJUserVo user);
|
public List<LJUserVo> getUserLists(LJUserVo user);
|
||||||
|
public List<LJUserVo> getUserCountList(LJUserVo user);
|
||||||
|
|
||||||
Integer userNum(Integer storeId);
|
Integer userNum(Integer storeId);
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
private UserBalanceService balanceService;
|
private UserBalanceService balanceService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ILJStoreService storeService;
|
private ILJStoreService storeService;
|
||||||
|
@Resource
|
||||||
|
private LJUserMapper ljUserMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件分页查询会员信息
|
* 根据条件分页查询会员信息
|
||||||
@ -81,6 +83,15 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
return userLists;
|
return userLists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LJUserVo> getUserCountList(LJUserVo user) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
|
user.setStoreId(storeId);
|
||||||
|
List<LJUserVo> userCountList = ljUserMapper.getUserCountList(user);
|
||||||
|
return userCountList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer userNum(Integer storeId) {
|
public Integer userNum(Integer storeId) {
|
||||||
// 构建查询条件
|
// 构建查询条件
|
||||||
|
@ -81,6 +81,8 @@ public class LJUserVo extends BaseEntity {
|
|||||||
// 等级ID
|
// 等级ID
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
|
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
// 储值卡
|
// 储值卡
|
||||||
@ExcelProperty(value = "储值卡余额")
|
@ExcelProperty(value = "储值卡余额")
|
||||||
private Double cardBalance;
|
private Double cardBalance;
|
||||||
|
Loading…
Reference in New Issue
Block a user