This commit is contained in:
齐天大圣 2024-03-08 14:55:04 +08:00
parent 9669f7ea6b
commit 6bcb8dc254
10 changed files with 336 additions and 232 deletions

View File

@ -166,7 +166,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
Integer[] array = Arrays.stream(s.getAdaptOil().split(",")) Integer[] array = Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf) .map(Integer::valueOf)
.toArray(Integer[]::new); .toArray(Integer[]::new);
String[] adaptOil = new String[array.length]; /*String[] adaptOil = new String[array.length];
if (array.length>0) { if (array.length>0) {
for (int i = 0;i<array.length;i++) { for (int i = 0;i<array.length;i++) {
OilName oilName = oilNameService.selectOilNameById(array[i]); OilName oilName = oilNameService.selectOilNameById(array[i]);
@ -174,15 +174,15 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
adaptOil[i] = oilName.getOilName(); adaptOil[i] = oilName.getOilName();
} }
} }
} }*/
activeConsumptionVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(",")) activeConsumptionVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf) .map(Integer::valueOf)
.toArray(Integer[]::new)); .toArray(Integer[]::new));
activeConsumptionVO.setAdaptOils(adaptOil); //activeConsumptionVO.setAdaptOils(adaptOil);
activeConsumptionVO.setActiveGift(s.getActiveGift().split(",")); activeConsumptionVO.setActiveGift(s.getActiveGift().split(","));
//获取会员等级 //获取会员等级
String str = ""; /*String str = "";
if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){ if (ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
for (String gradeId : s.getDieselUserLevel().split(",")) { for (String gradeId : s.getDieselUserLevel().split(",")) {
LJUserGrade ljUserGrade = userGradeService.selectUserGradeById(Integer.parseInt(gradeId)); LJUserGrade ljUserGrade = userGradeService.selectUserGradeById(Integer.parseInt(gradeId));
@ -191,7 +191,7 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
} }
} }
activeConsumptionVO.setDieselUserLevel(str.split(",")); activeConsumptionVO.setDieselUserLevel(str.split(","));
} }*/
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.selectList(s.getId()); List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.selectList(s.getId());
int youhuiTed = 0; int youhuiTed = 0;
int duihuanTed = 0; int duihuanTed = 0;
@ -227,7 +227,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
activeConsumptionVO.setDuihuanTotaled(duihuanTed); activeConsumptionVO.setDuihuanTotaled(duihuanTed);
TAccount accountInfoById = accountService.getAccountInfoById(Integer.parseInt(s.getCreateBy())); TAccount accountInfoById = accountService.getAccountInfoById(Integer.parseInt(s.getCreateBy()));
if (ObjectUtil.isNotEmpty(accountInfoById)) activeConsumptionVO.setCreateBy(accountInfoById.getRealName()); if (ObjectUtil.isNotEmpty(accountInfoById)) {
activeConsumptionVO.setCreateBy(accountInfoById.getRealName());
}
return activeConsumptionVO; return activeConsumptionVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
activeConsumptionVOSIPage.setRecords(activeConsumptionVOList); activeConsumptionVOSIPage.setRecords(activeConsumptionVOList);
@ -385,7 +387,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
}else if (s.getAdaptUserType().equals("1")){ }else if (s.getAdaptUserType().equals("1")){
adaptUserType = "全部会员"; adaptUserType = "全部会员";
}else { }else {
adaptUserType = arrayToString(s.getDieselUserLevel()); if(ObjectUtils.isNotEmpty(s.getDieselUserLevel())){
adaptUserType = arrayToString(s.getDieselUserLevel());
}
} }
//赠送优惠券兑换券实物 //赠送优惠券兑换券实物
String card = ""; String card = "";
@ -399,13 +403,13 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
} }
} }
} }
ArrayList<String> oilNameList = new ArrayList<>(); /* ArrayList<String> oilNameList = new ArrayList<>();
//油号名字 //油号名字
for (Integer id : s.getAdaptOil()) { for (Integer id : s.getAdaptOil()) {
String oilName = oilNameService.selectOilNameById(id).getOilName(); String oilName = oilNameService.selectOilNameById(id).getOilName();
oilNameList.add(oilName); oilNameList.add(oilName);
} }*/
activeConsumptionAppletVO.setOilName(oilNameList); //activeConsumptionAppletVO.setOilName(oilNameList);
activeConsumptionAppletVO.setPoints(s.getPoints()); activeConsumptionAppletVO.setPoints(s.getPoints());
activeConsumptionAppletVO.setAdaptUserType(adaptUserType); activeConsumptionAppletVO.setAdaptUserType(adaptUserType);
String goodss = ""; String goodss = "";

View File

@ -42,6 +42,9 @@ import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableR
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.CouponVO; import com.fuint.business.marketingActivity.cardFavorable.vo.CouponVO;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
import com.fuint.business.marketingActivity.cardFule.vo.CardFuelDieselVO;
import com.fuint.business.marketingActivity.cardValue.entity.CardValue; import com.fuint.business.marketingActivity.cardValue.entity.CardValue;
import com.fuint.business.marketingActivity.cardValue.service.CardValueService; import com.fuint.business.marketingActivity.cardValue.service.CardValueService;
import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO; import com.fuint.business.marketingActivity.cardValue.vo.CardValueAppletVO;
@ -128,6 +131,8 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
private ChainStoreConfigService chainStoreConfigService; private ChainStoreConfigService chainStoreConfigService;
@Resource @Resource
private ActiveConsumptionChildService activeConsumptionChildService; private ActiveConsumptionChildService activeConsumptionChildService;
@Resource
private CardFuelDieselService cardFuelDieselService;
/** /**
* 分页查询所有 * 分页查询所有
* @param * @param
@ -344,6 +349,38 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
@Override @Override
public List<ActiveAppletVO> select(ActiveExchangeRecordDTO activeExchangeRecordDTO) { public List<ActiveAppletVO> select(ActiveExchangeRecordDTO activeExchangeRecordDTO) {
ArrayList<ActiveAppletVO> activeAppletVOS = new ArrayList<>(); ArrayList<ActiveAppletVO> activeAppletVOS = new ArrayList<>();
//充值有礼
CardValue cardValue = new CardValue();
cardValue.setStoreId(activeExchangeRecordDTO.getStoreId());
List<CardValueAppletVO> cardValueAppletVOS = cardValueService.selectAllApplet(cardValue);
if (CollectionUtils.isNotEmpty(cardValueAppletVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("储值卡充值活动");
activeAppletVO.setDes(cardValueAppletVOS.get(0).getDiscountActiveDescribe());
activeAppletVO.setTime(cardValueAppletVOS.get(0).getTime());
activeAppletVOS.add(activeAppletVO);
}else {
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("储值卡充值活动");
activeAppletVO.setDes("活动准备中,敬请期待!");
activeAppletVOS.add(activeAppletVO);
}
//囤油卡有礼
CardFuelDiesel cardFuelDiesel = new CardFuelDiesel();
cardFuelDiesel.setStoreId(activeExchangeRecordDTO.getStoreId());
List<CardFuelDieselVO> cardFuelDieselVOS = cardFuelDieselService.selectAllAppletByStorId(cardFuelDiesel);
if (CollectionUtils.isNotEmpty(cardFuelDieselVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("囤油卡充值活动");
activeAppletVO.setDes(cardFuelDieselVOS.get(0).getDiscountActiveDescribe());
activeAppletVO.setTime(cardFuelDieselVOS.get(0).getTime());
activeAppletVOS.add(activeAppletVO);
}else {
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("囤油卡充值活动");
activeAppletVO.setDes("活动准备中,敬请期待!");
activeAppletVOS.add(activeAppletVO);
}
//消费有礼活动 //消费有礼活动
ActiveConsumption consumption = new ActiveConsumption(); ActiveConsumption consumption = new ActiveConsumption();
consumption.setStoreId(activeExchangeRecordDTO.getStoreId()); consumption.setStoreId(activeExchangeRecordDTO.getStoreId());
@ -393,12 +430,12 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
} }
//新人有礼 //新人有礼
ActiveNewlywedsAppletVO activeNewlywedsAppletVO = activeNewlywedsService.selectApplet(consumption); List<ActiveNewlywedsAppletVO> activeNewlywedsAppletVOS = activeNewlywedsService.selectApplet(consumption);
if (ObjectUtils.isNotEmpty(activeNewlywedsAppletVO) && ObjectUtils.isNotEmpty(activeNewlywedsAppletVO.getNewlywedsActiveDescribe())){ if (ObjectUtils.isNotEmpty(activeNewlywedsAppletVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("新人有礼活动"); activeAppletVO.setName("新人有礼活动");
activeAppletVO.setDes(activeNewlywedsAppletVO.getNewlywedsActiveDescribe()); activeAppletVO.setDes(activeNewlywedsAppletVOS.get(0).getNewlywedsActiveDescribe());
activeAppletVO.setTime(activeNewlywedsAppletVO.getTime()); activeAppletVO.setTime(activeNewlywedsAppletVOS.get(0).getTime());
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
}else { }else {
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
@ -407,11 +444,11 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
} }
//推荐有礼 //推荐有礼
ActiveRecommendAppletVO activeRecommendAppletVO = activeRecommendService.selectApplet(consumption); List<ActiveRecommendAppletVO> activeRecommendAppletVOS = activeRecommendService.selectApplet(consumption);
if (ObjectUtils.isNotEmpty(activeRecommendAppletVO) && ObjectUtils.isNotEmpty(activeRecommendAppletVO.getRecommendActiveDescribeIn())){ if (ObjectUtils.isNotEmpty(activeRecommendAppletVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO(); ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("推荐有礼活动"); activeAppletVO.setName("推荐有礼活动");
activeAppletVO.setDes(activeRecommendAppletVO.getRecommendActiveDescribeIn()); activeAppletVO.setDes(activeRecommendAppletVOS.get(0).getRecommendActiveDescribeIn());
activeAppletVO.setTime("永久有效"); activeAppletVO.setTime("永久有效");
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
}else { }else {
@ -420,22 +457,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
activeAppletVO.setDes("活动准备中,敬请期待!"); activeAppletVO.setDes("活动准备中,敬请期待!");
activeAppletVOS.add(activeAppletVO); activeAppletVOS.add(activeAppletVO);
} }
//充值有礼
CardValue cardValue = new CardValue();
cardValue.setStoreId(activeExchangeRecordDTO.getStoreId());
List<CardValueAppletVO> cardValueAppletVOS = cardValueService.selectAllApplet(cardValue);
if (CollectionUtils.isNotEmpty(cardValueAppletVOS)){
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("储值卡充值活动");
activeAppletVO.setDes(cardValueAppletVOS.get(0).getDiscountActiveDescribe());
activeAppletVO.setTime(cardValueAppletVOS.get(0).getTime());
activeAppletVOS.add(activeAppletVO);
}else {
ActiveAppletVO activeAppletVO = new ActiveAppletVO();
activeAppletVO.setName("储值卡充值活动");
activeAppletVO.setDes("活动准备中,敬请期待!");
activeAppletVOS.add(activeAppletVO);
}
return activeAppletVOS; return activeAppletVOS;
} }

View File

@ -254,11 +254,11 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
String formatEd = dateFormat.format(s.getActiveEndTime()); String formatEd = dateFormat.format(s.getActiveEndTime());
activeFullminusAppletVO.setTime(formatSt+"-" + formatEd+""); activeFullminusAppletVO.setTime(formatSt+"-" + formatEd+"");
//油号名字 //油号名字
ArrayList<String> oilNameList = new ArrayList<>(); /* ArrayList<String> oilNameList = new ArrayList<>();
for (Integer id : s.getAdaptOil()) { for (Integer id : s.getAdaptOil()) {
String oilName = oilNameService.selectOilNameById(id).getOilName(); String oilName = oilNameService.selectOilNameById(id).getOilName();
oilNameList.add(oilName); oilNameList.add(oilName);
} }*/
//适用用户名 //适用用户名
String adaptUserType = ""; String adaptUserType = "";
adaptUserType = arrayToString(s.getDieselUserLevel()); adaptUserType = arrayToString(s.getDieselUserLevel());
@ -273,7 +273,7 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
} }
} }
activeFullminusAppletVO.setAdaptUserType(adaptUserType); activeFullminusAppletVO.setAdaptUserType(adaptUserType);
activeFullminusAppletVO.setOilName(oilNameList); // activeFullminusAppletVO.setOilName(oilNameList);
activeFullminusAppletVO.setFullminusActiveDescribe(s.getName() +"享受满" + activeFullminusAppletVO.setFullminusActiveDescribe(s.getName() +"享受满" +
amount + "元,减" + discount + "元。"); amount + "元,减" + discount + "元。");
return activeFullminusAppletVO; return activeFullminusAppletVO;

View File

@ -42,7 +42,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
*/ */
ActiveNewlywedsVO getOneById(Serializable id); ActiveNewlywedsVO getOneById(Serializable id);
ActiveNewlywedsVO getOneByStoreId(Serializable id); ActiveNewlywedsVO getOneByStoreId(Serializable id);
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption); List<ActiveNewlywedsVO> getOneByIdApplet(ActiveConsumption activeConsumption);
/** /**
* 修改数据 * 修改数据
@ -55,6 +55,6 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* 查询单条数据(小程序端) * 查询单条数据(小程序端)
* @return * @return
*/ */
ActiveNewlywedsAppletVO selectApplet(ActiveConsumption activeConsumption); List<ActiveNewlywedsAppletVO> selectApplet(ActiveConsumption activeConsumption);
} }

View File

@ -395,36 +395,46 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
* @return * @return
*/ */
@Override @Override
public ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption) { public List<ActiveNewlywedsVO> getOneByIdApplet(ActiveConsumption activeConsumption) {
Integer storeId = activeConsumption.getStoreId(); Integer storeId = activeConsumption.getStoreId();
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO(); ArrayList<ActiveNewlywedsVO> arrayList = new ArrayList<>();
activeNewlywedsVO.setCourtesyReward(new String[0]);
if (ObjectUtils.isNotEmpty(storeId)){ if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息 //获取新人有礼活动信息
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId); lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,storeId);
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper); List<ActiveNewlyweds> list = list(lambdaQueryWrapper);
//ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
//获取兑换物品信息 //获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeNewlyweds)){ if (ObjectUtils.isNotEmpty(list)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>(); for (ActiveNewlyweds activeNewlyweds : list) {
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId()); ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime); activeNewlywedsVO.setCourtesyReward(new String[0]);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO); LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
//封装VO返回 queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(",")); queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){ List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList); BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
}else { //封装VO返回
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>(); activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists); if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
}
arrayList.add(activeNewlywedsVO);
} }
}else { }else {
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
activeNewlywedsVO.setCourtesyReward(new String[0]);
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>(); ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList); activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
arrayList.add(activeNewlywedsVO);
} }
} }
return activeNewlywedsVO; return arrayList;
} }
/** /**
@ -464,49 +474,56 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
} }
@Override @Override
public ActiveNewlywedsAppletVO selectApplet(ActiveConsumption activeConsumption) { public List<ActiveNewlywedsAppletVO> selectApplet(ActiveConsumption activeConsumption) {
ActiveNewlywedsAppletVO activeNewlywedsAppletVO = new ActiveNewlywedsAppletVO(); ArrayList<ActiveNewlywedsAppletVO> arrayList = new ArrayList<>();
//获取本店铺的推荐有礼活动 //获取本店铺的推荐有礼活动
ActiveNewlywedsVO activeNewlywedsVO = getOneByIdApplet(activeConsumption); List<ActiveNewlywedsVO> oneByIdApplet = getOneByIdApplet(activeConsumption);
if (ObjectUtils.isNotEmpty(activeNewlywedsVO.getId())){ if (ObjectUtils.isNotEmpty(oneByIdApplet)){
//活动时间 for (ActiveNewlywedsVO activeNewlywedsVO : oneByIdApplet) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd"); ActiveNewlywedsAppletVO activeNewlywedsAppletVO = new ActiveNewlywedsAppletVO();
String formatSt = dateFormat.format(activeNewlywedsVO.getActiveStartTime()); if (ObjectUtils.isNotEmpty(activeNewlywedsVO.getId())){
String formatEd = dateFormat.format(activeNewlywedsVO.getActiveEndTime()); //活动时间
activeNewlywedsAppletVO.setTime(formatSt+"-" + formatEd+""); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd");
//邀请人获得 String formatSt = dateFormat.format(activeNewlywedsVO.getActiveStartTime());
if (ObjectUtils.isNotEmpty(activeNewlywedsVO) && ObjectUtils.isNotEmpty(activeNewlywedsVO.getPoints())){ String formatEd = dateFormat.format(activeNewlywedsVO.getActiveEndTime());
//积分 activeNewlywedsAppletVO.setTime(formatSt+"-" + formatEd+"");
activeNewlywedsAppletVO.setPoint(activeNewlywedsVO.getPoints().toString()); //邀请人获得
} if (ObjectUtils.isNotEmpty(activeNewlywedsVO) && ObjectUtils.isNotEmpty(activeNewlywedsVO.getPoints())){
if (ObjectUtils.isNotEmpty(activeNewlywedsVO) && ObjectUtils.isNotEmpty(activeNewlywedsVO.getGrowthValue())){ //积分
//成长值 activeNewlywedsAppletVO.setPoint(activeNewlywedsVO.getPoints().toString());
activeNewlywedsAppletVO.setGrowValue(activeNewlywedsVO.getGrowthValue().toString());
}
//邀请人赠送优惠券兑换券
String cardi1 = "";
String cardo1 = "";
if (CollectionUtils.isNotEmpty(activeNewlywedsVO.getActiveNewlywedsChildList())){
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsVO.getActiveNewlywedsChildList()) {
if (activeNewlywedsChild.getActiveGift().equals("1")){
//优惠券
cardi1 += activeNewlywedsChild.getGiftCardName()+"的券("+activeNewlywedsChild.getGiftCardDetail()+");";
} }
if (activeNewlywedsChild.getActiveGift().equals("2")){ if (ObjectUtils.isNotEmpty(activeNewlywedsVO) && ObjectUtils.isNotEmpty(activeNewlywedsVO.getGrowthValue())){
//兑换券 //成长值
cardo1 += activeNewlywedsChild.getGiftCardName()+"的券;"; activeNewlywedsAppletVO.setGrowValue(activeNewlywedsVO.getGrowthValue().toString());
} }
//邀请人赠送优惠券兑换券
String cardi1 = "";
String cardo1 = "";
if (CollectionUtils.isNotEmpty(activeNewlywedsVO.getActiveNewlywedsChildList())){
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsVO.getActiveNewlywedsChildList()) {
if (activeNewlywedsChild.getActiveGift().equals("1")){
//优惠券
cardi1 += activeNewlywedsChild.getGiftCardName()+"的券("+activeNewlywedsChild.getGiftCardDetail()+");";
}
if (activeNewlywedsChild.getActiveGift().equals("2")){
//兑换券
cardo1 += activeNewlywedsChild.getGiftCardName()+"的券;";
}
}
}
//邀请人的券
//积分
activeNewlywedsAppletVO.setPoint(activeNewlywedsVO.getPoints().toString());
//成长值
activeNewlywedsAppletVO.setGrowValue(activeNewlywedsVO.getGrowthValue().toString());
activeNewlywedsAppletVO.setNewlywedsActiveDescribe("欢迎各位亲朋好友参加本店的新人有礼活动,我们有丰厚的奖励哦,参加即送优惠券:"+cardi1+"兑换券:"+cardo1);
arrayList.add(activeNewlywedsAppletVO);
//return activeNewlywedsAppletVO;
} }
} }
//邀请人的券
//积分
activeNewlywedsAppletVO.setPoint(activeNewlywedsVO.getPoints().toString());
//成长值
activeNewlywedsAppletVO.setGrowValue(activeNewlywedsVO.getGrowthValue().toString());
activeNewlywedsAppletVO.setNewlywedsActiveDescribe("欢迎各位亲朋好友参加本店的新人有礼活动,我们有丰厚的奖励哦,参加即送优惠券:"+cardi1+"兑换券:"+cardo1);
return activeNewlywedsAppletVO;
} }
return activeNewlywedsAppletVO;
return arrayList;
} }
/** /**

View File

@ -33,7 +33,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* @return * @return
*/ */
ActiveRecommendVO getOneById(Serializable id); ActiveRecommendVO getOneById(Serializable id);
ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption); List<ActiveRecommendVO> getOneByIdApplet(ActiveConsumption activeConsumption);
/** /**
* 修改数据 * 修改数据
@ -46,7 +46,7 @@ public interface ActiveRecommendService extends IService<ActiveRecommend> {
* 查询单条数据(小程序端) * 查询单条数据(小程序端)
* @return * @return
*/ */
ActiveRecommendAppletVO selectApplet(ActiveConsumption activeConsumption); List<ActiveRecommendAppletVO> selectApplet(ActiveConsumption activeConsumption);
IPage select(Page page, ActiveRecommend activeRecommend); IPage select(Page page, ActiveRecommend activeRecommend);
} }

View File

@ -124,21 +124,24 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
//推荐有礼活动 //推荐有礼活动
ActiveConsumption activeConsumption = new ActiveConsumption(); ActiveConsumption activeConsumption = new ActiveConsumption();
activeConsumption.setStoreId(storeId); activeConsumption.setStoreId(storeId);
ActiveRecommendVO activeRecommendVO = activeRecommendService.getOneByIdApplet(activeConsumption); List<ActiveRecommendVO> oneByIdApplet = activeRecommendService.getOneByIdApplet(activeConsumption);
//活动所送推荐人的优惠券 for (ActiveRecommendVO activeRecommendVO : oneByIdApplet) {
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendVO.getActiveRecommendChildList(); //活动所送推荐人的优惠券
if(CollectionUtils.isNotEmpty(activeRecommendChildList)){ List<ActiveRecommendChild> activeRecommendChildList = activeRecommendVO.getActiveRecommendChildList();
for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) { if(CollectionUtils.isNotEmpty(activeRecommendChildList)){
if (activeRecommendChild.getActiveGift().equals("1")){ for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) {
//券数量 if (activeRecommendChild.getActiveGift().equals("1")){
Integer giftCardTotal = activeRecommendChild.getGiftCardTotal(); //券数量
//券id Integer giftCardTotal = activeRecommendChild.getGiftCardTotal();
Integer vouchersId = activeRecommendChild.getVouchersId(); //券id
//券总额 Integer vouchersId = activeRecommendChild.getVouchersId();
discountAmount += (cardFavorableService.getById(vouchersId).getDiscountAmount() * giftCardTotal * size); //券总额
discountAmount += (cardFavorableService.getById(vouchersId).getDiscountAmount() * giftCardTotal * size);
}
} }
} }
} }
} }
return discountAmount; return discountAmount;
} }
@ -162,67 +165,70 @@ public class ActiveRecommendRecordsServiceImpl extends ServiceImpl<ActiveRecomme
LJUser ljUser = ljUserService.queryUserByUserId(userId); LJUser ljUser = ljUserService.queryUserByUserId(userId);
ActiveConsumption activeConsumption = new ActiveConsumption(); ActiveConsumption activeConsumption = new ActiveConsumption();
activeConsumption.setStoreId(activeRecommendRecordsDTO.getStoreId()); activeConsumption.setStoreId(activeRecommendRecordsDTO.getStoreId());
ActiveRecommendVO activeRecommendVO = activeRecommendService.getOneByIdApplet(activeConsumption); List<ActiveRecommendVO> oneByIdApplet = activeRecommendService.getOneByIdApplet(activeConsumption);
UserBalance userBalance = userBalanceService.selectUserBalance(Integer.parseInt(activeRecommendRecordsDTO.getUserId()),iljStoreService.selectStoreByStoreId(activeRecommendRecordsDTO.getStoreId()).getChainStoreId()); for (ActiveRecommendVO activeRecommendVO : oneByIdApplet) {
//积分 UserBalance userBalance = userBalanceService.selectUserBalance(Integer.parseInt(activeRecommendRecordsDTO.getUserId()),iljStoreService.selectStoreByStoreId(activeRecommendRecordsDTO.getStoreId()).getChainStoreId());
if (ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){ //积分
userBalance.setPoints(userBalance.getPoints() + activeRecommendVO.getPoints()); if (ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){
} userBalance.setPoints(userBalance.getPoints() + activeRecommendVO.getPoints());
//成长值 }
if (ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){ //成长值
userBalance.setGrowthValue(userBalance.getGrowthValue() + activeRecommendVO.getGrowthValue()); if (ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){
} userBalance.setGrowthValue(userBalance.getGrowthValue() + activeRecommendVO.getGrowthValue());
//卡券 }
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendVO.getActiveRecommendChildList(); //卡券
if(CollectionUtils.isNotEmpty(activeRecommendChildList)){ List<ActiveRecommendChild> activeRecommendChildList = activeRecommendVO.getActiveRecommendChildList();
for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) { if(CollectionUtils.isNotEmpty(activeRecommendChildList)){
//优惠券 for (ActiveRecommendChild activeRecommendChild : activeRecommendChildList) {
if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("1")){ //优惠券
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("1")){
cardFavorableRecord.setCardFavorableId(activeRecommendChild.getVouchersId()); CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setStoreId(activeRecommendRecordsDTO.getStoreId()); cardFavorableRecord.setCardFavorableId(activeRecommendChild.getVouchersId());
cardFavorableRecord.setMtUserId(ljUser1.getId()); cardFavorableRecord.setStoreId(activeRecommendRecordsDTO.getStoreId());
cardFavorableRecord.setName(ljUser1.getName()); cardFavorableRecord.setMtUserId(ljUser1.getId());
cardFavorableRecord.setMobile(ljUser1.getMobile()); cardFavorableRecord.setName(ljUser1.getName());
cardFavorableRecord.setStatus("0"); cardFavorableRecord.setMobile(ljUser1.getMobile());
cardFavorableRecord.setExchangeFrom("推荐有礼"); cardFavorableRecord.setStatus("0");
cardFavorableRecord.setActiveId(activeRecommendChild.getActiveRecommendId()); cardFavorableRecord.setExchangeFrom("推荐有礼");
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord); cardFavorableRecord.setActiveId(activeRecommendChild.getActiveRecommendId());
} cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
//兑换券 }
if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("2")){ //兑换券
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord(); if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("2")){
cardExchangeRecord.setCardExchangeId(activeRecommendChild.getVouchersId()); CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setStoreId(activeRecommendRecordsDTO.getStoreId()); cardExchangeRecord.setCardExchangeId(activeRecommendChild.getVouchersId());
cardExchangeRecord.setMtUserId(ljUser1.getId()); cardExchangeRecord.setStoreId(activeRecommendRecordsDTO.getStoreId());
cardExchangeRecord.setName(ljUser1.getName()); cardExchangeRecord.setMtUserId(ljUser1.getId());
cardExchangeRecord.setMobile(ljUser1.getMobile()); cardExchangeRecord.setName(ljUser1.getName());
cardExchangeRecord.setPhoto(ljUser1.getAvatar()); cardExchangeRecord.setMobile(ljUser1.getMobile());
cardExchangeRecord.setStatus("0"); cardExchangeRecord.setPhoto(ljUser1.getAvatar());
cardExchangeRecord.setExchangeFrom("推荐有礼"); cardExchangeRecord.setStatus("0");
cardExchangeRecord.setActiveId(activeRecommendChild.getActiveRecommendId()); cardExchangeRecord.setExchangeFrom("推荐有礼");
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord); cardExchangeRecord.setActiveId(activeRecommendChild.getActiveRecommendId());
} cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
//被邀请人优惠券 }
if (activeRecommendChild.getGiftUserType().equals("1") && activeRecommendChild.getActiveGift().equals("1")){ //被邀请人优惠券
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord(); if (activeRecommendChild.getGiftUserType().equals("1") && activeRecommendChild.getActiveGift().equals("1")){
cardFavorableRecord.setCardFavorableId(activeRecommendChild.getVouchersId()); CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setStoreId(activeRecommendRecordsDTO.getStoreId()); cardFavorableRecord.setCardFavorableId(activeRecommendChild.getVouchersId());
cardFavorableRecord.setMtUserId(ljUser.getId()); cardFavorableRecord.setStoreId(activeRecommendRecordsDTO.getStoreId());
cardFavorableRecord.setName(ljUser.getName()); cardFavorableRecord.setMtUserId(ljUser.getId());
cardFavorableRecord.setMobile(ljUser.getMobile()); cardFavorableRecord.setName(ljUser.getName());
cardFavorableRecord.setStatus("0"); cardFavorableRecord.setMobile(ljUser.getMobile());
cardFavorableRecord.setExchangeFrom("新人送券"); cardFavorableRecord.setStatus("0");
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord); cardFavorableRecord.setExchangeFrom("新人送券");
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
}
} }
} }
userBalanceService.updateById(userBalance);
//被邀请人
activeRecommendRecords.setInviteeUserId(userId.toString());
activeRecommendRecords.setInviteeUserName(ljUser.getName());
return save(activeRecommendRecords);
} }
userBalanceService.updateById(userBalance); }
//被邀请人
activeRecommendRecords.setInviteeUserId(userId.toString());
activeRecommendRecords.setInviteeUserName(ljUser.getName());
return save(activeRecommendRecords);
}
return false; return false;
} }
} }

View File

@ -221,35 +221,42 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
* @return * @return
*/ */
@Override @Override
public ActiveRecommendVO getOneByIdApplet(ActiveConsumption activeConsumption) { public List<ActiveRecommendVO> getOneByIdApplet(ActiveConsumption activeConsumption) {
Integer storeId = activeConsumption.getStoreId(); Integer storeId = activeConsumption.getStoreId();
ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO(); ArrayList<ActiveRecommendVO> arrayList = new ArrayList<>();
activeRecommendVO.setInviterGiftType(new String[0]);
if (ObjectUtils.isNotEmpty(storeId)){ if (ObjectUtils.isNotEmpty(storeId)){
//获取新人有礼活动信息 //获取新人有礼活动信息
LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ActiveRecommend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId); lambdaQueryWrapper.eq(ActiveRecommend::getStoreId,storeId);
ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper); List<ActiveRecommend> list = list(lambdaQueryWrapper);
//获取兑换物品信息 for (ActiveRecommend activeRecommend : list) {
if (ObjectUtils.isNotEmpty(activeRecommend)){ ActiveRecommendVO activeRecommendVO = new ActiveRecommendVO();
LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>(); activeRecommendVO.setInviterGiftType(new String[0]);
queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId());
queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime); if (ObjectUtils.isNotEmpty(activeRecommend)){
List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper); LambdaQueryWrapper<ActiveRecommendChild> queryWrapper = new LambdaQueryWrapper<>();
BeanUtils.copyProperties(activeRecommend,activeRecommendVO); queryWrapper.eq(ActiveRecommendChild::getActiveRecommendId,activeRecommend.getId());
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(",")); queryWrapper.orderByDesc(ActiveRecommendChild::getCreateTime);
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){ List<ActiveRecommendChild> activeRecommendChildList = activeRecommendChildService.list(queryWrapper);
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList); BeanUtils.copyProperties(activeRecommend,activeRecommendVO);
activeRecommendVO.setInviterGiftType(activeRecommend.getInviterGiftType().split(","));
if (CollectionUtils.isNotEmpty(activeRecommendChildList)){
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildList);
}else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
}
}else { }else {
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>(); ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren); activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
} }
}else { arrayList.add(activeRecommendVO);
ArrayList<ActiveRecommendChild> activeRecommendChildren = new ArrayList<>();
activeRecommendVO.setActiveRecommendChildList(activeRecommendChildren);
} }
//ActiveRecommend activeRecommend = getOne(lambdaQueryWrapper);
//获取兑换物品信息
} }
return activeRecommendVO; return arrayList;
} }
/** /**
@ -292,60 +299,66 @@ public class ActiveRecommendServiceImpl extends ServiceImpl<ActiveRecommendMappe
* @return * @return
*/ */
@Override @Override
public ActiveRecommendAppletVO selectApplet(ActiveConsumption activeConsumption) { public List<ActiveRecommendAppletVO> selectApplet(ActiveConsumption activeConsumption) {
ActiveRecommendAppletVO activeRecommendAppletVO = new ActiveRecommendAppletVO();
ArrayList<ActiveRecommendAppletVO> arrayList = new ArrayList<>();
//获取本店铺的推荐有礼活动 //获取本店铺的推荐有礼活动
ActiveRecommendVO activeRecommendVO = getOneByIdApplet(activeConsumption); List<ActiveRecommendVO> activeRecommendVOList = getOneByIdApplet(activeConsumption);
//邀请人获得 for (ActiveRecommendVO activeRecommendVO : activeRecommendVOList) {
if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){ ActiveRecommendAppletVO activeRecommendAppletVO = new ActiveRecommendAppletVO();
//积分 //邀请人获得
activeRecommendAppletVO.setPoint(activeRecommendVO.getPoints().toString()); if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){
} //积分
if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){ activeRecommendAppletVO.setPoint(activeRecommendVO.getPoints().toString());
//成长值 }
activeRecommendAppletVO.setGrowValue(activeRecommendVO.getGrowthValue().toString()); if (ObjectUtils.isNotEmpty(activeRecommendVO) && ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){
} //成长值
//邀请人赠送优惠券兑换券 activeRecommendAppletVO.setGrowValue(activeRecommendVO.getGrowthValue().toString());
String cardi1 = ""; }
String cardo1 = ""; //邀请人赠送优惠券兑换券
//被邀请人赠送优惠券 String cardi1 = "";
String cardi2 = ""; String cardo1 = "";
if (CollectionUtils.isNotEmpty(activeRecommendVO.getActiveRecommendChildList())){ //被邀请人赠送优惠券
for (ActiveRecommendChild activeRecommendChild : activeRecommendVO.getActiveRecommendChildList()) { String cardi2 = "";
if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("1")){ if (CollectionUtils.isNotEmpty(activeRecommendVO.getActiveRecommendChildList())){
//优惠券 for (ActiveRecommendChild activeRecommendChild : activeRecommendVO.getActiveRecommendChildList()) {
cardi1 += activeRecommendChild.getGiftCardName()+"的券("+activeRecommendChild.getGiftCardDetail()+");"; if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("1")){
}else if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("2")){ //优惠券
//兑换券 cardi1 += activeRecommendChild.getGiftCardName()+"的券("+activeRecommendChild.getGiftCardDetail()+");";
cardo1 += activeRecommendChild.getGiftCardName()+"的券;"; }else if (activeRecommendChild.getGiftUserType().equals("0") && activeRecommendChild.getActiveGift().equals("2")){
}else if (activeRecommendChild.getGiftUserType().equals("1") && activeRecommendChild.getActiveGift().equals("1")){ //兑换券
//优惠券 cardo1 += activeRecommendChild.getGiftCardName()+"的券;";
cardi2 += activeRecommendChild.getGiftCardName()+"的券("+activeRecommendChild.getGiftCardDetail()+");"; }else if (activeRecommendChild.getGiftUserType().equals("1") && activeRecommendChild.getActiveGift().equals("1")){
//优惠券
cardi2 += activeRecommendChild.getGiftCardName()+"的券("+activeRecommendChild.getGiftCardDetail()+");";
}
} }
} }
} //邀请人的券
//邀请人的券 //活动时间
//活动时间 activeRecommendAppletVO.setTime("永久有效");
activeRecommendAppletVO.setTime("永久有效"); //积分
//积分 if (ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){
if (ObjectUtils.isNotEmpty(activeRecommendVO.getPoints())){ activeRecommendAppletVO.setPoint(activeRecommendVO.getPoints().toString());
activeRecommendAppletVO.setPoint(activeRecommendVO.getPoints().toString()); }
} //成长值
//成长值 if (ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){
if (ObjectUtils.isNotEmpty(activeRecommendVO.getGrowthValue())){ activeRecommendAppletVO.setGrowValue(activeRecommendVO.getGrowthValue().toString());
activeRecommendAppletVO.setGrowValue(activeRecommendVO.getGrowthValue().toString()); }
activeRecommendAppletVO.setRecommendActiveDescribeIn("欢迎各位亲朋好友来参加本店的推荐有礼活动,对于邀请人,参加即送:优惠券:"+cardi1+"兑换券:"+cardo1);
//被邀请人的券
activeRecommendAppletVO.setRecommendActiveDescribeOut("对于被邀请人,参加即送:优惠券:"+cardi2);
if (ObjectUtils.isEmpty(cardi1)){
activeRecommendAppletVO.setRecommendActiveDescribeIn("");
}
if (ObjectUtils.isEmpty(cardi2)){
activeRecommendAppletVO.setRecommendActiveDescribeOut("");
}
arrayList.add(activeRecommendAppletVO);
} }
activeRecommendAppletVO.setRecommendActiveDescribeIn("欢迎各位亲朋好友来参加本店的推荐有礼活动,对于邀请人,参加即送:优惠券:"+cardi1+"兑换券:"+cardo1); return arrayList;
//被邀请人的券
activeRecommendAppletVO.setRecommendActiveDescribeOut("对于被邀请人,参加即送:优惠券:"+cardi2);
if (ObjectUtils.isEmpty(cardi1)){
activeRecommendAppletVO.setRecommendActiveDescribeIn("");
}
if (ObjectUtils.isEmpty(cardi2)){
activeRecommendAppletVO.setRecommendActiveDescribeOut("");
}
return activeRecommendAppletVO;
} }
@Override @Override

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel; import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
import com.fuint.business.marketingActivity.cardFule.vo.CardFuelDieselVO;
import java.util.List; import java.util.List;
@ -26,5 +27,6 @@ public interface CardFuelDieselService extends IService<CardFuelDiesel> {
IPage select(Page page, CardFuelDiesel cardFuelDiesel); IPage select(Page page, CardFuelDiesel cardFuelDiesel);
IPage selectAllApplet(Page page, CardFuelDiesel cardFuelDiesel); IPage selectAllApplet(Page page, CardFuelDiesel cardFuelDiesel);
List<CardFuelDieselVO> selectAllAppletByStorId(CardFuelDiesel cardFuelDiesel);
} }

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelDieselMapper; import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelDieselMapper;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel; import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService; import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
import com.fuint.business.marketingActivity.cardFule.vo.CardFuelDieselVO;
import com.fuint.business.petrolStationManagement.entity.OilName; import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.entity.OilNumber; import com.fuint.business.petrolStationManagement.entity.OilNumber;
import com.fuint.business.petrolStationManagement.service.OilNameService; import com.fuint.business.petrolStationManagement.service.OilNameService;
@ -18,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -149,5 +151,43 @@ public class CardFuelDieselServiceImpl extends ServiceImpl<CardFuelDieselMapper,
page1.setRecords(cardFuelDiesels); page1.setRecords(cardFuelDiesels);
return page1; return page1;
} }
@Override
public List<CardFuelDieselVO> selectAllAppletByStorId(CardFuelDiesel cardFuelDiesel) {
ArrayList<CardFuelDieselVO> arrayList = new ArrayList<>();
LambdaQueryWrapper<CardFuelDiesel> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardFuelDiesel::getStoreId, cardFuelDiesel.getStoreId());
List<CardFuelDiesel> list = list(queryWrapper);
for (CardFuelDiesel fuelDiesel : list) {
CardFuelDieselVO cardFuelDieselVO = new CardFuelDieselVO();
//油品名称
String type = fuelDiesel.getType();
String oilType = fuelDiesel.getOilType();
OilName oilName1 = oilNameService.selectOilNameById(Integer.parseInt(oilType));
String oilName = oilName1.getOilName();
cardFuelDieselVO.setOilName(type+"-"+oilName);
//时间
String startFormat= "";
String endFormat = "";
if (fuelDiesel.getActiveTime().equals("1")){
cardFuelDieselVO.setTime("不限时间!");
//描述
cardFuelDieselVO.setDiscountActiveDescribe("本充值活动,充值满"+
fuelDiesel.getRechargeBalance()+"元可以参加,所参与油品类型为:"+cardFuelDieselVO.getOilName()+",锁价单价为:"+
fuelDiesel.getLockupPrice()+"元/L总升数为"+fuelDiesel.getIncomeLitres()+"L活动时间为不限时间!");
}else {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
startFormat = simpleDateFormat.format(fuelDiesel.getStartTime());
endFormat = simpleDateFormat.format(fuelDiesel.getEndTime());
cardFuelDieselVO.setTime(startFormat+"-"+endFormat);
//描述
cardFuelDieselVO.setDiscountActiveDescribe("本充值活动,充值满"+
fuelDiesel.getRechargeBalance()+"元可以参加,所参与油品类型为:"+cardFuelDieselVO.getOilName()+",锁价单价为:"+
fuelDiesel.getLockupPrice()+"元/L总升数为"+fuelDiesel.getIncomeLitres()+"L活动时间为"+startFormat+"-"+endFormat);
}
arrayList.add(cardFuelDieselVO);
}
return arrayList;
}
} }