This commit is contained in:
wangh 2024-01-12 13:58:57 +08:00
commit 250f000040
33 changed files with 812 additions and 295 deletions

View File

@ -20,11 +20,19 @@ export function selectTree(data) {
// 联级选择器 树形数据结构
export function cvsGoodsTree() {
return request({
url: '/business/cvsGoods/tree',
method: 'get',
})
}
return request({
url: '/business/cvsGoods/tree',
method: 'get',
})
}
// 联级选择器 树形数据结构
export function cvsGoodsAll() {
return request({
url: '/business/cvsGoods',
method: 'get',
})
}
// 查询一级分类
export function list(data) {

View File

@ -28,12 +28,12 @@
/>
</el-form-item>
<el-form-item label="" prop="isonline">
<!-- <el-form-item label="" prop="isonline">
<el-select v-model="queryParams.status" placeholder="是否使用">
<el-option label="已使用" value="0"></el-option>
<el-option label="未使用" value="1"></el-option>
</el-select>
</el-form-item>
</el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -62,9 +62,9 @@
<!-- <el-table-column label="员工id" align="center" prop="mtStaffId" />-->
<!-- <el-table-column label="兑换券id" align="center" prop="cardExchangeId" />-->
<el-table-column label="id" align="center" prop="mtUserId" />
<el-table-column label="序号" align="center" prop="mtUserId" />
<el-table-column label="手机号码" align="center" prop="mobile" />
<el-table-column label="" align="center" prop="name" />
<el-table-column label="名" align="center" prop="name" />
<el-table-column label="头像" align="center" prop="photo" />
<el-table-column label="核销人手机号" align="center" prop="staffMobile" />
<el-table-column label="核销人姓名" align="center" prop="realName" />

View File

@ -11,14 +11,6 @@
:options="cvsGoodOptions"
:props="{ checkStrictly: true }"
clearable></el-cascader>
<!-- <el-select-->
<!-- v-model="queryParams.cvsGoodId"-->
<!-- placeholder="全部"-->
<!-- clearable-->
<!-- style="width: 300px"-->
<!-- >-->
<!-- <el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>-->
<!-- </el-select>-->
</el-form-item>
<el-form-item label="供应商" prop="supplierId">
<el-select
@ -201,14 +193,18 @@
</el-col>
<el-col :span="12">
<el-form-item label="所属分类" prop="cvsGoodId">
<el-select
v-model="form.cvsGoodId"
placeholder="全部"
clearable
style="width: 300px"
>
<el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
<!-- <el-select-->
<!-- v-model="form.cvsGoodId"-->
<!-- placeholder="全部"-->
<!-- clearable-->
<!-- style="width: 300px"-->
<!-- >-->
<!-- <el-option v-for="item in cvsGoodList" :key="item.id" :label="item.name" :value="item.id"/>-->
<!-- </el-select>-->
<el-cascader v-model="cvsGoodId"
:options="cvsGoodOptions"
:props="{ checkStrictly: true }"
clearable></el-cascader>
</el-form-item>
</el-col>
</el-row>
@ -331,7 +327,7 @@
<script>
import {cvsGoodsTree, selectTree} from "@/api/convenienceStore/goods";
import {cvsGoodsAll, cvsGoodsTree, selectTree} from "@/api/convenienceStore/goods";
import {addSupplier, listSupplier} from "@/api/convenienceStore/supplier";
import {
addLJGoods,
@ -357,7 +353,7 @@ export default {
//
supplier:"",
// id
cvsGoodId:"",
cvsGoodId:[],
cvsGoodOptions:[],
isAdd:false,
activeName: 'goods',
@ -567,8 +563,8 @@ export default {
},
//
getQueryList(){
selectTree().then(response => {
this.cvsGoodList = response.data.records
cvsGoodsAll().then(response => {
this.cvsGoodList = response.data
});
},
getSuppilers(val){
@ -656,6 +652,21 @@ export default {
const id = row.id || this.ids;
getLJGoods(id).then(response => {
this.form = response.data;
this.cvsGoodOptions.forEach(item => {
if (item.value == response.data.cvsGoodId){
this.cvsGoodId.push(item.value)
}else {
if (item.children.length>0){
item.children.forEach(i => {
if (i.value == response.data.cvsGoodId){
this.cvsGoodId.push(item.value)
this.cvsGoodId.push(i.value)
}
})
}
}
})
// this.cvsGoodId = response.data.cvsGoodId
this.open = true;
this.isAdd = true;
this.title = "编辑商品";
@ -674,6 +685,11 @@ export default {
},
//
submitForm: function() {
if (this.cvsGoodId.length==1){
this.form.cvsGoodId = this.cvsGoodId[0]
}else {
this.form.cvsGoodId = this.cvsGoodId[1]
}
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.stock==0){

View File

@ -551,7 +551,7 @@ export default {
rules: {
name: [
{ required: true, message: "会员名称不能为空", trigger: "blur" },
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
// { min: 2, max: 200, message: '2 100 ', trigger: 'blur' }
],
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }],
status: [{ required: true, message: "请选择会员状态", trigger: "blur" }],

View File

@ -541,7 +541,133 @@
<!-- 子卡管理-->
<el-dialog :title="title" :visible.sync="openSubCard" append-to-body>
<cardValueChild :pUserId="form.id"></cardValueChild>
<!-- <cardValueChild :pUserId="form.id" :handleUpdate="handleUpdate1" :handleAdd="handleAdd1"></cardValueChild>-->
<el-tabs v-model="subCardActive" @tab-click="handleClick">
<el-tab-pane label="子卡管理" name="subCardManage">
<div style="display: flex;justify-content: space-between;margin: 10px 0">
<div style="font-size: 16px">会员信息{{form.mobile}}</div>
<el-button type="primary" :disabled="cardValueChildList.length>=2" @click="handleAdd1">新增子卡</el-button>
</div>
<div>
<el-table ref="tables" v-loading="loading" :data="cardValueChildList">
<el-table-column label="子卡ID" prop="id" align="center" width="60"/>
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center"/>
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed='right'>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate1(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleOrder(scope.row)"
>交易记录</el-button>
</template>
</el-table-column>
</el-table>
<!-- <pagination-->
<!-- :total="total"-->
<!-- :page.sync="queryParams.page"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
</div>
<el-alert
title="关于子卡"
type="info"
style="margin-top: 20px"
:closable="false"
description="子卡为会员子母卡功能,子卡共享母卡的储值额度及信息,子卡为实体会员卡信息,消费需在小程序中才可进行使用">
</el-alert>
</el-tab-pane>
<el-tab-pane label="子卡消费记录" name="consumption">
<div style="display: flex;justify-content: space-between;margin: 10px 0">
<div style="font-size: 16px">
<el-form :model="subCardList" ref="queryForm" size="small" :inline="true" label-width="85px">
<el-form-item label="子卡手机号" prop="cardChildPhones">
<el-input
v-model="subCardList.cardChildPhones"
placeholder="请输入子卡手机号"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付状态" prop="status">
<el-select
v-model="subCardList.status"
placeholder="全部"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.pay_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
</el-form-item>
</el-form>
</div>
</div>
<div>
<el-table ref="tables" v-loading="loading" :data="orderList">
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" class="demo-table-expand" style="margin-left: 20px">
<el-form-item label="备注信息">
<span>{{ props.row.remark }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column label="ID" prop="id" align="center" width="60"/>
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center" />
<el-table-column label="订单号" prop="orderNo" align="center" />
<el-table-column label="订单金额" prop="amount" align="center" />
<el-table-column label="消费金额" prop="payAmount" align="center" />
<el-table-column label="支付状态" prop="status" align="center" >
<template slot-scope="scope">
<dict-tag :options="dict.type.pay_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="支付时间" prop="payTime" align="center" >
<template slot-scope="scope">
<span>{{ scope.row.payTime ? parseTime(scope.row.payTime) :"--" }}</span>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="subCardList.page"
:limit.sync="subCardList.pageSize"
@pagination="getOrderList"
/>
</div>
<el-alert
title="关于子卡"
type="info"
style="margin-top: 20px"
:closable="false"
description="当前会员的所有子卡消费记录信息,可根据对应子卡卡号进行检索查询">
</el-alert>
</el-tab-pane>
</el-tabs>
</el-dialog>
<!-- 每日交易次数-->
@ -598,6 +724,43 @@
</div>
</el-dialog>
<!-- 添加或修改子卡信息-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openSubCard1" width="30%">
<el-form ref="form1" :model="form1" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="主卡信息" prop="userId" style="width: 420px">
<el-select
v-model="form1.userId"
placeholder="全部"
clearable
disabled
style="width: 100%"
>
<el-option
:label="form.mobile"
:value="form.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="子卡手机号" prop="cardChildPhones" style="width: 420px">
<el-input
v-model.number="form1.cardChildPhones"
placeholder="请输入子卡手机号"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="openSubCard1 = false"> </el-button>
<el-button type="primary" @click="submitSubCard"> </el-button>
</span>
</el-dialog>
</div>
</template>
@ -628,6 +791,12 @@ import growthValueRecord from "@/views/member/userInfoOrder/growthValueRecord.vu
import refuelMoneyRecord from "@/views/member/userInfoOrder/refuelMoneyRecord.vue";
import cardValueChild from "@/views/member/userInfoOrder/cardValueChild.vue";
import {allFixingLevel, getFixingLevel} from "@/api/staff/user/fixinglevel";
import {
addCardValueChild,
cardValueChildInfo,
editCardValueChild,
listCardValueChild, listCardValueChildOrder
} from "@/api/staff/user/cardvaluechild";
export default {
components: {
@ -646,9 +815,11 @@ export default {
return item
}
},
dicts: ['official', 'zhzt', 'zcrzdj', 'payment_type'],
dicts: ['official', 'zhzt', 'zcrzdj', 'payment_type','pay_status'],
data() {
return {
orderList:[],
openSubCard1:false,
baseUrl: process.env.VUE_APP_BASE_API,
flag: null,
fixingLevelList: [],
@ -748,11 +919,13 @@ export default {
tabOilType: '92',
//
aboutSecondCard: [],
cardValueChildList:[],
//
loading: false,
id: '',
//
form: {},
form1: {},
//
store: '',
//
@ -770,7 +943,13 @@ export default {
name: '',
status: '',
},
subCardList: [],
subCardList:{
page:1,
pageSize:10,
cardChildPhones:'',
userId:'',
status:''
},
list: [],
//
rules: {
@ -778,6 +957,8 @@ export default {
name: [{required: true, message: "请输入会员昵称,内容不可为空", trigger: "blur"}],
type: [{required: true, message: "请选择操作类型", trigger: "blur"}],
fixingLevel: [{required: true, message: "请选择认证信息", trigger: "blur"}],
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
}
}
},
@ -792,8 +973,73 @@ export default {
this.getInformation();
this.getFixingLevelList();
this.getStore();
this.getCardList()
this.getOrderList()
},
methods: {
handleQuery(){
this.subCardList.page = 1;
this.getOrderList()
},
handleOrder(data){
this.subCardList.cardChildPhones = data.cardChildPhones
this.subCardActive = "consumption"
this.subCardList.page = 1;
this.getOrderList()
},
//
getOrderList(){
this.subCardList.userId = this.id
listCardValueChildOrder(this.subCardList).then(res => {
this.orderList = res.data.records
this.total = res.data.total
})
},
//
getCardList(){
listCardValueChild(this.id).then(res => {
this.cardValueChildList = res.data
})
},
handleAdd1(){
this.title = "添加子卡信息"
this.openSubCard1 = true
},
handleUpdate1(data){
cardValueChildInfo(data.id).then(res => {
this.form1 = res.data
this.title = "修改子卡信息"
this.openSubCard1 = true
})
},
//
submitSubCard(){
this.$refs["form1"].validate(valid => {
if (valid) {
if (this.form1.id) {
editCardValueChild(this.form1).then(res => {
if (res.data==1){
this.$modal.msgSuccess("修改成功!")
this.openSubCard1 = false
this.getCardList()
}else {
this.$modal.msgError("手机号已存在,请重新添加")
}
})
}else {
addCardValueChild(this.form1).then(res => {
if (res.data.success=="添加成功!"){
this.$modal.msgSuccess("添加成功!")
this.openSubCard1 = false
this.getCardList()
}else {
this.$modal.msgError(res.data.error)
}
})
}
}
})
},
fixingLevelinfo(list, id) {
let name = "";
list.forEach(item => {

View File

@ -4,10 +4,10 @@
<el-tab-pane label="子卡管理" name="subCardManage">
<div style="display: flex;justify-content: space-between;margin: 10px 0">
<div style="font-size: 16px">会员信息{{form.mobile}}</div>
<el-button type="primary" :disabled="list.length>=2" @click="handleAdd">新增子卡</el-button>
<el-button type="primary" :disabled="cardValueChildList.length>=2" @click="handleAdd1">新增子卡</el-button>
</div>
<div>
<el-table ref="tables" v-loading="loading" :data="list">
<el-table ref="tables" v-loading="loading" :data="cardValueChildList">
<el-table-column label="子卡ID" prop="id" align="center" width="60"/>
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center"/>
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
@ -21,7 +21,7 @@
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="handleUpdate1(scope.row)"
>修改</el-button>
<el-button
size="mini"
@ -127,8 +127,8 @@
</el-tab-pane>
</el-tabs>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%">
<el-form ref="form" :model="form1" :rules="rules" label-width="120px">
<el-dialog :title="title" :visible.sync="openSubCard1" width="30%">
<el-form ref="form1" :model="form1" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="主卡信息" prop="userId" style="width: 420px">
@ -159,8 +159,8 @@
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submitFrom"> </el-button>
<el-button @click="openSubCard1 = false"> </el-button>
<el-button type="primary" @click="submitSubCard"> </el-button>
</span>
</el-dialog>
</div>
@ -191,7 +191,7 @@ export default {
page:1,
pageSize:10,
},
list:[],
cardValueChildList:[],
userId:"",
subCardList: {
page:1,
@ -201,7 +201,7 @@ export default {
},
orderList:[],
title:"",
dialogVisible:false,
openSubCard1:false,
rules:{
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
@ -212,7 +212,7 @@ export default {
this.userId = this.$route.query.id;
this.getUser()
this.getList()
this.getCardList()
this.getOrderList()
},
methods:{
@ -223,9 +223,9 @@ export default {
})
},
//
getList(){
getCardList(){
listCardValueChild(this.userId).then(res => {
this.list = res.data
this.cardValueChildList = res.data
})
},
//
@ -235,27 +235,29 @@ export default {
this.total = res.data.total
})
},
handleAdd(){
this.title = "添加子卡信息"
this.dialogVisible = true
handleAdd1(){
// this.title = ""
// this.openSubCard1 = true
this.$emit("handleAdd")
},
handleUpdate(data){
cardValueChildInfo(data.id).then(res => {
this.form1 = res.data
this.title = "修改子卡信息"
this.dialogVisible = true
})
handleUpdate1(data){
// cardValueChildInfo(data.id).then(res => {
// this.form1 = res.data
// this.title = ""
// this.openSubCard1 = true
// })
this.$emit("handleUpdate")
},
//
submitFrom(){
this.$refs["form"].validate(valid => {
submitSubCard(){
this.$refs["form1"].validate(valid => {
if (valid) {
if (this.form1.id) {
editCardValueChild(this.form1).then(res => {
if (res.data==1){
this.$modal.msgSuccess("修改成功!")
this.dialogVisible = false
this.getList()
this.openSubCard1 = false
this.getCardList()
}else {
this.$modal.msgError("手机号已存在,请重新添加")
}
@ -264,8 +266,8 @@ export default {
addCardValueChild(this.form1).then(res => {
if (res.data.success=="添加成功!"){
this.$modal.msgSuccess("添加成功!")
this.dialogVisible = false
this.getList()
this.openSubCard1 = false
this.getCardList()
}else {
this.$modal.msgError(res.data.error)
}

View File

@ -54,6 +54,15 @@ public class CvsGoodsController extends BaseController {
return getSuccessResult(list);
}
/**
* 查询当前店铺所有分类信息
* @return
*/
@GetMapping
public ResponseObject selectAll(){
return getSuccessResult(cvsGoodsService.selectCvsGoods());
}
//查询一级菜单
@PostMapping("/list")
public ResponseObject list(CvsGoods goods)

View File

@ -36,6 +36,12 @@ public interface CvsGoodsService extends IService<CvsGoods> {
*/
List<CvsGoods> selectCvsGoodsList(CvsGoods goods);
/**
* 查询当前店铺所有分类信息
* @return
*/
List<CvsGoodsTree> selectCvsGoods();
/**
* 联级选择器 树形数据结构
* @return

View File

@ -126,6 +126,14 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
return baseMapper.selectList(queryWrapper);
}
@Override
public List<CvsGoodsTree> selectCvsGoods() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
return baseMapper.selectList(queryWrapper);
}
/**
* 联级选择器 树形数据结构
* @return

View File

@ -290,9 +290,6 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
new Date().getTime() <= cardFavorable.getCreateTime().getTime() + Integer.parseInt(cardFavorable.getValidityDay()) * 86400000L + 86400000L * cardFavorable.getValidityTwo()) {
BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO);
}
/*if (){
}*/
exchangeFavorableVOArrayList.add(exchangeFavorableVO);
}
}

View File

@ -40,6 +40,7 @@ public interface ActiveNewlywedsService extends IService<ActiveNewlyweds> {
* @return
*/
ActiveNewlywedsVO getOneById(Serializable id);
ActiveNewlywedsVO getOneByStoreId(Serializable id);
ActiveNewlywedsVO getOneByIdApplet(ActiveConsumption activeConsumption);
/**

View File

@ -14,11 +14,14 @@ import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRec
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.mapper.CardFavorableRecordMapper;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.sun.xml.bind.v2.TODO;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -43,6 +46,8 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private LJUserService userService;
@Resource
private UserBalanceService userBalanceService;
/**
* 新增数据
* @param activeNewlywedsRecords
@ -57,48 +62,52 @@ public class ActiveNewlywedsRecordsServiceImpl extends ServiceImpl<ActiveNewlywe
Integer userId = nowAccountInfo.getId();
LJUserVo ljUserVo = userService.selectUserById(userId);
//保存新人有礼记录
ActiveNewlywedsVO activeNewlyweds = activeNewlywedsService.getOneById(1);
ActiveNewlywedsVO activeNewlyweds = activeNewlywedsService.getOneByStoreId(activeNewlywedsRecords.getStoreId());
activeNewlywedsRecords.setActiveNewlywedsId(activeNewlyweds.getId());
activeNewlywedsRecords.setChainStoreId(nowAccountInfo.getChainStoreId());
activeNewlywedsRecords.setStoreId(nowAccountInfo.getStoreId());
activeNewlywedsRecords.setUserId(userId);
save = save(activeNewlywedsRecords);
//优惠券
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlyweds.getActiveNewlywedsChildList();
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
for (ActiveNewlywedsChild activeNewlywedsChild : activeNewlywedsChildList) {
if (activeNewlywedsChild.getActiveGift().equals("1")){
cardFavorableRecord.setCardFavorableId(activeNewlywedsChild.getActiveNewlywedsId());
cardFavorableRecord.setChainStorId(nowAccountInfo.getChainStoreId());
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
cardFavorableRecord.setCardFavorableId(activeNewlywedsChild.getVouchersId());
cardFavorableRecord.setStoreId(nowAccountInfo.getStoreId());
cardFavorableRecord.setMtUserId(userId);
cardFavorableRecord.setMtUserId(ljUserVo.getId());
cardFavorableRecord.setName(ljUserVo.getName());
cardFavorableRecord.setMobile(ljUserVo.getMobile());
cardFavorableRecord.setName(nowAccountInfo.getRealName());
cardFavorableRecord.setStatus("0");
cardFavorableRecord.setExchangeFrom("新人发券");
save = cardFavorableRecordService.save(cardFavorableRecord);
save = cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
}else {
//兑换券
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
cardExchangeRecord.setCardExchangeId(activeNewlywedsChild.getActiveNewlywedsId());
cardExchangeRecord.setChainStorId(nowAccountInfo.getChainStoreId());
cardExchangeRecord.setCardExchangeId(activeNewlywedsChild.getVouchersId());
cardExchangeRecord.setStoreId(nowAccountInfo.getStoreId());
cardExchangeRecord.setMtUserId(userId);
cardExchangeRecord.setMtUserId(ljUserVo.getId());
cardExchangeRecord.setName(ljUserVo.getName());
cardExchangeRecord.setMobile(ljUserVo.getMobile());
cardExchangeRecord.setExchangeName(activeNewlywedsChild.getGiftCardName());
cardExchangeRecord.setPhoto(ljUserVo.getAvatar());
cardExchangeRecord.setStatus("0");
cardExchangeRecord.setExchangeFrom("新人领券");
cardExchangeRecord.setGiftName(activeNewlywedsChild.getGiftCardName());
cardExchangeRecord.setDescription(activeNewlywedsChild.getGiftCardDetail());
save = cardExchangeRecordService.save(cardExchangeRecord);
save = cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
}
}
//用户余额
UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId());
//积分
//成长值 TODO
if (ObjectUtils.isNotEmpty(userBalance.getPoints()) && ObjectUtils.isNotEmpty(activeNewlyweds.getPoints())){
userBalance.setPoints(userBalance.getPoints() + activeNewlyweds.getPoints());
}
//成长值
if (ObjectUtils.isNotEmpty(userBalance.getGrowthValue()) && ObjectUtils.isNotEmpty(activeNewlyweds.getGrowthValue())){
userBalance.setGrowthValue(userBalance.getGrowthValue() + activeNewlyweds.getGrowthValue());
}
userBalanceService.updateUserBalance(userBalance);
}
//
return save;
}
}

View File

@ -183,6 +183,43 @@ public class ActiveNewlywedsServiceImpl extends ServiceImpl<ActiveNewlywedsMappe
return activeNewlywedsVO;
}
/**
* 通过店铺查询单条数据
* @param id
* @return
*/
@Override
public ActiveNewlywedsVO getOneByStoreId(Serializable id) {
ActiveNewlywedsVO activeNewlywedsVO = new ActiveNewlywedsVO();
activeNewlywedsVO.setCourtesyReward(new String[0]);
if (ObjectUtils.isNotEmpty(id)){
//获取新人有礼活动信息
LambdaQueryWrapper<ActiveNewlyweds> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActiveNewlyweds::getStoreId,id);
ActiveNewlyweds activeNewlyweds = getOne(lambdaQueryWrapper);
//获取兑换物品信息
if (ObjectUtils.isNotEmpty(activeNewlyweds)){
LambdaQueryWrapper<ActiveNewlywedsChild> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActiveNewlywedsChild::getActiveNewlywedsId,activeNewlyweds.getId());
queryWrapper.orderByDesc(ActiveNewlywedsChild::getCreateTime);
List<ActiveNewlywedsChild> activeNewlywedsChildList = activeNewlywedsChildService.list(queryWrapper);
BeanUtils.copyProperties(activeNewlyweds,activeNewlywedsVO);
//封装VO返回
activeNewlywedsVO.setCourtesyReward(activeNewlyweds.getCourtesyReward().split(","));
if (CollectionUtils.isNotEmpty(activeNewlywedsChildList)){
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildLists = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildLists);
}
}else {
ArrayList<ActiveNewlywedsChild> activeNewlywedsChildList = new ArrayList<>();
activeNewlywedsVO.setActiveNewlywedsChildList(activeNewlywedsChildList);
}
}
return activeNewlywedsVO;
}
/**
* 通过店铺查询单条数据(小程序端)
* @param activeConsumption

View File

@ -4,6 +4,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardExchange.dto.CardExchangeRecordDTO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.service.ILJStaffService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param;
@ -27,6 +31,8 @@ public class CardExchangeRecordController extends BaseController {
*/
@Resource
private CardExchangeRecordService cardExchangeRecordService;
@Resource
private ILJStaffService iljStaffService;
/**
* 分页查询所有数据
@ -104,6 +110,10 @@ public class CardExchangeRecordController extends BaseController {
*/
@PutMapping
public ResponseObject update(@RequestBody CardExchangeRecord cardExchangeRecord) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStaff ljStaff = iljStaffService.selectStaffById(nowAccountInfo.getStaffId());
cardExchangeRecord.setRealName(ljStaff.getRealName());
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
return getSuccessResult(this.cardExchangeRecordService.updateById(cardExchangeRecord));
}

View File

@ -11,13 +11,19 @@ import com.fuint.business.marketingActivity.cardGift.service.CardGiftService;
import com.fuint.business.oilDepotConfiguration.entity.OilDepotConfig;
import com.fuint.business.oilDepotConfiguration.service.OilDepotConfigService;
import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.entity.UserBalance;
import com.fuint.business.userManager.mapper.LJUserMapper;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@ -38,6 +44,10 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
@Resource
private StoreService storeService;
@Resource
private UserBalanceService userBalanceService;
@Resource
private LJUserMapper ljUserMapper;
/**
* 新增数据
@ -148,6 +158,7 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
* @return
*/
@Override
@Transactional
public CardGift exchange(CardGift cardGift) {
//登录用户id
Integer userId = TokenUtil.getNowAccountInfo().getId();
@ -161,6 +172,17 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
one.setActivateStatus("1");
one.setUserId(userId);
updateById(one);
//更新用户余额
Double cardAmount = one.getCardAmount();
//会员信息
LJUserVo ljUserVo = ljUserMapper.selectUserById(userId);
UserBalance userBalance = userBalanceService.selectUserBalance(userId,ljUserVo.getChainStoreId());
Double cardBalance = userBalance.getCardBalance();
BigDecimal bigDecimal = BigDecimal.valueOf(cardAmount);
BigDecimal bigDecimal1 = BigDecimal.valueOf(cardBalance);
BigDecimal add = bigDecimal1.add(bigDecimal);
userBalance.setCardBalance(add.doubleValue());
userBalanceService.updateUserBalance(userBalance);
return one;
}else {
return cardGift;
@ -179,6 +201,7 @@ public class CardGiftServiceImpl extends ServiceImpl<CardGiftMapper, CardGift> i
Integer userId = TokenUtil.getNowAccountInfo().getId();
LambdaQueryWrapper<CardGift> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CardGift::getUserId,userId);
queryWrapper.orderByDesc(CardGift::getUpdateTime);
return page(page,queryWrapper);
}
}

View File

@ -782,6 +782,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
cardValueRecord.setAmountCommission(cardValueOrders.getAmountCommission());
cardValueRecord.setPayStatus("paid");
cardValueRecord.setStoreId(cardValueOrders.getStoreId());
cardValueRecord.setChainStoreId(cardValueOrders.getChainStoreId());
cardValueRecord.setPaymentNo(cardValueOrders.getOrderNo());
save(cardValueRecord);
}

View File

@ -29,6 +29,14 @@ public class CreditUnit extends BaseEntity implements Serializable {
@ApiModelProperty("自增ID")
@TableId(value = "ID", type = IdType.AUTO)
private Integer id;
/**
* 店铺id
*/
private Integer storeId;
/**
* 连锁店id
*/
private Integer chainStoreId;
/**
* 单位名称
*/

View File

@ -3,7 +3,8 @@
<mapper namespace="com.fuint.business.order.mapper.CardValueChildOrderMapper">
<select id="selectCardValueChildOrderList" resultType="com.fuint.business.order.vo.CardValueChildOrderVo">
select cvco.*,cvc.card_child_phones from card_value_child_order cvco left join card_valud_childrens cvc on cvco.card_value_child_id = cvc.id
select cvco.*,cvc.card_child_phones from card_value_child_order cvco
left join card_valud_childrens cvc on cvco.card_value_child_id = cvc.id
<where>
<if test="order.storeId != null and order.storeId != ''">
and cvco.store_id = #{order.storeId}
@ -11,6 +12,12 @@
<if test="order.cardChildPhones != null and order.cardChildPhones != ''">
and cvc.card_child_phones = #{order.cardChildPhones}
</if>
<if test="order.userId != null and order.userId != ''">
and cvc.user_id = #{order.userId}
</if>
<if test="order.status != null and order.status != ''">
and cvco.status = #{order.status}
</if>
order by cvco.pay_time desc
</where>
</select>

View File

@ -45,9 +45,10 @@
</where>
</select>
<select id="selectHangBills" resultType="com.fuint.business.order.vo.HangBillVo" parameterType="int">
<include refid="selectHangBill"></include>
select hb.*,cu.unit_name,cu.person_credit,cu.contact_mobile,cu.credit_limit from hang_bill hb
left join credit_unit cu on hb.credit_unit_id = cu.id
<where>
hb.store_id = #{storeId}
hb.store_id = #{storeId} and hb.status!=1
</where>
</select>
</mapper>

View File

@ -1,5 +1,6 @@
package com.fuint.business.order.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -30,10 +31,13 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl<CardValueChildOr
@Override
public IPage<CardValueChildOrderVo> selectCardValueChildOrderList(Page page, CardValueChildOrderVo cardValueChildOrderVo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
if (cardValueChildOrderVo.getStoreId()==null){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
cardValueChildOrderVo.setStoreId(nowAccountInfo.getStoreId());
}
if (cardValueChildOrderVo.getUserId()==null){
cardValueChildOrderVo.setUserId(nowAccountInfo.getId());
}
return baseMapper.selectCardValueChildOrderList(page,cardValueChildOrderVo);
}
@ -50,10 +54,15 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl<CardValueChildOr
LJStore store = storeService.selectStoreByStoreId(cardValueChildOrder.getStoreId());
CardValudChildrens cardValudChildrens = cardValudChildrensService.selectCardValueChildrenByMobileAndStoreId(user.getMobile(), cardValueChildOrder.getStoreId());
cardValueChildOrder.setCardValueId(cardValudChildrens.getCardValueId());
cardValueChildOrder.setCardValueChildId(cardValudChildrens.getId());
cardValueChildOrder.setChainStoreId(store.getChainStoreId());
return baseMapper.insert(cardValueChildOrder);
int row = 0;
if (ObjectUtil.isNotEmpty(cardValudChildrens)){
cardValueChildOrder.setCardValueId(cardValudChildrens.getCardValueId());
cardValueChildOrder.setCardValueChildId(cardValudChildrens.getId());
cardValueChildOrder.setChainStoreId(store.getChainStoreId());
row =baseMapper.insert(cardValueChildOrder);
}
return row;
}
@Override

View File

@ -5,16 +5,26 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.order.entity.CreditUnit;
import com.fuint.business.order.mapper.CreditUnitMapper;
import com.fuint.business.order.service.CreditUnitService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CreditUnitServiceImpl extends ServiceImpl<CreditUnitMapper, CreditUnit> implements CreditUnitService {
@Autowired
private ILJStoreService storeService;
@Override
public List<CreditUnit> selectCreditUnitList() {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status","qy");
queryWrapper.eq("chain_store_id",store.getChainStoreId());
List<CreditUnit> list = baseMapper.selectList(queryWrapper);
return list;
}
@ -27,6 +37,10 @@ public class CreditUnitServiceImpl extends ServiceImpl<CreditUnitMapper, CreditU
@Override
public int insertCreditUnit(CreditUnit creditUnit) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
creditUnit.setStoreId(store.getId());
creditUnit.setChainStoreId(store.getChainStoreId());
int row = baseMapper.insert(creditUnit);
return row;
}

View File

@ -47,6 +47,7 @@ import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import com.fuint.system.config.service.SysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
@ -305,6 +306,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setStatus(payStatus);
if (payType.equals("CASH")){
cashierOrder.setPayTime(new Date());
this.insertAllOrderInfo(orderNo,storeId,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
}
cashierOrder.setOrderNo(orderNo);
cashierOrder.setGoodsOrderAmount(goodsAmount);
@ -355,6 +357,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setPayTime(new Date());
this.addOilTrack(jsonObjects.get(i),storeId);
}
if (map.get("allAmount").equals("0")){
order.setPayTime(new Date());
order.setOrderStatus("paid");
}
baseMapper.insert(order);
oilOrder1 = this.selectOilOrderByOrderNo(orderNo);
}
@ -403,8 +409,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
orders.put("goodsOrder",goodsOrder1);
cashierOrder.setGoodsOrderId(goodsOrder1.getId());
}
orders.put("orderNo",orderNo);
cashierOrderService.insertCashierOrder(cashierOrder);
// this.insertAllOrderInfo(orderNo,storeId,oilAmount,payType,userId,"PC");
return orders;
}
@ -420,16 +426,16 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (!map.get("oilOrder").equals("[]")) {
oilOrders = JSONArray.parseArray(map.get("oilOrder"), JSONObject.class);
// 码支付
if (authCode.contains("19")) {
String[] split = authCode.split("19");
// 二维码支付
if (authCode.contains("9E")) {
String[] split = authCode.split("9E");
// 获取用户id
Integer userId = Integer.valueOf(split[1]);
res = this.updateUserBalanceAndInsetOrder(userId,map,oilAmount,oilOrders,nowAccountInfo.getStoreId());
}
// 二维码支付
if (authCode.contains("9E")) {
String[] split = authCode.split("9E");
// 码支付
if (authCode.contains("19") && authCode.matches("\\d+")) {
String[] split = authCode.split("19");
// 获取用户id
Integer userId = Integer.valueOf(split[1]);
res = this.updateUserBalanceAndInsetOrder(userId,map,oilAmount,oilOrders,nowAccountInfo.getStoreId());
@ -518,10 +524,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setOilOrderId(oilOrder.getId());
cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId);
// this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet");
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"PC","1","paid");
res.put("success","success");
} else {
String status = "unpaid";
if (ObjectUtil.isNotEmpty(refuelMoneys)){
for (Object refuelMoney : refuelMoneys) {
@ -529,15 +536,18 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
String oilType = ((JSONObject) refuelMoney).get("oilType").toString();
Double refuelMoneyLiters = Double.valueOf(((JSONObject) refuelMoney).get("refuelMoney").toString());
// 根据油品名称查询油品id
OilName oilName = oilNameService.selectOilNameByOilName(oilType);
OilName oilName = oilNameService.selectOilNameById(Integer.valueOf(oilType));
OilOrder order = new OilOrder();
OilOrder oilOrder = null;
// 添加收银台订单信息
CashierOrder cashierOrder = new CashierOrder();
boolean flag = false;
for (int i = 0;i < oilOrders.size();i++) {
if (oilOrders.get(i).get("oilName").equals(oilName.getId().toString())){
if (refuelMoneyLiters>=Double.valueOf(oilOrders.get(i).get("liters").toString())){
if (refuelMoneyLiters>=Double.valueOf(oilOrders.get(i).get("liters").toString())) {
status = "paid";
flag = true;
Double amount = Double.valueOf(oilOrders.get(i).get("amount").toString());
Double oilPrice = Double.valueOf(oilOrders.get(i).get("oilPrice").toString());
Double oilNum = amount / oilPrice;
@ -564,7 +574,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setPayUser(userVo1.getMobile());
order.setPayType(map.get("payType"));
order.setInvoicing("未开票");
order.setOrderStatus("paid");
order.setOrderStatus(status);
order.setPayTime(new Date());
this.addOilTrack(oilOrders.get(i), accountInfo.getStoreId());
@ -576,24 +586,25 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setPayUser(userVo1.getMobile());
cashierOrder.setAmount(oilAmount);
cashierOrder.setPayAmount(oilAmount);
cashierOrder.setStatus("paid");
cashierOrder.setStatus(status);
cashierOrder.setPayTime(new Date());
cashierOrder.setOrderNo(orderNo);
cashierOrder.setOilOrderAmount(oilAmount);
// cashierOrder.setOilDiscountAmount(Double.valueOf(map.get("oilDiscount")));
cashierOrder.setTerminal(map.get("terminal"));
cashierOrder.setOilOrderId(oilOrder.getId());
this.updateGrowthValue1(0.0,userId, Integer.valueOf(oilOrder.getOils()),refuelMoneyLiters-Double.valueOf(oilOrders.get(i).get("liters").toString()),storeId);
this.updateGrowthValue1(0.0, userId, Integer.valueOf(oilOrder.getOils()), refuelMoneyLiters - Double.valueOf(oilOrders.get(i).get("liters").toString()), storeId);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, map.get("payType"), userId, "PC", "1", status);
}
}else {
res.put("error","囤油卡余额不足!");
}
}
cashierOrderService.insertCashierOrder(cashierOrder);
// this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,map.get("payType"),userId,"applet");
res.put("success","success");
if (flag){
cashierOrderService.insertCashierOrder(cashierOrder);
res.put("success","success");
}
}
}else {
@ -612,17 +623,21 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
/**
* 添加所有订单信息
*/
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,String payType,Integer userId,String payChannel){
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,String payType,Integer userId,String payChannel,String type,String status){
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(orderNo);
allOrderInfo.setType("1");
allOrderInfo.setType(type);
allOrderInfo.setStoreId(storeId);
allOrderInfo.setGoodsMoney(goodsMoney);
allOrderInfo.setPayType(payType);
allOrderInfo.setUserId(userId);
allOrderInfo.setPayChannel(payChannel);
allOrderInfo.setStatus("paid");
allOrderInfo.setContent("油品订单");
allOrderInfo.setStatus(status);
if (type.equals("1")){
allOrderInfo.setContent("油品订单");
}else {
allOrderInfo.setContent("收银台订单");
}
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
}
@ -646,8 +661,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
refuelMoney1.setRefuelMoney(((JSONObject) money).get("refuelMoney").toString());
Double refuelMoneyLiters = Double.valueOf(((JSONObject) money).get("refuelMoney").toString());
// 根据油品名称查询油品id
OilName oilName = oilNameService.selectOilNameByOilName(((JSONObject) money).get("oilType").toString());
if (oilName.getId().toString().equals(oilId.toString())){
// OilName oilName = oilNameService.selectOilNameByOilName(((JSONObject) money).get("oilType").toString());
if (((JSONObject) money).get("oilType").toString().equals(oilId.toString())){
refuelMoney1.setRefuelMoney(String.valueOf(refuelMoney));
}
list.add(refuelMoney1);
@ -873,6 +888,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
userId = cardValudChildrens.getUserId();
}
this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId());
this.addOilTracks(oilOrder,oilOrder.getStoreId());
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
if (ObjectUtil.isNotEmpty(cashierOrder)){
cashierOrder.setPayTime(new Date());
@ -978,7 +994,25 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
LJStore store = storeService.selectStoreByStoreId(storeId);
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
int growth = balance.getGrowthValue();
balance.setRefuelMoney(refuelMoney);
if (refuelMoney==null){
String refuelMoney1 = balance.getRefuelMoney();
if (StringUtils.isNotEmpty(refuelMoney1)){
JSONArray objects = JSONArray.parseArray(refuelMoney1);
List<RefuelMoney> list = new ArrayList<>();
for (Object object : objects) {
if (((JSONObject)object).get("oilType").toString().equals(oilId)){
RefuelMoney refuelMoney2 = new RefuelMoney();
refuelMoney2.setType(((JSONObject) object).get("type").toString());
refuelMoney2.setOilType(((JSONObject) object).get("oilType").toString());
refuelMoney2.setRefuelMoney("0");
list.add(refuelMoney2);
}
}
balance.setRefuelMoney(JSONObject.toJSONString(list));
}
}else {
balance.setRefuelMoney(refuelMoney);
}
// 查询会员等级列表信息
Page page = new Page(1,20);
LJUserGrade ljUserGrade1 = new LJUserGrade();

View File

@ -126,6 +126,16 @@ public class LJUserController extends BaseController {
return getSuccessResult(map1);
}
/**
* 根据storeId查询会员信息
* @param storeId
* @return
*/
@GetMapping("/storeUserInfo/{storeId}")
public ResponseObject userVoInfo1(@PathVariable Integer storeId){
return getSuccessResult(userService.queryUserByStoreIdAndUserId(storeId));
}
@GetMapping("/getByUniApp")
public ResponseObject getByUniApp(Integer chainStoreId){
LJUserVo user = userService.getByUniApp(chainStoreId);
@ -185,8 +195,7 @@ public class LJUserController extends BaseController {
@PostMapping("/name")
public ResponseObject userVoByName(@Validated @RequestBody Map<String ,String > map){
String name = map.get("name");
List<LJUserVo> list = userService.queryUserByName(name);
return getSuccessResult(list);
return getSuccessResult(userService.queryUserByName(name));
}
/**

View File

@ -68,7 +68,7 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
* @param name
* @return
*/
public List<LJUserVo> selectUserByName(@Param("name") String name);
public List<LJUserVo> selectUserByName(@Param("name") String name,@Param("chainStoreId") Integer chainStoreId);
/**
* 统计信息

View File

@ -67,9 +67,12 @@
</select>
<select id="selectUserByName" resultType="com.fuint.business.userManager.vo.LJUserVo"
parameterType="java.lang.String">
<include refid="selectUser"></include>
<include refid="selectUserAndBalance"></include>
<where>
mu.name like concat('%', #{name}, '%')
<if test="chainStoreId != null and chainStoreId != ''">
and mub.chain_store_id = #{chainStoreId}
</if>
</where>
</select>

View File

@ -60,6 +60,13 @@ public interface LJUserService extends IService<LJUser> {
*/
public Map<String,Object> queryUserByStoreId(Integer storeId,Integer mobile);
/**
* 根据storeId获取连锁店id 根据连锁店id查询用户信息
* @param storeId
* @return
*/
public LJUserVo queryUserByStoreIdAndUserId(Integer storeId);
/**
* 根据手机号和连锁店id查询会员信息
* @param mobile
@ -89,7 +96,7 @@ public interface LJUserService extends IService<LJUser> {
* @param name
* @return
*/
public List<LJUserVo> queryUserByName(String name);
public Map<String,Object> queryUserByName(String name);
/**
* 根据id删除会员信息

View File

@ -151,6 +151,13 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
return map;
}
@Override
public LJUserVo queryUserByStoreIdAndUserId(Integer storeId) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(storeId);
return baseMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
}
@Override
public LJUserVo selectUserByMobileAndChantStoreId(String mobile) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@ -159,6 +166,7 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
if (ObjectUtil.isNotEmpty(store)){
ljUserVo = baseMapper.selectUserByMobileAndChantStoreId(mobile,store.getChainStoreId());
}
ljUserVo.setStoreId(store.getId());
return ljUserVo;
}
@ -205,9 +213,14 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
* @return
*/
@Override
public List<LJUserVo> queryUserByName(String name) {
List<LJUserVo> list = baseMapper.selectUserByName(name);
return list;
public Map<String,Object> queryUserByName(String name) {
Map<String,Object> map = new HashMap<>();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
List<LJUserVo> list = baseMapper.selectUserByName(name,store.getChainStoreId());
map.put("userVo",list);
map.put("storeId",store.getId());
return map;
}
@Autowired

View File

@ -20,7 +20,7 @@ export function cashierOrder(id) {
// 根据订单号查询油品订单信息
export function cashierOrderByOrderNo(data) {
return request({
url: '/business/oilOrder/orderNo',
url: '/business/cashierOrder/orderNo',
method: 'post',
data: data
})

View File

@ -543,7 +543,10 @@
<el-dialog title="批量挂账归还" :visible.sync="open3" append-to-body>
<el-form ref="form3" :model="form3">
<el-form-item>
<el-input placeholder="请输入挂账单位、挂账人、挂账人手机号检索" v-model="unitName" class="input-with-select">
<el-input placeholder="请输入挂账单位、挂账人、挂账人手机号检索"
v-model="unitName"
@keyup.enter.native="getRepayList"
clearable class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="getRepayList">查询</el-button>
</el-input>
</el-form-item>
@ -556,37 +559,15 @@
height="300"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="单据号"
prop="orderNo"
width="120">
</el-table-column>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="单据号" prop="orderNo" width="120"></el-table-column>
<el-table-column label="挂账方详情">
<el-table-column
prop="unitName"
label="单位">
</el-table-column>
<el-table-column
prop="personCredit"
label="姓名">
</el-table-column>
<el-table-column
prop="contactMobile"
label="电话">
</el-table-column>
</el-table-column>
<el-table-column
prop="amount"
label="挂账金额">
</el-table-column>
<el-table-column
prop="outstandAmount"
label="未归还金额">
<el-table-column prop="unitName" label="单位"></el-table-column>
<el-table-column prop="personCredit" label="姓名"></el-table-column>
<el-table-column prop="contactMobile" label="电话"></el-table-column>
</el-table-column>
<el-table-column prop="amount" label="挂账金额"></el-table-column>
<el-table-column prop="outstandAmount" label="未归还金额"></el-table-column>
<el-table-column
prop="repaidAmount"
label="归还金额"
@ -607,7 +588,7 @@
:total="total1"
:page.sync="queryParam.page"
:limit.sync="queryParam.pageSize"
@current-change="getList">
@current-change="getLists">
</el-pagination>
</div>
<div style="display: flex;height: 36px">
@ -620,7 +601,7 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="open3 = false"> </el-button>
<el-button type="primary" @click="batchSub"> </el-button>
<el-button :disabled="amount==0" type="primary" @click="batchSub"> </el-button>
</span>
</el-dialog>
@ -646,6 +627,7 @@
@input="changePayType">
<el-radio v-for="item in payList"
:key="item.dictValue"
v-if="item.dictValue!='APPLET_CODE'"
:value="item.dictValue"
:label="item.dictValue" border>{{ item.dictLabel }}</el-radio>
</el-radio-group>
@ -910,21 +892,22 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
getRepayList(){
let result = [];
this.form3.unitName = this.unitName;
let str = this.form3.unitName
let str = this.unitName
this.list.forEach(item => {
if (item.returnType==0){
if (item.unitName.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
}
if (item.personCredit.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
}
if (item.contactMobile.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
}
if (item.unitName.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
return;
}
if (item.personCredit.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
return;
}
if (item.contactMobile.includes(str)){
item.repaidAmount = item.outstandAmount
result.push(item)
return;
}
})
this.repayList = result
@ -932,6 +915,10 @@ import {listReturnRecord, returnRecordByOrderNo, returnRecordInfo} from "@/api/c
getLists(){
hangBills().then(response => {
this.list = response.data;
this.repayList = response.data;
for (let i = 0; i<response.data.length;i++){
this.repayList[i].repaidAmount = response.data[i].outstandAmount
}
})
},
handleChange(value) {

View File

@ -15,7 +15,7 @@
background-color: rgb(67,119,204)">
<div>
<template>
<img v-if="member.avatar" class="list-avatar" :src="member.avatar">
<img v-if="member.avatar" class="list-avatar" :src="baseUrl + member.avatar">
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
</template>
</div>
@ -135,7 +135,7 @@
</div>
<div>- {{ consumeRefuelMoney }}L</div>
</div>
<div class="center-left-hj" v-show="isMember">
<div class="center-left-hj" v-show="isMember && balance>0">
<div>
<el-checkbox style="color: black;font-size: 16px"
v-model="checkAll4" @change="handleCheckAllChange4">
@ -152,17 +152,6 @@
width="400"
trigger="click">
<div>
<!-- <el-checkbox-group v-model="checkedCities5" @change="handleCheckedCitiesChange5">-->
<!-- <el-checkbox v-for="(item,index) in couponDiscount" :label="item.name" :key="index">-->
<!-- <div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">-->
<!-- <div style="width: 200px">{{item.name}}</div>-->
<!-- <div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">-->
<!-- <div style="color: red">-{{ item.reduce }}</div>-->
<!-- <div style="color: grey">{{ item.full }}{{ item.reduce }}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-checkbox>-->
<!-- </el-checkbox-group>-->
<el-radio-group v-model="checkedCities5" @input="handleCheckedCitiesChange5">
<el-radio v-for="(item,index) in couponDiscount"
:label="item.name" :key="index" style="display: flex;">
@ -482,7 +471,7 @@
:visible.sync="dialogVisiblej"
width="30%"
:close-on-click-modal="false">
<div v-if="isPay == true"
<div v-if="isPay==false"
v-loading="loading">
<div style="text-align: center;font-size: 15px;font-weight: bold">应收金额</div>
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
@ -583,7 +572,7 @@
</el-descriptions>
<el-descriptions title="储值余额">
<template slot="extra">
<span style="color: red;margin-right: 20px">余额充值</span>
<!-- <span style="color: red;margin-right: 20px">余额充值</span>-->
<span style="font-weight: bold">{{member.cardBalance ? member.cardBalance : "--"}}</span>
</template>
<el-descriptions-item v-if="member.cardBalance!=0" label="账户余额">{{member.cardBalance ? member.cardBalance : "--"}}</el-descriptions-item>
@ -639,12 +628,12 @@
title="请选择会员"
:visible.sync="dialogVisibleMember"
:close-on-click-modal="false">
<div class="wrap-wrap">
<div class="wrap-wrap" style="height:700px;overflow-y: scroll;">
<el-table ref="tables" :data="memberList">
<el-table-column label="ID" align="center" prop="id" width="80" />
<el-table-column label="头像" align="center" width="70">
<template slot-scope="scope">
<img v-if="scope.row.avatar" class="list-avatar" :src="scope.row.avatar">
<img v-if="scope.row.avatar" class="list-avatar" :src="baseUrl + scope.row.avatar">
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
</template>
</el-table-column>
@ -804,6 +793,7 @@
name: "homeindex",
data(){
return{
baseUrl:process.env.VUE_APP_BASE_API,
//
checkAll1: false,
isIndeterminate1: true,
@ -822,7 +812,7 @@
checkedCities3: [],
cities3: cityOptions,
//
checkAll4: true,
checkAll4: false,
isIndeterminate4: true,
checkedCities4: [],
cities4: cityOptions,
@ -852,6 +842,7 @@
loading:false,
//
oilType:'',
oilNameID:'',
//
type:"",
//
@ -898,6 +889,7 @@
//
memberList:[],
select1:'会员手机号',
storeId:"",
//
userNo:"",
//
@ -1020,7 +1012,7 @@
menu:1,
index:0,
//
isPay:true,
isPay:false,
isPaySuccess:false,
//
orderNo:'',
@ -1032,7 +1024,7 @@
//
oilNumberList:[],
//
isSure:false,
isSure:true,
//
couponAmount:0,
//
@ -1242,7 +1234,7 @@
}
this.checkedCities1 = val ? list : [];
this.isIndeterminate1 = false;
this.isExclusion();
this.isDefaultUseCard();
},
handleCheckedCitiesChange1(value) {
this.fullReduction = 0;
@ -1258,7 +1250,7 @@
let checkedCount = value.length;
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.fullReduceDiscount.length;
this.isExclusion();
this.isDefaultUseCard();
},
handleCheckAllChange2(val) {
let list = []
@ -1274,7 +1266,7 @@
}
this.checkedCities2 = val ? list : [];
this.isIndeterminate2 = false;
this.isExclusion();
this.isDefaultUseCard();
},
handleCheckedCitiesChange2(value) {
this.oilDiscount = 0
@ -1290,7 +1282,7 @@
let checkedCount = value.length;
this.checkAll2 = checkedCount === this.gradeDiscount.length;
this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.gradeDiscount.length;
this.isExclusion();
this.isDefaultUseCard();
},
handleCheckAllChange3(val) {
if (val==false){
@ -1301,7 +1293,7 @@
this.isOilStorageCard = true;
this.changeRefuelMoney()
}
this.isExclusion();
this.isDefaultUseCard();
},
handleCheckedCitiesChange3(value) {
let checkedCount = value.length;
@ -1315,7 +1307,7 @@
}else {
this.isUseBalance = false;
}
this.isExclusion();
this.isDefaultUseCard();
},
handleCheckedCitiesChange4(value) {
let checkedCount = value.length;
@ -1359,7 +1351,7 @@
this.couponAmount = 0
this.checkedCities5 = ""
}
this.isExclusion();
this.isDefaultUseCard();
},
handleCheckedCitiesChange5(value) {
this.couponAmount = 0;
@ -1375,7 +1367,7 @@
}
})
this.checkAll5 = true;
this.isExclusion();
this.isDefaultUseCard();
},
//
querySearch(queryString, cb) {
@ -1908,7 +1900,7 @@
}
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
_this.checkAll2 = true;
_this.isExclusion();
_this.isDefaultUseCard();
})
},
//
@ -1918,10 +1910,14 @@
this.map.payUser = data.mobile;
this.map.userId = data.id;
this.balance = this.member.cardBalance;
if (data.refuelMoney){
// 使
this.refuelMoney = JSON.parse(data.refuelMoney)
this.changeRefuelMoney();
}else
this.getGrade(data.id,data.gradeId)
this.changeRefuelMoney();
this.handleChange();
this.preferentialData.storeId = data.storeId;
// this.handleChange();
this.preferentialData.storeId = this.storeId;
this.preferentialData.userId = data.id;
this.preferentialData.gradeId = data.gradeId;
if (this.oilOrder.length>0){
@ -1937,8 +1933,9 @@
_this.preferentialData.oilPrice = item1.oilPrice;
_this.preferentialData.oilLiters = item1.liters;
_this.couponDiscount =[];
_this.couponIds = [],
_this.couponIds = [];
selectCoupon(_this.preferentialData).then(response => {
// console.log(response)
_this.couponAmount = 0;
_this.couponIds = response.data
if (response.data.length>0){
@ -2014,23 +2011,25 @@
})
}
_this.checkAll5 = true;
_this.isExclusion();
_this.isDefaultUseCard();
})
})
},
// 使
countOilCard(){
if (this.hoardAmount!=0){
if (this.balance!=0 && this.balance >= (this.oilAmount - this.hoardAmount)){
if (this.hoardAmount>0){
if (this.balance!=0 && this.balance >= this.hoardAmount){
this.oilActualPay = 0
this.consumeAmount = this.hoardAmount
}else {
this.oilActualPay = (this.oilAmount - this.hoardAmount -this.balance).toFixed(2)
this.oilActualPay = (this.hoardAmount -this.balance).toFixed(2)
this.consumeAmount = this.balance
}
}else {
this.oilActualPay = 0
this.consumeAmount = 0
}
console.log("囤油卡",this.isOilStorageCard,this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount)
},
// 使使
countAmountFull(){
@ -2046,6 +2045,7 @@
}else {
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
console.log("优惠券",this.oilAmount, this.oilDiscount,this.couponAmount)
},
// 使使
countAmountUnBalance(){
@ -2055,13 +2055,14 @@
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
this.consumeAmount = 0
console.log("优惠券和满减",this.oilAmount , this.fullReduction , this.oilDiscount , this.couponAmount)
},
// 使使 || 使使
countAmountBalance(){
if (this.isMember){
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
this.oilActualPay = 0
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction
this.consumeAmount = (this.oilAmount*100 - this.oilDiscount*100 - this.fullReduction*100)/100
}else {
this.oilActualPay = (this.oilAmount -this.balance - this.oilDiscount - this.fullReduction).toFixed(2)
this.consumeAmount = this.balance
@ -2069,6 +2070,7 @@
}else {
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
console.log("储值卡满减",this.oilAmount, this.oilDiscount,this.fullReduction)
},
//
isExclusion(){
@ -2113,20 +2115,39 @@
return;
}
// 使
if (this.isOilStorageCard){
this.checkAll1 = false;
this.fullReduction = 0;
this.checkAll2 = false;
this.checkedCities2 = [],
this.oilDiscount = 0;
this.checkAll5 = false;
this.couponAmount = 0;
this.countOilCard();
return;
}
// if (this.isOilStorageCard){
// this.checkAll1 = false;
// this.fullReduction = 0;
// this.checkAll2 = false;
// this.checkedCities2 = [];
// this.oilDiscount = 0;
// this.checkAll5 = false;
// this.couponAmount = 0;
// this.countOilCard();
// return;
// }
this.countAmountBalance();
}
},
// 使
isDefaultUseCard(){
if (this.isOilStorageCard){
this.checkAll3 = true;
this.checkAll1 = false;
this.fullReduction = 0;
this.checkAll2 = false;
this.checkedCities2 = [];
this.oilDiscount = 0;
this.checkAll5 = false;
this.couponAmount = 0;
this.countOilCard();
if (this.hoardAmount>0 && this.balance > 0){
this.checkAll4 = true;
}
}else {
this.isExclusion()
}
},
//
preferential(){
let _this = this;
@ -2184,17 +2205,17 @@
_this.checkedCities1 = []
_this.fullReduction = 0
}
_this.isExclusion();
_this.isDefaultUseCard();
})
})
},
//
handleChoose(data) {
this.isSure = true;
this.isSure = false;
this.member = data;
if (data.refuelMoney != null && data.refuelMoney != ""){
this.refuelMoney = JSON.parse(data.refuelMoney)
}
// if (data.refuelMoney != null && data.refuelMoney != ""){
// this.refuelMoney = JSON.parse(data.refuelMoney)
// }
this.dialogVisibleMember = false;
},
//
@ -2220,6 +2241,7 @@
//
delGoods(index){
this.goodsOrder.splice(index,1)
this.handleChange()
},
//
changeGoods(val){
@ -2229,11 +2251,6 @@
if (this.goodsOrder.length > 0) {
let amount = 0;
for (let i = 0; i < goods.length; i++) {
if (_this.isMember) {
amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
} else {
amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
}
if (goods[i].id == val.id) {
if (val.stock<goods[i].num + 1){
this.$modal.msgError("商品库存不足,请重新选择商品")
@ -2246,6 +2263,11 @@
} else {
result = true;
}
if (_this.isMember) {
amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
} else {
amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
}
}
this.goodsAmount = amount;
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
@ -2266,16 +2288,35 @@
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.goodsOrder.push(val);
this.goodsTotal += 1;
}else {
console.log(222)
if (val.stock==0){
this.$modal.msgError("商品库存不足,请重新选择商品")
return;
}
if (_this.isMember) {
this.goodsAmount += +val.memberPrice * val.num
} else {
this.goodsAmount += +val.retailPrice * val.num
}
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
}
this.goods = ""
},
//
settlement(){
if (this.payType=="APPLET_CODE") {
if (this.goodsOrder.length > 0) {
this.$modal.msgError("非油商品不可使用小程序码支付")
return;
}
}
this.authCode = ""
this.seekZero = 0;
this.isPay = true
this.isPay = false
this.dialogVisiblej = true
this.getStaff()
},
//
resetting(){
@ -2306,7 +2347,7 @@
//
getOilOrder(){
this.dialogVisibleamount = false
this.form.oilType = this.oilType;
this.form.oilType = this.oilNameID;
this.form.type = this.type;
//
if (this.select == "元"){
@ -2358,13 +2399,17 @@
_this.consumeRefuelMoney = 0;
_this.oilActualPay = 0;
_this.hoardAmount = 0;
_this.oilAmount = 0;
_this.oilOrder.forEach(item => {
let conRefMon = 0;
let hoardAmount = 0;
if (_this.refuelMoney!=null){
let id = ""
if (_this.refuelMoney){
for (let i = 0;i < _this.refuelMoney.length;i++){
//
if (_this.refuelMoney[i].oilType==item.oilType){
if (_this.refuelMoney[i].oilType==item.oilType && _this.refuelMoney[i].refuelMoney>0){
id = item.id
_this.isOilStorageCard = true
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
conRefMon = item.liters
}else {
@ -2372,18 +2417,34 @@
//
hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
}
}else {
hoardAmount = item.amount
}
}
}
_this.consumeRefuelMoney += +conRefMon
if (_this.consumeRefuelMoney!=0){
_this.isOilStorageCard = true;
_this.checkAll3 = true;
_this.consumeAmount = 0;
}
_this.hoardAmount += +hoardAmount
_this.oilAmount += +item.amount
// _this.changeBalance(_this.hoardAmount,id)
// if (_this.consumeRefuelMoney!=0){
// _this.isOilStorageCard = true;
// _this.checkAll3 = true;
// _this.consumeAmount = 0;
// }
_this.isDefaultUseCard();
})
_this.isExclusion();
},
changeBalance(hoardAmount,id){
if (this.balance>0 && id != ""){
this.oilOrder.forEach(item => {
if (this.balance >= item.amount){
this.consumeAmount = item.amount
}else {
this.consumeAmount = this.balance
this.oilActualPay = item.amount - this.balance
}
})
}
},
// L
changeSelect(){
@ -2424,6 +2485,7 @@
name = item.oilName;
oilType = item.oilType;
_this.oilType = item.oilName;
_this.oilNameID = item.id;
_this.type = item.oilType;
}
})
@ -2442,15 +2504,18 @@
getUserInfoMobile({mobile:this.userNo}).then( response => {
if (response.data!=null){
this.member = response.data
this.storeId = response.data.storeId
this.isSure = false
}else {
this.$modal.msgError("会员信息不存在")
}
})
}else {
getUserVoName({name:this.userNo}).then( response => {
this.memberList = response.data
})
this.dialogVisibleMember = true;
getUserVoName({name:this.userNo}).then( response => {
this.memberList = response.data.userVo
this.storeId = response.data.storeId
})
}
},
//
@ -2521,13 +2586,17 @@
let _this = this;
if (this.payType=="APPLET_CODE"){
this.loading = true;
if (this.goodsOrder.length>0){
this.$modal.msgError("非油商品不可使用小程序码支付")
return;
}
scanAppletQrCode(_this.map).then( resp => {
if (resp.data.success!=undefined){
if (resp.data.success=='success'){
this.loading = true;
setTimeout(function (){
_this.isPaySuccess = true;
this.loading = false;
_this.isPay = false;
_this.loading = false;
_this.isPay = true;
_this.resetting1();
},3000)
}else {
@ -2538,8 +2607,8 @@
}
addLJGoods(_this.map).then( response => {
_this.orderNo = response.data.orderNo;
if (response.data.oilOrder!=null){
_this.orderNo = response.data.oilOrder.orderNo;
if (response.data.oilOrder.orderStatus == "paid"){
_this.isPaySuccess = true;
_this.seekZero = 0
@ -2568,11 +2637,10 @@
})
this.loading = true;
_this.queryPayStatus();
// console.log(_this.isQuery)
let timer = setInterval(function () {
if (_this.isQuery == false) {
_this.loading = false;
_this.isPay = false;
_this.isPay = true;
clearInterval(_this.timer);
}
},500)
@ -2582,7 +2650,6 @@
_this.resetting1();
},
resetting1(){
// console.log(111)
let _this = this;
this.authCode = "";
if (_this.isPaySuccess == true){
@ -2601,6 +2668,7 @@
_this.goodsOrder = []
_this.amount = 0
};
this.userNo = ""
this.map = {
allAmount:0,
//
@ -2664,23 +2732,6 @@
_this.timer = setInterval(function (){
// "234520231228115544f073f4"
cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => {
if (response.data!=null){
if (response.data.orderStatus == "unpaid"){
_this.isQuery = true;
}
if (response.data.orderStatus == "paid"){
_this.isPaySuccess = true;
_this.isQuery = false;
_this.amount = 0
}
if (response.data.orderStatus == "payFail"){
_this.isPaySuccess = false;
_this.isQuery = false;
}
}
_this.resetting1();
})
goodsOrder({orderNo:_this.orderNo}).then( response => {
if (response.data!=null){
if (response.data.status == "unpaid"){
_this.isQuery = true;
@ -2700,22 +2751,11 @@
},500)
},
handClose(){
if(this.isPaySuccess){
this.oilAmount = 0;
this.oilActualPay = 0;
this.oilDiscount = 0;
this.goodsAmount = 0;
this.goodsActualPay = 0;
this.goodsDiscount = 0;
this.consumeAmount = 0;
this.consumeRefuelMoney = 0;
this.oilTotal = 0;
this.goodsTotal = 0;
this.isMember = false;
}
this.isPay = true;
this.dialogVisiblej = false
this.resetting1()
this.member = {};
this.isPaySuccess = false;
this.isPay = false;
this.dialogVisiblej = false
},
//
payMethod(payType){

View File

@ -279,7 +279,7 @@
url: 'business/marketingActivity/activeNewlywedsRecords',
method: 'post',
data: {
storeId: this.storeId
}
}).then(res => {
console.log("11111" + res)

View File

@ -214,7 +214,7 @@
//
getMember(){
request({
url: "business/userManager/user/storeUser/" + this.storeId,
url: "business/userManager/user/storeUserInfo/" + this.storeId,
method: 'get',
}).then((res) => {
this.member = res.data

View File

@ -148,6 +148,7 @@
oilPrice: 0,
//
oilName: "",
oilNameId:"",
//
oilType:"",
// id
@ -169,6 +170,7 @@
deductAmount:0,
//
refuelMoney:[],
refuelMoneyAfter:[],
//
gradeDiscount:[],
//
@ -200,7 +202,7 @@
},
onLoad(e) {
this.orderNo = e.orderNo
// this.orderNo = "23452024011011251833f48e"
// this.orderNo = "234520240111104725ec1fbe"
},
onShow() {
this.getOilOrder();
@ -211,14 +213,12 @@
methods: {
//
payment(){
let refuel = this.refuelMoney
refuel.refuelMoney = this.refuelMoney.refuelMoney - this.oilCardRedece
let map = {
orderNo : this.orderNo,
payAmount : this.payAmount,
// payAmount : "0.01",
discountAmount : this.fullRedece+this.gradeRedece+this.couponRedece,
oilCardAmount : JSON.stringify(refuel),
oilCardAmount : JSON.stringify(this.refuelMoneyAfter),
oilCardLiters : this.oilCardRedece,
balanceAmount : this.balanceRedece,
isOilStorageCard : this.isOilStorageCard,
@ -308,19 +308,23 @@
// 使
chooseRefuelMoney(){
let falg = false;
this.refuelMoney.forEach(item => {
if (item.oilType == this.oilName){
for(let i = 0;i<this.refuelMoney.length;i++){
if (this.refuelMoney[i].oilType == this.oilNameId){
falg = true
this.refuelBalance = item.refuelMoney
this.isOilStorageCard = true
if (this.oilCardRedece >= this.oilOrder.oilNum){
this.refuelBalance = this.refuelMoney[i].refuelMoney
if (this.refuelMoney[i].refuelMoney>0){
this.isOilStorageCard = true
}
if (this.refuelMoney[i].refuelMoney >= this.oilOrder.oilNum){
this.oilCardRedece = this.oilOrder.oilNum
this.refuelMoneyAfter[i].refuelMoney = this.refuelMoney[i].refuelMoney - this.oilOrder.oilNum
}else{
this.oilCardRedece = item.refuelMoney
this.oilCardRedece = this.refuelMoney[i].refuelMoney
this.refuelMoneyAfter[i].refuelMoney = 0
this.chooseCardBalance(1)
}
}
})
}
if (falg == false) {
this.chooseCardBalance(0)
this.chooseGrade(this.user.id,this.user.gradeId)
@ -342,12 +346,17 @@
}else{
// 使
//
let residueAmount = (this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice
let residueAmount = 0
if(this.oilCardRedece>0){
residueAmount = ((this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice).toFixed(2)
}else{
residueAmount = this.oilOrder.orderAmount
}
if (this.user.cardBalance >= residueAmount){
this.balanceRedece = residueAmount
} else {
this.balanceRedece = this.user.cardBalance
this.payAmount = (this.oilOrder.orderAmount - residueAmount - this.balanceRedece).toFixed(2)
this.payAmount = ((residueAmount*100).toFixed(0) - (this.balanceRedece*100).toFixed(0))/100
}
}
}else{
@ -691,9 +700,10 @@
}
_this.user = res.data.userVo;
_this.user = res.data.userVo;
console.log(res.data.userVo.refuelMoney);
// console.log(res.data.userVo.refuelMoney);
if (res.data.userVo.refuelMoney!=null && res.data.userVo.refuelMoney!=""){
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
_this.chooseRefuelMoney()
}else{
_this.chooseCardBalance(0)
@ -752,9 +762,11 @@
method: 'get',
}).then((res) => {
res.data.forEach(item => {
// console.log(item);
if (item.oilName == _this.oilOrder.oils) {
_this.oilPrice = item.gbPrice;
_this.oilName = item.oilNames;
_this.oilNameId = item.oilName;
_this.oilType = item.oilType;
_this.oilId = item.oilId;
}