This commit is contained in:
cun-nan 2024-09-09 08:46:27 +08:00
parent 5e3bf43642
commit cc71deba29
3 changed files with 34 additions and 14 deletions

View File

@ -408,7 +408,7 @@
</el-table>
</div>
<el-dialog :title="addMerchantTitile" :visible.sync="addMerchants" width="550px">
<el-form :model="form" ref="formAdd" :rules="rules">
<el-form :model="form" ref="formAdd" :rules="rules" :inline="true">
<el-form-item label="所属机构" :label-width="formLabelWidth" prop="deptId">
<el-select v-model="form.deptId+''" disabled placeholder="请选择所属机构" style="width: 350px">
<el-option
@ -457,11 +457,11 @@
<el-dialog :title="Ruletitle" :visible.sync="addRule">
<el-form :model="formRule" ref="formRule" :rules="rules">
<el-form-item label="规则名称" :label-width="formLabelWidth" prop="ruleName">
<el-input v-model="formRule.ruleName" placeholder="请输入规则名称" autocomplete="off" style="width: 350px" :disabled="!isEditable"></el-input>
<el-input v-model="formRule.ruleName" placeholder="请输入规则名称" autocomplete="off" style="width: 350px"></el-input>
</el-form-item>
<el-form-item label="规则描述" :label-width="formLabelWidth">
<el-input type="textarea" v-model="formRule.description" placeholder="请输入规则描述" autocomplete="off"
style="width: 350px" :disabled="!isEditable"></el-input>
style="width: 350px"></el-input>
</el-form-item>
<el-form-item label="规则类型" :label-width="formLabelWidth" prop="ruleType">
<div style="display: flex">
@ -495,7 +495,7 @@
</el-form-item>
<el-form-item label="交易占比" :label-width="formLabelWidth">
<el-input v-model="item.proportion" placeholder="请输入交易占比" autocomplete="off" style="width: 300px" :disabled="!isEditable">
<el-input v-model="item.proportion" placeholder="请输入交易占比" autocomplete="off" style="width: 300px">
<template slot="append">%</template>
</el-input>
</el-form-item>
@ -569,7 +569,7 @@
</el-dialog>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%">
<el-form :model="form1" ref="form1" :rules="rules">
<el-form :model="form1" ref="form1" :rules="rules" label-width="100px">
<el-form-item label="支付通道" :label-width="formLabelWidth" prop="merchantName" width="300px">
<el-select
v-model="form1.merchantName"
@ -690,7 +690,7 @@ import {
import {
addRuleConfig,
deleteRuleConfig,
editRuleConfig,
editRuleConfig, enableRuleConfig,
getOilGunList,
getRuleConfig,
listRuleConfig, listRuleConfigs
@ -724,7 +724,7 @@ export default {
desc: ''
},
form1: {},
formLabelWidth: '80px',
formLabelWidth: '100px',
dialogFormVisible: false,
dialogVisible: false,
dialogVisibleList: false,
@ -794,6 +794,7 @@ export default {
if (res.data === 1) {
this.$modal.msgSuccess("启用成功")
this.getList()
this.tableData1list()
this.Enable = false
}else {
this.$modal.msgError("启用失败,请确保交易占比相加满足百分之百")
@ -851,6 +852,7 @@ export default {
if (res.data === 1) {
this.$modal.msgSuccess("修改成功")
this.getList()
this.tableData1list()
this.addRule = false
}else {
this.$modal.msgError("规则名称不可重复")
@ -863,6 +865,7 @@ export default {
if (res.data == 1) {
this.$modal.msgSuccess("添加成功");
this.getList()
this.tableData1list()
this.addRule = false
} else {
this.$modal.msgError("添加失败,规则名称不可重复")
@ -1226,11 +1229,11 @@ export default {
},
//
tableData1list() {
listRuleConfigs().then(response => {
// listRuleConfigs().then(response => {
//
// console.log(response.data + " -==- -==-")
console.log(response.data + " -==- -==-")
this.tableData1 = response.data;
// this.tableData1 = response.data;
/*this.merchantList.forEach(item => {
if (item.isOpenRule == "1") {
this.value1 = false;
@ -1241,6 +1244,9 @@ export default {
listOilConfig().then(response => {
this.oilConfigList = response.data;
})*/
// })
listRuleConfig().then(res => {
this.tableData1 = res.data
})
},
open() {
@ -1275,7 +1281,7 @@ export default {
.new-box {
width: 100%;
height: 80vh;
height: 89vh;
overflow: auto;
background: #fff;
box-sizing: border-box;

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.api.fuyou.vo.MerchantConfigVo;
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.springframework.beans.factory.annotation.Autowired;
@ -40,8 +42,9 @@ public class MerchantConfigController extends BaseController {
*/
@GetMapping("/list")
public ResponseObject list(){
List<MerchantConfig> list = merchantConfigService.selectMerchList();
return getSuccessResult(list);
// List<MerchantConfig> list = merchantConfigService.selectMerchList();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
return getSuccessResult(merchantConfigService.selectMerchList(nowAccountInfo.getStoreId()));
}
@GetMapping("/list2")

View File

@ -11,6 +11,8 @@ import com.fuint.api.fuyou.service.OilConfigService;
import com.fuint.api.fuyou.service.PaymentRuleConfigService;
import com.fuint.api.fuyou.vo.OilConfigVo;
import com.fuint.api.fuyou.vo.PaymentRuleConfigVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
@ -30,6 +32,10 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
@Override
public List<PaymentRuleConfigVo> selectList(PaymentRuleConfig paymentRuleConfig) {
if (ObjectUtil.isEmpty(paymentRuleConfig.getStoreId())){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
paymentRuleConfig.setStoreId(nowAccountInfo.getStoreId());
}
List<PaymentRuleConfigVo> list = baseMapper.selectListByStoreId(paymentRuleConfig);
for (PaymentRuleConfig ruleConfig : list) {
List<OilConfigVo> oilConfigs = oilConfigService.selectListByRuleConfigId(ruleConfig.getId());
@ -76,6 +82,11 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
if (ObjectUtil.isNotEmpty(paymentRuleConfig)){
return 0;
}
if (ObjectUtil.isEmpty(ruleConfig.getStoreId())){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
ruleConfig.setStoreId(nowAccountInfo.getStoreId());
ruleConfig.setDeptId(Math.toIntExact(nowAccountInfo.getDeptId()));
}
int row = baseMapper.insert(ruleConfig);
paymentRuleConfig = selectRuleByRuleName(ruleConfig.getRuleName(), ruleConfig.getStoreId());
if (ObjectUtil.isNotEmpty(paymentRuleConfig)) {