Commit 72a11d83 authored by mengbali153's avatar mengbali153

在线点单一版

parent 5105aab0
...@@ -129,7 +129,12 @@ public class UserControler extends UserController { ...@@ -129,7 +129,12 @@ public class UserControler extends UserController {
if (merchantInfo.getCode() == 200) { if (merchantInfo.getCode() == 200) {
Merchant data = merchantInfo.getData(); Merchant data = merchantInfo.getData();
if (data.getManageStatus() == 1) { if (data.getManageStatus() == 1) {
return R.failed("当前商户已关闭"); // return R.failed("当前商户已关闭");
data.setManageStatus((byte)0);
BaseResponse updatemerchant = merchantService.updatemerchant(data);
return R.ok(updatemerchant);
}else{
return R.ok("当前商户已开启");
} }
} }
if ("ADMIN".equals(user.getSysUser().getLevel())) { if ("ADMIN".equals(user.getSysUser().getLevel())) {
...@@ -162,6 +167,16 @@ public class UserControler extends UserController { ...@@ -162,6 +167,16 @@ public class UserControler extends UserController {
} }
} }
@ApiOperation("收银端退出")
@ApiImplicitParam(name = "deviceCode", value = "当前设备号", dataType = "String", paramType = "query")
@PostMapping("/close")
public R closeCashier(@RequestParam("deviceCode") String deviceCode) {
Merchant merchByDevice = iMerchantService.getMerchByDevice(deviceCode);
merchByDevice.setManageStatus((byte)1);
BaseResponse updatemerchant = iMerchantService.updatemerchant(merchByDevice);
return R.ok(updatemerchant);
}
@PostMapping("/check/pwd") @PostMapping("/check/pwd")
@ApiOperation("验证敏感操作密码") @ApiOperation("验证敏感操作密码")
......
...@@ -26,4 +26,7 @@ public interface IDeviceService { ...@@ -26,4 +26,7 @@ public interface IDeviceService {
@DeleteMapping("page") @DeleteMapping("page")
public BaseResponse devicePage(@RequestParam("merchId") Long merchId, @RequestParam("typeId") Integer typeId, public BaseResponse devicePage(@RequestParam("merchId") Long merchId, @RequestParam("typeId") Integer typeId,
@SpringQueryMap PageQuery pageQuery); @SpringQueryMap PageQuery pageQuery);
@GetMapping("/getDeviceBySeller")
public Device getDeviceBySeller(Long merchId);
} }
...@@ -40,6 +40,9 @@ public interface IMerchantService { ...@@ -40,6 +40,9 @@ public interface IMerchantService {
@PostMapping("getMerchNames") @PostMapping("getMerchNames")
BaseResponse getMerchNameByIds(@RequestBody List<Long> merchIds); BaseResponse getMerchNameByIds(@RequestBody List<Long> merchIds);
@PostMapping("getMerchByDevice")
Merchant getMerchByDevice(@RequestParam("deviceCode") String deviceCode);
@GetMapping("getMerchNameByIds") @GetMapping("getMerchNameByIds")
BaseResponse getMerchantByIds(@RequestParam("ids") List<Long> ids); BaseResponse getMerchantByIds(@RequestParam("ids") List<Long> ids);
......
...@@ -33,4 +33,9 @@ public class DeviceServiceImpl implements IDeviceService { ...@@ -33,4 +33,9 @@ public class DeviceServiceImpl implements IDeviceService {
public BaseResponse devicePage(Long merchId, Integer typeId, PageQuery pageQuery) { public BaseResponse devicePage(Long merchId, Integer typeId, PageQuery pageQuery) {
return null; return null;
} }
@Override
public Device getDeviceBySeller(Long merchId) {
return null;
}
} }
...@@ -32,6 +32,12 @@ public class MerchantImpl implements IMerchantService { ...@@ -32,6 +32,12 @@ public class MerchantImpl implements IMerchantService {
return null; return null;
} }
@Override
public Merchant getMerchByDevice(String device) {
error();
return null;
}
@Override @Override
public BaseResponse getDeviceUser(String deviceCode, String username) { public BaseResponse getDeviceUser(String deviceCode, String username) {
error(); error();
......
...@@ -68,6 +68,13 @@ public class DeviceController { ...@@ -68,6 +68,13 @@ public class DeviceController {
return BaseResponse.ok(result); return BaseResponse.ok(result);
} }
public List<Device> getMerchDevicesV2(@PathVariable("merchId") Long merchId) {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("merch_id", merchId);
List<Device> result = deviceService.list(wrapper);
return result;
}
@DeleteMapping("delete/{id}") @DeleteMapping("delete/{id}")
public BaseResponse deleteDevice(@PathVariable("id") Long id) { public BaseResponse deleteDevice(@PathVariable("id") Long id) {
if (id == null) { if (id == null) {
...@@ -96,4 +103,15 @@ public class DeviceController { ...@@ -96,4 +103,15 @@ public class DeviceController {
page = (Page<Device>) deviceService.page(page, wrapper); page = (Page<Device>) deviceService.page(page, wrapper);
return BaseResponse.ok(page); return BaseResponse.ok(page);
} }
@GetMapping("/getDeviceBySeller")
public Device getDeviceBySeller(Long merchId) {
// QueryWrapper wrapper = new QueryWrapper();
// wrapper.eq("merch_id", merchId);
// Device one = deviceService.getOne(wrapper);
List<Device> merchDevicesV2 = getMerchDevicesV2(merchId);
Device device = merchDevicesV2.get(1);
return device;
}
} }
package cn.wise.sc.pay.business.merchant.controller; package cn.wise.sc.pay.business.merchant.controller;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.wise.sc.pay.business.merchant.service.IDeviceService;
import cn.wise.sc.pay.business.merchant.service.IDeviceUserService; import cn.wise.sc.pay.business.merchant.service.IDeviceUserService;
import cn.wise.sc.pay.business.merchant.service.IMerchantService; import cn.wise.sc.pay.business.merchant.service.IMerchantService;
import cn.wise.sc.pay.common.core.model.BaseController; import cn.wise.sc.pay.common.core.model.BaseController;
...@@ -8,6 +9,7 @@ import cn.wise.sc.pay.common.core.model.BaseResponse; ...@@ -8,6 +9,7 @@ import cn.wise.sc.pay.common.core.model.BaseResponse;
import cn.wise.sc.pay.common.core.query.PageQuery; import cn.wise.sc.pay.common.core.query.PageQuery;
import cn.wise.sc.pay.common.core.query.PageWrapperQuery; import cn.wise.sc.pay.common.core.query.PageWrapperQuery;
import cn.wise.sc.pay.common.core.query.TimeBucket; import cn.wise.sc.pay.common.core.query.TimeBucket;
import cn.wise.sc.pay.domain.merchant.bean.Device;
import cn.wise.sc.pay.domain.merchant.bean.DeviceUser; import cn.wise.sc.pay.domain.merchant.bean.DeviceUser;
import cn.wise.sc.pay.domain.merchant.bean.Merchant; import cn.wise.sc.pay.domain.merchant.bean.Merchant;
import cn.wise.sc.pay.domain.merchant.excelvo.MerchantExcelVO; import cn.wise.sc.pay.domain.merchant.excelvo.MerchantExcelVO;
...@@ -67,6 +69,9 @@ public class MerchantController extends BaseController<IMerchantService, Merchan ...@@ -67,6 +69,9 @@ public class MerchantController extends BaseController<IMerchantService, Merchan
@Autowired @Autowired
IDeviceUserService deviceUserService; IDeviceUserService deviceUserService;
@Autowired
IDeviceService deviceService;
@Autowired @Autowired
UserRoleService userRoleService; UserRoleService userRoleService;
...@@ -85,6 +90,14 @@ public class MerchantController extends BaseController<IMerchantService, Merchan ...@@ -85,6 +90,14 @@ public class MerchantController extends BaseController<IMerchantService, Merchan
return BaseResponse.ok(merchantService.list(wrapper)); return BaseResponse.ok(merchantService.list(wrapper));
} }
@PostMapping("getMerchByDevice")
public Merchant getMerchByDevice(String deviceCode) {
Long byDevice = merchantService.getMerchByDevice(deviceCode);
Merchant merchant = merchantService.getById(byDevice);
return merchant;
}
@GetMapping("like") @GetMapping("like")
public BaseResponse getMerchList(@RequestParam(value = "merchName", required = false) String merchName) { public BaseResponse getMerchList(@RequestParam(value = "merchName", required = false) String merchName) {
QueryWrapper wrapper = new QueryWrapper(); QueryWrapper wrapper = new QueryWrapper();
......
...@@ -47,6 +47,14 @@ public interface IMerchantService extends IService<Merchant> { ...@@ -47,6 +47,14 @@ public interface IMerchantService extends IService<Merchant> {
*/ */
BaseResponse updateMerchant(Merchant merchant); BaseResponse updateMerchant(Merchant merchant);
/**
* 获取设备所属的商户id
*
* @param deviceCode
* @return
*/
Long getMerchByDevice(String deviceCode);
/** /**
* 根据条件获取商户列表 * 根据条件获取商户列表
* *
......
...@@ -165,6 +165,15 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> ...@@ -165,6 +165,15 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant>
return result ? BaseResponse.ok("成功删除商户") : BaseResponse.error("删除商户失败", Merchant.class); return result ? BaseResponse.ok("成功删除商户") : BaseResponse.error("删除商户失败", Merchant.class);
} }
@Override
public Long getMerchByDevice(String deviceCode) {
QueryWrapper qw = new QueryWrapper();
qw.eq("device_code",deviceCode);
Device device = deviceService.getOne(qw);
Long merchId = device.getMerchId();
return merchId;
}
@Override @Override
public BaseResponse updateMerchant(Merchant merchant) { public BaseResponse updateMerchant(Merchant merchant) {
merchant.setUpdateTime(System.currentTimeMillis()); merchant.setUpdateTime(System.currentTimeMillis());
......
...@@ -6,6 +6,7 @@ import cn.wise.sc.pay.common.core.query.PageWrapperQuery; ...@@ -6,6 +6,7 @@ import cn.wise.sc.pay.common.core.query.PageWrapperQuery;
import cn.wise.sc.pay.domain.order.excel.OrderExcel; import cn.wise.sc.pay.domain.order.excel.OrderExcel;
import cn.wise.sc.pay.domain.order.model.OrderResponse; import cn.wise.sc.pay.domain.order.model.OrderResponse;
import cn.wise.sc.pay.domain.order.model.OrderStatus; import cn.wise.sc.pay.domain.order.model.OrderStatus;
import cn.wise.sc.pay.domain.order.model.Orders;
import cn.wise.sc.pay.domain.order.model.StatisticsGoods; import cn.wise.sc.pay.domain.order.model.StatisticsGoods;
import cn.wise.sc.pay.domain.order.query.OrderDetailQuery; import cn.wise.sc.pay.domain.order.query.OrderDetailQuery;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
...@@ -281,4 +282,13 @@ public interface IOrdersService { ...@@ -281,4 +282,13 @@ public interface IOrdersService {
BaseResponse<List<StatisticsGoods>> statisticsGoodsMarketMoneyGroupSellerGood(PageWrapperQuery pageWrapperQuery); BaseResponse<List<StatisticsGoods>> statisticsGoodsMarketMoneyGroupSellerGood(PageWrapperQuery pageWrapperQuery);
/**
* 根据订单号查询订单
*
* @param orderNo 订单号
* @return
*/
@GetMapping("/getOrderByOrderNo")
Orders getOrderByOrderNo(@PathVariable("orderNo") String orderNo);
} }
...@@ -7,6 +7,7 @@ import cn.wise.sc.pay.common.core.query.PageWrapperQuery; ...@@ -7,6 +7,7 @@ import cn.wise.sc.pay.common.core.query.PageWrapperQuery;
import cn.wise.sc.pay.domain.order.excel.OrderExcel; import cn.wise.sc.pay.domain.order.excel.OrderExcel;
import cn.wise.sc.pay.domain.order.model.OrderResponse; import cn.wise.sc.pay.domain.order.model.OrderResponse;
import cn.wise.sc.pay.domain.order.model.OrderStatus; import cn.wise.sc.pay.domain.order.model.OrderStatus;
import cn.wise.sc.pay.domain.order.model.Orders;
import cn.wise.sc.pay.domain.order.query.OrderDetailQuery; import cn.wise.sc.pay.domain.order.query.OrderDetailQuery;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -165,6 +166,11 @@ public class IOrderImpl implements IOrdersService { ...@@ -165,6 +166,11 @@ public class IOrderImpl implements IOrdersService {
} }
@Override
public Orders getOrderByOrderNo(String orderNo) {
return null;
}
Logger logger = LoggerFactory.getLogger(this.getClass()); Logger logger = LoggerFactory.getLogger(this.getClass());
/** /**
......
...@@ -355,6 +355,19 @@ public class OrderController { ...@@ -355,6 +355,19 @@ public class OrderController {
return ordersService.statisticsGoodsMarketMoneyGroupSellerGood(pageWrapperQuery); return ordersService.statisticsGoodsMarketMoneyGroupSellerGood(pageWrapperQuery);
} }
/**
* 根据订单号查询订单
*
* @param orderNo 订单号
* @return
*/
@GetMapping("/getOrderByOrderNo")
public Orders getOrderByOrderNo(@PathVariable("orderNo") String orderNo){
QueryWrapper qw =new QueryWrapper();
qw.eq("order_no",orderNo);
return ordersService.getOne(qw);
}
/** /**
* JSON转MAP * JSON转MAP
* *
......
...@@ -5,7 +5,9 @@ import cn.hutool.core.lang.Assert; ...@@ -5,7 +5,9 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.Snowflake; import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.wise.sc.pay.api.merchant.service.IDeviceService;
import cn.wise.sc.pay.api.merchant.service.IMerchantProfitService; import cn.wise.sc.pay.api.merchant.service.IMerchantProfitService;
import cn.wise.sc.pay.api.merchant.service.IMerchantService;
import cn.wise.sc.pay.business.goods.service.ISpcDetailService; import cn.wise.sc.pay.business.goods.service.ISpcDetailService;
import cn.wise.sc.pay.business.order.configure.WX_Util; import cn.wise.sc.pay.business.order.configure.WX_Util;
import cn.wise.sc.pay.business.order.model.BizContent; import cn.wise.sc.pay.business.order.model.BizContent;
...@@ -23,6 +25,7 @@ import cn.wise.sc.pay.business.order.utils.UgcContentUtil; ...@@ -23,6 +25,7 @@ import cn.wise.sc.pay.business.order.utils.UgcContentUtil;
import cn.wise.sc.pay.business.order.weichat.model.OAuthAccessToken; import cn.wise.sc.pay.business.order.weichat.model.OAuthAccessToken;
import cn.wise.sc.pay.common.core.model.BaseResponse; import cn.wise.sc.pay.common.core.model.BaseResponse;
import cn.wise.sc.pay.common.mq.client.dto.TransactionMessage; import cn.wise.sc.pay.common.mq.client.dto.TransactionMessage;
import cn.wise.sc.pay.domain.merchant.bean.Device;
import cn.wise.sc.pay.domain.order.model.OrderResponse; import cn.wise.sc.pay.domain.order.model.OrderResponse;
import cn.wise.sc.pay.domain.order.model.OrderStatus; import cn.wise.sc.pay.domain.order.model.OrderStatus;
import cn.wise.sc.pay.domain.order.model.Orders; import cn.wise.sc.pay.domain.order.model.Orders;
...@@ -37,6 +40,7 @@ import com.alibaba.fastjson.JSON; ...@@ -37,6 +40,7 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -85,6 +89,12 @@ public class WXController { ...@@ -85,6 +89,12 @@ public class WXController {
ISafeguardService iSafeguardService; ISafeguardService iSafeguardService;
final final
Producer producer; Producer producer;
@Autowired
IMerchantService iMerchantService;
// @Autowired
// IDeviceService iDeviceService;
final
IDeviceService iDeviceService;
@Value("${wechat.suqiancredit.appId}") @Value("${wechat.suqiancredit.appId}")
String WECHAT_APPID; String WECHAT_APPID;
@Value("${wechat.suqiancredit.secret}") @Value("${wechat.suqiancredit.secret}")
...@@ -97,13 +107,15 @@ public class WXController { ...@@ -97,13 +107,15 @@ public class WXController {
ISpcDetailService iSpcDetailService, ISpcDetailService iSpcDetailService,
IMerchantProfitService merchantProfitService, IMerchantProfitService merchantProfitService,
Producer producer, Producer producer,
ISafeguardService iSafeguardService) { ISafeguardService iSafeguardService,
IDeviceService iDeviceService) {
this.wxPayService = wxPayService; this.wxPayService = wxPayService;
this.iOrdersService = iOrdersService; this.iOrdersService = iOrdersService;
this.iSpcDetailService = iSpcDetailService; this.iSpcDetailService = iSpcDetailService;
this.merchantProfitService = merchantProfitService; this.merchantProfitService = merchantProfitService;
this.producer = producer; this.producer = producer;
this.iSafeguardService = iSafeguardService; this.iSafeguardService = iSafeguardService;
this.iDeviceService = iDeviceService;
} }
/** /**
...@@ -260,6 +272,7 @@ public class WXController { ...@@ -260,6 +272,7 @@ public class WXController {
//将订单号存到保留域 //将订单号存到保留域
String mchReserved = body + "|" + orderId; String mchReserved = body + "|" + orderId;
//微信下单时 支付方式 //微信下单时 支付方式
Function<PayParamQuery, BaseResponse> zfbUnifiedFuc = arg -> Function<PayParamQuery, BaseResponse> zfbUnifiedFuc = arg ->
wxPayService.servicePay(arg.getUnifiedOrderNo(), arg.getTxnAmt(), wxPayService.servicePay(arg.getUnifiedOrderNo(), arg.getTxnAmt(),
...@@ -276,6 +289,56 @@ public class WXController { ...@@ -276,6 +289,56 @@ public class WXController {
log.info("=====================requestIp=========================="); log.info("=====================requestIp==========================");
log.info(requestIp); log.info(requestIp);
//
// if (body == "oxo-pay"){
// //微信支付时的参数
// PayParamQuery payParamQuery = PayParamQuery.builder()
// .requestIp(requestIp)
// .openId(openId)
// .unifiedOrderNo(orderId)
// .payMethod(0)
// .build();
//
//// QueryWrapper qw =new QueryWrapper();
//// qw.eq("order_no",orderId);
////
//// Orders one = iOrdersService.getOne(qw);
// log.info("=====================mchReserved!!!!!!!!!!!!!!!!!!!!!!!==========================");
//// Long sellerId = one.getSellerId();
//// Device deviceBySeller = iDeviceService.getDeviceBySeller(sellerId);
//// String deviceCode = deviceBySeller.getDeviceCode();
// String deviceCode = "T208D94L40388";
// String mchReserved = deviceCode + "|" + orderId;
// log.info(mchReserved);
//
// //微信下单时 支付方式
// Function<PayParamQuery, BaseResponse> wxUnifiedFuc = arg ->
// wxPayService.wxPay(arg.getRequestIp(), arg.getUnifiedOrderNo(),
// arg.getTxnAmt(), arg.getOpenId(), mchReserved, arg.getSellerId() + "");
//
//
// return unifiedOrder(orderId, wxUnifiedFuc, payParamQuery);
// }else {
// //微信支付时的参数
// PayParamQuery payParamQuery = PayParamQuery.builder()
// .requestIp(requestIp)
// .openId(openId)
// .unifiedOrderNo(orderId)
// .payMethod(0)
// .build();
//
// //将订单号存到保留域
// String mchReserved = body + "|" + orderId;
//
// //微信下单时 支付方式
// Function<PayParamQuery, BaseResponse> wxUnifiedFuc = arg ->
// wxPayService.wxPay(arg.getRequestIp(), arg.getUnifiedOrderNo(),
// arg.getTxnAmt(), arg.getOpenId(), mchReserved, arg.getSellerId() + "");
//
//
// return unifiedOrder(orderId, wxUnifiedFuc, payParamQuery);
// }
//微信支付时的参数 //微信支付时的参数
PayParamQuery payParamQuery = PayParamQuery.builder() PayParamQuery payParamQuery = PayParamQuery.builder()
...@@ -284,6 +347,7 @@ public class WXController { ...@@ -284,6 +347,7 @@ public class WXController {
.unifiedOrderNo(orderId) .unifiedOrderNo(orderId)
.payMethod(0) .payMethod(0)
.build(); .build();
//将订单号存到保留域 //将订单号存到保留域
String mchReserved = body + "|" + orderId; String mchReserved = body + "|" + orderId;
...@@ -292,6 +356,7 @@ public class WXController { ...@@ -292,6 +356,7 @@ public class WXController {
wxPayService.wxPay(arg.getRequestIp(), arg.getUnifiedOrderNo(), wxPayService.wxPay(arg.getRequestIp(), arg.getUnifiedOrderNo(),
arg.getTxnAmt(), arg.getOpenId(), mchReserved, arg.getSellerId() + ""); arg.getTxnAmt(), arg.getOpenId(), mchReserved, arg.getSellerId() + "");
return unifiedOrder(orderId, wxUnifiedFuc, payParamQuery); return unifiedOrder(orderId, wxUnifiedFuc, payParamQuery);
} }
...@@ -836,23 +901,57 @@ public class WXController { ...@@ -836,23 +901,57 @@ public class WXController {
if (StrUtil.isBlank(msgInfo)) { if (StrUtil.isBlank(msgInfo)) {
log.error("打印小票的消息失败!预保留域为空!"); log.error("打印小票的消息失败!预保留域为空!");
} }
log.info("--------------------------");
log.info("orders="+orders);
log.info("masInfo="+msgInfo);
log.info("--------------------------");
//收银系统 打印小票 //收银系统 打印小票
if ("cashier".equals(orders.getPaas())) { if ("cashier".equals(orders.getPaas())) {
String[] strs = msgInfo.split("\\|"); String[] strs = msgInfo.split("\\|");
if (strs.length >= 2) { if (strs.length >= 2) {
String msg = strs[strs.length - 3]; // String msg = strs[strs.length - 3];
String msg = strs[strs.length - 2];
String sn = strs[strs.length - 2]; String sn = strs[strs.length - 2];
TransactionMessage transactionMessage = new TransactionMessage(); log.info(msg+"-------------------"+sn);
transactionMessage.setMessage(msg + "|" + orders.getOrderNo()); if (msg == "oxo-pay"){
transactionMessage.setQueue(sn); String deviceNo = "T208D94L40388";
transactionMessage.setRouteKey(sn); TransactionMessage transactionMessage = new TransactionMessage();
try { transactionMessage.setMessage(deviceNo + "|" + orders.getOrderNo());
log.info("打印小票 msg :{}", JSON.toJSONString(transactionMessage)); transactionMessage.setQueue(deviceNo);
mqpost(transactionMessage); transactionMessage.setRouteKey(deviceNo);
} catch (IOException e) { transactionMessage.setStatus(999);
log.error("收银端打印小票,mq消息推送失败!"); log.info(transactionMessage.toString());
e.printStackTrace(); try {
log.info("打印小票 msg :{}", JSON.toJSONString(transactionMessage));
mqpost(transactionMessage);
} catch (IOException e) {
log.error("收银端打印小票,mq消息推送失败!");
e.printStackTrace();
}
}else {
TransactionMessage transactionMessage = new TransactionMessage();
transactionMessage.setMessage(msg + "|" + orders.getOrderNo());
transactionMessage.setQueue(sn);
transactionMessage.setRouteKey(sn);
try {
log.info("打印小票 msg :{}", JSON.toJSONString(transactionMessage));
mqpost(transactionMessage);
} catch (IOException e) {
log.error("收银端打印小票,mq消息推送失败!");
e.printStackTrace();
}
} }
// TransactionMessage transactionMessage = new TransactionMessage();
// transactionMessage.setMessage(msg + "|" + orders.getOrderNo());
// transactionMessage.setQueue(sn);
// transactionMessage.setRouteKey(sn);
// try {
// log.info("打印小票 msg :{}", JSON.toJSONString(transactionMessage));
// mqpost(transactionMessage);
// } catch (IOException e) {
// log.error("收银端打印小票,mq消息推送失败!");
// e.printStackTrace();
// }
} }
} }
...@@ -861,7 +960,8 @@ public class WXController { ...@@ -861,7 +960,8 @@ public class WXController {
if ("APP".equals(orders.getPaas())) { if ("APP".equals(orders.getPaas())) {
String[] strs = msgInfo.split("\\|"); String[] strs = msgInfo.split("\\|");
if (strs.length >= 2) { if (strs.length >= 2) {
String msg = strs[strs.length - 3]; // String msg = strs[strs.length - 3];
String msg = strs[strs.length - 2];
String sn = strs[strs.length - 2]; String sn = strs[strs.length - 2];
TransactionMessage transactionMessage = new TransactionMessage(); TransactionMessage transactionMessage = new TransactionMessage();
transactionMessage.setMessage(msg + "|" + orders.getOrderNo()); transactionMessage.setMessage(msg + "|" + orders.getOrderNo());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment