This commit is contained in:
cun-nan 2024-05-27 16:56:51 +08:00
parent 8a6a373981
commit dfce05d949
18 changed files with 794 additions and 312 deletions

View File

@ -100,26 +100,26 @@
></el-statistic>
</div>
</el-col>
<el-col :span="4">
<div class="sta" v-if="!refuelMoney">
<el-statistic
group-separator=","
:precision="2"
:value="0"
title="囤油卡余额"
>
<!-- <span></span>-->
</el-statistic>
</div>
<div v-if="refuelMoney && refuelMoney.length>0" style="display: flex;align-items: center;margin-top: 25px">
<div class="size-hui">囤油卡余额</div>
<div v-for="(item,index) in refuelMoney"
:key="index" style="margin-left: 20px;text-align: center">
<div class="size-hui">{{ item.oilName ? item.type + item.oilName : item.type }}</div>
<div class="size-bole">{{ item.refuelMoney || 0.00 }}</div>
</div>
</div>
</el-col>
<!-- <el-col :span="4">-->
<!-- <div class="sta" v-if="!refuelMoney">-->
<!-- <el-statistic-->
<!-- group-separator=","-->
<!-- :precision="2"-->
<!-- :value="0"-->
<!-- title="囤油卡余额"-->
<!-- >-->
<!-- &lt;!&ndash; <span></span>&ndash;&gt;-->
<!-- </el-statistic>-->
<!-- </div>-->
<!-- <div v-if="refuelMoney && refuelMoney.length>0" style="display: flex;align-items: center;margin-top: 25px">-->
<!-- <div class="size-hui">囤油卡余额</div>-->
<!-- <div v-for="(item,index) in refuelMoney"-->
<!-- :key="index" style="margin-left: 20px;text-align: center">-->
<!-- <div class="size-hui">{{ item.oilName ? item.type + item.oilName : item.type }}</div>-->
<!-- <div class="size-bole">{{ item.refuelMoney || 0.00 }}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-col>-->
</el-row>
</div>
</template>
@ -158,7 +158,7 @@
<el-dialog :close-on-click-modal="false" width="60%" :title="title" :visible.sync="openRecharge" append-to-body>
<template>
<el-tabs v-model="activeRecharge" type="card" @tab-click="handleClick">
<el-tab-pane label="储值卡" name="balance">
<el-tab-pane label="电子储值卡" name="balance">
<div>
<el-row>
<el-col :span="1.5">
@ -277,7 +277,7 @@
</div>
</div>
</el-tab-pane>
<el-tab-pane label="油卡" name="literCard" v-if="oilTypeList && oilTypeList.length>0">
<el-tab-pane label="电子囤油卡" name="literCard" v-if="oilTypeList && oilTypeList.length>0">
<el-row>
<el-col :span="24">
<div style="display: flex">

View File

@ -39,4 +39,8 @@ public class ReceiveParameterPos {
* 订单描述
*/
private String content;
/**
* 订单描述
*/
private Double oilCardAmount;
}

View File

@ -28,6 +28,7 @@ import com.fuint.business.userManager.vo.LJUserVo;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -58,6 +59,7 @@ public class FyPayServiceImpl implements FyPayService {
/**
* 条码支付
*
* @param map1
* @return
*/
@ -75,9 +77,9 @@ public class FyPayServiceImpl implements FyPayService {
String mchntCd = map1.get("mchntCd");
String goodsDes = map1.get("goodsDes");
Map<String, String> map = Builder.buildFuiou22();
map.put("auth_code",authCode);
map.put("mchnt_order_no",orderNo);
map.put("order_type",payType);
map.put("auth_code", authCode);
map.put("mchnt_order_no", orderNo);
map.put("order_type", payType);
map.put("order_amt", allAmount);
map.put("ins_cd", insCd);
map.put("mchnt_cd", mchntCd);
@ -87,17 +89,17 @@ public class FyPayServiceImpl implements FyPayService {
// 请求报文
String reqBody = Message.requestMsg(map);
// 响应报文
String rspXml = Message.responseMsg(reqBody,Const.fuiou_31_url);
String rspXml = Message.responseMsg(reqBody, Const.fuiou_31_url);
//响应报文验签
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
String str = resMap.get("sign");
String resultCode = resMap.get("result_code");
if (!resultCode.equals("000000")){
if (!resultCode.equals("000000")) {
throw new RuntimeException(resMap.get("result_msg"));
}
if (Utils.verifySign(resMap, str)){
if (Utils.verifySign(resMap, str)) {
ThreadUtil.execAsync(() -> {
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@ -105,7 +107,7 @@ public class FyPayServiceImpl implements FyPayService {
public void run() {
try {
Map<String, String> orderQueryRes = queryOrder(map1);
if(!orderQueryRes.get("msg").equals("unpaid")){
if (!orderQueryRes.get("msg").equals("unpaid")) {
timer.cancel();
}
} catch (Exception e) {
@ -113,10 +115,10 @@ public class FyPayServiceImpl implements FyPayService {
}
}
//定时器 不延时 立即开始 0.5s一次
}, 0, 500);
}, 0, 500);
Thread.currentThread().interrupt();
});
}else {
} else {
throw new Exception("验签失败,请联系管理员!");
}
return resMap;
@ -137,8 +139,8 @@ public class FyPayServiceImpl implements FyPayService {
@Override
public Map<String, String> queryOrder(Map<String, String> map1) throws Exception {
Map<String, String> resMap =new HashMap<>();
resMap.put("msg","error");
Map<String, String> resMap = new HashMap<>();
resMap.put("msg", "error");
try {
String orderNo = map1.get("orderNo");
String payType = map1.get("payType");
@ -146,35 +148,35 @@ public class FyPayServiceImpl implements FyPayService {
String mchntCd = map1.get("mchntCd");
Double allAmount = Double.valueOf(map1.get("allAmount"));
Map<String, String> map = Builder.buildFuiou30();
map.put("mchnt_order_no",orderNo);
map.put("order_type",payType);
map.put("mchnt_order_no", orderNo);
map.put("order_type", payType);
map.put("ins_cd", insCd);
map.put("mchnt_cd", mchntCd);
Integer storeId1 = Integer.valueOf(map1.get("storeId"));
// 余额新增
String type = "";
String payStates="";
String payStatus="unpaid";
String payStates = "";
String payStatus = "unpaid";
if (!ObjectUtil.isEmpty(map1.get("type"))) {
type = map1.get("type");
}
ReceiveParameter receiveParameter = new ReceiveParameter();
receiveParameter.setOrderNo(orderNo);
receiveParameter.setGoodsMoney(allAmount/100);
receiveParameter.setGoodsMoney(allAmount / 100);
receiveParameter.setStoreId(storeId1);
receiveParameter.setPayType(payType);
// 请求报文
String reqBody = Message.requestMsg(map);
// 响应报文
String rspXml = Message.responseMsg(reqBody,Const.fuiou_34_url);
String rspXml = Message.responseMsg(reqBody, Const.fuiou_34_url);
//响应报文验签
Map<String, String> reqMap = Utils.xmlStr2Map(rspXml);
String str = reqMap.get("sign");
if (Utils.verifySign(reqMap, str)){
if (Utils.verifySign(reqMap, str)) {
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(orderNo);
List<OilOrder> list = oilOrderService.selectOilOrder(orderNo);
LJOrder goodsOrder = goodsOrderService.selectGoodsOrder(orderNo);
@ -182,18 +184,19 @@ public class FyPayServiceImpl implements FyPayService {
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(storeId1);
List<ReturnRecord> returnRecords = returnRecordService.selectReturnRecordByOrderNo(orderNo);
Date date = new Date();
if (reqMap.get("trans_stat").equals("SUCCESS")){
if (reqMap.get("trans_stat").equals("SUCCESS")) {
payStatus = "paid";
if (!ObjectUtil.isEmpty(oilOrder)){
if (!ObjectUtil.isEmpty(oilOrder)) {
// 油品订单
oilOrder.setOrderStatus("paid");
oilOrder.setPayTime(date);
oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(),oilOrder.getUserId(),oilOrder.getActiveId(),oilOrder.getCouponId(),oilOrder.getActiveType(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(), Integer.valueOf(oilOrder.getOils()));
oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getActiveId(), oilOrder.getCouponId(), oilOrder.getActiveType(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), Integer.valueOf(oilOrder.getOils()));
oilOrderService.insertFavorable(oilOrder, Double.valueOf(map1.get("oilCardAmount")));
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId())) staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),"1",orderNo);
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId()))
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), "1", orderNo);
// 修改油罐容量
List<JSONObject> jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class);
if (jsonObjects.size()<=1) {
if (jsonObjects.size() <= 1) {
Integer tankId = Integer.valueOf(jsonObjects.get(0).get("tankId").toString());
oilOrder.setTankId(tankId);
@ -202,41 +205,42 @@ public class FyPayServiceImpl implements FyPayService {
if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder);
//修改优惠券使用状态
if (oilOrder.getCouponId()!=null){
if (oilOrder.getCouponId() != null) {
CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrder.getCouponId());
if (!ObjectUtil.isEmpty(byId)){
if (!ObjectUtil.isEmpty(byId)) {
byId.setStatus("1");
cardFavorableRecordService.updateById(byId);
}
}
}
if (!ObjectUtil.isEmpty(goodsOrder)){
if (!ObjectUtil.isEmpty(goodsOrder)) {
// 商品订单
goodsOrder.setStatus("paid");
goodsOrder.setPayTime(date);
goodsOrderService.insertFavorable(goodsOrder);
Boolean isMember = false;
if (goodsOrder.getUserId()!=null){
if (goodsOrder.getUserId() != null) {
isMember = true;
}
if (ObjectUtil.isNotEmpty(goodsOrder.getStaffId())) staffCommissionService.countStaffCommission(goodsOrder.getStaffId(),goodsOrder.getStoreId(),goodsOrder.getAmount(),goodsOrder.getPayAmount(),"2",orderNo);
if (!map1.get("goodsOrder").equals("[]")){
if (ObjectUtil.isNotEmpty(goodsOrder.getStaffId()))
staffCommissionService.countStaffCommission(goodsOrder.getStaffId(), goodsOrder.getStoreId(), goodsOrder.getAmount(), goodsOrder.getPayAmount(), "2", orderNo);
if (!map1.get("goodsOrder").equals("[]")) {
List<JSONObject> goods = JSONArray.parseArray(map1.get("goodsOrder"), JSONObject.class);
OrderGoods orderGoods = new OrderGoods();
for (JSONObject good : goods) {
orderGoods.setOrderId(goodsOrder.getId());
orderGoods.setGoodsId(Integer.valueOf(good.get("id").toString()));
orderGoods.setNum(Integer.valueOf(good.get("num").toString()));
orderGoodsService.insertOrderGoods(orderGoods,storeId1,isMember);
orderGoodsService.insertOrderGoods(orderGoods, storeId1, isMember);
}
}
}
if (!ObjectUtil.isEmpty(cashierOrder)){
if (!ObjectUtil.isEmpty(cashierOrder)) {
// 收银台订单
cashierOrder.setStatus("paid");
cashierOrder.setPayTime(date);
}
if (!ArrayUtil.isEmpty(returnRecords)){
if (!ArrayUtil.isEmpty(returnRecords)) {
for (ReturnRecord returnRecord : returnRecords) {
// 挂账归还信息
returnRecord.setReturnType("1");
@ -248,27 +252,28 @@ public class FyPayServiceImpl implements FyPayService {
receiveParameter.setType("7");
receiveParameter.setContent("挂账订单");
}
if (!ArrayUtil.isEmpty(list)){
if (list.size()>1){
if (!ArrayUtil.isEmpty(list)) {
if (list.size() > 1) {
Double oilLiters = 0.0;
for (OilOrder order : list){
for (OilOrder order : list) {
oilLiters += order.getOilNum();
}
for (OilOrder order : list) {
if (order.getOrderType().equals("主订单")){
if (ObjectUtil.isNotEmpty(order.getStaffId()))staffCommissionService.countStaffCommission(order.getStaffId(),order.getStoreId(),order.getOrderAmount(),order.getPayAmount(),"1",orderNo);
if (order.getOrderType().equals("主订单")) {
if (ObjectUtil.isNotEmpty(order.getStaffId()))
staffCommissionService.countStaffCommission(order.getStaffId(), order.getStoreId(), order.getOrderAmount(), order.getPayAmount(), "1", orderNo);
}
// 添加多个油品订单
order.setOrderStatus("paid");
order.setPayTime(date);
oilOrderService.updateOilOrder(order);
oilOrderService.updateCardAndActiveById(order.getStoreId(),order.getUserId(),order.getActiveId(),order.getCouponId(),order.getActiveType(),order.getOrderAmount(),order.getPayAmount(), Integer.valueOf(order.getOils()));
oilOrderService.updateCardAndActiveById(order.getStoreId(), order.getUserId(), order.getActiveId(), order.getCouponId(), order.getActiveType(), order.getOrderAmount(), order.getPayAmount(), Integer.valueOf(order.getOils()));
// 修改油罐容量
List<JSONObject> jsonObjects = JSONArray.parseArray(map1.get("oilOrder"), JSONObject.class);
for (JSONObject jsonObject : jsonObjects) {
oilOrderService.addOilTrack(jsonObject,oilOrder.getStoreId());
oilOrderService.addOilTrack(jsonObject, oilOrder.getStoreId());
}
}
}
@ -276,7 +281,7 @@ public class FyPayServiceImpl implements FyPayService {
if ("CVR".equals(type)) {
payStates = "paid";
receiveParameter.setType("2");
if (ObjectUtil.isNotEmpty(goodsOrder) && ObjectUtil.isNotEmpty(goodsOrder.getUserId())){
if (ObjectUtil.isNotEmpty(goodsOrder) && ObjectUtil.isNotEmpty(goodsOrder.getUserId())) {
receiveParameter.setUserId(goodsOrder.getUserId());
}
// if (!ObjectUtil.isEmpty(map1.get("orderId"))) {
@ -291,23 +296,23 @@ public class FyPayServiceImpl implements FyPayService {
}
// 修改商户账号余额信息
Double amount = merchantConfig.getAmount();
merchantConfig.setAmount(amount+(allAmount/100));
merchantConfig.setAmount(amount + (allAmount / 100));
merchantConfigService.updateMerch(merchantConfig);
resMap.put("msg","success");
}else if (reqMap.get("trans_stat").equals("USERPAYING")){
resMap.put("msg","unpaid");
}else {
resMap.put("msg", "success");
} else if (reqMap.get("trans_stat").equals("USERPAYING")) {
resMap.put("msg", "unpaid");
} else {
payStatus = "payFail";
if (!ObjectUtil.isEmpty(oilOrder)){
if (!ObjectUtil.isEmpty(oilOrder)) {
oilOrder.setOrderStatus("payFail");
}
if (!ObjectUtil.isEmpty(goodsOrder)){
if (!ObjectUtil.isEmpty(goodsOrder)) {
goodsOrder.setStatus("payFail");
}
if (!ObjectUtil.isEmpty(cashierOrder)){
if (!ObjectUtil.isEmpty(cashierOrder)) {
cashierOrder.setStatus("payFail");
}
if (!ArrayUtil.isEmpty(returnRecords)){
if (!ArrayUtil.isEmpty(returnRecords)) {
for (ReturnRecord returnRecord : returnRecords) {
returnRecord.setReturnType("0");
returnRecord.setPayStatus("payFail");
@ -317,8 +322,8 @@ public class FyPayServiceImpl implements FyPayService {
receiveParameter.setType("7");
receiveParameter.setContent("挂账订单");
}
if (!ArrayUtil.isEmpty(list)){
if (list.size()>1) {
if (!ArrayUtil.isEmpty(list)) {
if (list.size() > 1) {
for (OilOrder order : list) {
order.setOrderStatus("payFail");
oilOrderService.updateOilOrder(order);
@ -338,33 +343,37 @@ public class FyPayServiceImpl implements FyPayService {
payStates = "payFail";
}
}
if (!ObjectUtil.isEmpty(oilOrder)){
Double discountAmount = 0.0;
if (!ObjectUtil.isEmpty(oilOrder)) {
discountAmount = oilOrder.getDiscountAmount();
receiveParameter.setType("1");
if (oilOrder.getUserId()!=null){
if (oilOrder.getUserId() != null) {
receiveParameter.setUserId(oilOrder.getUserId());
}
receiveParameter.setContent("油品订单");
oilOrderService.updateOilOrder(oilOrder);
}
if (!ObjectUtil.isEmpty(goodsOrder)){
if (!ObjectUtil.isEmpty(goodsOrder)) {
discountAmount = goodsOrder.getDiscount();
receiveParameter.setType("2");
if (goodsOrder.getUserId()!=null){
if (goodsOrder.getUserId() != null) {
receiveParameter.setUserId(goodsOrder.getUserId());
}
receiveParameter.setContent("商品订单");
goodsOrderService.updateGoodOrder(goodsOrder);
}
if (!ObjectUtil.isEmpty(cashierOrder)){
if (!ObjectUtil.isEmpty(cashierOrder)) {
discountAmount = cashierOrder.getOilDiscountAmount() + cashierOrder.getGoodsDiscountAmount();
receiveParameter.setType("6");
if (!ObjectUtil.isEmpty(oilOrder)){
if (oilOrder.getUserId()!=null){
if (!ObjectUtil.isEmpty(oilOrder)) {
if (oilOrder.getUserId() != null) {
receiveParameter.setUserId(oilOrder.getUserId());
}
}
if (!ObjectUtil.isEmpty(goodsOrder)){
if (goodsOrder.getUserId()!=null){
if (!ObjectUtil.isEmpty(goodsOrder)) {
if (goodsOrder.getUserId() != null) {
receiveParameter.setUserId(goodsOrder.getUserId());
}
}
@ -379,7 +388,7 @@ public class FyPayServiceImpl implements FyPayService {
CardValueRecord byId = cardValueRecordService.getById(id);
receiveParameter.setType("3");
if (byId.getMtUserId()!=null){
if (byId.getMtUserId() != null) {
receiveParameter.setUserId(byId.getMtUserId());
}
receiveParameter.setContent("储值卡订单");
@ -391,45 +400,45 @@ public class FyPayServiceImpl implements FyPayService {
CardFuelRecord cardFuelRecord = cardFuelRecordService.queryById(id);
receiveParameter.setType("5");
if (cardFuelRecord.getMtUserId()!=null){
if (cardFuelRecord.getMtUserId() != null) {
receiveParameter.setUserId(cardFuelRecord.getMtUserId());
}
receiveParameter.setContent("囤油卡订单");
}
if ("IOS".equals(type)) {
// 积分商城
String storeId = ObjectUtil.isEmpty(map1.get("storeId"))?"-1":map1.get("storeId");
integralOrdersService.editPayStatus(orderNo, payStates,Integer.parseInt(storeId));
String storeId = ObjectUtil.isEmpty(map1.get("storeId")) ? "-1" : map1.get("storeId");
integralOrdersService.editPayStatus(orderNo, payStates, Integer.parseInt(storeId));
IntegralOrders integralOrders = integralOrdersService.queryIntegralOrdersByOrderNo(orderNo, Integer.parseInt(storeId));
receiveParameter.setType("4");
if (integralOrders.getUserId()!=null){
if (integralOrders.getUserId() != null) {
receiveParameter.setUserId(integralOrders.getUserId());
}
receiveParameter.setContent("积分订单");
}
if (!reqMap.get("trans_stat").equals("USERPAYING")){
this.insertAllOrderInfo(receiveParameter,payStatus);
if (!reqMap.get("trans_stat").equals("USERPAYING")) {
this.insertAllOrderInfo(receiveParameter, payStatus,discountAmount);
}
if (ObjectUtil.isNotEmpty(merchantConfig)){
if (ObjectUtil.isNotEmpty(merchantConfig)) {
// 添加配置记录信息
MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord();
merchantConfigRecord.setMerchantId(merchantConfig.getId());
if (payStatus.equals("paid")){
if (payStatus.equals("paid")) {
merchantConfigRecord.setIsSuccess("yes");
}else {
} else {
merchantConfigRecord.setIsSuccess("no");
}
merchantConfigRecord.setAmount(allAmount/100.0);
merchantConfigRecord.setAmount(allAmount / 100.0);
merchantConfigRecord.setType("0");
merchantConfigRecord.setStoreId(merchantConfig.getStoreId());
merchantConfigRecord.setOrderNo(orderNo);
merchantConfigRecordService.insertMerchantConfigRecord(merchantConfigRecord);
}
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
}
@ -442,9 +451,9 @@ public class FyPayServiceImpl implements FyPayService {
try {
// 查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameter.getStoreId());
if (ObjectUtil.isEmpty(merchantConfig)){
res.put("code","error");
res.put("msg","暂未配置商户信息");
if (ObjectUtil.isEmpty(merchantConfig)) {
res.put("code", "error");
res.put("msg", "暂未配置商户信息");
return res;
}
// MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(16);
@ -460,34 +469,34 @@ public class FyPayServiceImpl implements FyPayService {
map.put("ins_cd", merchantConfig.getInsCd());
// 商户号
map.put("mchnt_cd", merchantConfig.getMchntCd());
// 订单号
map.put("mchnt_order_no",receiveParameter.getOrderNo());
// 订单总金额
// 订单号
map.put("mchnt_order_no", receiveParameter.getOrderNo());
// 订单总金额
Integer goodsMoney = (int) (receiveParameter.getGoodsMoney() * 100);
map.put("order_amt", goodsMoney.toString());
// 订单描述
// 订单描述
map.put("goods_des", receiveParameter.getContent());
if (receiveParameter.getPayType().equals("WECHAT")){
map.put("trade_type","LETPAY");
if (receiveParameter.getPayType().equals("WECHAT")) {
map.put("trade_type", "LETPAY");
// 微信open_id
map.put("sub_openid", userVo.getOpenId());
System.out.println("微信open_id:"+userVo.getOpenId());
System.out.println("微信open_id:" + userVo.getOpenId());
// appid
map.put("sub_appid", merchantConfig.getAppid());
} else if (receiveParameter.getPayType().equals("ALIPAY")){
map.put("trade_type","FWC");
} else if (receiveParameter.getPayType().equals("ALIPAY")) {
map.put("trade_type", "FWC");
// 支付宝userId
map.put("sub_openid", userVo.getUserId());
System.out.println("支付宝userId:"+userVo.getUserId());
System.out.println("支付宝userId:" + userVo.getUserId());
// appid
map.put("sub_appid", merchantConfig.getAlipayAppid());
}else {
res.put("code","error");
res.put("msg","暂不支持其他支付方式");
} else {
res.put("code", "error");
res.put("msg", "暂不支持其他支付方式");
return res;
}
if (ObjectUtil.isNotEmpty(merchantConfig)){
if (ObjectUtil.isNotEmpty(merchantConfig)) {
// 添加配置记录信息
MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord();
@ -502,35 +511,38 @@ public class FyPayServiceImpl implements FyPayService {
// 请求报文
String reqBody = Message.requestMsg(map);
// 响应报文
String rspXml = Message.responseMsg(reqBody,Const.fuiou_32_url);
// 响应报文
String rspXml = Message.responseMsg(reqBody, Const.fuiou_32_url);
//响应报文验签
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
log.info("--FyPayServiceImpl--:{}",resMap);
log.info("--FyPayServiceImpl--:{}", resMap);
String str = resMap.get("sign");
if (Utils.verifySign(resMap, str)){
if (Utils.verifySign(resMap, str)) {
System.out.println(resMap);
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(receiveParameter.getOrderNo());
// 添加订单信息
this.insertAllOrderInfo(receiveParameter);
Double discountAmount = 0.0;
if (ObjectUtil.isNotEmpty(oilOrder)) discountAmount = oilOrder.getDiscountAmount();
this.insertAllOrderInfo(receiveParameter, discountAmount);
res.put("code","success");
res.put("msg","成功");
res.put("code", "success");
res.put("msg", "成功");
ReturnParameter returnParameter = new ReturnParameter();
returnParameter.setOrderNo(receiveParameter.getOrderNo());
returnParameter.setReservedPayInfo(resMap.get("reserved_pay_info"));
returnParameter.setReservedTransactionId(resMap.get("reserved_transaction_id"));
res.put("data",returnParameter);
res.put("resultMsg",resMap.get("result_msg"));
res.put("data", returnParameter);
res.put("resultMsg", resMap.get("result_msg"));
return res;
}else {
throw new Exception("验签失败,请联系管理员!");
} else {
throw new Exception("验签失败,请联系管理员!");
}
}catch (Exception e){
res.put("code","error");
res.put("msg",e.getMessage());
} catch (Exception e) {
res.put("code", "error");
res.put("msg", e.getMessage());
e.printStackTrace();
}
return res;
@ -542,7 +554,7 @@ public class FyPayServiceImpl implements FyPayService {
/**
* 添加所有订单信息
*/
private void insertAllOrderInfo(ReceiveParameter receiveParameter,String payStatus){
private void insertAllOrderInfo(ReceiveParameter receiveParameter, String payStatus,Double discountAmount) {
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(receiveParameter.getOrderNo());
allOrderInfo.setType(receiveParameter.getType());
@ -553,12 +565,13 @@ public class FyPayServiceImpl implements FyPayService {
allOrderInfo.setUserId(receiveParameter.getUserId());
allOrderInfo.setPayChannel("cashier");
allOrderInfo.setStatus(payStatus);
if (payStatus.equals("paid")){
allOrderInfo.setDiscountAmount(discountAmount);
if (payStatus.equals("paid")) {
allOrderInfo.setPayTime(new Date());
}
allOrderInfo.setContent(receiveParameter.getContent());
AllOrderInfo allOrderInfo1 = allOrderInfoService.selectAllOrderInfoByOrderNo(receiveParameter.getOrderNo());
if (ObjectUtil.isEmpty(allOrderInfo1)){
if (ObjectUtil.isEmpty(allOrderInfo1)) {
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
}
}
@ -566,7 +579,7 @@ public class FyPayServiceImpl implements FyPayService {
/**
* 添加所有订单信息
*/
private void insertAllOrderInfo(ReceiveParameter receiveParameter){
private void insertAllOrderInfo(ReceiveParameter receiveParameter,Double discountAmount) {
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(receiveParameter.getOrderNo());
allOrderInfo.setType(receiveParameter.getType());
@ -577,8 +590,9 @@ public class FyPayServiceImpl implements FyPayService {
allOrderInfo.setPayChannel("applet");
allOrderInfo.setStatus("unpaid");
allOrderInfo.setContent(receiveParameter.getContent());
allOrderInfo.setDiscountAmount(discountAmount);
AllOrderInfo allOrderInfo1 = allOrderInfoService.selectAllOrderInfoByOrderNo(receiveParameter.getOrderNo());
if (ObjectUtil.isEmpty(allOrderInfo1)){
if (ObjectUtil.isEmpty(allOrderInfo1)) {
allOrderInfoService.insertAllOrderInfo(allOrderInfo);
}
}
@ -597,9 +611,9 @@ public class FyPayServiceImpl implements FyPayService {
map.put("ins_cd", insCd);
map.put("mchnt_cd", mchntCd);
map.put("term_id", "88888888");
map.put("mchnt_order_no",orderNo);
map.put("mchnt_order_no", orderNo);
map.put("random_str", "orderNo");
map.put("order_type",payType);
map.put("order_type", payType);
map.put("refund_order_no", refundOrderNo);
map.put("refund_amt", refundAmt);
map.put("total_amt", totalAmt);
@ -612,13 +626,13 @@ public class FyPayServiceImpl implements FyPayService {
// 请求报文
String reqBody = Message.requestMsg(map);
// 响应报文
String rspXml = Message.responseMsg(reqBody,Const.fuiou_33_url);
String rspXml = Message.responseMsg(reqBody, Const.fuiou_33_url);
//响应报文验签
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
String str = resMap.get("sign");
if (Utils.verifySign(resMap, str)){
if (Utils.verifySign(resMap, str)) {
}
return resMap;
@ -630,20 +644,20 @@ public class FyPayServiceImpl implements FyPayService {
try {
// 查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId());
if (ObjectUtil.isEmpty(merchantConfig)){
res.put("code","error");
res.put("msg","暂未配置商户信息");
if (ObjectUtil.isEmpty(merchantConfig)) {
res.put("code", "error");
res.put("msg", "暂未配置商户信息");
return res;
}
String publicKey = merchantConfig.getPublicKey();
String privateKey = merchantConfig.getPrivateKey();
Const.INS_PUBLIC_KEY = publicKey;
Const.INS_PRIVATE_KEY = privateKey;
String allAmount = String.valueOf(receiveParameterPos.getGoodsMoney()*100);
String allAmount = String.valueOf((int) (receiveParameterPos.getGoodsMoney() * 100));
Map<String, String> map = Builder.buildFuiou22();
map.put("auth_code",receiveParameterPos.getAuthCode());
map.put("mchnt_order_no",receiveParameterPos.getOrderNo());
map.put("order_type",receiveParameterPos.getPayType());
map.put("auth_code", receiveParameterPos.getAuthCode());
map.put("mchnt_order_no", receiveParameterPos.getOrderNo());
map.put("order_type", receiveParameterPos.getPayType());
map.put("order_amt", allAmount);
map.put("ins_cd", merchantConfig.getInsCd());
map.put("mchnt_cd", merchantConfig.getMchntCd());
@ -653,25 +667,27 @@ public class FyPayServiceImpl implements FyPayService {
// 请求报文
String reqBody = Message.requestMsg(map);
// 响应报文
String rspXml = Message.responseMsg(reqBody,Const.fuiou_31_url);
String rspXml = Message.responseMsg(reqBody, Const.fuiou_31_url);
//响应报文验签
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
String str = resMap.get("sign");
String resultCode = resMap.get("result_code");
if (!resultCode.equals("000000")){
if (!resultCode.equals("000000")) {
throw new RuntimeException(resMap.get("result_msg"));
}
if (Utils.verifySign(resMap, str)){
if (Utils.verifySign(resMap, str)) {
ThreadUtil.execAsync(() -> {
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
try {
Map<String, String> orderQueryRes = queryOrderPos(receiveParameterPos,merchantConfig.getInsCd(),merchantConfig.getMchntCd());
if(!orderQueryRes.get("msg").equals("unpaid")){
Map<String, String> orderQueryRes = queryOrderPos(receiveParameterPos, merchantConfig.getInsCd(), merchantConfig.getMchntCd());
if (!orderQueryRes.get("msg").equals("unpaid")) {
res.put("code", "success");
res.put("msg", "success");
timer.cancel();
}
} catch (Exception e) {
@ -679,50 +695,114 @@ public class FyPayServiceImpl implements FyPayService {
}
}
//定时器 不延时 立即开始 0.5s一次
}, 0, 500);
}, 0, 500);
Thread.currentThread().interrupt();
});
}else {
} else {
throw new Exception("验签失败,请联系管理员!");
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return null;
return res;
}
@Override
public Map<String, String> queryOrderPos(ReceiveParameterPos receiveParameterPos,String insCd,String mchntCd) {
Map<String, String> resMap =new HashMap<>();
resMap.put("msg","error");
public Map<String, String> queryOrderPos(ReceiveParameterPos receiveParameterPos, String insCd, String mchntCd) {
Map<String, String> resMap = new HashMap<>();
resMap.put("msg", "error");
try {
Map<String, String> map = Builder.buildFuiou30();
map.put("mchnt_order_no",receiveParameterPos.getOrderNo());
map.put("order_type",receiveParameterPos.getType());
map.put("mchnt_order_no", receiveParameterPos.getOrderNo());
map.put("order_type", receiveParameterPos.getPayType());
map.put("ins_cd", insCd);
map.put("mchnt_cd", mchntCd);
String payStatus = "unpaid";
// 请求报文
String reqBody = Message.requestMsg(map);
// 响应报文
String rspXml = Message.responseMsg(reqBody,Const.fuiou_34_url);
String rspXml = Message.responseMsg(reqBody, Const.fuiou_34_url);
//响应报文验签
Map<String, String> reqMap = Utils.xmlStr2Map(rspXml);
String str = reqMap.get("sign");
if (Utils.verifySign(reqMap, str)){
if (reqMap.get("trans_stat").equals("SUCCESS")){
resMap.put("msg","success");
}else if (reqMap.get("trans_stat").equals("USERPAYING")){
resMap.put("msg","unpaid");
}else {
resMap.put("msg","payFail");
if (Utils.verifySign(reqMap, str)) {
OilOrder oilOrder = oilOrderService.selectOilOrderByOrderNo(receiveParameterPos.getOrderNo());
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId());
ReceiveParameter receiveParameter = new ReceiveParameter();
BeanUtils.copyProperties(receiveParameterPos, receiveParameter);
Double discountAmount = 0.0;
if (ObjectUtil.isNotEmpty(oilOrder)) discountAmount = oilOrder.getDiscountAmount();
this.insertAllOrderInfo(receiveParameter, receiveParameterPos.getPayType(),discountAmount);
if (reqMap.get("trans_stat").equals("SUCCESS")) {
payStatus = "paid";
if (!ObjectUtil.isEmpty(oilOrder)) {
// 油品订单
oilOrder.setOrderStatus("paid");
oilOrder.setPayTime(new Date());
oilOrderService.updateCardAndActiveById(oilOrder.getStoreId(), oilOrder.getUserId(), oilOrder.getActiveId(), oilOrder.getCouponId(), oilOrder.getActiveType(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), Integer.valueOf(oilOrder.getOils()));
oilOrderService.insertFavorable(oilOrder, receiveParameterPos.getOilCardAmount());
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId()))
staffCommissionService.countStaffCommission(oilOrder.getStaffId(), oilOrder.getStoreId(), oilOrder.getOrderAmount(), oilOrder.getPayAmount(), "1", receiveParameterPos.getOrderNo());
// 修改油罐容量
oilOrderService.addOilTracks(oilOrder, oilOrder.getStoreId());
if (ObjectUtil.isNotEmpty(oilOrder.getUserId())) integralSettingsService.refuelPoints(oilOrder);
//修改优惠券使用状态
if (oilOrder.getCouponId() != null) {
CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrder.getCouponId());
if (!ObjectUtil.isEmpty(byId)) {
byId.setStatus("1");
cardFavorableRecordService.updateById(byId);
}
}
}
// 修改商户账号余额信息
Double amount = merchantConfig.getAmount();
merchantConfig.setAmount(amount + receiveParameterPos.getGoodsMoney());
merchantConfigService.updateMerch(merchantConfig);
resMap.put("msg", "success");
} else if (reqMap.get("trans_stat").equals("USERPAYING")) {
payStatus = "unpaid";
resMap.put("msg", "unpaid");
} else {
payStatus = "payFail";
if (!ObjectUtil.isEmpty(oilOrder)) {
oilOrder.setOrderStatus("payFail");
}
resMap.put("msg", "payFail");
}
if (!ObjectUtil.isEmpty(oilOrder)) {
receiveParameter.setType("1");
if (oilOrder.getUserId() != null) {
receiveParameter.setUserId(oilOrder.getUserId());
}
receiveParameter.setContent("油品订单");
oilOrderService.updateOilOrder(oilOrder);
}
if (ObjectUtil.isNotEmpty(merchantConfig)) {
// 添加配置记录信息
MerchantConfigRecord merchantConfigRecord = new MerchantConfigRecord();
merchantConfigRecord.setMerchantId(merchantConfig.getId());
if (payStatus.equals("paid")) {
merchantConfigRecord.setIsSuccess("yes");
} else {
merchantConfigRecord.setIsSuccess("no");
}
merchantConfigRecord.setAmount(receiveParameterPos.getGoodsMoney());
merchantConfigRecord.setType("0");
merchantConfigRecord.setStoreId(merchantConfig.getStoreId());
merchantConfigRecord.setOrderNo(receiveParameterPos.getOrderNo());
merchantConfigRecordService.insertMerchantConfigRecord(merchantConfigRecord);
}
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return null;
return resMap;
}
@Override
@ -730,9 +810,9 @@ public class FyPayServiceImpl implements FyPayService {
Map<String, String> res = new HashMap<>();
// 查询商户配置信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(receiveParameterPos.getStoreId());
if (ObjectUtil.isEmpty(merchantConfig)){
res.put("code","error");
res.put("msg","暂未配置商户信息");
if (ObjectUtil.isEmpty(merchantConfig)) {
res.put("code", "error");
res.put("msg", "暂未配置商户信息");
return res;
}
Map<String, String> map = Builder.buildFuiou25();
@ -740,14 +820,14 @@ public class FyPayServiceImpl implements FyPayService {
map.put("ins_cd", merchantConfig.getInsCd());
map.put("mchnt_cd", merchantConfig.getMchntCd());
map.put("term_id", "88888888");
map.put("mchnt_order_no",receiveParameterPos.getOrderNo());
map.put("mchnt_order_no", receiveParameterPos.getOrderNo());
map.put("random_str", "orderNo");
map.put("order_type",receiveParameterPos.getPayType());
map.put("order_type", receiveParameterPos.getPayType());
map.put("goods_des", receiveParameterPos.getContent());
double amount = receiveParameterPos.getGoodsMoney() * 100;
map.put("order_amt", String.valueOf((int) amount));
String nowtime = DateUtil.format(new Date(), "yyyyMMddHHmmss");
map.put("txn_begin_ts",nowtime);
map.put("txn_begin_ts", nowtime);
String publicKey = merchantConfig.getPublicKey();
String privateKey = merchantConfig.getPrivateKey();
@ -757,13 +837,13 @@ public class FyPayServiceImpl implements FyPayService {
// 请求报文
String reqBody = Message.requestMsg(map);
// 响应报文
String rspXml = Message.responseMsg(reqBody,Const.fuiou_35_url);
String rspXml = Message.responseMsg(reqBody, Const.fuiou_35_url);
//响应报文验签
Map<String, String> resMap = Utils.xmlStr2Map(rspXml);
String str = resMap.get("sign");
if (Utils.verifySign(resMap, str)){
if (Utils.verifySign(resMap, str)) {
System.out.println(resMap);
}
return resMap;

View File

@ -322,4 +322,13 @@ public class OilOrderController extends BaseController {
return getSuccessResult(orderService.getInfoByEm(order));
}
/**
* pos端扫码支付
* @param oilOrderVo
* @return
*/
@PostMapping("addOrderPos")
public ResponseObject addOrderPos(@RequestBody OilOrderVo oilOrderVo) throws Exception {
return getSuccessResult(orderService.addOrderPos(oilOrderVo));
}
}

View File

@ -51,6 +51,10 @@ public class AllOrderInfo extends BaseEntity implements Serializable {
* 支付金额
*/
private Double payMoney;
/**
* 优惠金额
*/
private Double discountAmount;
/**
* 支付时间
*/

View File

@ -209,7 +209,7 @@ public interface OilOrderService extends IService<OilOrder> {
* @param oilOrderVo
* @return
*/
int addOrderPos(OilOrderVo oilOrderVo);
Map<String,String> addOrderPos(OilOrderVo oilOrderVo) throws Exception;
/**
* 添加订单信息 主扫

View File

@ -71,6 +71,7 @@ import com.fuint.common.util.StringUtils;
import com.fuint.common.util.TokenUtil;
import com.fuint.system.config.service.SysConfigService;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
@ -526,7 +527,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setPayAmount(0.0);
}
cashierOrder.setPayTime(new Date());
this.insertAllOrderInfo(orderNo,storeId,oilAmount+goodsAmount,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
this.insertAllOrderInfo(orderNo,storeId,oilAmount+goodsAmount,Double.valueOf(map.get("allAmount")),oilDiscount,payType,userId,"PC","6","paid");
}else {
cashierOrder.setPayAmount(oilActualPay+goodsActualPay);
}
@ -574,7 +575,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// throw new RuntimeException("支付失败");
}
}else {
this.insertAllOrderInfo(orderNo,storeId,oilAmount+goodsAmount,Double.valueOf(map.get("allAmount")),payType,userId,"PC","6","paid");
this.insertAllOrderInfo(orderNo,storeId,oilAmount+goodsAmount,Double.valueOf(map.get("allAmount")),oilDiscount,payType,userId,"PC","6","paid");
}
OilOrder oilOrder2 = this.selectOilOrderByOrderNo(orderNo);
@ -916,7 +917,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setSeekZero(0.0);
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount, map.get("payType"), userId, "PC", "1", status);
this.insertAllOrderInfo(orderNo, storeId, oilAmount, oilAmount,0.0, map.get("payType"), userId, "PC", "1", status);
if (ObjectUtil.isNotEmpty(map.get("staffId"))) staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,"1",orderNo);
res.put("success","success");
}
@ -988,7 +989,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
cashierOrder.setPayType(map.get("payType"));
cashierOrderService.insertCashierOrder(cashierOrder);
this.updateGrowthValue1(oilAmount,oilAmount,userId, Integer.valueOf(oilOrder.getOils()),0.0,storeId,orderNo);
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,oilAmount,map.get("payType"),userId,"PC","1","paid");
this.insertAllOrderInfo(orderNo,accountInfo.getStoreId(),oilAmount,oilAmount,0.0,map.get("payType"),userId,"PC","1","paid");
if (ObjectUtil.isNotEmpty(map.get("staffId"))) staffCommissionService.countStaffCommission(Integer.valueOf(map.get("staffId")),storeId,oilAmount,oilAmount,"1",orderNo);
// this.insertCardBalance(oilAmount,userId,storeId);
res.put("success","success");
@ -1006,7 +1007,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
/**
* 添加所有订单信息
*/
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,Double payAmount,String payType,Integer userId,String payChannel,String type,String status){
private void insertAllOrderInfo(String orderNo,Integer storeId,Double goodsMoney,Double payAmount,Double discountAmount,String payType,Integer userId,String payChannel,String type,String status){
AllOrderInfo allOrderInfo = new AllOrderInfo();
allOrderInfo.setOrderNo(orderNo);
allOrderInfo.setType(type);
@ -1016,6 +1017,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
allOrderInfo.setUserId(userId);
allOrderInfo.setPayChannel(payChannel);
allOrderInfo.setStatus(status);
allOrderInfo.setDiscountAmount(discountAmount);
if (status.equals("paid")){
allOrderInfo.setPayMoney(payAmount);
allOrderInfo.setPayTime(new Date());
@ -1227,7 +1229,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
userId = userVo.getId();
if (!isUseChild.equals("yes")){
applet.put("error","不可使用子卡消费!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0, oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0,oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
}
@ -1238,7 +1240,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
if (balanceAmount.equals("0") && map.get("payAmount").equals("0")) {
if (Double.compare(oilCardLiters,oilOrder.getOilNum())!=0){
applet.put("error","囤油卡消费升数不对!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0, oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0,oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
}else {
@ -1246,7 +1248,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Double residueAmount = useLiters * oilNumber.getOilPrice();
if ((Double.valueOf(map.get("payAmount"))+Double.valueOf(balanceAmount)-residueAmount)>=0.05){
applet.put("error","消费总金额不对!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0, oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0,oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
}
@ -1257,7 +1259,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
// if (Double.compare(realAmount,oilOrder.getOrderAmount())!=0){
if (-0.03>=(realAmount-oilOrder.getOrderAmount()) && (realAmount-oilOrder.getOrderAmount())>=0.03){
applet.put("error","消费总金额不对!");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0, oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),0.0,oilOrder.getDiscountAmount(), oilOrder.getPayType(), userId,oilOrder.getPayType(),"1","payFail");
result = true;
}
}
@ -1316,7 +1318,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
this.updateGrowthValue(oilOrder.getOrderAmount(),payAmount,userId, Integer.valueOf(oilOrder.getOils()),oilCardAmount,oilOrder.getStoreId(),orderNo);
this.addOilTracks(oilOrder,oilOrder.getStoreId());
this.insertCardOrder(oilOrder.getUserId(),oilOrder.getStoreId(),orderNo,oilOrder.getOrderAmount(),"paid", Double.valueOf(balanceAmount),payAmount);
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),payAmount,oilOrder.getPayType(),oilOrder.getUserId(),"applet","1","paid");
this.insertAllOrderInfo(orderNo,oilOrder.getStoreId(),oilOrder.getOrderAmount(),payAmount,Double.valueOf(discountAmount),oilOrder.getPayType(),oilOrder.getUserId(),"applet","1","paid");
this.insertCardBalance(Double.valueOf(balanceAmount),userId,oilOrder.getStoreId(),orderNo);
if (ObjectUtil.isNotEmpty(oilOrder.getStaffId())) staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getOrderAmount(),"1",orderNo);
oilOrder.setPayAmount(payAmount);
@ -1986,7 +1988,8 @@ return stringDoubleMap;
// pos端
@Override
public int addOrderPos(OilOrderVo oilOrderVo) {
public Map<String,String> addOrderPos(OilOrderVo oilOrderVo) throws Exception {
Map<String,String> res = new HashMap<>();
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
// 根据日期生成订单信息
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
@ -2001,14 +2004,67 @@ return stringDoubleMap;
oilOrderVo.setOilNum(oilNum);
oilOrderVo.setTerminal("POS");
oilOrderVo.setOrderType("主订单");
if (oilOrderVo.getPayType().equals("CASH")){
if (ObjectUtil.isNotEmpty(oilOrderVo.getPayType()) && oilOrderVo.getPayType().equals("CASH")){
oilOrderVo.setOrderStatus("paid");
oilOrderVo.setPayTime(new Date());
}else {
oilOrderVo.setOrderStatus("unpaid");
}
if (ObjectUtil.isNotEmpty(oilOrderVo.getAuthCode())) {
Double substring = Double.valueOf(oilOrderVo.getAuthCode().substring(0, 2));
if (substring >= 10 && substring <= 15) {
oilOrderVo.setPayType("WECHAT");
} else if (substring >= 25 && substring <= 30) {
oilOrderVo.setPayType("ALIPAY");
} else if (substring == 62) {
oilOrderVo.setPayType("UNIONPAY");
}
}
int row = baseMapper.insert(oilOrderVo);
return row;
ReceiveParameterPos receiveParameterPos = new ReceiveParameterPos();
receiveParameterPos.setStoreId(nowAccountInfo.getStoreId());
receiveParameterPos.setType("1");
receiveParameterPos.setOrderNo(orderNo);
receiveParameterPos.setContent("油品订单支付");
receiveParameterPos.setPayType(oilOrderVo.getPayType());
receiveParameterPos.setGoodsMoney(oilOrderVo.getPayAmount());
receiveParameterPos.setAuthCode(oilOrderVo.getAuthCode());
receiveParameterPos.setUserId(oilOrderVo.getUserId());
receiveParameterPos.setOilCardAmount(oilOrderVo.getOilCardAmount1());
if (ObjectUtil.isNotEmpty(oilOrderVo.getAuthCode()) && oilOrderVo.getPayAmount()>0){
try {
fyPayService.posPay(receiveParameterPos);
// if (stringObjectMap.get("code").equals("success")){
// row = 1;
// }else {
// row = 2;
// }
}catch (Exception e){
e.printStackTrace();
}
}else {
staffCommissionService.countStaffCommission(nowAccountInfo.getStaffId(),nowAccountInfo.getStoreId(),oilOrderVo.getOrderAmount(),oilOrderVo.getPayAmount(),"1",orderNo);
this.addOilTracks(oilOrderVo,nowAccountInfo.getStoreId());
this.updateCardAndActiveById(nowAccountInfo.getStoreId(),oilOrderVo.getUserId(),oilOrderVo.getActiveId(),oilOrderVo.getCouponId(),oilOrderVo.getActiveType(),oilOrderVo.getOrderAmount(),oilOrderVo.getPayAmount(), Integer.valueOf(oilOrderVo.getOils()));
this.insertAllOrderInfo(orderNo,nowAccountInfo.getStoreId(),oilOrderVo.getOrderAmount(),oilOrderVo.getPayAmount(),oilOrderVo.getDiscountAmount(),oilOrderVo.getPayType(),oilOrderVo.getUserId(),"POS","1","paid");
this.insertFavorable(oilOrderVo, oilOrderVo.getOilCardAmount());
if (ObjectUtil.isNotEmpty(oilOrderVo.getUserId())) integralSettingsService.refuelPoints(oilOrderVo);
//修改优惠券使用状态
if (oilOrderVo.getCouponId() != null) {
CardFavorableRecord byId = cardFavorableRecordService.getById(oilOrderVo.getCouponId());
if (!ObjectUtil.isEmpty(byId)) {
byId.setStatus("1");
cardFavorableRecordService.updateById(byId);
}
}
row = 1;
}
if (row == 1 && ObjectUtil.isNotEmpty(oilOrderVo.getUserId())){
this.updateGrowthValue(oilOrderVo.getOrderAmount(),oilOrderVo.getPayAmount(), oilOrderVo.getUserId(), Integer.valueOf(oilOrderVo.getOils()),null,nowAccountInfo.getStoreId(),orderNo);
}
res.put("orderNo",orderNo);
res.put("code", String.valueOf(row));
return res;
}
@Override

View File

@ -29,6 +29,9 @@ public class OilOrderVo extends OilOrder {
// 优惠券优惠金额
@TableField(exist = false)
private Double couponAmount;
@TableField(exist = false)
private String authCode;
@TableField(exist = false)
private Double oilCardAmount1;
}

View File

@ -123,7 +123,7 @@
and store_id = #{oilGun.storeId}
</select>
<select id="selectListByStoreId" resultType="com.fuint.business.petrolStationManagement.vo.OilGunVO">
SELECT og.*,onu.oil_name FROM oil_gun og
SELECT og.*,onu.oil_name,onu.oil_Price FROM oil_gun og
LEFT JOIN oil_number onu on og.number_id = onu.number_id
where og.status = '启用'
<if test="storeId != null">

View File

@ -102,6 +102,9 @@ public class PrinterServiceImpl implements PrinterService {
@Override
public String getToken(Integer storeId) {
PrintDeviceInfo infoByStoreId = printDeviceInfoMapper.getInfoByStoreId(storeId);
if (ObjectUtil.isEmpty(infoByStoreId)){
return "error";
}
RequestMethod.getInstance().init(infoByStoreId.getAppKey(),infoByStoreId.getAppSecret());
try {

View File

@ -594,7 +594,7 @@
<el-dialog :close-on-click-modal="false" width="60%" title="会员充值" :visible.sync="openRecharge" append-to-body>
<template>
<el-tabs v-model="activeRecharge" type="card" @tab-click="handleClick">
<el-tab-pane label="储值卡" name="balance">
<el-tab-pane label="电子储值卡" name="balance">
<div style="font-size: 14px">
<div style="font-size: 14px;height: 50px;line-height: 50px">充值金额</div>
<div v-if="cardValueList.length>0"
@ -708,7 +708,7 @@
</div>
</div>
</el-tab-pane>
<el-tab-pane label="油卡" name="literCard">
<el-tab-pane label="电子囤油卡" name="literCard">
<el-row>
<el-col :span="24">
<div style="display: flex">
@ -3377,7 +3377,7 @@
}else {
this.oilActualPay = this.oilAmount.toFixed(2)
}
console.log("不使用囤油卡",this.oilAmount, this.oilDiscount,this.couponAmount,this.fullReduction)
console.log("不使用囤油卡",this.oilAmount, this.oilDiscount,this.couponAmount,this.fullReduction,this.oilCardAmount)
},
// 使
countAmountUnBalance(){
@ -3896,7 +3896,7 @@
if (flag) amount = item.oilPrice * item.liters
oilAmount += amount
})
this.oilCardAmount = this.oilAmount - oilAmount
if (oilAmount>0) this.oilCardAmount = this.oilAmount - oilAmount
this.countAmountFull()
})
},

View File

@ -101,25 +101,25 @@
></el-statistic>
</div>
</el-col>
<el-col :span="4">
<div class="sta" v-if="!refuelMoney">
<el-statistic
group-separator=","
:precision="2"
:value="0"
title="囤油卡余额"
>
</el-statistic>
</div>
<div v-if="refuelMoney && refuelMoney.length>0" style="display: flex;align-items: center;margin-top: 25px">
<div class="size-hui">囤油卡余额</div>
<div v-for="(item,index) in refuelMoney"
:key="index" style="margin-left: 20px;text-align: center">
<div class="size-hui">{{ item.oilName ? item.type + item.oilName : item.type }}</div>
<div class="size-bole">{{ item.refuelMoney || 0.00 }}</div>
</div>
</div>
</el-col>
<!-- <el-col :span="4">-->
<!-- <div class="sta" v-if="!refuelMoney">-->
<!-- <el-statistic-->
<!-- group-separator=","-->
<!-- :precision="2"-->
<!-- :value="0"-->
<!-- title="囤油卡余额"-->
<!-- >-->
<!-- </el-statistic>-->
<!-- </div>-->
<!-- <div v-if="refuelMoney && refuelMoney.length>0" style="display: flex;align-items: center;margin-top: 25px">-->
<!-- <div class="size-hui">囤油卡余额</div>-->
<!-- <div v-for="(item,index) in refuelMoney"-->
<!-- :key="index" style="margin-left: 20px;text-align: center">-->
<!-- <div class="size-hui">{{ item.oilName ? item.type + item.oilName : item.type }}</div>-->
<!-- <div class="size-bole">{{ item.refuelMoney || 0.00 }}</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </el-col>-->
</el-row>
</div>
</template>
@ -158,7 +158,7 @@
<el-dialog :close-on-click-modal="false" width="60%" :title="title" :visible.sync="openRecharge" append-to-body>
<template>
<el-tabs v-model="activeRecharge" type="card" @tab-click="handleClick">
<el-tab-pane label="储值卡" name="balance">
<el-tab-pane label="电子储值卡" name="balance">
<div>
<el-row>
<el-col :span="1.5">
@ -278,7 +278,7 @@
</div>
</div>
</el-tab-pane>
<el-tab-pane label="油卡" name="literCard">
<el-tab-pane label="电子囤油卡" name="literCard">
<el-row>
<el-col :span="24">
<div style="display: flex">

View File

@ -2,6 +2,10 @@
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"

View File

@ -1,75 +1,75 @@
{
"name": "WX-lift",
"appid": "__UNI__7A6878C",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App */
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* */
"modules": {},
/* */
"distribute": {
/* android */
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios": {},
/* SDK */
"sdkConfigs": {}
}
},
/* */
"quickapp": {},
/* */
"mp-weixin": {
"appid": "wx7ad01a99a7247643",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true
},
"usingComponents": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "2"
}
"name" : "WX-lift",
"appid" : "__UNI__7A6878C",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wx64893d1680461e30",
"setting" : {
"urlCheck" : false,
"es6" : true,
"postcss" : true,
"minified" : true
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}

View File

@ -77,6 +77,13 @@
"navigationBarTitleText": "消息列表",
"navigationStyle": "custom"
}
},
{
"path": "scanQrcode/index",
"style": {
"navigationBarTitleText": "扫码支付",
"navigationStyle": "custom"
}
}
]

View File

@ -3,15 +3,27 @@
<view class="container">
<headers :titles="titles"><u-icon name="arrow-left" color="#fff" size="22"></u-icon></headers>
<view class="input-box">
<view style="margin-right: 10px;">收款金额</view>
<view style="margin-right: 10px;">收款金额</view>
<view class="">{{AmountCollected}}</view>
<!-- <input type="number" /> -->
</view>
<view class="input-box">
<view style="margin-right: 10px;">优惠后收款金额</view>
<view class="">{{paymentAmount}}</view>
<!-- <input type="number" /> -->
</view>
<view class="input-box">
<view style="margin-right: 10px;">优惠金额</view>
<view class="">{{DiscountAmount}}</view>
<!-- <input type="number" /> -->
</view>
<view class="input-box">
<view style="margin-right: 10px;">储值卡消费金额</view>
<view class="">{{balanceRedece}}</view>
<!-- <input type="number" /> -->
</view>
<!-- <view class="title_">选择油号</view>
<view class="warp-box">
@ -23,8 +35,8 @@
</view> -->
<view class="title_">选择油枪</view>
<view class="warp-box">
<view class="w-box" :class="{ 'acv' : spearIndex == index }" @click="getspearIndex(index)"
v-for="(item,index) in spearList" :key="index">
<view class="w-box" :class="{ 'acv' : spearIndex == index }" v-for="(item,index) in spearList"
:key="index" @click="getspearIndex(index,item)">
{{item.gunName}}
</view>
@ -34,7 +46,7 @@
<view class="kuang-top">
<view class="w-shi">添加备注</view>
<view style="color: #E8E8E8;"> | </view>
<view class="w-shi" @click="gosearchVip()">搜索会员</view>
<view class="w-shi" @click="gosearchVip()">{{userInfo ? userInfo.mobile : '搜索会员'}}</view>
</view>
<!-- 键盘区域 -->
<view class="num-box">
@ -46,16 +58,18 @@
</view>
<view class="Centralimg" v-if="item.type == 'img' ">
<view class="icon-box">
<image src="/static/imgs/smzf.png" v-if="item.value == 'smzf' "></image>
<image src="/static/imgs/smzf.png" v-if="item.value == 'smzf' " @click="scanQrcode">
</image>
<image src="/static/imgs/skzf.png" v-if="item.value == 'skzf' "></image>
<image src="/static/imgs/hyzf.png" v-if="item.value == 'hyzf' "></image>
<image src="/static/imgs/xjzf.png" v-if="item.value == 'xjzf' "></image>
<image src="/static/imgs/xjzf.png" v-if="item.value == 'xjzf' " @click="cashPay">
</image>
<image src="/static/imgs/scjian.png" style="height: 30px;" v-if="!item.value"></image>
</view>
<view class="icon-size" v-if="item.value == 'smzf' ">扫码支付</view>
<view class="icon-size" v-if="item.value == 'smzf' " @click="scanQrcode">扫码支付</view>
<view class="icon-size" v-if="item.value == 'skzf' ">刷卡支付</view>
<view class="icon-size" v-if="item.value == 'hyzf' ">会员支付</view>
<view class="icon-size" v-if="item.value == 'xjzf' ">现金支付</view>
<view class="icon-size" v-if="item.value == 'xjzf' " @click="cashPay">现金支付</view>
</view>
</view>
@ -75,8 +89,25 @@
export default {
data() {
return {
AmountCollected: '',
DiscountAmount: '',
userId: "",
userInfo: "",
AmountCollected: "",
paymentAmount: "",
DiscountAmount: 0,
balance: 0,
balanceRedece: 0,
// 使
isOilStorageCard: false,
authCode: "",
oilName: "",
tankId: "",
oilPrice: "",
oilGunNum: "",
oilCardAmount: 0,
levelAmount: 0,
activeAmount: 0,
//
oilOrder: {},
titles: "收款",
oilList: [
"92#", "95#", "98#"
@ -86,6 +117,8 @@
"1号枪", "2号枪", "3号枪"
],
spearIndex: 0,
orderNo:"",
preferentialData: {},
//
keyboardList: [{
value: '1',
@ -155,6 +188,13 @@
}
},
onLoad(e) {
if (e.userId) {
this.userId = e.userId
this.AmountCollected = e.AmountCollected
this.getUser();
}
},
onShow() {
// this.actList = ["1", "1", "1", "1", "1", ]
// this.status = "nomore"
@ -174,30 +214,220 @@
headers
},
methods: {
//
getPaymentPreferential() {
if (!this.AmountCollected || !this.userInfo) {
return;
}
this.DiscountAmount = 0;
let type = 0;
if (this.balanceRedece == 0) {
type = 2
} else {
type = 0
}
let map = {
// 0 1
type: type,
//
amount: this.AmountCollected,
//Id
oilId: this.oilName,
//id
storeId: uni.getStorageSync("storeId"),
//
mtUserLevel: this.userInfo.gradeId,
//id
userId: this.userInfo.id,
}
request({
url: "business/marketingActivity/activeExchange/getPaymentActive",
method: 'get',
params: map,
}).then((res) => {
this.preferentialData = res.data
if (res.data.memberFavorableAmount) {
this.DiscountAmount += res.data.memberFavorableAmount
this.oilOrder.levelAmount = res.data.memberFavorableAmount
}
if (res.data.cardFavorableAmount) {
this.DiscountAmount += res.data.cardFavorableAmount
}
if (res.data.activeFavorableAmount) {
this.DiscountAmount += res.data.activeFavorableAmount
this.oilOrder.activeAmount = res.data.activeFavorableAmount
}
this.countAmount()
})
},
//
getUser() {
request({
url: '/business/userManager/user/' + this.userId,
method: 'get',
}).then((res) => {
this.userInfo = res.data
this.balance = res.data.cardBalance
this.getPaymentPreferential()
})
},
//
countAmount() {
if (this.balance >= (this.AmountCollected - this.DiscountAmount - this.oilCardAmount)) {
this.balanceRedece = this.AmountCollected - this.DiscountAmount - this.oilCardAmount
this.paymentAmount = 0
} else {
this.balanceRedece = this.balance
this.paymentAmount = (this.AmountCollected - this.DiscountAmount - this.balance - this.oilCardAmount).toFixed(2)
}
},
//
scanQrcode() {
console.log(this.oilOrder);
if (!this.AmountCollected) {
uni.showToast({
title: "请先输入收款金额",
icon: "none"
})
return;
}
let _this = this
uni.scanCode({
onlyFromCamera: true,
success: (res) => {
console.log('扫描二维码成功,结果:' + JSON.stringify(res) + res.result);
_this.authCode = res.result
_this.payMent()
},
error: (res) => {
console.log('扫描二维码出现错误')
}
})
},
//
cashPay() {
this.oilOrder.payType = "CASH"
this.payMent()
},
getOilCardAmount(){
if(!this.userInfo){
return;
}
request({
url: '/business/marketingActivity/cardFuelRecord/getRecordByUserId',
method: 'get',
params:{mtUserId:this.userInfo.id}
}).then((res) => {
res.data.forEach(item => {
if (item.oilType==this.oilName){
let liters = this.AmountCollected / this.oilPrice
this.oilCardAmount = item.lockupPrice * liters
}
})
})
},
//
payMent() {
this.oilOrder.orderNo = this.orderNo
this.oilOrder.orderAmount = this.AmountCollected
this.oilOrder.payAmount = this.paymentAmount
this.oilOrder.discountAmount = this.DiscountAmount
this.oilOrder.balanceAmount = this.balanceRedece
this.oilOrder.isOilStorageCard = this.isOilStorageCard
this.oilOrder.isUseChildCard = this.isUseChildCard
this.oilOrder.activeId = this.preferentialData.activeId
this.oilOrder.cardFavorableId = this.preferentialData.cardFavorableId
this.oilOrder.recordId = this.preferentialData.recordId
this.oilOrder.type = this.preferentialData.type
this.oilOrder.balanceAmountSale = this.balanceRedece
this.oilOrder.levelAmount = this.levelAmount
this.oilOrder.activeAmount = this.activeAmount
this.oilOrder.authCode = this.authCode
this.oilOrder.oils = this.oilName
this.oilOrder.tankId = this.tankId
this.oilOrder.oilPrice = this.oilPrice
this.oilOrder.oilCardAmount1 = this.oilCardAmount
this.oilOrder.userId = this.userInfo.id
this.oilOrder.oilGunNum = this.oilGunNum
this.oilOrder.payUser = this.userInfo.mobile
request({
url: "business/oilOrder/addOrderPos",
method: 'post',
data: this.oilOrder
}).then((res) => {
this.orderNo = res.data.orderNo
if (res.data.code == 1) {
this.reset()
uni.showToast({
title: "支付成功",
icon: "success"
})
// uni.navigateTo({
// url:"/pages/index/index"
// })
} else if (res.data.code == 2) {
uni.showToast({
title: "请先配置商户号",
icon: "none"
})
} else {
uni.showToast({
title: "支付失败,请联系管理员",
icon: "none"
})
}
})
},
//
reset() {
this.userId = "";
this.userInfo = "";
this.AmountCollected = "";
this.DiscountAmount = 0;
this.balanceRedece = 0;
this.isOilStorageCard = false;
this.balanceRedece = 0;
this.authCode = "";
this.oilName = "";
this.tankId = "";
this.oilPrice = "";
this.oilCardAmount = 0;
this.paymentAmount = 0;
this.levelAmount = 0;
this.activeAmount = 0;
this.getOilGun()
},
//
getOilGun(){
getOilGun() {
request({
url: 'business/petrolStationManagement/oilGun/queryOilGunList',
method: 'get',
}).then((res) => {
this.spearList = res.data
if (this.spearList.length > 0) {
this.oilGunNum = this.spearList[0].id
this.oilName = this.spearList[0].oilName
this.tankId = this.spearList[0].tankId
this.oilPrice = this.spearList[0].oilPrice
}
})
},
//
gosearchVip() {
uni.navigateTo({
url: '/pagesHome/searchVip/searchVip'
url: '/pagesHome/searchVip/searchVip?AmountCollected=' + this.AmountCollected
})
},
//
KeyboardLogic(data) {
console.log(data);
// console.log(data);
if (data.type == 'num') {
this.AmountCollected = this.AmountCollected + data.value
if (!this.userInfo) this.paymentAmount = this.AmountCollected
this.getPaymentPreferential()
}
if (data.type == 'img') {
if (!data.value) {
console.log('1');
this.AmountCollected = this.AmountCollected.substring(0, this.AmountCollected.length - 1);
}
if (data.value == 'skzf') {
@ -212,8 +442,13 @@
getoilIndex(num) {
this.oilIndex = num
},
getspearIndex(num) {
getspearIndex(num, data) {
this.spearIndex = num
this.oilGunNum = data.id
this.oils = data.oilName
this.tankId = data.tankId
this.oilPrice = data.oilPrice
this.getPaymentPreferential()
},
goback() {
uni.navigateBack()

View File

@ -0,0 +1,41 @@
<template>
<view class="container">
<mumu-get-qrcode @success='qrcodeSucess' @error="qrcodeError"></mumu-get-qrcode> //
</view>
</template>
<script>
import mumuGetQrcode from '@/uni_modules/mumu-getQrcode/components/mumu-getQrcode/mumu-getQrcode.vue' //
export default {
components: {
mumuGetQrcode //
},
data() {
return {
}
},
name: 'Qrcode',
methods: {
qrcodeSucess(data) { //
console.log(data,123)
uni.showModal({
title: '成功',
content: data,
success: () => {
console.log(111)
}
})
},
qrcodeError(err) { //
uni.showModal({
title: '摄像头授权失败',
content: '摄像头授权失败,请检测当前浏览器是否有摄像头权限。',
success: () => {
console.log(222)
uni.navigateBack({}) //
}
})
}
}
};
</script>

View File

@ -5,27 +5,27 @@
<view class="top-box">
<view class="inputbox">
<u-icon name="search" size="20"></u-icon>
<input type="text" />
<input type="text" v-model="paramsQuery.mobile" />
</view>
<u-icon name="scan" color="#fff" size="38"></u-icon>
<u-icon name="search" color="#fff" size="38" @click="getList"></u-icon>
</view>
<view class="box_" v-for="(item,index) in 8" :key="index">
<view class="box_" v-for="(item,index) in list" :key="index" @click="toCollection(item.id)">
<view class="leftbox">
<view class="title_">会员信息</view>
<view class="d-s">
<view class="hui">会员名称:</view>
<view class="hei"> 胡桃</view>
<view class="hei"> {{item.name}}</view>
</view>
<view class="d-s">
<view class="hui">手机号:</view>
<view class="hei"> 153****9968</view>
<view class="hei"> {{item.mobile}}</view>
</view>
<view class="d-s">
<view class="hui">账户余额:</view>
<view class="hei"> 1854.96</view>
<view class="hei"> {{item.cardBalance}}</view>
</view>
</view>
@ -35,33 +35,49 @@
</view>
</view>
<view class="bottom-b"></view>
<view class="p-bottom" @click="govipjs()">
<!-- <view class="p-bottom" @click="govipjs()">
<view class="anniu">
会员支付
</view>
</view>
</view> -->
</view>
</template>
<script>
import request from "../../utils/request";
import headers from '../../components/header/headers.vue'
export default {
data() {
return {
titles: "会员查询",
//
list:[],
total:0,
paramsQuery:{
page:1,
pageSize:30,
},
AmountCollected:"",
}
},
onLoad(e) {
this.AmountCollected = e.AmountCollected
},
onShow() {
// this.actList = ["1", "1", "1", "1", "1", ]
// this.status = "nomore"
this.getList()
},
onPullDownRefresh() {
console.log("刷新");
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.length < this.total) {
this.paramsQuery.page++;
this.getList()
}
// this.show = true
setTimeout(() => {
console.log("加载执行");
@ -71,6 +87,26 @@
headers
},
methods: {
toCollection(id){
uni.navigateTo({
url:"/pagesHome/Collection/Collection?userId="+id+"&AmountCollected="+this.AmountCollected
})
},
getList(){
request({
url: '/business/userManager/user/list',
method: 'get',
params: this.paramsQuery
}).then((res) => {
if (this.paramsQuery.page == 1) {
this.list = res.data.records
} else {
this.list = this.list.concat(res.data.records)
}
this.total = res.data.total
})
},
govipjs() {
uni.navigateTo({
url: '/pagesHome/PaymentResults/PaymentResults'