Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2024-01-29 14:11:10 +08:00
commit 425f20f080
9 changed files with 87 additions and 55 deletions

View File

@ -42,10 +42,14 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
List<Double> distanceList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
MerchantConfig merchantConfig = merchantConfigService.selectMerchById(list.get(i).getMerchConfigId());
if (ObjectUtil.isNotEmpty(merchantConfig)){
amountAll += merchantConfig.getAmount();
proList.add(list.get(i).getProportion()/100.0);
radioList.add(merchantConfig.getAmount()/amountAll);
distanceList.add(proList.get(i) - radioList.get(i));
}
}
int index = 0;
Double max = Collections.max(distanceList);

View File

@ -836,9 +836,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
//消费有礼
List<ActiveConsumptionVO> activeConsumptionVOS = oilOrderMapper.selectActiveConsumption(paymentActiveDTO.getStoreId(), paymentActiveDTO.getAmount());
//连锁店信息
if (paymentActiveDTO.getUserId()==null){
paymentActiveDTO.setUserId(TokenUtil.getNowAccountInfo().getId());
}
// if (paymentActiveDTO.getUserId()==null){
// paymentActiveDTO.setUserId(TokenUtil.getNowAccountInfo().getId());
// }
LJUser ljUserVo = userService.queryUserByUserId(paymentActiveDTO.getUserId());
Integer storeId1 = paymentActiveDTO.getStoreId();
Integer chainStoreId = iljStoreService.selectStoreByStoreId(storeId1).getChainStoreId();

View File

@ -276,12 +276,12 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
public boolean updateCardAndActiveById(PaymentActiveVO paymentActiveVO) {
//优惠券
boolean flag = false;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer userId = null;
if (paymentActiveVO.getUserId()!=null){
userId = paymentActiveVO.getUserId();
}else {
userId = nowAccountInfo.getId();
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// userId = nowAccountInfo.getId();
}
if (ObjectUtils.isNotEmpty(paymentActiveVO.getCardFavorableId())){
flag = cardFavorableRecordMapper.updateCardAndActiveById(paymentActiveVO.getCardFavorableId(),userId,paymentActiveVO.getStoreId());

View File

@ -213,6 +213,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Double goodsActualPay = Double.valueOf(map.get("goodsActualPay"));
// 找零金额
Double seekZero = Double.valueOf(map.get("seekZero"));
// 找零金额
Integer cardFavorableId = null;
if (StringUtils.isNotEmpty(map.get("cardFavorableId"))){
cardFavorableId = Integer.valueOf(map.get("cardFavorableId"));
}
// 付款用户
String payUser = null;
if (map.get("payUser") != null && !map.get("payUser").equals("")){
@ -347,6 +352,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (payType.equals("CASH")){
staffCommissionService.countStaffCommission(staffId,storeId,oilAmount,oilActualPay,oilLiters,"1",orderNo);
}
order.setCouponId(cardFavorableId);
}else {
order.setOrderType("子订单");
order.setOrderAmount(amount);
@ -372,9 +378,12 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setInvoicing("未开票");
order.setOrderStatus(payStatus);
order.setTankId(Integer.valueOf(jsonObjects.get(0).get("tankId").toString()));
if (ObjectUtil.isNotEmpty(jsonObjects.get(i).get("activeId"))){
order.setActiveId(Integer.valueOf(jsonObjects.get(i).get("activeId").toString()));
order.setCouponId(Integer.valueOf(jsonObjects.get(i).get("cardFavorableId").toString()));
}
if (ObjectUtil.isNotEmpty(jsonObjects.get(i).get("type"))){
order.setActiveType(jsonObjects.get(i).get("type").toString());
}
if (payType.equals("CASH")){
order.setPayTime(new Date());
this.addOilTrack(jsonObjects.get(i),storeId);
@ -471,7 +480,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// 调用消费有礼接口
public void updateCardAndActiveById(Integer storeId,Integer userId,Integer activeId,Integer cardFavorableId,String type,Double orderAmount,Integer oilId){
if (userId!=null){
LJUserVo userVo = userService.selectUserById(userId, storeId);
LJUserVo userVo = userService.queryUserById(userId, storeId);
PaymentActiveVO paymentActiveVO = new PaymentActiveVO();
paymentActiveVO.setUserId(userId);
paymentActiveVO.setMtUserLevel(userVo.getGradeId());
@ -987,6 +996,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
String activeId = map.get("activeId");
// 优惠券id
String cardFavorableId = map.get("cardFavorableId");
// 活动类型
String type = map.get("type");
Integer tankId = Integer.valueOf(map.get("tankId"));
Map<String, Object> applet = new HashMap<>();
@ -1123,6 +1134,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
oilOrder.setPayAmount(payAmount);
oilOrder.setActiveId(Integer.valueOf(activeId));
oilOrder.setCouponId(Integer.valueOf(cardFavorableId));
oilOrder.setActiveType(type);
this.updateOilOrder(oilOrder);
return applet;

View File

@ -54,6 +54,13 @@ public interface LJUserService extends IService<LJUser> {
*/
public LJUserVo selectUserById(int id,Integer storeId);
/**
* 根据id查询会员信息
* @param id
* @return
*/
public LJUserVo queryUserById(int id,Integer storeId);
/**
* 根据storeId获取连锁店id 根据连锁店id查询用户信息
* @param storeId

View File

@ -164,6 +164,12 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return baseMapper.queryUserByChainStoreId(id,store.getChainStoreId());
}
@Override
public LJUserVo queryUserById(int id, Integer storeId) {
LJStore store = storeService.selectStoreByStoreId(storeId);
return baseMapper.queryUserByChainStoreId(id,store.getChainStoreId());
}
@Autowired
@Lazy
private CardValudChildrensService cardValudChildrensService;

View File

@ -401,7 +401,7 @@
}
})
if (uni.getStorageSync("appltType")== "WECHAT") {
// code
wx.login({
success(res) {
@ -423,7 +423,7 @@
}
}
})
}
},

View File

@ -507,6 +507,7 @@
}
})
if (uni.getStorageSync("appltType")== "WECHAT") {
// code
wx.login({
success(res) {
@ -528,6 +529,7 @@
}
}
})
}
},
// 退
backspace() {

View File

@ -310,6 +310,7 @@
isUseChildCard:this.isUseChildCard,
activeId:this.preferentialData.activeId,
cardFavorableId:this.preferentialData.cardFavorableId,
type:this.preferentialData.type,
};
let _this = this;
request({