bug
This commit is contained in:
parent
7f990d9b34
commit
8e6cb5413b
@ -33,4 +33,10 @@ public class ActiveDiscountPayVO implements Serializable {
|
||||
private BigDecimal cardFavorableAmount;
|
||||
//优惠券信息
|
||||
private String cardFavorableInfo;
|
||||
//会员日类型 1:周 2:月
|
||||
private String memberDayType;
|
||||
//每周的会员日
|
||||
private String weekDay;
|
||||
//每月的会员日
|
||||
private String monthDay;
|
||||
}
|
||||
|
@ -81,6 +81,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.TextStyle;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@ -133,8 +136,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
private ActiveConsumptionChildService activeConsumptionChildService;
|
||||
@Resource
|
||||
private CardFuelDieselService cardFuelDieselService;
|
||||
|
||||
/**
|
||||
* 分页查询所有
|
||||
*
|
||||
* @param
|
||||
* @param cardExchangeRecord
|
||||
* @return
|
||||
@ -203,6 +208,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
|
||||
/**
|
||||
* 核销卡券
|
||||
*
|
||||
* @param activeExchangeRecordDTO
|
||||
* @return
|
||||
*/
|
||||
@ -226,6 +232,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
|
||||
/**
|
||||
* 查询满减活动
|
||||
*
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param transferDTO
|
||||
@ -342,8 +349,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
}
|
||||
return exchangeFavorableVOArrayList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询所有数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@ -463,6 +472,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
|
||||
/**
|
||||
* 优惠活动接口
|
||||
*
|
||||
* @param paymentActiveDTO
|
||||
* @return
|
||||
*/
|
||||
@ -472,8 +482,25 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
Integer storeId = paymentActiveDTO.getStoreId();
|
||||
double finalAmount = 0.00;
|
||||
Integer userId = TokenUtil.getNowAccountInfo().getId();
|
||||
//获取今日是周几
|
||||
DayOfWeek dayOfWeek = LocalDate.now().getDayOfWeek();
|
||||
String displayName = dayOfWeek.getDisplayName(TextStyle.FULL, Locale.getDefault());
|
||||
|
||||
//折扣有限制
|
||||
List<ActiveDiscountPayVO> activeDiscountVOList = oilOrderMapper.selectActiveDiscount(storeId, paymentActiveDTO.getAmount(), paymentActiveDTO.getOilId(), paymentActiveDTO.getMtUserLevel());
|
||||
for (ActiveDiscountPayVO activeDiscountPayVO : activeDiscountVOList) {
|
||||
//周
|
||||
if (activeDiscountPayVO.getMemberDayType().equals("1")) {
|
||||
String weekDay = activeDiscountPayVO.getWeekDay();
|
||||
if (weekDay.contains(displayName)) {
|
||||
} else if (activeDiscountPayVO.getMemberDayType().equals("2")) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
//月
|
||||
}
|
||||
}
|
||||
//折扣无限制
|
||||
List<ActiveDiscountPayVO> activeDiscountVOLists = oilOrderMapper.selectActiveDiscounts(storeId, paymentActiveDTO.getAmount(), paymentActiveDTO.getOilId(), paymentActiveDTO.getMtUserLevel());
|
||||
activeDiscountVOList.addAll(activeDiscountVOLists);
|
||||
|
@ -41,7 +41,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
|
||||
* @return
|
||||
*/
|
||||
ActiveNewlywedsVO getOneById(Serializable id);
|
||||
ActiveNewlywedsVO getOneByStoreId(Serializable id);
|
||||
List<ActiveNewlywedsVO> getOneByStoreId(Serializable id);
|
||||
List<ActiveNewlywedsVO> getOneByIdApplet(ActiveConsumption activeConsumption);
|
||||
|
||||
/**
|
||||
|
@ -62,7 +62,8 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
|
||||
Integer userId = nowAccountInfo.getId();
|
||||
LJUserVo ljUserVo = userService.selectUserById(userId,activeNewlywedsRecords.getStoreId());
|
||||
//保存新人有礼记录
|
||||
ActiveNewlywedsVO activeNewlyweds = activeNewlywedsService.getOneByStoreId(activeNewlywedsRecords.getStoreId());
|
||||
List<ActiveNewlywedsVO> activeNewlywedsVOList = activeNewlywedsService.getOneByStoreId(activeNewlywedsRecords.getStoreId());
|
||||
for (ActiveNewlywedsVO activeNewlyweds : activeNewlywedsVOList) {
|
||||
activeNewlywedsRecords.setActiveNewlywedsId(activeNewlyweds.getId());
|
||||
activeNewlywedsRecords.setChainStoreId(nowAccountInfo.getChainStoreId());
|
||||
activeNewlywedsRecords.setStoreId(nowAccountInfo.getStoreId());
|
||||
@ -110,6 +111,8 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
|
||||
}
|
||||
userBalanceService.updateUserBalance(userBalance);
|
||||
}
|
||||
}
|
||||
|
||||
return save;
|
||||
}
|
||||
}
|
||||
|
@ -358,14 +358,18 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ActiveNewlywedsVO getOneByStoreId(Serializable id) {
|
||||
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
|
||||
activeNewlywedsVO.setCourtesyReward(new String[0]);
|
||||
public List<ActiveNewlywedsVO> getOneByStoreId(Serializable id) {
|
||||
|
||||
ArrayList<ActiveNewlywedsVO> arrayList = new ArrayList<>();
|
||||
if (ObjectUtils.isNotEmpty(id)){
|
||||
//获取新人有礼活动信息
|
||||
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,id);
|
||||
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
|
||||
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,id).eq(ActiveNewlyweds::getIsonline,0);
|
||||
//ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
|
||||
List<ActiveNewlyweds> newlywedsList = list(lambdaQueryWrapper);
|
||||
for (ActiveNewlyweds activeNewlyweds : newlywedsList) {
|
||||
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
|
||||
activeNewlywedsVO.setCourtesyReward(new String[0]);
|
||||
//获取兑换物品信息
|
||||
if (ObjectUtils.isNotEmpty(activeNewlyweds)){
|
||||
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
|
||||
@ -385,8 +389,10 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
|
||||
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
|
||||
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
|
||||
}
|
||||
arrayList.add(activeNewlywedsVO);
|
||||
}
|
||||
return activeNewlywedsVO;
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -130,6 +130,9 @@ public class CardExchangeRecordController extends BaseController {
|
||||
CardExchangeRecord byId = cardExchangeRecordService.getById(cardExchangeRecord.getId());
|
||||
Integer cardExchangeId = byId.getCardExchangeId();
|
||||
CardExchange cardExchange = cardExchangeService.getById(cardExchangeId);
|
||||
if (cardExchange.getType().equals("1")){
|
||||
return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord));
|
||||
}
|
||||
Integer giftId = cardExchange.getGiftId();
|
||||
LJOrder ljOrder = new LJOrder();
|
||||
ljOrder.setTerminal("pc");
|
||||
|
@ -118,9 +118,7 @@
|
||||
WHERE
|
||||
cer.mt_user_id = #{cardFavorableDTOS.id}
|
||||
and ce.type = 0
|
||||
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''">
|
||||
and cer.status = #{cardFavorableDTOS.useStatus}
|
||||
</if>
|
||||
and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL
|
||||
SELECT
|
||||
'洗车券' AS couponType,
|
||||
@ -132,9 +130,7 @@
|
||||
WHERE
|
||||
cer.mt_user_id = #{cardFavorableDTOS.id}
|
||||
and ce.type = 1
|
||||
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''">
|
||||
and cer.status = #{cardFavorableDTOS.useStatus}
|
||||
</if>
|
||||
and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL
|
||||
SELECT
|
||||
'洗车卡' AS couponType,
|
||||
|
Loading…
Reference in New Issue
Block a user