This commit is contained in:
wangh 2024-01-23 14:19:42 +08:00
commit 3646bc94b9
48 changed files with 643 additions and 231 deletions

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询成长值记录信息列表
export function listGrowthValueRecord(query) {
return request({
url: '/business/growthValueChange/list',
method: 'get',
params: query
})
}

View File

@ -105,14 +105,13 @@ export default {
},
getOilName(){
oilNumbers().then(res => {
console.log(res)
this.oilNameList = res.data
})
},
getList(){
this.loading = true
this.queryParams.userId = this.userId
this.queryParams.mtUserId = this.userId
getCardFavorableList(this.queryParams).then(res=>{
if (res.code == 200) {
this.list = res.data.records
@ -123,7 +122,6 @@ export default {
})
},
changeStatus() {
console.log("12312312312312312",this.cardList)
if (this.cardList == 'notUse') {
this.queryParams.status = 0
} else if (this.cardList == 'used') {

View File

@ -1,12 +1,23 @@
<template>
<div>
<el-table ref="tables" v-loading="loading" :data="list">
<el-table-column label="所属油站" prop="id" align="center"/>
<el-table-column label="变动时间" align="center"/>
<el-table-column label="类型" align="center" prop="userNo"/>
<el-table-column label="变动成长值" align="center" prop="name" />
<el-table-column label="描述" align="center" prop="name" />
<el-table-column label="类型" align="center" prop="balance"/>
<el-table-column label="所属油站" prop="storeName" align="center">
<template slot-scope="scope">
<span>{{scope.row.storeName ? scope.row.storeName : storeName}}</span>
</template>
</el-table-column>
<el-table-column label="变动时间" prop="createTime" align="center"/>
<el-table-column label="类型" align="center" prop="changeType">
<template slot-scope="scope">
<el-tag v-if="scope.row.changeType == 0">减少</el-tag>
<el-tag type="success" v-else>增加</el-tag>
</template>
</el-table-column>
<el-table-column label="变动成长值" align="center" prop="growthValue" />
<el-table-column label="变动后成长值" align="center" prop="afterTheChange" />
<el-table-column label="描述" align="center" prop="fromType" />
</el-table>
<pagination
@ -19,6 +30,9 @@
</template>
<script>
import {listGrowthValueRecord} from "@/api/order/growthvaluerecord";
import {ljStoreInfo} from "@/api/staff/store";
export default {
props:["pUserId"],
data(){
@ -30,16 +44,30 @@ export default {
queryParams:{
page:1,
pageSize:10,
}
},
storeName:"",
}
},
created() {
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
this.getList()
this.getStoreName()
},
methods:{
getStoreName(){
ljStoreInfo().then(res => {
this.storeName = res.data.name
})
},
getList(){
this.loading = true
this.queryParams.userId = this.userId
listGrowthValueRecord(this.queryParams).then(res => {
this.list = res.data.records
this.total = res.data.total
this.loading = false
})
}
}
}

View File

@ -40,15 +40,15 @@
<div style="margin-top: 15px">
<span style="color: grey;">成长值计算方式</span>
<div style="display: flex;justify-content: space-between">
<el-input v-model="gasGrowthValue" disabled placeholder="1" style="margin: 10px 10px">
<el-input v-model="gasGrowthValue" disabled style="margin: 10px 10px">
<template slot="prepend">汽油成长值比例,每消费1元积</template>
<template slot="append">成长值</template>
</el-input>
<el-input v-model="dieselGrowthValue" disabled placeholder="1" style="margin: 10px 10px">
<el-input v-model="dieselGrowthValue" disabled style="margin: 10px 10px">
<template slot="prepend">柴油成长值比例,每消费1元积</template>
<template slot="append">成长值</template>
</el-input>
<el-input v-model="naturalGrowthValue" disabled placeholder="1" style="margin: 10px 10px">
<el-input v-model="naturalGrowthValue" disabled style="margin: 10px 10px">
<template slot="prepend">天然气成长值比例,每消费1元积</template>
<template slot="append">成长值</template>
</el-input>
@ -491,11 +491,11 @@ export default {
//
growthValueRule:[],
//
gasGrowthValue:'',
gasGrowthValue:0,
//
dieselGrowthValue:'',
dieselGrowthValue:0,
//
naturalGrowthValue:'',
naturalGrowthValue:0,
clear:'',
//
loading: true,
@ -584,9 +584,15 @@ export default {
// console.log(response)
this.isEnableLevel = response.data.isEnableLevel;
this.clear = response.data.isMonthClear;
this.gasGrowthValue = response.data.gasGrowthValue;
this.dieselGrowthValue = response.data.dieselGrowthValue;
this.naturalGrowthValue = response.data.naturalGrowthValue;
if (response.data.gasGrowthValue){
this.gasGrowthValue = response.data.gasGrowthValue;
}
if (response.data.dieselGrowthValue) {
this.dieselGrowthValue = response.data.dieselGrowthValue;
}
if (response.data.naturalGrowthValue) {
this.naturalGrowthValue = response.data.naturalGrowthValue;
}
if (response.data.isEnableLevel=="no"){
this.level1 = true;
this.level2 = false;

View File

@ -8,7 +8,7 @@ ENV = 'production'
VUE_APP_BASE_API = '/fuint-application/'
# 发布目录
VUE_APP_PUBLIC_PATH = '/fuintAdmin/'
VUE_APP_PUBLIC_PATH = '/oilZt/'
# 后端接口地址
VUE_APP_SERVER_URL = 'https://www.tuofeng.cc/oilAdmin/'

View File

@ -49,6 +49,7 @@ Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
// Vue.prototype.pcUrl = 'http://192.168.0.121:82/'
Vue.prototype.pcUrl = 'http://192.168.0.121:82/'
// Vue.prototype.pcUrl = 'http://47.95.206.185:85/'
// 全局组件挂载
Vue.component('DictTag', DictTag)

View File

@ -3,7 +3,7 @@
<el-card class="card">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="店铺" prop="storeId">
<el-select v-model="queryParams.storeId" placeholder="请选择店铺" style="width: 100%">
<el-select v-model="queryParams.storeId" filterable placeholder="请选择店铺" clearable style="width: 100%">
<el-option v-for="item in storeList"
:key="item.id" clearable
:label="item.name" :value="item.id"
@ -87,10 +87,10 @@
:visible.sync="dialogVisible">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="店铺" prop="storeId">
<el-select v-model="form.storeId" placeholder="请选择店铺" style="width: 100%">
<el-select v-model="form.storeId" filterable placeholder="请选择店铺" style="width: 100%">
<el-option v-for="item in storeList"
:key="item.id"
:label="item.name" :value="item.id"></el-option>
:label="item.name" :value="item.id+''"></el-option>
</el-select>
</el-form-item>
<el-form-item label="轮播图" prop="bannerUrl">
@ -235,18 +235,17 @@ export default {
if (valid) {
if (this.form.id){
updateIndexBanner(this.form).then(res => {
console.log(res)
if (res.data==1){
this.$modal.msgSuccess("修改成功")
this.dialogVisible = false
this.flag = false
this.queryParams.page = 1
this.getList()
this.getStoreList()
}
})
}else {
addIndexBanner(this.form).then(res => {
console.log(res)
if (res.data==1){
this.$modal.msgSuccess("添加成功")
this.dialogVisible = false

View File

@ -254,7 +254,8 @@ export default {
code:this.loginForm.telcode
}
this.$store.dispatch("codeLogin", data).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
// this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
this.$router.push({ path: "/Service/index" }).catch(()=>{});
}).catch(() => {
this.loading = false;
@ -279,7 +280,8 @@ export default {
Cookies.remove('rememberMe');
}
app.$store.dispatch("Login", this.loginForm).then(() => {
app.$router.push({ path: this.redirect || "/" }).catch(()=>{});
// app.$router.push({ path: this.redirect || "/" }).catch(()=>{});
app.$router.push({ path: "/Service/index" }).catch(()=>{});
}).catch(() => {
app.loading = false;
if (app.captchaOnOff) {

View File

@ -39,7 +39,7 @@ system.name = \u84DD\u9CB8\u667A\u6167\u6CB9\u7AD9\u7CFB\u7EDF
website.url=https://www.fuint.cn/h5/
# \u4E0A\u4F20\u56FE\u7247\u672C\u5730\u5730\u5740
images.root=d:/rouyi/uploadPath
images.root=d:/ruoyi/uploadPath
images.path=/static/uploadImages/
# \u4E0A\u4F20\u56FE\u7247\u670D\u52A1\u5668\u57DF\u540D
@ -124,3 +124,7 @@ weixin.subMessage.pointChange=[{'key':'amount', 'name':'\u53D8\u52A8\u6570\u91CF
rocketmq.name-server=127.0.0.1:9876
//2
rocketmq.producer.group=provider
# \u5458\u5DE5\u7801\u80CC\u666F\u56FE\u8BBE\u7F6E
staff.bg=/static/qrCodeImg/laigeyouhui_bg.jpg
staff.logo=/static/qrCodeImg/logo.png

View File

@ -124,3 +124,7 @@ weixin.subMessage.pointChange=[{'key':'amount', 'name':'\u53D8\u52A8\u6570\u91CF
rocketmq.name-server=127.0.0.1:9876
//2
rocketmq.producer.group=provider
# \u5458\u5DE5\u7801\u80CC\u666F\u56FE\u8BBE\u7F6E
staff.bg=/static/qrCodeImg/laigeyouhui_bg.jpg
staff.logo=/static/qrCodeImg/logo.png

View File

@ -49,8 +49,8 @@ public class Const {
public static String NOTIFY_PUBLIC_KEYS="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbBAl3xSB7YeUnze4yYZmnTeT7OtXZr0sP10TsDVRH2SY/VEjgS9KPmHMmVeKZT3+6xKsUvulgVyie46GGtZPrnoh+glF1gzsYAXJ7dvR/R5nYO5VvfwK/ChPFTiKhbTtO4OKtchgBZuqCbsemG+gFIiVJo37dY0Kg0zISmFHdOQIDAQAB";
//异步通知(回调地址)
// public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify";
public static String notify_url = "https://www.tuofeng.cc/oilAdmin/api/fyPay/notify";
// public static String notify_url = "https://8q4f124343.yicp.fun/api/fyPay/notify";
//下单
public static String fuiou_21_url = "https://fundwx.fuiou.com/preCreate";

View File

@ -56,7 +56,7 @@ public class IndexBannerController extends BaseController {
*/
@PostMapping
public ResponseObject add(@RequestBody IndexBanner indexBanner){
return getSuccessResult(indexBannerService.insertIndexBanner(indexBanner,null));
return getSuccessResult(indexBannerService.insertIndexBanner(indexBanner,indexBanner.getStoreId()));
}
/**

View File

@ -456,16 +456,13 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
List<ActiveDiscountPayVO> activeFuletVOLists = oilOrderMapper.selectActiveFules(storeId,paymentActiveDTO.getAmount(),paymentActiveDTO.getOilId(),paymentActiveDTO.getMtUserLevel());
activeFuletVOList.addAll(activeFuletVOLists);
//优惠券
//<<<<<<< HEAD
//paymentActiveDTO.setUserId(userId);
paymentActiveDTO.setUserId(117);
//=======
if (ObjectUtils.isNotEmpty(paymentActiveDTO.getUserId())){
userId = paymentActiveDTO.getUserId();
}
paymentActiveDTO.setUserId(userId);
//>>>>>>> origin/master
List<CardFavorableRecordVO> canUserCardFavorableList = cardFavorableRecordMapper.getCanUserCardFavorableList(paymentActiveDTO);
//如果是储值卡付款直接过滤掉
if(paymentActiveDTO.getType().equals("0")){
@ -669,93 +666,95 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
if (StringUtils.isNotEmpty(gradeId)) {
LJStore store = iljStoreService.selectStoreByStoreId(storeId);
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")) {
if (ObjectUtils.isNotEmpty(chainStoreConfig)) {
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
if (isEnableLevel.equals("yes")) {
LJUserGrade ljUserGrade = ljUserGradeMapper.selectAllByGradeId(gradeId);
if (ObjectUtils.isNotEmpty(ljUserGrade)) {
if (oilTypebyId.equals("汽油")) {
if (ljUserGrade.getGasolineDiscount().equals("无优惠")) {
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) {
//升数
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();
BigDecimal gasolineRule1 = jsonObject.getBigDecimal("gasolineRule1");
if (paymentActiveDTO.getAmount().compareTo(gasolineRule1) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("gasolineRule2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
} 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) {
//升数
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();
BigDecimal gasolineRule1 = jsonObject.getBigDecimal("gasolineRule1");
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) {
//升数
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();
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("dieselRule2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
} 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 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();
BigDecimal bigDecimal = jsonObject.getBigDecimal("dieselRule1");
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();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
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();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("naturalGas2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
} 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) {
//升数
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();
BigDecimal bigDecimal = jsonObject.getBigDecimal("naturalGas1");
if (paymentActiveDTO.getAmount().compareTo(bigDecimal) >= 0) {
//升数
Integer gasolineRule3 = jsonObject.getInteger("naturalGas2");
BigDecimal bigDecimal2 = BigDecimal.valueOf(gasolineRule3);
paymentActiveVO.setMemberFavorableAmount(bigDecimal2);
}
}
}
}

View File

@ -27,4 +27,10 @@ public class PaymentActiveVO implements Serializable {
private BigDecimal cardFavorableAmount;
//等级会员优惠金额
private BigDecimal memberFavorableAmount;
//订单金额
private BigDecimal orderAmount;
//可用油品Id
private Integer oilId;
//会员等级
private Integer mtUserLevel;
}

View File

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.activeDiscountRecords.entity.ActiveDiscountRecords;
import com.fuint.business.marketingActivity.activeDiscountRecords.mapper.ActiveDiscountRecordsMapper;
import com.fuint.business.marketingActivity.activeDiscountRecords.service.ActiveDiscountRecordsService;
import com.fuint.business.marketingActivity.activeExchange.dto.PaymentActiveDTO;
import com.fuint.business.marketingActivity.activeExchange.service.ActiveExchangeService;
import com.fuint.business.marketingActivity.activeExchange.vo.PaymentActiveVO;
import com.fuint.business.marketingActivity.activeFullminusRecords.entity.ActiveFullminusRecords;
import com.fuint.business.marketingActivity.activeFullminusRecords.mapper.ActiveFullminusRecordsMapper;
@ -27,6 +29,7 @@ import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -57,6 +60,9 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
private ActiveFullminusRecordsService activeFullminusRecordsService;
@Resource
private ActiveDiscountRecordsService activeDiscountRecordsService;
@Resource
@Lazy
private ActiveExchangeService activeExchangeService;
/**
* 分页查询所有数据
* @param page
@ -65,8 +71,6 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
*/
@Override
public IPage select(Page page, CardFavorableRecord cardFavorableRecord) {
//构建查询条件
LambdaQueryWrapper<CardFavorableRecord> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtils.isNotEmpty(cardFavorableRecord.getMobile())){
@ -184,6 +188,10 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
*/
@Override
public boolean isDrawDown(CardFavorableRecord cardFavorableRecord) {
LambdaQueryWrapper<CardFavorable> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(CardFavorable::getStoreId,cardFavorableRecord.getStoreId());
List<CardFavorable> list1 = cardFavorableService.list(queryWrapper1);
boolean isDrawDown = false;
//登录用户信息
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@ -192,7 +200,7 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
queryWrapper.eq(CardFavorableRecord::getStoreId,cardFavorableRecord.getStoreId());
//如果领过券 就不让领了
List<CardFavorableRecord> list = list(queryWrapper);
if (CollectionUtils.isEmpty(list)){
if (CollectionUtils.isEmpty(list) && CollectionUtils.isNotEmpty(list1) && list.size() <list1.size()){
isDrawDown = true;
}
return isDrawDown;
@ -264,6 +272,13 @@ public class CardFavorableRecordServiceImpl extends ServiceImpl<CardFavorableRec
activeDiscountRecords.setStoreId(paymentActiveVO.getStoreId());
flag = activeDiscountRecordsService.save(activeDiscountRecords);
}
PaymentActiveDTO paymentActiveDTO = new PaymentActiveDTO();
paymentActiveDTO.setUserId(userId);
paymentActiveDTO.setAmount(paymentActiveVO.getOrderAmount());
paymentActiveDTO.setStoreId(paymentActiveVO.getStoreId());
paymentActiveDTO.setOilId(paymentActiveVO.getOilId());
paymentActiveDTO.setMtUserLevel(paymentActiveVO.getMtUserLevel());
activeExchangeService.activeConsumption(paymentActiveDTO);
return flag;
}
}

View File

@ -3,13 +3,16 @@ package com.fuint.business.marketingActivity.cardFavorable.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTO;
import com.fuint.business.marketingActivity.cardFavorable.dto.CardFavorableDTOS;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableMapper;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorable;
import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRecordMapper;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO;
import com.fuint.business.marketingActivity.cardFavorable.vo.CouponVO;
@ -19,10 +22,12 @@ import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@ -40,6 +45,9 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
private StoreService storeService;
@Resource
private CardFavorableRecordMapper cardFavorableRecordMapper;
@Resource
@Lazy
private CardFavorableRecordService cardFavorableRecordService;
/**
* 新增数据
* @param cardFavorableDTO
@ -95,9 +103,26 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
queryWrapper.eq(CardFavorable::getStoreId,storeId);
queryWrapper.orderByDesc(CardFavorable::getCreateTime);
IPage page1 = page(page, queryWrapper);
//本店所有的优惠券
List<CardFavorable> records = page1.getRecords();
if (records.size()>3){
List<CardFavorable> cardFavorables = records.subList(0, 3);
ArrayList<CardFavorable> cardFavorableArrayList = new ArrayList<>();
//登录人已领优惠券
LambdaQueryWrapper<CardFavorableRecord> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(CardFavorableRecord::getMtUserId,TokenUtil.getNowAccountInfo().getId());
queryWrapper1.eq(CardFavorableRecord::getStoreId,storeId);
List<CardFavorableRecord> list = cardFavorableRecordService.list(queryWrapper1);
if (CollectionUtils.isNotEmpty(list)){
for (CardFavorableRecord cardFavorableRecord : list) {
for (CardFavorable record : records) {
if(!cardFavorableRecord.getCardFavorableId().equals(record.getId())){
CardFavorable one = getById(record.getId());
cardFavorableArrayList.add(one);
}
}
}
}
if (cardFavorableArrayList.size()>3){
List<CardFavorable> cardFavorables = cardFavorableArrayList.subList(0, 3);
page1.setRecords(cardFavorables);
}
return page1;

View File

@ -20,6 +20,8 @@ public class CardValueRecordDTO extends CardValueRecord {
private Integer cardFavorableId;
//卡券领取记录id
private Integer cardRecordId;
private String appltType;
private String paymentType;
// /**
// * 会员id

View File

@ -67,15 +67,19 @@
combined_result.storeId,
combined_result.OilName,
combined_result.type
combined_result.paymentType
FROM
(SELECT '储值卡' AS recordName,mt_user_id mtUserId, recharge_balance rechargeBalance, gift_balance obtain, fringe_benefit oilName,royalty_type type,create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_value_record
(SELECT '储值卡' AS recordName,payment_type paymentType,mt_user_id mtUserId, recharge_balance rechargeBalance, gift_balance obtain, fringe_benefit oilName,royalty_type type,create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_value_record
UNION
SELECT '升数卡' AS recordName,mt_user_id mtUserId, recharge_balance rechargeBalance, income_litres obtain,oil_name oilName,type, create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_fuel_record) AS combined_result
SELECT '升数卡' AS recordName,payment_type paymentType,mt_user_id mtUserId, recharge_balance rechargeBalance, income_litres obtain,oil_name oilName,type, create_time createTime, chain_store_id chainStoreId, store_id storeId FROM card_fuel_record) AS combined_result
<where>
<if test="cardValueRecord.mtUserId != null">
and combined_result.mtUserId = #{cardValueRecord.mtUserId}
</if>
<if test="cardValueRecord.appltType != null">
and combined_result.payment_type = #{cardValueRecord.appltType}
</if>
<if test="cardValueRecord.storeId != null">
and combined_result.storeId = #{cardValueRecord.storeId}
</if>

View File

@ -15,6 +15,7 @@ import com.fuint.api.fuyou.entity.ReturnParameter;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.business.commission.entity.CommissionRecord;
import com.fuint.business.commission.mapper.CommissionRecordMapper;
import com.fuint.business.commission.service.CommissionRecordService;
import com.fuint.business.integral.entity.IntegralDetail;
import com.fuint.business.integral.service.IntegralDetailService;
@ -121,6 +122,8 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
private CardExchangeRecordService cardExchangeRecordService;
@Autowired
private ILJStoreService storeService;
@Resource
private CommissionRecordMapper commissionRecordMapper;
/**
* 储值卡充值新增
* @param cardValueRecordDTO
@ -777,6 +780,16 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
}
userBalanceService.save(userBalance1);
}
//员工提成 commissionRecordMapper
if (ObjectUtils.isNotEmpty(cardValueOrders.getAmountCommission())){
Integer staffId = cardValueOrders.getStaffId();
CommissionRecord commissionRecord = new CommissionRecord();
commissionRecord.setStoreId(cardValueOrders.getStoreId());
commissionRecord.setAmount(cardValueOrders.getAmountCommission());
commissionRecord.setStaffId(staffId);
commissionRecord.setType("3");
commissionRecord.setOrderNo(cardValueOrders.getOrderNo());
}
//用户余额变化记录
cardBalanceChange.setUserId(cardValueOrders.getMtUserId());
cardBalanceChange.setStoreId(cardValueOrders.getStoreId());

View File

@ -22,6 +22,7 @@ import com.fuint.utils.Digests;
import com.fuint.utils.Encodes;
import jdk.nashorn.internal.parser.Token;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -95,8 +96,10 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
*/
@Override
public LJStaff selectStaffByMobile(String mobile) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("mobile",mobile);
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
LJStaff staff = baseMapper.selectOne(queryWrapper);
return staff;
}
@ -227,18 +230,23 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
private SettingService settingService;
@Autowired
private BackendFileController backendFileController;
@Autowired
private Environment env;
@Override
public String createStaffQrCode(int id, HttpServletRequest request) throws Exception {
;;
// 根据id查询员工信息和店铺信息
LJStaff staff = this.selectStaffById(id);
LJStore store = storeService.selectStoreByStoreId(staff.getStoreId());
//在图片上生成二维码
String backgroundImage = "D:/ruoyi/qrCode/cailibao_bg.jpg";
String logoImage = "D:/ruoyi/qrCode/logo.png";
// String backgroundImage = "/static/qrCodeImg/laigeyouhui_bg.jpg";
// String logoImage = "/static/qrCodeImg/logo.png";
String backgroundImage = env.getProperty("staff.bg");
String logoImage = env.getProperty("staff.logo");
String url = staff.getStaffCode();
String area = store.getName();
String finalPath="D:/ruoyi/qrCode/" + area + ".jpg";
String finalPath="D:/qrCode/" + area + ".jpg";
//背景图片路径 loge图片 二维码 输出地址
createLogoCodePicture(backgroundImage, logoImage, url, finalPath, area,store.getAddress());

View File

@ -1,5 +1,6 @@
package com.fuint.business.member.utils;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.extra.qrcode.QrCodeUtil;
import cn.hutool.extra.qrcode.QrConfig;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
@ -27,7 +28,10 @@ public class QrCodeUtils {
try {
// 读取原图片信息
//得到文件
File file = ResourceUtils.getFile(roundImage);
// File file = ResourceUtils.getFile(roundImage);
ClassPathResource resource = new ClassPathResource(roundImage);
ClassPathResource logoResource = new ClassPathResource(logoImage);
File file = resource.getFile();
//文件转化为图片
Image srcImg = ImageIO.read(file);
//获取图片的宽
@ -39,7 +43,7 @@ public class QrCodeUtils {
Graphics2D g = bufImg.createGraphics();
g.drawImage(srcImg, 0, 0, srcImgWidth, srcImgHeight, null);
//使用工具类生成二维码
Image image = createQrCode(logoImage, url, 360, 360);
Image image = createQrCode(logoResource.getFile().toString(), url, 360, 360);
//将小图片绘到大图片上,500,300 .表示你的小图片在大图片上的位置
g.drawImage(image, 260, 320, null);
// 设置字体样式字体大小

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.entity.LJOrder;
import com.fuint.business.order.service.GrowthValueChangeService;
import com.fuint.business.order.vo.GrowthValueChangeVo;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -27,11 +28,11 @@ public class GrowthValueChangeController extends BaseController {
* @return
*/
@GetMapping("/list")
public ResponseObject list(GrowthValueChange growthValueChange,
public ResponseObject list(GrowthValueChangeVo growthValueChange,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
IPage<GrowthValueChange> list = growthValueChangeService.selectGrowthValueChangeList(page,growthValueChange);
IPage<GrowthValueChangeVo> list = growthValueChangeService.selectGrowthValueChangeList(page,growthValueChange);
return getSuccessResult(list);
}
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.vo.GrowthValueChangeVo;
import org.apache.ibatis.annotations.Param;
public interface GrowthValueChangeMapper extends BaseMapper<GrowthValueChange> {
@ -13,5 +14,5 @@ public interface GrowthValueChangeMapper extends BaseMapper<GrowthValueChange> {
* @param growthValueChange
* @return
*/
public IPage<GrowthValueChange> selectGrowthValueChangeList(@Param("page") Page page,@Param("growthValueChange") GrowthValueChange growthValueChange);
public IPage<GrowthValueChangeVo> selectGrowthValueChangeList(@Param("page") Page page, @Param("growthValueChange") GrowthValueChangeVo growthValueChange);
}

View File

@ -1,12 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.order.mapper.GrowthValueChangeMapper">
<select id="selectGrowthValueChangeList" resultType="com.fuint.business.order.entity.GrowthValueChange">
select * from growth_value_change
<select id="selectGrowthValueChangeList" resultType="com.fuint.business.order.vo.GrowthValueChangeVo">
select gvc.*,ms.name storeName from growth_value_change gvc
left join mt_store ms on store_id = ms.id
<where>
<if test="growthValueChange.storeId != null and growthValueChange.storeId != ''">
and store_id = #{growthValueChange.storeId}
and gvc.store_id = #{growthValueChange.storeId}
</if>
<if test="growthValueChange.userId != null and growthValueChange.userId != ''">
and gvc.user_id = #{growthValueChange.userId}
</if>
</where>
order by gvc.create_time desc
</select>
</mapper>

View File

@ -3,6 +3,7 @@ package com.fuint.business.order.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.vo.GrowthValueChangeVo;
public interface GrowthValueChangeService {
/**
@ -11,7 +12,7 @@ public interface GrowthValueChangeService {
* @param growthValueChange
* @return
*/
public IPage<GrowthValueChange> selectGrowthValueChangeList(Page page, GrowthValueChange growthValueChange);
public IPage<GrowthValueChangeVo> selectGrowthValueChangeList(Page page, GrowthValueChangeVo growthValueChange);
/**
* 根据id查询成长值变化记录信息

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.entity.GrowthValueChange;
import com.fuint.business.order.mapper.GrowthValueChangeMapper;
import com.fuint.business.order.service.GrowthValueChangeService;
import com.fuint.business.order.vo.GrowthValueChangeVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
@ -13,7 +14,7 @@ import org.springframework.stereotype.Service;
@Service
public class GrowthValueChangeServiceImpl extends ServiceImpl<GrowthValueChangeMapper, GrowthValueChange> implements GrowthValueChangeService {
@Override
public IPage<GrowthValueChange> selectGrowthValueChangeList(Page page, GrowthValueChange growthValueChange) {
public IPage<GrowthValueChangeVo> selectGrowthValueChangeList(Page page, GrowthValueChangeVo growthValueChange) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
growthValueChange.setStoreId(nowAccountInfo.getStoreId());
return baseMapper.selectGrowthValueChangeList(page,growthValueChange);

View File

@ -40,9 +40,11 @@ import com.fuint.business.petrolStationManagement.service.OilTankService;
import com.fuint.business.petrolStationManagement.service.OilTrackingService;
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.service.ChainStoreConfigService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService;
@ -94,6 +96,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
private StaffCommissionService staffCommissionService;
@Autowired
private GrowthValueChangeService growthValueChangeService;
@Autowired
private ChainStoreConfigService chainStoreConfigService;
@Override
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
@ -556,7 +560,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1(0.0, userId, Integer.valueOf(oilOrder.getOils()), refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()), storeId,orderNo);
this.updateGrowthValue1(oilAmount,0.0, userId, Integer.valueOf(oilOrder.getOils()), refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()), storeId,orderNo);
this.insertOilBalance(userId,storeId,oilName.getId().toString(),oilName.getOilType(),Double.valueOf(oilOrders.get(i).get("liters").toString()),refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()),orderNo);
}else if (refuelMoneyLiters>0 && (Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice<=cardBalance){
flag = true;
@ -593,7 +597,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1((Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId,orderNo);
this.updateGrowthValue1(oilAmount,(Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice, userId, Integer.valueOf(oilOrder.getOils()), 0.0, storeId,orderNo);
this.insertOilBalance(userId,storeId,oilName.getId().toString(),oilName.getOilType(),refuelMoneyLiters,0.0,orderNo);
} else if (cardBalance >= oilAmount){
flag = true;
@ -630,7 +634,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
// this.insertCardBalance((Double.valueOf(oilOrders.get(i).get("liters").toString())-refuelMoneyLiters)*oilPrice,userId,storeId);
}else {
res.put("error","囤油卡或储值卡余额不足!");
@ -672,7 +676,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
baseMapper.insert(order);
oilOrder = this.selectOilOrderByOrderNo(orderNo);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
}
}
@ -757,7 +761,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setSeekZero(0.0);
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,oilLiters,"1",orderNo);
// this.insertCardBalance(oilAmount,userId,storeId);
@ -808,7 +812,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
* @param oilId 油号id
* @param refuelMoney 扣除的囤油卡升数
*/
private void updateGrowthValue1(Double oilActualPay,Integer userid,Integer oilId,Double refuelMoney,Integer storeId,String orderNo){
private void updateGrowthValue1(Double oilAmount,Double oilActualPay,Integer userid,Integer oilId,Double refuelMoney,Integer storeId,String orderNo){
OilName oilName = oilNameService.selectOilNameById(oilId);
// 获取成长值增长数值
Integer gasGrowthValue = null;
@ -842,9 +846,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Page page = new Page(1,20);
LJUserGrade ljUserGrade1 = new LJUserGrade();
List<LJUserGrade> records = userGradeService.selectUserGradeAll(storeId);
if (oilName.getOilType().equals("汽油")){
gasGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("gas_growth_value"));
Integer addVal = (int) (gasGrowthValue * oilActualPay);
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreByStoreId(storeId);
if (oilName.getOilType().equals("汽油") && ObjectUtil.isNotEmpty(chainStoreConfig)){
gasGrowthValue = Integer.valueOf(chainStoreConfig.getGasGrowthValue());
Integer addVal = (int) (gasGrowthValue * oilAmount);
addGrowthVal = addVal;
growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -857,9 +862,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
}
balance.setGrowthValue(growthAfter);
}else if(oilName.getOilType().equals("柴油")){
dieselGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("diesel_growth_value"));
Integer addVal = (int) (dieselGrowthValue * oilActualPay);
}else if(oilName.getOilType().equals("柴油") && ObjectUtil.isNotEmpty(chainStoreConfig)){
dieselGrowthValue = Integer.valueOf(chainStoreConfig.getDieselGrowthValue());
Integer addVal = (int) (dieselGrowthValue * oilAmount);
addGrowthVal = addVal;
growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -872,9 +877,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
}
balance.setGrowthValue(growthAfter);
}else{
naturalGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("natural_growth_value"));
Integer addVal = (int) (naturalGrowthValue * oilActualPay);
}else if (oilName.getOilType().equals("天然气") && ObjectUtil.isNotEmpty(chainStoreConfig)){
naturalGrowthValue = Integer.valueOf(chainStoreConfig.getNaturalGrowthValue());
Integer addVal = (int) (naturalGrowthValue * oilAmount);
addGrowthVal = addVal;
growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -887,7 +892,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
}
balance.setGrowthValue(growthAfter);
}
}else {}
// balance.setCardBalance(balance.getCardBalance()-oilActualPay);
userBalanceService.updateUserBalance(balance);
@ -1291,9 +1296,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Page page = new Page(1,20);
LJUserGrade ljUserGrade1 = new LJUserGrade();
List<LJUserGrade> records = userGradeService.selectUserGradeAll(storeId);
if (oilName.getOilType().equals("汽油")){
gasGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("gas_growth_value"));
Integer addVal = (int) (gasGrowthValue * oilActualPay);
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreByStoreId(storeId);
if (oilName.getOilType().equals("汽油") && ObjectUtil.isNotEmpty(chainStoreConfig)){
gasGrowthValue = Integer.valueOf(chainStoreConfig.getGasGrowthValue());
Integer addVal = (int) (gasGrowthValue * oilAmount);
addGrowthVal = addVal;
growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -1306,9 +1312,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
}
balance.setGrowthValue(growthAfter);
}else if(oilName.getOilType().equals("柴油")){
dieselGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("diesel_growth_value"));
Integer addVal = (int) (dieselGrowthValue * oilActualPay);
}else if(oilName.getOilType().equals("柴油") && ObjectUtil.isNotEmpty(chainStoreConfig)){
dieselGrowthValue = Integer.valueOf(chainStoreConfig.getDieselGrowthValue());
Integer addVal = (int) (dieselGrowthValue * oilAmount);
addGrowthVal = addVal;
growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -1321,9 +1327,9 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
}
balance.setGrowthValue(growthAfter);
}else{
naturalGrowthValue = Integer.valueOf(sysConfigService.getValueByKey("natural_growth_value"));
Integer addVal = (int) (naturalGrowthValue * oilActualPay);
}else if (oilName.getOilType().equals("天然气") && ObjectUtil.isNotEmpty(chainStoreConfig)){
naturalGrowthValue = Integer.valueOf(chainStoreConfig.getNaturalGrowthValue());
Integer addVal = (int) (naturalGrowthValue * oilAmount);
addGrowthVal = addVal;
growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
@ -1336,7 +1342,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
}
}
balance.setGrowthValue(growthAfter);
}
}else {}
// 修改用户成长值
Integer consumeNum = balance.getConsumeNum();
balance.setConsumeNum(consumeNum+1);

View File

@ -0,0 +1,10 @@
package com.fuint.business.order.vo;
import com.fuint.business.order.entity.GrowthValueChange;
public class GrowthValueChangeVo extends GrowthValueChange {
/**
* 店铺名称
*/
private String storeName;
}

View File

@ -96,7 +96,7 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> impleme
qrCode.setChainStoreId(store.getChainStoreId());
// 带有店铺id 跳转首页
qrCode.setCollection("https://www.tuofeng.cc/oilIndex?storeId="+store.getId());
qrCode.setCollection("https://www.tuofeng.cc/oilStation?storeId="+store.getId());
// 带有店铺id 跳转一键加油页面
qrCode.setPayment("https://www.tuofeng.cc/oilRefuel?storeId="+store.getId());
row = baseMapper.insert(qrCode);

View File

@ -29,7 +29,9 @@ public class ChainStoreConfigServiceImpl extends ServiceImpl<ChainStoreConfigMap
public ChainStoreConfig selectChainStoreConfigById() {
LJStore store = storeService.selectStoreById();
Integer id = store.getChainStoreId();
return baseMapper.selectById(id);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("chain_store_id",id);
return baseMapper.selectOne(queryWrapper);
}
/**
@ -94,6 +96,18 @@ public class ChainStoreConfigServiceImpl extends ServiceImpl<ChainStoreConfigMap
LJStore store = storeService.selectStoreByStoreId(storeId);
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("chain_store_id",store.getChainStoreId());
return baseMapper.selectOne(queryWrapper);
ChainStoreConfig chainStoreConfig = baseMapper.selectOne(queryWrapper);
if (ObjectUtil.isEmpty(chainStoreConfig)){
ChainStoreConfig chainStoreConfig1 = new ChainStoreConfig();
chainStoreConfig1.setChainStoreId(store.getChainStoreId());
chainStoreConfig1.setIsEnableLevel("no");
chainStoreConfig1.setIsMonthClear("clear_month");
chainStoreConfig1.setGasGrowthValue("1");
chainStoreConfig1.setDieselGrowthValue("1");
chainStoreConfig1.setNaturalGrowthValue("1");
baseMapper.insert(chainStoreConfig1);
}
chainStoreConfig = baseMapper.selectOne(queryWrapper);
return chainStoreConfig;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询成长值记录信息列表
export function listGrowthValueRecord(query) {
return request({
url: '/business/growthValueChange/list',
method: 'get',
params: query
})
}

View File

@ -209,6 +209,7 @@ export default {
}
},
created() {
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
this.getUser()

View File

@ -76,9 +76,9 @@ export default {
}
},
created() {
this.userId = this.pUserId;
// this.userId = this.$route.query.id;
console.log( "111111",this.userId)
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
this.getList()
this.getOilName()
},
@ -109,14 +109,13 @@ export default {
},
getOilName(){
oilNumbers().then(res => {
console.log(res)
this.oilNameList = res.data
})
},
getList(){
this.loading = true
// this.queryParams.mtUserId = this.userId
this.queryParams.mtUserId = this.userId
getCardFavorableList(this.queryParams).then(res=>{
if (res.code == 200) {
@ -129,7 +128,6 @@ export default {
})
},
changeStatus() {
console.log("12312312312312312",this.cardList)
if (this.cardList == 'notUse') {
this.queryParams.status = 0
} else if (this.cardList == 'used') {

View File

@ -1,12 +1,23 @@
<template>
<div>
<el-table ref="tables" v-loading="loading" :data="list">
<el-table-column label="所属油站" prop="id" align="center"/>
<el-table-column label="变动时间" align="center"/>
<el-table-column label="类型" align="center" prop="userNo"/>
<el-table-column label="变动成长值" align="center" prop="name" />
<el-table-column label="描述" align="center" prop="name" />
<el-table-column label="类型" align="center" prop="balance"/>
<el-table-column label="所属油站" prop="storeName" align="center">
<template slot-scope="scope">
<span>{{scope.row.storeName ? scope.row.storeName : storeName}}</span>
</template>
</el-table-column>
<el-table-column label="变动时间" prop="createTime" align="center"/>
<el-table-column label="类型" align="center" prop="changeType">
<template slot-scope="scope">
<el-tag v-if="scope.row.changeType == 0">减少</el-tag>
<el-tag type="success" v-else>增加</el-tag>
</template>
</el-table-column>
<el-table-column label="变动成长值" align="center" prop="growthValue" />
<el-table-column label="变动后成长值" align="center" prop="afterTheChange" />
<el-table-column label="描述" align="center" prop="fromType" />
</el-table>
<pagination
@ -19,6 +30,9 @@
</template>
<script>
import {ljStoreInfo} from "@/api/staff/store";
import {listGrowthValueRecord} from "@/api/cashier/growthvaluerecord";
export default {
props:["pUserId"],
data(){
@ -30,15 +44,31 @@ export default {
queryParams:{
page:1,
pageSize:10,
}
},
storeName:""
}
},
created() {
this.userId = this.pUserId;
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
this.getList()
this.getStoreName()
},
methods:{
getList(){
getStoreName(){
ljStoreInfo().then(res => {
this.storeName = res.data.name
})
},
getList(){
this.loading = true
this.queryParams.userId = this.userId
listGrowthValueRecord(this.queryParams).then(res => {
this.list = res.data.records
this.total = res.data.total
this.loading = false
})
}
}
}

View File

@ -84,7 +84,6 @@ export default {
getPayType(){
getDicts("payment_type").then(res => {
this.payTypeList = res.data
console.log(res)
})
},
//

View File

@ -45,7 +45,6 @@ export default {
created() {
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
console.log('1212',this.userId)
this.getList()
},
methods:{

View File

@ -35,7 +35,8 @@ export default {
}
},
created() {
this.userId = this.pUserId;
// this.userId = this.pUserId;
this.userId = this.$route.query.id;
},
methods:{
getList(){

View File

@ -1,6 +1,6 @@
<script>
export default {
onLaunch: function() {
onLaunch: function(e) {
console.log('App Launch')
// #ifdef MP-WEIXIN
uni.setStorageSync("appltType","WECHAT")
@ -42,6 +42,36 @@
uni.setStorageSync("appltType","ALIPAY")
console.log("支付宝")
my.canIUse('button.open-type.getAuthorize')
//qrCode
if (e.query && e.query.qrCode) {
console.log(JSON.stringify(e)+"1.0")
let q = e.query.qrCode;
if (e.query.qrCode) {
let str = q.split("?")[1];
let storeId = "";
let staffId = "";
if (str.includes("&")){
let arr = str.split("&");
arr.forEach(item => {
if (item.includes("storeId")) {
storeId = item.split("=")[1]
}else {
staffId = item.split("=")[1]
}
})
}else{
if (str.includes("storeId")) {
storeId = str.split("=")[1]
}
}
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
uni.showLoading({
title:uni.getStorageSync("storeId") + "staffId" + uni.getStorageSync("inviteStaffId")
})
}
}
// #endif
},
onShow: function() {

View File

@ -5,7 +5,7 @@ module.exports = {
// baseUrl: 'http://192.168.0.196:8081/',
// baseUrl: 'http://192.168.1.4:8080/',
baseUrl: 'http://192.168.0.178:8008/',
baseUrl: 'http://192.168.0.121:8080/',

View File

@ -9,8 +9,11 @@
<swiper class="swiper" style="width: 100%;height: 300px;" circular :indicator-dots="indicatorDots"
:autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-for="(item,index) in list1" :key="index" @click="goPage(item.routeUrl)">
<view class="swiper-item uni-bg-red"></view>
<image style="width: 100%;" :src="item.bannerUrl"></image>
<view class="swiper-item uni-bg-red">
<image style="width: 100%;" :src="item.bannerUrl"></image>
</view>
<!-- <image style="width: 100%;" :src="getBannerUrl(item.bannerUrl)"></image> -->
</swiper-item>
</swiper>
</view>
@ -83,9 +86,9 @@
<view class="station-title" style="display: flex;justify-content: space-between;">
{{store.name}}{{store.description ? "("+store.description+")" : ""}}
<view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
<!-- <view class="" @click="goChooseAddress" style="width: 22%;font-size: 14px;font-weight: 400;">
<view>切换位置 <uni-icons type="right" color="#304fff" size="16"></uni-icons> </view>
</view>
</view> -->
</view><!--顺通石化加油站(工业南路站)-->
<view style="display: flex;">
<view class="bule-icon" v-if="welfare.length!=0" v-for="(item,index) in welfare" :key="index">
@ -114,7 +117,7 @@
<!-- <u-picker :show="show" :columns="columns" @confirm="confirm" @cancel="cancel"></u-picker> -->
<u-picker :columns="columns" @confirm="confirm" :show="show" @cancel="show = false"
keyName="label"></u-picker>
<u-overlay :show="shows">
<u-overlay :show="shows == true">
<image src="../../static/imgs/zzxryl.png"
style="width: 280px; height: 350px; margin: 20px auto; margin-top: 200px; ">
</image>
@ -238,6 +241,16 @@ import { callWithErrorHandling } from "vue"
tabbar
},
methods: {
//
getBannerUrl(url){
let imgurl = ""
if (url.includes("http")){
imgurl = url
}else {
imgurl = this.baseUrl + url
}
return imgurl;
},
// banner
goPage(url) {
uni.navigateTo({
@ -246,12 +259,21 @@ import { callWithErrorHandling } from "vue"
},
//
getIndexBanner() {
let _this = this
if (uni.getStorageSync("storeId")) {
request({
url: 'business/indexBanner/list/' + uni.getStorageSync("storeId"),
method: 'get',
}).then(res => {
this.list1 = res.data
_this.list1 = res.data
for (let i = 0;i<res.data.length;i++){
if (res.data[i].bannerUrl.includes("http")){
_this.list1[i].bannerUrl = res.data[i].bannerUrl
}else{
_this.list1[i].bannerUrl = _this.baseUrl + res.data[i].bannerUrl
}
}
console.log(_this.list1);
})
}
},
@ -434,6 +456,8 @@ import { callWithErrorHandling } from "vue"
_this.list3.push(_this.baseUrl + item)
})
}
_this.getIndexBanner()
})
// uni.showToast({
@ -526,7 +550,7 @@ import { callWithErrorHandling } from "vue"
address,
latitude,
longitude
}) => { //
}) => { //
// this.addressName = address;
console.log(name, address, latitude, longitude);
this.longitude = longitude;
@ -838,4 +862,4 @@ import { callWithErrorHandling } from "vue"
color: white;
margin: 0 auto;
}
</style>
</style>

View File

@ -8,7 +8,7 @@
<view class="top-box">
<view class="dis" style="width: 78%;">
<view class="top-img">
<image v-if="store.logo==''||store.logo==null||store.logo==undefined" src="../../static/logo.png" mode="aspectFit"></image>
<image v-if="!store.logo" src="../../static/logo.png" mode="aspectFit"></image>
<image v-else :src="baseUrl+store.logo" mode="aspectFit"></image>
</view>
<view style="width: 80%;">
@ -175,33 +175,40 @@
tabbar
},
onLoad(query) {
const q = decodeURIComponent(query.q) //
if (query.q) {
let str = q.split("?")[1];
let storeId = "19";
let staffId = "";
if (str.includes("&")){
let arr = str.split("&");
arr.forEach(item => {
if (item.includes("storeId")) {
storeId = item.split("=")[1]
} else {
staffId = item.split("=")[1]
}
})
}else{
storeId = str.split("=")[1]
if (uni.getStorageSync("appltType") == "WECHAT"){
const q = decodeURIComponent(query.q) //
if (query.q) {
let str = q.split("?")[1];
let storeId = "19";
let staffId = "";
if (str.includes("&")){
let arr = str.split("&");
arr.forEach(item => {
if (item.includes("storeId")) {
storeId = item.split("=")[1]
} else {
staffId = item.split("=")[1]
}
})
}else{
storeId = str.split("=")[1]
}
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
this.getStore(uni.getStorageSync("storeId"));
}
}else{
if (uni.getStorageSync("storeId")){
this.getStore(uni.getStorageSync("storeId"));
}
uni.setStorageSync("storeId", storeId)
uni.setStorageSync("inviteStaffId", staffId)
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
this.getStore(uni.getStorageSync("storeId"));
}
},
onShow() {
// this.isExistStoreId();
@ -333,7 +340,22 @@
//
getSIndex(index,id) {
this.sindex = index
this.toPayment(id)
//
request({
url: "business/petrolStationManagement/oilTank/" + uni.getStorageSync('tankId'),
method: 'get',
}).then((res)=>{
if (res.data.storedQuantity-this.liters<0){
uni.showToast({
title:"所加油的升数大于油罐内的升数,请重新选择加油升数",
icon:"none"
})
return;
}else {
this.toPayment(id)
}
})
},
toPayment(id){
this.oilOrder.orderAmount = this.value

View File

@ -312,6 +312,45 @@
}
});
}
if (_this.appltType == "ALIPAY") {
my.tradePay({
tradeNO: res.data.data.reservedTransactionId
}, function(resp) {
if (resp.resultCode == '9000') {
console.log("支付成功")
// 使
/* _this.preferentialData.storeId = _this.oilOrder.storeId
_this.preferentialData.orderAmount = _this.oilOrder.orderAmount
_this.preferentialData.oilId = _this.oilOrder.oils
_this.preferentialData.mtUserLevel = _this.user.gradeId
request({
url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById",
method: 'post',
data: _this.preferentialData,
}).then((res)=>{
console.log(res);
}) */
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
} else {
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
data: {
"orderNo": res.data.data.orderNo,
"status": "payFail"
},
}).then((res) => {
uni.showToast({
title: "支付失败!",
icon: "error"
})
})
console.log('支付失败,' + resp.resultCode);
}
});
}
})
},
@ -381,6 +420,45 @@
}
});
}
if (_this.appltType == "ALIPAY") {
my.tradePay({
tradeNO: res.data.data.reservedTransactionId
}, function(resp) {
if (resp.resultCode == '9000') {
console.log("支付成功")
// 使
/* _this.preferentialData.storeId = _this.oilOrder.storeId
_this.preferentialData.orderAmount = _this.oilOrder.orderAmount
_this.preferentialData.oilId = _this.oilOrder.oils
_this.preferentialData.mtUserLevel = _this.user.gradeId
request({
url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById",
method: 'post',
data: _this.preferentialData,
}).then((res)=>{
console.log(res);
}) */
uni.reLaunch({
url: '/pagesRefuel/orderSuccess/index'
})
} else {
request({
url: "/business/allOrderInfo/orderStatus",
method: 'post',
data: {
"orderNo": res.data.data.orderNo,
"status": "payFail"
},
}).then((res) => {
uni.showToast({
title: "支付失败!",
icon: "error"
})
})
console.log('支付失败,' + resp.resultCode);
}
});
}
})
},

View File

@ -14,7 +14,7 @@
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<!-- <button class="dl-box" open-type="getPhoneNumber" @getphonenumber="getUserLogin">手机号快捷登录</button> -->
<button open-type="getAuthorize" scope='phoneNumber' class="dl-box" hover-class="button-active"
<button open-type="getAuthorize" scope='phoneNumber' class="dl-box" hover-class="button-active"
@getAuthorize="getUserLogin">手机号快捷登录</button>
<!-- #endif -->
<button class="kk-box" @click="goback">我再看看</button>
@ -23,9 +23,9 @@
<view class="lanquanzi" v-if="qindex == true" @click="qindex =! qindex"><u-icon name="checkbox-mark"
color="#ffffff" size="14"></u-icon></view>
<text>请仔细阅读</text>
<text class="lan">用户协议</text>
<text class="lan" @click="gopv()">用户协议</text>
<text></text>
<text class="lan">隐私政策</text>
<text class="lan" @click="gopv()">隐私政策</text>
</view>
</view>
</view>
@ -48,6 +48,12 @@
},
components: {},
methods: {
gopv() {
uni.navigateTo({
url: '/pagesLogin/login/webview'
})
},
// userid
getUserLogin(e) {
// if (this.qindex == false) {
@ -61,7 +67,7 @@
console.log(e)
let _this = this;
my.getPhoneNumber({
scopes: 'auth_base',
success: res1 => {
@ -83,15 +89,16 @@
storeId: 0,
staffId: "",
phone: "18457621459",
encryptedData:encryptedData,
encryptedData: encryptedData,
},
}).then((resp) => {
console.log(resp)
if (resp.code == 200) {
uni.setStorageSync('App-Token', resp.data.token);
uni.setStorageSync('chainStoreId', resp.data.chainStoreId);
uni.setStorageSync('chainStoreId', resp.data
.chainStoreId);
uni.navigateTo({
url: '/pages/index/index'
})
@ -104,8 +111,8 @@
console.log('my.getAuthCode 调用失败', err)
}
});
},
fail: err => {
console.log('my.getAuthCode 调用失败', err)
@ -366,4 +373,4 @@
border: 1px solid #0078FF;
color: white;
}
</style>
</style>

View File

@ -60,7 +60,7 @@
<text>评价有礼</text>
</view>
</view>
<view v-else-if="item.orderStatus=='unpaid'" class="end-box" @click="goPayment()">
<view v-else-if="item.orderStatus=='unpaid'" class="end-box" @click="goPayment(item.orderNo)">
<view class="anniu">
<text>去支付</text>
</view>
@ -403,8 +403,10 @@
// this.getBalanceOrder()
}
},
goPayment(){
goPayment(orderNo){
uni.navigateTo({
url: '/pagesRefuel/orderDetail/index?orderNo=' + orderNo,
})
},
goComment() {
uni.navigateTo({

View File

@ -7,6 +7,7 @@
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<!-- #ifdef MP-WEIXIN -->
<button class="box-hang" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<view class="">头像</view>
<view class="touxiang">
@ -14,6 +15,16 @@
<image class="touxiang" v-else src="@/static/imgs/myx.png" mode="aspectFit"></image>
</view>
</button>
<!-- #endif -->
<!-- #ifdef MP-ALIPAY -->
<button class="box-hang" @click="onChooseAvatar1">
<view class="">头像</view>
<view class="touxiang">
<image class="touxiang" v-if="user.avatar!='' && user.avatar!=null && user.avatar!=undefined" :src="baseUrl + user.avatar" mode="aspectFit"></image>
<image class="touxiang" v-else src="@/static/imgs/myx.png" mode="aspectFit"></image>
</view>
</button>
<!-- #endif -->
<view class="box-hang" @click="goEdit(0)">
<view class="">昵称</view>
<view class="dis">
@ -99,6 +110,30 @@
},
})
},
//
onChooseAvatar1(e){
let _this = this;
//使
uni.chooseImage({
sourceType: ['album', 'camera'],//
success: (res) => {
console.log('图片', res)
var tempFilePath = res.tempFilePaths;
var filePath = tempFilePath[0];
console.log(filePath);//
//api
//
upload({
url: '/clientApi/file/upload',
filePath: filePath,
}).then((res) => {
console.log('images', res.data.fileName);
_this.user.avatar = res.data.fileName
_this.editUser()
})
}
});
},
//
editUser(){
request({

View File

@ -324,6 +324,9 @@
}
if(res.data.success == "ok"){
_this.preferentialData.storeId = _this.oilOrder.storeId
_this.preferentialData.orderAmount = _this.oilOrder.orderAmount
_this.preferentialData.oilId = _this.oilOrder.oils
_this.preferentialData.mtUserLevel = _this.user.gradeId
request({
url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById",
method: 'post',
@ -361,6 +364,9 @@
console.log('success');
// 使
_this.preferentialData.storeId = _this.oilOrder.storeId
_this.preferentialData.orderAmount = _this.oilOrder.orderAmount
_this.preferentialData.oilId = _this.oilOrder.oils
_this.preferentialData.mtUserLevel = _this.user.gradeId
request({
url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById",
method: 'post',
@ -393,6 +399,9 @@
console.log("支付成功")
// 使
_this.preferentialData.storeId = _this.oilOrder.storeId
_this.preferentialData.orderAmount = _this.oilOrder.orderAmount
_this.preferentialData.oilId = _this.oilOrder.oils
_this.preferentialData.mtUserLevel = _this.user.gradeId
request({
url: "business/marketingActivity/cardFavorableRecord/updateCardAndActiveById",
method: 'post',