This commit is contained in:
cun-nan 2024-07-18 16:14:13 +08:00
parent 533c8b4b0a
commit 7fe4e8355b
23 changed files with 497 additions and 79 deletions

View File

@ -97,6 +97,29 @@
:data="tableData1" :data="tableData1"
style="width: 100%;margin-bottom: 20px;" style="width: 100%;margin-bottom: 20px;"
border> border>
<el-table-column type="expand" >
<template slot-scope="props">
<el-table ref="tables" :data="props.row.ruleList">
<el-table-column align="center" width="50"></el-table-column>
<el-table-column label="支付通道" prop="merchantName" align="center" width="120"/>
<el-table-column label="商户号编码" prop="mchntCd" align="center" width="150"/>
<el-table-column label="交易占比" prop="proportion" v-if="props.row.ruleType==1" align="center" width="80">
<template slot-scope="scope">
<span>{{ scope.row.proportion }}%</span>
</template>
</el-table-column>
<el-table-column label="交易类型" prop="transactionType" v-if="props.row.ruleType==2" align="center" width="400">
<template slot-scope="scope">
<div v-if="scope.row.transactionType.includes('1')">会员充值,</div>
<div v-if="scope.row.transactionType.includes('2')">便利店,</div>
<div v-if="scope.row.transactionType.includes('3')">积分商城,</div>
<div v-if="scope.row.transactionType.includes('4')">{{ scope.row.oilGunName }}</div>
<div v-if="scope.row.transactionType.includes('5')">油品+便利店组合付款</div>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column <el-table-column
type="index" type="index"
align="center" align="center"
@ -108,9 +131,9 @@
label="规则名称" label="规则名称"
align="center" align="center"
width="120"> width="120">
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<div style="color: #409EFF;cursor: pointer">规则名称</div> <!-- <div style="color: #409EFF;cursor: pointer">{{ scope.row.ruleName }}</div>-->
</template> <!-- </template>-->
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -131,7 +154,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.status" v-model="scope.row.status"
@change="EnableRule(scope.row)" @change="scope.row.status=='qy' ? EnableRule(scope.row) : submitEnable('jy')"
active-value="qy" active-value="qy"
inactive-value="jy" inactive-value="jy"
active-color="#13ce66" active-color="#13ce66"
@ -222,7 +245,7 @@
</el-dialog> </el-dialog>
<el-dialog :title="Ruletitle" :visible.sync="addRule"> <el-dialog :title="Ruletitle" :visible.sync="addRule">
<el-form :model="formRule" ref="formRule" :rules="rules"> <el-form :model="formRule" ref="formRule" :rules="rules">
<el-form-item label="规则名称" :label-width="formLabelWidth"> <el-form-item label="规则名称" :label-width="formLabelWidth" prop="ruleName">
<el-input v-model="formRule.ruleName" placeholder="请输入规则名称" autocomplete="off" style="width: 350px"></el-input> <el-input v-model="formRule.ruleName" placeholder="请输入规则名称" autocomplete="off" style="width: 350px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="规则描述" :label-width="formLabelWidth"> <el-form-item label="规则描述" :label-width="formLabelWidth">
@ -249,10 +272,10 @@
<el-select v-model="item.merchConfigId" placeholder="请选择支付通道" style="width: 300px" <el-select v-model="item.merchConfigId" placeholder="请选择支付通道" style="width: 300px"
@change="chooseMerchConfig(item.merchConfigId,index)"> @change="chooseMerchConfig(item.merchConfigId,index)">
<el-option <el-option
v-for="(item,i) in merchantList" v-for="(item1,i) in merchantList"
:key="item.id" :key="item1.id"
:label="item.remark ? (item.merchantName+''+item.remark+'') : (item.merchantName+'--')" :label="item1.remark ? (item1.merchantName+''+item1.remark+'') : (item1.merchantName+'--')"
:value="item.id"></el-option> :value="item1.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商户号编号" :label-width="formLabelWidth"> <el-form-item label="商户号编号" :label-width="formLabelWidth">
@ -275,10 +298,10 @@
<el-select v-model="item.merchConfigId" placeholder="请选择支付通道" style="width: 300px" <el-select v-model="item.merchConfigId" placeholder="请选择支付通道" style="width: 300px"
@change="chooseMerchConfig(item.merchConfigId,index)"> @change="chooseMerchConfig(item.merchConfigId,index)">
<el-option <el-option
v-for="(item,i) in merchantList" v-for="(item1,i) in merchantList"
:key="item.id" :key="item1.id"
:label="item.remark ? (item.merchantName+''+item.remark+'') : (item.merchantName+'--')" :label="item1.remark ? (item1.merchantName+''+item1.remark+'') : (item1.merchantName+'--')"
:value="item.id"></el-option> :value="item1.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商户号编号" :label-width="formLabelWidth"> <el-form-item label="商户号编号" :label-width="formLabelWidth">
@ -286,20 +309,21 @@
style="width: 300px" disabled></el-input> style="width: 300px" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="交易类型" :label-width="formLabelWidth"> <el-form-item label="交易类型" :label-width="formLabelWidth">
<el-select v-model="item.transactionType" placeholder="请选择交易类型" style="width: 300px"> <el-select v-model="item.transactionType" multiple placeholder="请选择交易类型" style="width: 300px">
<el-option label="会员充值" value="1"></el-option> <el-option label="会员充值" value="1"></el-option>
<el-option label="便利店" value="2"></el-option> <el-option label="便利店" value="2"></el-option>
<el-option label="积分商城" value="3"></el-option> <el-option label="积分商城" value="3"></el-option>
<el-option label="油品" value="4"></el-option> <el-option label="油品" value="4"></el-option>
<el-option label="油品+便利店组合收款" value="5"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="油号-油枪" :label-width="formLabelWidth" v-if="item.transactionType==4"> <el-form-item label="油号-油枪" :label-width="formLabelWidth" v-if="item.transactionType.includes('4')">
<el-select v-model="item.oilGunId" placeholder="请选择油号-油枪" style="width: 300px"> <el-select v-model="item.oilGunId" multiple collapse-tags placeholder="请选择油号-油枪" style="width: 300px">
<el-option <el-option
v-for="item in oilGunList" v-for="item1 in oilGunList"
:key="item.id" :key="item1.id"
:label="item.oilNumber+'-'+item.gunName" :label="item1.oilNumber+'-'+item1.gunName"
:value="item.id"></el-option> :value="item1.id+''"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
@ -697,6 +721,9 @@ export default {
deptId: [ deptId: [
{required: true, message: '请选择机构信息', trigger: 'blur'}, {required: true, message: '请选择机构信息', trigger: 'blur'},
], ],
ruleName: [
{required: true, message: '请输入规则名称', trigger: 'blur'},
],
} }
} }
}, },
@ -721,7 +748,49 @@ export default {
// //
submitAddRule(){ submitAddRule(){
this.$refs["formRule"].validate(valid => { this.$refs["formRule"].validate(valid => {
if (this.formRule.ruleType == 2) {
let typeList = []
let oilGunIds = []
this.formRule.ruleList.forEach(item => {
if (item.oilGunId) {
oilGunIds.push(...item.oilGunId)
}
if (item.transactionType) {
typeList.push(...item.transactionType)
}
})
typeList = typeList.filter((item, index, arr) => arr.indexOf(item) === index);
oilGunIds = oilGunIds.filter((item, index, arr) => arr.indexOf(item) === index);
if (typeList.length < 5) {
this.$message.error("请确保交易类型全部选择")
return
}
if (oilGunIds.length < this.oilGunList.length) {
this.$message.error("请确保油枪号全部选择")
return;
}
}else {
let proportion = 0
this.formRule.ruleList.forEach(item => {
if (item.proportion) {
proportion += Number(item.proportion)
}
})
console.log(proportion)
if (proportion!=100){
this.$message.error("请确保交易占比相加为百分之百")
return;
}
}
if (valid) { if (valid) {
this.formRule.ruleList.forEach(item => {
if (item.oilGunId){
item.oilGunId = item.oilGunId.toString()
}
if (item.transactionType){
item.transactionType = item.transactionType.toString()
}
})
if (this.formRule.id) { if (this.formRule.id) {
editRuleConfig(this.formRule).then(res => { editRuleConfig(this.formRule).then(res => {
if (res.data === 1) { if (res.data === 1) {
@ -798,6 +867,14 @@ export default {
this.Ruletitle = '修改商户信息' this.Ruletitle = '修改商户信息'
this.addRule = true this.addRule = true
this.formRule = res.data this.formRule = res.data
this.formRule.ruleList.forEach(item => {
if (item.oilGunId){
item.oilGunId = item.oilGunId.split(",")
}
if (item.transactionType){
item.transactionType = item.transactionType.split(",")
}
})
}) })
}, },
EnableRule(data){ EnableRule(data){

View File

@ -49,7 +49,9 @@
<el-table-column label="员工状态" align="center" width="80" prop="status"> <el-table-column label="员工状态" align="center" width="80" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.value" v-model="scope.row.status"
active-value="qy"
inactive-value="jy"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949"> inactive-color="#ff4949">
</el-switch> </el-switch>

View File

@ -81,8 +81,31 @@ public class FyPayController {
allOrderInfo.setPayTime(new Date()); allOrderInfo.setPayTime(new Date());
allOrderInfoService.updateAllOrderInfo(allOrderInfo); allOrderInfoService.updateAllOrderInfo(allOrderInfo);
String transactionType = null;
String oilGunId = null;
OilOrder oilOrder = orderService.selectOilOrderByOrderNo(orderNo);
if (allOrderInfo.getType().equals("1")){
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else if (allOrderInfo.getType().equals("2")){
transactionType = "2";
}else if (allOrderInfo.getType().equals("3") || allOrderInfo.getType().equals("5")){
transactionType = "1";
}else if (allOrderInfo.getType().equals("4")){
transactionType = "3";
}else if (allOrderInfo.getType().equals("6")){
transactionType = "5";
}else if (allOrderInfo.getType().equals("8")){
if (ObjectUtil.isNotEmpty(oilOrder)){
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else {
transactionType = "1";
}
}
// 修改配置收款账户余额信息 // 修改配置收款账户余额信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(allOrderInfo.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(allOrderInfo.getStoreId(),transactionType,oilGunId);
Double beforeAmount = merchantConfig.getAmount(); Double beforeAmount = merchantConfig.getAmount();
Double afterAmount = beforeAmount + allOrderInfo.getPayMoney(); Double afterAmount = beforeAmount + allOrderInfo.getPayMoney();
merchantConfig.setAmount(afterAmount); merchantConfig.setAmount(afterAmount);
@ -114,17 +137,17 @@ public class FyPayController {
} }
} }
@GetMapping("/test") // @GetMapping("/test")
public String test() throws Exception { // public String test() throws Exception {
ReceiveParameterPos receiveParameterPos = new ReceiveParameterPos(); // ReceiveParameterPos receiveParameterPos = new ReceiveParameterPos();
receiveParameterPos.setPayType("WECHAT"); // receiveParameterPos.setPayType("WECHAT");
receiveParameterPos.setContent("ceshi"); // receiveParameterPos.setContent("ceshi");
receiveParameterPos.setOrderNo("20240509fdskjhv003"); // receiveParameterPos.setOrderNo("20240509fdskjhv003");
receiveParameterPos.setStoreId(141); // receiveParameterPos.setStoreId(141);
receiveParameterPos.setGoodsMoney(0.01); // receiveParameterPos.setGoodsMoney(0.01);
fyPayService.mainScan(receiveParameterPos); // fyPayService.mainScan(receiveParameterPos);
return "succse"; // return "succse";
} // }
// 接收支付平台异步通知的接口 // 接收支付平台异步通知的接口
@PostMapping("/notifyScan") @PostMapping("/notifyScan")
@ -148,8 +171,31 @@ public class FyPayController {
allOrderInfo.setPayTime(new Date()); allOrderInfo.setPayTime(new Date());
allOrderInfoService.updateAllOrderInfo(allOrderInfo); allOrderInfoService.updateAllOrderInfo(allOrderInfo);
String transactionType = null;
String oilGunId = null;
OilOrder oilOrder = orderService.selectOilOrderByOrderNo(orderNo);
if (allOrderInfo.getType().equals("1")){
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else if (allOrderInfo.getType().equals("2")){
transactionType = "2";
}else if (allOrderInfo.getType().equals("3") || allOrderInfo.getType().equals("5")){
transactionType = "1";
}else if (allOrderInfo.getType().equals("4")){
transactionType = "3";
}else if (allOrderInfo.getType().equals("6")){
transactionType = "5";
}else if (allOrderInfo.getType().equals("8")){
if (ObjectUtil.isNotEmpty(oilOrder)){
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else {
transactionType = "1";
}
}
// 修改配置收款账户余额信息 // 修改配置收款账户余额信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(allOrderInfo.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(allOrderInfo.getStoreId(),transactionType,oilGunId);
Double beforeAmount = merchantConfig.getAmount(); Double beforeAmount = merchantConfig.getAmount();
Double afterAmount = beforeAmount + allOrderInfo.getPayMoney(); Double afterAmount = beforeAmount + allOrderInfo.getPayMoney();
merchantConfig.setAmount(afterAmount); merchantConfig.setAmount(afterAmount);

View File

@ -78,6 +78,10 @@ public class PaymentRuleConfig extends BaseEntity implements Serializable {
* 修改用户 * 修改用户
*/ */
private String updateBy; private String updateBy;
/**
* 是否手动启用
*/
private String handEnable;
@TableField(exist = false) @TableField(exist = false)
private List<OilConfigVo> ruleList; private List<OilConfigVo> ruleList;

View File

@ -35,4 +35,8 @@ public class ReceiveParameter {
* 订单描述 * 订单描述
*/ */
private String content; private String content;
/**
* 油枪id
*/
private String oilGunId;
} }

View File

@ -43,4 +43,8 @@ public class ReceiveParameterPos {
* 订单描述 * 订单描述
*/ */
private Double oilCardAmount; private Double oilCardAmount;
/**
* 油枪id
*/
private String oilGunId;
} }

View File

@ -11,5 +11,5 @@ public interface MerchantConfigMapper extends BaseMapper<MerchantConfig> {
MerchantConfig getConfig(@Param("storeId") Integer storeId, @Param("mchntCd") String mchntCd); MerchantConfig getConfig(@Param("storeId") Integer storeId, @Param("mchntCd") String mchntCd);
int subtractAmount(@Param("id") Integer id,@Param("changeTheAmount") Double changeTheAmount); int subtractAmount(@Param("id") Integer id,@Param("changeTheAmount") Double changeTheAmount);
List<MerchantConfigVo> selectList(@Param("merchantConfig") MerchantConfigVo merchantConfig); List<MerchantConfigVo> selectList1(@Param("merchantConfig") MerchantConfigVo merchantConfig);
} }

View File

@ -14,7 +14,7 @@
mchnt_cd = #{mchntCd} mchnt_cd = #{mchntCd}
limit 1 limit 1
</select> </select>
<select id="selectList" resultType="com.fuint.api.fuyou.vo.MerchantConfigVo" <select id="selectList1" resultType="com.fuint.api.fuyou.vo.MerchantConfigVo"
parameterType="com.fuint.api.fuyou.vo.MerchantConfigVo"> parameterType="com.fuint.api.fuyou.vo.MerchantConfigVo">
SELECT mc.*,sd.dept_name,ta.real_name FROM `merchant_config` mc SELECT mc.*,sd.dept_name,ta.real_name FROM `merchant_config` mc
LEFT JOIN sys_dept sd ON mc.dept_id = sd.dept_id LEFT JOIN sys_dept sd ON mc.dept_id = sd.dept_id

View File

@ -20,10 +20,19 @@ public interface MerchantConfigService extends IService<MerchantConfig> {
/** /**
* 根据店铺id查询正在使用的商户信息 * 根据店铺id查询正在使用的商户信息
* @param storeId 店铺id
* @param transactionType 交易类型 1会员充值2便利店3积分商城4油品5油品+便利店组合付款
* @param oilGunId 油枪id 不是油品付款传null
* @return
*/
public MerchantConfig selectMeChByIdIsUse(Integer storeId,String transactionType,String oilGunId);
/**
* 根据店铺id查询正在使用的商户信息备份
* @param storeId * @param storeId
* @return * @return
*/ */
public MerchantConfig selectMeChByIdIsUse(int storeId); public MerchantConfig selectMeChByIdIsUse1(int storeId);
/** /**
* 根据storeId修改消费后的金额信息 * 根据storeId修改消费后的金额信息

View File

@ -14,6 +14,15 @@ public interface OilConfigService extends IService<OilConfig> {
* 规则配置 * 规则配置
*/ */
public void oilRule(Integer storeId); public void oilRule(Integer storeId);
/**
* 规则配置 交易占比
*/
public void oilRule1(Integer storeId,Integer ruleConfigId);
/**
* 规则配置 交易类型
*/
public void oilRule2(Integer storeId,Integer ruleConfigId,String transactionType,String oilGunId);
/** /**
* 判断占比相加是否为100% 是返回1 不是返回0 * 判断占比相加是否为100% 是返回1 不是返回0

View File

@ -56,6 +56,13 @@ public interface PaymentRuleConfigService extends IService<PaymentRuleConfig> {
*/ */
int enablePaymentRuleConfig(PaymentRuleConfig ruleConfig); int enablePaymentRuleConfig(PaymentRuleConfig ruleConfig);
/**
* 根据店铺id查询正在使用的规则信息
* @param storeId
* @return
*/
PaymentRuleConfig selectInfoByStoreId(Integer storeId);
/** /**
* 判断规则是否到启用时间 * 判断规则是否到启用时间
*/ */

View File

@ -190,7 +190,23 @@ public class FyPayServiceImpl implements FyPayService {
List<OilOrder> list = oilOrderService.selectOilOrder(orderNo); List<OilOrder> list = oilOrderService.selectOilOrder(orderNo);
LJOrder goodsOrder = goodsOrderService.selectGoodsOrder(orderNo); LJOrder goodsOrder = goodsOrderService.selectGoodsOrder(orderNo);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo); CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId1); String transactionType = null;
String oilGunId = null;
if (ObjectUtil.isNotEmpty(oilOrder) && ObjectUtil.isNotEmpty(goodsOrder)){
transactionType = "5";
}else if (ObjectUtil.isNotEmpty(oilOrder)) {
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else if (ObjectUtil.isNotEmpty(goodsOrder)) {
transactionType = "2";
}
if ("CVR".equals(type) || "CFR".equals(type)) {
transactionType = "1";
}
if ("IOS".equals(type)) {
transactionType = "3";
}
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId1,transactionType,oilGunId);
List<ReturnRecord> returnRecords = returnRecordService.selectReturnRecordByOrderNo(orderNo); List<ReturnRecord> returnRecords = returnRecordService.selectReturnRecordByOrderNo(orderNo);
Date date = new Date(); Date date = new Date();
if (reqMap.get("trans_stat").equals("SUCCESS")) { if (reqMap.get("trans_stat").equals("SUCCESS")) {
@ -466,8 +482,22 @@ public class FyPayServiceImpl implements FyPayService {
public Map<String, Object> applet(ReceiveParameter receiveParameter) { public Map<String, Object> applet(ReceiveParameter receiveParameter) {
Map<String, Object> res = new HashMap<>(); Map<String, Object> res = new HashMap<>();
try { try {
String transactionType = null;
String oilGunId = null;
if (receiveParameter.getType().equals("1")){
transactionType = "4";
oilGunId = receiveParameter.getOilGunId();
} else if (receiveParameter.getType().equals("2")){
transactionType = "2";
} else if (receiveParameter.getType().equals("3") || receiveParameter.getType().equals("5")){
transactionType = "1";
} else if (receiveParameter.getType().equals("4")){
transactionType = "3";
} else if (receiveParameter.getType().equals("6")){
transactionType = "5";
}
// 查询商户配置信息 // 查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId(),transactionType,oilGunId);
if (ObjectUtil.isEmpty(merchantConfig)) { if (ObjectUtil.isEmpty(merchantConfig)) {
res.put("code", "error"); res.put("code", "error");
res.put("msg", "暂未配置商户信息"); res.put("msg", "暂未配置商户信息");
@ -659,8 +689,22 @@ public class FyPayServiceImpl implements FyPayService {
public Map<String, Object> posPay(ReceiveParameterPos receiveParameterPos) { public Map<String, Object> posPay(ReceiveParameterPos receiveParameterPos) {
Map<String, Object> res = new HashMap<>(); Map<String, Object> res = new HashMap<>();
try { try {
String transactionType = null;
String oilGunId = null;
if (receiveParameterPos.getType().equals("1")){
transactionType = "4";
oilGunId = receiveParameterPos.getOilGunId();
} else if (receiveParameterPos.getType().equals("2")){
transactionType = "2";
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")){
transactionType = "1";
} else if (receiveParameterPos.getType().equals("4")){
transactionType = "3";
} else if (receiveParameterPos.getType().equals("6")){
transactionType = "5";
}
// 查询商户配置信息 // 查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(),transactionType,oilGunId);
if (ObjectUtil.isEmpty(merchantConfig)) { if (ObjectUtil.isEmpty(merchantConfig)) {
res.put("code", "error"); res.put("code", "error");
res.put("msg", "暂未配置商户信息"); res.put("msg", "暂未配置商户信息");
@ -746,7 +790,21 @@ public class FyPayServiceImpl implements FyPayService {
String str = reqMap.get("sign"); String str = reqMap.get("sign");
if (Utils.verifySign(reqMap, str)) { if (Utils.verifySign(reqMap, str)) {
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(receiveParameterPos.getOrderNo()); OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(receiveParameterPos.getOrderNo());
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId()); String transactionType = null;
String oilGunId = null;
if (receiveParameterPos.getType().equals("1")){
transactionType = "4";
oilGunId = receiveParameterPos.getOilGunId();
} else if (receiveParameterPos.getType().equals("2")){
transactionType = "2";
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")){
transactionType = "1";
} else if (receiveParameterPos.getType().equals("4")){
transactionType = "3";
} else if (receiveParameterPos.getType().equals("6")){
transactionType = "5";
}
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(),transactionType,oilGunId);
ReceiveParameter receiveParameter = new ReceiveParameter(); ReceiveParameter receiveParameter = new ReceiveParameter();
BeanUtils.copyProperties(receiveParameterPos, receiveParameter); BeanUtils.copyProperties(receiveParameterPos, receiveParameter);
Double discountAmount = 0.0; Double discountAmount = 0.0;
@ -825,8 +883,23 @@ public class FyPayServiceImpl implements FyPayService {
@Override @Override
public Map<String, String> mainScan(ReceiveParameterPos receiveParameterPos) throws Exception { public Map<String, String> mainScan(ReceiveParameterPos receiveParameterPos) throws Exception {
Map<String, String> res = new HashMap<>(); Map<String, String> res = new HashMap<>();
String transactionType = null;
String oilGunId = null;
if (receiveParameterPos.getType().equals("1")){
transactionType = "4";
oilGunId = receiveParameterPos.getOilGunId();
} else if (receiveParameterPos.getType().equals("2")){
transactionType = "2";
} else if (receiveParameterPos.getType().equals("3") || receiveParameterPos.getType().equals("5")){
transactionType = "1";
} else if (receiveParameterPos.getType().equals("4")){
transactionType = "3";
} else if (receiveParameterPos.getType().equals("6")){
transactionType = "5";
}
// 查询商户配置信息 // 查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId(),transactionType,oilGunId);
if (ObjectUtil.isEmpty(merchantConfig)) { if (ObjectUtil.isEmpty(merchantConfig)) {
res.put("code", "error"); res.put("code", "error");
res.put("msg", "暂未配置商户信息"); res.put("msg", "暂未配置商户信息");

View File

@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.api.fuyou.entity.FuYouPublicMerchant; import com.fuint.api.fuyou.entity.FuYouPublicMerchant;
import com.fuint.api.fuyou.entity.MerchantConfig; import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.entity.PaymentRuleConfig;
import com.fuint.api.fuyou.mapper.MerchantConfigMapper; import com.fuint.api.fuyou.mapper.MerchantConfigMapper;
import com.fuint.api.fuyou.service.MerchantConfigService; import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.api.fuyou.service.OilConfigService; import com.fuint.api.fuyou.service.OilConfigService;
import com.fuint.api.fuyou.service.PaymentRuleConfigService;
import com.fuint.api.fuyou.vo.MerchantConfigVo; import com.fuint.api.fuyou.vo.MerchantConfigVo;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.RedisLock; import com.fuint.common.util.RedisLock;
@ -30,6 +32,10 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
@Lazy @Lazy
private OilConfigService oilConfigService; private OilConfigService oilConfigService;
@Autowired
@Lazy
private PaymentRuleConfigService paymentRuleConfigService;
@Override @Override
public MerchantConfig selectMeChByIsUse(String isUse) { public MerchantConfig selectMeChByIsUse(String isUse) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
@ -39,23 +45,48 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
} }
@Override @Override
public MerchantConfig selectMeChByIdIsUse(int storeId) { public MerchantConfig selectMeChByIdIsUse(Integer storeId,String transactionType,String oilGunId) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_use","1"); queryWrapper.eq("is_use","1");
queryWrapper.eq("store_id",storeId); queryWrapper.eq("store_id",storeId);
MerchantConfig merchantConfig = baseMapper.selectOne(queryWrapper); MerchantConfig merchantConfig = baseMapper.selectOne(queryWrapper);
if (ObjectUtil.isNotEmpty(merchantConfig) && merchantConfig.getIsOpenRule().equals("1")){ // if (ObjectUtil.isNotEmpty(merchantConfig) && merchantConfig.getIsOpenRule().equals("1")){
List<MerchantConfig> list = this.selectMeChByIsOpen(storeId); // List<MerchantConfig> list = this.selectMeChByIsOpen(storeId);
if (list.size()>0){ // if (list.size()>0){
oilConfigService.oilRule(storeId); // oilConfigService.oilRule(storeId);
// }
// }
PaymentRuleConfig paymentRuleConfig = paymentRuleConfigService.selectInfoByStoreId(storeId);
if (ObjectUtil.isNotEmpty(paymentRuleConfig)){
// 按比例分账
if (paymentRuleConfig.getRuleType().equals("1")){
oilConfigService.oilRule1(storeId,paymentRuleConfig.getId());
}else {
// 按交易类型分账
oilConfigService.oilRule2(storeId,paymentRuleConfig.getId(),transactionType,oilGunId);
} }
} }
return baseMapper.selectOne(queryWrapper); return baseMapper.selectOne(queryWrapper);
} }
@Override
public MerchantConfig selectMeChByIdIsUse1(int storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_use","1");
queryWrapper.eq("store_id",storeId);
// MerchantConfig merchantConfig = baseMapper.selectOne(queryWrapper);
// if (ObjectUtil.isNotEmpty(merchantConfig) && merchantConfig.getIsOpenRule().equals("1")){
// List<MerchantConfig> list = this.selectMeChByIsOpen(storeId);
// if (list.size()>0){
// oilConfigService.oilRule(storeId);
// }
// }
return baseMapper.selectOne(queryWrapper);
}
@Override @Override
public void updateMeChAmountByStoreId(Integer storeId,Double amount) { public void updateMeChAmountByStoreId(Integer storeId,Double amount) {
MerchantConfig merchantConfig = this.selectMeChByIdIsUse(storeId); MerchantConfig merchantConfig = this.selectMeChByIdIsUse1(storeId);
if (ObjectUtil.isNotEmpty(merchantConfig)){ if (ObjectUtil.isNotEmpty(merchantConfig)){
Double amount1 = merchantConfig.getAmount(); Double amount1 = merchantConfig.getAmount();
merchantConfig.setAmount(amount1); merchantConfig.setAmount(amount1);
@ -86,7 +117,7 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
public List<MerchantConfigVo> selectMerchList(Integer storeId) { public List<MerchantConfigVo> selectMerchList(Integer storeId) {
MerchantConfigVo merchantConfigVo = new MerchantConfigVo(); MerchantConfigVo merchantConfigVo = new MerchantConfigVo();
merchantConfigVo.setStoreId(storeId); merchantConfigVo.setStoreId(storeId);
return baseMapper.selectList(merchantConfigVo); return baseMapper.selectList1(merchantConfigVo);
} }
@Override @Override
@ -105,7 +136,7 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
@Override @Override
public void updateMerchOrter(int storeId) { public void updateMerchOrter(int storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper<MerchantConfig> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_use","1"); queryWrapper.eq("is_use","1");
queryWrapper.eq("store_id",storeId); queryWrapper.eq("store_id",storeId);
List<MerchantConfig> list = baseMapper.selectList(queryWrapper); List<MerchantConfig> list = baseMapper.selectList(queryWrapper);
@ -187,7 +218,7 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
} }
merchantConfig.setAppid(FuYouPublicMerchant.appid); merchantConfig.setAppid(FuYouPublicMerchant.appid);
merchantConfig.setAlipayAppid(FuYouPublicMerchant.alipayAppid); merchantConfig.setAlipayAppid(FuYouPublicMerchant.alipayAppid);
MerchantConfig merchantConfig1 = this.selectMeChByIdIsUse(storeId); MerchantConfig merchantConfig1 = this.selectMeChByIdIsUse1(storeId);
if (ObjectUtil.isEmpty(merchantConfig1)){ if (ObjectUtil.isEmpty(merchantConfig1)){
merchantConfig.setIsUse("1"); merchantConfig.setIsUse("1");
}else { }else {

View File

@ -73,6 +73,78 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
merchantConfigService.updateMerch(merchantConfig); merchantConfigService.updateMerch(merchantConfig);
} }
@Override
public void oilRule1(Integer storeId, Integer ruleConfigId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",storeId);
queryWrapper.eq("rule_config_id",ruleConfigId);
List<OilConfig> list = baseMapper.selectList(queryWrapper);
Double amountAll = 0.0;
// 百分占比
List<Double> proList = new ArrayList<>();
// radio
List<Double> radioList = new ArrayList<>();
// 距离
List<Double> distanceList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
MerchantConfig merchantConfig = merchantConfigService.selectMerchById(list.get(i).getMerchConfigId());
if (ObjectUtil.isNotEmpty(merchantConfig)){
amountAll += merchantConfig.getAmount();
proList.add(list.get(i).getProportion()/100.0);
radioList.add(merchantConfig.getAmount()/amountAll);
distanceList.add(proList.get(i) - radioList.get(i));
}
}
int index = 0;
Double max = Collections.max(distanceList);
for (int i = 0; i<distanceList.size(); i++) {
if (distanceList.get(i)==max){
index = i;
}
}
// 将其他使用的账户关掉
merchantConfigService.updateMerchOrter(storeId);
// 改变目前使用账户
MerchantConfig merchantConfig = merchantConfigService.selectMerchById(list.get(index).getMerchConfigId());
merchantConfig.setIsUse("1");
// merchantConfig.setIsOpenRule("1");
merchantConfigService.updateMerch(merchantConfig);
}
@Override
public void oilRule2(Integer storeId, Integer ruleConfigId,String transactionType,String oilGunId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",storeId);
queryWrapper.eq("rule_config_id",ruleConfigId);
List<OilConfig> list = baseMapper.selectList(queryWrapper);
for (OilConfig oilConfig : list) {
if (oilConfig.getTransactionType().contains(transactionType)){
if (transactionType.equals("4")){
String[] split = oilConfig.getOilGunId().split(",");
for (String id : split) {
if (oilGunId.equals(id)){
// 将其他使用的账户关掉
merchantConfigService.updateMerchOrter(storeId);
// 改变目前使用账户
MerchantConfig merchantConfig = merchantConfigService.selectMerchById(oilConfig.getMerchConfigId());
merchantConfig.setIsUse("1");
merchantConfigService.updateMerch(merchantConfig);
}
}
}else {
// 将其他使用的账户关掉
merchantConfigService.updateMerchOrter(storeId);
// 改变目前使用账户
MerchantConfig merchantConfig = merchantConfigService.selectMerchById(oilConfig.getMerchConfigId());
merchantConfig.setIsUse("1");
merchantConfigService.updateMerch(merchantConfig);
}
}
}
}
@Override @Override
public int judgmentProportion(Integer storeId) { public int judgmentProportion(Integer storeId) {
int result = 0; int result = 0;
@ -195,7 +267,7 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
List<OilGun> records = oilGunService.queryByPage(new Page(1, 10000), oilGun1).getRecords(); List<OilGun> records = oilGunService.queryByPage(new Page(1, 10000), oilGun1).getRecords();
for (OilGun record : records) { for (OilGun record : records) {
for (String gunId : split) { for (String gunId : split) {
if (gunId.equals(record.getId())){ if (gunId.equals(record.getId().toString())){
oilGunName += record.getOilNumber() + "-" + record.getGunName() + ","; oilGunName += record.getOilNumber() + "-" + record.getGunName() + ",";
} }
} }

View File

@ -102,6 +102,7 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
List<PaymentRuleConfig> list = baseMapper.selectList(queryWrapper); List<PaymentRuleConfig> list = baseMapper.selectList(queryWrapper);
for (PaymentRuleConfig paymentRuleConfig : list) { for (PaymentRuleConfig paymentRuleConfig : list) {
paymentRuleConfig.setStatus("jy"); paymentRuleConfig.setStatus("jy");
ruleConfig.setHandEnable("0");
baseMapper.updateById(paymentRuleConfig); baseMapper.updateById(paymentRuleConfig);
} }
int i = 1; int i = 1;
@ -111,6 +112,7 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
if (i==0){ if (i==0){
return 0; return 0;
} }
ruleConfig.setHandEnable("1");
return baseMapper.updateById(ruleConfig); return baseMapper.updateById(ruleConfig);
}else { }else {
if (ruleConfig.getStatus().equals("qy")){ if (ruleConfig.getStatus().equals("qy")){
@ -120,6 +122,14 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
} }
} }
@Override
public PaymentRuleConfig selectInfoByStoreId(Integer storeId) {
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",storeId);
queryWrapper.eq("status","qy");
return baseMapper.selectOne(queryWrapper);
}
/** /**
* 判断规则是否到启用时间 * 判断规则是否到启用时间
*/ */
@ -131,8 +141,13 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
queryWrapper.eq("store_id",storeId); queryWrapper.eq("store_id",storeId);
queryWrapper.orderByAsc("start_time"); queryWrapper.orderByAsc("start_time");
List<PaymentRuleConfig> list = baseMapper.selectList(queryWrapper); List<PaymentRuleConfig> list = baseMapper.selectList(queryWrapper);
QueryWrapper<PaymentRuleConfig> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("store_id",storeId);
queryWrapper1.eq("hand_enable","1");
PaymentRuleConfig paymentRuleConfig1 = baseMapper.selectOne(queryWrapper1);
for (PaymentRuleConfig paymentRuleConfig : list) { for (PaymentRuleConfig paymentRuleConfig : list) {
if (ObjectUtil.isNotEmpty(paymentRuleConfig.getStartTime()) && paymentRuleConfig.getStartTime().before(new Date())) { if (ObjectUtil.isNotEmpty(paymentRuleConfig.getStartTime()) && paymentRuleConfig.getStartTime().before(new Date())
&& paymentRuleConfig.getStartTime().before(paymentRuleConfig1.getUpdateTime())) {
int i = 1; int i = 1;
if (paymentRuleConfig.getRuleType().equals("1")){ if (paymentRuleConfig.getRuleType().equals("1")){
i = oilConfigService.judgmentProportion1(paymentRuleConfig.getStoreId(), paymentRuleConfig.getId()); i = oilConfigService.judgmentProportion1(paymentRuleConfig.getStoreId(), paymentRuleConfig.getId());

View File

@ -238,7 +238,7 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
// Integer allAmount = (int) (integralOrdersList.getAllAmout()*100); // Integer allAmount = (int) (integralOrdersList.getAllAmout()*100);
System.out.println("金额" + (int) (integralOrdersList.getAllAmout() * 100)); System.out.println("金额" + (int) (integralOrdersList.getAllAmout() * 100));
Integer allAmount = (int) (0.01 * 100); Integer allAmount = (int) (0.01 * 100);
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId(),"3",null);
// 处理支付需要的数据 // 处理支付需要的数据
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("authCode", integralOrdersList.getAuthCode()); map.put("authCode", integralOrdersList.getAuthCode());

View File

@ -299,7 +299,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
Integer allAmount = (int) (theAmountToBePaid*100); Integer allAmount = (int) (theAmountToBePaid*100);
System.out.println("allAmount1:"+allAmount); System.out.println("allAmount1:"+allAmount);
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId(),"1",null);
// 处理支付需要的数据 // 处理支付需要的数据
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("authCode", cardFuelRecordDTO.getAuthCode()); map.put("authCode", cardFuelRecordDTO.getAuthCode());

View File

@ -419,7 +419,7 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
System.out.println("allAmount1:"+allAmount); System.out.println("allAmount1:"+allAmount);
// Integer allAmount = (int) (0.01*100); // Integer allAmount = (int) (0.01*100);
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId()); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(nowAccountInfo.getStoreId(),"1",null);
// 处理支付需要的数据 // 处理支付需要的数据
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("authCode",cardValueRecordDTO.getAuthCode()); map.put("authCode",cardValueRecordDTO.getAuthCode());

View File

@ -335,7 +335,30 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
private Map<String, String> getMerchantConfig(AllOrderInfo allOrderInfo){ private Map<String, String> getMerchantConfig(AllOrderInfo allOrderInfo){
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
// 商户机构查询 // 商户机构查询
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(allOrderInfo.getStoreId()); String transactionType = null;
String oilGunId = null;
OilOrder oilOrder = orderService.selectOilOrderByOrderNo(allOrderInfo.getOrderNo());
if (allOrderInfo.getType().equals("1")){
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else if (allOrderInfo.getType().equals("2")){
transactionType = "2";
}else if (allOrderInfo.getType().equals("3") || allOrderInfo.getType().equals("5")){
transactionType = "1";
}else if (allOrderInfo.getType().equals("4")){
transactionType = "3";
}else if (allOrderInfo.getType().equals("6")){
transactionType = "5";
}else if (allOrderInfo.getType().equals("8")){
if (ObjectUtil.isNotEmpty(oilOrder)){
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else {
transactionType = "1";
}
}
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(allOrderInfo.getStoreId(),transactionType,oilGunId);
if (ObjectUtil.isEmpty(merchantConfig)) { if (ObjectUtil.isEmpty(merchantConfig)) {
throw new RuntimeException("未配置商户号"); throw new RuntimeException("未配置商户号");
} }
@ -530,7 +553,31 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getTradingPage(page, allOrderInfo); IPage<AllOrderInfoVo> pageList = allOrderInfoMapper.getTradingPage(page, allOrderInfo);
for (AllOrderInfoVo record : pageList.getRecords()) { for (AllOrderInfoVo record : pageList.getRecords()) {
MtStore mtStore = storeService.queryStoreById3(record.getStoreId()); MtStore mtStore = storeService.queryStoreById3(record.getStoreId());
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(record.getStoreId());
String transactionType = null;
String oilGunId = null;
OilOrder oilOrder = orderService.selectOilOrderByOrderNo(record.getOrderNo());
if (record.getType().equals("1")){
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else if (record.getType().equals("2")){
transactionType = "2";
}else if (record.getType().equals("3") || record.getType().equals("5")){
transactionType = "1";
}else if (record.getType().equals("4")){
transactionType = "3";
}else if (record.getType().equals("6")){
transactionType = "5";
}else if (record.getType().equals("8")){
if (ObjectUtil.isNotEmpty(oilOrder)){
transactionType = "4";
oilGunId = oilOrder.getOilGunNum();
}else {
transactionType = "1";
}
}
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(record.getStoreId(),transactionType,oilGunId);
record.setStoreName(mtStore.getName()); record.setStoreName(mtStore.getName());
if(ObjectUtil.isNotEmpty(merchantConfig)) { if(ObjectUtil.isNotEmpty(merchantConfig)) {
record.setMchntCd(merchantConfig.getMchntCd()); record.setMchntCd(merchantConfig.getMchntCd());

View File

@ -12,15 +12,9 @@ import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.service.FyPayService; import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.service.MerchantConfigService; import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.api.fuyou.service.OilConfigService; import com.fuint.api.fuyou.service.OilConfigService;
import com.fuint.business.order.entity.AllOrderInfo; import com.fuint.business.order.entity.*;
import com.fuint.business.order.entity.CreditUnit;
import com.fuint.business.order.entity.HangBill;
import com.fuint.business.order.entity.ReturnRecord;
import com.fuint.business.order.mapper.HangBillMapper; import com.fuint.business.order.mapper.HangBillMapper;
import com.fuint.business.order.service.AllOrderInfoService; import com.fuint.business.order.service.*;
import com.fuint.business.order.service.CreditUnitService;
import com.fuint.business.order.service.HangBillService;
import com.fuint.business.order.service.ReturnRecordService;
import com.fuint.business.order.vo.Excel.CashierOrderExcel; import com.fuint.business.order.vo.Excel.CashierOrderExcel;
import com.fuint.business.order.vo.Excel.HangBillExcel; import com.fuint.business.order.vo.Excel.HangBillExcel;
import com.fuint.business.order.vo.HangBillVo; import com.fuint.business.order.vo.HangBillVo;
@ -40,6 +34,8 @@ import java.util.*;
public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> implements HangBillService { public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> implements HangBillService {
@Autowired @Autowired
private CreditUnitService creditUnitService; private CreditUnitService creditUnitService;
@Autowired
private OilOrderService orderService;
@Override @Override
public IPage<HangBillVo> selectHangBillList(Page page, HangBillVo hangBill) { public IPage<HangBillVo> selectHangBillList(Page page, HangBillVo hangBill) {
@ -347,12 +343,13 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
if (!map.get("repaidAmount").equals("0") && !payType.equals("CASH")){ if (!map.get("repaidAmount").equals("0") && !payType.equals("CASH")){
Integer allAmount = (int) (Double.valueOf(map.get("repaidAmount"))*100); Integer allAmount = (int) (Double.valueOf(map.get("repaidAmount"))*100);
// 判断是否开启支付规则 // 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId); // List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
if (list.size()>0){ // if (list.size()>0){
oilConfigService.oilRule(storeId); // oilConfigService.oilRule(storeId);
} // }
// 根据店铺id查询商户配置信息 // 根据店铺id查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId); OilOrder oilOrder = orderService.selectOilOrderByOrderNo(orderNo);
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId,"1",oilOrder.getOilGunNum());
// 处理支付需要的数据 // 处理支付需要的数据
Map<String,String> map1 = new HashMap<>(); Map<String,String> map1 = new HashMap<>();
map1.put("authCode",map.get("authCode")); map1.put("authCode",map.get("authCode"));

View File

@ -297,6 +297,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Double goodsActualPay = Double.valueOf(map.get("goodsActualPay")); Double goodsActualPay = Double.valueOf(map.get("goodsActualPay"));
// 找零金额 // 找零金额
Double seekZero = Double.valueOf(map.get("seekZero")); Double seekZero = Double.valueOf(map.get("seekZero"));
// 油枪id
String oilGunId = map.get("oilGunId");
log.info("11111111111111111111111285:", map.get("levelAmount")); log.info("11111111111111111111111285:", map.get("levelAmount"));
Double levelAmount = Double.valueOf(map.get("levelAmount")); Double levelAmount = Double.valueOf(map.get("levelAmount"));
Double activeAmount = Double.valueOf(map.get("activeAmount")); Double activeAmount = Double.valueOf(map.get("activeAmount"));
@ -382,8 +384,17 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
OilOrder oilOrder1 = null; OilOrder oilOrder1 = null;
LJOrder ljOrder1 = null; LJOrder ljOrder1 = null;
String transactionType = null;
if (oilAmount>0 && goodsAmount>0){
transactionType = "5";
}else if (oilAmount>0) {
transactionType = "4";
}else if (goodsAmount>0) {
transactionType = "2";
}
// 根据店铺id查询商户配置信息 // 根据店铺id查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId); MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId,transactionType,oilGunId);
if (ObjectUtil.isEmpty(merchantConfig) && !payType.equals("CASH") && !payType.equals("credit") && if (ObjectUtil.isEmpty(merchantConfig) && !payType.equals("CASH") && !payType.equals("credit") &&
!map.get("allAmount").equals("0")) { !map.get("allAmount").equals("0")) {
@ -554,10 +565,10 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH") && !payType.equals("credit")) { if (!map.get("allAmount").equals("0") && !map.get("payType").equals("CASH") && !payType.equals("credit")) {
Integer allAmount = (int) (Double.valueOf(map.get("allAmount")) * 100); Integer allAmount = (int) (Double.valueOf(map.get("allAmount")) * 100);
// 判断是否开启支付规则 // 判断是否开启支付规则
List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId); // List<MerchantConfig> list = merchantConfigService.selectMeChByIsOpen(storeId);
if (list.size() > 0) { // if (list.size() > 0) {
oilConfigService.oilRule(storeId); // oilConfigService.oilRule(storeId);
} // }
// 处理支付需要的数据 // 处理支付需要的数据
Map<String, String> map1 = new HashMap<>(); Map<String, String> map1 = new HashMap<>();
@ -1643,6 +1654,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
receiveParameter.setStoreId(oilOrder.getStoreId()); receiveParameter.setStoreId(oilOrder.getStoreId());
receiveParameter.setPayType(oilOrder.getPayType()); receiveParameter.setPayType(oilOrder.getPayType());
receiveParameter.setUserId(oilOrder.getUserId()); receiveParameter.setUserId(oilOrder.getUserId());
receiveParameter.setOilGunId(oilOrder.getOilGunNum());
// 调用支付接口 // 调用支付接口
try { try {
applet = fyPayService.applet(receiveParameter); applet = fyPayService.applet(receiveParameter);
@ -2399,6 +2411,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
receiveParameterPos.setAuthCode(oilOrderVo.getAuthCode()); receiveParameterPos.setAuthCode(oilOrderVo.getAuthCode());
receiveParameterPos.setUserId(oilOrderVo.getUserId()); receiveParameterPos.setUserId(oilOrderVo.getUserId());
receiveParameterPos.setOilCardAmount(oilOrderVo.getOilCardAmount1()); receiveParameterPos.setOilCardAmount(oilOrderVo.getOilCardAmount1());
receiveParameterPos.setOilGunId(oilOrderVo.getOilGunNum());
if (ObjectUtil.isNotEmpty(oilOrderVo.getAuthCode()) && oilOrderVo.getPayAmount() > 0) { if (ObjectUtil.isNotEmpty(oilOrderVo.getAuthCode()) && oilOrderVo.getPayAmount() > 0) {
try { try {
fyPayService.posPay(receiveParameterPos); fyPayService.posPay(receiveParameterPos);
@ -2470,6 +2483,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
receiveParameterPos.setUserId(oilOrderVo.getUserId()); receiveParameterPos.setUserId(oilOrderVo.getUserId());
receiveParameterPos.setGoodsMoney(oilOrderVo.getPayAmount()); receiveParameterPos.setGoodsMoney(oilOrderVo.getPayAmount());
receiveParameterPos.setOilCardAmount(oilOrderVo.getOilCardAmount1()); receiveParameterPos.setOilCardAmount(oilOrderVo.getOilCardAmount1());
receiveParameterPos.setOilGunId(oilOrderVo.getOilGunNum());
Map<String, String> mainScan = fyPayService.mainScan(receiveParameterPos); Map<String, String> mainScan = fyPayService.mainScan(receiveParameterPos);
res.put("oilOrder",this.selectOilOrderByOrderNo(orderNo)); res.put("oilOrder",this.selectOilOrderByOrderNo(orderNo));
res.put("scanCode",mainScan); res.put("scanCode",mainScan);

View File

@ -1364,6 +1364,7 @@
consumeRefuelMoney:0, consumeRefuelMoney:0,
// //
fullReduction:0, fullReduction:0,
oilGunId:null,
// //
refuelMoney:null, refuelMoney:null,
refuelMoney1:[], refuelMoney1:[],
@ -4023,7 +4024,6 @@
{value:"¥300"}, {value:"¥300"},
]; ];
this.amount = 0 this.amount = 0
this.dialogVisibleamount = true;
let result = false let result = false
this.isExistOilOrder = false; this.isExistOilOrder = false;
// //
@ -4038,6 +4038,11 @@
if (result){ if (result){
return; return;
} }
if (this.oilOrder.length==1){
this.$message.error("只能选择一个油枪信息")
return;
}
this.dialogVisibleamount = true;
getOilNumberById(data.numberId).then( response => { getOilNumberById(data.numberId).then( response => {
this.form = response.data; this.form = response.data;
this.form.tankId = data.tankId this.form.tankId = data.tankId
@ -4045,6 +4050,7 @@
if (item.id==data.id){ if (item.id==data.id){
this.form.id = item.id this.form.id = item.id
this.form.gunName = item.id this.form.gunName = item.id
this.oilGunId = item.id
this.form.gunNames = item.gunName this.form.gunNames = item.gunName
} }
}) })
@ -4097,6 +4103,7 @@
this.map.payUser = this.member.mobile this.map.payUser = this.member.mobile
this.map.levelAmount = this.oilDiscount this.map.levelAmount = this.oilDiscount
this.map.activeAmount = this.fullReduction this.map.activeAmount = this.fullReduction
this.map.oilGunId = this.oilGunId
let _this = this; let _this = this;

View File

@ -3,9 +3,9 @@ module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api', // baseUrl: 'https://vue.ruoyi.vip/prod-api',
// baseUrl: 'http://192.168.0.196:8081/', // baseUrl: 'http://192.168.0.196:8081/',
// baseUrl: 'https://www.tuofeng.cc/oilAdmin/', // baseUrl: 'https://www.tuofeng.cc/oilAdmin/',
baseUrl: 'https://oilapi.youkerr.com/oilAdmin/', // baseUrl: 'https://oilapi.youkerr.com/oilAdmin/',
// baseUrl: 'https://8q4f124343.yicp.fun/', // baseUrl: 'https://8q4f124343.yicp.fun/',
// baseUrl: 'http://192.168.31.96:8080/', baseUrl: 'http://192.168.31.96:8080/',
// baseUrl: 'http://192.168.1.5:8002/cdJdc', // baseUrl: 'http://192.168.1.5:8002/cdJdc',
imagesUrl: 'http://www.nuoyunr.com/lananRsc', imagesUrl: 'http://www.nuoyunr.com/lananRsc',
// 应用信息 // 应用信息