Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
425f20f080
@ -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());
|
||||
amountAll += merchantConfig.getAmount();
|
||||
proList.add(list.get(i).getProportion()/100.0);
|
||||
radioList.add(merchantConfig.getAmount()/amountAll);
|
||||
distanceList.add(proList.get(i) - radioList.get(i));
|
||||
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);
|
||||
|
@ -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();
|
||||
|
@ -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());
|
||||
|
@ -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()));
|
||||
order.setActiveId(Integer.valueOf(jsonObjects.get(i).get("activeId").toString()));
|
||||
order.setCouponId(Integer.valueOf(jsonObjects.get(i).get("cardFavorableId").toString()));
|
||||
order.setActiveType(jsonObjects.get(i).get("type").toString());
|
||||
if (ObjectUtil.isNotEmpty(jsonObjects.get(i).get("activeId"))){
|
||||
order.setActiveId(Integer.valueOf(jsonObjects.get(i).get("activeId").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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -401,29 +401,29 @@
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 判断当前登录的code是否相同
|
||||
wx.login({
|
||||
success(res) {
|
||||
if (res.code) {
|
||||
//发起网络请求
|
||||
request({
|
||||
url: 'clientApi/sign/mpWxLogin2',
|
||||
method: "POST",
|
||||
data: {
|
||||
code: res.code
|
||||
}
|
||||
}).then(res => {
|
||||
if (!res.data) {
|
||||
uni.removeStorageSync("App-Token");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
if (uni.getStorageSync("appltType")== "WECHAT") {
|
||||
// 判断当前登录的code是否相同
|
||||
wx.login({
|
||||
success(res) {
|
||||
if (res.code) {
|
||||
//发起网络请求
|
||||
request({
|
||||
url: 'clientApi/sign/mpWxLogin2',
|
||||
method: "POST",
|
||||
data: {
|
||||
code: res.code
|
||||
}
|
||||
}).then(res => {
|
||||
if (!res.data) {
|
||||
uni.removeStorageSync("App-Token");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
@ -507,27 +507,29 @@
|
||||
}
|
||||
})
|
||||
|
||||
// 判断当前登录的code是否相同
|
||||
wx.login({
|
||||
success(res) {
|
||||
if (res.code) {
|
||||
//发起网络请求
|
||||
request({
|
||||
url: 'clientApi/sign/mpWxLogin2',
|
||||
method: "POST",
|
||||
data: {
|
||||
code: res.code
|
||||
}
|
||||
}).then(res => {
|
||||
if (!res.data) {
|
||||
uni.removeStorageSync("App-Token");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
if (uni.getStorageSync("appltType")== "WECHAT") {
|
||||
// 判断当前登录的code是否相同
|
||||
wx.login({
|
||||
success(res) {
|
||||
if (res.code) {
|
||||
//发起网络请求
|
||||
request({
|
||||
url: 'clientApi/sign/mpWxLogin2',
|
||||
method: "POST",
|
||||
data: {
|
||||
code: res.code
|
||||
}
|
||||
}).then(res => {
|
||||
if (!res.data) {
|
||||
uni.removeStorageSync("App-Token");
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
// 退格键被点击
|
||||
backspace() {
|
||||
|
@ -310,6 +310,7 @@
|
||||
isUseChildCard:this.isUseChildCard,
|
||||
activeId:this.preferentialData.activeId,
|
||||
cardFavorableId:this.preferentialData.cardFavorableId,
|
||||
type:this.preferentialData.type,
|
||||
};
|
||||
let _this = this;
|
||||
request({
|
||||
|
Loading…
Reference in New Issue
Block a user