提交代码

master
胡锐 12 months ago
parent 9b602015f5
commit 33dc227e46
  1. 1
      cweb/src/main/java/com/cweb/config/AuthConfig.java
  2. 3
      cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java
  3. 4
      cweb/src/main/java/com/cweb/controller/TestController.java
  4. 23
      cweb/src/main/java/com/cweb/controller/WechatController.java
  5. 70
      cweb/src/main/java/com/cweb/controller/meal/BsMealTableOrderController.java
  6. 181
      cweb/src/main/java/com/cweb/controller/meal/BsMealTableOrderPayController.java
  7. 6
      service/src/main/java/com/hfkj/channel/saas/utils/SaasCommon.java
  8. 3
      service/src/main/java/com/hfkj/config/CommonSysConfig.java
  9. 198
      service/src/main/java/com/hfkj/config/SpPrinterConfig.java
  10. 81
      service/src/main/java/com/hfkj/config/SpPrinterTemplate.java
  11. 32
      service/src/main/java/com/hfkj/config/WxMaConfig.java
  12. 19
      service/src/main/java/com/hfkj/dao/BsMealTableOrderChildMapper.java
  13. 14
      service/src/main/java/com/hfkj/dao/BsMealTableOrderChildSqlProvider.java
  14. 50
      service/src/main/java/com/hfkj/dao/BsMealTableOrderMapper.java
  15. 46
      service/src/main/java/com/hfkj/dao/BsMealTableOrderSqlProvider.java
  16. 48
      service/src/main/java/com/hfkj/entity/BsMealTableOrder.java
  17. 16
      service/src/main/java/com/hfkj/entity/BsMealTableOrderChild.java
  18. 70
      service/src/main/java/com/hfkj/entity/BsMealTableOrderChildExample.java
  19. 190
      service/src/main/java/com/hfkj/entity/BsMealTableOrderExample.java
  20. 3
      service/src/main/java/com/hfkj/service/BsTradeOrderService.java
  21. 28
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java
  22. 14
      service/src/main/java/com/hfkj/service/meal/BsMealTableOrderChildProductService.java
  23. 3
      service/src/main/java/com/hfkj/service/meal/BsMealTableOrderChildService.java
  24. 28
      service/src/main/java/com/hfkj/service/meal/BsMealTableOrderService.java
  25. 53
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableOrderChildProductServiceImpl.java
  26. 51
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableOrderChildServiceImpl.java
  27. 2
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableOrderProductServiceImpl.java
  28. 149
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableOrderServiceImpl.java
  29. 39
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableServiceImpl.java
  30. 1
      service/src/main/java/com/hfkj/sysenum/DeviceTypeEnum.java
  31. 51
      service/src/main/java/com/hfkj/sysenum/MealTableOrderPayStatusEnum.java
  32. 3
      service/src/main/java/com/hfkj/sysenum/TradeOrderCreateTypeEnum.java
  33. 16
      service/src/main/resources/dev/commonConfig.properties
  34. 6
      service/src/main/resources/prod-9606/commonConfig.properties
  35. 6
      service/src/main/resources/prod/commonConfig.properties

@ -125,6 +125,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/storeProductCategory/search") .excludePathPatterns("/storeProductCategory/search")
.excludePathPatterns("/mealTable/getTable") .excludePathPatterns("/mealTable/getTable")
.excludePathPatterns("/mealTableOrder/*") .excludePathPatterns("/mealTableOrder/*")
.excludePathPatterns("/mealTableOrderPay/*")
.excludePathPatterns("/ocr/*") .excludePathPatterns("/ocr/*")
.excludePathPatterns("/openGroup/*") .excludePathPatterns("/openGroup/*")
; ;

@ -184,7 +184,7 @@ public class BsTradeOrderController {
param.put("deviceId", device.getId()); param.put("deviceId", device.getId());
// 创建交易订单 // 创建交易订单
return ResponseMsgUtil.success(tradeOrderService.createOrder(store.getId(), body.getBigDecimal("totalAmount"),null,null, null, param, request)); return ResponseMsgUtil.success(tradeOrderService.createOrder(TradeOrderCreateTypeEnum.type2, store.getId(), body.getBigDecimal("totalAmount"),null,null, null, param, request));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
@ -289,6 +289,7 @@ public class BsTradeOrderController {
// 创建交易订单 // 创建交易订单
return ResponseMsgUtil.success(tradeOrderService.createOrder( return ResponseMsgUtil.success(tradeOrderService.createOrder(
TradeOrderCreateTypeEnum.type1,
store.getId(), store.getId(),
body.getBigDecimal("totalAmount"), body.getBigDecimal("totalAmount"),
storeDiscountActivity, storeDiscountActivity,

@ -605,10 +605,10 @@ public class TestController {
@ApiOperation(value = "saasActivity") @ApiOperation(value = "saasActivity")
public ResponseData saasActivity(@RequestParam(value = "code", required = false) String code) { public ResponseData saasActivity(@RequestParam(value = "code", required = false) String code) {
try { try {
// return ResponseMsgUtil.success(saasActivityService.queryAgentActivityStatus("193")); return ResponseMsgUtil.success(saasActivityService.queryAgentActivityStatus("193"));
// return ResponseMsgUtil.success(saasActivityService.agentRegisterActivity("193")); // return ResponseMsgUtil.success(saasActivityService.agentRegisterActivity("193"));
// return ResponseMsgUtil.success(saasActivityService.queryAgentActivityList()); // return ResponseMsgUtil.success(saasActivityService.queryAgentActivityList());
return ResponseMsgUtil.success(saasActivityService.referee("8226900542202CG")); // return ResponseMsgUtil.success(saasActivityService.queryCustomerRates("193", "8226900542202CG"));
// return ResponseMsgUtil.success(saasActivityService.queryCustomerActivityStatus("73", "8226900445800HB")); // return ResponseMsgUtil.success(saasActivityService.queryCustomerActivityStatus("73", "8226900445800HB"));
/*********** 活动报名 *************/ /*********** 活动报名 *************/

@ -1,11 +1,15 @@
package com.cweb.controller; package com.cweb.controller;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConst; import com.cweb.config.SysConst;
import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.WxMaConfig;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -37,4 +41,23 @@ public class WechatController {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
@RequestMapping(value = "/wxMiniHandleCode", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "微信小程序code解析")
public ResponseData wxMiniHandleCode(@RequestBody JSONObject body) {
try {
if (body == null|| StringUtils.isBlank(body.getString("code"))) {
log.error("LoginController --> phone() error!", "请求参数校验失败");
}
WxMaJscode2SessionResult session = WxMaConfig.getMaService().jsCode2SessionInfo(body.getString("code"));
//保存小程序用户登录的openId及sessionKey信息
JSONObject jo = new JSONObject();
jo.put("openId", session.getOpenid());
return ResponseMsgUtil.success(jo);
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
} }

@ -5,13 +5,12 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.SpPrinterTemplate;
import com.hfkj.entity.BsMealTableOrder; import com.hfkj.entity.BsMealTableOrder;
import com.hfkj.entity.BsMealTableOrderChildProduct;
import com.hfkj.entity.BsMealTableOrderProduct; import com.hfkj.entity.BsMealTableOrderProduct;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.service.meal.BsMealShopCartService; import com.hfkj.service.meal.*;
import com.hfkj.service.meal.BsMealTableOrderChildService;
import com.hfkj.service.meal.BsMealTableOrderProductService;
import com.hfkj.service.meal.BsMealTableOrderService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -44,6 +43,8 @@ public class BsMealTableOrderController {
private BsMealTableOrderService mealTableOrderService; private BsMealTableOrderService mealTableOrderService;
@Resource @Resource
private BsMealTableOrderProductService mealTableOrderProductService; private BsMealTableOrderProductService mealTableOrderProductService;
@Resource
private BsMealTableOrderChildProductService mealTableOrderChildProductService;
@RequestMapping(value="/createOrder",method = RequestMethod.POST) @RequestMapping(value="/createOrder",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ -54,7 +55,7 @@ public class BsMealTableOrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
mealTableOrderChildService.createChildOrder(body.getString("serialNumber"), body.getString("userIdentity")); mealTableOrderChildService.createChildOrder(body.getString("serialNumber"), body.getString("remark"), body.getString("userIdentity"));
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");
@ -64,15 +65,68 @@ public class BsMealTableOrderController {
} }
} }
@RequestMapping(value="/operateOrderProduct",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "操作订单产品")
public ResponseData operateOrderProduct(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("orderNo"))
|| body.getJSONArray("productArray") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
for (Object obj : body.getJSONArray("productArray")) {
JSONObject product = (JSONObject) obj;
if (product == null || product.getLong("productId") == null || product.getInteger("number") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
}
mealTableOrderService.operateOrderProduct(body.getString("orderNo"), body.getJSONArray("productArray"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryOrderDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询订单详情")
public ResponseData queryOrderDetail(@RequestParam(value = "orderNo" , required = true) String orderNo) {
try {
// 查询桌台当前订单
BsMealTableOrder tableOrder = mealTableOrderService.getTableOrderByOrderNo(orderNo);
if (tableOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");
}
Map<String, Object> map = new HashMap<>();
map.put("order", tableOrder);
Map<String,Object> param = new HashMap<>();
param.put("orderNo", tableOrder.getOrderNo());
map.put("product", mealTableOrderProductService.getOrderProductList(param));
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryCurrentOrder",method = RequestMethod.GET) @RequestMapping(value="/queryCurrentOrder",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询当前订单") @ApiOperation(value = "查询桌台当前订单")
public ResponseData queryCurrentOrder(@RequestParam(value = "serialNumber" , required = true) String serialNumber) { public ResponseData queryCurrentOrder(@RequestParam(value = "serialNumber" , required = true) String serialNumber) {
try { try {
// 查询桌台当前订单 // 查询桌台当前订单
BsMealTableOrder tableOrder = mealTableOrderService.getCurrentTableOrder(serialNumber); BsMealTableOrder tableOrder = mealTableOrderService.getCurrentTableOrder(serialNumber);
if (tableOrder == null) { if (tableOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当初桌台未开台"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当桌台未开台");
} }
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("order", tableOrder); map.put("order", tableOrder);
@ -87,6 +141,8 @@ public class BsMealTableOrderController {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }
} }

@ -0,0 +1,181 @@
package com.cweb.controller.meal;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.LaKaLaTradeService;
import com.hfkj.channel.tianque.service.TianQueTradeService;
import com.hfkj.common.exception.BaseException;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.service.BsMerPlatformNoService;
import com.hfkj.service.BsTradeOrderService;
import com.hfkj.service.meal.BsMealTableOrderService;
import com.hfkj.sysenum.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* @className: BsMealShopCartController
* @author: HuRui
* @date: 2023/11/30
**/
@Controller
@Api(value = "桌台订单管理")
@RequestMapping(value = "/mealTableOrderPay")
public class BsMealTableOrderPayController {
Logger log = LoggerFactory.getLogger(BsMealTableController.class);
@Resource
private BsTradeOrderService tradeOrderService;
@Resource
private BsMealTableOrderService mealTableOrderService;
@Resource
private BsMerPlatformNoService merPlatformNoService;
@Resource
private LaKaLaTradeService laKaLaTradeService;
@Resource
private TianQueTradeService tianQueTradeService;
@Autowired
private RedisTemplate redisTemplate;
@RequestMapping(value="/payOrder",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "支付订单")
public ResponseData payOrder(@RequestBody JSONObject body, HttpServletRequest request) {
try {
if (body == null || StringUtils.isBlank(body.getString("orderNo")) || StringUtils.isBlank(body.getString("payUserId"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 支付订单
BsMealTableOrder tableOrder = mealTableOrderService.getTableOrderByOrderNo(body.getString("orderNo"));
if (tableOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");
}
if (!tableOrder.getStatus().equals(MealTableOrderStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态异常");
}
if (!tableOrder.getPayStatus().equals(MealTableOrderPayStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "小伙伴正在支付中或已支付");
}
String lockKey = "MEAL_ORDER_PAY_" + tableOrder.getOrderNo();
try {
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null);
if(lock) {
// 加锁成功
// 查询交易渠道
BsMerPlatformNo merPlatform = merPlatformNoService.getCurrentPlatform(tableOrder.getMerId());
if (merPlatform == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知交易渠道");
}
Map<String, Object> param = new HashMap<>();
param.put("payMode", TradeOrderPayModeEnum.WECHAT.getCode());
param.put("payUserId", body.getString("payUserId"));
param.put("transType", "JSAPI");
param.put("sub_appid", "wxff3cbb14f62d026d");
// 创建订单
Map<String, Object> orderMap = tradeOrderService.createOrder(TradeOrderCreateTypeEnum.type4, tableOrder.getStoreId(), tableOrder.getOrderAmount(), null, null, null, param, request);
if (merPlatform.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
try {
Map<String, Object> order = laKaLaTradeService.preorder(MapUtils.getString(orderMap, "outTradeNo"));
System.out.println("返回参数:" + JSONObject.toJSONString(order));
if (StringUtils.isNotBlank(MapUtils.getString(order, "order"))) {
// 设置支付状态
tableOrder.setPayOrderNo(MapUtils.getString(orderMap, "outTradeNo"));
tableOrder.setPayStatus(MealTableOrderPayStatusEnum.status2.getNumber());
mealTableOrderService.editData(tableOrder);
redisTemplate.delete(lockKey);
return ResponseMsgUtil.success(order);
}
} catch (Exception e) {
log.error("拉卡拉支付失败", e.getMessage());
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage());
}
} else if (merPlatform.getPlatformType().equals(PlatformTypeEnum.type5.getNumber())) {
try {
Map<String, Object> order = tianQueTradeService.preorder(MapUtils.getString(orderMap, "outTradeNo"));
System.out.println("返回参数:" + JSONObject.toJSONString(order));
if (StringUtils.isNotBlank(MapUtils.getString(order, "order"))) {
// 设置支付状态
tableOrder.setPayOrderNo(MapUtils.getString(orderMap, "outTradeNo"));
tableOrder.setPayStatus(MealTableOrderPayStatusEnum.status2.getNumber());
mealTableOrderService.editData(tableOrder);
redisTemplate.delete(lockKey);
return ResponseMsgUtil.success(order);
}
} catch (Exception e) {
log.error("随行付支付失败", e.getMessage());
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage());
}
}
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "小伙伴正在支付中...");
}
} catch (BaseException baseException) {
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, baseException.getErrorMsg());
} catch (Exception e) {
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知错误");
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付失败");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/cancelPay",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "取消支付")
public ResponseData cancelPay(@RequestBody JSONObject body) {
try {
if (body == null || StringUtils.isBlank(body.getString("orderNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 支付订单
BsMealTableOrder tableOrder = mealTableOrderService.getTableOrderByOrderNo(body.getString("orderNo"));
if (tableOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");
}
if (tableOrder.getStatus().equals(MealTableOrderStatusEnum.status2.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "取消失败,订单已结账");
}
tableOrder.setPayOrderNo(null);
tableOrder.setPayStatus(MealTableOrderPayStatusEnum.status1.getNumber());
mealTableOrderService.editData(tableOrder);
return ResponseMsgUtil.success("取消成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -42,7 +42,7 @@ public class SaasCommon {
* @return * @return
*/ */
public Object getToken() { public Object getToken() {
try { /*try {
Object saasToken = redisUtil.get("SAAS_TOKEN"); Object saasToken = redisUtil.get("SAAS_TOKEN");
if (saasToken != null) { if (saasToken != null) {
return saasToken.toString(); return saasToken.toString();
@ -72,8 +72,8 @@ public class SaasCommon {
return null; return null;
} finally { } finally {
log.info("==============end 获取token end =============="); log.info("==============end 获取token end ==============");
} }*/
return null; return "b72a5b10-3440-460d-b3e0-f9deaa76a326";
} }
public Object getUpdateToken() { public Object getUpdateToken() {

@ -14,6 +14,9 @@ public class CommonSysConfig {
private String wechat_mp_appid; private String wechat_mp_appid;
private String wechat_mp_secret; private String wechat_mp_secret;
private String wechat_ma_appid;
private String wechat_ma_secret;
/** /**
* 华为云OBS桶名称 * 华为云OBS桶名称
*/ */

@ -0,0 +1,198 @@
package com.hfkj.config;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.*;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
/**
* 商鹏打印机
* @author hurui
*/
public class SpPrinterConfig {
public static final String baseUri = "https://open.spyun.net/v1/";
private String appid = "sp6284a57015d78";
private String appsecret = "2bdca1587ead21c0569e0ed1f82b19f6";
/* public SpPrinterConfig(String appid, String appsecret) {
this.appid = appid;
this.appsecret = appsecret;
}*/
// 添加打印机
public String addPrinter(String sn, String pkey, String name) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("sn", sn));
params.add(new BasicNameValuePair("pkey", pkey));
params.add(new BasicNameValuePair("name", name));
return request("POST", "printer/add", params);
}
// 删除打印机
public String deletePrinter(String sn) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("sn", sn));
return request("DELETE", "printer/delete", params);
}
// 修改打印机信息
public String updatePrinter(String sn, String name) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("sn", sn));
params.add(new BasicNameValuePair("name", name));
return request("PATCH", "printer/update", params);
}
// 修改打印机参数
public String updatePrinterSetting(String sn, int auto_cut, String voice) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("sn", sn));
params.add(new BasicNameValuePair("auto_cut", String.valueOf(auto_cut)));
params.add(new BasicNameValuePair("voice", voice));
return request("PATCH", "printer/setting", params);
}
// 获取打印机信息
public String getPrinter(String sn) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("sn", sn));
return request("GET", "printer/info", params);
}
// 打印订单
public String print(String sn, String content, int times) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("sn", sn));
params.add(new BasicNameValuePair("content", content));
params.add(new BasicNameValuePair("times", String.valueOf(times)));
return request("POST", "printer/print", params);
}
// 清空待打印订单
public String deletePrints(String sn) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("sn", sn));
return request("DELETE", "printer/cleansqs", params);
}
// 查询打印订单状态
public String getPrintsStatus(String id) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("id", id));
return request("GET", "printer/order/status", params);
}
// 查询打印机历史打印订单数
public String getPrintsOrders(String sn, String date) throws IOException {
ArrayList<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("sn", sn));
params.add(new BasicNameValuePair("date", date));
return request("GET", "printer/order/number", params);
}
// 发送请求
private String request(String method, String uri, ArrayList<NameValuePair> params) throws IOException {
RequestConfig requestConfig = RequestConfig.custom()
.setSocketTimeout(4000) //读取超时
.setConnectTimeout(1000) //连接超时
.build();
CloseableHttpClient httpClient = HttpClients.custom()
.setDefaultRequestConfig(requestConfig)
.build();
// 公共请求参数
params.add(new BasicNameValuePair("appid", appid));
params.add(new BasicNameValuePair("timestamp", String.valueOf(System.currentTimeMillis() / 1000)));
params.add(new BasicNameValuePair("sign", makeSign(params)));
CloseableHttpResponse response = null;
String url = baseUri + uri;
if (method.equals("GET")) {
HttpGet request = new HttpGet(url + "?" + URLEncodedUtils.format(params, "utf-8"));
response = httpClient.execute(request);
} else if (method.equals("DELETE")) {
HttpDelete request = new HttpDelete(url + "?" + URLEncodedUtils.format(params, "utf-8"));
response = httpClient.execute(request);
} else if (method.equals("POST")) {
HttpPost request = new HttpPost(url);
request.setEntity(new UrlEncodedFormEntity(params,"utf-8"));
response = httpClient.execute(request);
} else if (method.equals("PATCH")) {
HttpPatch request = new HttpPatch(url);
request.setEntity(new UrlEncodedFormEntity(params,"utf-8"));
response = httpClient.execute(request);
} else if (method.equals("PUT")) {
HttpPut request = new HttpPut(url);
request.setEntity(new UrlEncodedFormEntity(params,"utf-8"));
response = httpClient.execute(request);
}
if (response == null) {
throw new ClientProtocolException();
}
HttpEntity httpEntity = response.getEntity();
if (httpEntity == null) {
throw new ClientProtocolException();
}
/* if (response.getStatusLine().getStatusCode() != 200) {
throw new ClientProtocolException(EntityUtils.toString(httpEntity));
}*/
return EntityUtils.toString(httpEntity);
}
// 创建签名
public String makeSign(ArrayList<NameValuePair> params) {
int size = params.size();
String[] keys = new String[params.size()];
HashMap<String, String> values = new HashMap<>();
for (int i = 0; i < size; i++) {
NameValuePair p = params.get(i);
keys[i] = p.getName();
values.put(p.getName(), p.getValue());
}
Arrays.sort(keys);
String sign = "";
for (int i = 0; i < keys.length; i++) {
String v = values.get(keys[i]);
if (!keys[i].equals("sign") && !keys[i].equals("appsecret") && !v.equals("")) {
if (i > 0) {
sign += "&";
}
sign += keys[i] + "=" + v;
}
}
sign += "&appsecret=" + appsecret;
return DigestUtils.md5Hex(sign).toUpperCase();
}
}

@ -0,0 +1,81 @@
package com.hfkj.config;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.entity.BsMealTableOrder;
import com.hfkj.entity.BsMealTableOrderChild;
import com.hfkj.entity.BsMealTableOrderChildProduct;
import com.hfkj.entity.BsMealTableOrderProduct;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
import java.util.List;
/**
* 商鹏打印机模板
* @author hurui
*/
public class SpPrinterTemplate {
/**
* 扫码点餐点餐订单
* @param mealTableOrder 交易订单
* @param productList 产品列表
* @return
*/
public static String mealOrder(BsMealTableOrder mealTableOrder, BsMealTableOrderChild mealTableOrderChild,List<BsMealTableOrderChildProduct> productList) {
String str = "<C><L1>(点菜单)</L1></C>\n" +
"<C><L1>"+mealTableOrder.getTableName()+"</L1></C>\n" +
"订单号:"+mealTableOrder.getOrderNo() +"\n"+
"用餐人数:"+mealTableOrder.getPeopleNum()+"人\n" +
"================================\n" +
"品名 数量\n" +
"================================\n";
for (BsMealTableOrderChildProduct product : productList) {
str+=limitStr(13,product.getProductName())+" "+product.getProductNum()+"\n";
}
str+="================================\n" +
"备注:" + (mealTableOrderChild.getRemark()==null?"":mealTableOrderChild.getRemark())+"\n" +
"打印时间:" + DateUtil.date2String(new Date(), DateUtil.Y_M_D_HMS) +"\n";
return str;
}
/**
* 加油站客户存根模板
* @param mealTableOrder 交易订单
* @param productList 产品列表
* @return
*/
public static String mealOrderBill(BsMealTableOrder mealTableOrder,List<BsMealTableOrderProduct> productList) {
String str = "<C><L1>"+mealTableOrder.getStoreName()+"</L1></C>\n" +
"<C><L1>"+mealTableOrder.getTableName()+"</L1></C>\n" +
"订单号:"+mealTableOrder.getOrderNo() +"\n"+
"用餐人数:"+mealTableOrder.getPeopleNum()+"人\n" +
"开台时间:" + DateUtil.date2String(mealTableOrder.getCreateTime(), DateUtil.Y_M_D_HMS) +"\n"+
"打印时间:" + DateUtil.date2String(new Date(), DateUtil.Y_M_D_HMS) +"\n"+
"================================\n" +
"品名 数量 单价 金额\n" +
"================================\n";
for (BsMealTableOrderProduct product : productList) {
str+=limitStr(8,product.getProductName())+" "+product.getProductNum()+" "+product.getProductPrice()+" "+product.getProductTotalPrice()+"\n";
}
str+="================================\n" +
"<R>合计:"+mealTableOrder.getOrderAmount()+"元</R>\n" +
"--------------------------------\n" +
"<C>谢谢光临,欢迎下次惠顾!</C>\n";
return str;
}
private static String limitStr(int limit,String str) {
if (str.length() >= limit) {
return str.substring(0, limit-1);
}
// 补位长度
int repairLength = limit - str.length();
for (int i = 0; i < repairLength;i++) {
str+=" ";
}
return str;
}
}

@ -0,0 +1,32 @@
package com.hfkj.config;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
@Configuration
public class WxMaConfig {
private static WxMaService maService;
public static WxMaService getMaService() {
if (maService == null) {
throw new IllegalArgumentException(String.format("未找到对应的配置,请核实!"));
}
return maService;
}
@PostConstruct
public void init() {
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
config.setAppid(CommonSysConst.getSysConfig().getWechat_ma_appid());
config.setSecret(CommonSysConst.getSysConfig().getWechat_ma_secret());
maService = new WxMaServiceImpl();
maService.setWxMaConfig(config);
}
}

@ -45,18 +45,18 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
"serial_number, table_number, ", "serial_number, table_number, ",
"`table_name`, order_no, ", "`table_name`, order_no, ",
"child_order_no, child_order_amount, ", "child_order_no, child_order_amount, ",
"`status`, create_time, ", "remark, `status`, ",
"update_time, ext_1, ", "create_time, update_time, ",
"ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
"#{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ", "#{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ",
"#{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ", "#{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
"#{serialNumber,jdbcType=VARCHAR}, #{tableNumber,jdbcType=INTEGER}, ", "#{serialNumber,jdbcType=VARCHAR}, #{tableNumber,jdbcType=INTEGER}, ",
"#{tableName,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ", "#{tableName,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ",
"#{childOrderNo,jdbcType=VARCHAR}, #{childOrderAmount,jdbcType=DECIMAL}, ", "#{childOrderNo,jdbcType=VARCHAR}, #{childOrderAmount,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", "#{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMealTableOrderChild record); int insert(BsMealTableOrderChild record);
@ -80,6 +80,7 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_amount", property="childOrderAmount", jdbcType=JdbcType.DECIMAL), @Result(column="child_order_amount", property="childOrderAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@ -92,8 +93,8 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
@Select({ @Select({
"select", "select",
"id, mer_id, mer_no, mer_name, mer_abbreviate, store_id, store_name, serial_number, ", "id, mer_id, mer_no, mer_name, mer_abbreviate, store_id, store_name, serial_number, ",
"table_number, `table_name`, order_no, child_order_no, child_order_amount, `status`, ", "table_number, `table_name`, order_no, child_order_no, child_order_amount, remark, ",
"create_time, update_time, ext_1, ext_2, ext_3", "`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_meal_table_order_child", "from bs_meal_table_order_child",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -111,6 +112,7 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR), @Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="child_order_amount", property="childOrderAmount", jdbcType=JdbcType.DECIMAL), @Result(column="child_order_amount", property="childOrderAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@ -143,6 +145,7 @@ public interface BsMealTableOrderChildMapper extends BsMealTableOrderChildMapper
"order_no = #{orderNo,jdbcType=VARCHAR},", "order_no = #{orderNo,jdbcType=VARCHAR},",
"child_order_no = #{childOrderNo,jdbcType=VARCHAR},", "child_order_no = #{childOrderNo,jdbcType=VARCHAR},",
"child_order_amount = #{childOrderAmount,jdbcType=DECIMAL},", "child_order_amount = #{childOrderAmount,jdbcType=DECIMAL},",
"remark = #{remark,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},", "`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},", "create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},",

@ -76,6 +76,10 @@ public class BsMealTableOrderChildSqlProvider {
sql.VALUES("child_order_amount", "#{childOrderAmount,jdbcType=DECIMAL}"); sql.VALUES("child_order_amount", "#{childOrderAmount,jdbcType=DECIMAL}");
} }
if (record.getRemark() != null) {
sql.VALUES("remark", "#{remark,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) { if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
} }
@ -122,6 +126,7 @@ public class BsMealTableOrderChildSqlProvider {
sql.SELECT("order_no"); sql.SELECT("order_no");
sql.SELECT("child_order_no"); sql.SELECT("child_order_no");
sql.SELECT("child_order_amount"); sql.SELECT("child_order_amount");
sql.SELECT("remark");
sql.SELECT("`status`"); sql.SELECT("`status`");
sql.SELECT("create_time"); sql.SELECT("create_time");
sql.SELECT("update_time"); sql.SELECT("update_time");
@ -197,6 +202,10 @@ public class BsMealTableOrderChildSqlProvider {
sql.SET("child_order_amount = #{record.childOrderAmount,jdbcType=DECIMAL}"); sql.SET("child_order_amount = #{record.childOrderAmount,jdbcType=DECIMAL}");
} }
if (record.getRemark() != null) {
sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) { if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
} }
@ -242,6 +251,7 @@ public class BsMealTableOrderChildSqlProvider {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}"); sql.SET("child_order_no = #{record.childOrderNo,jdbcType=VARCHAR}");
sql.SET("child_order_amount = #{record.childOrderAmount,jdbcType=DECIMAL}"); sql.SET("child_order_amount = #{record.childOrderAmount,jdbcType=DECIMAL}");
sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
@ -306,6 +316,10 @@ public class BsMealTableOrderChildSqlProvider {
sql.SET("child_order_amount = #{childOrderAmount,jdbcType=DECIMAL}"); sql.SET("child_order_amount = #{childOrderAmount,jdbcType=DECIMAL}");
} }
if (record.getRemark() != null) {
sql.SET("remark = #{remark,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) { if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}"); sql.SET("`status` = #{status,jdbcType=INTEGER}");
} }

@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider; import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider; import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Results;
@ -38,30 +39,34 @@ public interface BsMealTableOrderMapper extends BsMealTableOrderMapperExt {
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
@Insert({ @Insert({
"insert into bs_meal_table_order (id, mer_id, ", "insert into bs_meal_table_order (mer_id, mer_no, ",
"mer_no, mer_name, ", "mer_name, mer_abbreviate, ",
"mer_abbreviate, store_id, ", "store_id, store_name, ",
"store_name, serial_number, ", "serial_number, table_number, ",
"table_number, `table_name`, ", "`table_name`, people_num, ",
"people_num, order_no, ", "order_no, order_amount, ",
"order_amount, `status`, ", "`status`, pay_status, ",
"pay_time, create_time, ", "pay_time, pay_order_no, ",
"pay_price, create_time, ",
"update_time, ext_1, ", "update_time, ext_1, ",
"ext_2, ext_3)", "ext_2, ext_3)",
"values (#{id,jdbcType=BIGINT}, #{merId,jdbcType=BIGINT}, ", "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
"#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ", "#{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ",
"#{merAbbreviate,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ", "#{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
"#{storeName,jdbcType=VARCHAR}, #{serialNumber,jdbcType=VARCHAR}, ", "#{serialNumber,jdbcType=VARCHAR}, #{tableNumber,jdbcType=INTEGER}, ",
"#{tableNumber,jdbcType=INTEGER}, #{tableName,jdbcType=VARCHAR}, ", "#{tableName,jdbcType=VARCHAR}, #{peopleNum,jdbcType=INTEGER}, ",
"#{peopleNum,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, ", "#{orderNo,jdbcType=VARCHAR}, #{orderAmount,jdbcType=DECIMAL}, ",
"#{orderAmount,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ", "#{status,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ", "#{payTime,jdbcType=TIMESTAMP}, #{payOrderNo,jdbcType=VARCHAR}, ",
"#{payPrice,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMealTableOrder record); int insert(BsMealTableOrder record);
@InsertProvider(type=BsMealTableOrderSqlProvider.class, method="insertSelective") @InsertProvider(type=BsMealTableOrderSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMealTableOrder record); int insertSelective(BsMealTableOrder record);
@SelectProvider(type=BsMealTableOrderSqlProvider.class, method="selectByExample") @SelectProvider(type=BsMealTableOrderSqlProvider.class, method="selectByExample")
@ -80,7 +85,10 @@ public interface BsMealTableOrderMapper extends BsMealTableOrderMapperExt {
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_amount", property="orderAmount", jdbcType=JdbcType.DECIMAL), @Result(column="order_amount", property="orderAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_order_no", property="payOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -92,8 +100,8 @@ public interface BsMealTableOrderMapper extends BsMealTableOrderMapperExt {
@Select({ @Select({
"select", "select",
"id, mer_id, mer_no, mer_name, mer_abbreviate, store_id, store_name, serial_number, ", "id, mer_id, mer_no, mer_name, mer_abbreviate, store_id, store_name, serial_number, ",
"table_number, `table_name`, people_num, order_no, order_amount, `status`, pay_time, ", "table_number, `table_name`, people_num, order_no, order_amount, `status`, pay_status, ",
"create_time, update_time, ext_1, ext_2, ext_3", "pay_time, pay_order_no, pay_price, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_meal_table_order", "from bs_meal_table_order",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -112,7 +120,10 @@ public interface BsMealTableOrderMapper extends BsMealTableOrderMapperExt {
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_amount", property="orderAmount", jdbcType=JdbcType.DECIMAL), @Result(column="order_amount", property="orderAmount", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
@Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="pay_order_no", property="payOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -145,7 +156,10 @@ public interface BsMealTableOrderMapper extends BsMealTableOrderMapperExt {
"order_no = #{orderNo,jdbcType=VARCHAR},", "order_no = #{orderNo,jdbcType=VARCHAR},",
"order_amount = #{orderAmount,jdbcType=DECIMAL},", "order_amount = #{orderAmount,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},", "`status` = #{status,jdbcType=INTEGER},",
"pay_status = #{payStatus,jdbcType=INTEGER},",
"pay_time = #{payTime,jdbcType=TIMESTAMP},", "pay_time = #{payTime,jdbcType=TIMESTAMP},",
"pay_order_no = #{payOrderNo,jdbcType=VARCHAR},",
"pay_price = #{payPrice,jdbcType=DECIMAL},",
"create_time = #{createTime,jdbcType=TIMESTAMP},", "create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_1 = #{ext1,jdbcType=VARCHAR},",

@ -28,10 +28,6 @@ public class BsMealTableOrderSqlProvider {
SQL sql = new SQL(); SQL sql = new SQL();
sql.INSERT_INTO("bs_meal_table_order"); sql.INSERT_INTO("bs_meal_table_order");
if (record.getId() != null) {
sql.VALUES("id", "#{id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) { if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
} }
@ -84,10 +80,22 @@ public class BsMealTableOrderSqlProvider {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
} }
if (record.getPayStatus() != null) {
sql.VALUES("pay_status", "#{payStatus,jdbcType=INTEGER}");
}
if (record.getPayTime() != null) { if (record.getPayTime() != null) {
sql.VALUES("pay_time", "#{payTime,jdbcType=TIMESTAMP}"); sql.VALUES("pay_time", "#{payTime,jdbcType=TIMESTAMP}");
} }
if (record.getPayOrderNo() != null) {
sql.VALUES("pay_order_no", "#{payOrderNo,jdbcType=VARCHAR}");
}
if (record.getPayPrice() != null) {
sql.VALUES("pay_price", "#{payPrice,jdbcType=DECIMAL}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
} }
@ -131,7 +139,10 @@ public class BsMealTableOrderSqlProvider {
sql.SELECT("order_no"); sql.SELECT("order_no");
sql.SELECT("order_amount"); sql.SELECT("order_amount");
sql.SELECT("`status`"); sql.SELECT("`status`");
sql.SELECT("pay_status");
sql.SELECT("pay_time"); sql.SELECT("pay_time");
sql.SELECT("pay_order_no");
sql.SELECT("pay_price");
sql.SELECT("create_time"); sql.SELECT("create_time");
sql.SELECT("update_time"); sql.SELECT("update_time");
sql.SELECT("ext_1"); sql.SELECT("ext_1");
@ -210,10 +221,22 @@ public class BsMealTableOrderSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
} }
if (record.getPayStatus() != null) {
sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}");
}
if (record.getPayTime() != null) { if (record.getPayTime() != null) {
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}");
} }
if (record.getPayOrderNo() != null) {
sql.SET("pay_order_no = #{record.payOrderNo,jdbcType=VARCHAR}");
}
if (record.getPayPrice() != null) {
sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
} }
@ -256,7 +279,10 @@ public class BsMealTableOrderSqlProvider {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("order_amount = #{record.orderAmount,jdbcType=DECIMAL}"); sql.SET("order_amount = #{record.orderAmount,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}");
sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}");
sql.SET("pay_order_no = #{record.payOrderNo,jdbcType=VARCHAR}");
sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
@ -324,10 +350,22 @@ public class BsMealTableOrderSqlProvider {
sql.SET("`status` = #{status,jdbcType=INTEGER}"); sql.SET("`status` = #{status,jdbcType=INTEGER}");
} }
if (record.getPayStatus() != null) {
sql.SET("pay_status = #{payStatus,jdbcType=INTEGER}");
}
if (record.getPayTime() != null) { if (record.getPayTime() != null) {
sql.SET("pay_time = #{payTime,jdbcType=TIMESTAMP}"); sql.SET("pay_time = #{payTime,jdbcType=TIMESTAMP}");
} }
if (record.getPayOrderNo() != null) {
sql.SET("pay_order_no = #{payOrderNo,jdbcType=VARCHAR}");
}
if (record.getPayPrice() != null) {
sql.SET("pay_price = #{payPrice,jdbcType=DECIMAL}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
} }

@ -81,11 +81,26 @@ public class BsMealTableOrder implements Serializable {
*/ */
private Integer status; private Integer status;
/**
* 支付状态 1未支付 2支付中 3支付成功
*/
private Integer payStatus;
/** /**
* 支付时间 * 支付时间
*/ */
private Date payTime; private Date payTime;
/**
* 支付订单号
*/
private String payOrderNo;
/**
* 支付金额
*/
private BigDecimal payPrice;
/** /**
* 创建时间 * 创建时间
*/ */
@ -216,6 +231,14 @@ public class BsMealTableOrder implements Serializable {
this.status = status; this.status = status;
} }
public Integer getPayStatus() {
return payStatus;
}
public void setPayStatus(Integer payStatus) {
this.payStatus = payStatus;
}
public Date getPayTime() { public Date getPayTime() {
return payTime; return payTime;
} }
@ -224,6 +247,22 @@ public class BsMealTableOrder implements Serializable {
this.payTime = payTime; this.payTime = payTime;
} }
public String getPayOrderNo() {
return payOrderNo;
}
public void setPayOrderNo(String payOrderNo) {
this.payOrderNo = payOrderNo;
}
public BigDecimal getPayPrice() {
return payPrice;
}
public void setPayPrice(BigDecimal payPrice) {
this.payPrice = payPrice;
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
@ -290,7 +329,10 @@ public class BsMealTableOrder implements Serializable {
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getOrderAmount() == null ? other.getOrderAmount() == null : this.getOrderAmount().equals(other.getOrderAmount())) && (this.getOrderAmount() == null ? other.getOrderAmount() == null : this.getOrderAmount().equals(other.getOrderAmount()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals(other.getPayStatus()))
&& (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime())) && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
&& (this.getPayOrderNo() == null ? other.getPayOrderNo() == null : this.getPayOrderNo().equals(other.getPayOrderNo()))
&& (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
@ -316,7 +358,10 @@ public class BsMealTableOrder implements Serializable {
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getOrderAmount() == null) ? 0 : getOrderAmount().hashCode()); result = prime * result + ((getOrderAmount() == null) ? 0 : getOrderAmount().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode());
result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode()); result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
result = prime * result + ((getPayOrderNo() == null) ? 0 : getPayOrderNo().hashCode());
result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
@ -345,7 +390,10 @@ public class BsMealTableOrder implements Serializable {
sb.append(", orderNo=").append(orderNo); sb.append(", orderNo=").append(orderNo);
sb.append(", orderAmount=").append(orderAmount); sb.append(", orderAmount=").append(orderAmount);
sb.append(", status=").append(status); sb.append(", status=").append(status);
sb.append(", payStatus=").append(payStatus);
sb.append(", payTime=").append(payTime); sb.append(", payTime=").append(payTime);
sb.append(", payOrderNo=").append(payOrderNo);
sb.append(", payPrice=").append(payPrice);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1); sb.append(", ext1=").append(ext1);

@ -76,6 +76,11 @@ public class BsMealTableOrderChild implements Serializable {
*/ */
private BigDecimal childOrderAmount; private BigDecimal childOrderAmount;
/**
* 备注
*/
private String remark;
/** /**
* 状态 0不可用 1未结账 2已结账 * 状态 0不可用 1未结账 2已结账
*/ */
@ -203,6 +208,14 @@ public class BsMealTableOrderChild implements Serializable {
this.childOrderAmount = childOrderAmount; this.childOrderAmount = childOrderAmount;
} }
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Integer getStatus() { public Integer getStatus() {
return status; return status;
} }
@ -276,6 +289,7 @@ public class BsMealTableOrderChild implements Serializable {
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getChildOrderNo() == null ? other.getChildOrderNo() == null : this.getChildOrderNo().equals(other.getChildOrderNo())) && (this.getChildOrderNo() == null ? other.getChildOrderNo() == null : this.getChildOrderNo().equals(other.getChildOrderNo()))
&& (this.getChildOrderAmount() == null ? other.getChildOrderAmount() == null : this.getChildOrderAmount().equals(other.getChildOrderAmount())) && (this.getChildOrderAmount() == null ? other.getChildOrderAmount() == null : this.getChildOrderAmount().equals(other.getChildOrderAmount()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
@ -301,6 +315,7 @@ public class BsMealTableOrderChild implements Serializable {
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getChildOrderNo() == null) ? 0 : getChildOrderNo().hashCode()); result = prime * result + ((getChildOrderNo() == null) ? 0 : getChildOrderNo().hashCode());
result = prime * result + ((getChildOrderAmount() == null) ? 0 : getChildOrderAmount().hashCode()); result = prime * result + ((getChildOrderAmount() == null) ? 0 : getChildOrderAmount().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
@ -329,6 +344,7 @@ public class BsMealTableOrderChild implements Serializable {
sb.append(", orderNo=").append(orderNo); sb.append(", orderNo=").append(orderNo);
sb.append(", childOrderNo=").append(childOrderNo); sb.append(", childOrderNo=").append(childOrderNo);
sb.append(", childOrderAmount=").append(childOrderAmount); sb.append(", childOrderAmount=").append(childOrderAmount);
sb.append(", remark=").append(remark);
sb.append(", status=").append(status); sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);

@ -986,6 +986,76 @@ public class BsMealTableOrderChildExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andStatusIsNull() { public Criteria andStatusIsNull() {
addCriterion("`status` is null"); addCriterion("`status` is null");
return (Criteria) this; return (Criteria) this;

@ -1036,6 +1036,66 @@ public class BsMealTableOrderExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPayStatusIsNull() {
addCriterion("pay_status is null");
return (Criteria) this;
}
public Criteria andPayStatusIsNotNull() {
addCriterion("pay_status is not null");
return (Criteria) this;
}
public Criteria andPayStatusEqualTo(Integer value) {
addCriterion("pay_status =", value, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusNotEqualTo(Integer value) {
addCriterion("pay_status <>", value, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusGreaterThan(Integer value) {
addCriterion("pay_status >", value, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("pay_status >=", value, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusLessThan(Integer value) {
addCriterion("pay_status <", value, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusLessThanOrEqualTo(Integer value) {
addCriterion("pay_status <=", value, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusIn(List<Integer> values) {
addCriterion("pay_status in", values, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusNotIn(List<Integer> values) {
addCriterion("pay_status not in", values, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusBetween(Integer value1, Integer value2) {
addCriterion("pay_status between", value1, value2, "payStatus");
return (Criteria) this;
}
public Criteria andPayStatusNotBetween(Integer value1, Integer value2) {
addCriterion("pay_status not between", value1, value2, "payStatus");
return (Criteria) this;
}
public Criteria andPayTimeIsNull() { public Criteria andPayTimeIsNull() {
addCriterion("pay_time is null"); addCriterion("pay_time is null");
return (Criteria) this; return (Criteria) this;
@ -1096,6 +1156,136 @@ public class BsMealTableOrderExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPayOrderNoIsNull() {
addCriterion("pay_order_no is null");
return (Criteria) this;
}
public Criteria andPayOrderNoIsNotNull() {
addCriterion("pay_order_no is not null");
return (Criteria) this;
}
public Criteria andPayOrderNoEqualTo(String value) {
addCriterion("pay_order_no =", value, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoNotEqualTo(String value) {
addCriterion("pay_order_no <>", value, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoGreaterThan(String value) {
addCriterion("pay_order_no >", value, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoGreaterThanOrEqualTo(String value) {
addCriterion("pay_order_no >=", value, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoLessThan(String value) {
addCriterion("pay_order_no <", value, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoLessThanOrEqualTo(String value) {
addCriterion("pay_order_no <=", value, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoLike(String value) {
addCriterion("pay_order_no like", value, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoNotLike(String value) {
addCriterion("pay_order_no not like", value, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoIn(List<String> values) {
addCriterion("pay_order_no in", values, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoNotIn(List<String> values) {
addCriterion("pay_order_no not in", values, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoBetween(String value1, String value2) {
addCriterion("pay_order_no between", value1, value2, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayOrderNoNotBetween(String value1, String value2) {
addCriterion("pay_order_no not between", value1, value2, "payOrderNo");
return (Criteria) this;
}
public Criteria andPayPriceIsNull() {
addCriterion("pay_price is null");
return (Criteria) this;
}
public Criteria andPayPriceIsNotNull() {
addCriterion("pay_price is not null");
return (Criteria) this;
}
public Criteria andPayPriceEqualTo(BigDecimal value) {
addCriterion("pay_price =", value, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceNotEqualTo(BigDecimal value) {
addCriterion("pay_price <>", value, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceGreaterThan(BigDecimal value) {
addCriterion("pay_price >", value, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("pay_price >=", value, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceLessThan(BigDecimal value) {
addCriterion("pay_price <", value, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("pay_price <=", value, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceIn(List<BigDecimal> values) {
addCriterion("pay_price in", values, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceNotIn(List<BigDecimal> values) {
addCriterion("pay_price not in", values, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("pay_price between", value1, value2, "payPrice");
return (Criteria) this;
}
public Criteria andPayPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("pay_price not between", value1, value2, "payPrice");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;

@ -4,6 +4,7 @@ import com.hfkj.entity.BsStoreDiscountActivity;
import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrder;
import com.hfkj.model.UserDiscount; import com.hfkj.model.UserDiscount;
import com.hfkj.sysenum.PlatformTypeEnum; import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.TradeOrderCreateTypeEnum;
import com.hfkj.sysenum.TradeOrderMsgTypeEnum; import com.hfkj.sysenum.TradeOrderMsgTypeEnum;
import com.hfkj.sysenum.TradeOrderPayModeEnum; import com.hfkj.sysenum.TradeOrderPayModeEnum;
@ -31,7 +32,7 @@ public interface BsTradeOrderService {
* @param tradeAmount 交易金额 * @param tradeAmount 交易金额
* @param param 其他参数 * @param param 其他参数
*/ */
Map<String, Object> createOrder(Long storeId, BigDecimal tradeAmount, BsStoreDiscountActivity storeDiscount, String userPhone, UserDiscount userDiscount, Map<String, Object> param, HttpServletRequest request); Map<String, Object> createOrder(TradeOrderCreateTypeEnum createType, Long storeId, BigDecimal tradeAmount, BsStoreDiscountActivity storeDiscount, String userPhone, UserDiscount userDiscount, Map<String, Object> param, HttpServletRequest request);
/** /**
* 取消订单 * 取消订单

@ -17,6 +17,7 @@ import com.hfkj.dao.BsTradeOrderMapper;
import com.hfkj.entity.*; import com.hfkj.entity.*;
import com.hfkj.model.UserDiscount; import com.hfkj.model.UserDiscount;
import com.hfkj.service.*; import com.hfkj.service.*;
import com.hfkj.service.meal.BsMealTableOrderService;
import com.hfkj.service.rebate.BsRebateActivityAccountService; import com.hfkj.service.rebate.BsRebateActivityAccountService;
import com.hfkj.service.rebate.BsRebateActivityService; import com.hfkj.service.rebate.BsRebateActivityService;
import com.hfkj.service.rebate.model.RebateActivityAccountTradeObject; import com.hfkj.service.rebate.model.RebateActivityAccountTradeObject;
@ -39,9 +40,6 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
@Resource @Resource
private BsMerService merService; private BsMerService merService;
@Resource
private BsSalesmanService salesmanService;
@Resource @Resource
private BsStoreCidService bsStoreCidService; private BsStoreCidService bsStoreCidService;
@ -69,6 +67,10 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@Resource
private BsMealTableOrderService mealTableOrderService;
private final static String TRADE_ORDER = "TRADE_ORDER:"; private final static String TRADE_ORDER = "TRADE_ORDER:";
@Override @Override
@ -86,7 +88,7 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
} }
@Override @Override
public Map<String, Object> createOrder(Long storeId, BigDecimal tradeAmount, BsStoreDiscountActivity storeDiscount, String userPhone, UserDiscount userDiscount, Map<String, Object> param, HttpServletRequest request) { public Map<String, Object> createOrder(TradeOrderCreateTypeEnum createType, Long storeId, BigDecimal tradeAmount, BsStoreDiscountActivity storeDiscount, String userPhone, UserDiscount userDiscount, Map<String, Object> param, HttpServletRequest request) {
// 查询门店信息 // 查询门店信息
BsStore store = storeService.getStoreById(storeId); BsStore store = storeService.getStoreById(storeId);
if (store == null) { if (store == null) {
@ -105,7 +107,7 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
} }
BsTradeOrder tradeOrder = new BsTradeOrder(); BsTradeOrder tradeOrder = new BsTradeOrder();
tradeOrder.setCreateType(TradeOrderCreateTypeEnum.type1.getCode()); tradeOrder.setCreateType(createType.getCode());
tradeOrder.setCompanyId(mer.getCompanyId()); tradeOrder.setCompanyId(mer.getCompanyId());
tradeOrder.setAgentId(mer.getAgentId()); tradeOrder.setAgentId(mer.getAgentId());
tradeOrder.setSalesmanId(mer.getSalesmanId()); tradeOrder.setSalesmanId(mer.getSalesmanId());
@ -221,6 +223,15 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
tradeOrder.setTransType(MapUtils.getString(param, "transType")); tradeOrder.setTransType(MapUtils.getString(param, "transType"));
} }
if (StringUtils.isNotBlank(MapUtils.getString(param, "payNotifyUrl"))) {
tradeOrder.setPayNotifyUrl(MapUtils.getString(param, "payNotifyUrl"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "sub_appid"))) {
tradeOrder.setPayAppid(MapUtils.getString(param, "sub_appid"));
}
editOrder(tradeOrder); editOrder(tradeOrder);
@ -447,6 +458,11 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
soundService.sendPayMsg(device.getDeviceNo(), tradeOrder.getTradeAmount()); soundService.sendPayMsg(device.getDeviceNo(), tradeOrder.getTradeAmount());
} }
// 处理不同类型的业务
if (tradeOrder.getCreateType().equals(TradeOrderCreateTypeEnum.type4.getCode())) {
mealTableOrderService.paySuccess(tradeOrder);
}
if (tradeOrder.getStoreDiscountId() != null && StringUtils.isNotBlank(tradeOrder.getUserPhone())) { if (tradeOrder.getStoreDiscountId() != null && StringUtils.isNotBlank(tradeOrder.getUserPhone())) {
// 支付返积分 // 支付返积分
HsgIntegralService.rebate(RebateProductTypeEnum.type2, HsgIntegralService.rebate(RebateProductTypeEnum.type2,
@ -480,8 +496,8 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
tradeOrder.getCreateTime()); tradeOrder.getCreateTime());
} }
// APP消息
JSONObject objectPush = new JSONObject(); JSONObject objectPush = new JSONObject();
objectPush.put("storeId" , tradeOrder.getStoreId()); objectPush.put("storeId" , tradeOrder.getStoreId());
objectPush.put("price" , tradeOrder.getTradeAmount()); objectPush.put("price" , tradeOrder.getTradeAmount());
bsStoreCidService.storePush(objectPush); bsStoreCidService.storePush(objectPush);

@ -1,6 +1,9 @@
package com.hfkj.service.meal; package com.hfkj.service.meal;
import com.hfkj.entity.BsMealTableOrderChild; import com.hfkj.entity.BsMealTableOrderChildProduct;
import java.util.List;
import java.util.Map;
/** /**
* @className: BsMealTableOrderChildProductService * @className: BsMealTableOrderChildProductService
@ -13,6 +16,13 @@ public interface BsMealTableOrderChildProductService {
* 编辑数据 * 编辑数据
* @param data * @param data
*/ */
void editData(BsMealTableOrderChild data); void editData(BsMealTableOrderChildProduct data);
/**
* 查询产品列表
* @param param
* @return
*/
List<BsMealTableOrderChildProduct> getProductList(Map<String,Object> param);
} }

@ -25,7 +25,6 @@ public interface BsMealTableOrderChildService {
* @param userIdentity * @param userIdentity
* @return * @return
*/ */
void createChildOrder(String serialNumber, String userIdentity); void createChildOrder(String serialNumber, String remark, String userIdentity);
} }

@ -1,6 +1,8 @@
package com.hfkj.service.meal; package com.hfkj.service.meal;
import com.alibaba.fastjson.JSONArray;
import com.hfkj.entity.BsMealTableOrder; import com.hfkj.entity.BsMealTableOrder;
import com.hfkj.entity.BsTradeOrder;
/** /**
* @className: BsMealTableOrderService * @className: BsMealTableOrderService
@ -22,4 +24,30 @@ public interface BsMealTableOrderService {
*/ */
BsMealTableOrder getCurrentTableOrder(String serialNumber); BsMealTableOrder getCurrentTableOrder(String serialNumber);
/**
* 查询订单
* @param orderNo
* @return
*/
BsMealTableOrder getTableOrderByOrderNo(String orderNo);
/**
* 查询订单
* @param payOrderNo
* @return
*/
BsMealTableOrder getTableOrderByPayOrderNo(String payOrderNo);
/**
* 支付成功
* @param tradeOrder
*/
void paySuccess(BsTradeOrder tradeOrder);
/**
* 操作订单产品
* @param orderNo
* @param productArray
*/
void operateOrderProduct(String orderNo, JSONArray productArray);
} }

@ -0,0 +1,53 @@
package com.hfkj.service.meal.impl;
import com.hfkj.dao.BsMealTableOrderChildMapper;
import com.hfkj.dao.BsMealTableOrderChildProductMapper;
import com.hfkj.entity.BsMealTableOrderChild;
import com.hfkj.entity.BsMealTableOrderChildProduct;
import com.hfkj.entity.BsMealTableOrderChildProductExample;
import com.hfkj.service.meal.BsMealTableOrderChildProductService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @className: BsMealTableOrderChildProductServiceImpl
* @author: HuRui
* @date: 2023/12/11
**/
@Service("mealTableOrderChildProductService")
public class BsMealTableOrderChildProductServiceImpl implements BsMealTableOrderChildProductService {
@Resource
private BsMealTableOrderChildProductMapper mealTableOrderChildProductMapper;
@Override
public void editData(BsMealTableOrderChildProduct data) {
if (data.getId() == null) {
data.setCreateTime(new Date());
data.setUpdateTime(new Date());
mealTableOrderChildProductMapper.insert(data);
} else {
data.setUpdateTime(new Date());
mealTableOrderChildProductMapper.updateByPrimaryKeySelective(data);
}
}
@Override
public List<BsMealTableOrderChildProduct> getProductList(Map<String, Object> param) {
BsMealTableOrderChildProductExample example = new BsMealTableOrderChildProductExample();
BsMealTableOrderChildProductExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(MapUtils.getString(param, "childOrderNo"))) {
criteria.andChildOrderNoEqualTo(MapUtils.getString(param, "childOrderNo"));
}
example.setOrderByClause("create_time desc");
return mealTableOrderChildProductMapper.selectByExample(example);
}
}

@ -7,6 +7,8 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.GenerateUtil; import com.hfkj.common.utils.GenerateUtil;
import com.hfkj.config.SpPrinterConfig;
import com.hfkj.config.SpPrinterTemplate;
import com.hfkj.config.mqtt.MqttProviderService; import com.hfkj.config.mqtt.MqttProviderService;
import com.hfkj.dao.BsMealTableOrderChildMapper; import com.hfkj.dao.BsMealTableOrderChildMapper;
import com.hfkj.dao.BsMealTableOrderChildProductMapper; import com.hfkj.dao.BsMealTableOrderChildProductMapper;
@ -15,6 +17,7 @@ import com.hfkj.entity.*;
import com.hfkj.service.BsDeviceService; import com.hfkj.service.BsDeviceService;
import com.hfkj.service.group.BsStoreGroupService; import com.hfkj.service.group.BsStoreGroupService;
import com.hfkj.service.meal.*; import com.hfkj.service.meal.*;
import com.hfkj.sysenum.DeviceTypeEnum;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@ -73,17 +76,17 @@ public class BsMealTableOrderChildServiceImpl implements BsMealTableOrderChildSe
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW) @Transactional(propagation= Propagation.REQUIRES_NEW)
public void createChildOrder(String serialNumber, String userIdentity) { public void createChildOrder(String serialNumber, String remark, String userIdentity) {
String lockKey = "MEAL_SHOP_CART_" + serialNumber;
try {
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null);
if(lock) {
// 加锁成功
// 查询当前开台订单 // 查询当前开台订单
BsMealTableOrder tableOrder = mealTableOrderService.getCurrentTableOrder(serialNumber); BsMealTableOrder tableOrder = mealTableOrderService.getCurrentTableOrder(serialNumber);
if (tableOrder == null) { if (tableOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "桌台未开台,订单创建失败!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "桌台未开台,订单创建失败!");
} }
String lockKey = "MEAL_ORDER_" + tableOrder.getOrderNo();
try {
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null);
if(lock) {
// 加锁成功
BsMealTableOrderChild tableOrderChild = new BsMealTableOrderChild(); BsMealTableOrderChild tableOrderChild = new BsMealTableOrderChild();
tableOrderChild.setMerId(tableOrder.getMerId()); tableOrderChild.setMerId(tableOrder.getMerId());
tableOrderChild.setMerNo(tableOrder.getMerNo()); tableOrderChild.setMerNo(tableOrder.getMerNo());
@ -98,6 +101,7 @@ public class BsMealTableOrderChildServiceImpl implements BsMealTableOrderChildSe
tableOrderChild.setChildOrderNo(System.currentTimeMillis()+ GenerateUtil.generateRandomString(1)); tableOrderChild.setChildOrderNo(System.currentTimeMillis()+ GenerateUtil.generateRandomString(1));
tableOrderChild.setChildOrderAmount(new BigDecimal("0")); tableOrderChild.setChildOrderAmount(new BigDecimal("0"));
tableOrderChild.setStatus(1); tableOrderChild.setStatus(1);
tableOrderChild.setRemark(remark);
editData(tableOrderChild); editData(tableOrderChild);
List<BsMealTableOrderChildProduct> childProductList = new ArrayList<>(); List<BsMealTableOrderChildProduct> childProductList = new ArrayList<>();
@ -115,11 +119,11 @@ public class BsMealTableOrderChildServiceImpl implements BsMealTableOrderChildSe
BsMealTableOrderProduct orderProduct = mealTableOrderProductService.getOrderProduct(tableOrder.getOrderNo(), cartProduct.getProductId()); BsMealTableOrderProduct orderProduct = mealTableOrderProductService.getOrderProduct(tableOrder.getOrderNo(), cartProduct.getProductId());
if (orderProduct == null) { if (orderProduct == null) {
orderProduct = new BsMealTableOrderProduct(); orderProduct = new BsMealTableOrderProduct();
orderProduct.setOrderId(tableOrderChild.getStoreId()); orderProduct.setOrderId(tableOrder.getId());
orderProduct.setOrderNo(tableOrderChild.getStoreName()); orderProduct.setOrderNo(tableOrder.getOrderNo());
orderProduct.setProductCategoryId(cartProduct.getProductCategoryId()); orderProduct.setProductCategoryId(cartProduct.getProductCategoryId());
orderProduct.setProductCategoryName(cartProduct.getProductCategoryName()); orderProduct.setProductCategoryName(cartProduct.getProductCategoryName());
orderProduct.setProductId(cartProduct.getId()); orderProduct.setProductId(cartProduct.getProductId());
orderProduct.setProductImg(cartProduct.getProductImg()); orderProduct.setProductImg(cartProduct.getProductImg());
orderProduct.setProductName(cartProduct.getProductName()); orderProduct.setProductName(cartProduct.getProductName());
orderProduct.setProductSpec(cartProduct.getProductSpec()); orderProduct.setProductSpec(cartProduct.getProductSpec());
@ -141,7 +145,7 @@ public class BsMealTableOrderChildServiceImpl implements BsMealTableOrderChildSe
childProduct.setChildOrderNo(tableOrderChild.getChildOrderNo()); childProduct.setChildOrderNo(tableOrderChild.getChildOrderNo());
childProduct.setProductCategoryId(cartProduct.getProductCategoryId()); childProduct.setProductCategoryId(cartProduct.getProductCategoryId());
childProduct.setProductCategoryName(cartProduct.getProductCategoryName()); childProduct.setProductCategoryName(cartProduct.getProductCategoryName());
childProduct.setProductId(cartProduct.getId()); childProduct.setProductId(cartProduct.getProductId());
childProduct.setProductImg(cartProduct.getProductImg()); childProduct.setProductImg(cartProduct.getProductImg());
childProduct.setProductName(cartProduct.getProductName()); childProduct.setProductName(cartProduct.getProductName());
childProduct.setProductSpec(cartProduct.getProductSpec()); childProduct.setProductSpec(cartProduct.getProductSpec());
@ -174,29 +178,22 @@ public class BsMealTableOrderChildServiceImpl implements BsMealTableOrderChildSe
pushParam.put("productList", new JSONArray()); pushParam.put("productList", new JSONArray());
mqttProviderService.publish(2, false, "MEAL_TABLE_" + serialNumber, JSONObject.toJSONString(pushParam)); mqttProviderService.publish(2, false, "MEAL_TABLE_" + serialNumber, JSONObject.toJSONString(pushParam));
// todo 打印小票 // TODO 打印小票
Map<String,Object> deviceParam = new HashMap<>();
deviceParam.put("storeId", tableOrder.getStoreId());
deviceParam.put("deviceType", DeviceTypeEnum.type3.getNumber());
List<BsDevice> deviceList = deviceService.getDeviceList(deviceParam);
for (BsDevice device : deviceList) {
SpPrinterConfig sp = new SpPrinterConfig();
sp.print(device.getDeviceNo(), SpPrinterTemplate.mealOrder(tableOrder, tableOrderChild, childProductList), 1);
}
redisTemplate.delete(lockKey); redisTemplate.delete(lockKey);
} else { } else {
System.out.println("加锁失败"); System.out.println("加锁失败");
Thread.sleep(100); // 加锁失败,重试 Thread.sleep(100); // 加锁失败,重试
createChildOrder(serialNumber, userIdentity); createChildOrder(serialNumber, remark, userIdentity);
} }
} catch (BaseException baseException) { } catch (BaseException baseException) {
redisTemplate.delete(lockKey); redisTemplate.delete(lockKey);

@ -53,7 +53,7 @@ public class BsMealTableOrderProductServiceImpl implements BsMealTableOrderProdu
@Override @Override
public BsMealTableOrderProduct getOrderProduct(String orderNo, Long productId) { public BsMealTableOrderProduct getOrderProduct(String orderNo, Long productId) {
BsMealTableOrderProductExample example = new BsMealTableOrderProductExample(); BsMealTableOrderProductExample example = new BsMealTableOrderProductExample();
example.createCriteria().andOrderNoEqualTo(orderNo).andStatusNotEqualTo(0); example.createCriteria().andOrderNoEqualTo(orderNo).andProductIdEqualTo(productId).andStatusNotEqualTo(0);
List<BsMealTableOrderProduct> list = mealTableOrderProductMapper.selectByExample(example); List<BsMealTableOrderProduct> list = mealTableOrderProductMapper.selectByExample(example);
if (!list.isEmpty()) { if (!list.isEmpty()) {
return list.get(0); return list.get(0);

@ -1,16 +1,30 @@
package com.hfkj.service.meal.impl; package com.hfkj.service.meal.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.BaseException;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.config.SpPrinterConfig;
import com.hfkj.config.SpPrinterTemplate;
import com.hfkj.dao.BsMealTableOrderMapper; import com.hfkj.dao.BsMealTableOrderMapper;
import com.hfkj.entity.BsMealTableOrder; import com.hfkj.entity.*;
import com.hfkj.entity.BsMealTableOrderExample; import com.hfkj.service.BsDeviceService;
import com.hfkj.service.meal.BsMealTableOrderService; import com.hfkj.service.group.BsStoreGroupService;
import com.hfkj.service.meal.*;
import com.hfkj.sysenum.DeviceTypeEnum;
import com.hfkj.sysenum.MealTableOrderPayStatusEnum;
import com.hfkj.sysenum.MealTableOrderStatusEnum; import com.hfkj.sysenum.MealTableOrderStatusEnum;
import com.hfkj.sysenum.MealTableStatusEnum; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.io.IOException;
import java.util.List; import java.math.BigDecimal;
import java.util.*;
/** /**
* @className: BsMealTableOrderServiceImpl * @className: BsMealTableOrderServiceImpl
@ -23,6 +37,22 @@ public class BsMealTableOrderServiceImpl implements BsMealTableOrderService {
@Resource @Resource
private BsMealTableOrderMapper mealTableOrderMapper; private BsMealTableOrderMapper mealTableOrderMapper;
@Resource
private BsMealTableOrderProductService mealTableOrderProductService;
@Resource
private BsMealTableService mealTableService;
@Resource
private BsStoreGroupService storeGroupService;
@Resource
private BsDeviceService deviceService;
@Resource
private RedisTemplate redisTemplate;
@Override @Override
public void editData(BsMealTableOrder mealTableOrder) { public void editData(BsMealTableOrder mealTableOrder) {
if (mealTableOrder.getId() == null) { if (mealTableOrder.getId() == null) {
@ -47,4 +77,111 @@ public class BsMealTableOrderServiceImpl implements BsMealTableOrderService {
} }
return null; return null;
} }
@Override
public BsMealTableOrder getTableOrderByOrderNo(String orderNo) {
BsMealTableOrderExample example = new BsMealTableOrderExample();
example.createCriteria().andOrderNoEqualTo(orderNo);
List<BsMealTableOrder> orderList = mealTableOrderMapper.selectByExample(example);
if (!orderList.isEmpty()) {
return orderList.get(0);
}
return null;
}
@Override
public BsMealTableOrder getTableOrderByPayOrderNo(String payOrderNo) {
BsMealTableOrderExample example = new BsMealTableOrderExample();
example.createCriteria().andPayOrderNoEqualTo(payOrderNo);
List<BsMealTableOrder> orderList = mealTableOrderMapper.selectByExample(example);
if (!orderList.isEmpty()) {
return orderList.get(0);
}
return null;
}
@Override
public void paySuccess(BsTradeOrder tradeOrder) {
// 查询订单详情
BsMealTableOrder mealTableOrder = getTableOrderByPayOrderNo(tradeOrder.getOutTradeNo());
if (mealTableOrder != null) {
// 关台
mealTableService.endTable(mealTableOrder.getSerialNumber());
}
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void operateOrderProduct(String orderNo, JSONArray productArray) {
// 查询订单
BsMealTableOrder order = getTableOrderByOrderNo(orderNo);
if (order == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未知的的订单号");
}
String lockKey = "MEAL_ORDER_" + order.getOrderNo();
try {
Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, null);
if(lock) {
// 加锁成功
// 操作类型 1:添加 2:减少
for (Object obj : productArray) {
JSONObject product = (JSONObject) obj;
// 查询产品
BsStoreProduct storeProduct = storeGroupService.findStoreProduct(product.getLong("productId"));
if (storeProduct == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未知的的产品");
}
// 查询交易订单中的产品
BsMealTableOrderProduct orderProduct = mealTableOrderProductService.getOrderProduct(orderNo, storeProduct.getId());
if (orderProduct == null) {
orderProduct = new BsMealTableOrderProduct();
orderProduct.setOrderId(order.getId());
orderProduct.setOrderNo(order.getOrderNo());
orderProduct.setProductCategoryId(storeProduct.getProductCategoryId());
orderProduct.setProductCategoryName(storeProduct.getProductCategoryName());
orderProduct.setProductId(storeProduct.getId());
orderProduct.setProductImg(storeProduct.getImg());
orderProduct.setProductName(storeProduct.getName());
orderProduct.setProductSpec(storeProduct.getSpec());
orderProduct.setProductPrice(storeProduct.getPrice());
orderProduct.setProductNum(product.getInteger("number"));
orderProduct.setProductTotalPrice(new BigDecimal(orderProduct.getProductNum().toString()).multiply(orderProduct.getProductPrice()));
orderProduct.setStatus(1);
} else {
if (product.getInteger("number") <= 0) {
orderProduct.setStatus(0);
}
orderProduct.setProductNum(product.getInteger("number"));
orderProduct.setProductTotalPrice(new BigDecimal(orderProduct.getProductNum().toString()).multiply(orderProduct.getProductPrice()));
}
mealTableOrderProductService.editData(orderProduct);
}
// 重新计算交易总价
order.setOrderAmount(new BigDecimal("0"));
Map<String,Object> param = new HashMap<>();
param.put("orderNo", order.getOrderNo());
List<BsMealTableOrderProduct> orderProductList = mealTableOrderProductService.getOrderProductList(param);
for (BsMealTableOrderProduct product : orderProductList) {
order.setOrderAmount(order.getOrderAmount().add(product.getProductTotalPrice()));
}
editData(order);
redisTemplate.delete(lockKey);
} else {
System.out.println("加锁失败");
Thread.sleep(100); // 加锁失败,重试
operateOrderProduct(orderNo, productArray);
}
} catch (BaseException baseException) {
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, baseException.getErrorMsg());
} catch (Exception e) {
redisTemplate.delete(lockKey);
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知错误");
}
}
} }

@ -9,12 +9,16 @@ import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.GenerateUtil; import com.hfkj.common.utils.GenerateUtil;
import com.hfkj.common.utils.IDGenerator; import com.hfkj.common.utils.IDGenerator;
import com.hfkj.config.CommonSysConst; import com.hfkj.config.CommonSysConst;
import com.hfkj.config.SpPrinterConfig;
import com.hfkj.config.SpPrinterTemplate;
import com.hfkj.dao.BsMealTableMapper; import com.hfkj.dao.BsMealTableMapper;
import com.hfkj.entity.*; import com.hfkj.entity.*;
import com.hfkj.model.MerBasisModel; import com.hfkj.model.MerBasisModel;
import com.hfkj.service.BsDeviceService; import com.hfkj.service.BsDeviceService;
import com.hfkj.service.BsMerService; import com.hfkj.service.BsMerService;
import com.hfkj.service.BsStoreService; import com.hfkj.service.BsStoreService;
import com.hfkj.service.meal.BsMealShopCartService;
import com.hfkj.service.meal.BsMealTableOrderProductService;
import com.hfkj.service.meal.BsMealTableOrderService; import com.hfkj.service.meal.BsMealTableOrderService;
import com.hfkj.service.meal.BsMealTableService; import com.hfkj.service.meal.BsMealTableService;
import com.hfkj.sysenum.*; import com.hfkj.sysenum.*;
@ -26,11 +30,9 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Random;
/** /**
* @className: BsMealTableServiceImpl * @className: BsMealTableServiceImpl
@ -52,6 +54,12 @@ public class BsMealTableServiceImpl implements BsMealTableService {
@Resource @Resource
private BsMealTableOrderService mealTableOrderService; private BsMealTableOrderService mealTableOrderService;
@Resource
private BsMealTableOrderProductService mealTableOrderProductService;
@Resource
private BsMealShopCartService mealShopCartService;
@Resource @Resource
private BsDeviceService deviceService; private BsDeviceService deviceService;
@ -211,6 +219,7 @@ public class BsMealTableServiceImpl implements BsMealTableService {
order.setOrderNo(DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(10)); order.setOrderNo(DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(10));
order.setOrderAmount(new BigDecimal("0")); order.setOrderAmount(new BigDecimal("0"));
order.setStatus(MealTableOrderStatusEnum.status1.getNumber()); order.setStatus(MealTableOrderStatusEnum.status1.getNumber());
order.setPayStatus(MealTableOrderPayStatusEnum.status1.getNumber());
mealTableOrderService.editData(order); mealTableOrderService.editData(order);
} }
@ -232,11 +241,31 @@ public class BsMealTableServiceImpl implements BsMealTableService {
BsMealTableOrder tableOrder = mealTableOrderService.getCurrentTableOrder(serialNumber); BsMealTableOrder tableOrder = mealTableOrderService.getCurrentTableOrder(serialNumber);
if (tableOrder != null) { if (tableOrder != null) {
tableOrder.setStatus(MealTableOrderStatusEnum.status2.getNumber()); tableOrder.setStatus(MealTableOrderStatusEnum.status2.getNumber());
tableOrder.setPayStatus(MealTableOrderPayStatusEnum.status2.getNumber());
tableOrder.setPayTime(new Date()); tableOrder.setPayTime(new Date());
mealTableOrderService.editData(tableOrder); mealTableOrderService.editData(tableOrder);
// TODO 打印小票订单 // 清空购物车
mealShopCartService.clearData(tableOrder.getSerialNumber());
// 订单产品
Map<String,Object> orderProductMap = new HashMap<>();
orderProductMap.put("orderNo", tableOrder.getOrderNo());
List<BsMealTableOrderProduct> productList = mealTableOrderProductService.getOrderProductList(orderProductMap);
// 打印小票
Map<String,Object> deviceParam = new HashMap<>();
deviceParam.put("storeId", tableOrder.getStoreId());
deviceParam.put("deviceType", DeviceTypeEnum.type3.getNumber());
List<BsDevice> deviceList = deviceService.getDeviceList(deviceParam);
for (BsDevice device : deviceList) {
SpPrinterConfig sp = new SpPrinterConfig();
try {
sp.print(device.getDeviceNo(), SpPrinterTemplate.mealOrderBill(tableOrder, productList), 1);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
} }
} }
} }

@ -9,6 +9,7 @@ import java.util.Objects;
public enum DeviceTypeEnum { public enum DeviceTypeEnum {
type1(1, "4G收款音响"), type1(1, "4G收款音响"),
type2(2, "桌码(支付码)"), type2(2, "桌码(支付码)"),
type3(3, "小票打印机"),
; ;
private Integer number; private Integer number;

@ -0,0 +1,51 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: MealTableOrderStatus
* @author: HuRui
* @date: 2023/11/30
**/
public enum MealTableOrderPayStatusEnum {
status1(1, "待支付"),
status2(2, "支付中"),
status3(3, "已支付"),
;
private Integer number;
private String name;
MealTableOrderPayStatusEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static MealTableOrderPayStatusEnum getDataByNumber(Integer number) {
for (MealTableOrderPayStatusEnum ele : values()) {
if (Objects.equals(number,ele.getNumber())) {
return ele;
}
}
return null;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -11,7 +11,8 @@ import java.util.Objects;
public enum TradeOrderCreateTypeEnum { public enum TradeOrderCreateTypeEnum {
type1(1, "扫一扫"), type1(1, "扫一扫"),
type2(2, "被扫"), type2(2, "被扫"),
type3(3, "API"); type3(3, "API"),
type4(4, "扫码点餐");
private Integer code; private Integer code;

@ -1,6 +1,9 @@
wechat_mp_appid=wxa075e8509802f826 wechat_mp_appid=wxa075e8509802f826
wechat_mp_secret=0e606fc1378d35e359fcf3f15570b2c5 wechat_mp_secret=0e606fc1378d35e359fcf3f15570b2c5
wechat_ma_appid=wxff3cbb14f62d026d
wechat_ma_secret=f6ae84c8bbf8a702f88a064e96918c09
obs_bucket_name=gratia-pay-test obs_bucket_name=gratia-pay-test
obs_end_point=https://obs.cn-east-3.myhuaweicloud.com obs_end_point=https://obs.cn-east-3.myhuaweicloud.com
obs_url=https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com obs_url=https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com
@ -48,13 +51,18 @@ lkl_saas_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAUkzRA+4GOS5OzYqxD/UJ
lkl_saas_private_key=MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMBSTNED7gY5Lk7NirEP9QnAzqn22jV0+960v/tFsxr3ejjqpOg+U+1pbrUS9uU6V0dwEQejsAZdcqYhivu3ZSnU9kLSDtQymej9vlaRPqJ4nrTVet66PyGHJ/b/Gh6Pm+mLj/6UCv1gX7kZzJpV/iB/NM0muYqP09+9fkHetQfZAgMBAAECgYB42D3kaC+8QVnTsluffoNeKYSyT6Y1SNiqy7CGVvl/zFlEQkx0khVybHlf1hbFWq9U+Bn7TuNgXH+Z3CHUoRwy4Ap/kMx637iRatoC8F/kcPaiB7JFQfdrxhgK858dSyHCQ2OXXQDJgJdth+oF9FylVsrDu5Sw3ha4OuzrmufuwQJBAPnPPSeFr1wu7kH6I+A5E49fMbAm7EU+3TYVzxNH1lr3X/LWuK9pi/LVPrSR4eNgAypyQWREIqdpBIiJ9bOnwa0CQQDFFl0zTQTVTWf5r/hwgCUMo4gHr2y/q7XMNe6n5fh4SQuQ+o4gW+BGHzDrT97G5hFGPL+w5niGuEBHWSo5/9xdAkEAnrxdM7vzDjSUGUCFg3lBQJ1QyYoyIF4t2qxJBQtk3jDKu1hNysjasNdoHP2F+CGOYW5wtvHEw3Qr+UcQ5bP3kQJABPAcga6KUnXQBxd7mAX956UpQVgJ13uL4IPxaM+APDNIUOeWLAVhRyB870hfAoi9Ig9fliUQG//9zEvVnQJmGQJBAOb8Z0mGMEbEeAyEKjqoNiQkkIcoBdmPKNFUoUJ6ohcBNOoMfklvNsf2+BPfuhs26tvhYDBRgCAfOVhqTQcGj6I= lkl_saas_private_key=MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMBSTNED7gY5Lk7NirEP9QnAzqn22jV0+960v/tFsxr3ejjqpOg+U+1pbrUS9uU6V0dwEQejsAZdcqYhivu3ZSnU9kLSDtQymej9vlaRPqJ4nrTVet66PyGHJ/b/Gh6Pm+mLj/6UCv1gX7kZzJpV/iB/NM0muYqP09+9fkHetQfZAgMBAAECgYB42D3kaC+8QVnTsluffoNeKYSyT6Y1SNiqy7CGVvl/zFlEQkx0khVybHlf1hbFWq9U+Bn7TuNgXH+Z3CHUoRwy4Ap/kMx637iRatoC8F/kcPaiB7JFQfdrxhgK858dSyHCQ2OXXQDJgJdth+oF9FylVsrDu5Sw3ha4OuzrmufuwQJBAPnPPSeFr1wu7kH6I+A5E49fMbAm7EU+3TYVzxNH1lr3X/LWuK9pi/LVPrSR4eNgAypyQWREIqdpBIiJ9bOnwa0CQQDFFl0zTQTVTWf5r/hwgCUMo4gHr2y/q7XMNe6n5fh4SQuQ+o4gW+BGHzDrT97G5hFGPL+w5niGuEBHWSo5/9xdAkEAnrxdM7vzDjSUGUCFg3lBQJ1QyYoyIF4t2qxJBQtk3jDKu1hNysjasNdoHP2F+CGOYW5wtvHEw3Qr+UcQ5bP3kQJABPAcga6KUnXQBxd7mAX956UpQVgJ13uL4IPxaM+APDNIUOeWLAVhRyB870hfAoi9Ig9fliUQG//9zEvVnQJmGQJBAOb8Z0mGMEbEeAyEKjqoNiQkkIcoBdmPKNFUoUJ6ohcBNOoMfklvNsf2+BPfuhs26tvhYDBRgCAfOVhqTQcGj6I=
# TianQue config # TianQue config
tianque_request_url=https://openapi-test.tianquetech.com # tianque_request_url=https://openapi-test.tianquetech.com
tianque_org_id=00205462 # tianque_org_id=00205462
tianque_private_key=MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD7amtTqsq2cKBv5YpAL49dEXyx76LB2c6G9tGPfOVBk5skOxmII1bFIvUyrQsmLtM+sRg0tzi6EXBu40YW7scTKqe6UA1XHSVYHvooDL1P6E3luJu0eNh7x2yiS8vqq4v8xceRVjXBf1aBe/bPuEqG3W1v76Gw8PqNn+QUeLQrv6QCYBJC5I3Vg2AHrN4udFKnzvIZjV92gx/D9FWTpwU338I1Mw5twRbCCu8f91kmRsOa9atWbN3kM/fZI+uzaEFf9soolKNfhlP7Qhbm0/e6sciv6UDHgpSuXNl/uCYDxZ9YsSyUTJR0Ep+M7l8b4AITFjyE26jqSkUYHcGBRy5ZAgMBAAECggEAfCMMgVA4LSKpJPbab1zMVbC3uAfRfhO0NNGToVySufFOzfHcZmrEgiwDk5T7h0vhg/ffMtAw0zafJDFVvycA5obOMGEsZRIACWWqMLIxm03hgIbJYq+0fFF4Yx43vlQbl6B0LF+7xSHBrcdukxu0uKiGS5mvZXVm0RzcefsrQtmvcGFMcAAeC34aBMOnA/rfSGU82aKoy5A4WcAUSU8r6fOwQMV3aUsyI1z3QbG0RJeE1qPNAs/cVjSVlepLo0BgmePl4DDmBP21AOxnoE70XbVJdFEYGjiF/A1bZID5DEo0rqnvWCUQdWaBUT1QwDFoMITv7CgsaQyG1rlKewaJ/QKBgQD/y7qCsQjpKLHR8Y1tTIDOPedaJTaysWVadTxaVAtjlWnik1V5q+VHtOYN/14p7X587CtTD5MiN6PHRjAWTPHIr8Y87Z2ipqljscDkZb5sOsN3RzriZERLg8bcB6GRlcHkeNUNGLpBPTObIvpWTLvL+mnt4cTF/1ck2li/fX/fywKBgQD7ncutu6QK7FAlkGjX3cBSTT76sBOJYZe7LmvsJJBM+7nmly3/WO1OF/dAFrWqTXjP6PTtCPQ1+z2/kNtgJLJMJVPYeTZauq9OfT+4Ls1318vEr9KXSm/E3rTZLmpxSzgKEzDoYVeyrPh0QdaWvaP5k3BUGl3Scd5cHJKsxshd6wKBgAq+wyH0T9yDghzAmeFKgmqnfQ1zXL3a59gJ7rQYrbXMM/t5lvCagPInLjbOUGVQfay/uv4tPFAGqFGZqDF3n/x/LcOnc6S+fYUblW/CumIPgeCD1HxoG9pUOclKZMYZ1WBElyaKsGBHMuDEcmGnrYffCA4fGsX6eO2qYmoA2ptLAoGBALpQTdGHcCDmezJVjEzL1u0aZdgbKVxA96mS5jclm/RlMXKd32GE57M768l5B2vjkeHiDfq29p5CO6buDINUqPHZcgyJNMZaFhV4iQZJIbvr/ubVioqcg8azYhavWAIsQIK1UzG/YsDbc94iIlPceN8FXdfo7jA2QQDT54goaZWhAoGAQPk/qXBTzJzE6yeDVSC6edYzrVMRTqqNR70HgSY+7GqDsNWb+9otKUkyhCSDOMT8GOFQzNqPRgPBC9LD/Jf8owPExjdl3x/lmmnnc+WeaYyPYpbRuaz1eMmsCLXBMcPmLgj+xOp7J/xtLFGXTfIk7ozRDGJ2BFUJvBOUFLSSNeY= # tianque_private_key=MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD7amtTqsq2cKBv5YpAL49dEXyx76LB2c6G9tGPfOVBk5skOxmII1bFIvUyrQsmLtM+sRg0tzi6EXBu40YW7scTKqe6UA1XHSVYHvooDL1P6E3luJu0eNh7x2yiS8vqq4v8xceRVjXBf1aBe/bPuEqG3W1v76Gw8PqNn+QUeLQrv6QCYBJC5I3Vg2AHrN4udFKnzvIZjV92gx/D9FWTpwU338I1Mw5twRbCCu8f91kmRsOa9atWbN3kM/fZI+uzaEFf9soolKNfhlP7Qhbm0/e6sciv6UDHgpSuXNl/uCYDxZ9YsSyUTJR0Ep+M7l8b4AITFjyE26jqSkUYHcGBRy5ZAgMBAAECggEAfCMMgVA4LSKpJPbab1zMVbC3uAfRfhO0NNGToVySufFOzfHcZmrEgiwDk5T7h0vhg/ffMtAw0zafJDFVvycA5obOMGEsZRIACWWqMLIxm03hgIbJYq+0fFF4Yx43vlQbl6B0LF+7xSHBrcdukxu0uKiGS5mvZXVm0RzcefsrQtmvcGFMcAAeC34aBMOnA/rfSGU82aKoy5A4WcAUSU8r6fOwQMV3aUsyI1z3QbG0RJeE1qPNAs/cVjSVlepLo0BgmePl4DDmBP21AOxnoE70XbVJdFEYGjiF/A1bZID5DEo0rqnvWCUQdWaBUT1QwDFoMITv7CgsaQyG1rlKewaJ/QKBgQD/y7qCsQjpKLHR8Y1tTIDOPedaJTaysWVadTxaVAtjlWnik1V5q+VHtOYN/14p7X587CtTD5MiN6PHRjAWTPHIr8Y87Z2ipqljscDkZb5sOsN3RzriZERLg8bcB6GRlcHkeNUNGLpBPTObIvpWTLvL+mnt4cTF/1ck2li/fX/fywKBgQD7ncutu6QK7FAlkGjX3cBSTT76sBOJYZe7LmvsJJBM+7nmly3/WO1OF/dAFrWqTXjP6PTtCPQ1+z2/kNtgJLJMJVPYeTZauq9OfT+4Ls1318vEr9KXSm/E3rTZLmpxSzgKEzDoYVeyrPh0QdaWvaP5k3BUGl3Scd5cHJKsxshd6wKBgAq+wyH0T9yDghzAmeFKgmqnfQ1zXL3a59gJ7rQYrbXMM/t5lvCagPInLjbOUGVQfay/uv4tPFAGqFGZqDF3n/x/LcOnc6S+fYUblW/CumIPgeCD1HxoG9pUOclKZMYZ1WBElyaKsGBHMuDEcmGnrYffCA4fGsX6eO2qYmoA2ptLAoGBALpQTdGHcCDmezJVjEzL1u0aZdgbKVxA96mS5jclm/RlMXKd32GE57M768l5B2vjkeHiDfq29p5CO6buDINUqPHZcgyJNMZaFhV4iQZJIbvr/ubVioqcg8azYhavWAIsQIK1UzG/YsDbc94iIlPceN8FXdfo7jA2QQDT54goaZWhAoGAQPk/qXBTzJzE6yeDVSC6edYzrVMRTqqNR70HgSY+7GqDsNWb+9otKUkyhCSDOMT8GOFQzNqPRgPBC9LD/Jf8owPExjdl3x/lmmnnc+WeaYyPYpbRuaz1eMmsCLXBMcPmLgj+xOp7J/xtLFGXTfIk7ozRDGJ2BFUJvBOUFLSSNeY=
tianque_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCOmsrFtFPTnEzfpJ/hDl5RODBxw4i9Ex3NmmG/N7A1+by032zZZgLLpdNh8y5otjFY0E37Nyr4FGKFRSSuDiTk8vfx3pv6ImS1Rxjjg4qdVHIfqhCeB0Z2ZPuBD3Gbj8hHFEtXZq8+msAFu/5ZQjiVhgs5WWBjh54LYWSum+d9+wIDAQAB # tianque_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCOmsrFtFPTnEzfpJ/hDl5RODBxw4i9Ex3NmmG/N7A1+by032zZZgLLpdNh8y5otjFY0E37Nyr4FGKFRSSuDiTk8vfx3pv6ImS1Rxjjg4qdVHIfqhCeB0Z2ZPuBD3Gbj8hHFEtXZq8+msAFu/5ZQjiVhgs5WWBjh54LYWSum+d9+wIDAQAB
tianque_micro_pay_ret_url=https://gratia-pay.dctpay.com/crest/tianqueNotify/microPay tianque_micro_pay_ret_url=https://gratia-pay.dctpay.com/crest/tianqueNotify/microPay
tianque_open_api_pay_notify_url=https://gratia-pay.dctpay.com/openApi/v1/payNotify/tianque tianque_open_api_pay_notify_url=https://gratia-pay.dctpay.com/openApi/v1/payNotify/tianque
tianque_request_url=https://openapi.tianquetech.com
tianque_org_id=65749201
tianque_private_key=MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDlAa7Xw1w16H6xmZgxwEN+UPm72s7PisVkbWFbDexeqQkpSvrouHVswte1qlQyOivhZU21KbuklCOMAuJ4/kcZJ4KlvSckzpAnOrFmA7M3x76zK+GWmOfgHvT208XAGx9mjh5mXHmOUZcyhXmgMnHMQdwTUi0vdk2ni/yHQqBUK1fH8jGI5eWwuzP6oSu7/gqaF/vZyF7TP0dvjgDPuDI6iMRVb4At10yxcZIvFTKuKsMksf2YKgtlvhidvHicnr93RksclSaVbw9VjuXrdYd1hlLJson3xTUr+l96aGMfefiK94f0Jrx81zWqD7BaKtgdE+x0VXPuaM0Tv5HBdCHxAgMBAAECggEABeX9MuF9RoYufTSPjvh8xIwhYo1INmBEpUmL8GRzahzAd6fOvp/BpoN+OtegQ4rsBmotjjT8+Eg4giqw2pzyB9vUqaAtme0YGWqRlycRPqaOat7+eHqHvmYNuS3LMh+At4uBjPFk0B2Z31tAvreN5szrdjPvpgFODrq0TmeQ6ZoHtSTYM90zkhH7NyDKBbul4d0XkjDuE1Y/vN1FkTXxJI0FV76HxCgckPj3Jd3cut1S9Prhwvx9sMWjWiy6rd6m9AR6d+31GJVzYeXz6Y3/cG6MFrDO/bVc8oK5ltjNFPEkz28b04LKmFZhAHBFqEuLC5jFYOqciJVcpkPaGQ3RYQKBgQD8DW+5+N0az5l2p1w5CniFhva3rk92jOZKxHvoPGpwA6qlhGGn96gqdTpjY5gAonaGiJbjwnubProe9JafSnOP2Pj3yfLfhp4CtkoDk1bvBZJUW3CWTOHWPsT8Xae6wZ8qd7hkjRoHqf5Ub+0JyA/h/CfYLZS1Xtf5i5G4Gk/rBwKBgQDol9kC+zIhIc5vgfrDmZwGDwn/H0N7pYpDx23vjesgeKmpnrj9al+ODUW5SOjIYYjjsQ8ot51Zg+65YsQNGPFuTbSu3OHRl4emzmJVrfjVVsehbYPR676R5zEgJOIIjqeU9r9AH60lLuhy/7SIJyfNAgL7wUtxo+djXGzinXK1RwKBgGwaJy0P+2SgXSVyqi8cuowqUm59KD+kNrEijDISl2PrbqkGmgu8QDfVh3FRKcQ76bHRq0WMCA+RW6ojJOa0u9OaL023I5+S0PpAzIW0D7j8HsJnZWZRGxsUWNAUKvgCSw2fw0n86okW86mrR3LGh2lZCI3DHuCbCO5SWfEn99bJAoGAdM81tDKVJWCF/Sgo2Ky/V6eb3J1F1cX4Hzv7sQ/z4nXWtxG4U8RlQsDVoEzGY0PgbIESXN+BzV/dtwqr7Ov26+9oa10Qp6LTBGmnpuHdEr8nOKH4Tqd3KG0UFdGQFr4V2VDmEX0XBpJ9OKvEbZBEg8eb2fVkPykSXqsfH9v0rKcCgYEAmRagAvycwGeD0hGehj6gRYegt4NqcU895Ce7J85u9QrO03Wn7l77ToktCcl9GRI7ZZwJOzCIsUntoGJHc3VbXnio7qixdm4oYo4TvNV3lUI1NKisszrFJCCXemZHeesW3t3RFzYwDGX/MJrBw7q8qsAnio0fc0ubcNVc67LNZ38=
tianque_public_key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjo1+KBcvwDSIo+nMYLeOJ19Ju4ii0xH66ZxFd869EWFWk/EJa3xIA2+4qGf/Ic7m7zi/NHuCnfUtUDmUdP0JfaZiYwn+1Ek7tYAOc1+1GxhzcexSJLyJlR2JLMfEM+rZooW4Ei7q3a8jdTWUNoak/bVPXnLEVLrbIguXABERQ0Ze0X9Fs0y/zkQFg8UjxUN88g2CRfMC6LldHm7UBo+d+WlpOYH7u0OTzoLLiP/04N1cfTgjjtqTBI7qkOGxYs6aBZHG1DJ6WdP+5w+ho91sBTVajsCxAaMoExWQM2ipf/1qGdsWmkZScPflBqg7m0olOD87ymAVP/3Tcbvi34bDfwIDAQAB
wechat_pay_notify_url=https://gratia-pay.dctpay.com/crest/weiXinNotify/jsapiPay wechat_pay_notify_url=https://gratia-pay.dctpay.com/crest/weiXinNotify/jsapiPay
file_url=/home/project/gratia-pay/file file_url=/home/project/gratia-pay/file

@ -1,3 +1,9 @@
wechat_mp_appid=wxa075e8509802f826
wechat_mp_secret=0e606fc1378d35e359fcf3f15570b2c5
wechat_ma_appid=wxff3cbb14f62d026d
wechat_ma_secret=f6ae84c8bbf8a702f88a064e96918c09
obs_bucket_name=gratia-pay obs_bucket_name=gratia-pay
obs_end_point=https://obs.cn-southwest-2.myhuaweicloud.com obs_end_point=https://obs.cn-southwest-2.myhuaweicloud.com
obs_url=https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com obs_url=https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com

@ -1,3 +1,9 @@
wechat_mp_appid=wxa075e8509802f826
wechat_mp_secret=0e606fc1378d35e359fcf3f15570b2c5
wechat_ma_appid=wxff3cbb14f62d026d
wechat_ma_secret=f6ae84c8bbf8a702f88a064e96918c09
obs_bucket_name=gratia-pay obs_bucket_name=gratia-pay
obs_end_point=https://obs.cn-southwest-2.myhuaweicloud.com obs_end_point=https://obs.cn-southwest-2.myhuaweicloud.com
obs_url=https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com obs_url=https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com

Loading…
Cancel
Save