bug
This commit is contained in:
parent
3cc44f8272
commit
fcb8ddb9ca
@ -49,12 +49,15 @@ import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilNameMapper;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilNumberMapper;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.ChainStoreConfig;
|
||||
import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.LJUserGradeMapper;
|
||||
import com.fuint.business.userManager.mapper.LJUserMapper;
|
||||
import com.fuint.business.userManager.service.ChainStoreConfigService;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
@ -65,6 +68,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -116,6 +120,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
private OilNameMapper oilNameMapper;
|
||||
@Resource
|
||||
private OilNumberMapper oilNumberMapper;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private ChainStoreConfigService chainStoreConfigService;
|
||||
/**
|
||||
* 分页查询所有
|
||||
* @param
|
||||
@ -644,96 +651,102 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
String oilTypebyId = oilNameMapper.getOilTypebyId(oilId);
|
||||
|
||||
String gradeId = paymentActiveDTO.getMtUserLevel().toString();
|
||||
if (StringUtils.isNotEmpty(gradeId)){
|
||||
LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId);
|
||||
if (ObjectUtils.isNotEmpty(ljUserGrade)){
|
||||
if (oilTypebyId.equals("汽油")){
|
||||
if (ljUserGrade.getGasolineDiscount().equals("无优惠")){
|
||||
if (StringUtils.isNotEmpty(gradeId)) {
|
||||
LJStore store = iljStoreService.selectStoreByStoreId(storeId);
|
||||
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
|
||||
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
|
||||
if (isEnableLevel.equals("yes")) {
|
||||
|
||||
}else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
|
||||
String gasolineRule = ljUserGrade.getGasolineRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
|
||||
LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId);
|
||||
if (ObjectUtils.isNotEmpty(ljUserGrade)) {
|
||||
if (oilTypebyId.equals("汽油")) {
|
||||
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
|
||||
|
||||
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
|
||||
String gasolineRule = ljUserGrade.getGasolineRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
|
||||
BigDecimal bigDecimal = jsonObject.getBigDecimal("gasolineRule1");
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
|
||||
//升数
|
||||
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1,2,RoundingMode.HALF_UP);
|
||||
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal gasolineRule3 = jsonObject.getBigDecimal("gasolineRule3");
|
||||
BigDecimal multiply = divide.multiply(gasolineRule3);
|
||||
paymentActiveVO.setMemberFavorableAmount(multiply);
|
||||
}
|
||||
}else {
|
||||
String gasolineRule = ljUserGrade.getGasolineRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
|
||||
} else {
|
||||
String gasolineRule = ljUserGrade.getGasolineRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
|
||||
BigDecimal gasolineRule1 = jsonObject.getBigDecimal("gasolineRule1");
|
||||
if (paymentActiveDTO.getAmount().compareTo(gasolineRule1)>=0){
|
||||
if (paymentActiveDTO.getAmount().compareTo(gasolineRule1) >= 0) {
|
||||
//升数
|
||||
Integer gasolineRule3 = jsonObject.getInteger("gasolineRule2");
|
||||
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
|
||||
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oilTypebyId.equals("柴油")){
|
||||
if (ljUserGrade.getGasolineDiscount().equals("无优惠")){
|
||||
if (oilTypebyId.equals("柴油")) {
|
||||
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
|
||||
|
||||
}else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
|
||||
String gasolineRule = ljUserGrade.getDieselRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
|
||||
BigDecimal bigDecimal =jsonObject.getBigDecimal("dieselRule1");
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
|
||||
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
|
||||
String gasolineRule = ljUserGrade.getDieselRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
|
||||
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
|
||||
//升数
|
||||
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1,2,RoundingMode.HALF_UP);
|
||||
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal bigDecimal2 = jsonObject.getBigDecimal("dieselRule3");
|
||||
BigDecimal multiply = divide.multiply(bigDecimal2);
|
||||
paymentActiveVO.setMemberFavorableAmount(multiply);
|
||||
}
|
||||
}else {
|
||||
String gasolineRule = ljUserGrade.getDieselRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
|
||||
} else {
|
||||
String gasolineRule = ljUserGrade.getDieselRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
|
||||
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
|
||||
//升数
|
||||
Integer gasolineRule3 = jsonObject.getInteger("dieselRule2");
|
||||
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
|
||||
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (oilTypebyId.equals("天然气")) {
|
||||
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
|
||||
|
||||
}
|
||||
if (oilTypebyId.equals("天然气")){
|
||||
if (ljUserGrade.getGasolineDiscount().equals("无优惠")){
|
||||
|
||||
}else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")){
|
||||
String gasolineRule = ljUserGrade.getNaturalGasRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
|
||||
} else if (ljUserGrade.getGasolineDiscount().equals("每升优惠")) {
|
||||
String gasolineRule = ljUserGrade.getNaturalGasRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule3"))).get();
|
||||
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
|
||||
//升数
|
||||
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1,2,RoundingMode.HALF_UP);
|
||||
BigDecimal divide = paymentActiveDTO.getAmount().divide(bigDecimal1, 2, RoundingMode.HALF_UP);
|
||||
BigDecimal bigDecimal2 = jsonObject.getBigDecimal("naturalGas3");
|
||||
BigDecimal multiply = divide.multiply(bigDecimal2);
|
||||
paymentActiveVO.setMemberFavorableAmount(multiply);
|
||||
}
|
||||
}else {
|
||||
String gasolineRule = ljUserGrade.getGasolineRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
|
||||
} else {
|
||||
String gasolineRule = ljUserGrade.getGasolineRule();
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(gasolineRule, JSONObject.class);
|
||||
JSONObject jsonObject = jsonObjects.stream().max(Comparator.comparingDouble(o -> o.getDouble("gasolineRule2"))).get();
|
||||
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal)>=0){
|
||||
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
|
||||
//升数
|
||||
Integer gasolineRule3 = jsonObject.getInteger("naturalGas2");
|
||||
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
|
||||
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return paymentActiveVO;
|
||||
}
|
||||
|
||||
|
@ -253,4 +253,15 @@ public class OilOrderController extends BaseController {
|
||||
public ResponseObject getAllAmount(@PathVariable Integer userId){
|
||||
return getSuccessResult(orderService.sumOilOrderAmountByUserIdAndStoreId(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号查询油品订单信息(小程序)
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("oilOrderNo")
|
||||
public ResponseObject getOilOrder(@RequestBody Map<String,String> map){
|
||||
String orderNo = map.get("orderNo");
|
||||
return getSuccessResult(orderService.selectOilOrderDescByOrderNo(orderNo));
|
||||
}
|
||||
}
|
||||
|
@ -113,4 +113,5 @@ public interface OilOrderMapper extends BaseMapper<OilOrder> {
|
||||
|
||||
Map<String, String> orderStatistics( @Param("order") OilOrder order);
|
||||
|
||||
OilOrderVo selectOilOrderDescByOrderNo(@Param("orderNo") String orderNo);
|
||||
}
|
||||
|
@ -518,4 +518,15 @@
|
||||
user_id = #{userId} and store_id = #{storeId} and order_status = 'paid'
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectOilOrderDescByOrderNo" resultType="com.fuint.business.order.vo.OilOrderVo"
|
||||
parameterType="java.lang.String">
|
||||
select od.*,ona.oil_name,og.gun_name,sta.real_name,sto.name storeName,sto.description from oil_order od
|
||||
left join oil_name ona on od.oils = ona.id
|
||||
left join oil_gun og on od.oil_gun_num = og.id
|
||||
left join mt_staff sta on od.staff_id = sta.id
|
||||
left join mt_store sto on od.store_id = sto.id
|
||||
<where>
|
||||
od.order_no = #{orderNo}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -8,6 +8,7 @@ import com.fuint.business.order.entity.CashierOrder;
|
||||
import com.fuint.business.order.entity.OilOrder;
|
||||
import com.fuint.business.order.vo.OilOrderVo;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -144,5 +145,5 @@ public interface OilOrderService extends IService<OilOrder> {
|
||||
Map<String, String> orderStatistics(OilOrder order);
|
||||
|
||||
|
||||
|
||||
OilOrderVo selectOilOrderDescByOrderNo(String orderNo);
|
||||
}
|
||||
|
@ -993,17 +993,17 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
applet = fyPayService.applet(receiveParameter);
|
||||
String resultMsg = (String) applet.get("resultMsg");
|
||||
// 判断商户订单号是否重复 重复则重新生成订单号
|
||||
if (StringUtils.isNotEmpty(resultMsg)){
|
||||
// 根据日期生成订单信息
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
String orderNo1 = "2345"+timestamp+randomString;
|
||||
oilOrder.setOrderNo(orderNo1);
|
||||
this.updateOilOrder(oilOrder);
|
||||
receiveParameter.setOrderNo(orderNo1);
|
||||
applet = fyPayService.applet(receiveParameter);
|
||||
}
|
||||
// if (StringUtils.isNotEmpty(resultMsg)){
|
||||
// // 根据日期生成订单信息
|
||||
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
// String timestamp = dateFormat.format(new Date());
|
||||
// String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
// String orderNo1 = "2345"+timestamp+randomString;
|
||||
// oilOrder.setOrderNo(orderNo1);
|
||||
// this.updateOilOrder(oilOrder);
|
||||
// receiveParameter.setOrderNo(orderNo1);
|
||||
// applet = fyPayService.applet(receiveParameter);
|
||||
// }
|
||||
applet.put("orderNo",orderNo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -1531,4 +1531,9 @@ return stringDoubleMap;
|
||||
|
||||
return oilOrderMapper.orderStatistics(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OilOrderVo selectOilOrderDescByOrderNo(String orderNo) {
|
||||
return baseMapper.selectOilOrderDescByOrderNo(orderNo);
|
||||
}
|
||||
}
|
||||
|
@ -9,5 +9,8 @@ public class OilOrderVo extends OilOrder {
|
||||
private Double oilPrice;
|
||||
//
|
||||
private String storeName;
|
||||
private String description;
|
||||
private String oilName;
|
||||
private String gunName;
|
||||
private String realName;
|
||||
}
|
||||
|
@ -133,6 +133,7 @@
|
||||
import tabbar from "../../components/tabbar/tabbar.vue"
|
||||
import config from '@/config'
|
||||
import request from '../../utils/request'
|
||||
import { callWithErrorHandling } from "vue"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -326,22 +327,21 @@
|
||||
getUserAuthority() {
|
||||
let _this = this;
|
||||
// this.getAddress();
|
||||
|
||||
uni.getSetting({
|
||||
success(res) {
|
||||
console.log(res, 111)
|
||||
// console.log(res, 111,"dingw")
|
||||
if (!res.authSetting['scope.userLocation']) {
|
||||
uni.authorize({
|
||||
scope: 'scope.userLocation',
|
||||
success() {
|
||||
// 用户同意获取位置信息
|
||||
// _this.isExistStoreId()
|
||||
_this.getAddress(uni.getStorageSync("storeId"));
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝
|
||||
}
|
||||
})
|
||||
// uni.authorize({
|
||||
// scope: 'scope.userLocation',
|
||||
// success() {
|
||||
// // 用户同意获取位置信息
|
||||
// // _this.isExistStoreId()
|
||||
// },
|
||||
// fail() {
|
||||
// // 用户拒绝
|
||||
// }
|
||||
// })
|
||||
_this.getAddress(uni.getStorageSync("storeId"));
|
||||
} else {
|
||||
// 用户同意获取位置信息
|
||||
// _this.isExistStoreId()
|
||||
|
@ -339,7 +339,7 @@
|
||||
this.oilOrder.orderAmount = this.value
|
||||
this.oilOrder.storeId = this.storeId
|
||||
this.oilOrder.staffId = id
|
||||
this.oilOrder.oilNum = Math.ceil((this.value/this.oilPrice)*100)/100
|
||||
this.oilOrder.oilNum = (this.value/this.oilPrice).toFixed(2)
|
||||
this.oilOrder.tankId = uni.getStorageSync("tankId")
|
||||
let _this = this;
|
||||
// 添加油品订单信息
|
||||
|
@ -13,11 +13,12 @@
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>油站名称</view>
|
||||
<view>{{store.name}}{{store.description ? "("+store.description+")" : ""}}</view>
|
||||
<!-- <view>{{store.name}}{{store.description ? "("+store.description+")" : ""}}</view> -->
|
||||
<view>{{oilOrder.storeName}}{{oilOrder.description ? "("+oilOrder.description+")" : ""}}</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>油号油枪</view>
|
||||
<view>{{oilName}}/{{oilOrder.oilGunNum}}</view>
|
||||
<view>{{oilOrder.oilName}}/{{oilOrder.gunName}}</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>加油金额</view>
|
||||
@ -33,7 +34,7 @@
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>加油员工</view>
|
||||
<view>{{staff.realName}}</view>
|
||||
<view>{{oilOrder.realName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -110,7 +111,7 @@
|
||||
</view>
|
||||
<!-- <view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view> -->
|
||||
|
||||
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">已为您计算出最大优惠</view>
|
||||
<view style="margin: 10px 20px 0;color: red;font-size: 12px;" v-if="fullRedece>0 || gradeRedece>0 || couponRedece>0">已为您计算出最大优惠</view>
|
||||
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">注:囤油卡不参与任何优惠活动</view>
|
||||
</view>
|
||||
|
||||
@ -249,7 +250,7 @@
|
||||
},
|
||||
onLoad(e) {
|
||||
this.orderNo = e.orderNo
|
||||
// this.orderNo = "234520240119103259511c58"
|
||||
// this.orderNo = "23452024012011401299130f"
|
||||
},
|
||||
onShow() {
|
||||
this.getOilOrder();
|
||||
@ -263,8 +264,21 @@
|
||||
this.checkOilCard = val
|
||||
if (val){
|
||||
this.chooseRefuelMoney()
|
||||
this.fullRedece = 0;
|
||||
this.gradeRedece = 0;
|
||||
this.couponRedece = 0;
|
||||
this.preferentialData = {
|
||||
activeFavorableAmount: "",
|
||||
activeId: "",
|
||||
activeInfo: "",
|
||||
cardFavorableAmount: "",
|
||||
cardFavorableId: "",
|
||||
cardFavorableInfo: "",
|
||||
memberFavorableAmount: "",
|
||||
type: "",
|
||||
};
|
||||
}else{
|
||||
this.payAmount = this.payAmount + (this.oilCardRedece * this.oilPrice)
|
||||
this.chooseCardBalance(0)
|
||||
this.oilCardRedece = 0
|
||||
this.getPaymentPreferential(this.user.gradeId)
|
||||
}
|
||||
@ -431,13 +445,16 @@
|
||||
},
|
||||
// 查看是否有可使用的储值卡金额
|
||||
chooseCardBalance(val){
|
||||
if (this.oilCardRedece==0){
|
||||
this.getPaymentPreferential(this.user.gradeId)
|
||||
}
|
||||
console.log("balance");
|
||||
if (this.user.cardBalance>0) {
|
||||
this.isStoreValueCard = true;
|
||||
if (val == 0) {
|
||||
// 没有使用囤油卡
|
||||
if (this.user.cardBalance >= (this.oilOrder.orderAmount - this.couponRedece)){
|
||||
this.balanceRedece = this.oilOrder.orderAmount - this.couponRedece
|
||||
if (this.user.cardBalance >= this.oilOrder.orderAmount){
|
||||
this.balanceRedece = this.oilOrder.orderAmount
|
||||
} else {
|
||||
this.balanceRedece = this.user.cardBalance
|
||||
this.deductAmount = (this.oilOrder.orderAmount*100-this.balanceRedece*100)/100
|
||||
@ -461,6 +478,7 @@
|
||||
}
|
||||
}else{
|
||||
this.deductAmount = this.oilOrder.orderAmount
|
||||
this.payAmount = this.oilOrder.orderAmount
|
||||
}
|
||||
},
|
||||
// 查看是否有可使用的会员等级优惠
|
||||
@ -800,7 +818,7 @@
|
||||
// 计算用户应付金额
|
||||
countPayMent(){
|
||||
this.payAmount = this.deductAmount;
|
||||
console.log("111",this.deductAmount, this.gradeRedece, this.fullRedece, this.couponRedece);
|
||||
// console.log("111",this.deductAmount, this.gradeRedece, this.fullRedece, this.couponRedece);
|
||||
},
|
||||
|
||||
// 根据店铺id查询用户信息
|
||||
@ -865,22 +883,26 @@
|
||||
this.fullRedece = res.data.activeFavorableAmount
|
||||
}
|
||||
console.log(this.gradeRedece,this.couponRedece,this.fullRedece,res.data.memberFavorableAmount,"2231");
|
||||
|
||||
this.payAmount = (this.payAmount - this.fullRedece - this.couponRedece - this.gradeRedece).toFixed(2)
|
||||
})
|
||||
},
|
||||
// 获取油品订单
|
||||
getOilOrder() {
|
||||
let _this = this;
|
||||
request({
|
||||
url: "business/oilOrder/orderNo",
|
||||
// url: "business/oilOrder/orderNo",
|
||||
url: "business/oilOrder/oilOrderNo",
|
||||
method: 'post',
|
||||
data: {
|
||||
orderNo: _this.orderNo
|
||||
},
|
||||
}).then((res) => {
|
||||
if(res.data!=null){
|
||||
if(res.data){
|
||||
// console.log(res);
|
||||
_this.oilOrder = res.data
|
||||
_this.getStaffList(res.data.staffId)
|
||||
_this.getStore(res.data.storeId)
|
||||
// _this.getStaffList(res.data.staffId)
|
||||
// _this.getStore(res.data.storeId)
|
||||
_this.getOilNumber(res.data.storeId)
|
||||
// _this.chooseCoupons()
|
||||
_this.getUser(res.data.userId)
|
||||
|
Loading…
Reference in New Issue
Block a user