This commit is contained in:
wangh 2024-05-08 09:03:56 +08:00
commit 73edd03038
29 changed files with 132 additions and 61 deletions

View File

@ -630,7 +630,7 @@ export default {
this.opendetails = true this.opendetails = true
let data = { let data = {
id:row.id, id:row.id,
exchangeFrom:"店铺一键送券" exchangeFrom:"店铺一键送券"
} }
await looklook(data).then(res=>{ await looklook(data).then(res=>{
if(res.data){ if(res.data){

View File

@ -338,6 +338,15 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
private void countPoints(IntegralSettings integralSettings,String oilId,Double amount,Integer userId){ private void countPoints(IntegralSettings integralSettings,String oilId,Double amount,Integer userId){
LJStore store = iljStoreService.selectStoreByStoreId(integralSettings.getStoreId()); LJStore store = iljStoreService.selectStoreByStoreId(integralSettings.getStoreId());
UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId()); UserBalance balance = userBalanceService.selectUserBalance(userId, store.getChainStoreId());
IntegralDetail integralDetail = new IntegralDetail();
integralDetail.setStoreId(integralSettings.getStoreId());
integralDetail.setChainStoreId(integralSettings.getChainStoreId());
integralDetail.setPointsChange(Double.valueOf(integralSettings.getRefuelPoints()));
integralDetail.setCurrentPoints(balance.getPoints() + integralSettings.getRefuelPoints());
integralDetail.setChangeType("1");
integralDetail.setChangeReason("充值");
integralDetail.setUserId(balance.getMtUserId());
IntegralDetail integralDetail1 = integralDetailService.insert2(integralDetail);
if (ObjectUtil.isNotEmpty(balance)) { if (ObjectUtil.isNotEmpty(balance)) {
if (integralSettings.getRefuelSceneRules()==0) { if (integralSettings.getRefuelSceneRules()==0) {
// 通用规则 // 通用规则
@ -361,6 +370,7 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
} }
} }
userBalanceService.updateUserBalance(balance); userBalanceService.updateUserBalance(balance);
} }
} }

View File

@ -20,7 +20,7 @@ public interface ActiveConsumptionChildService extends IService<ActiveConsumptio
List<ActiveConsumptionChild> selectList(Serializable id); List<ActiveConsumptionChild> selectList(Serializable id);
List<CardFavorableRecord> detailRecord(ActiveConsumption activeConsumption); List<Object> detailRecord(ActiveConsumption activeConsumption);
CardFavorableCountVO detailCount(Serializable id); CardFavorableCountVO detailCount(Serializable id);
} }

View File

@ -18,6 +18,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -41,19 +43,45 @@ public class ActiveConsumptionChildServiceImpl extends ServiceImpl<ActiveConsump
} }
@Override @Override
public List<CardFavorableRecord> detailRecord(ActiveConsumption activeConsumption) { public List<Object> detailRecord(ActiveConsumption activeConsumption) {
ArrayList<Object> objects = new ArrayList<>();
// 查询优惠券领取记录 // 查询优惠券领取记录
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardFavorableRecord::getActiveId, activeConsumption.getId()); queryWrapper.eq(CardFavorableRecord::getActiveId, activeConsumption.getId());
queryWrapper.eq(CardFavorableRecord::getExchangeFrom, activeConsumption.getExchangeFrom()); queryWrapper.like(CardFavorableRecord::getExchangeFrom, activeConsumption.getExchangeFrom());
queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId());
if (ObjectUtils.isNotEmpty(activeConsumption.getActiveStartTime()) && ObjectUtils.isNotEmpty(activeConsumption.getActiveEndTime())){ if (ObjectUtils.isNotEmpty(activeConsumption.getActiveStartTime()) && ObjectUtils.isNotEmpty(activeConsumption.getActiveEndTime())){
queryWrapper.between(CardFavorableRecord::getCreateTime, activeConsumption.getActiveStartTime(), activeConsumption.getActiveEndTime()); queryWrapper.between(CardFavorableRecord::getCreateTime, activeConsumption.getActiveStartTime(), activeConsumption.getActiveEndTime());
} }
queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId()); queryWrapper.eq(CardFavorableRecord::getStoreId, nowAccountInfo.getStoreId());
List<CardFavorableRecord> favorableRecords = cardFavorableRecordService.list(queryWrapper); List<CardFavorableRecord> favorableRecords = cardFavorableRecordService.list(queryWrapper);
return favorableRecords;
for (CardFavorableRecord favorableRecord : favorableRecords) {
HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("name",favorableRecord.getName());
objectObjectHashMap.put("mobile",favorableRecord.getMobile());
objectObjectHashMap.put("createTime",favorableRecord.getCreateTime());
objectObjectHashMap.put("exchangeFrom",favorableRecord.getExchangeFrom());
objects.add(objectObjectHashMap);
}
LambdaQueryWrapper<CardExchangeRecord> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(CardExchangeRecord::getActiveId, activeConsumption.getId());
queryWrapper1.like(CardExchangeRecord::getExchangeFrom, activeConsumption.getExchangeFrom());
if (ObjectUtils.isNotEmpty(activeConsumption.getActiveStartTime()) && ObjectUtils.isNotEmpty(activeConsumption.getActiveEndTime())){
queryWrapper1.between(CardExchangeRecord::getCreateTime, activeConsumption.getActiveStartTime(), activeConsumption.getActiveEndTime());
}
queryWrapper1.eq(CardExchangeRecord::getStoreId, nowAccountInfo.getStoreId());
List<CardExchangeRecord> record1 = cardExchangeRecordService.list(queryWrapper1);
for (CardExchangeRecord cardExchangeRecord : record1) {
HashMap<Object, Object> objectObjectHashMap1 = new HashMap<>();
objectObjectHashMap1.put("name",cardExchangeRecord.getName());
objectObjectHashMap1.put("mobile",cardExchangeRecord.getMobile());
objectObjectHashMap1.put("createTime",cardExchangeRecord.getCreateTime());
objectObjectHashMap1.put("exchangeFrom",cardExchangeRecord.getExchangeFrom());
objects.add(objectObjectHashMap1);
}
return objects;
} }
@Override @Override

View File

@ -982,7 +982,6 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
paymentActiveVO.setMemberFavorableAmount(bigDecimal2); paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
} }
} }
} }
if (oilTypebyId.equals("天然气")) { if (oilTypebyId.equals("天然气")) {
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) { if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
@ -1086,7 +1085,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
@Override @Override
public void activeConsumption (PaymentActiveDTO paymentActiveDTO) throws Exception { public void activeConsumption (PaymentActiveDTO paymentActiveDTO) throws Exception {
//消费有礼 //消费有礼
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); // AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
ArrayList<ActiveConsumptionVO> activeConsumptionVOS1 = new ArrayList<>(); ArrayList<ActiveConsumptionVO> activeConsumptionVOS1 = new ArrayList<>();
List<ActiveConsumptionVO> activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(paymentActiveDTO.getStoreId(), paymentActiveDTO.getOrderAmount()); List<ActiveConsumptionVO> activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(paymentActiveDTO.getStoreId(), paymentActiveDTO.getOrderAmount());
if (CollectionUtils.isNotEmpty(activeConsumptionVOS)) { if (CollectionUtils.isNotEmpty(activeConsumptionVOS)) {
@ -1100,7 +1099,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
if (ObjectUtils.isNotEmpty(paymentActiveDTO.getUserId())){ if (ObjectUtils.isNotEmpty(paymentActiveDTO.getUserId())){
queryWrapper.eq(ActiveConsumptionRecord::getUserId,paymentActiveDTO.getUserId()); queryWrapper.eq(ActiveConsumptionRecord::getUserId,paymentActiveDTO.getUserId());
}else { }else {
queryWrapper.eq(ActiveConsumptionRecord::getUserId,nowAccountInfo.getId()); queryWrapper.eq(ActiveConsumptionRecord::getUserId,paymentActiveDTO.getUserId());
} }
List<ActiveConsumptionRecord> list = activeConsumptionRecordService.list(queryWrapper); List<ActiveConsumptionRecord> list = activeConsumptionRecordService.list(queryWrapper);
@ -1112,7 +1111,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
if (ObjectUtils.isNotEmpty(paymentActiveDTO.getUserId())){ if (ObjectUtils.isNotEmpty(paymentActiveDTO.getUserId())){
activeConsumptionRecord.setUserId(paymentActiveDTO.getUserId()); activeConsumptionRecord.setUserId(paymentActiveDTO.getUserId());
}else { }else {
activeConsumptionRecord.setUserId(nowAccountInfo.getId()); activeConsumptionRecord.setUserId(paymentActiveDTO.getUserId());
} }
activeConsumptionRecord.setStoreId(paymentActiveDTO.getStoreId()); activeConsumptionRecord.setStoreId(paymentActiveDTO.getStoreId());
activeConsumptionRecordService.save(activeConsumptionRecord); activeConsumptionRecordService.save(activeConsumptionRecord);

View File

@ -159,7 +159,7 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
//优惠券 //优惠券
LambdaQueryWrapper<CardFavorableRecord> queryWrapper1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CardFavorableRecord> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(CardFavorableRecord::getExchangeFrom, "店铺一键送券"); queryWrapper1.eq(CardFavorableRecord::getExchangeFrom, "店铺一键送券");
queryWrapper1.eq(CardFavorableRecord::getActiveId, record.getId()); queryWrapper1.eq(CardFavorableRecord::getActiveId, record.getId());
queryWrapper1.eq(CardFavorableRecord::getStoreId, record.getStoreId()); queryWrapper1.eq(CardFavorableRecord::getStoreId, record.getStoreId());
List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper1); List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper1);
@ -170,7 +170,7 @@ public class ActiveOneCouponServiceImpl extends ServiceImpl<ActiveOneCouponMappe
//兑换券 //兑换券
LambdaQueryWrapper<CardExchangeRecord> queryWrapper2 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CardExchangeRecord> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(CardExchangeRecord::getExchangeFrom, "店铺一键送券"); queryWrapper2.eq(CardExchangeRecord::getExchangeFrom, "店铺一键送券");
queryWrapper2.eq(CardExchangeRecord::getActiveId, record.getId()); queryWrapper2.eq(CardExchangeRecord::getActiveId, record.getId());
queryWrapper2.eq(CardExchangeRecord::getStoreId, record.getStoreId()); queryWrapper2.eq(CardExchangeRecord::getStoreId, record.getStoreId());
List<CardExchangeRecord> list2 = cardExchangeRecordService.list(queryWrapper2); List<CardExchangeRecord> list2 = cardExchangeRecordService.list(queryWrapper2);

View File

@ -139,13 +139,13 @@ public class CardExchangeRecordController extends BaseController {
ljOrder.setPayUser(byId.getMobile()); ljOrder.setPayUser(byId.getMobile());
ljOrder.setStoreId(nowAccountInfo.getStoreId()); ljOrder.setStoreId(nowAccountInfo.getStoreId());
ljOrder.setUserId(byId.getMtUserId()); ljOrder.setUserId(byId.getMtUserId());
ljOrder.setGoodsNum(1); ljOrder.setGoodsNum(byId.getProductCount());
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); stockStatisticService.insertStockStatisticTrack(giftId,0.0,"核销兑换!",byId.getProductCount());
return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord)); return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord));
} }

View File

@ -30,6 +30,7 @@ public class CardExchangeRecord extends Model<CardExchangeRecord> {
private Integer chainStorId; private Integer chainStorId;
//所属店铺id //所属店铺id
private Integer storeId; private Integer storeId;
private Integer productCount;
//员工id //员工id
private Integer mtStaffId; private Integer mtStaffId;
//员工姓名 //员工姓名

View File

@ -126,6 +126,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
CardExchange cardExchange = cardExchangeService.getById(cardExchangeRecord.getCardExchangeId()); CardExchange cardExchange = cardExchangeService.getById(cardExchangeRecord.getCardExchangeId());
if (ObjectUtils.isNotEmpty(cardExchange)){ if (ObjectUtils.isNotEmpty(cardExchange)){
cardExchangeRecord.setExchangeName(cardExchange.getName()); cardExchangeRecord.setExchangeName(cardExchange.getName());
cardExchangeRecord.setProductCount(cardExchange.getProductCount());
cardExchangeRecord.setGiftName(cardExchange.getGiftName()); cardExchangeRecord.setGiftName(cardExchange.getGiftName());
cardExchangeRecord.setDescription(cardExchange.getUseInstructions()); cardExchangeRecord.setDescription(cardExchange.getUseInstructions());
cardExchangeRecord.setStartTime(new Date()); cardExchangeRecord.setStartTime(new Date());

View File

@ -106,12 +106,7 @@
LEFT JOIN card_favorable_record cfr ON cf.id = cfr.card_favorable_id LEFT JOIN card_favorable_record cfr ON cf.id = cfr.card_favorable_id
WHERE WHERE
cfr.mt_user_id = #{cardFavorableDTOS.id} cfr.mt_user_id = #{cardFavorableDTOS.id}
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''">
and cfr.status = #{cardFavorableDTOS.useStatus} and cfr.status = #{cardFavorableDTOS.useStatus}
</if>
<if test="cardFavorableDTOS.useStatus == 0">
and cfr.status = #{cardFavorableDTOS.useStatus}
</if>
and cfr.store_id = #{cardFavorableDTOS.storeId} and cfr.store_id = #{cardFavorableDTOS.storeId}
and cf.type != 1 UNION ALL and cf.type != 1 UNION ALL
SELECT SELECT
@ -123,11 +118,12 @@
LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id LEFT JOIN card_exchange ce ON cer.card_exchange_id = ce.id
WHERE WHERE
cer.mt_user_id = #{cardFavorableDTOS.id} cer.mt_user_id = #{cardFavorableDTOS.id}
<if test="cardFavorableDTOS.useStatus != null">
and cer.status = #{cardFavorableDTOS.useStatus}
</if>
and cer.store_id = #{cardFavorableDTOS.storeId}
and ce.type = 0 or cer.mt_user_id = #{cardFavorableDTOS.id} and ce.type = 1 and ce.type = 0 or cer.mt_user_id = #{cardFavorableDTOS.id} and ce.type = 1
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''"> <if test="cardFavorableDTOS.useStatus != null">
and cer.status = #{cardFavorableDTOS.useStatus}
</if>
<if test="cardFavorableDTOS.useStatus == 0">
and cer.status = #{cardFavorableDTOS.useStatus} and cer.status = #{cardFavorableDTOS.useStatus}
</if> </if>
and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL and cer.store_id = #{cardFavorableDTOS.storeId} UNION ALL
@ -141,12 +137,7 @@
WHERE WHERE
cer.mt_user_id = #{cardFavorableDTOS.id} cer.mt_user_id = #{cardFavorableDTOS.id}
and ce.type = 1 and ce.type = 1
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''"> and cer.status = #{cardFavorableDTOS.useStatus}
and cer.status = #{cardFavorableDTOS.useStatus}
</if>
<if test="cardFavorableDTOS.useStatus == 0">
and cer.status = #{cardFavorableDTOS.useStatus}
</if>
and cer.store_id = #{cardFavorableDTOS.storeId} and cer.store_id = #{cardFavorableDTOS.storeId}
<if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''"> <if test="cardFavorableDTOS.useStatus!=null and cardFavorableDTOS.useStatus != ''">
and cer.status = #{cardFavorableDTOS.useStatus} and cer.status = #{cardFavorableDTOS.useStatus}

View File

@ -443,7 +443,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
cardFavorableRecord.setMobile(userInfo.getMobile()); cardFavorableRecord.setMobile(userInfo.getMobile());
cardFavorableRecord.setMtUserId(userInfo.getId()); cardFavorableRecord.setMtUserId(userInfo.getId());
cardFavorableRecord.setStatus("0"); cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("店铺一键送券"); cardFavorableRecord.setExchangeFrom("店铺一键送券");
flag = addCardFavorableRecord(cardFavorableRecord); flag = addCardFavorableRecord(cardFavorableRecord);
} }
} }
@ -475,7 +475,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
cardExchangeRecord.setMobile(ljUserVo.getMobile()); cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar()); cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setStatus("0"); cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("店铺一键送券"); cardExchangeRecord.setExchangeFrom("店铺一键送券");
flag = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord); flag = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
} }
} }

View File

@ -326,7 +326,7 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
if (record.getCouponType().equals("优惠券")){ if (record.getCouponType().equals("优惠券")){
record.setCouponContent(""+record.getSatisfiedAmount()+""+record.getCouponAmount()+""); record.setCouponContent(""+record.getSatisfiedAmount()+""+record.getCouponAmount()+"");
}else { }else {
record.setCouponContent("可兑换:"+record.getCouponContent()); record.setCouponContent("可兑换:"+record.getSatisfiedAmount());
} }
} }
//有效期 //有效期
@ -350,6 +350,11 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
cardFavorableDTOS.setStoreId(nowAccountInfo.getStoreId()); cardFavorableDTOS.setStoreId(nowAccountInfo.getStoreId());
IPage<CouponVO> couponVOS = cardFavorableRecordMapper.selectAllByCondition(page,cardFavorableDTOS); IPage<CouponVO> couponVOS = cardFavorableRecordMapper.selectAllByCondition(page,cardFavorableDTOS);
List<CouponVO> records = couponVOS.getRecords(); List<CouponVO> records = couponVOS.getRecords();
for (CouponVO record : records) {
if (record.getCouponType().equals("兑换券")){
record.setCouponContent(record.getSatisfiedAmount());
}
}
//有效期 //有效期
List<CouponVO> collect = records.stream().filter(s -> s.getEndTime().getTime() < System.currentTimeMillis()).collect(Collectors.toList()); List<CouponVO> collect = records.stream().filter(s -> s.getEndTime().getTime() < System.currentTimeMillis()).collect(Collectors.toList());
if (ObjectUtils.isNotEmpty(collect)){ if (ObjectUtils.isNotEmpty(collect)){

View File

@ -92,6 +92,8 @@ public class OilOrder extends BaseEntity implements Serializable {
* 优惠金额 * 优惠金额
*/ */
private Double balanceAmount; private Double balanceAmount;
private Double levelAmount;
private Double activeAmount;
/** /**
* 优惠金额 * 优惠金额
*/ */

View File

@ -233,7 +233,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
// 优惠券 // 优惠券
if (ObjectUtil.isNotEmpty(oilOrderVo.getCouponId())) { if (ObjectUtil.isNotEmpty(oilOrderVo.getCouponId())) {
CardFavorableVO cardFavorableVO = cardFavorableService.selectOneById(oilOrderVo.getCouponId()); //CardFavorableVO cardFavorableVO = cardFavorableService.selectOneById(oilOrderVo.getCouponId());
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardFavorableRecord::getCardFavorableId, oilOrderVo.getCouponId());
queryWrapper.eq(CardFavorableRecord::getMtUserId, oilOrderVo.getUserId());
CardFavorableRecord cardFavorableVO = cardFavorableRecordService.getOne(queryWrapper);
oilOrderVo.setCouponAmount(cardFavorableVO.getDiscountAmount()); oilOrderVo.setCouponAmount(cardFavorableVO.getDiscountAmount());
} else { } else {
oilOrderVo.setCouponAmount(0.0); oilOrderVo.setCouponAmount(0.0);
@ -278,6 +282,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Double goodsActualPay = Double.valueOf(map.get("goodsActualPay")); Double goodsActualPay = Double.valueOf(map.get("goodsActualPay"));
// 找零金额 // 找零金额
Double seekZero = Double.valueOf(map.get("seekZero")); Double seekZero = Double.valueOf(map.get("seekZero"));
Double levelAmount = Double.valueOf(map.get("levelAmount"));
Double activeAmount = Double.valueOf(map.get("activeAmount"));
// 优惠券id // 优惠券id
Integer cardFavorableId = null; Integer cardFavorableId = null;
if (StringUtils.isNotEmpty(map.get("cardFavorableId"))){ if (StringUtils.isNotEmpty(map.get("cardFavorableId"))){
@ -442,6 +448,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,"1",orderNo); staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,"1",orderNo);
} }
order.setCouponId(recordId); order.setCouponId(recordId);
order.setActiveAmount(activeAmount);
order.setLevelAmount(levelAmount);
}else { }else {
order.setOrderType("子订单"); order.setOrderType("子订单");
order.setOrderAmount(amount); order.setOrderAmount(amount);
@ -1592,7 +1600,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}else {} }else {}
// 修改用户成长值 // 修改用户成长值
Integer consumeNum = balance.getConsumeNum(); Integer consumeNum = balance.getConsumeNum();
balance.setConsumeNum(consumeNum+1); // balance.setConsumeNum(consumeNum+1);
userBalanceService.updateUserBalance(balance); userBalanceService.updateUserBalance(balance);
this.insertGrowthValueChange(userid,storeId,addGrowthVal,growthAfter,orderNo); this.insertGrowthValueChange(userid,storeId,addGrowthVal,growthAfter,orderNo);

View File

@ -220,7 +220,7 @@ public class LJUserController extends BaseController {
*/ */
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
public ResponseObject remove(@PathVariable Integer id){ public ResponseObject remove(@PathVariable Integer id){
userService.deleteUserById(id); userService.deleteUserBy(id);
return getSuccessResult("操作成功"); return getSuccessResult("操作成功");
} }

View File

@ -114,7 +114,8 @@ public interface LJUserService extends IService<LJUser> {
* 根据id删除会员信息 * 根据id删除会员信息
* @param id * @param id
*/ */
public void deleteUserById(Integer id); public void deleteUserById(Integer id,Integer storeId);
public void deleteUserBy(Integer id);
/** /**
* 增加会员信息 * 增加会员信息

View File

@ -59,5 +59,5 @@ public interface MtInvitationService {
* 根据会员id和店铺id删除用户邀请注册信息 * 根据会员id和店铺id删除用户邀请注册信息
* @param userId * @param userId
*/ */
void deleteByUserIdAndeStoreId(Integer userId); void deleteByUserIdAndeStoreId(Integer userId,Integer storeId);
} }

View File

@ -22,7 +22,7 @@ public interface UserBalanceService extends IService<UserBalance> {
* 根据用户id和店铺id删除会员储值信息 * 根据用户id和店铺id删除会员储值信息
* @param userId * @param userId
*/ */
public void deleteUserBalanceByUserId(Integer userId); public void deleteUserBalanceByUserId(Integer userId,Integer storeId);
/** /**
* 根据用户id修改储值卡金额 * 根据用户id修改储值卡金额

View File

@ -291,15 +291,28 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
* @param id * @param id
*/ */
@Override @Override
public void deleteUserById(Integer id) { public void deleteUserById(Integer id,Integer storeId) {
balanceService.deleteUserBalanceByUserId(id); balanceService.deleteUserBalanceByUserId(id,storeId);
List<UserBalance> userBalances = balanceService.selectUserBalance(id); List<UserBalance> userBalances = balanceService.selectUserBalance(id);
if (userBalances.size()==0){ if (userBalances.size()==0){
baseMapper.deleteById(id); baseMapper.deleteById(id);
} }
invitationService.deleteByUserIdAndeStoreId(id); invitationService.deleteByUserIdAndeStoreId(id,storeId);
}
@Override
public void deleteUserBy(Integer id) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
balanceService.deleteUserBalanceByUserId(id,nowAccountInfo.getStoreId());
List<UserBalance> userBalances = balanceService.selectUserBalance(id);
if (userBalances.size()==0){
baseMapper.deleteById(id);
}
invitationService.deleteByUserIdAndeStoreId(id,nowAccountInfo.getStoreId());
} }
@Autowired @Autowired

View File

@ -89,11 +89,10 @@ public class MtInvitationServiceImpl implements MtInvitationService {
} }
@Override @Override
public void deleteByUserIdAndeStoreId(Integer userId) { public void deleteByUserIdAndeStoreId(Integer userId,Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("userId",userId); queryWrapper.eq("userId",userId);
queryWrapper.eq("storeId",nowAccountInfo.getStoreId()); queryWrapper.eq("storeId",storeId);
mtInvitationMapper.delete(queryWrapper); mtInvitationMapper.delete(queryWrapper);
} }
} }

View File

@ -46,9 +46,9 @@ public class UserBalanceServiceImpl extends ServiceImpl<UserBalanceMapper, UserB
} }
@Override @Override
public void deleteUserBalanceByUserId(Integer userId) { public void deleteUserBalanceByUserId(Integer userId,Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); /*AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();*/
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId()); LJStore store = storeService.selectStoreByStoreId(storeId);
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mt_user_id",userId); queryWrapper.eq("mt_user_id",userId);
queryWrapper.eq("chain_store_id",store.getChainStoreId()); queryWrapper.eq("chain_store_id",store.getChainStoreId());

View File

@ -0,0 +1,9 @@
package com.fuint.common.annotation;
import java.lang.annotation.*;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ExpirationCheck {
}

View File

@ -811,7 +811,7 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
} }
// 新增余额信息 // 新增余额信息
if (ObjectUtil.isNotEmpty(storeId) && storeId !="") { if (ObjectUtil.isNotEmpty(storeId) && !storeId.equals("")) {
createVaseInfo(mtUser, storeId, staffId, inviterId); createVaseInfo(mtUser, storeId, staffId, inviterId);
} }
@ -834,15 +834,15 @@ public class MemberServiceImpl extends ServiceImpl<MtUserMapper, MtUser> impleme
if (ObjectUtil.isNotEmpty(user)){ if (ObjectUtil.isNotEmpty(user)){
if (mtUserMobile.getId()!=user.getId()){ if (!mtUserMobile.getId().equals(user.getId())){
ljUserService.deleteUserById(user.getId()); ljUserService.deleteUserById(user.getId(),Integer.parseInt(storeId));
} }
} }
int i = baseMapper.updateById(mtUserMobile); int i = baseMapper.updateById(mtUserMobile);
// 新增余额信息 // 新增余额信息
if (ObjectUtil.isNotEmpty(storeId) && storeId !="") { if (ObjectUtil.isNotEmpty(storeId) && !storeId.equals("")) {
createVaseInfo(mtUserMobile,storeId,staffId,inviterId); createVaseInfo(mtUserMobile,storeId,staffId,inviterId);
} }

View File

@ -49,6 +49,7 @@ public class ShiroConfig {
filterMap.put("/excel/export","anon"); filterMap.put("/excel/export","anon");
//根据地理位置获取最近的店铺信息 //根据地理位置获取最近的店铺信息
filterMap.put("/business/storeInformation/store/recentlyStore","anon"); filterMap.put("/business/storeInformation/store/recentlyStore","anon");
filterMap.put("/business/storeInformation/store/isRecharge","anon");
//会员扫码进入小程序后根据id获取店铺信息 //会员扫码进入小程序后根据id获取店铺信息
filterMap.put("/business/storeInformation/store/queryStoreById","anon"); filterMap.put("/business/storeInformation/store/queryStoreById","anon");
filterMap.put("/backendApi/store/loginVerification","anon"); filterMap.put("/backendApi/store/loginVerification","anon");

View File

@ -121,7 +121,7 @@ public class TokenUtil {
if (accountInfo == null) { if (accountInfo == null) {
return; return;
} }
RedisUtil.set(Constants.SESSION_ADMIN_USER + accountInfo.getToken(), accountInfo, TOKEN_OVER_TIME); RedisUtil.set(Constants.SESSION_ADMIN_USER + accountInfo.getToken(), accountInfo);
} }
/** /**
@ -179,4 +179,4 @@ public class TokenUtil {
} }
throw new LoginEffectiveException("登录失效,请重新登录"); throw new LoginEffectiveException("登录失效,请重新登录");
} }
} }

View File

@ -83,7 +83,7 @@ public class AlipayController extends BaseController {
user.setUserId(userId); user.setUserId(userId);
if (ObjectUtil.isNotEmpty(user1)) { if (ObjectUtil.isNotEmpty(user1)) {
if (user1.getId()!=user.getId()){ if (user1.getId()!=user.getId()){
userService.deleteUserById(user1.getId()); userService.deleteUserById(user1.getId(),Integer.parseInt(storeId));
} }
} }
userService.updateById(user); userService.updateById(user);

View File

@ -195,6 +195,7 @@ public class BackendSourceController extends BaseController {
editSource.setSourceStyle(sort); editSource.setSourceStyle(sort);
editSource.setIsMenu(isMenu); editSource.setIsMenu(isMenu);
editSource.setSourceCode(editSource.getPath()); editSource.setSourceCode(editSource.getPath());
editSource.setMerchantId(Integer.valueOf(param.get("merchantId").toString()));
String eName = ""; String eName = "";
String[] paths = path.split("/"); String[] paths = path.split("/");

View File

@ -251,20 +251,16 @@
this.storeId = uni.getStorageSync("storeId") this.storeId = uni.getStorageSync("storeId")
this.chainStoreId = uni.getStorageSync("chainStoreId") this.chainStoreId = uni.getStorageSync("chainStoreId")
this.staffId = uni.getStorageSync("inviteStaffId") this.staffId = uni.getStorageSync("inviteStaffId")
await this.getUserAuthority(); // await this.getUserAuthority();
// await this.getOilType(); // await this.getOilType();
} else { } else {
if (uni.getStorageSync("storeId")) { if (uni.getStorageSync("storeId")) {
this.storeId = uni.getStorageSync("storeId") this.storeId = uni.getStorageSync("storeId")
} else {
let storeId = "34";
uni.setStorageSync("storeId", storeId)
} }
await this.getUserAuthority();
// await this.getOilType(); // await this.getOilType();
} }
await this.getUserAuthority();
await this.getTheJudgmentIsTheSame(); await this.getTheJudgmentIsTheSame();
} else { } else {
await this.getUserAuthority(); await this.getUserAuthority();

View File

@ -253,6 +253,8 @@
memberFavorableAmount: "", memberFavorableAmount: "",
type: "", type: "",
}, },
levelAmount: 0,
activeAmount: 0,
// //
isFixingLevel: false, isFixingLevel: false,
} }
@ -321,7 +323,9 @@
type: this.preferentialData.type, type: this.preferentialData.type,
balanceAmountSale: this.balanceRedece, balanceAmountSale: this.balanceRedece,
oilCardAmountSale: this.oilCardRedece, oilCardAmountSale: this.oilCardRedece,
ifLogin: this.ifLogin ifLogin: this.ifLogin,
levelAmount: this.levelAmount,
activeAmount: this.activeAmount
}; };
let _this = this; let _this = this;
request({ request({
@ -895,12 +899,14 @@
this.preferentialData = res.data this.preferentialData = res.data
if (res.data.memberFavorableAmount) { if (res.data.memberFavorableAmount) {
this.gradeRedece = res.data.memberFavorableAmount this.gradeRedece = res.data.memberFavorableAmount
this.levelAmount = res.data.memberFavorableAmount
} }
if (res.data.cardFavorableAmount) { if (res.data.cardFavorableAmount) {
this.couponRedece = res.data.cardFavorableAmount this.couponRedece = res.data.cardFavorableAmount
} }
if (res.data.activeFavorableAmount) { if (res.data.activeFavorableAmount) {
this.fullRedece = res.data.activeFavorableAmount this.fullRedece = res.data.activeFavorableAmount
this.activeAmount = res.data.activeFavorableAmount
} }
console.log(this.gradeRedece, this.couponRedece, this.fullRedece, res.data console.log(this.gradeRedece, this.couponRedece, this.fullRedece, res.data
.memberFavorableAmount, "2231"); .memberFavorableAmount, "2231");