提交代码

master
胡锐 12 months ago
parent 33dc227e46
commit db2ddd9cfd
  1. 4
      cweb/src/main/java/com/cweb/controller/TestController.java
  2. 25
      cweb/src/main/java/com/cweb/controller/meal/BsMealTableOrderController.java
  3. 1
      service/src/main/java/com/hfkj/common/exception/ErrorCode.java
  4. 2
      service/src/main/java/com/hfkj/service/impl/BsDeviceOrderServiceImpl.java
  5. 10
      service/src/main/java/com/hfkj/service/meal/BsMealTableOrderService.java
  6. 5
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableOrderChildServiceImpl.java
  7. 19
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableOrderServiceImpl.java
  8. 2
      service/src/main/java/com/hfkj/service/meal/impl/BsMealTableServiceImpl.java

@ -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.queryCustomerRates("193", "8226900542202CG")); return ResponseMsgUtil.success(saasActivityService.referee("8226900542202CG"));
// return ResponseMsgUtil.success(saasActivityService.queryCustomerActivityStatus("73", "8226900445800HB")); // return ResponseMsgUtil.success(saasActivityService.queryCustomerActivityStatus("73", "8226900445800HB"));
/*********** 活动报名 *************/ /*********** 活动报名 *************/

@ -1,6 +1,8 @@
package com.cweb.controller.meal; package com.cweb.controller.meal;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode; 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;
@ -13,6 +15,7 @@ import com.hfkj.model.ResponseData;
import com.hfkj.service.meal.*; import com.hfkj.service.meal.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -143,6 +146,28 @@ public class BsMealTableOrderController {
} }
@RequestMapping(value="/queryOrderList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询订单列表")
public ResponseData queryOrderList(@RequestParam(value = "storeId" , required = true) String storeId,
@RequestParam(value = "serialNumber" , required = false) String serialNumber,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
Map<String, Object> param = new HashMap<>();
param.put("storeId", storeId);
param.put("serialNumber", serialNumber);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(mealTableOrderService.getTableOrderList(param)));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -64,6 +64,7 @@ public enum ErrorCode {
BASE_ORGANIZATION_HAS_NOT_PARENT_ERROR("2033","该部门无上级部门"), BASE_ORGANIZATION_HAS_NOT_PARENT_ERROR("2033","该部门无上级部门"),
UN_MEMBER_ERROR("2034","未找到用户"), UN_MEMBER_ERROR("2034","未找到用户"),
PASSWORD_ERROR("2035","账号或密码错误"), PASSWORD_ERROR("2035","账号或密码错误"),
MEAL_TABLE_CREATE_BREAK_OUT_ERROR("2036","小伙伴正在提交订单..."),
STATUS_ERROR("3000","状态错误"), STATUS_ERROR("3000","状态错误"),

@ -124,7 +124,7 @@ public class BsDeviceOrderServiceImpl implements BsDeviceOrderService {
order.setStatus(DeviceOrderStatusEnum.status3.getNumber()); order.setStatus(DeviceOrderStatusEnum.status3.getNumber());
editData(order); editData(order);
if (order.getDeviceType().equals(DeviceTypeEnum.type1.getNumber())) { if (order.getDeviceType().equals(DeviceTypeEnum.type1.getNumber()) || order.getDeviceType().equals(DeviceTypeEnum.type3.getNumber())) {
List<BsDevice> deviceList = new ArrayList<>(); List<BsDevice> deviceList = new ArrayList<>();
for (String deviceNo : deviceNoList) { for (String deviceNo : deviceNoList) {
// 查询设备 // 查询设备

@ -4,6 +4,9 @@ import com.alibaba.fastjson.JSONArray;
import com.hfkj.entity.BsMealTableOrder; import com.hfkj.entity.BsMealTableOrder;
import com.hfkj.entity.BsTradeOrder; import com.hfkj.entity.BsTradeOrder;
import java.util.List;
import java.util.Map;
/** /**
* @className: BsMealTableOrderService * @className: BsMealTableOrderService
* @author: HuRui * @author: HuRui
@ -38,6 +41,13 @@ public interface BsMealTableOrderService {
*/ */
BsMealTableOrder getTableOrderByPayOrderNo(String payOrderNo); BsMealTableOrder getTableOrderByPayOrderNo(String payOrderNo);
/**
* 查询订单列表
* @param param
* @return
*/
List<BsMealTableOrder> getTableOrderList(Map<String,Object> param);
/** /**
* 支付成功 * 支付成功
* @param tradeOrder * @param tradeOrder

@ -187,13 +187,10 @@ public class BsMealTableOrderChildServiceImpl implements BsMealTableOrderChildSe
SpPrinterConfig sp = new SpPrinterConfig(); SpPrinterConfig sp = new SpPrinterConfig();
sp.print(device.getDeviceNo(), SpPrinterTemplate.mealOrder(tableOrder, tableOrderChild, childProductList), 1); sp.print(device.getDeviceNo(), SpPrinterTemplate.mealOrder(tableOrder, tableOrderChild, childProductList), 1);
} }
redisTemplate.delete(lockKey); redisTemplate.delete(lockKey);
} else { } else {
System.out.println("加锁失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.MEAL_TABLE_CREATE_BREAK_OUT_ERROR, "");
Thread.sleep(100); // 加锁失败,重试
createChildOrder(serialNumber, remark, userIdentity);
} }
} catch (BaseException baseException) { } catch (BaseException baseException) {
redisTemplate.delete(lockKey); redisTemplate.delete(lockKey);

@ -16,6 +16,8 @@ import com.hfkj.service.meal.*;
import com.hfkj.sysenum.DeviceTypeEnum; import com.hfkj.sysenum.DeviceTypeEnum;
import com.hfkj.sysenum.MealTableOrderPayStatusEnum; import com.hfkj.sysenum.MealTableOrderPayStatusEnum;
import com.hfkj.sysenum.MealTableOrderStatusEnum; import com.hfkj.sysenum.MealTableOrderStatusEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
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;
@ -100,6 +102,23 @@ public class BsMealTableOrderServiceImpl implements BsMealTableOrderService {
return null; return null;
} }
@Override
public List<BsMealTableOrder> getTableOrderList(Map<String, Object> param) {
BsMealTableOrderExample example = new BsMealTableOrderExample();
BsMealTableOrderExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(MealTableOrderStatusEnum.status0.getNumber());
if (MapUtils.getLong(param, "storeId") != null) {
criteria.andStoreIdEqualTo(MapUtils.getLong(param, "storeId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "serialNumber"))) {
criteria.andSerialNumberEqualTo(MapUtils.getString(param, "serialNumber"));
}
example.setOrderByClause("create_time desc");
return mealTableOrderMapper.selectByExample(example);
}
@Override @Override
public void paySuccess(BsTradeOrder tradeOrder) { public void paySuccess(BsTradeOrder tradeOrder) {
// 查询订单详情 // 查询订单详情

@ -118,7 +118,7 @@ public class BsMealTableServiceImpl implements BsMealTableService {
// 生成二维码 // 生成二维码
String file = "/mealTableQrCode/" + storeId + "/" + mealTable.getSerialNumber() + ".png"; String file = "/mealTableQrCode/" + storeId + "/" + mealTable.getSerialNumber() + ".png";
mealTable.setQrCodeContent("www.baidu.com"); mealTable.setQrCodeContent(CommonSysConst.getSysConfig().getDomainName()+"/wxqrcode/meal?sn="+mealTable.getSerialNumber());
QRCodeGenerator.generateQRCodeImage( QRCodeGenerator.generateQRCodeImage(
mealTable.getQrCodeContent(), mealTable.getQrCodeContent(),
350, 350,

Loading…
Cancel
Save