dev-discount
袁野 3 years ago
commit 5969cd34ac
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/ApiMemberProductController.java
  2. 5
      hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java
  3. 20
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountAgentRelController.java
  4. 2
      hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java
  5. 138
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  6. 68
      hai-bweb/src/main/java/com/bweb/controller/HighGasStaffController.java
  7. 2
      hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java
  8. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  9. 4
      hai-bweb/src/main/resources/dev/config.properties
  10. 2
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  11. 32
      hai-cweb/src/main/java/com/cweb/controller/HighDiscountController.java
  12. 2
      hai-cweb/src/main/java/com/cweb/controller/HighGoodsTypeController.java
  13. 30
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  14. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  15. 101
      hai-cweb/src/main/java/com/cweb/controller/HighThirdPartyController.java
  16. 66
      hai-cweb/src/main/java/com/cweb/controller/HighUserDiscountController.java
  17. 9
      hai-cweb/src/main/java/com/cweb/controller/pay/ThirdOrderController.java
  18. 20
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  19. 1
      hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java
  20. 48
      hai-schedule/src/main/java/com/hai/schedule/ApiThirdProductSchedule.java
  21. 39
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  22. 1
      hai-service/src/main/java/com/hai/common/exception/ErrorCode.java
  23. 1
      hai-service/src/main/java/com/hai/common/pay/entity/OrderType.java
  24. 3
      hai-service/src/main/java/com/hai/common/security/AESEncodeUtil.java
  25. 37
      hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java
  26. 32
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  27. 28
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  28. 4
      hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java
  29. 56
      hai-service/src/main/java/com/hai/config/RechargeConfig.java
  30. 18
      hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java
  31. 184
      hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java
  32. 17
      hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java
  33. 28
      hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java
  34. 29
      hai-service/src/main/java/com/hai/dao/HighDiscountMapper.java
  35. 14
      hai-service/src/main/java/com/hai/dao/HighDiscountSqlProvider.java
  36. 4
      hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java
  37. 17
      hai-service/src/main/java/com/hai/dao/HighGasStaffMapper.java
  38. 14
      hai-service/src/main/java/com/hai/dao/HighGasStaffSqlProvider.java
  39. 20
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  40. BIN
      hai-service/src/main/java/com/hai/entity/._HighOrder.java
  41. 32
      hai-service/src/main/java/com/hai/entity/HighChildOrder.java
  42. 130
      hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java
  43. 16
      hai-service/src/main/java/com/hai/entity/HighDiscount.java
  44. 60
      hai-service/src/main/java/com/hai/entity/HighDiscountExample.java
  45. 16
      hai-service/src/main/java/com/hai/entity/HighGasStaff.java
  46. 70
      hai-service/src/main/java/com/hai/entity/HighGasStaffExample.java
  47. 43
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  48. 1
      hai-service/src/main/java/com/hai/enum_type/GasPositionType.java
  49. 2
      hai-service/src/main/java/com/hai/enum_type/OrderPushType.java
  50. 1
      hai-service/src/main/java/com/hai/enum_type/UserObjectTypeEnum.java
  51. 18
      hai-service/src/main/java/com/hai/model/GasOrderModel.java
  52. 11
      hai-service/src/main/java/com/hai/model/ThirdPartyModel.java
  53. 2
      hai-service/src/main/java/com/hai/service/ApiOpenService.java
  54. 12
      hai-service/src/main/java/com/hai/service/ApiProductService.java
  55. 7
      hai-service/src/main/java/com/hai/service/HighDiscountService.java
  56. 16
      hai-service/src/main/java/com/hai/service/HighDiscountUserRelService.java
  57. 16
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  58. 16
      hai-service/src/main/java/com/hai/service/impl/ApiOpenServiceImpl.java
  59. 13
      hai-service/src/main/java/com/hai/service/impl/ApiProductServiceImpl.java
  60. 1
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  61. 11
      hai-service/src/main/java/com/hai/service/impl/HighDiscountServiceImpl.java
  62. 73
      hai-service/src/main/java/com/hai/service/impl/HighDiscountUserRelServiceImpl.java
  63. 2
      hai-service/src/main/java/com/hai/service/impl/HighGasStaffServiceImpl.java
  64. 265
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  65. 1
      hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java
  66. 16
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  67. 4
      hai-service/src/main/java/com/hai/service/pay/impl/NotifyServiceImpl.java
  68. 17
      hai-service/src/main/java/com/hai/service/pay/impl/StarbucksOrderServiceImpl.java
  69. 70
      hai-service/src/main/java/com/hai/service/pay/impl/ThirdOrderServiceImpl.java
  70. 14
      hai-service/src/main/resources/dev/commonConfig.properties
  71. 15
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  72. 15
      hai-service/src/main/resources/prod/commonConfig.properties

@ -93,6 +93,7 @@ public class ApiMemberProductController {
apiMemberProduct.getTypeId() == null ||
StringUtils.isBlank(apiMemberProduct.getProductId()) ||
apiMemberProduct.getBrandId() == null ||
apiMemberProduct.getCostPrice() == null ||
apiMemberProduct.getPrice() == null ) {
log.error("ApiMemberProductController -> insertMemberProduct() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -129,6 +130,7 @@ public class ApiMemberProductController {
apiMemberProduct.getTypeId() == null ||
StringUtils.isBlank(apiMemberProduct.getProductId()) ||
apiMemberProduct.getBrandId() == null ||
apiMemberProduct.getCostPrice() == null ||
apiMemberProduct.getPrice() == null ) {
log.error("ApiMemberProductController -> insertMemberProduct() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");

@ -21,6 +21,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DeadlockLoserDataAccessException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -553,6 +554,10 @@ public class HighCouponAgentController {
return ResponseMsgUtil.success("操作成功");
} catch (DeadlockLoserDataAccessException deadlockLoserDataAccessException) {
log.error("HighActivityController -> userLottery() error!", "请求过于频繁");
return ResponseMsgUtil.builderResponse(ErrorCode.FREQUENT_REQUESTS.getCode(),ErrorCode.FREQUENT_REQUESTS.getMsg(),null);
} catch (Exception e) {
log.error("HighCouponAgentController --> pushGzSinopec() error!", e);
return ResponseMsgUtil.exception(e);

@ -16,6 +16,7 @@ import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst;
import com.hai.entity.*;
import com.hai.enum_type.QrCodeType;
import com.hai.model.ResponseData;
@ -31,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.net.URLEncoder;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -139,6 +141,24 @@ public class HighDiscountAgentRelController {
}
}
@RequestMapping(value="/getReceiveLink",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取领取链接")
public ResponseData getReceiveLink(@RequestParam(name = "id", required = true) Long id) {
try {
String param = URLEncoder.encode(AESEncodeUtil.aesEncrypt(id.toString()), "UTF-8");
String url = CommonSysConst.getSysConfig().getHsgDomainName() + "/hsgH5?accountId=000001&key=&code=" + param;
return ResponseMsgUtil.success(url);
} catch (Exception e) {
log.error("HighDiscountController -> getReceiveLink() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDiscountAgentList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")

@ -63,6 +63,7 @@ public class HighDiscountController {
|| highDiscount.getDiscountType() == null
|| highDiscount.getDiscountPrice() == null
|| highDiscount.getEffectiveDay() == null
|| highDiscount.getReceiveNumber() == null
|| highDiscount.getUseScope() == null
|| highDiscount.getSalesEndTime() == null) {
log.error("HighDiscountController -> insertDiscount() error!","参数错误");
@ -113,6 +114,7 @@ public class HighDiscountController {
if (highDiscount.getId() == null
|| StringUtils.isBlank(highDiscount.getDiscountName())
|| StringUtils.isBlank(highDiscount.getDiscountImg())
|| highDiscount.getReceiveNumber() == null
|| highDiscount.getEffectiveDay() == null
|| highDiscount.getSalesEndTime() == null) {
log.error("HighDiscountController -> updateDiscount() error!","参数错误");

@ -111,41 +111,80 @@ public class HighGasController {
Map<String, Object> param = new HashMap<>();;
param.put("gasName", userInfoModel.getMerchantStore().getStoreName());
Map<String, Object> history = new HashMap<>();
// 历史加油总金额
Map<String, Object> historyTotal = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7");
history.put("totalPrice", historyTotal.get("price"));
history.put("totalCount", historyTotal.get("count"));
// 历史加油金额
Map<String, Object> historyIncomet = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7");
history.put("incomePrice", historyIncomet.get("price"));
history.put("incomeCount", historyIncomet.get("count"));
// 历史退款
Map<String, Object> historyRefund = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "4");
history.put("refundPrice", historyRefund.get("price"));
history.put("refundCount", historyRefund.get("count"));
param.put("history", history);
Map<String, Object> today = new HashMap<>();
// 今日加油总金额
Map<String, Object> todayTotal = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7");
today.put("totalPrice", todayTotal.get("price"));
today.put("totalCount", todayTotal.get("count"));
// 今日加油金额
Map<String, Object> todayIncomet = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7");
today.put("incomePrice", todayIncomet.get("price"));
today.put("incomeCount", todayIncomet.get("count"));
// 今日退款
Map<String, Object> todayRefund = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "4");
today.put("refundPrice", todayRefund.get("price"));
today.put("refundCount", todayRefund.get("count"));
param.put("today", today);
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type8.getType())
&& userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) {
Map<String, Object> history = new HashMap<>();
// 历史加油总金额
Map<String, Object> historyTotal = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "2,3,4,6,7");
history.put("totalPrice", historyTotal.get("price"));
history.put("totalCount", historyTotal.get("count"));
// 历史加油金额
Map<String, Object> historyIncomet = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "2,3,6,7");
history.put("incomePrice", historyIncomet.get("price"));
history.put("incomeCount", historyIncomet.get("count"));
// 历史退款
Map<String, Object> historyRefund = highOrderService.getGasStaffHistoryOrderCount(userInfoModel.getGasStaff().getId(), "4");
history.put("refundPrice", historyRefund.get("price"));
history.put("refundCount", historyRefund.get("count"));
param.put("history", history);
Map<String, Object> today = new HashMap<>();
// 今日加油总金额
Map<String, Object> todayTotal = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "2,3,4,6,7");
today.put("totalPrice", todayTotal.get("price"));
today.put("totalCount", todayTotal.get("count"));
// 今日加油金额
Map<String, Object> todayIncomet = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "2,3,6,7");
today.put("incomePrice", todayIncomet.get("price"));
today.put("incomeCount", todayIncomet.get("count"));
// 今日退款
Map<String, Object> todayRefund = highOrderService.getGasStaffTheDayOrderCount(userInfoModel.getGasStaff().getId(), "4");
today.put("refundPrice", todayRefund.get("price"));
today.put("refundCount", todayRefund.get("count"));
param.put("today", today);
} else {
Map<String, Object> history = new HashMap<>();
// 历史加油总金额
Map<String, Object> historyTotal = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7");
history.put("totalPrice", historyTotal.get("price"));
history.put("totalCount", historyTotal.get("count"));
// 历史加油金额
Map<String, Object> historyIncomet = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7");
history.put("incomePrice", historyIncomet.get("price"));
history.put("incomeCount", historyIncomet.get("count"));
// 历史退款
Map<String, Object> historyRefund = highOrderService.getGasHistoryOrderCount(userInfoModel.getMerchantStore().getId(), "4");
history.put("refundPrice", historyRefund.get("price"));
history.put("refundCount", historyRefund.get("count"));
param.put("history", history);
Map<String, Object> today = new HashMap<>();
// 今日加油总金额
Map<String, Object> todayTotal = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,4,6,7");
today.put("totalPrice", todayTotal.get("price"));
today.put("totalCount", todayTotal.get("count"));
// 今日加油金额
Map<String, Object> todayIncomet = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "2,3,6,7");
today.put("incomePrice", todayIncomet.get("price"));
today.put("incomeCount", todayIncomet.get("count"));
// 今日退款
Map<String, Object> todayRefund = highOrderService.getGasTheDayOrderCount(userInfoModel.getMerchantStore().getId(), "4");
today.put("refundPrice", todayRefund.get("price"));
today.put("refundCount", todayRefund.get("count"));
param.put("today", today);
}
return ResponseMsgUtil.success(param);
} catch (Exception e) {
@ -159,6 +198,7 @@ public class HighGasController {
@ApiOperation(value = "查询油站订单列表")
public ResponseData getGasOrderList(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "staffId", required = false) Long staffId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@ -170,7 +210,7 @@ public class HighGasController {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String, Object> param = new HashMap<>();;
Map<String, Object> param = new HashMap<>();
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工
if (userInfoModel.getSecUser().getObjectType().equals(2)) {
if (storeId != null) {
@ -191,15 +231,20 @@ public class HighGasController {
} else {
param.put("storeId", 0);
}
}
param.put("gasStaffId", staffId);
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
param.put("gasStaffId", staffId);
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status1.getStatus())) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
}
if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) {
param.put("gasStaffId", userInfoModel.getGasStaff().getId());
}
} else {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
@ -260,6 +305,7 @@ public class HighGasController {
@ApiOperation(value = "导出油站订单")
public ResponseData exportGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "staffId", required = false) Long staffId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE) {
@ -290,20 +336,24 @@ public class HighGasController {
} else {
param.put("storeId", 0);
}
}
param.put("gasStaffId", staffId);
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
param.put("gasStaffId", staffId);
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status1.getStatus())) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
}
if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) {
param.put("gasStaffId", userInfoModel.getGasStaff().getId());
}
} else {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
param.put("orderNo", orderNo);
param.put("createTimeS", createTimeS);
param.put("createTimeE", createTimeE);
@ -317,6 +367,7 @@ public class HighGasController {
List<String> headList = new ArrayList<>();
headList.add("订单号");
headList.add("油站名称");
headList.add("加油员");
headList.add("油品类型");
headList.add("油品油号");
headList.add("油枪号");
@ -337,6 +388,7 @@ public class HighGasController {
data = new ArrayList<>();
data.add(orderModel.getOrderNo());
data.add(orderModel.getGasName());
data.add(StringUtils.isNotBlank(orderModel.getGasStaffName())?orderModel.getGasStaffName():"未知");
data.add(orderModel.getGasOilType().equals("1") ? "汽油": "柴油");
data.add(orderModel.getGasOilNo() + "#");
data.add(orderModel.getGasGunNo() + "号");
@ -357,7 +409,7 @@ public class HighGasController {
if (!file.exists()) {
file.mkdirs();
}
EasyExcel.write(fileUrl+pathName).head(generationHead(headList)).sheet("油卡").doWrite(dataList);
EasyExcel.write(fileUrl+pathName).head(generationHead(headList)).sheet("加油订单").doWrite(dataList);
return ResponseMsgUtil.success(pathName);

@ -1,28 +1,45 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bweb.config.SysConst;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.Base64Util;
import com.hai.common.QRCodeGenerator;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.AESEncodeUtil;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst;
import com.hai.entity.HighGasStaff;
import com.hai.entity.HighMerchantStore;
import com.hai.enum_type.GasStaffStatus;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.CommonService;
import com.hai.service.HighGasStaffService;
import com.hai.service.HighMerchantStoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.utils.URLEncodedUtils;
import org.bouncycastle.util.encoders.UrlBase64Encoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Base64;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -36,6 +53,9 @@ public class HighGasStaffController {
@Resource
private HighGasStaffService gasStaffService;
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private CommonService commonService;
@ -112,6 +132,54 @@ public class HighGasStaffController {
}
}
@RequestMapping(value="/queryQrCode",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询二维码")
public ResponseData queryQrCode(@RequestBody JSONObject body) {
try {
if (body.getLong("gasStaffId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询员工信息
HighGasStaff gasStaff = gasStaffService.getStaffDetailById(body.getLong("gasStaffId"));
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到员工信息");
}
if (StringUtils.isBlank(gasStaff.getQrCodeImgUrl())) {
// 查询加油站
HighMerchantStore merchantStore = merchantStoreService.getDetailById(gasStaff.getMerchantStoreId());
if (merchantStore == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站信息");
}
// 查询秘钥
String key = commonService.getDictionaryCodeName("QR_CODE_SIGN_KEY", "1");
if (StringUtils.isBlank(key)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败");
}
// 员工ID签名
String signId = AESEncodeUtil.base64Encode(AESEncodeUtil.aesEncryptToBytes(gasStaff.getId().toString(), key));
// 生成二维码
String param = CommonSysConst.getSysConfig().getHsgDomainName()+"/hsgH5?accountId=000000&gasKey=" + merchantStore.getStoreKey() + "&staffCode=" + URLEncoder.encode(signId, "UTF-8");
String qrCodeImgUrl = DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(1) +".jpg";
QRCodeGenerator.generateQRCodeImage(param, 350, 350, SysConst.getSysConfig().getFileUrl()+"/gasStaff/"+qrCodeImgUrl);
gasStaff.setQrCodeImgUrl(qrCodeImgUrl);
gasStaffService.updateStaff(gasStaff);
}
return ResponseMsgUtil.success(gasStaff.getQrCodeImgUrl());
} catch (Exception e) {
log.error("HighGasStaffController -> queryQrCode() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/disabled",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "禁用员工")

@ -203,7 +203,7 @@ public class HighOpenApiController {
highGasOrderPush.setRequestContent(JSONObject.toJSONString(object));
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (returnParam == null || !returnParam.getString("result").equals("success")) {
if (!returnParam.getString("result").equals("success")) {
log.error("HighOpenApiController -> couJointDist() error!","商户派发电子券失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户派发电子券失败");
}

File diff suppressed because one or more lines are too long

@ -1,5 +1,5 @@
#fileUrl=/home/project/hsg/filesystem
fileUrl=/Volumes/work/code/filesystem/
fileUrl=/home/project/hsg/filesystem
#fileUrl=/Volumes/work/code/filesystem/
cmsPath=/home/project/hsg/filesystem/cmsPath
agentQrCode=/home/project/hsg/filesystem/agentQrCode
agentQrCodeWxUrl=https://hsgcs.dctpay.com/wx/?action=ic&id=

@ -97,6 +97,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/couponAgent/convertCodeDetail")
.excludePathPatterns("/coupon/getCouponById")
.excludePathPatterns("/discount/getDiscountByQrCode")
.excludePathPatterns("/discount/getDiscountByCode")
.excludePathPatterns("/discount/getDiscountById")
.excludePathPatterns("/discount/getCouponByDiscount")
.excludePathPatterns("/discountPackage/getDiscountPackageList")
@ -137,6 +138,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/czOrder/*")
.excludePathPatterns("/outRechargePrice/*")
.excludePathPatterns("/userDiscount/*")
.excludePathPatterns("/highThirdParty/*")
;
}

@ -17,12 +17,14 @@ import com.hai.service.HighDiscountCouponRelService;
import com.hai.service.HighDiscountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
@ -83,6 +85,36 @@ public class HighDiscountController {
}
}
@RequestMapping(value="/getDiscountByCode",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据Code查询优惠券")
public ResponseData getDiscountByCode(@RequestParam(name = "code", required = true) String code) {
try {
System.out.println(code);
String discountAgentId;
try {
discountAgentId = AESEncodeUtil.aesDecrypt(URLDecoder.decode(code, "UTF-8"));
} catch (Exception e) {
log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误");
}
if (StringUtils.isBlank(discountAgentId)) {
log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误");
}
// 查询优惠券与代理商关系id
HighDiscountAgentRel discountAgentRel = highDiscountAgentRelService.getRelById(Long.parseLong(discountAgentId));
if (discountAgentRel == null) {
log.error("HighDiscountController -> getDiscountByQrCode() error!","code解码错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "code解码错误");
}
return ResponseMsgUtil.success(discountAgentRel);
} catch (Exception e) {
log.error("HighDiscountController -> getDiscountByQrCode() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDiscountByDiscountAgentId",method = RequestMethod.GET)
@ResponseBody

@ -50,12 +50,14 @@ public class HighGoodsTypeController {
@ApiOperation(value = "获取商品类型列表")
public ResponseData getListGoodsType(@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
@RequestParam(name = "userService", required = false) String userService,
@RequestParam(name = "title", required = false) String title,
HttpServletRequest request) {
try {
Map<String,String> map = new HashMap<>();
map.put("title", title);
map.put("userService", userService);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highGoodsTypeService.getListGoodsType(map)));

@ -8,6 +8,7 @@ import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.AESEncodeUtil;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
@ -38,6 +39,7 @@ import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.net.URLDecoder;
import java.util.*;
import java.util.stream.Collectors;
@ -94,6 +96,9 @@ public class HighOrderController {
@Resource
private HighGasDiscountOilPriceService gasDiscountOilPriceService;
@Resource
private HighGasStaffService gasStaffService;
@RequestMapping(value="/addOrder",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "增加订单")
@ -241,6 +246,31 @@ public class HighOrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已达到每日加油次数上限");
}
if (StringUtils.isNotBlank(highOrder.getGasStaffCode())) {
String qrCodeSignKey = commonService.getDictionaryCodeName("QR_CODE_SIGN_KEY", "1");
if (StringUtils.isBlank(qrCodeSignKey)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知秘钥");
}
String staffId;
try {
staffId = AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(URLDecoder.decode(highOrder.getGasStaffCode(),"UTF-8")), qrCodeSignKey);
} catch (Exception e) {
log.error("HighOrderController --> addOrder() error!", "收银员code解析失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "收银员code解析失败");
}
// 查询员工
HighGasStaff gasStaff = gasStaffService.getStaffDetailById(Long.parseLong(staffId));
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知收银员");
}
if (gasStaff.getMerchantStoreId().equals(childOrder.getGoodsId())) {
childOrder.setGasStaffId(gasStaff.getId());
childOrder.setGasStaffName(gasStaff.getName());
}
}
// 查询门店
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(childOrder.getGoodsId());
if (store == null) {

File diff suppressed because one or more lines are too long

@ -64,6 +64,9 @@ public class HighThirdPartyController {
@Autowired
private UserCenter userCenter;
@Resource
private ApiMemberProductService apiMemberProductService;
@RequestMapping(value = "/getAllCity", method = RequestMethod.GET)
@ResponseBody
@ -110,9 +113,23 @@ public class HighThirdPartyController {
List<ApiStarbucksProducts> list = apiProductService.getStarbucksProducts(map);
for (ApiStarbucksProducts apiStarbucksProducts : list) {
apiStarbucksProducts.setExt1(String.valueOf(i));
apiStarbucksProducts.setSalesVentiPrice(apiStarbucksProducts.getSalesVentiPrice().add(apiStarbucksProducts.getSalesVentiPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP));
apiStarbucksProducts.setSalesTallPrice(apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getSalesTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP));
apiStarbucksProducts.setSalesGrandePrice(apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getSalesGrandePrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP));
BigDecimal salesVentiPrice = apiStarbucksProducts.getSalesVentiPrice().add(apiStarbucksProducts.getSalesVentiPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
BigDecimal salesTallPrice = apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getSalesTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
BigDecimal salesGrandePrice = apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getSalesGrandePrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
if (salesVentiPrice.compareTo(apiStarbucksProducts.getMarketVentiPrice()) > 0) {
salesVentiPrice = apiStarbucksProducts.getMarketVentiPrice();
}
if (salesTallPrice.compareTo(apiStarbucksProducts.getMarketTallPrice()) > 0) {
salesTallPrice = apiStarbucksProducts.getMarketTallPrice();
}
if (salesGrandePrice.compareTo(apiStarbucksProducts.getMarketGrandePrice()) > 0) {
salesGrandePrice = apiStarbucksProducts.getMarketGrandePrice();
}
apiStarbucksProducts.setSalesVentiPrice(salesVentiPrice);
apiStarbucksProducts.setSalesTallPrice(salesTallPrice);
apiStarbucksProducts.setSalesGrandePrice(salesGrandePrice);
starbucksProductsList.add(apiStarbucksProducts);
}
starbucksProducts.setName(s);
@ -154,7 +171,8 @@ public class HighThirdPartyController {
@ResponseBody
@ApiOperation(value = "查询肯德基门店")
public ResponseData getKfcStoresList(@RequestParam(name = "storeName", required = false) String storeName,
@RequestParam(name = "cityCode", required = true) String cityCode,
@RequestParam(name = "cityCode", required = false) String cityCode,
@RequestParam(name = "cityName", required = false) String cityName,
@RequestParam(name = "lat", required = true) String lat,
@RequestParam(name = "lon", required = true) String lon) {
try {
@ -162,6 +180,7 @@ public class HighThirdPartyController {
Map<String, Object> map = new HashMap<>();
map.put("storeName", storeName);
map.put("cityCode", cityCode);
map.put("cityName", cityName);
List<ApiKfcStores> list = apiProductService.getKfcStoresList(map);
@ -199,7 +218,7 @@ public class HighThirdPartyController {
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId));
if (region != null) {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
productDiscount = thirdProductConfig.getProductConfigNum(1, bsCompany.getId());
productDiscount = thirdProductConfig.getProductConfigNum(2, bsCompany.getId());
}
if (productDiscount == null) {
@ -216,13 +235,22 @@ public class HighThirdPartyController {
for (Object products : dataObject.getJSONArray("products")) {
JSONObject productsObject = (JSONObject) products;
BigDecimal productsPrice = productsObject.getBigDecimal("price");
productsObject.put("salePrice", productsPrice.add(productsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP));
BigDecimal salePriceF = productsPrice.add(productsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP);
if (salePriceF.compareTo(productsObject.getBigDecimal("originalPrice")) > 0) {
salePriceF = productsObject.getBigDecimal("originalPrice");
}
productsObject.put("salePrice", salePriceF);
if (productsObject.getJSONArray("specGroups") != null) {
for (Object specGroups : productsObject.getJSONArray("specGroups")) {
JSONObject specGroupsObject = (JSONObject) specGroups;
BigDecimal specGroupsPrice = specGroupsObject.getBigDecimal("price");
specGroupsObject.put("salePrice", specGroupsPrice.add(specGroupsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP));
BigDecimal salePrice = specGroupsPrice.add(specGroupsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP);
if (salePrice.compareTo(specGroupsObject.getBigDecimal("originalPrice")) > 0) {
salePrice = specGroupsObject.getBigDecimal("originalPrice");
}
specGroupsObject.put("salePrice", salePrice);
}
}
}
@ -278,10 +306,10 @@ public class HighThirdPartyController {
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
System.out.println("======================================================" + object);
if (StringUtils.isBlank(object.getString("customerMobile")) ||
StringUtils.isBlank(object.getString("regionId")) ||
StringUtils.isBlank(object.getString("storeCode")) ||
object.getInteger("productType") == null ||
object.getInteger("platformId") == null
) {
@ -330,7 +358,7 @@ public class HighThirdPartyController {
BeanUtils.copyProperties(order, partyModel);
partyModel.setCode(object.getJSONObject("data").getString("ticket"));
partyModel.setThirdOrderStatus(object.getJSONObject("data").getInteger("status"));
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc"));
if (object.getJSONObject("data").getString("ticket") != null) {
String[] s = object.getJSONObject("data").getString("ticket").split(",");
@ -359,7 +387,7 @@ public class HighThirdPartyController {
if (object.getBoolean("success")) {
BeanUtils.copyProperties(order, partyModel);
partyModel.setCode(object.getJSONObject("data").getString("ticket"));
partyModel.setThirdOrderStatus(object.getJSONObject("data").getInteger("status"));
partyModel.setStatusDesc(object.getJSONObject("data").getString("statusDesc"));
partyModel.setObject(object.getJSONObject("data"));
@ -396,12 +424,12 @@ public class HighThirdPartyController {
partyModel.setList(list);
}
} else {
}else {
log.error("getThirdOrderByOrderId error!", "查询失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("message"));
}
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 10) {
BeanUtils.copyProperties(order, partyModel);
}
return ResponseMsgUtil.success(partyModel);
@ -434,4 +462,51 @@ public class HighThirdPartyController {
}
}
@RequestMapping(value = "/getMemberProducts", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询会员产品")
public ResponseData getMemberProducts(@RequestParam(name = "name", required = false) String name,
@RequestParam(value = "typeId", required = true) Integer typeId,
@RequestParam(value = "brandId", required = true) Integer brandId,
@RequestParam(value = "regionId", required = true) String regionId) {
try {
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId));
BigDecimal productDiscount = null;
if (region != null) {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
productDiscount = thirdProductConfig.getProductConfigNum(3, bsCompany.getId());
}
if (productDiscount == null) {
log.error("getRechargeProduct error!", "查询失败!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前地区未配置产品");
}
Map<String, Object> map = new HashMap<>();
map.put("name" , name);
map.put("typeId" , typeId);
map.put("brandId" , brandId);
List<ApiMemberProduct> list = apiMemberProductService.getListApiMemberProduct(map);
for (ApiMemberProduct memberProduct : list) {
BigDecimal costPrice = memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
if (costPrice.compareTo(memberProduct.getPrice()) > 0) {
costPrice = memberProduct.getPrice();
}
memberProduct.setCostPrice(costPrice);
}
return ResponseMsgUtil.success(list);
} catch (Exception e) {
log.error("HighUserCardController --> oilCardRefund() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -6,18 +6,17 @@ import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.AESEncodeUtil;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.*;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.HighDiscountAgentCodeService;
import com.hai.service.HighDiscountCouponRelService;
import com.hai.service.HighDiscountUserRelService;
import com.hai.service.HighOpenApiService;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -27,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.net.URLDecoder;
import java.util.*;
import java.util.stream.Collectors;
@ -45,6 +45,12 @@ public class HighUserDiscountController {
@Autowired
private UserCenter userCenter;
@Resource
private HighDiscountService discountService;
@Resource
private HighDiscountAgentRelService discountAgentRelService;
@Resource
private HighDiscountUserRelService highDiscountUserRelService;
@ -56,7 +62,7 @@ public class HighUserDiscountController {
@RequestMapping(value="/receiveDiscount",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "用户领取优惠券")
@ApiOperation(value = "用户领取优惠券码【领取优惠码值】")
public ResponseData receiveDiscount(@RequestBody String reqBody, HttpServletRequest request) {
try {
@ -70,6 +76,7 @@ public class HighUserDiscountController {
log.error("HighDiscountController -> receiveDiscount() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 领取
highDiscountUserRelService.receiveDiscount(userInfoModel.getHighUser().getId(), codeId);
return ResponseMsgUtil.success("领取成功");
@ -84,6 +91,55 @@ public class HighUserDiscountController {
}
}
@RequestMapping(value="/receive",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "用户领取优惠券【领取优惠】")
public ResponseData receive(@RequestBody String reqBody, HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
JSONObject jsonObject = JSONObject.parseObject(reqBody);
String discountAgentCode = jsonObject.getString("code");
if (StringUtils.isBlank(discountAgentCode)) {
log.error("HighDiscountController -> receiveDiscount() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 解密
String discountAgentId = AESEncodeUtil.aesDecrypt(URLDecoder.decode(discountAgentCode, "UTF-8"));
HighDiscountAgentRel discountAgentRel = discountAgentRelService.getRelById(Long.parseLong(discountAgentId));
if (discountAgentRel == null) {
log.error("HighDiscountController -> receiveDiscount() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知优惠券");
}
// 查询优惠券信息
HighDiscount discount = discountService.getDiscountById(discountAgentRel.getDiscountId());
if (discount == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券");
}
if (!discount.getStatus().equals(2)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法领取,优惠券活动已过期");
}
// 领取
highDiscountUserRelService.receive(userInfoModel.getHighUser().getId(), discountAgentRel.getId());
return ResponseMsgUtil.success("领取成功");
} catch (DeadlockLoserDataAccessException deadlockLoserDataAccessException) {
log.error("HighActivityController -> userLottery() error!", "服务器繁忙");
return ResponseMsgUtil.builderResponse(ErrorCode.SERVER_BUSY_ERROR.getCode(),ErrorCode.SERVER_BUSY_ERROR.getMsg(),null);
} catch (Exception e) {
log.error("HighDiscountController -> receiveDiscount() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getUserDiscountList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户的优惠券列表")

@ -6,6 +6,7 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.pay.WechatPayUtil;
import com.hai.common.pay.entity.OrderType;
import com.hai.common.pay.entity.WeChatPayReqInfo;
import com.hai.common.pay.util.MD5Util;
import com.hai.common.security.AESEncodeUtil;
@ -44,7 +45,7 @@ import java.util.concurrent.ThreadLocalRandom;
@Controller
@RequestMapping(value = "/thirdOrder")
@Api(value = "第三方订单支付接口")
public class thirdOrderController {
public class ThirdOrderController {
private static Logger log = LoggerFactory.getLogger(TuanYouController.class);
@ -102,9 +103,11 @@ public class thirdOrderController {
map.put("orderNo", order.getOrderNo());
map.put("payPrice", order.getPayRealPrice());
if (order.getHighChildOrderList().get(0).getGoodsType() == 4) {
map.put("orderScene", "KFC_ORDER");
map.put("orderScene", OrderType.KFC_ORDER.getModuleCode());
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) {
map.put("orderScene", "STARBUCKS_ORDER");
map.put("orderScene", OrderType.STARBUCKS_ORDER.getModuleCode());
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 10) {
map.put("orderScene", OrderType.THIRD_ORDER.getModuleCode());
}
// 肯德基订单 星巴克订单

@ -115,6 +115,9 @@ public class UnionPayController {
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private ApiMemberProductService apiMemberProductService;
@RequestMapping(value = "/notify", method = RequestMethod.POST)
@ApiOperation(value = "银联支付 -> 异步回调")
public void notify(@RequestBody String params,HttpServletRequest request, HttpServletResponse response) {
@ -347,14 +350,27 @@ public class UnionPayController {
}
}
HighGasOrderPush orderPush = new HighGasOrderPush();
JSONObject returnObject = new JSONObject();
if (order.getHighChildOrderList().get(0).getGoodsType() == 4) {
QianZhuConfig.payKfcOrder(order.getOrderNo());
returnObject = QianZhuConfig.payKfcOrder(order.getOrderNo());
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) {
QianZhuConfig.starbucksOrdersPay(order.getOrderNo());
returnObject = QianZhuConfig.starbucksOrdersPay(order.getOrderNo());
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 10){
orderPush.setType(OrderPushType.type9.getType());
ApiMemberProduct memberProduct = apiMemberProductService.findById(order.getHighChildOrderList().get(0).getGoodsId());
returnObject = QianZhuConfig.insertV2(memberProduct.getProductId() , order.getOrderNo() , order.getRemarks());
}
highOrderService.updateOrder(order);
orderPush.setOrderNo(order.getOrderNo());
orderPush.setCreateTime(new Date());
orderPush.setRequestContent(order.getOrderNo());
orderPush.setReturnContent(returnObject.toJSONString());
highGasOrderPushMapper.insert(orderPush);
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
new Thread(() -> {

@ -114,7 +114,6 @@ public class WechatPayController {
+ "<return_msg><![CDATA[签名验证错误]]></return_msg>" + "</xml> ";
}*/
new Thread(() -> {
// 查询订单信息
HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no"));

@ -3,6 +3,7 @@ package com.hai.schedule;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hai.config.QianZhuConfig;
import com.hai.entity.ApiKfcStores;
import com.hai.entity.ApiStarbucksProducts;
import com.hai.service.ApiProductService;
import org.slf4j.Logger;
@ -12,6 +13,8 @@ import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Configuration
public class ApiThirdProductSchedule {
@ -69,4 +72,49 @@ public class ApiThirdProductSchedule {
}
}
@Scheduled(cron = "0 0 1 * * ?") // 获取星巴克产品 每日凌晨1点执行一次
public void getKfcStore() throws Exception {
JSONObject jsonObject = QianZhuConfig.getKfcStore();
JSONArray object = jsonObject.getJSONArray("data");
for (Object data : object) {
JSONObject dataObject = (JSONObject) data;
Map<String, Object> mapStore = new HashMap<>();
mapStore.put("storeCode" , dataObject.getString("storeCode"));
ApiKfcStores apiKfcStores = apiProductService.findKfcStores(mapStore);
if (apiKfcStores == null) {
apiKfcStores = new ApiKfcStores();
}
apiKfcStores.setProvinceCode(dataObject.getString("provinceCode"));
apiKfcStores.setProvinceName(dataObject.getString("provinceName"));
apiKfcStores.setCityCode(dataObject.getString("cityCode"));
apiKfcStores.setCityName(dataObject.getString("cityName"));
apiKfcStores.setCityNameFirstLetter(dataObject.getString("cityNameFirstLetter"));
apiKfcStores.setKfcCityId(dataObject.getInteger("kfcCityId"));
apiKfcStores.setKfcCityCode(dataObject.getString("kfcCityCode"));
apiKfcStores.setStoreName(dataObject.getString("storeName"));
apiKfcStores.setStoreCode(dataObject.getString("storeCode"));
apiKfcStores.setLon(dataObject.getString("lon"));
apiKfcStores.setLat(dataObject.getString("lat"));
apiKfcStores.setAddress(dataObject.getString("address"));
apiKfcStores.setStartTime(dataObject.getString("startTime"));
apiKfcStores.setEndTime(dataObject.getString("endTime"));
apiKfcStores.setStoreStatus(dataObject.getInteger("storeStatus"));
apiKfcStores.setShelfStatus(dataObject.getInteger("shelfStatus"));
if (apiKfcStores.getId() == null) {
apiKfcStores.setCreateTime(new Date());
apiKfcStores.setOperatorId(9999L);
apiKfcStores.setOperatorName("系统生成");
apiKfcStores.setStatus(100);
apiProductService.insertKfcStore(apiKfcStores);
} else {
apiKfcStores.setUpdateTime(new Date());
apiProductService.updateKfcStore(apiKfcStores);
}
}
}
}

@ -23,6 +23,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* @Auther: 胡锐
@ -92,13 +93,12 @@ public class HighOrderSchedule {
* @Date 14:18 2022/5/31
* @Param []
*/
@Scheduled(cron = "0 0/5 * * * ?") //每10分钟执行一次
@Scheduled(cron = "0 0/5 * * * ?") //每5分钟执行一次
public void initRechargeOrder() {
Map<String, Object> map = new HashMap<>();
map.put("payStatus", String.valueOf(102));
map.put("rechargeStatus", String.valueOf(204));
List<OutRechargeOrder> orderList = outRechargeOrderService.getListRechargeOrder(map);
if (orderList.size() > 0) {
for (OutRechargeOrder order : orderList) {
try {
@ -109,6 +109,7 @@ public class HighOrderSchedule {
List<OutRechargeChildOrder> childOrderList = rechargeChildOrderService.getListRechargeChildOrder(childOrderMap);
System.out.println("话费定时任务 -> 判断是否存在已支付订单:订单id:" + order.getId());
if (childOrderList.size() == 0) {
Date rechargeTime = order.getCreateTimed();
Date currentTime = new Date();
@ -116,14 +117,17 @@ public class HighOrderSchedule {
// 判断快充 并且 充值时间小于6
if (order.getRechargeType() == 1 && hours < 6) {
System.out.println("话费定时任务 -> 请求快充:订单id:" + order.getId());
outRechargeOrderService.pollRequest(order);
return;
continue;
}
// 判断慢充 并且 充值时间小于72
if (order.getRechargeType() == 2 && hours < 72) {
System.out.println("话费定时任务 -> 请求慢充:订单id:" + order.getId());
outRechargeOrderService.pollRequest(order);
return;
continue;
}
System.out.println("话费定时任务 -> 退款任务" + order.getId());
outRechargeOrderService.rechargeOrderToRefund(order.getId());
}
@ -132,6 +136,7 @@ public class HighOrderSchedule {
}
}
}
System.out.println("话费定时任务 -> 结束任务");
}
/**
@ -254,6 +259,32 @@ public class HighOrderSchedule {
}
}
}
} else if (highOrder.getHighChildOrderList().get(0).getGoodsType() == 10) {
// 会员充值订单
// 根据订单号查询订单详情
JSONObject orderObject = QianZhuConfig.QueryV2(highOrder.getOrderNo());
if (orderObject != null && orderObject.getLong("Code") == 999) {
// 订单失败 // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败
if (orderObject.getJSONObject("Data").getInteger("OrderState") == 3) {
// 订单失败
if (order.getOrderStatus() == 2) {
highOrderService.thirdOrderToRefund(order.getId());
} else {
highOrderService.thirdCancelOrder(order.getId());
}
}
// 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败
if (orderObject.getJSONObject("Data").getInteger("OrderState") == 2) {
for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) {
childOrder.setChildOrdeStatus(3);
}
highOrder.setOrderStatus(3);
highOrder.setFinishTime(new Date());
highOrderService.updateOrder(highOrder);
}
}
}
}
} catch (Exception e) {

@ -26,6 +26,7 @@ public enum ErrorCode {
WECHAT_LOGIN_ERROR("3002","微信登录失败"),
WECHAT_LOGIN_TEACHER_ERROR("3003","当前微信用户不是老师,请联系管理员"),
SERVER_BUSY_ERROR("3004","服务器繁忙,请稍后重试"),
FREQUENT_REQUESTS("3005","服务器繁忙,请稍后重试"),
//////////////////业务异常/////////////
COMMON_ERROR("2000",""),

@ -8,6 +8,7 @@ public enum OrderType {
STARBUCKS_ORDER("STARBUCKS", "starbucksOrderService", "星巴克订单"),
CINEMA_ORDER("CINEMA", "cinemaOrderService", "电影票订单"),
MOBILE_ORDER("MOBILE", "mobileOrderService", "话费充值订单"),
THIRD_ORDER("THIRD", "thirdOrderService", "会员充值充值订单"),
TEST("TEST", "testPayService", "支付测试"),
;

@ -7,6 +7,7 @@ import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
import java.math.BigInteger;
import java.net.URLDecoder;
import java.security.SecureRandom;
import java.util.Base64;
@ -63,7 +64,7 @@ public class AESEncodeUtil {
public static void main(String[] args) throws Exception{
long currentTimeMillis = System.currentTimeMillis();
System.out.println(AESEncodeUtil.aesDecrypt(Base64Util.decode("ZStZUjRIcFl5SVo4MEhzSU96MldDUEFZa3lmbUhpNTdKMGhCVytIY3NJaz0")));
System.out.println(AESEncodeUtil.aesDecrypt(URLDecoder.decode("mL4laIILGps4E58w8sbseQ%3D%3D", "UTF-8")));
/* String content = "{\"create_time\":1573544092110,\"order_serial_no\":\"40280e816db49c0b016db4a2c31f0004\",\"product_code\":\"8a9e80045cf85e54015cf8809fcd\",\"product_name\":\"平安发票贷\",\"uscc\":\"91370781687233838E\"}";
System.out.println("加密前" + content);

@ -490,6 +490,7 @@ public class HttpsUtils {
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
System.out.println("-------------------------------------------" + httpStr);
return JSON.parseObject(httpStr);
} catch (Exception e) {
log.error(e.getMessage(),e);
@ -505,6 +506,42 @@ public class HttpsUtils {
return null;
}
public static JSONObject doPostByCy(String apiUrl, Map<String,Object> body) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
String httpStr = null;
CloseableHttpResponse response = null;
try {
HttpPost httpPost = new HttpPost(apiUrl);
httpPost.setConfig(requestConfig);
StringEntity stringEntity = new StringEntity(JSON.toJSONString(body), "UTF-8");// 解决中文乱码问题
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
System.out.println("-------------------------------------------" + httpStr);
return JSON.parseObject(httpStr);
} catch (Exception e) {
log.error(e.getMessage(),e);
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
log.error(e.getMessage(),e);
}
}
}
return null;
}
public static JSONObject doPostForm(String apiUrl, String body, Map<String,Object> header) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {

@ -438,6 +438,38 @@ public class WxUtils {
}
}
/**
* 生成龙阅签名. 注意若含有sign_type字段必须和signType参数保持一致
*
* @param data 待签名数据
* @param key API密钥
* @param signType 签名方式
* @return 签名
*/
public static String generateSignatureCy(final Map<String, Object> data, String key, WXPayConstants.SignType signType) throws Exception {
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) {
continue;
}
if (data.get(k) != null) // 参数值为空,则不参与签名
sb.append(k).append("=").append(data.get(k)).append("&");
}
sb.append("appsecret=").append(key);
if (WXPayConstants.SignType.MD5.equals(signType)) {
return MD5(sb.toString() , true);
}
else if (WXPayConstants.SignType.HMACSHA256.equals(signType)) {
return HMACSHA256(sb.toString(), key);
}
else {
throw new Exception(String.format("Invalid sign_type: %s", signType));
}
}
/**
* 生成签名.
*

@ -80,6 +80,10 @@ public class CommonSysConfig {
private String JjUrl;
private String JjAppSecret;
private String CyApiKey;
private String CyAppSecret;
private String CyPostUrl;
private String unionAppId;
private String unionSecret;
private String unionRsaKey;
@ -548,4 +552,28 @@ public class CommonSysConfig {
public void setThirdPostUrl(String thirdPostUrl) {
this.thirdPostUrl = thirdPostUrl;
}
public String getCyApiKey() {
return CyApiKey;
}
public void setCyApiKey(String cyApiKey) {
CyApiKey = cyApiKey;
}
public String getCyAppSecret() {
return CyAppSecret;
}
public void setCyAppSecret(String cyAppSecret) {
CyAppSecret = cyAppSecret;
}
public String getCyPostUrl() {
return CyPostUrl;
}
public void setCyPostUrl(String cyPostUrl) {
CyPostUrl = cyPostUrl;
}
}

@ -42,6 +42,9 @@ public class HuiLianTongConfig {
@Resource
private RedisUtil redisUtil;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
/**
* 获取token
* @return
@ -155,7 +158,6 @@ public class HuiLianTongConfig {
JSONObject o = HuiLianTongUnionCardConfig.syncPayOrder(mapPost);
System.out.println("订单同步请求参数---------" + mapPost);
System.out.println("订单同步请求结果---------" + o);
}
}
} catch (Exception e) {

@ -2,22 +2,14 @@ package com.hai.config;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.MD5Util;
import com.hai.common.utils.WxUtils;
import com.hai.entity.OutRechargeChildOrder;
import com.hai.entity.OutRechargeOrder;
import com.hai.entity.OutRechargePrice;
import com.hai.service.OutRechargeChildOrderService;
import com.hai.service.OutRechargeOrderService;
import com.hai.service.OutRechargePriceService;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -143,4 +135,48 @@ public class RechargeConfig {
}
/**
* @Author Sum1Dream
* @name rechargeOrderByCy.java
* @Description // 城宇话费下单
* @Date 10:22 2022/7/14
* @Param [com.alibaba.fastjson.JSONObject]
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject rechargeOrderByCy(JSONObject object) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("agentOrderId" , object.getString("agentOrderId"));
paramMap.put("productId" , object.getInteger("productId"));
paramMap.put("mobile" , object.getString("mobile"));
paramMap.put("timestamp" , DateUtil.date2String(new Date() , DateUtil.Y_M_D_HMS));
paramMap.put("appid" , CommonSysConst.getSysConfig().getCyApiKey());
paramMap.put("sign", WxUtils.generateSignatureCy(paramMap , CommonSysConst.getSysConfig().getCyAppSecret() , WXPayConstants.SignType.MD5));
return HttpsUtils.doPostByCy(CommonSysConst.getSysConfig().getCyPostUrl()+ "/api/interface/recharge", paramMap);
}
/**
* @Author Sum1Dream
* @name rechargeOrderByCy.java
* @Description // 城宇话费查询订单详情
* @Date 10:22 2022/7/14
* @Param [com.alibaba.fastjson.JSONObject]
* @return com.alibaba.fastjson.JSONObject
*/
public static JSONObject queryRechargeByCy(JSONObject object) throws Exception {
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("orderId" , object.getString("orderNo"));
paramMap.put("timestamp" , DateUtil.date2String(new Date() , DateUtil.Y_M_D_HMS));
paramMap.put("appid" , CommonSysConst.getSysConfig().getCyApiKey());
paramMap.put("sign", WxUtils.generateSignatureCy(paramMap , CommonSysConst.getSysConfig().getCyAppSecret() , WXPayConstants.SignType.MD5));
return HttpsUtils.doPostByCy(CommonSysConst.getSysConfig().getCyPostUrl()+ "/api/interface/queryRecharge", paramMap);
}
}

@ -1,5 +1,9 @@
package com.hai.config;
import com.hai.common.utils.DateUtil;
import java.util.Date;
/**
* 商鹏打印机模板
* @author hurui
@ -21,17 +25,20 @@ public class SpPrinterTemplate {
public static String oilCashierStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice) {
String orderPrice) throws Exception {
String str = "<C><B>" + gasName + "</B></C> <BR> " +
"<C>(收银员存根)</C> <BR>" +
"------------------------------<BR>" +
"流水:" + orderNo + "<BR>" +
"------------------------------<BR>" +
"时间:" + payTime + "<BR>" +
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"支付时间:" + payTime + "<BR>" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "<BR>" +
"来源:" + source + "<BR>" +
"油枪:"+ gunNo + "号<BR>" +
"油品:" + oilNo + "#<BR>" +
@ -60,17 +67,20 @@ public class SpPrinterTemplate {
public static String oilClientStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice) {
String orderPrice) throws Exception {
String str = "<C><B>" + gasName + "</B></C> <BR> " +
"<C>(客户存根)</C> <BR>" +
"------------------------------<BR>" +
"流水:" + orderNo + "<BR>" +
"------------------------------<BR>" +
"时间:" + payTime + "<BR>" +
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"支付时间:" + payTime + "<BR>" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "<BR>" +
"来源:" + source + "<BR>" +
"油枪:"+ gunNo + "号<BR>" +
"油品:" + oilNo + "#<BR>" +

@ -11,6 +11,180 @@ import java.util.Date;
*/
public class ZkcPrinterTemplate {
/**
* 加油站
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @return
*/
public static byte[] oilTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write(gasName.getBytes("UTF-8"));
stream.write(0x0A);
stream.write("(收银员存根)".getBytes("UTF-8"));
stream.write(0x0A);
// 左对齐
stream.write(0x1B);
stream.write(0x61);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("流水号:" + orderNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("支付时间:" + payTime).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油品:" + oilNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));
stream.write(0x0A);
stream.write("实际加油升数以加油机为准!".getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x0E);
stream.write("加油金额".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("¥" + orderPrice).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x21);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write("开心又省钱;来“ 嗨森逛 ”".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
// 居中
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write(gasName.getBytes("UTF-8"));
stream.write(0x0A);
stream.write("(客户存根)".getBytes("UTF-8"));
stream.write(0x0A);
// 左对齐
stream.write(0x1B);
stream.write(0x61);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("流水号:" + orderNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("支付时间:" + payTime).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油品:" + oilNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));
stream.write(0x0A);
stream.write("实际加油升数以加油机为准!".getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x0E);
stream.write("加油金额".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("¥" + orderPrice).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x21);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write("开心又省钱;来“ 嗨森逛 ”".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
return getPrinterBytes(stream.toByteArray(), 1, "UTF-8");
}
/**
* 加油站收银员存根模板
* @param gasName 油站名称
@ -26,6 +200,7 @@ public class ZkcPrinterTemplate {
public static byte[] oilCashierStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
@ -60,6 +235,9 @@ public class ZkcPrinterTemplate {
stream.write(("支付时间:" + payTime).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A);
@ -101,6 +279,8 @@ public class ZkcPrinterTemplate {
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
return getPrinterBytes(stream.toByteArray(), 1, "UTF-8");
}
@ -119,6 +299,7 @@ public class ZkcPrinterTemplate {
public static byte[] oilClientStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
@ -154,6 +335,9 @@ public class ZkcPrinterTemplate {
stream.write(("支付时间:" + payTime).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A);

@ -54,7 +54,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
"gas_price_vip, gas_price_official, ",
"gas_oil_liters, gas_discount, ",
"gas_oil_subsidy, gas_liters_preferences, ",
"gas_price_preferences, gas_salesman_id, ",
"gas_price_preferences, gas_staff_id, ",
"gas_staff_name, gas_salesman_id, ",
"gas_salesman_name, gas_agent_id, ",
"gas_agent_name, gas_org_id, ",
"gas_org_name, ext_1, ",
@ -75,7 +76,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
"#{gasPriceVip,jdbcType=DECIMAL}, #{gasPriceOfficial,jdbcType=DECIMAL}, ",
"#{gasOilLiters,jdbcType=DECIMAL}, #{gasDiscount,jdbcType=DECIMAL}, ",
"#{gasOilSubsidy,jdbcType=DECIMAL}, #{gasLitersPreferences,jdbcType=DECIMAL}, ",
"#{gasPricePreferences,jdbcType=DECIMAL}, #{gasSalesmanId,jdbcType=BIGINT}, ",
"#{gasPricePreferences,jdbcType=DECIMAL}, #{gasStaffId,jdbcType=BIGINT}, ",
"#{gasStaffName,jdbcType=VARCHAR}, #{gasSalesmanId,jdbcType=BIGINT}, ",
"#{gasSalesmanName,jdbcType=VARCHAR}, #{gasAgentId,jdbcType=BIGINT}, ",
"#{gasAgentName,jdbcType=VARCHAR}, #{gasOrgId,jdbcType=BIGINT}, ",
"#{gasOrgName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
@ -123,6 +125,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
@Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_liters_preferences", property="gasLitersPreferences", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_preferences", property="gasPricePreferences", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_salesman_id", property="gasSalesmanId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_salesman_name", property="gasSalesmanName", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_agent_id", property="gasAgentId", jdbcType=JdbcType.BIGINT),
@ -145,8 +149,9 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
"sale_count, total_price, giveaway_type, child_orde_status, praise_status, gas_oil_no, ",
"gas_gun_no, gas_oil_type, gas_order_no, gas_price_platform, gas_price_gun, gas_price_vip, ",
"gas_price_official, gas_oil_liters, gas_discount, gas_oil_subsidy, gas_liters_preferences, ",
"gas_price_preferences, gas_salesman_id, gas_salesman_name, gas_agent_id, gas_agent_name, ",
"gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ext_4, ext_5, ext_6",
"gas_price_preferences, gas_staff_id, gas_staff_name, gas_salesman_id, gas_salesman_name, ",
"gas_agent_id, gas_agent_name, gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ",
"ext_4, ext_5, ext_6",
"from high_child_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -183,6 +188,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
@Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_liters_preferences", property="gasLitersPreferences", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_preferences", property="gasPricePreferences", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_salesman_id", property="gasSalesmanId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_salesman_name", property="gasSalesmanName", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_agent_id", property="gasAgentId", jdbcType=JdbcType.BIGINT),
@ -240,6 +247,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
"gas_oil_subsidy = #{gasOilSubsidy,jdbcType=DECIMAL},",
"gas_liters_preferences = #{gasLitersPreferences,jdbcType=DECIMAL},",
"gas_price_preferences = #{gasPricePreferences,jdbcType=DECIMAL},",
"gas_staff_id = #{gasStaffId,jdbcType=BIGINT},",
"gas_staff_name = #{gasStaffName,jdbcType=VARCHAR},",
"gas_salesman_id = #{gasSalesmanId,jdbcType=BIGINT},",
"gas_salesman_name = #{gasSalesmanName,jdbcType=VARCHAR},",
"gas_agent_id = #{gasAgentId,jdbcType=BIGINT},",

@ -152,6 +152,14 @@ public class HighChildOrderSqlProvider {
sql.VALUES("gas_price_preferences", "#{gasPricePreferences,jdbcType=DECIMAL}");
}
if (record.getGasStaffId() != null) {
sql.VALUES("gas_staff_id", "#{gasStaffId,jdbcType=BIGINT}");
}
if (record.getGasStaffName() != null) {
sql.VALUES("gas_staff_name", "#{gasStaffName,jdbcType=VARCHAR}");
}
if (record.getGasSalesmanId() != null) {
sql.VALUES("gas_salesman_id", "#{gasSalesmanId,jdbcType=BIGINT}");
}
@ -241,6 +249,8 @@ public class HighChildOrderSqlProvider {
sql.SELECT("gas_oil_subsidy");
sql.SELECT("gas_liters_preferences");
sql.SELECT("gas_price_preferences");
sql.SELECT("gas_staff_id");
sql.SELECT("gas_staff_name");
sql.SELECT("gas_salesman_id");
sql.SELECT("gas_salesman_name");
sql.SELECT("gas_agent_id");
@ -398,6 +408,14 @@ public class HighChildOrderSqlProvider {
sql.SET("gas_price_preferences = #{record.gasPricePreferences,jdbcType=DECIMAL}");
}
if (record.getGasStaffId() != null) {
sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}");
}
if (record.getGasStaffName() != null) {
sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}");
}
if (record.getGasSalesmanId() != null) {
sql.SET("gas_salesman_id = #{record.gasSalesmanId,jdbcType=BIGINT}");
}
@ -486,6 +504,8 @@ public class HighChildOrderSqlProvider {
sql.SET("gas_oil_subsidy = #{record.gasOilSubsidy,jdbcType=DECIMAL}");
sql.SET("gas_liters_preferences = #{record.gasLitersPreferences,jdbcType=DECIMAL}");
sql.SET("gas_price_preferences = #{record.gasPricePreferences,jdbcType=DECIMAL}");
sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}");
sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}");
sql.SET("gas_salesman_id = #{record.gasSalesmanId,jdbcType=BIGINT}");
sql.SET("gas_salesman_name = #{record.gasSalesmanName,jdbcType=VARCHAR}");
sql.SET("gas_agent_id = #{record.gasAgentId,jdbcType=BIGINT}");
@ -632,6 +652,14 @@ public class HighChildOrderSqlProvider {
sql.SET("gas_price_preferences = #{gasPricePreferences,jdbcType=DECIMAL}");
}
if (record.getGasStaffId() != null) {
sql.SET("gas_staff_id = #{gasStaffId,jdbcType=BIGINT}");
}
if (record.getGasStaffName() != null) {
sql.SET("gas_staff_name = #{gasStaffName,jdbcType=VARCHAR}");
}
if (record.getGasSalesmanId() != null) {
sql.SET("gas_salesman_id = #{gasSalesmanId,jdbcType=BIGINT}");
}

@ -44,21 +44,21 @@ public interface HighDiscountMapper extends HighDiscountMapperExt {
"discount_name, discount_img, ",
"discount_carousel_img, discount_type, ",
"discount_condition, discount_price, ",
"effective_day, sales_end_time, ",
"create_time, update_time, ",
"operator_id, operator_name, ",
"`status`, ext_1, ext_2, ",
"ext_3)",
"receive_number, effective_day, ",
"sales_end_time, create_time, ",
"update_time, operator_id, ",
"operator_name, `status`, ",
"ext_1, ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{discountKey,jdbcType=VARCHAR}, ",
"#{usingRange,jdbcType=INTEGER}, #{useScope,jdbcType=INTEGER}, ",
"#{discountName,jdbcType=VARCHAR}, #{discountImg,jdbcType=VARCHAR}, ",
"#{discountCarouselImg,jdbcType=VARCHAR}, #{discountType,jdbcType=INTEGER}, ",
"#{discountCondition,jdbcType=DECIMAL}, #{discountPrice,jdbcType=DECIMAL}, ",
"#{effectiveDay,jdbcType=INTEGER}, #{salesEndTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
"#{receiveNumber,jdbcType=INTEGER}, #{effectiveDay,jdbcType=INTEGER}, ",
"#{salesEndTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighDiscount record);
@ -80,6 +80,7 @@ public interface HighDiscountMapper extends HighDiscountMapperExt {
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="receive_number", property="receiveNumber", jdbcType=JdbcType.INTEGER),
@Result(column="effective_day", property="effectiveDay", jdbcType=JdbcType.INTEGER),
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@ -96,9 +97,9 @@ public interface HighDiscountMapper extends HighDiscountMapperExt {
@Select({
"select",
"id, company_id, discount_key, using_range, use_scope, discount_name, discount_img, ",
"discount_carousel_img, discount_type, discount_condition, discount_price, effective_day, ",
"sales_end_time, create_time, update_time, operator_id, operator_name, `status`, ",
"ext_1, ext_2, ext_3",
"discount_carousel_img, discount_type, discount_condition, discount_price, receive_number, ",
"effective_day, sales_end_time, create_time, update_time, operator_id, operator_name, ",
"`status`, ext_1, ext_2, ext_3",
"from high_discount",
"where id = #{id,jdbcType=BIGINT}"
})
@ -114,6 +115,7 @@ public interface HighDiscountMapper extends HighDiscountMapperExt {
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="receive_number", property="receiveNumber", jdbcType=JdbcType.INTEGER),
@Result(column="effective_day", property="effectiveDay", jdbcType=JdbcType.INTEGER),
@Result(column="sales_end_time", property="salesEndTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@ -148,6 +150,7 @@ public interface HighDiscountMapper extends HighDiscountMapperExt {
"discount_type = #{discountType,jdbcType=INTEGER},",
"discount_condition = #{discountCondition,jdbcType=DECIMAL},",
"discount_price = #{discountPrice,jdbcType=DECIMAL},",
"receive_number = #{receiveNumber,jdbcType=INTEGER},",
"effective_day = #{effectiveDay,jdbcType=INTEGER},",
"sales_end_time = #{salesEndTime,jdbcType=TIMESTAMP},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",

@ -68,6 +68,10 @@ public class HighDiscountSqlProvider {
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}");
}
if (record.getReceiveNumber() != null) {
sql.VALUES("receive_number", "#{receiveNumber,jdbcType=INTEGER}");
}
if (record.getEffectiveDay() != null) {
sql.VALUES("effective_day", "#{effectiveDay,jdbcType=INTEGER}");
}
@ -128,6 +132,7 @@ public class HighDiscountSqlProvider {
sql.SELECT("discount_type");
sql.SELECT("discount_condition");
sql.SELECT("discount_price");
sql.SELECT("receive_number");
sql.SELECT("effective_day");
sql.SELECT("sales_end_time");
sql.SELECT("create_time");
@ -199,6 +204,10 @@ public class HighDiscountSqlProvider {
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
}
if (record.getReceiveNumber() != null) {
sql.SET("receive_number = #{record.receiveNumber,jdbcType=INTEGER}");
}
if (record.getEffectiveDay() != null) {
sql.SET("effective_day = #{record.effectiveDay,jdbcType=INTEGER}");
}
@ -258,6 +267,7 @@ public class HighDiscountSqlProvider {
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
sql.SET("receive_number = #{record.receiveNumber,jdbcType=INTEGER}");
sql.SET("effective_day = #{record.effectiveDay,jdbcType=INTEGER}");
sql.SET("sales_end_time = #{record.salesEndTime,jdbcType=TIMESTAMP}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
@ -318,6 +328,10 @@ public class HighDiscountSqlProvider {
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}");
}
if (record.getReceiveNumber() != null) {
sql.SET("receive_number = #{receiveNumber,jdbcType=INTEGER}");
}
if (record.getEffectiveDay() != null) {
sql.SET("effective_day = #{effectiveDay,jdbcType=INTEGER}");
}

@ -39,4 +39,8 @@ public interface HighDiscountUserRelMapperExt {
" ORDER BY hdur.create_time desc" +
"</script>"})
List<HighUserDiscountUnicomModel> getUserCouponsList(@Param("map") Map<String,Object> map);
@Select({"<script> select count(1) count from high_discount_user_rel where user_id = #{userId} and discount_id = #{discountId} and `status` <![CDATA[ <> 100 ]]> </script>"})
Integer receiveDiscountCount(@Param("userId") Long userId, @Param("discountId") Long discountId);
}

@ -42,15 +42,15 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt {
"insert into high_gas_staff (merchant_store_id, avatar, ",
"`name`, telephone, ",
"position_type, position_name, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"qr_code_img_url, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merchantStoreId,jdbcType=BIGINT}, #{avatar,jdbcType=VARCHAR}, ",
"#{name,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, ",
"#{positionType,jdbcType=INTEGER}, #{positionName,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{qrCodeImgUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighGasStaff record);
@ -68,6 +68,7 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt {
@Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
@Result(column="position_type", property="positionType", jdbcType=JdbcType.INTEGER),
@Result(column="position_name", property="positionName", jdbcType=JdbcType.VARCHAR),
@Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@ -80,7 +81,7 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt {
@Select({
"select",
"id, merchant_store_id, avatar, `name`, telephone, position_type, position_name, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"qr_code_img_url, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"from high_gas_staff",
"where id = #{id,jdbcType=BIGINT}"
})
@ -92,6 +93,7 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt {
@Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
@Result(column="position_type", property="positionType", jdbcType=JdbcType.INTEGER),
@Result(column="position_name", property="positionName", jdbcType=JdbcType.VARCHAR),
@Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@ -118,6 +120,7 @@ public interface HighGasStaffMapper extends HighGasStaffMapperExt {
"telephone = #{telephone,jdbcType=VARCHAR},",
"position_type = #{positionType,jdbcType=INTEGER},",
"position_name = #{positionName,jdbcType=VARCHAR},",
"qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",

@ -52,6 +52,10 @@ public class HighGasStaffSqlProvider {
sql.VALUES("position_name", "#{positionName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.VALUES("qr_code_img_url", "#{qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -92,6 +96,7 @@ public class HighGasStaffSqlProvider {
sql.SELECT("telephone");
sql.SELECT("position_type");
sql.SELECT("position_name");
sql.SELECT("qr_code_img_url");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
@ -143,6 +148,10 @@ public class HighGasStaffSqlProvider {
sql.SET("position_name = #{record.positionName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -182,6 +191,7 @@ public class HighGasStaffSqlProvider {
sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}");
sql.SET("position_type = #{record.positionType,jdbcType=INTEGER}");
sql.SET("position_name = #{record.positionName,jdbcType=VARCHAR}");
sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
@ -222,6 +232,10 @@ public class HighGasStaffSqlProvider {
sql.SET("position_name = #{positionName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.SET("qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -43,7 +43,7 @@ public interface HighOrderMapperExt {
List<HighOrder> getCloseOrder();
@Select({"select distinct * from high_order a left join high_child_order b on a.id = b.order_id where order_status in (1,2) and goods_type in (4,9) group by a.id;"})
@Select({"select distinct * from high_order a left join high_child_order b on a.id = b.order_id where order_status in (1,2) and goods_type in (4,9,10) group by a.id;"})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@ -1126,6 +1126,14 @@ public interface HighOrderMapperExt {
" and to_days(pay_time) = to_days(now())"})
Map<String, Object> selectGasTheDayOrderCount(@Param("storeId") Long storeId, @Param("status") String status);
@Select({" select" +
" case when SUM(b.total_price) is null then 0 else SUM(b.total_price) end price," +
" count(1) count" +
" from high_child_order a,high_order b " +
" where a.order_id = b.id and goods_type = 3 and gas_staff_id = #{gasStaffId} and b.order_status in (${status}) " +
" and to_days(pay_time) = to_days(now())"})
Map<String, Object> selectGasStaffTheDayOrderCount(@Param("gasStaffId") Long gasStaffId, @Param("status") String status);
@Select({" select" +
" case when SUM(b.total_price) is null then 0 else SUM(b.total_price) end price," +
" count(1) count" +
@ -1133,6 +1141,13 @@ public interface HighOrderMapperExt {
" where a.order_id = b.id and goods_type = 3 and goods_id = #{storeId} and b.order_status in (${status}) "})
Map<String, Object> selectGasHistoryOrderCount(@Param("storeId") Long storeId, @Param("status") String status);
@Select({" select" +
" case when SUM(b.total_price) is null then 0 else SUM(b.total_price) end price," +
" count(1) count" +
" from high_child_order a,high_order b " +
" where a.order_id = b.id and goods_type = 3 and gas_staff_id = #{gasStaffId} and b.order_status in (${status}) "})
Map<String, Object> selectGasStaffHistoryOrderCount(@Param("gasStaffId") Long gasStaffId, @Param("status") String status);
@Select({
"<script> " +
" select " +
@ -1144,12 +1159,14 @@ public interface HighOrderMapperExt {
" b.deduction_price deductionPrice," +
" b.pay_real_price payRealPrice," +
" b.order_status status," +
" REPLACE(b.mem_phone, SUBSTR(b.mem_phone,4,4), '****') merPhone," +
" a.goods_name gasName," +
" (select address from high_merchant_store where id = a.goods_id) gasAddress," +
" a.goods_img gasLogo," +
" a.gas_oil_type gasOilType," +
" a.gas_oil_no gasOilNo," +
" a.gas_gun_no gasGunNo," +
" a.gas_staff_name gasStaffName," +
" a.gas_price_gun gasPriceGun," +
" a.gas_oil_liters gasOilLiters," +
" a.gas_discount gasDiscount," +
@ -1167,6 +1184,7 @@ public interface HighOrderMapperExt {
" where a.order_id = b.id " +
" and goods_type = 3 " +
"<if test='param.storeId != null'> and goods_id in (${param.storeId}) </if>" +
"<if test='param.gasStaffId != null'> and a.gas_staff_id = #{param.gasStaffId}</if>" +
"<if test='param.status != null'> and b.order_status in (${param.status})</if>" +
"<if test='param.createTimeS != null'> <![CDATA[ and b.create_time >= #{param.createTimeS} ]]> </if>",
"<if test='param.createTimeE != null'> <![CDATA[ and b.create_time <= #{param.createTimeE} ]]> </if>",

@ -173,6 +173,16 @@ public class HighChildOrder implements Serializable {
*/
private BigDecimal gasPricePreferences;
/**
* 加油站加油员id
*/
private Long gasStaffId;
/**
* 加油站加油员名称
*/
private String gasStaffName;
/**
* 加油站业务员id
*/
@ -473,6 +483,22 @@ public class HighChildOrder implements Serializable {
this.gasPricePreferences = gasPricePreferences;
}
public Long getGasStaffId() {
return gasStaffId;
}
public void setGasStaffId(Long gasStaffId) {
this.gasStaffId = gasStaffId;
}
public String getGasStaffName() {
return gasStaffName;
}
public void setGasStaffName(String gasStaffName) {
this.gasStaffName = gasStaffName;
}
public Long getGasSalesmanId() {
return gasSalesmanId;
}
@ -613,6 +639,8 @@ public class HighChildOrder implements Serializable {
&& (this.getGasOilSubsidy() == null ? other.getGasOilSubsidy() == null : this.getGasOilSubsidy().equals(other.getGasOilSubsidy()))
&& (this.getGasLitersPreferences() == null ? other.getGasLitersPreferences() == null : this.getGasLitersPreferences().equals(other.getGasLitersPreferences()))
&& (this.getGasPricePreferences() == null ? other.getGasPricePreferences() == null : this.getGasPricePreferences().equals(other.getGasPricePreferences()))
&& (this.getGasStaffId() == null ? other.getGasStaffId() == null : this.getGasStaffId().equals(other.getGasStaffId()))
&& (this.getGasStaffName() == null ? other.getGasStaffName() == null : this.getGasStaffName().equals(other.getGasStaffName()))
&& (this.getGasSalesmanId() == null ? other.getGasSalesmanId() == null : this.getGasSalesmanId().equals(other.getGasSalesmanId()))
&& (this.getGasSalesmanName() == null ? other.getGasSalesmanName() == null : this.getGasSalesmanName().equals(other.getGasSalesmanName()))
&& (this.getGasAgentId() == null ? other.getGasAgentId() == null : this.getGasAgentId().equals(other.getGasAgentId()))
@ -663,6 +691,8 @@ public class HighChildOrder implements Serializable {
result = prime * result + ((getGasOilSubsidy() == null) ? 0 : getGasOilSubsidy().hashCode());
result = prime * result + ((getGasLitersPreferences() == null) ? 0 : getGasLitersPreferences().hashCode());
result = prime * result + ((getGasPricePreferences() == null) ? 0 : getGasPricePreferences().hashCode());
result = prime * result + ((getGasStaffId() == null) ? 0 : getGasStaffId().hashCode());
result = prime * result + ((getGasStaffName() == null) ? 0 : getGasStaffName().hashCode());
result = prime * result + ((getGasSalesmanId() == null) ? 0 : getGasSalesmanId().hashCode());
result = prime * result + ((getGasSalesmanName() == null) ? 0 : getGasSalesmanName().hashCode());
result = prime * result + ((getGasAgentId() == null) ? 0 : getGasAgentId().hashCode());
@ -716,6 +746,8 @@ public class HighChildOrder implements Serializable {
sb.append(", gasOilSubsidy=").append(gasOilSubsidy);
sb.append(", gasLitersPreferences=").append(gasLitersPreferences);
sb.append(", gasPricePreferences=").append(gasPricePreferences);
sb.append(", gasStaffId=").append(gasStaffId);
sb.append(", gasStaffName=").append(gasStaffName);
sb.append(", gasSalesmanId=").append(gasSalesmanId);
sb.append(", gasSalesmanName=").append(gasSalesmanName);
sb.append(", gasAgentId=").append(gasAgentId);

@ -2135,6 +2135,136 @@ public class HighChildOrderExample {
return (Criteria) this;
}
public Criteria andGasStaffIdIsNull() {
addCriterion("gas_staff_id is null");
return (Criteria) this;
}
public Criteria andGasStaffIdIsNotNull() {
addCriterion("gas_staff_id is not null");
return (Criteria) this;
}
public Criteria andGasStaffIdEqualTo(Long value) {
addCriterion("gas_staff_id =", value, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdNotEqualTo(Long value) {
addCriterion("gas_staff_id <>", value, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdGreaterThan(Long value) {
addCriterion("gas_staff_id >", value, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdGreaterThanOrEqualTo(Long value) {
addCriterion("gas_staff_id >=", value, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdLessThan(Long value) {
addCriterion("gas_staff_id <", value, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdLessThanOrEqualTo(Long value) {
addCriterion("gas_staff_id <=", value, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdIn(List<Long> values) {
addCriterion("gas_staff_id in", values, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdNotIn(List<Long> values) {
addCriterion("gas_staff_id not in", values, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdBetween(Long value1, Long value2) {
addCriterion("gas_staff_id between", value1, value2, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffIdNotBetween(Long value1, Long value2) {
addCriterion("gas_staff_id not between", value1, value2, "gasStaffId");
return (Criteria) this;
}
public Criteria andGasStaffNameIsNull() {
addCriterion("gas_staff_name is null");
return (Criteria) this;
}
public Criteria andGasStaffNameIsNotNull() {
addCriterion("gas_staff_name is not null");
return (Criteria) this;
}
public Criteria andGasStaffNameEqualTo(String value) {
addCriterion("gas_staff_name =", value, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameNotEqualTo(String value) {
addCriterion("gas_staff_name <>", value, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameGreaterThan(String value) {
addCriterion("gas_staff_name >", value, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameGreaterThanOrEqualTo(String value) {
addCriterion("gas_staff_name >=", value, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameLessThan(String value) {
addCriterion("gas_staff_name <", value, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameLessThanOrEqualTo(String value) {
addCriterion("gas_staff_name <=", value, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameLike(String value) {
addCriterion("gas_staff_name like", value, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameNotLike(String value) {
addCriterion("gas_staff_name not like", value, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameIn(List<String> values) {
addCriterion("gas_staff_name in", values, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameNotIn(List<String> values) {
addCriterion("gas_staff_name not in", values, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameBetween(String value1, String value2) {
addCriterion("gas_staff_name between", value1, value2, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasStaffNameNotBetween(String value1, String value2) {
addCriterion("gas_staff_name not between", value1, value2, "gasStaffName");
return (Criteria) this;
}
public Criteria andGasSalesmanIdIsNull() {
addCriterion("gas_salesman_id is null");
return (Criteria) this;

@ -69,6 +69,11 @@ public class HighDiscount implements Serializable {
*/
private BigDecimal discountPrice;
/**
* 领取次数
*/
private Integer receiveNumber;
/**
* 领取有效天数
*/
@ -200,6 +205,14 @@ public class HighDiscount implements Serializable {
this.discountPrice = discountPrice;
}
public Integer getReceiveNumber() {
return receiveNumber;
}
public void setReceiveNumber(Integer receiveNumber) {
this.receiveNumber = receiveNumber;
}
public Integer getEffectiveDay() {
return effectiveDay;
}
@ -303,6 +316,7 @@ public class HighDiscount implements Serializable {
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType()))
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition()))
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice()))
&& (this.getReceiveNumber() == null ? other.getReceiveNumber() == null : this.getReceiveNumber().equals(other.getReceiveNumber()))
&& (this.getEffectiveDay() == null ? other.getEffectiveDay() == null : this.getEffectiveDay().equals(other.getEffectiveDay()))
&& (this.getSalesEndTime() == null ? other.getSalesEndTime() == null : this.getSalesEndTime().equals(other.getSalesEndTime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
@ -330,6 +344,7 @@ public class HighDiscount implements Serializable {
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode());
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode());
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode());
result = prime * result + ((getReceiveNumber() == null) ? 0 : getReceiveNumber().hashCode());
result = prime * result + ((getEffectiveDay() == null) ? 0 : getEffectiveDay().hashCode());
result = prime * result + ((getSalesEndTime() == null) ? 0 : getSalesEndTime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
@ -360,6 +375,7 @@ public class HighDiscount implements Serializable {
sb.append(", discountType=").append(discountType);
sb.append(", discountCondition=").append(discountCondition);
sb.append(", discountPrice=").append(discountPrice);
sb.append(", receiveNumber=").append(receiveNumber);
sb.append(", effectiveDay=").append(effectiveDay);
sb.append(", salesEndTime=").append(salesEndTime);
sb.append(", createTime=").append(createTime);

@ -826,6 +826,66 @@ public class HighDiscountExample {
return (Criteria) this;
}
public Criteria andReceiveNumberIsNull() {
addCriterion("receive_number is null");
return (Criteria) this;
}
public Criteria andReceiveNumberIsNotNull() {
addCriterion("receive_number is not null");
return (Criteria) this;
}
public Criteria andReceiveNumberEqualTo(Integer value) {
addCriterion("receive_number =", value, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberNotEqualTo(Integer value) {
addCriterion("receive_number <>", value, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberGreaterThan(Integer value) {
addCriterion("receive_number >", value, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberGreaterThanOrEqualTo(Integer value) {
addCriterion("receive_number >=", value, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberLessThan(Integer value) {
addCriterion("receive_number <", value, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberLessThanOrEqualTo(Integer value) {
addCriterion("receive_number <=", value, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberIn(List<Integer> values) {
addCriterion("receive_number in", values, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberNotIn(List<Integer> values) {
addCriterion("receive_number not in", values, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberBetween(Integer value1, Integer value2) {
addCriterion("receive_number between", value1, value2, "receiveNumber");
return (Criteria) this;
}
public Criteria andReceiveNumberNotBetween(Integer value1, Integer value2) {
addCriterion("receive_number not between", value1, value2, "receiveNumber");
return (Criteria) this;
}
public Criteria andEffectiveDayIsNull() {
addCriterion("effective_day is null");
return (Criteria) this;

@ -48,6 +48,11 @@ public class HighGasStaff implements Serializable {
*/
private String positionName;
/**
* 二维码图片地址
*/
private String qrCodeImgUrl;
/**
* 状态 0删除 1正常 2禁用
*/
@ -127,6 +132,14 @@ public class HighGasStaff implements Serializable {
this.positionName = positionName;
}
public String getQrCodeImgUrl() {
return qrCodeImgUrl;
}
public void setQrCodeImgUrl(String qrCodeImgUrl) {
this.qrCodeImgUrl = qrCodeImgUrl;
}
public Integer getStatus() {
return status;
}
@ -194,6 +207,7 @@ public class HighGasStaff implements Serializable {
&& (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone()))
&& (this.getPositionType() == null ? other.getPositionType() == null : this.getPositionType().equals(other.getPositionType()))
&& (this.getPositionName() == null ? other.getPositionName() == null : this.getPositionName().equals(other.getPositionName()))
&& (this.getQrCodeImgUrl() == null ? other.getQrCodeImgUrl() == null : this.getQrCodeImgUrl().equals(other.getQrCodeImgUrl()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
@ -213,6 +227,7 @@ public class HighGasStaff implements Serializable {
result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode());
result = prime * result + ((getPositionType() == null) ? 0 : getPositionType().hashCode());
result = prime * result + ((getPositionName() == null) ? 0 : getPositionName().hashCode());
result = prime * result + ((getQrCodeImgUrl() == null) ? 0 : getQrCodeImgUrl().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
@ -235,6 +250,7 @@ public class HighGasStaff implements Serializable {
sb.append(", telephone=").append(telephone);
sb.append(", positionType=").append(positionType);
sb.append(", positionName=").append(positionName);
sb.append(", qrCodeImgUrl=").append(qrCodeImgUrl);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);

@ -585,6 +585,76 @@ public class HighGasStaffExample {
return (Criteria) this;
}
public Criteria andQrCodeImgUrlIsNull() {
addCriterion("qr_code_img_url is null");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlIsNotNull() {
addCriterion("qr_code_img_url is not null");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlEqualTo(String value) {
addCriterion("qr_code_img_url =", value, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlNotEqualTo(String value) {
addCriterion("qr_code_img_url <>", value, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlGreaterThan(String value) {
addCriterion("qr_code_img_url >", value, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlGreaterThanOrEqualTo(String value) {
addCriterion("qr_code_img_url >=", value, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlLessThan(String value) {
addCriterion("qr_code_img_url <", value, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlLessThanOrEqualTo(String value) {
addCriterion("qr_code_img_url <=", value, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlLike(String value) {
addCriterion("qr_code_img_url like", value, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlNotLike(String value) {
addCriterion("qr_code_img_url not like", value, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlIn(List<String> values) {
addCriterion("qr_code_img_url in", values, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlNotIn(List<String> values) {
addCriterion("qr_code_img_url not in", values, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlBetween(String value1, String value2) {
addCriterion("qr_code_img_url between", value1, value2, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andQrCodeImgUrlNotBetween(String value1, String value2) {
addCriterion("qr_code_img_url not between", value1, value2, "qrCodeImgUrl");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -222,6 +222,49 @@ public class HighOrder implements Serializable {
private String ext3;
<<<<<<< HEAD
=======
private List<HighChildOrder> highChildOrderList;
private HighDiscount highDiscount;
private Boolean isTyAgent;
private String gasStaffCode;
public String getGasStaffCode() {
return gasStaffCode;
}
public void setGasStaffCode(String gasStaffCode) {
this.gasStaffCode = gasStaffCode;
}
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
}
public void setHighChildOrderList(List<HighChildOrder> highChildOrderList) {
this.highChildOrderList = highChildOrderList;
}
public HighDiscount getHighDiscount() {
return highDiscount;
}
public void setHighDiscount(HighDiscount highDiscount) {
this.highDiscount = highDiscount;
}
public Boolean getIsTyAgent() {
return isTyAgent;
}
public void setIsTyAgent(Boolean tyAgent) {
isTyAgent = tyAgent;
}
>>>>>>> 2d52dbc7b84e73f0aec222be0e523218c95d9908
private static final long serialVersionUID = 1L;
public Long getId() {

@ -6,6 +6,7 @@ package com.hai.enum_type;
*/
public enum GasPositionType {
status1(1 , "收银员"),
status2(2 , "加油员"),
;
private Integer status;

@ -14,6 +14,8 @@ public enum OrderPushType {
type5(5 , "汇联通会员卡"),
type6(6 , "汇联通卡券"),
type7(7 , "汇联通会员充值订单"),
type8(8 , "星巴克订单"),
type9(9 , "会员充值订单"),
;
private Integer type;

@ -12,6 +12,7 @@ public enum UserObjectTypeEnum {
type5(5, "充值后台工商"),
type6(6, "团油代理商"),
type7(7, "团油业务员"),
type8(8, "加油站员工"),
;
private Integer type;

@ -17,9 +17,11 @@ public class GasOrderModel {
private BigDecimal deductionPrice;
private BigDecimal payRealPrice;
private Integer status;
private String merPhone;
private String gasLogo;
private String gasName;
private String gasAddress;
private String gasStaffName;
private String gasOilType;
private String gasOilNo;
private String gasGunNo;
@ -37,6 +39,22 @@ public class GasOrderModel {
private Boolean printStatus;
private Integer printNum;
public String getGasStaffName() {
return gasStaffName;
}
public void setGasStaffName(String gasStaffName) {
this.gasStaffName = gasStaffName;
}
public String getMerPhone() {
return merPhone;
}
public void setMerPhone(String merPhone) {
this.merPhone = merPhone;
}
public Boolean getPrintStatus() {
return printStatus;
}

@ -14,6 +14,9 @@ public class ThirdPartyModel extends HighOrder {
// 第三方订单状态
private Integer thirdOrderStatus;
// 第三方订单状态
private String statusDesc;
// 就餐方式
private Integer eatType;
@ -74,4 +77,12 @@ public class ThirdPartyModel extends HighOrder {
public void setObject(JSONObject object) {
this.object = object;
}
public String getStatusDesc() {
return statusDesc;
}
public void setStatusDesc(String statusDesc) {
this.statusDesc = statusDesc;
}
}

@ -1,9 +1,7 @@
package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.ApiCity;
import com.hai.entity.ApiMerchants;
import com.hai.entity.ApiProduct;
import com.hai.entity.ApiProductConfig;
/**

@ -214,6 +214,18 @@ public interface ApiProductService {
*/
List<ApiCity> getAllCity(String cityName);
/**
* @Author Sum1Dream
* @name insertCity.java
* @Description // 插入城市
* @Date 17:18 2022/7/13
* @Param [com.hai.entity.ApiKfcStores]
* @return void
*/
void insertCity(ApiCity apiCity);
void updateCity(ApiCity apiCity);
/**
* @Author Sum1Dream
* @name insertKfcStore.java

@ -33,6 +33,13 @@ public interface HighDiscountService {
**/
HighDiscount getDiscountById(Long id);
/**
* 根据优惠券key查询
* @param discountKey
* @return
*/
HighDiscount getDiscountByKey(String discountKey);
/**
* @Author 胡锐
* @Description 查询优惠券列表

@ -15,11 +15,18 @@ public interface HighDiscountUserRelService {
/**
* @Author 胡锐
* @Description 领取优惠券
* @Description 领取优惠券code
* @Date 2021/4/4 15:12
**/
void receiveDiscount(Long userId,Long codeId);
/**
* @Author 胡锐
* @Description 领取优惠券
* @Date 2021/4/4 15:12
**/
void receive(Long userId, Long discountAgentId);
/**
* @Author 胡锐
* @Description 修改
@ -62,5 +69,12 @@ public interface HighDiscountUserRelService {
**/
List<HighDiscountUserRel> getExpiredDiscount();
/**
* 领取优惠券统计
* @param userId
* @param discountId
* @return
*/
Integer receiveDiscountCount(Long userId,Long discountId);
}

@ -409,6 +409,14 @@ public interface HighOrderService {
*/
Map<String, Object> getGasTheDayOrderCount(Long storeId, String status);
/**
* 查询加油站工作人员当天统计
* @param gasStaffId
* @param status
* @return
*/
Map<String, Object> getGasStaffTheDayOrderCount(Long gasStaffId, String status);
/**
* 查询加油站历史统计
* @param storeId
@ -417,6 +425,14 @@ public interface HighOrderService {
*/
Map<String, Object> getGasHistoryOrderCount(Long storeId, String status);
/**
* 查询加油站加油员历史统计
* @param gasStaffId
* @param status
* @return
*/
Map<String, Object> getGasStaffHistoryOrderCount(Long gasStaffId, String status);
/**
* 查询加油站订单列表
* @param param

@ -1,25 +1,18 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.MD5Util;
import com.hai.config.CommonSysConst;
import com.hai.config.QianZhuConfig;
import com.hai.config.RechargeConfig;
import com.hai.dao.ApiAmountRecordMapper;
import com.hai.dao.ApiCityMapper;
import com.hai.dao.OutRechargeOrderMapper;
import com.hai.entity.*;
import com.hai.enum_type.OperatorEnum;
import com.hai.model.OutRechargePriceModel;
import com.hai.service.*;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
@ -56,11 +49,6 @@ public class ApiOpenServiceImpl implements ApiOpenService {
@Resource
private BsRequestRecordService bsRequestRecordService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Resource
private ApiCityMapper apiCityMapper;
@Override
@Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW)

@ -362,6 +362,16 @@ public class ApiProductServiceImpl implements ApiProductService {
return apiCityMapper.selectByExample(example);
}
@Override
public void insertCity(ApiCity apiCity) {
apiCityMapper.insert(apiCity);
}
@Override
public void updateCity(ApiCity apiCity) {
apiCityMapper.updateByPrimaryKeySelective(apiCity);
}
@Override
public void insertKfcStore(ApiKfcStores apiKfcStores) {
apiKfcStoresMapper.insert(apiKfcStores);
@ -398,6 +408,9 @@ public class ApiProductServiceImpl implements ApiProductService {
if (StringUtils.isNotBlank(MapUtils.getString(map , "storeName"))) {
criteria.andStoreNameLike("%" + MapUtils.getString(map , "storeName") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(map , "cityName"))) {
criteria.andCityNameLike("%" + MapUtils.getString(map , "cityName") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(map , "storeCode"))) {
criteria.andStoreCodeEqualTo(MapUtils.getString(map , "storeCode"));

@ -575,6 +575,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
}
@Override
@Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW)
public Map<String, Object> pushGzSinopec(Long couponAgentRelId, String phone, String remark) throws Exception {
// 查询兑换码
HighCouponAgentCode convertCode = getCodeById(couponAgentRelId);

@ -39,6 +39,17 @@ public class HighDiscountServiceImpl implements HighDiscountService {
return highDiscountMapper.selectByPrimaryKey(id);
}
@Override
public HighDiscount getDiscountByKey(String discountKey) {
HighDiscountExample example = new HighDiscountExample();
example.createCriteria().andDiscountKeyEqualTo(discountKey).andStatusNotEqualTo(0);
List<HighDiscount> list = highDiscountMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public List<HighDiscount> getDiscount(Map<String, Object> map) {
HighDiscountExample example = new HighDiscountExample();

@ -51,7 +51,6 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic
if(code == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "二维码不存在");
}
// 状态 0:删除 1:待领取 2:待使用 3:已使用 4:已过期 5: 已分配
if(code.getStatus() != 1 && code.getStatus() != 5) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "二维码不存在或已被领取");
@ -67,6 +66,18 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic
rel.setStockCount(rel.getStockCount() - 1);
highDiscountAgentRelService.updateDiscountAgentRel(rel);
// 查询优惠券信息
HighDiscount discount = highDiscountService.getDiscountById(rel.getDiscountId());
if (discount == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券信息");
}
if (!discount.getStatus().equals(2)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法领取,优惠券活动已过期");
}
if (discount.getReceiveNumber() > 0 && this.receiveDiscountCount(userId, discount.getId()).intValue() >= discount.getReceiveNumber().intValue()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券已达到上线");
}
// 校验卡卷状态
if (rel.getHighDiscount().getStatus() != 2) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法领取,优惠券已过期");
@ -106,6 +117,61 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW,isolation= Isolation.SERIALIZABLE)
public void receive(Long userId, Long discountAgentId) {
// 查询优惠券与代理商关系
HighDiscountAgentRel discountAgentRel = highDiscountAgentRelService.getRelById(discountAgentId);
if (discountAgentRel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知优惠券");
}
// 查询优惠券信息
HighDiscount discount = discountAgentRel.getHighDiscount();
if (discount == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知优惠券");
}
if (!discount.getStatus().equals(2)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法领取,优惠券活动已过期");
}
if (discount.getReceiveNumber() > 0 && this.receiveDiscountCount(userId, discount.getId()) >= discount.getReceiveNumber()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "领取数量已达到上线");
}
// 查询可分配的优惠券code
List<HighDiscountAgentCode> discountAgentCodeList = highDiscountAgentCodeService.getDiscountCodeByStatus(discountAgentRel.getId(), 1);
if (discountAgentCodeList.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券已无库存");
}
HighDiscountAgentCode code = discountAgentCodeList.get(0);
code.setStatus(2);
highDiscountAgentCodeService.updateCode(code);
// 查询优惠券信息
discountAgentRel.setStockCount(discountAgentRel.getStockCount() - 1);
highDiscountAgentRelService.updateDiscountAgentRel(discountAgentRel);
HighDiscountUserRel userRel = new HighDiscountUserRel();
userRel.setDiscountId(discountAgentRel.getDiscountId());
userRel.setAgentId(discountAgentRel.getAgentId());
userRel.setUserId(userId);
userRel.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
userRel.setCreateTime(new Date());
userRel.setDiscountAgentCodeId(code.getId());
// 计算使用有效期
Calendar userEndTime = Calendar.getInstance();
userEndTime.setTime(new Date());
userEndTime.set(Calendar.HOUR_OF_DAY, 23);
userEndTime.set(Calendar.MINUTE, 59);
userEndTime.set(Calendar.SECOND, 59);
userEndTime.add(Calendar.DATE, discountAgentRel.getHighDiscount().getEffectiveDay());
if (userEndTime.getTime().compareTo(discountAgentRel.getHighDiscount().getSalesEndTime()) == 1) {
userRel.setUseEndTime(discountAgentRel.getHighDiscount().getSalesEndTime());
} else {
userRel.setUseEndTime(userEndTime.getTime());
}
highDiscountUserRelMapper.insert(userRel);
}
@Override
public void updateDiscountUserRel(HighDiscountUserRel highDiscountUserRel) {
highDiscountUserRelMapper.updateByPrimaryKey(highDiscountUserRel);
@ -171,4 +237,9 @@ public class HighDiscountUserRelServiceImpl implements HighDiscountUserRelServic
example.createCriteria().andStatusEqualTo(1).andUseEndTimeLessThanOrEqualTo(new Date());
return highDiscountUserRelMapper.selectByExample(example);
}
@Override
public Integer receiveDiscountCount(Long userId, Long discountId) {
return highDiscountUserRelMapper.receiveDiscountCount(userId, discountId);
}
}

@ -57,6 +57,8 @@ public class HighGasStaffServiceImpl implements HighGasStaffService {
Long roleId;
if (gasStaff.getPositionType().equals(GasPositionType.status1.getStatus())) {
roleId = 100L;
} else if (gasStaff.getPositionType().equals(GasPositionType.status2.getStatus())) {
roleId = 101L;
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知角色");
}

@ -163,6 +163,9 @@ public class HighOrderServiceImpl implements HighOrderService {
private ApiOrderRecordService apiOrderRecordService;
@Resource
private ApiMemberProductService apiMemberProductService;
@Override
@Transactional(
isolation = Isolation.SERIALIZABLE,
@ -1452,6 +1455,12 @@ public class HighOrderServiceImpl implements HighOrderService {
highDiscountAgentCodeService.updateCode(code);
}
}
if (order.getPayGold() != null) {
// 积分返回
highUserService.goldHandle(order.getMemId(), order.getPayGold(), 1, 3, order.getId());
}
updateOrder(order);
}
}
@ -1666,11 +1675,21 @@ public class HighOrderServiceImpl implements HighOrderService {
return highOrderMapperExt.selectGasTheDayOrderCount(storeId, status);
}
@Override
public Map<String, Object> getGasStaffTheDayOrderCount(Long gasStaffId, String status) {
return highOrderMapperExt.selectGasStaffTheDayOrderCount(gasStaffId,status);
}
@Override
public Map<String, Object> getGasHistoryOrderCount(Long storeId, String status) {
return highOrderMapperExt.selectGasHistoryOrderCount(storeId, status);
}
@Override
public Map<String, Object> getGasStaffHistoryOrderCount(Long gasStaffId, String status) {
return highOrderMapperExt.selectGasStaffHistoryOrderCount(gasStaffId,status);
}
@Override
public List<GasOrderModel> getGasOrderList(Map<String, Object> param) throws Exception {
if (MapUtils.getLong(param, "createTimeS") != null) {
@ -1710,31 +1729,31 @@ public class HighOrderServiceImpl implements HighOrderService {
new Thread(() -> {
try {
SpPrinterConfig sp = new SpPrinterConfig();
sp.print(device.getDeviceSn(),
SpPrinterTemplate.oilCashierStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
), 1);
Thread.sleep(6000);
sp.print(device.getDeviceSn(),
SpPrinterTemplate.oilClientStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
), 1);
String printStr = SpPrinterTemplate.oilCashierStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
order.getMemPhone(),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
) + "<BR>";
/* +
SpPrinterTemplate.oilClientStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
order.getMemPhone(),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
) + "<BR>";*/
sp.print(device.getDeviceSn(), printStr, 1);
} catch (Exception e) {
e.printStackTrace();
}
@ -1745,31 +1764,17 @@ public class HighOrderServiceImpl implements HighOrderService {
new Thread(() -> {
try {
mqttProviderConfig.publish(2, false, device.getDeviceImei(),
ZkcPrinterTemplate.oilCashierStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
));
Thread.sleep(6000);
mqttProviderConfig.publish(2, false, device.getDeviceImei(),
ZkcPrinterTemplate.oilClientStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
));
ZkcPrinterTemplate.oilCashierStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
order.getMemPhone(),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
));
} catch (Exception e) {
e.getMessage();
}
@ -1806,6 +1811,7 @@ public class HighOrderServiceImpl implements HighOrderService {
HighUser user = highUserService.findByUserId(object.getLong("userId"));
JSONObject jsonObject = null;
JSONObject requestContent = null;
// 积分抵扣金额
BigDecimal integralPrice = new BigDecimal(0);
@ -1820,7 +1826,9 @@ public class HighOrderServiceImpl implements HighOrderService {
JSONObject productDetail = thirdProductConfig.getThirdPartyByDetail(object.getInteger("platformId"), object.getInteger("productType"), object.getLong("companyId"));
// 1 星巴克 2 肯德基
highOrder.setProductType(object.getInteger("productType"));
// 1 星巴克 2 肯德基 3 会员充值
if (object.getInteger("productType") == 1) {
JSONObject userToken = QianZhuConfig.getTokenV2(user.getId().toString(), user.getName(), user.getPhone());
@ -1864,9 +1872,9 @@ public class HighOrderServiceImpl implements HighOrderService {
List.add(JSON.toJSONString(contentMap));
}
// 下单
jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile"));
// jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), object.getString("storeCode"), List.toString().replace(" ", ""), object.getString("customerMobile"));
jsonObject = QianZhuConfig.starbucksOrders(user.getId().toString(), "50562", List.toString().replace(" ", ""), object.getString("customerMobile"));
// 判断下单是否成功
if (!Objects.equals(jsonObject.getString("code"), "200")) {
@ -1880,7 +1888,7 @@ public class HighOrderServiceImpl implements HighOrderService {
// 根据订单号查询订单详情
JSONObject orderObject = QianZhuConfig.starbucksOrderByOrderNo(jsonObject.getJSONObject("data").getString("orderNo"));
// 判断下单是否成功
// 判断是否成功
if (!orderObject.getBoolean("success")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("message"));
}
@ -1894,7 +1902,6 @@ public class HighOrderServiceImpl implements HighOrderService {
highOrder.setMemName(user.getName());
highOrder.setMemPhone(user.getPhone());
highOrder.setOrderStatus(1);
highOrder.setRemarks(object.getString("userRemark"));
highOrderMapper.insert(highOrder);
// 获取星巴克订单内容
@ -1906,29 +1913,29 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.setOrderId(highOrder.getId());
childOrder.setChildOrdeStatus(1);
childOrder.setGoodsType(9);
childOrder.setStoreId(object.getLong("storeCode"));
childOrder.setGoodsId(object.getLong("productId"));
childOrder.setStoreAddress(childObject.getString("storeAddress"));
childOrder.setStoreName(childObject.getString("storeName"));
childOrder.setGoodsName(childObject.getString("productName"));
childOrder.setGoodsImg(childObject.getString("imgUrl"));
childOrder.setSaleCount(childObject.getInteger("quantity"));
childOrder.setGoodsPrice(childObject.getBigDecimal("marketPrice"));
// String goodsSpecName = childObject.getString("cupSize") +
// "," + childObject.getString("temperature") +
// "," + childObject.getString("milk") +
// "," + childObject.getString("milkBubble") +
// "," + childObject.getString("espresso") +
// "," + childObject.getString("cream");
// childOrder.setGoodsSpecName(goodsSpecName);
childOrder.setGoodsActualPrice(childObject.getBigDecimal("unitPrice"));
// 计算利润
BigDecimal profitPrice = childObject.getBigDecimal("unitPrice").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)));
// 计算子订单支付金额
BigDecimal childPrice = childObject.getBigDecimal("unitPrice").add(profitPrice).setScale(2 , RoundingMode.HALF_UP);
// 计算实际支付金额
if (childPrice.compareTo(childObject.getBigDecimal("marketPrice")) > 0) {
childPrice = childObject.getBigDecimal("marketPrice");
}
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity"));
// 计算总订单实际支付金额
orderPayPrice = orderPayPrice.add(childPrice);
// 计算市场价金额
marketPrice = marketPrice.add(childObject.getBigDecimal("marketPrice"));
childOrder.setGoodsActualPrice(childPrice);
childOrder.setTotalPrice(childPrice.multiply(childObject.getBigDecimal("quantity")));
marketPrice = marketPrice.add(childObject.getBigDecimal("marketPrice").multiply(childObject.getBigDecimal("quantity")));
childOrder.setTotalPrice(childPrice);
highChildOrderMapper.insert(childOrder);
}
@ -1961,7 +1968,6 @@ public class HighOrderServiceImpl implements HighOrderService {
highOrder.setMemName(user.getName());
highOrder.setMemPhone(user.getPhone());
highOrder.setOrderStatus(1);
highOrder.setRemarks(object.getString("userRemark"));
highOrderMapper.insert(highOrder);
@ -1973,26 +1979,74 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.setOrderId(highOrder.getId());
childOrder.setChildOrdeStatus(1);
childOrder.setGoodsType(4);
childOrder.setGoodsId(object.getLong("productId"));
childOrder.setStoreAddress(orderObject.getJSONObject("data").getJSONObject("kfcPlaceOrder").getString("storeAddress"));
childOrder.setStoreName(orderObject.getJSONObject("data").getJSONObject("kfcPlaceOrder").getString("storeName"));
childOrder.setGoodsName(childObject.getString("productName"));
childOrder.setGoodsImg(childObject.getString("imageUrl"));
childOrder.setSaleCount(childObject.getInteger("quantity"));
childOrder.setGoodsPrice(childObject.getBigDecimal("originPrice"));
childOrder.setGoodsActualPrice(childObject.getBigDecimal("price"));
// 计算利润
BigDecimal profitPrice = childObject.getBigDecimal("price").multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)));
// 计算子订单支付金额
BigDecimal childPrice = childObject.getBigDecimal("price").add(profitPrice).setScale(2 , RoundingMode.HALF_UP);
// 计算实际支付金额
if (childPrice.compareTo(childObject.getBigDecimal("originPrice")) > 0) {
childPrice = childObject.getBigDecimal("originPrice");
}
childPrice = childPrice.multiply(childObject.getBigDecimal("quantity"));
// 计算总订单实际支付金额
orderPayPrice = orderPayPrice.add(childPrice);
// 计算市场价金额
marketPrice = marketPrice.add(childObject.getBigDecimal("originPrice"));
marketPrice = marketPrice.add(childObject.getBigDecimal("originPrice").multiply(childObject.getBigDecimal("quantity")));
childOrder.setTotalPrice(childPrice);
highChildOrderMapper.insert(childOrder);
childOrder.setGoodsActualPrice(childPrice);
childOrder.setTotalPrice(childPrice.multiply(childObject.getBigDecimal("quantity")));
}
} else if (object.getInteger("productType") == 3) {
ApiMemberProduct memberProduct = apiMemberProductService.findById(object.getLong("goodsId"));
highChildOrderMapper.insert(childOrder);
if (memberProduct == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前产品不可购买");
}
object.put("productId", memberProduct.getProductId());
// 插入订单内容
highOrder.setOrderNo("HF" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5));
highOrder.setRegionId(object.getString("regionId"));
highOrder.setCompanyId(object.getLong("companyId"));
highOrder.setCreateTime(new Date());
highOrder.setMemId(user.getId());
highOrder.setMemName(user.getName());
highOrder.setMemPhone(user.getPhone());
highOrder.setOrderStatus(1);
// 计算实际支付金额
orderPayPrice = memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDetail.getBigDecimal("priceDiscount").divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP);
if (orderPayPrice.compareTo(memberProduct.getPrice()) > 0) {
orderPayPrice = memberProduct.getPrice();
}
// 计算市场价金额
marketPrice = memberProduct.getPrice();
highOrderMapper.insert(highOrder);
HighChildOrder childOrder = new HighChildOrder();
childOrder.setOrderId(highOrder.getId());
childOrder.setChildOrdeStatus(1);
childOrder.setGoodsType(10);
childOrder.setStoreId(object.getLong("storeCode"));
childOrder.setGoodsId(memberProduct.getId());
childOrder.setGoodsName(memberProduct.getName());
childOrder.setSaleCount(1);
childOrder.setGoodsPrice(marketPrice);
childOrder.setGoodsActualPrice(orderPayPrice);
childOrder.setTotalPrice(orderPayPrice);
highChildOrderMapper.insert(childOrder);
}
// 定义优惠券
@ -2080,7 +2134,7 @@ public class HighOrderServiceImpl implements HighOrderService {
highOrder.setDeductionPrice(discountPrice);
highOrder.setPayGold(object.getInteger("integralNum"));
// 使用优惠券 或者积分
// 使用优惠券
if (highOrder.getMemDiscountId() != null) {
highOrder.setTotalPrice(marketPrice);
highOrder.setPayPrice(marketPrice.subtract(discountPrice));
@ -2123,28 +2177,29 @@ public class HighOrderServiceImpl implements HighOrderService {
for (HighChildOrder childOrder : highOrderList.getHighChildOrderList()) {
childOrder.setChildOrdeStatus(2);
}
// 推送订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
// 1 星巴克 2 肯德基 3:第三方会员充值
if (object.getInteger("productType") == 1) {
QianZhuConfig.starbucksOrdersPay(highOrder.getOrderNo());
highGasOrderPush.setType(OrderPushType.type8.getType());
requestContent = QianZhuConfig.starbucksOrdersPay(highOrder.getOrderNo());
} else if (object.getInteger("productType") == 2){
QianZhuConfig.payKfcOrder(highOrder.getOrderNo());
highGasOrderPush.setType(OrderPushType.type4.getType());
requestContent = QianZhuConfig.payKfcOrder(highOrder.getOrderNo());
} else if (object.getInteger("productType") == 3){
highGasOrderPush.setType(OrderPushType.type9.getType());
requestContent = QianZhuConfig.insertV2(object.getString("productId") , highOrder.getOrderNo() , object.getString("customerMobile"));
}
}
// 创建提交记录
BsRequestRecord requestRecord = new BsRequestRecord();
requestRecord.setCreateTime(new Date());
requestRecord.setUpdateTime(new Date());
requestRecord.setOrderNo(highOrder.getOrderNo());
requestRecord.setRequestContent(object.toJSONString());
requestRecord.setOperatorId(0L);
requestRecord.setOperatorName("系统生成");
requestRecord.setSourceId(highOrder.getId().toString());
requestRecord.setSourceType(1);
bsRequestRecordService.insertRequestRecord(requestRecord);
highGasOrderPush.setOrderNo(highOrder.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(highOrder.getOrderNo());
highGasOrderPush.setReturnContent(requestContent.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
}
return highOrder;
}
@ -2168,6 +2223,9 @@ public class HighOrderServiceImpl implements HighOrderService {
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) {
goodsDesc = "购买星巴克产品";
tranDesc = goodsDesc + order.getPayRealPrice() + "元";
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 10) {
goodsDesc = "购买会员充值产品";
tranDesc = goodsDesc + order.getPayRealPrice() + "元";
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法支付,请使用其他支付方式");
}
@ -2209,16 +2267,33 @@ public class HighOrderServiceImpl implements HighOrderService {
order.setPayType(4);
order.setPayTime(new Date()); // 支付时间
updateOrder(order);
HighGasOrderPush orderPush = new HighGasOrderPush();
JSONObject returnObject = new JSONObject();
for (HighChildOrder childOrder : order.getHighChildOrderList()) {
childOrder.setChildOrdeStatus(2);
}
if (order.getHighChildOrderList().get(0).getGoodsType() == 4) {
QianZhuConfig.payKfcOrder(order.getOrderNo());
orderPush.setType(OrderPushType.type4.getType());
returnObject = QianZhuConfig.payKfcOrder(order.getOrderNo());
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 9) {
QianZhuConfig.starbucksOrdersPay(order.getOrderNo());
orderPush.setType(OrderPushType.type8.getType());
returnObject = QianZhuConfig.starbucksOrdersPay(order.getOrderNo());
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 10){
orderPush.setType(OrderPushType.type9.getType());
ApiMemberProduct memberProduct = apiMemberProductService.findById(order.getHighChildOrderList().get(0).getGoodsId());
returnObject = QianZhuConfig.insertV2(memberProduct.getProductId() , order.getOrderNo() , order.getRemarks());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法支付,请使用其他支付方式");
}
orderPush.setOrderNo(order.getOrderNo());
orderPush.setCreateTime(new Date());
orderPush.setRequestContent(JSON.toJSONString(dataMap));
orderPush.setReturnContent(returnObject.toJSONString());
highGasOrderPushMapper.insert(orderPush);
}
@Override
@ -2285,7 +2360,7 @@ public class HighOrderServiceImpl implements HighOrderService {
}
// 工会卡退款
if (order.getPayType() == 3) {
if (order.getPayType() == 4) {
JSONObject jsonObject = HuiLianTongUnionCardConfig.refund("HFR" + new Date().getTime(), order.getOrderNo());
if (jsonObject == null) {
@ -2310,7 +2385,7 @@ public class HighOrderServiceImpl implements HighOrderService {
}
// 商户预充值 帐户退款
if (order.getPayType() == 6) {
if (order.getPayType() == 7) {
Map<String , Object> map = new HashMap<>();
map.put("orderNo" , order.getOrderNo());
@ -2363,7 +2438,7 @@ public class HighOrderServiceImpl implements HighOrderService {
}
// 银联退款
if (order.getPayType() == 4) {
if (order.getPayType() == 5) {
// 订单退款
JSONObject refund = UnionPayConfig.zwrefund(UnionPayConfig.MER_ID2, UnionPayConfig.TERM_ID2, order.getOrderNo(), order.getPaySerialNo(), order.getPayRealPrice().multiply(new BigDecimal("100")).longValue());
if (!refund.getString("resultcode").equals("W6")) {

@ -66,7 +66,6 @@ public class HighQzOrderServiceImpl implements HighQzOrderService {
highOrder.setDeductionPrice(new BigDecimal("0"));
highOrder.setOrderStatus(1);
highOrder.setCreateTime(data.getDate("createTime"));
highOrder.setRemarks(data.getString("userRemark"));
HighChildOrder highChildOrder;
if (orderType.equals("KFC")) {

@ -30,6 +30,8 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
@ -41,10 +43,13 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
@Service("outRechargeOrderService")
public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
private static final Logger log = LoggerFactory.getLogger(OutRechargeOrderServiceImpl.class);
@Resource
private OutRechargeOrderMapper outRechargeOrderMapper;
@ -789,7 +794,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
// 查询充值产品
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(outRechargeOrder.getGoodsId(), null);
System.out.println("话费定时任务 -> 需要重新充值:开始");
// 查询充值子订单
Map<String, Object> childOrderMap = new HashMap<>();
@ -816,8 +821,8 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
// 查询充值子订单
Map<String, Object> childOrderMap103 = new HashMap<>();
childOrderMap.put("parent_order_id", outRechargeOrder.getId());
childOrderMap.put("status", 103);
childOrderMap103.put("parent_order_id", outRechargeOrder.getId());
childOrderMap103.put("status", 103);
List<OutRechargeChildOrder> childOrderList103 = outRechargeChildOrderService.getListRechargeChildOrder(childOrderMap103);
if (childOrderList103.size() > 0) {
@ -845,12 +850,12 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
for (String s : rechargePlatform) {
// 尖椒充值
System.out.println("话费定时任务 -> 需要重新充值:尖椒开始");
if (s.equals("1") && type == 1) {
object.put("out_order_id", orderNo);
object.put("amount", outRechargePrice.getRechargePrice());
object.put("mobile", outRechargeOrder.getRechargeContent());
object.put("notifyUrl", CommonSysConst.getSysConfig().getJjNotifyUrl());
System.out.println("outRechargeOrder-----------------------------------------------------------------------------------------------------------------------------------------------------" + outRechargePrice.getRechargeType());
if (outRechargeOrder.getRechargeType() == 1) {
object.put("is_fast", 1);
}
@ -866,12 +871,12 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
}
// 龙阅充值
if (s.equals("2") && type == 2) {
System.out.println("话费定时任务 -> 需要重新充值:龙阅开始");
object.put("out_trade_num", orderNo);
object.put("product_id", outRechargePrice.getGoodsId());
object.put("mobile", outRechargeOrder.getRechargeContent());
object.put("notifyUrl", CommonSysConst.getSysConfig().getLyNotifyUrl());
JSONObject returnObject = RechargeConfig.rechargeOrderByLy(object);
System.out.println("龙阅请求回调地址---------------------" + CommonSysConst.getSysConfig().getLyNotifyUrl());
object.put("return_content", returnObject);
if (returnObject != null && returnObject.getLong("errno") == 0) {
childOrder.setStatus(102);
@ -912,6 +917,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
outRechargeOrder.setRechargeStatus(204);
}
outRechargeOrderService.updateOrder(outRechargeOrder);
System.out.println("话费定时任务 -> 需要重新充值:结束");
}
@Override

@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.sound.midi.Soundbank;
import java.util.Map;
@Service(value = "notifyService")
@ -37,6 +38,9 @@ public class NotifyServiceImpl implements NotifyService {
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public String alipayNotify(Map<String, String> params) throws Exception {
System.out.println("-----------------------------------------------------------" + params);
String result = "failure";
String trade_status = params.get("trade_status");
if ("TRADE_SUCCESS".equals(trade_status)) {

@ -2,12 +2,17 @@ package com.hai.service.pay.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.config.QianZhuConfig;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.ApiMemberProduct;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighGasOrderPush;
import com.hai.entity.HighOrder;
import com.hai.enum_type.OrderPushType;
import com.hai.service.ApiMemberProductService;
import com.hai.service.HighOrderService;
import com.hai.service.pay.PayService;
import org.springframework.stereotype.Service;
@ -16,6 +21,7 @@ import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
import java.util.Objects;
@Service("starbucksOrderService")
public class StarbucksOrderServiceImpl implements PayService {
@ -24,6 +30,9 @@ public class StarbucksOrderServiceImpl implements PayService {
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@Override
public void paySuccess(Map<String, String> map, String payType) throws Exception {
if (payType.equals("Alipay")) {
@ -44,16 +53,16 @@ public class StarbucksOrderServiceImpl implements PayService {
}
highOrderService.updateOrder(order);
// 支付给千猪
JSONObject object = QianZhuConfig.starbucksOrdersPay(order.getOrderNo());
// 订单支付
JSONObject requestContent = QianZhuConfig.starbucksOrdersPay(order.getOrderNo());
// 推送订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type3.getType());
highGasOrderPush.setType(OrderPushType.type8.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(order.getOrderNo());
highGasOrderPush.setReturnContent(object.toJSONString());
highGasOrderPush.setReturnContent(requestContent.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
}
}

@ -0,0 +1,70 @@
package com.hai.service.pay.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.config.QianZhuConfig;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.ApiMemberProduct;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighGasOrderPush;
import com.hai.entity.HighOrder;
import com.hai.enum_type.OrderPushType;
import com.hai.service.ApiMemberProductService;
import com.hai.service.HighOrderService;
import com.hai.service.pay.PayService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
@Service("thirdOrderService")
public class ThirdOrderServiceImpl implements PayService {
@Resource
private HighOrderService highOrderService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@Resource
private ApiMemberProductService apiMemberProductService;
@Override
public void paySuccess(Map<String, String> map, String payType) throws Exception {
if (payType.equals("Alipay")) {
return;
}
if (payType.equals("WechatPay")) {
HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no"));
if (order != null && order.getOrderStatus() == 1) {
order.setPaySerialNo(map.get("transaction_id")); // 支付流水号
order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额
order.setPayTime(new Date()); // 支付时间
order.setPayModel(2); // 支付模式:1 金币,2 第三方平台,3 混合
order.setPayType(2); // 支付方式: 1:支付宝 2:微信 3:金币
order.setOrderStatus(2); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
for (HighChildOrder childOrder : order.getHighChildOrderList()) {
childOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
}
highOrderService.updateOrder(order);
// 下单
ApiMemberProduct memberProduct = apiMemberProductService.findById(order.getHighChildOrderList().get(0).getGoodsId());
JSONObject object = QianZhuConfig.insertV2(memberProduct.getProductId() , order.getOrderNo() , order.getRemarks());
// 推送订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type8.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setRequestContent(order.getOrderNo());
highGasOrderPush.setReturnContent(object.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
}
}
}
}

@ -71,9 +71,17 @@ JjAppSecret = xkf9eoq2cjh6uvzp0mtrga134lnibdw8
#LY
LyNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallbackByLy
LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU
LyMemberId=18665
LyPostUrl=https://cz.31994.cn/yrapi.php/
#LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU
#LyMemberId=18665
#LyPostUrl=https://cz.31994.cn/yrapi.php/
LyApiKey=UzMxo9SIL1tmFvWTwys7pQRGJqO3EChK
LyMemberId=11236
LyPostUrl=http://cz.zt10010.com/yrapi.php/
#CY
CyApiKey=cyMYLABWa2H2u
CyAppSecret =cysslWXHnMHDMEvDEtwSWaJMGwl4dkcPLT
CyPostUrl=http://120.24.83.85:8999/
unionAppId=7113783e75354df2a985efd3f31b9528
unionSecret=e2c731d2a026469aa6d218432f361653

@ -63,9 +63,18 @@ JjAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij
#LY
LyNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallbackByLy
LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU
LyMemberId=18665
LyPostUrl=https://cz.31994.cn/yrapi.php/
#LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU
#LyMemberId=18665
#LyPostUrl=https://cz.31994.cn/yrapi.php/
LyApiKey=UzMxo9SIL1tmFvWTwys7pQRGJqO3EChK
LyMemberId=11236
LyPostUrl=http://cz.zt10010.com/yrapi.php/
#CY
CyApiKey=cyMYLABWa2H2u
CyAppSecret =cysslWXHnMHDMEvDEtwSWaJMGwl4dkcPLT
CyPostUrl=http://120.24.83.85:8999/
unionAppId=ced46392acfe42be863fdfdd3e61164a
unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa

@ -61,9 +61,18 @@ JjAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij
#LY
LyNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallbackByLy
LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU
LyMemberId=18665
LyPostUrl=https://cz.31994.cn/yrapi.php/
#LyApiKey=CMdyxh2gJ7tbXc6rS0KADqPIfVpaQLjU
##LyMemberId=18665
##LyPostUrl=https://cz.31994.cn/yrapi.php/
LyApiKey=UzMxo9SIL1tmFvWTwys7pQRGJqO3EChK
LyMemberId=11236
LyPostUrl=http://cz.zt10010.com/yrapi.php/
#CY
CyApiKey=cyMYLABWa2H2u
CyAppSecret =cysslWXHnMHDMEvDEtwSWaJMGwl4dkcPLT
CyPostUrl=http://120.24.83.85:8999/
unionAppId=ced46392acfe42be863fdfdd3e61164a
unionSecret=a0f380bb22cd4ce2a8d35f3bf437d6fa

Loading…
Cancel
Save