优化项

This commit is contained in:
cun-nan 2024-01-02 17:13:25 +08:00
parent f161d1368a
commit 76befae703
17 changed files with 368 additions and 30 deletions

View File

@ -8,6 +8,15 @@ export function listMerchant() {
})
}
// 添加商户使用状态
export function addMerchant(data) {
return request({
url: '/api/merchantConfig',
method: 'post',
data: data,
})
}
// 修改商户使用状态
export function editMerchant(data) {
return request({
@ -16,3 +25,20 @@ export function editMerchant(data) {
data: data,
})
}
// 修改商户备注信息
export function editMerchantRemark(data) {
return request({
url: '/api/merchantConfig/edit',
method: 'post',
data: data,
})
}
// 根据id查询商户配置信息
export function merchantInfo(id) {
return request({
url: '/api/merchantConfig/'+id,
method: 'get',
})
}

View File

@ -20,6 +20,7 @@
</el-switch>
</div>
</div>
<div style="margin-top: 20px"><el-button type="primary" icon="el-icon-plus" @click="addMerchant">添加商户信息</el-button></div>
<div class="content-box">
<!-- <el-card class="box-card" shadow="hover" v-for="(item,index) in 10" :key="index">-->
<!-- <div slot="header" class="clearfix">-->
@ -30,13 +31,14 @@
<!-- </el-card>-->
<el-card class="box-card" shadow="hover" v-for="item in merchantList" :key="item.id">
<div slot="header" class="clearfix">
<span>{{ item.merchantName }}</span>
<span><dict-tag :options="dict.type.payment_channel" :value="item.merchantName"/></span>
<el-button v-if="item.isUse=='0'"
@click="editStatus(item,1)"
style="float: right; padding: 3px 0" type="text">切换为当前通道</el-button>
<el-tag v-else effect="dark" type="success" style="float: right">当前使用中</el-tag>
</div>
<div>商户编号:{{ item.mchntCd }}</div>
<div>商户编号: {{ item.mchntCd }}</div>
<div>备注: <span style="color: #00afff;margin-left: 3px" @click="editRemark(item.id)">{{ item.remark ? item.remark : "--" }}</span></div>
</el-card>
</div>
<el-divider></el-divider>
@ -101,18 +103,67 @@
<!-- </div>-->
<div class="hsize">:规则按照顺序进行处理并自动更换支付通道新增或变更规则后需要发布当前规则才生效,发布生效后的规则将从序号1的配置生效</div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%">
<el-form :model="form1" ref="form1" >
<el-form-item label="支付通道" :label-width="formLabelWidth" width="300px">
<el-select
v-model="form1.merchantName"
placeholder="全部"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.payment_channel"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="商户号" :label-width="formLabelWidth">
<el-input v-model="form1.mchntCd" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="form1.remark" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submitMerchant"> </el-button>
</span>
</el-dialog>
<el-dialog :title="title" :visible.sync="show" width="25%" style="margin-top: 200px">
<span>请输入备注信息</span>
<el-input placeholder="请输入备注信息" style="margin-top: 20px"
v-model="merchantConfig.remark"
clearable>
</el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="show = false"> </el-button>
<el-button type="primary" @click="submitRemark"> </el-button>
</span>
</el-dialog>
<!-- 编辑通道规则-->
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible"
<el-dialog :title="title" :visible.sync="dialogFormVisible"
width="30%">
<el-form :model="form" ref="form">
<el-form-item label="支付通道" :label-width="formLabelWidth" width="300px">
<el-select v-model="form.merchConfigId"
@change="changeMerch"
:disabled="isDis" placeholder="请选择商户信息">
<el-option v-for="item in merchantList" :key="item.id"
:label="item.merchantName"
:value="item.id"></el-option>
:disabled="isDis" placeholder="请选择商户信息" style="width: 100%">
<el-option
v-for="item in merchantList" :key="item.id"
:label="item.merchantName"
:value="item.id">
<span style="float: left">
<dict-tag :options="dict.type.payment_channel" :value="item.merchantName"/>
</span>
<span style="color: #00ff80">(111({{ item.remark ? item.remark : "--" }}))</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mchntCd }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商户号" :label-width="formLabelWidth">
@ -149,7 +200,13 @@
</template>
<script>
import {editMerchant, listMerchant} from "@/api/payConfig/merchantconfig";
import {
addMerchant,
editMerchant,
editMerchantRemark,
listMerchant,
merchantInfo
} from "@/api/payConfig/merchantconfig";
import {
addOilConfig,
delOilConfig,
@ -161,6 +218,7 @@ import {
import {addUser, getUserMobile, updateUser} from "@/api/staff/user/user";
export default {
dicts: ['payment_channel'],
name: 'peizhi',
data(){
return{
@ -183,17 +241,62 @@ export default {
resource: '',
desc: ''
},
form1:{},
formLabelWidth: '70px',
dialogFormVisible:false,
dialogVisible:false,
show:false,
value:false,
value1:true,
labelPosition: 'singleDay',
title:"",
merchantConfig:{},
rules:{
}
}
},
created() {
this.getList();
},
methods:{
//
submitRemark(){
editMerchantRemark(this.merchantConfig).then(res => {
if (res.data===1){
this.$modal.msgSuccess("修改成功")
this.getList()
this.show = false
}
})
},
//
editRemark(id){
this.title = "备注"
this.show = true
merchantInfo(id).then(res => {
this.merchantConfig = res.data
})
},
submitMerchant(){
this.$refs["form1"].validate(valid => {
if (valid) {
addMerchant(this.form1).then(res => {
if (res.data == 1){
this.$modal.msgSuccess("添加成功");
this.getList()
this.dialogVisible = false
}
})
}
})
},
//
addMerchant(){
this.title = "添加商户信息"
this.dialogVisible = true
this.form1 = {}
},
//
deleteOilConfig(id){
this.$confirm('确认删除此通道规则吗?', '提示', {
@ -214,6 +317,7 @@ export default {
},
//
addOil(){
this.title = "添加商户规则"
this.dialogFormVisible = true;
this.form = {
name: '',
@ -241,7 +345,7 @@ export default {
if (valid) {
if (this.form.id) {
editOilConfig(this.form).then(response => {
this.$modal.msgSuccess("修改会员成功");
this.$modal.msgSuccess("修改通道成功");
this.getList();
this.dialogFormVisible = false;
this.isDis = false;
@ -251,7 +355,7 @@ export default {
if (response.data==0){
this.$modal.msgError("已存在当前通道商户号的规则");
}else {
this.$modal.msgSuccess("新增会员成功");
this.$modal.msgSuccess("新增通道成功");
this.getList();
this.dialogFormVisible = false;
this.isDis = false;
@ -268,6 +372,7 @@ export default {
},
//
editOilConfig(id){
this.title = "修改商户规则"
this.isDis = true;
this.dialogFormVisible = true;
oilConfigInfo(id).then( response => {

View File

@ -161,12 +161,14 @@
<el-col :span="8">
<el-form-item label="角色组" prop="roleId">
<el-select v-model="form.roleId" placeholder="请选择角色">
<el-option
v-for="item in roleList"
:key="item.dutyId"
:label="item.dutyName"
:value="item.dutyId"
></el-option>
<!-- <el-option-->
<!-- v-for="item in roleList"-->
<!-- :key="item.dutyId"-->
<!-- :label="item.dutyName"-->
<!-- :value="item.dutyId"-->
<!-- ></el-option>-->
<el-option value="普通员工">普通员工</el-option>
<el-option value="收银员">收银员</el-option>
</el-select>
</el-form-item>
</el-col>

View File

@ -9,6 +9,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 商户配置信息 controller层
@ -45,4 +46,33 @@ public class MerchantConfigController extends BaseController {
int row = merchantConfigService.updateMerchStatus(merchantConfig);
return getSuccessResult(row);
}
/**
* 添加商户配置信息
* @param merchantConfig
* @return
*/
@PostMapping
public ResponseObject add(@RequestBody MerchantConfig merchantConfig){
return getSuccessResult(merchantConfigService.insertMerch(merchantConfig));
}
/**
* 修改商户备注信息
* @param id
* @return
*/
@GetMapping("/{id}")
public ResponseObject selectMerchant(@PathVariable Integer id){
return getSuccessResult(merchantConfigService.selectMerchById(id));
}
/**
* 修改商户备注信息
* @param merchantConfig
* @return
*/
@PostMapping("/edit")
public ResponseObject editMerchantRemark(@RequestBody MerchantConfig merchantConfig){
return getSuccessResult(merchantConfigService.updateMerchRemark(merchantConfig));
}
}

View File

@ -0,0 +1,30 @@
package com.fuint.api.fuyou.entity;
/**
* 公共商户信息
*/
public class FuYouPublicMerchant {
// 机构号
public static String insCd = "08K0069065";
// 公钥
public static String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmQr0jkE9LmCFm/o7Gv2FMXbCyQunOEDgMSxcr\n" +
"QavrvZW4qAL3mHwo8qkJnv4N4cVZcbwQmDziLYTncs60wwpWEN4w63gHxr7BMDPzESBF/q9smVSb\n" +
"SKL+rWzIBEqEvtNuRje64VJivII5RaTdm7OTvt10yt+G/7xkSAlFCBJ85wIDAQAB";
// 私钥
public static String privateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKZCvSOQT0uYIWb+jsa/YUxdsLJC\n" +
"6c4QOAxLFytBq+u9lbioAveYfCjyqQme/g3hxVlxvBCYPOIthOdyzrTDClYQ3jDreAfGvsEwM/MR\n" +
"IEX+r2yZVJtIov6tbMgESoS+025GN7rhUmK8gjlFpN2bs5O+3XTK34b/vGRICUUIEnznAgMBAAEC\n" +
"gYBtriVcKr1E301ZxqCl2Gb1m/EPCDl5aRWwdnEIZkBmOiFlOeELOZre4IZHBI4Q1ln8kZ1BTU0M\n" +
"4H6GuSRH90r/PJ/PDsdEnMkPAu3YuakfEqUtypNxTAYZ4kHo1ZL3LfCJxtENV8BYkRHEL9VKD7rA\n" +
"W5tFk1Ww1Q6/zJVs0zGhMQJBAPCdZqG8BwoDcQyZFcrqk1aeXFsGqVQL/9cbrl1TNeVTUZLykbuZ\n" +
"SsOiluDm15EABUP1Exb6cTuoizK57naYf0MCQQCw5D4g0QboKQL5JPZP8fpaQn3Y8uN/tSWnpYfu\n" +
"0+T1zkZFeR/z6kkfQ9yyWXgjeJ2i7QRVJalOvoR46QKl/zeNAkBJfMlLvFGqDUMJxfeR8fLuEY/D\n" +
"fVVaBhAtcpbeift7/uZ7Kvq3gSoEdjP+nIJaFteE2eTqr7LFtcRNydu6/PhhAkAt01NNCRmy9zzv\n" +
"8mVlHJjw3RzhITtSkEkq/zUR6A7+puuJf/GJLP64fMol4gu/lLWxyZk/vbv4zF5hPGwVOOLZAkEA\n" +
"iPtSRaIgYkbP2JOWFaoKbwBa3Jo261yQlpPpprLEcUyxCok4bjlbY6cAWmx1hkJ21OmLSbyhb+zi\n" +
"vJOlcnXvVw==";
// 微信appid
public static String appid = "wxd8014eaf9bd72e93";
// 支付宝appid
public static String alipayAppid = "2021004130635045";
}

View File

@ -70,5 +70,9 @@ public class MerchantConfig extends BaseEntity implements Serializable {
* 支付宝小程序appid
*/
private String alipayAppid;
/**
* 备注信息
*/
private String remark;
}

View File

@ -69,4 +69,18 @@ public interface MerchantConfigService extends IService<MerchantConfig> {
* @return
*/
public int updateMerchIsOpen(String isOpenRule);
/**
* 根据id修改用户备注信息
* @param merchantConfig
* @return
*/
public int updateMerchRemark(MerchantConfig merchantConfig);
/**
* 添加商户配置信息
* @param merchantConfig
* @return
*/
public int insertMerch(MerchantConfig merchantConfig);
}

View File

@ -2,6 +2,7 @@ package com.fuint.api.fuyou.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.api.fuyou.entity.FuYouPublicMerchant;
import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.mapper.MerchantConfigMapper;
import com.fuint.api.fuyou.service.MerchantConfigService;
@ -107,4 +108,27 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
}
return row;
}
@Override
public int updateMerchRemark(MerchantConfig merchantConfig) {
return baseMapper.updateById(merchantConfig);
}
@Override
public int insertMerch(MerchantConfig merchantConfig) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
merchantConfig.setStoreId(nowAccountInfo.getStoreId());
if (merchantConfig.getMerchantName().equals("富友")){
merchantConfig.setInsCd(FuYouPublicMerchant.insCd);
merchantConfig.setPublicKey(FuYouPublicMerchant.publicKey);
merchantConfig.setPrivateKey(FuYouPublicMerchant.privateKey);
}
merchantConfig.setAppid(FuYouPublicMerchant.appid);
merchantConfig.setAlipayAppid(FuYouPublicMerchant.alipayAppid);
merchantConfig.setIsUse("0");
merchantConfig.setIsOpenRule("0");
merchantConfig.setAmount(0.0);
int row = baseMapper.insert(merchantConfig);
return row;
}
}

View File

@ -27,7 +27,10 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
@Override
public void oilRule() {
List<OilConfig> list = baseMapper.selectList(null);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
List<OilConfig> list = baseMapper.selectList(queryWrapper);
Double amountAll = 0.0;
// 百分占比
List<Double> proList = new ArrayList<>();
@ -62,7 +65,10 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
public int judgmentProportion() {
int result = 0;
int percentage = 0;
List<OilConfig> list = baseMapper.selectList(null);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
List<OilConfig> list = baseMapper.selectList(queryWrapper);
for (OilConfig config : list) {
percentage += config.getProportion();
}

View File

@ -10,4 +10,25 @@ public interface IndexBannerService {
* @return
*/
List<IndexBanner> selectIndexBannerList(int storeId);
/**
* 根据路由地址查询首页banner图是否存在
* @param routeUrl
* @return
*/
IndexBanner selectIndexBannerByRouteUrl(String routeUrl);
/**
* 添加首页banner图
* @param indexBanner
* @return
*/
int insertIndexBanner(IndexBanner indexBanner);
/**
* 修改首页banner图
* @param indexBanner
* @return
*/
int updateIndexBanner(IndexBanner indexBanner);
}

View File

@ -1,11 +1,13 @@
package com.fuint.business.indexBanner.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.indexBanner.entity.IndexBanner;
import com.fuint.business.indexBanner.mapper.IndexBannerMapper;
import com.fuint.business.indexBanner.service.IndexBannerService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import org.springframework.stereotype.Service;
@ -19,4 +21,36 @@ public class IndexBannerServiceImpl extends ServiceImpl<IndexBannerMapper, Index
queryWrapper.eq("store_id",storeId);
return baseMapper.selectList(queryWrapper);
}
@Override
public IndexBanner selectIndexBannerByRouteUrl(String routeUrl) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("route_url",routeUrl);
return baseMapper.selectOne(queryWrapper);
}
@Override
public int insertIndexBanner(IndexBanner indexBanner) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
indexBanner.setStoreId(nowAccountInfo.getStoreId());
int row = 0;
if (StringUtils.isEmpty(indexBanner.getRouteUrl())){
indexBanner.setBannerUrl("http://47.95.206.185:83/topbj.png");
indexBanner.setRouteUrl("/pagesHome/Activity/index");
row = baseMapper.insert(indexBanner);
}else {
IndexBanner indexBanner1 = this.selectIndexBannerByRouteUrl(indexBanner.getRouteUrl());
if (ObjectUtil.isNotEmpty(indexBanner1)){
row = 0;
}else {
row = baseMapper.insert(indexBanner);
}
}
return row;
}
@Override
public int updateIndexBanner(IndexBanner indexBanner) {
return 0;
}
}

View File

@ -107,7 +107,7 @@ public class LJStaff extends BaseEntity implements Serializable {
private String pos;
@ApiModelProperty("角色id")
private Integer roleId;
private String roleId;
@ApiModelProperty("登入密码")
@TableField(exist = false)

View File

@ -52,6 +52,16 @@ public class QRCodeController extends BaseController {
return getSuccessResult(qrCode);
}
/**
* 添加门店二维码信息
* @return
*/
@GetMapping("/add")
public ResponseObject addQrCode(){
QRCode qrCode = new QRCode();
return getSuccessResult(iqrCodeService.insertQRCode(qrCode));
}
/**
* 删除二维码信息
* @return

View File

@ -1,14 +1,20 @@
package com.fuint.business.storeInformation.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;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.indexBanner.entity.IndexBanner;
import com.fuint.business.indexBanner.service.IndexBannerService;
import com.fuint.business.storeInformation.entity.LJStore;
import com.fuint.business.storeInformation.entity.QRCode;
import com.fuint.business.storeInformation.mapper.QRCodeMapper;
import com.fuint.business.storeInformation.service.ILJStoreService;
import com.fuint.business.storeInformation.service.IQRCodeService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@ -58,6 +64,11 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> impleme
baseMapper.deleteById(id);
}
@Autowired
private ILJStoreService storeService;
@Autowired
private IndexBannerService indexBannerService;
/**
* 增加二维码信息
* @param qrCode
@ -65,10 +76,24 @@ public class QRCodeServiceImpl extends ServiceImpl<QRCodeMapper, QRCode> impleme
*/
@Override
public int insertQRCode(QRCode qrCode) {
// 查询是否存在当前门店二维码信息
QRCode qrCode1 = this.selectQRCode();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
qrCode.setStoreId(storeId);
int row = baseMapper.insert(qrCode);
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
int row = 0;
if (ObjectUtil.isEmpty(qrCode1)){
qrCode.setStoreId(store.getId());
qrCode.setChainStoreId(store.getChainStoreId());
// 带有店铺id 跳转首页
qrCode.setCollection("https://www.tuofeng.cc/oilIndex?storeId="+store.getChainStoreId());
// 带有店铺id 跳转一键加油页面
qrCode.setPayment("https://www.tuofeng.cc/oilRefuel?storeId="+store.getChainStoreId());
row = baseMapper.insert(qrCode);
IndexBanner indexBanner = new IndexBanner();
indexBannerService.insertIndexBanner(indexBanner);
}else {
row = 0;
}
return row;
}

View File

@ -1,6 +1,8 @@
package com.fuint.system.dept.controller;
import com.fuint.business.storeInformation.entity.QRCode;
import com.fuint.business.storeInformation.service.IQRCodeService;
import com.fuint.common.constant.UserConstants;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.StringUtils;
@ -59,6 +61,9 @@ public class SysDeptController extends BaseController
return getSuccessResult(deptService.selectDeptById(deptId));
}
@Autowired
private IQRCodeService iqrCodeService;
/**
* 新增部门
*/
@ -68,6 +73,8 @@ public class SysDeptController extends BaseController
{
return getFailureResult("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
}
QRCode qrCode = new QRCode();
iqrCodeService.insertQRCode(qrCode);
return getSuccessResult(deptService.insertDept(dept));
}

View File

@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDictDataByType" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
where status = '0' and dict_type = #{dictType} order by dict_sort asc
where status = 'qy' and dict_type = #{dictType} order by dict_sort asc
</select>
<select id="selectDictLabel" resultType="String">

View File

@ -186,7 +186,7 @@
let str = q.split("?")[1];
let arr = str.split("&");
let storeId = "18";
let storeId = "19";
let staffId = "";
arr.forEach(item => {
@ -201,12 +201,12 @@
this.storeId = uni.getStorageSync("storeId")
this.staffId = uni.getStorageSync("inviteStaffId")
} else {
let storeId = "18";
uni.setStorageSync("storeId", storeId)
this.storeId = uni.getStorageSync("storeId")
if (uni.getStorageSync("storeId")){
this.storeId = uni.getStorageSync("storeId")
}else{
let storeId = "19";
uni.setStorageSync("storeId", storeId)
}
}
// this.isExistStoreId();