袁野 4 years ago
commit acb01b829c
  1. 1
      .gitignore
  2. 1
      hai-bweb/src/main/java/com/bweb/config/AuthConfig.java
  3. 37
      hai-bweb/src/main/java/com/bweb/controller/CommonController.java
  4. 108
      hai-bweb/src/main/java/com/bweb/controller/HighAgentController.java
  5. 85
      hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java
  6. 249
      hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java
  7. 64
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  8. 42
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantTripartitePlatformController.java
  9. 17
      hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java
  10. 12
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  11. 2
      hai-bweb/src/main/java/com/bweb/controller/HighTestController.java
  12. 5
      hai-bweb/src/main/java/com/bweb/controller/LoginController.java
  13. 7
      hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java
  14. 7
      hai-bweb/src/main/java/com/bweb/excelListener/ImportRechargeOrderListener.java
  15. 22
      hai-bweb/src/main/java/com/bweb/model/ExportOutRechargeOrder.java
  16. 14
      hai-bweb/src/main/resources/dev/application.yml
  17. 14
      hai-bweb/src/main/resources/pre/application.yml
  18. 14
      hai-bweb/src/main/resources/prod/application.yml
  19. 56
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  20. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  21. 56
      hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java
  22. 19
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  23. 107
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  24. 5
      hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java
  25. 15
      hai-cweb/src/main/resources/dev/application.yml
  26. 14
      hai-cweb/src/main/resources/pre/application.yml
  27. 14
      hai-cweb/src/main/resources/prod-9401/application.yml
  28. 14
      hai-cweb/src/main/resources/prod/application.yml
  29. 21
      hai-cweb/src/test/common/test.java
  30. 4
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  31. 8
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  32. 14
      hai-schedule/src/main/resources/dev/application.yml
  33. 15
      hai-schedule/src/main/resources/pre/application.yml
  34. 15
      hai-schedule/src/main/resources/prod/application.yml
  35. 4
      hai-service/pom.xml
  36. 6
      hai-service/src/main/java/com/hai/common/exception/ErrorCode.java
  37. 48
      hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java
  38. 44
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  39. 35
      hai-service/src/main/java/com/hai/config/HuiLianTongConfig.java
  40. 41
      hai-service/src/main/java/com/hai/config/MqttProviderCallBack.java
  41. 234
      hai-service/src/main/java/com/hai/config/MqttProviderConfig.java
  42. 5
      hai-service/src/main/java/com/hai/config/RechargeConfig.java
  43. 78
      hai-service/src/main/java/com/hai/config/ShellGroupService.java
  44. 4
      hai-service/src/main/java/com/hai/config/SpPrinterConfig.java
  45. 6
      hai-service/src/main/java/com/hai/config/WxOrderConfig.java
  46. 365
      hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java
  47. 3
      hai-service/src/main/java/com/hai/dao/ApiAmountRecordMapperExt.java
  48. 31
      hai-service/src/main/java/com/hai/dao/ApiOrderRecordMapperExt.java
  49. 18
      hai-service/src/main/java/com/hai/dao/ApiProductConfigMapperExt.java
  50. 17
      hai-service/src/main/java/com/hai/dao/HighAgentMapper.java
  51. 28
      hai-service/src/main/java/com/hai/dao/HighAgentSqlProvider.java
  52. 34
      hai-service/src/main/java/com/hai/dao/HighCouponAgentCodeMapper.java
  53. 42
      hai-service/src/main/java/com/hai/dao/HighCouponAgentCodeSqlProvider.java
  54. 38
      hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapper.java
  55. 14
      hai-service/src/main/java/com/hai/dao/HighCouponAgentRelSqlProvider.java
  56. 155
      hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java
  57. 7
      hai-service/src/main/java/com/hai/dao/HighDeviceMapperExt.java
  58. 430
      hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java
  59. 11
      hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformMapper.java
  60. 28
      hai-service/src/main/java/com/hai/dao/HighMerchantTripartitePlatformSqlProvider.java
  61. 2
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  62. 3
      hai-service/src/main/java/com/hai/dao/OutRechargeOrderMapperExt.java
  63. 4
      hai-service/src/main/java/com/hai/entity/ApiMerchants.java
  64. 4
      hai-service/src/main/java/com/hai/entity/ApiOrderRecord.java
  65. 35
      hai-service/src/main/java/com/hai/entity/HighAgent.java
  66. 130
      hai-service/src/main/java/com/hai/entity/HighAgentExample.java
  67. 50
      hai-service/src/main/java/com/hai/entity/HighCouponAgentCode.java
  68. 190
      hai-service/src/main/java/com/hai/entity/HighCouponAgentCodeExample.java
  69. 16
      hai-service/src/main/java/com/hai/entity/HighCouponAgentRel.java
  70. 60
      hai-service/src/main/java/com/hai/entity/HighCouponAgentRelExample.java
  71. 344
      hai-service/src/main/java/com/hai/entity/HighDevice.java
  72. 1473
      hai-service/src/main/java/com/hai/entity/HighDeviceExample.java
  73. 32
      hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatform.java
  74. 140
      hai-service/src/main/java/com/hai/entity/HighMerchantTripartitePlatformExample.java
  75. 4
      hai-service/src/main/java/com/hai/entity/OutRechargeOrder.java
  76. 44
      hai-service/src/main/java/com/hai/enum_type/DeviceTypeEnum.java
  77. 66
      hai-service/src/main/java/com/hai/model/ApiProductConfigModel.java
  78. 22
      hai-service/src/main/java/com/hai/model/OutRechargeOrderModel.java
  79. 47
      hai-service/src/main/java/com/hai/service/ApiAmountRecordService.java
  80. 37
      hai-service/src/main/java/com/hai/service/ApiOpenService.java
  81. 31
      hai-service/src/main/java/com/hai/service/ApiOrderRecordService.java
  82. 10
      hai-service/src/main/java/com/hai/service/ApiProductService.java
  83. 13
      hai-service/src/main/java/com/hai/service/HighAgentService.java
  84. 14
      hai-service/src/main/java/com/hai/service/HighCouponAgentService.java
  85. 42
      hai-service/src/main/java/com/hai/service/HighDeviceService.java
  86. 7
      hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java
  87. 5
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  88. 11
      hai-service/src/main/java/com/hai/service/SecConfigService.java
  89. 52
      hai-service/src/main/java/com/hai/service/impl/ApiAmountRecordServiceImpl.java
  90. 2
      hai-service/src/main/java/com/hai/service/impl/ApiMerchantsServiceImpl.java
  91. 282
      hai-service/src/main/java/com/hai/service/impl/ApiOpenServiceImpl.java
  92. 27
      hai-service/src/main/java/com/hai/service/impl/ApiOrderRecordServiceImpl.java
  93. 25
      hai-service/src/main/java/com/hai/service/impl/ApiProductServiceImpl.java
  94. 51
      hai-service/src/main/java/com/hai/service/impl/HighAgentServiceImpl.java
  95. 137
      hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java
  96. 2
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  97. 77
      hai-service/src/main/java/com/hai/service/impl/HighDeviceServiceImpl.java
  98. 2
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java
  99. 4
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java
  100. 7
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java
  101. Some files were not shown because too many files have changed in this diff Show More

1
.gitignore vendored

@ -27,6 +27,7 @@ hai-schedule/target/*
hai-schedule/log/*
hai-schedule/hai-schedule.iml
v1/target/*
v1/log/*
v1/hai-schedule.iml

@ -97,6 +97,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/cmsContent/get*")
.excludePathPatterns("/highGoldRec/*")
.excludePathPatterns("/openApi/*")
.excludePathPatterns("/test/*")
;
}

@ -1,6 +1,9 @@
package com.bweb.controller;
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.ResponseMsgUtil;
import com.hai.config.TuanYouConfig;
@ -11,6 +14,7 @@ import com.hai.service.CommonService;
import com.hai.service.SecConfigService;
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.web.bind.annotation.*;
@ -144,6 +148,39 @@ public class CommonController {
}
}
@RequestMapping(value="/editConfig",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "添加配置")
public ResponseData editConfig(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("codeType"))
|| StringUtils.isBlank(body.getString("codeValue"))
) {
log.error("OrderController --> orderToPay() ERROR", "");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
SecConfig config = secConfigService.findByCodeType(body.getString("codeType"));
if (config == null) {
config = new SecConfig();
config.setCodeType(body.getString("codeType"));
config.setCodeValue(body.getString("codeValue"));
secConfigService.insertSecConfig(config);
} else {
config.setCodeValue(body.getString("codeValue"));
secConfigService.updateSecConfig(config);
}
return ResponseMsgUtil.success("修改成功");
} catch (Exception e) {
log.error("CommonController --> editConfig() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/updateDictionary",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据 码值类型 查询数据字典")

@ -1,5 +1,6 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.bweb.config.SysConst;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -9,6 +10,7 @@ import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.MemberValidateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighAgent;
import com.hai.entity.SecUser;
@ -55,6 +57,109 @@ public class HighAgentController {
@Resource
private SecUserService secUserService;
@RequestMapping(value = "/insertChildAgent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增子级代理商")
public ResponseData insertChildAgent(@RequestBody JSONObject body) {
try {
//发布人员
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
log.error("HighAgentController -> insertAgent() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
if (body == null ||
StringUtils.isBlank(body.getString("agentName")) ||
StringUtils.isBlank(body.getString("agentPhone")) ||
StringUtils.isBlank(body.getString("agentAddress"))
) {
log.error("HighAgentController -> insertAgent() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 校验账户手机号
if (!MemberValidateUtil.validatePhone(body.getString("agentPhone"))) {
log.error("BsStudentController --> updateMerchant() error!", "请输入正确的手机号");
throw ErrorHelp.genException(SysCode.System, ErrorCode.PHONE_NUM_IS_ERROR, "");
}
// 校验账号用户名是否存在
if (secUserService.findByLoginName(body.getString("agentPhone")) != null) {
log.error("HighAgentController --> insertAgent() error!", "手机号已存在,请更换!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.USER_LOGIN_NAME_IS_EXIST_ERROR, "");
}
HighAgent agent = new HighAgent();
agent.setParentId(userInfoModel.getHighAgent().getId());
agent.setParentName(userInfoModel.getHighAgent().getAgentName());
agent.setType(userInfoModel.getHighAgent().getType());
agent.setAgentName(body.getString("agentName"));
agent.setAgentAddress(body.getString("agentAddress"));
agent.setAgentPhone(body.getString("agentPhone"));
agent.setAgentKey(String.valueOf(System.currentTimeMillis()));
agent.setAgentUser(body.getString("agentName"));
agent.setStatus(1); // 状态:0:不可用,1:可用
agent.setCreateTime(new Date());
agent.setOperatorId(userInfoModel.getSecUser().getId());
agent.setOperatorName(userInfoModel.getSecUser().getUserName());
highAgentService.insertChildAgent(agent);
return ResponseMsgUtil.success("新增成功");
} catch (Exception e) {
log.error("HighAgentController --> insertChildAgent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/changeAgentStatus", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "变更代理商状态")
public ResponseData changeAgentStatus(@RequestParam(value = "agentId" , required = true) Long agentId,
@RequestParam(value = "status" , required = true) Integer status) {
try {
HighAgent highAgent = highAgentService.findByAgentMsgId(agentId);
if (highAgent == null) {
log.error("HighAgentController --> changeAgentStatus() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_USER_ERROR, "");
}
highAgent.setStatus(status);
highAgentService.updateAgentDetail(highAgent);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighAgentController --> changeAgentStatus() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getChildAgentList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询子级代理商列表")
public ResponseData getChildAgentList(@RequestParam(value = "agentId" , required = true) Long agentId,
@RequestParam(value = "agentPhone" , required = false) String agentPhone,
@RequestParam(value = "agentName" , required = false) String agentName,
@RequestParam(value = "status" , required = false) Integer status,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
Map<String, Object> param = new HashMap<>();
param.put("parentAgentId", agentId);
param.put("agentPhone", agentPhone);
param.put("agentName", agentName);
param.put("status", status);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highAgentService.getListAgentMsg(param)));
} catch (Exception e) {
log.error("HighAgentController --> changeAgentStatus() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/insertAgent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增代理商")
@ -206,7 +311,7 @@ public class HighAgentController {
// throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
// }
Map<String, String> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
if (StringUtils.isNotBlank(agentName)) {
map.put("agentName", agentName);
@ -235,7 +340,6 @@ public class HighAgentController {
}
}
@RequestMapping(value = "/findByAgentId", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询详情")

@ -105,6 +105,90 @@ public class HighCouponAgentController {
}
}
@RequestMapping(value = "/assignCouponChildAgent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "分配卡券给子级代理商")
public ResponseData assignCouponChildAgent(@RequestBody JSONObject body, HttpServletRequest request) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null || userInfoModel.getHighAgent() == null) {
log.error("HighCouponAgentController -> assignCouponAgent() error!","该主角色没有权限");
throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, "");
}
if(body == null
|| body.getLong("couponAgentRelId") == null
|| body.getLong("agentId") == null
|| body.getInteger("stockCount") == null
) {
log.error("HighCouponAgentController -> assignCouponAgent() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询父级代理商的卡券关系
HighCouponAgentRel rel = highCouponAgentService.getRelById(body.getLong("couponAgentRelId"));
if (rel == null) {
log.error("HighCouponAgentController -> assignCouponAgent() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (rel.getAgentId().equals(body.getLong("agentId") )) {
log.error("HighCouponAgentController -> assignCouponAgent() error!","不能给自己分配");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "不能给自己分配");
}
if (body.getInteger("stockCount").intValue() > rel.getStockCount().intValue()) {
log.error("HighCouponAgentController -> assignCouponAgent() error!","库存数量不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "库存数量不足");
}
// 查询卡券详情
HighCoupon coupon = highCouponService.getCouponById(rel.getCouponId());
if (coupon == null) {
log.error("HighCouponAgentController -> assignCouponAgent() error!","未找到卡券信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
}
// 查询代理商
HighAgent highAgent = highAgentService.findByAgentMsgId(body.getLong("agentId"));
if (highAgent == null) {
log.error("HighCouponAgentController -> assignCouponAgent() error!", "未找到代理商信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, "");
}
if (highAgent.getParentId() == null) {
log.error("HighCouponAgentController -> assignCouponAgent() error!", "不是子级代理商");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "不是子级代理商");
}
// 校验是否分配过
HighCouponAgentRel couponAgent = highCouponAgentService.getRelByCouponAgent(rel.getCouponId(), body.getLong("agentId"), rel.getType());
if (couponAgent != null) {
couponAgent.setStockCount(couponAgent.getStockCount() + body.getInteger("stockCount"));
couponAgent.setOperatorId(userInfoModel.getSecUser().getId());
couponAgent.setOperatorName(userInfoModel.getSecUser().getUserName());
highCouponAgentService.assignCouponAgent(couponAgent, body.getInteger("stockCount"));
} else {
couponAgent = new HighCouponAgentRel();
couponAgent.setParentCouponAgentId(rel.getId());
couponAgent.setType(rel.getType());
couponAgent.setCouponId(rel.getCouponId());
couponAgent.setAgentId(body.getLong("agentId"));
couponAgent.setCouponName(coupon.getCouponName());
couponAgent.setSalesPrice(coupon.getSalesPrice());
couponAgent.setStatus(1); // 状态 0:删除 1:正常
couponAgent.setStockCount(body.getInteger("stockCount"));
couponAgent.setSalesCount(0);
couponAgent.setCreateTime(new Date());
couponAgent.setOperatorId(userInfoModel.getSecUser().getId());
couponAgent.setOperatorName(userInfoModel.getSecUser().getUserName());
highCouponAgentService.assignCouponAgent(couponAgent, body.getInteger("stockCount"));
}
return ResponseMsgUtil.success("分配成功");
} catch (Exception e) {
log.error("HighCouponAgentController --> assignCouponAgent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getAgentSalesCodeList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询代理商已销售的卡券")
@ -259,7 +343,6 @@ public class HighCouponAgentController {
}
}
@RequestMapping(value = "/getCouponByAgent", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据代理商 查询卡券")

@ -0,0 +1,249 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
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.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.SpPrinterConfig;
import com.hai.entity.*;
import com.hai.enum_type.DeviceTypeEnum;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.BsCompanyService;
import com.hai.service.HighDeviceService;
import com.hai.service.HighMerchantService;
import com.hai.service.HighMerchantStoreService;
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.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/device")
@Api(value = "卡卷接口")
public class HighDeviceController {
private static Logger log = LoggerFactory.getLogger(HighCouponController.class);
@Resource
private UserCenter userCenter;
@Resource
private HighDeviceService deviceService;
@Resource
private HighMerchantService merchantService;
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private BsCompanyService companyService;
@RequestMapping(value="/editDevice",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑设备")
public ResponseData editDevice(@RequestBody HighDevice body) {
try {
if (body.getMerStoreId() == null
|| body.getType() == null
|| StringUtils.isBlank(body.getDeviceName())
) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (DeviceTypeEnum.getNameByType(body.getType()) == null) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的设备类型");
}
if (body.getType().equals(DeviceTypeEnum.type1.getType())
&& (StringUtils.isBlank(body.getDeviceSn()) || StringUtils.isBlank(body.getDeviceKey()))) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} else if (body.getType().equals(DeviceTypeEnum.type2.getType())
&& (StringUtils.isBlank(body.getDeviceImei()) || StringUtils.isBlank(body.getDeviceIccid()))) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
HighDevice device;
if (body.getId() != null) {
// 查询设备
device = deviceService.getDetailById(body.getId());
if (device == null) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
} else {
device = new HighDevice();
}
// 查询门店
HighMerchantStore store = merchantStoreService.getDetailById(body.getMerStoreId());
if (store == null) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的门店");
}
// 查询商户
HighMerchant merchant = merchantService.getDetailById(store.getMerchantId());
if (merchant == null) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户");
}
// 查询分公司
BsCompany company = companyService.getCompanyById(merchant.getCompanyId());
if (company == null) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的分公司");
}
if (body.getType().equals(DeviceTypeEnum.type1.getType())) {
SpPrinterConfig sp = new SpPrinterConfig();
JSONObject jsonObject = JSONObject.parseObject(sp.addPrinter(body.getDeviceSn(), body.getDeviceKey(), body.getDeviceName()));
if (!jsonObject.getInteger("errorcode").equals(0)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errormsg"));
}
}
device.setCompanyId(company.getId());
device.setCompanyName(company.getName());
device.setMerId(merchant.getId());
device.setMerName(merchant.getMerchantName());
device.setMerStoreId(store.getId());
device.setMerStoreName(store.getStoreName());
device.setType(body.getType());
device.setDeviceName(body.getDeviceName());
device.setDeviceSn(body.getDeviceSn());
device.setDeviceKey(body.getDeviceKey());
device.setDeviceImei(body.getDeviceImei());
device.setDeviceIccid(body.getDeviceIccid());
deviceService.editDevice(device);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighDeviceController -> editDevice() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/delDevice",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "删除设备")
public ResponseData delDevice(@RequestBody JSONObject body) {
try {
if (body.getLong("deviceId") == null) {
log.error("HighDeviceController -> delDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询设备
HighDevice device = deviceService.getDetailById(body.getLong("deviceId"));
if (device == null) {
log.error("HighDeviceController -> delDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (device.getType().equals(DeviceTypeEnum.type1.getType())) {
SpPrinterConfig sp = new SpPrinterConfig();
JSONObject jsonObject = JSONObject.parseObject(sp.deletePrinter(device.getDeviceSn()));
if (!jsonObject.getInteger("errorcode").equals(0)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errormsg"));
}
}
device.setStatus(0);
deviceService.editDevice(device);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighDeviceController -> delDevice() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDetailById",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询设备详情")
public ResponseData getDetailById(@RequestParam(name = "deviceId", required = true) Long deviceId) {
try {
return ResponseMsgUtil.success(deviceService.getDetailById(deviceId));
} catch (Exception e) {
log.error("HighDeviceController -> getDetailById() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getDeviceList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询设备详情")
public ResponseData getDeviceList(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merId", required = false) Long merId,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "deviceName", required = false) String deviceName,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class);
if (sessionModel == null) {
log.error("HighDeviceController -> getDeviceList() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到");
}
Map<String, Object> param = new HashMap<>();
param.put("deviceName", deviceName);
if (sessionModel.getSecUser().getObjectType().equals(0)) {
param.put("companyId", companyId);
param.put("merId", merId);
param.put("storeId", storeId);
} else if (sessionModel.getSecUser().getObjectType().equals(1)) {
param.put("companyId", sessionModel.getBsCompany().getId());
param.put("merId", merId);
param.put("storeId", storeId);
} else if (sessionModel.getSecUser().getObjectType().equals(2)) {
param.put("merId", sessionModel.getMerchant().getId());
param.put("storeId", storeId);
} else if (sessionModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", sessionModel.getMerchantStore().getId());
} else {
log.error("HighDeviceController -> getDeviceList() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(deviceService.getDeviceList(param)));
} catch (Exception e) {
log.error("HighDeviceController -> getDeviceList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -173,11 +173,33 @@ public class HighGasController {
Map<String, Object> param = new HashMap<>();;
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工
if (userInfoModel.getSecUser().getObjectType().equals(2)) {
param.put("storeId", storeId);
if (storeId != null) {
param.put("storeId", storeId);
} else {
String storeIdStr = "";
List<HighMerchantStore> storeList = merchantStoreService.getStoreListByMer(userInfoModel.getMerchant().getId());
for (HighMerchantStore store : storeList) {
if (StringUtils.isBlank(storeIdStr)) {
storeIdStr += store.getId().toString();
} else {
storeIdStr += "," + store.getId().toString();
}
}
if (StringUtils.isNotBlank(storeIdStr)) {
param.put("storeId", storeIdStr);
} else {
param.put("storeId", 0);
}
}
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
} else {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
@ -237,17 +259,51 @@ public class HighGasController {
@ResponseBody
@ApiOperation(value = "导出油站订单")
public ResponseData exportGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null || userInfoModel.getMerchantStore() == null) {
if (userInfoModel == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String, Object> param = new HashMap<>();;
param.put("storeId", userInfoModel.getMerchantStore().getId());
Map<String, Object> param = new HashMap<>();
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工
if (userInfoModel.getSecUser().getObjectType().equals(2)) {
if (storeId != null) {
param.put("storeId", storeId);
} else {
String storeIdStr = "";
List<HighMerchantStore> storeList = merchantStoreService.getStoreListByMer(userInfoModel.getMerchant().getId());
for (HighMerchantStore store : storeList) {
if (StringUtils.isBlank(storeIdStr)) {
storeIdStr += store.getId().toString();
} else {
storeIdStr += "," + store.getId().toString();
}
}
if (StringUtils.isNotBlank(storeIdStr)) {
param.put("storeId", storeIdStr);
} else {
param.put("storeId", 0);
}
}
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) {
param.put("storeId", userInfoModel.getMerchantStore().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);

@ -4,9 +4,14 @@ 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.pay.util.XmlUtil;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.common.utils.WxUtils;
import com.hai.entity.HighMerchantTripartitePlatform;
import com.hai.model.ResponseData;
import com.hai.model.WxSharingReceiversVO;
import com.hai.service.HighMerchantTripartitePlatformService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -18,6 +23,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.SortedMap;
@Controller
@RequestMapping(value = "/merchantTripartitePlatform")
@ -45,14 +53,17 @@ public class HighMerchantTripartitePlatformController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (body.getBoolean("profitSharingStatus") == true && body.getBigDecimal("profitSharingRatio") == null) {
if (body.getBoolean("profitSharingStatus") == true &&
(body.getBigDecimal("profitSharingRatio") == null ||
StringUtils.isBlank(body.getString("profitSharingReceiversNumber")) ||
StringUtils.isBlank(body.getString("profitSharingReceiversName")))) {
log.error("HighMerchantController -> insertMerchantStore() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
HighMerchantTripartitePlatform platform = tripartitePlatformService.getDetail(body.getLong("merId"), body.getInteger("platformType"));
if (platform == null) {
platform = new HighMerchantTripartitePlatform();
}
platform.setMerId(body.getLong("merId"));
platform.setPlatformType(body.getInteger("platformType"));
@ -60,6 +71,33 @@ public class HighMerchantTripartitePlatformController {
platform.setPlatformMerNumber(body.getString("platformMerNumber"));
platform.setProfitSharingStatus(body.getBoolean("profitSharingStatus"));
platform.setProfitSharingRatio(body.getBigDecimal("profitSharingRatio"));
platform.setProfitSharingReceiversNumber(body.getString("profitSharingReceiversNumber"));
platform.setProfitSharingReceiversName(body.getString("profitSharingReceiversName"));
// 微信平台 增加分账关系
if (platform.getPlatformType().equals(1) && platform.getProfitSharingStatus().equals(true)) {
WxSharingReceiversVO receiversVO = new WxSharingReceiversVO();
receiversVO.setAccount(platform.getProfitSharingReceiversNumber());
receiversVO.setType("MERCHANT_ID");
receiversVO.setName(platform.getProfitSharingReceiversName());
receiversVO.setRelation_type("SERVICE_PROVIDER");
Map<String , String> map = new HashMap<>();
map.put("mch_id" , "1289663601"); // 服务商
map.put("sub_mch_id" , platform.getPlatformMerNumber());
map.put("appid" , "wxa075e8509802f826");
map.put("nonce_str" , WxUtils.makeNonStr());
map.put("sign_type" , "HMAC-SHA256");
map.put("receiver" , JSONObject.toJSONString(receiversVO));
String sign = WxUtils.generateSignature(map, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
map.put("sign" , sign);
String notifyXml = HttpsUtils.postData("https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver", WxUtils.mapToXml(map));
SortedMap<String, String> postData = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8");
if (!postData.get("result_code").equals("SUCCESS")) {
log.error("HighMerchantController -> editTripartitePlatform() error!", postData.get("err_code_des"));
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, postData.get("err_code_des"));
}
}
tripartitePlatformService.editDate(platform);
return ResponseMsgUtil.success("操作成功");

@ -10,9 +10,12 @@ import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.HuiLianTongConfig;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.HighCoupon;
import com.hai.entity.HighGasOrderPush;
import com.hai.entity.HighMerchant;
import com.hai.entity.HighUser;
import com.hai.enum_type.OrderPushType;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighOpenApiService;
@ -52,12 +55,16 @@ public class HighOpenApiController {
@Resource
private HighUserService highUserService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@Resource
private SecConfigService secConfigService;
@Resource
private HuiLianTongConfig huiLianTongConfig;
@RequestMapping(value = "/getGuizhouSinopecList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取专属优惠券")
@ -186,6 +193,16 @@ public class HighOpenApiController {
// 商户派发电子券
JSONObject returnParam = HuiLianTongConfig.couJointDist(token, object.getString("orderNo"), object.getString("couTypeCode"), object.getInteger("distCouCount"), object.getString("phone"), object.getString("thirdUserId"));
System.out.println("派发电子券" + returnParam);
// 推送记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type6.getType());
highGasOrderPush.setOrderNo(object.getString("orderNo"));
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(returnParam.getString("result"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(object));
highGasOrderPush.setReturnContent(returnParam.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (returnParam == null || !returnParam.getString("result").equals("success")) {
log.error("HighOpenApiController -> couJointDist() error!","商户派发电子券失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户派发电子券失败");

@ -75,7 +75,8 @@ public class HighOrderController {
@RequestMapping(value = "/print", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "打印")
public ResponseData print(@RequestParam(name = "orderId", required = true) Long orderId) {
public ResponseData print(@RequestParam(name = "orderId", required = true) Long orderId,
@RequestParam(name = "printType", required = true) Integer printType) {
try {
HighOrder order = highOrderService.getOrderById(orderId);
@ -83,11 +84,15 @@ public class HighOrderController {
log.error("HighCouponController -> getCouponList() error!","权限不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
order.setPrintStatus(true);
order.setPrintNum(order.getPrintNum() + 1);
highOrderService.updateOrderDetail(order);
// 1. 热敏打印机 2. 云打印机
if (printType == 2) {
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order);
}
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
@ -346,6 +351,9 @@ public class HighOrderController {
} else if (userInfoModel.getSecUser().getObjectType() == 2) {
map.put("merchantId", userInfoModel.getMerchant().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
map.put("orderNo", orderNo);

File diff suppressed because one or more lines are too long

@ -173,10 +173,9 @@ public class LoginController {
log.error("login error!","未找到代理商");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, "");
}
if(highAgent.getStatus() != 1) {
log.error("login error!","未找到代理商");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_AGENT, "");
log.error("login error!","代理商状态异常,请联系管理员");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "代理商状态异常,请联系管理员");
}
userInfoModel.setHighAgent(highAgent);

@ -221,10 +221,15 @@ public class OutRechargeOrderController {
Map<String, Object> map = new HashMap<>();
if (companyId != null) {
map.put("companyId", companyId);
} else if (userInfoModel.getSecRole().getRoleType() != 1){
map.put("companyId", userInfoModel.getBsCompany().getId());
if (userInfoModel.getSecRole().getRoleType() == 7) {
map.put("companyId", 23);
} else {
map.put("companyId", userInfoModel.getBsCompany().getId());
}
}
map.put("rechargeStatus", rechargeStatus);
map.put("payStatus", payStatus);

@ -40,12 +40,6 @@ public class ImportRechargeOrderListener extends AnalysisEventListener<ExportOut
OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderNo(data.getOrderNo());
if (rechargeOrder.getRechargeStatus() != 201 || rechargeOrder.getRechargeType() != 2) {
data.setErrorMessage("当前订单状态错误。");
errorData.add(data);
return;
}
if (Objects.equals(data.getRechargeStatusName(), "成功")) {
outRechargeOrderService.finishOrder(rechargeOrder.getId());
} else if (Objects.equals(data.getRechargeStatusName(), "失败")){
@ -56,7 +50,6 @@ public class ImportRechargeOrderListener extends AnalysisEventListener<ExportOut
errorData.add(data);
return;
}
}

@ -19,6 +19,9 @@ public class ExportOutRechargeOrder {
@ExcelProperty("支付方式")
private String payTypeName;
@ExcelProperty("工会卡")
private String laborUnionCard;
@ExcelProperty("充值内容")
private String rechargeContent;
@ -55,6 +58,9 @@ public class ExportOutRechargeOrder {
@ExcelProperty("充值状态")
private String rechargeStatusName;
@ExcelProperty("退款时间")
private Date refundTime;
// 错误消息
private String errorMessage;
@ -187,6 +193,14 @@ public class ExportOutRechargeOrder {
this.rechargeStatusName = rechargeStatusName;
}
public String getLaborUnionCard() {
return laborUnionCard;
}
public void setLaborUnionCard(String laborUnionCard) {
this.laborUnionCard = laborUnionCard;
}
public String getErrorMessage() {
return errorMessage;
}
@ -194,4 +208,12 @@ public class ExportOutRechargeOrder {
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public Date getRefundTime() {
return refundTime;
}
public void setRefundTime(Date refundTime) {
this.refundTime = refundTime;
}
}

@ -39,6 +39,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#配置日期返回至前台为时间戳
jackson:
serialization:

@ -39,6 +39,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#配置日期返回至前台为时间戳
jackson:
serialization:

@ -39,6 +39,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
#用户名
username: printer_provider
#密码
password: abcd123!
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/

@ -79,8 +79,8 @@ public class HighGasController {
@RequestParam(name = "distance", required = true) Integer distanceRecent,
@RequestParam(name = "regionId", required = true) Long regionId,
@RequestParam(name = "oilNoName", required = true) String oilNoName,
@RequestParam(name = "longitude", required = true) String longitude,
@RequestParam(name = "latitude", required = true) String latitude,
@RequestParam(name = "longitude", required = false) String longitude,
@RequestParam(name = "latitude", required = false) String latitude,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize
) {
@ -99,17 +99,29 @@ public class HighGasController {
store.put("store_logo", null);
}
}
double distance = CoordCommonUtil.getDistance(Double.valueOf(store.get("latitude").toString()), Double.valueOf(store.get("longitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
store.put("distance", Math.round(distance/100d)/10d);
if (StringUtils.isNotBlank(longitude) && StringUtils.isNotBlank(latitude)) {
double distance = CoordCommonUtil.getDistance(Double.valueOf(store.get("latitude").toString()), Double.valueOf(store.get("longitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
store.put("distance", Math.round(distance/100d)/10d);
} else {
store.put("distance", null);
}
}
List<Map<String, Object>> distance = storeList.stream().sorted(Comparator.comparingDouble(entry -> Double.valueOf(entry.get("distance").toString()))).collect(Collectors.toList());
Iterator<Map<String, Object>> iterator = distance.iterator();
while (iterator.hasNext()) {
if ((int)Math.round(Double.valueOf(iterator.next().get("distance").toString())) > distanceRecent.intValue()) {
iterator.remove();
PageInfo<Map<String, Object>> mapPageInfo;
if (StringUtils.isNotBlank(longitude) && StringUtils.isNotBlank(latitude)) {
List<Map<String, Object>> distance = storeList.stream().sorted(Comparator.comparingDouble(entry -> Double.valueOf(entry.get("distance").toString()))).collect(Collectors.toList());
Iterator<Map<String, Object>> iterator = distance.iterator();
while (iterator.hasNext()) {
if ((int)Math.round(Double.valueOf(iterator.next().get("distance").toString())) > distanceRecent.intValue()) {
iterator.remove();
}
}
mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance));
} else {
mapPageInfo = PageUtil.initPageInfoObj(pageNum, storeList.size(), pageSize, new PageInfo<>(storeList));
}
PageInfo<Map<String, Object>> mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance));
for (Map<String, Object> map : mapPageInfo.getList()) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "oil_no"))) {
@ -250,8 +262,8 @@ public class HighGasController {
@ResponseBody
@ApiOperation(value = "根据门店key 查询")
public ResponseData getGasDetailByStoreKey(@RequestParam(name = "storeKey", required = true) String storeKey,
@RequestParam(name = "longitude", required = true) String longitude,
@RequestParam(name = "latitude", required = true) String latitude,
@RequestParam(name = "longitude", required = false) String longitude,
@RequestParam(name = "latitude", required = false) String latitude,
@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent) {
try {
@ -280,9 +292,14 @@ public class HighGasController {
param.put("gasLogoSmall", CommonSysConst.getSysConfig().getHsgDomainName()+"/filesystem/"+store.getStoreLogo());
param.put("gasAddressLatitude", store.getLatitude());
param.put("gasAddressLongitude", store.getLongitude());
// 距离
double distance = CoordCommonUtil.getDistance(Double.valueOf(param.get("gasAddressLatitude").toString()), Double.valueOf(param.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
param.put("distance", Math.round(distance/100d)/10d);
if (StringUtils.isNotBlank(longitude) && StringUtils.isNotBlank(latitude)) {
// 距离
double distance = CoordCommonUtil.getDistance(Double.valueOf(param.get("gasAddressLatitude").toString()), Double.valueOf(param.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
param.put("distance", Math.round(distance/100d)/10d);
} else {
param.put("distance", null);
}
// 查询油枪
List<Map<String, Object>> gasGunMapList = new ArrayList<>();
@ -407,8 +424,13 @@ public class HighGasController {
}
result.put("oilPriceList", newOilPriceList);
double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
result.put("distance", Math.round(distance/100d)/10d);
if (StringUtils.isNotBlank(longitude) && StringUtils.isNotBlank(latitude)) {
// 距离
double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
result.put("distance", Math.round(distance/100d)/10d);
} else {
result.put("distance", null);
}
return ResponseMsgUtil.success(jsonObject.get("result"));
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("message"));

File diff suppressed because one or more lines are too long

@ -49,9 +49,6 @@ public class CzOrderController {
@Resource
private UserCenter userCenter;
@Resource
private HighGasOrderRefundMapper highGasOrderRefundMapper;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@ -76,6 +73,9 @@ public class CzOrderController {
@Resource
private WechatPayUtil wechatPayUtil;
@Resource
private ApiOrderRecordService apiOrderRecordService;
@RequestMapping(value = "/rechargeCallback", method = RequestMethod.POST)
@ApiOperation(value = "龙阅充值回调")
@ -191,6 +191,10 @@ public class CzOrderController {
outRechargeOrderService.updateOrder(rechargeOrder);
outRechargeChildOrderService.updateOrder(childOrder);
if (rechargeOrder.getPayType() == 6) {
apiOrderRecord(rechargeOrder);
}
} else {
callbackResult(childOrder , rechargeOrder);
}
@ -254,6 +258,9 @@ public class CzOrderController {
outRechargeOrderService.updateOrder(rechargeOrder);
outRechargeChildOrderService.updateOrder(childOrder);
if (rechargeOrder.getPayType() == 6) {
apiOrderRecord(rechargeOrder);
}
} else {
callbackResult(childOrder , rechargeOrder);
}
@ -278,7 +285,8 @@ public class CzOrderController {
Date rechargeTime = rechargeOrder.getCreateTimed();
Date currentTime = new Date();
int hours = (int) ((rechargeTime.getTime() - currentTime.getTime()) / (1000 * 60 * 60));
// 当前时间减去充值时间
int hours = (int) ((currentTime.getTime() - rechargeTime.getTime()) / (1000 * 60 * 60));
// 判断快充 并且 充值时间小于6
if (rechargeOrder.getRechargeType() == 1 && hours < 6) {
@ -291,8 +299,14 @@ public class CzOrderController {
return;
}
rechargeOrder.setRechargeStatus(203);
childOrder.setStatus(103);
outRechargeOrderService.updateOrder(rechargeOrder);
outRechargeChildOrderService.updateOrder(childOrder);
outRechargeOrderService.rechargeOrderToRefund(rechargeOrder.getId());
new Thread(() -> {
HighUser highUser = highUserService.findByUserId(rechargeOrder.getUserId());
WxMsgConfig.rechargedFail(
@ -468,4 +482,38 @@ public class CzOrderController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/apiCallBack",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "apiCallBack")
public String test(@RequestBody String reqBodyStr) {
try {
if (StringUtils.isBlank(reqBodyStr)) {
log.error("orderToPay error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
System.out.println("reqBodyStr");
return "SUCCESS";
} catch (Exception e) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
}
private void apiOrderRecord(OutRechargeOrder rechargeOrder) {
Map<String, Object> orderMap = new HashMap<>();
orderMap.put("orderId" , rechargeOrder.getId());
// 查询是否用重复订单
ApiOrderRecord apiOrderRecord = apiOrderRecordService.queryOrderResult(orderMap);
apiOrderRecord.setStatus(100);
apiOrderRecord.setRequestTime(new Date());
apiOrderRecordService.updateOrderRecord(apiOrderRecord);
}
}

@ -108,6 +108,9 @@ public class OrderController {
@Resource
private UnionStagingPayConfig unionStagingPayConfig;
@Resource
private SecConfigService configService;
/**
*
* @Title: orderToPay
@ -214,8 +217,13 @@ public class OrderController {
weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxGzSubMchId());//商户号
} else if (order.getHighChildOrderList().get(0).getGoodsType() == 3) {
weChatPayReqInfo.setSub_mch_id("1624126902"); // 浩联商户号
profitSharing = "Y";
SecConfig wxMerNumber = configService.findByCodeType("OIL_WX_MER");
if (wxMerNumber == null) {
weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1624126902); // 浩联商户号
} else {
weChatPayReqInfo.setSub_mch_id(wxMerNumber.getCodeValue());
}
profitSharing = "N";
// 查询油站
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(order.getHighChildOrderList().get(0).getGoodsId());
@ -225,12 +233,11 @@ public class OrderController {
profitSharing = "N";
// 第三方平台
HighMerchantTripartitePlatform merTripartitePlatform = tripartitePlatformService.getDetail(store.getId(), 1);
HighMerchantTripartitePlatform merTripartitePlatform = tripartitePlatformService.getDetail(store.getMerchantId(), 1);
if (merTripartitePlatform != null) {
weChatPayReqInfo.setSub_mch_id(merTripartitePlatform.getPlatformMerNumber());
if (merTripartitePlatform.getProfitSharingRatio().compareTo(new BigDecimal("0")) == 1) {
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true)?"Y":"N";
}
// 是否分账
profitSharing = merTripartitePlatform.getProfitSharingStatus().equals(true)?"Y":"N";
}
}
if (store.getPrestoreType().equals(1)) {

@ -9,18 +9,18 @@ import com.hai.common.exception.SysCode;
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.config.HuiLianTongConfig;
import com.hai.config.TuanYouConfig;
import com.hai.config.UnionStagingPayConfig;
import com.hai.config.*;
import com.hai.dao.HighCouponCodeOtherMapper;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.dao.HighPayRecordMapper;
import com.hai.dao.HighUserCouponMapper;
import com.hai.entity.*;
import com.hai.enum_type.MerStoreAmountSourceTypeEnum;
import com.hai.enum_type.MerStoreAmountTypeEnum;
import com.hai.enum_type.OrderPushType;
import com.hai.model.HighMerchantStoreModel;
import com.hai.model.ResponseData;
import com.hai.msg.entity.MsgTopic;
import com.hai.service.*;
import com.hai.service.pay.NotifyService;
import io.swagger.annotations.Api;
@ -29,6 +29,7 @@ import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -47,6 +48,9 @@ public class UnionPayController {
private static Logger log = LoggerFactory.getLogger(UnionPayController.class);
@Resource
private RedisTemplate redisTemplate;
@Resource
private HighOrderService highOrderService;
@ -280,39 +284,61 @@ public class UnionPayController {
if (highChildOrder.getGoodsType() == 3) {
highChildOrder.setChildOrdeStatus(3);
order.setOrderStatus(3);
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId());
// 推送团油订单
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("gasId", store.getStoreKey());
paramMap.put("oilNo", highChildOrder.getGasOilNo());
paramMap.put("gunNo", highChildOrder.getGasGunNo());
BigDecimal priceGun = highChildOrder.getGasPriceGun();
BigDecimal priceVip = highChildOrder.getGasPriceVip();
paramMap.put("priceGun", priceGun); // 枪单价
paramMap.put("priceVip", priceVip); // 优惠价
paramMap.put("driverPhone", order.getMemPhone());
paramMap.put("thirdSerialNo", order.getOrderNo());
paramMap.put("refuelingAmount", highChildOrder.getTotalPrice());
// 油品类型 1:汽油:2:柴油;3:天然气
if (highChildOrder.getGasOilType() == 1) {
paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount());
} else if (highChildOrder.getGasOilType() == 2) {
paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount());
}
JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap);
// 推送团油订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type1.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(orderPushObject.getString("code"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap));
highGasOrderPush.setReturnContent(orderPushObject.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (orderPushObject != null && orderPushObject.getString("code").equals("200")) {
highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo"));
// 来源类型 1:平台自建 2:团油
if (store.getSourceType().equals(1)) {
// 预存类型 0:非预存 1:预存门店
if (store.getPrestoreType() != null && store.getPrestoreType().equals(1)) {
Map<String, Object> pushParam = new HashMap<>();
pushParam.put("businessType", MerStoreAmountTypeEnum.type2.getType());
pushParam.put("storeId", highChildOrder.getGoodsId());
pushParam.put("price", order.getTotalPrice());
pushParam.put("sourceType", MerStoreAmountSourceTypeEnum.type2.getType());
pushParam.put("sourceId", order.getId());
pushParam.put("sourceContent", "订单号:" + order.getOrderNo() + ",加油金额:¥" + order.getTotalPrice());
pushParam.put("opUserId", order.getMemId());
pushParam.put("opUserName", order.getMemName());
// 扣预存款
this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam);
}
} else if (store.getSourceType().equals(2)) {
// 推送团油订单
Map<String,Object> paramMap = new HashMap<>();
paramMap.put("gasId", store.getStoreKey());
paramMap.put("oilNo", highChildOrder.getGasOilNo());
paramMap.put("gunNo", highChildOrder.getGasGunNo());
BigDecimal priceGun = highChildOrder.getGasPriceGun();
BigDecimal priceVip = highChildOrder.getGasPriceVip();
paramMap.put("priceGun", priceGun); // 枪单价
paramMap.put("priceVip", priceVip); // 优惠价
paramMap.put("driverPhone", order.getMemPhone());
paramMap.put("thirdSerialNo", order.getOrderNo());
paramMap.put("refuelingAmount", highChildOrder.getTotalPrice());
// 油品类型 1:汽油:2:柴油;3:天然气
if (highChildOrder.getGasOilType() == 1) {
paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount());
} else if (highChildOrder.getGasOilType() == 2) {
paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount());
}
JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap);
// 推送团油订单记录
HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
highGasOrderPush.setType(OrderPushType.type1.getType());
highGasOrderPush.setOrderNo(order.getOrderNo());
highGasOrderPush.setCreateTime(new Date());
highGasOrderPush.setCode(orderPushObject.getString("code"));
highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap));
highGasOrderPush.setReturnContent(orderPushObject.toJSONString());
highGasOrderPushMapper.insert(highGasOrderPush);
if (orderPushObject != null && orderPushObject.getString("code").equals("200")) {
highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo"));
}
}
}
@ -344,11 +370,18 @@ public class UnionPayController {
}
highOrderService.updateOrder(order);
}
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
new Thread(() -> {
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order);
}).start();
}
}
}
}
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
JSONObject result = new JSONObject();
result.put("resultcode", "00");

@ -144,7 +144,8 @@ public class WechatPayController {
@RequestMapping(value = "/addLedgerReceiver", method = RequestMethod.POST)
@ApiOperation(value = "微信支付 -> 添加分账接收方")
public void addLedgerReceiver(HttpServletRequest request, HttpServletResponse response) {
public void addLedgerReceiver(@RequestParam(name = "sub_mch_id", required = true) String sub_mch_id,
HttpServletRequest request, HttpServletResponse response) {
try {
WxSharingReceiversVO receiversVO = new WxSharingReceiversVO();
@ -156,7 +157,7 @@ public class WechatPayController {
Map<String , String> map = new HashMap<>();
map.put("mch_id" , "1289663601");
map.put("sub_mch_id" , "1624126902");
map.put("sub_mch_id" , sub_mch_id);
map.put("appid" , "wxa075e8509802f826");
map.put("nonce_str" , WxUtils.makeNonStr());
map.put("sign_type" , "HMAC-SHA256");

@ -39,6 +39,21 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#配置日期返回至前台为时间戳
jackson:
serialization:

@ -39,6 +39,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#配置日期返回至前台为时间戳
jackson:
serialization:

@ -40,6 +40,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
#用户名
username: printer_provider
#密码
password: abcd123!
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/

@ -40,6 +40,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
#用户名
username: printer_provider
#密码
password: abcd123!
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/

@ -7,6 +7,8 @@ import com.hai.common.QRCodeGenerator;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.IDGenerator;
import com.hai.config.MqttProviderConfig;
import com.hai.config.ZkcPrinterTemplate;
import com.hai.entity.*;
import com.hai.service.*;
import org.junit.Test;
@ -35,27 +37,14 @@ import java.util.*;
public class test {
@Resource
private HighUserService highUserService;
private HighOrderService highOrderService;
@Resource
private HighDiscountUserRelService highDiscountUserRelService;
@Resource
private HighDiscountAgentCodeService highDiscountAgentCodeService;
private MqttProviderConfig mqttProviderConfig;
@Test
public void test(){
/* List<HighDiscountAgentCode> codeList = highDiscountAgentCodeService.getDiscountCodeByDiscountAgentId(55L);
List<HighUser> userList = highUserService.getUserList();
public void test() throws Exception{
int num = 0;
for (HighUser user : userList) {
// 领取优惠券
highDiscountUserRelService.receiveDiscount(user.getId(), codeList.get(num).getId());
num++;
}*/
}

@ -151,11 +151,11 @@ public class HighGasSchedule {
}
}
@Scheduled(cron = "0 30 7 * * ?") //每日7点1分执行一次
/* @Scheduled(cron = "0 30 7 * * ?") //每日7点1分执行一次
public void refreshPriceOfficial() throws Exception {
gasOilPriceOfficialService.refreshPriceOfficial();
gasOilPriceOfficialService.refreshGasPriceOfficial(null, null);
}
}*/
}

@ -92,19 +92,19 @@ public class HighOrderSchedule {
* @Param []
* @return void
*/
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
@Scheduled(cron="0 0/5 * * * ?") //每10分钟执行一次
public void initRechargeOrder() {
Map<String, Object> map = new HashMap<>();
map.put("status" , String.valueOf(102));
map.put("payStatus" , String.valueOf(102));
map.put("rechargeStatus" , String.valueOf(204));
List<OutRechargeOrder> orderList = outRechargeOrderService.getListRechargeOrder(map);
if (orderList != null && orderList.size() > 0) {
System.out.println("订单数量------------------------------------------------------------------------------" + orderList.size());
if (orderList.size() > 0) {
for (OutRechargeOrder order : orderList) {
try {
// 查询充值子订单
Map<String, Object> childOrderMap = new HashMap<>();
childOrderMap.put("parent_order_id" , order.getId());
childOrderMap.put("status" , 102);

@ -40,6 +40,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#thymelea模板配置
thymeleaf:

@ -41,6 +41,21 @@ spring:
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://139.159.177.244:8083/mqtt
#用户名
username: printer_provider
#密码
password: 123654
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/

@ -40,7 +40,20 @@ spring:
max-wait: -1
max-idle: 10
min-idle: 0
#MQTT配置信息
mqtt:
#MQTT服务地址
url: ws://122.9.135.148:8083/mqtt
#用户名
username: printer_provider
#密码
password: abcd123!
#客户端id(不能重复)
# client:
# id: provider-id
#MQTT默认的消息推送主题,实际可在调用接口是指定
# default:
# topic: topic
#thymelea模板配置
thymeleaf:
prefix: classpath:/templates/

@ -264,6 +264,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-mqtt</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>

@ -129,6 +129,12 @@ public enum ErrorCode {
REQUEST_TIMED_OUT("3006","请求超时,请稍后重试"),
SIGN_VERIFY("6001","签名校验失败"),
ACCOUNT_NOT_EXIST("6002","账号不存在"),
PHONE_ERROR("6003","手机号码格式有误"),
INSUFFICIENT_BALANCE("6006","账户余额不足,请及时充值"),
ORDER_ALREADY_EXISTS("6007","订单已存在"),
IP_ERROR("6008","IP不在白名单"),
PRODUCT_ERROR("6009","商品错误"),
MSG_EVENT_NULL("2999","消息类型为空"),
USE_VISIT_ILLEGAL("4001","用户身份错误"),

@ -35,6 +35,7 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.cert.CertificateException;
@ -663,6 +664,49 @@ public class HttpsUtils {
return null;
}
/**
* 发送 POST 请求JSON形式
*
* @param apiUrl
* @return
*/
public static String doApiPost(String apiUrl, String str) {
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(str, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
return EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
} 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 doPost(String apiUrl, String str, String token, String sign, Long ts) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
@ -709,7 +753,7 @@ public class HttpsUtils {
* @Param [url, str]
* @return com.alibaba.fastjson.JSONObject
**/
public static JSONObject postData(String url, String str) {
public static String postData(String url, String str) {
CloseableHttpClient httpClient = null;
if (url.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
@ -731,7 +775,7 @@ public class HttpsUtils {
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
return JSON.parseObject(httpStr);
return httpStr;
} catch (Exception e) {
log.error(e.getMessage(),e);
} finally {

@ -18,6 +18,12 @@ public class CommonSysConfig {
private String tuanYouDieselAccount; // 柴油账号
private String tuanYouGasolineAccount; // 汽油账号
// 壳牌公共参数
private String shellGroupUrl;
private String shellGroupPartnerId;
private String shellPlatMerchantId;
private String shellPlatMerchantKey;
private String qinzhuUrl;
private String qinzhuHtmlUrl;
private String qinzhuMobileUrl; // 话费充值地址
@ -61,7 +67,7 @@ public class CommonSysConfig {
private String czOrderNotify;
private String lyApiKey;
private String lyNotifyUrl;
private String LyNotifyUrl;
private String lyMemberId;
private String LyPostUrl;
@ -74,6 +80,38 @@ public class CommonSysConfig {
private String unionSecret;
private String unionRsaKey;
public String getShellGroupPartnerId() {
return shellGroupPartnerId;
}
public void setShellGroupPartnerId(String shellGroupPartnerId) {
this.shellGroupPartnerId = shellGroupPartnerId;
}
public String getShellGroupUrl() {
return shellGroupUrl;
}
public void setShellGroupUrl(String shellGroupUrl) {
this.shellGroupUrl = shellGroupUrl;
}
public String getShellPlatMerchantId() {
return shellPlatMerchantId;
}
public void setShellPlatMerchantId(String shellPlatMerchantId) {
this.shellPlatMerchantId = shellPlatMerchantId;
}
public String getShellPlatMerchantKey() {
return shellPlatMerchantKey;
}
public void setShellPlatMerchantKey(String shellPlatMerchantKey) {
this.shellPlatMerchantKey = shellPlatMerchantKey;
}
public String getUnionAppId() {
return unionAppId;
}
@ -467,10 +505,10 @@ public class CommonSysConfig {
}
public String getLyNotifyUrl() {
return lyNotifyUrl;
return LyNotifyUrl;
}
public void setLyNotifyUrl(String lyNotifyUrl) {
this.lyNotifyUrl = lyNotifyUrl;
LyNotifyUrl = lyNotifyUrl;
}
}

@ -1,6 +1,7 @@
package com.hai.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
@ -9,7 +10,10 @@ import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.MD5Util;
import com.hai.common.utils.RedisUtil;
import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.HighCouponCodeOther;
import com.hai.entity.HighGasOrderPush;
import com.hai.entity.HighUserCoupon;
import com.hai.enum_type.OrderPushType;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
@ -130,7 +134,36 @@ public class HuiLianTongConfig {
map.put("sign", md5Capital(joiner.toString()));
String paramStr = "token="+MapUtils.getString(map, "token")+"&sign=" + MapUtils.getString(map, "sign")+"&jsonData=" + URLEncoder.encode(MapUtils.getString(map, "jsonData"),"UTF-8");
return HttpsUtils.doHuiLianTongPost(CommonSysConst.getSysConfig().getHuiliantongUrl() + "/coupon/api/coupon_corp/couJointDist?" + paramStr);
JSONObject object1 = HttpsUtils.doHuiLianTongPost(CommonSysConst.getSysConfig().getHuiliantongUrl() + "/coupon/api/coupon_corp/couJointDist?" + paramStr);
new Thread(() -> {
try {
if (object1 != null && object1.getString("result").equals("success")) {
JSONArray dataArray = object1.getJSONArray("data");
for (Object data : dataArray) {
JSONObject dataObject = (JSONObject) data;
Map<String, Object> mapPost = new HashMap<>();
mapPost.put("orderNo" , orderNo);
mapPost.put("distCouCount" , "1");
mapPost.put("phone" , userPhone);
mapPost.put("distributorId" , "1JnL8YMV");
mapPost.put("couNo" , dataObject.getString("couNo"));
mapPost.put("status" , "20");
mapPost.put("couTypeCode" , dataObject.getString("couTypeCode"));
mapPost.put("validStartDate" , dataObject.getDate("validStartDate"));
mapPost.put("validEndDate" , dataObject.getDate("validEndDate"));
JSONObject o = HuiLianTongUnionCardConfig.syncPayOrder(mapPost);
System.out.println("订单同步请求参数---------" + mapPost);
System.out.println("订单同步请求结果---------" + o);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}).start();
return object1;
}

@ -0,0 +1,41 @@
package com.hai.config;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MqttProviderCallBack implements MqttCallback {
/**
* 与服务器断开
* @param throwable
*/
@Override
public void connectionLost(Throwable throwable) {
}
/**
* 消息到达回调
* @param s
* @param mqttMessage
* @throws Exception
*/
@Override
public void messageArrived(String s, MqttMessage mqttMessage) throws Exception {
System.out.println("消息到达");
}
/**
* 消息发布成功回调
* @param iMqttDeliveryToken
*/
@Override
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
System.out.println("消息发布");
}
}

@ -0,0 +1,234 @@
package com.hai.config;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.*;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
@Slf4j
public class MqttProviderConfig {
@Value("${spring.mqtt.username}")
private String username;
@Value("${spring.mqtt.password}")
private String password;
@Value("${spring.mqtt.url}")
private String hostUrl;
/* @Value("${spring.mqtt.client.id}")
private String clientId;
@Value("${spring.mqtt.default.topic}")
private String defaultTopic;*/
/**
* 客户端对象
*/
private MqttClient client;
/**
* 在bean初始化后连接到服务器
*/
// @PostConstruct
public void init() {
connect("provider-" + System.currentTimeMillis());
}
/*
@PostConstruct
public void init(String clientId) {
connect(clientId);
}*/
/**
* 客户端连接服务端
*/
public void connect(String clientId){
try{
//创建MQTT客户端对象
client = new MqttClient(hostUrl,clientId,new MemoryPersistence());
//连接设置
MqttConnectOptions options = new MqttConnectOptions();
//是否清空session,设置false表示服务器会保留客户端的连接记录(订阅主题,qos),客户端重连之后能获取到服务器在客户端断开连接期间推送的消息
//设置为true表示每次连接服务器都是以新的身份
options.setCleanSession(true);
//设置连接用户名
options.setUserName(username);
//设置连接密码
options.setPassword(password.toCharArray());
//设置超时时间,单位为秒
options.setConnectionTimeout(100);
//设置心跳时间 单位为秒,表示服务器每隔 1.5*20秒的时间向客户端发送心跳判断客户端是否在线
options.setKeepAliveInterval(20);
// 设置遗嘱消息的话题,若客户端和服务器之间的连接意外断开,服务器将发布客户端的遗嘱信息
// options.setWill("willTopic",(clientId + "与服务器断开连接").getBytes(),0,false);
//设置回调
client.setCallback(new MqttProviderCallBack());
client.connect(options);
} catch(MqttException e){
e.printStackTrace();
}
}
public void publish(int qos,boolean retained,String topic,String message) {
if (client == null) {
init();
}
if (!client.isConnected()) {
init();
}
try {
MqttMessage mqttMessage = new MqttMessage();
mqttMessage.setQos(qos);
mqttMessage.setRetained(retained);
mqttMessage.setPayload(message.getBytes());
client.subscribe(topic, qos);
// 主题的目的地,用于发布/订阅信息
MqttTopic mqttTopic = client.getTopic(topic);
//提供一种机制来跟踪消息的传递进度
//用于在以非阻塞方式(在后台运行)执行发布是跟踪消息的传递进度
MqttDeliveryToken token;
//将指定消息发布到主题,但不等待消息传递完成,返回的token可用于跟踪消息的传递状态
//一旦此方法干净地返回,消息就已被客户端接受发布,当连接可用,将在后台完成消息传递
token = mqttTopic.publish(mqttMessage);
token.waitForCompletion();
} catch (MqttException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
public void publish(int qos,boolean retained,String topic,byte[] message) {
if (client == null) {
init();
}
if (!client.isConnected()) {
init();
}
try {
MqttMessage mqttMessage = new MqttMessage();
mqttMessage.setQos(qos);
mqttMessage.setRetained(retained);
mqttMessage.setPayload(message);
// 主题的目的地,用于发布/订阅信息
MqttTopic mqttTopic = client.getTopic(topic);
//提供一种机制来跟踪消息的传递进度
//用于在以非阻塞方式(在后台运行)执行发布是跟踪消息的传递进度
MqttDeliveryToken token;
//将指定消息发布到主题,但不等待消息传递完成,返回的token可用于跟踪消息的传递状态
//一旦此方法干净地返回,消息就已被客户端接受发布,当连接可用,将在后台完成消息传递
token = mqttTopic.publish(mqttMessage);
token.waitForCompletion();
} catch (MqttException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
public static byte[] sendPrinterRrCodeBytest(String printText, int pageCount) {
try {
byte[] by = printText.getBytes();
byte[] msgByte = new byte[by.length + 16];
// 写入缓存
msgByte[0] = 29;
msgByte[1] = 40;
msgByte[2] = 107;
msgByte[3] = (byte)(by.length+3);
msgByte[4] = 0;
msgByte[5] = 49;
msgByte[6] = 80;
msgByte[7] = 48; // (byte)0x30);
int index = 7;
for (int i = 0; i < by.length; i++)
{
index = index+1;
msgByte[index] = by[i];
}
// 打印缓存中的数据
msgByte[index + 1] = 29;
msgByte[index + 2] = 40;
msgByte[index + 3] = 107;
msgByte[index + 4] = (byte)(by.length+3);
msgByte[index + 5] = 0;
msgByte[index + 6] = 49;
msgByte[index + 7] = 81;
msgByte[index + 8] = 48; // (byte)0x30);
byte[] array = new byte[msgByte.length + 9];
array[0] = 30;
array[1] = 16;
array[2] =(byte) pageCount;//打印份数
int num = array.length - 5;
array[3] = (byte)(num >> 8);
//array[4] = (byte)((uint)num & 0xFFu);
array[4] = (byte)(num & 0xFF);
for (int i = 0; i < msgByte.length; i++)
{
array[i+ 5] = msgByte[i];
}
array[array.length - 4] = 27;
array[array.length - 3] = 99;
byte[] crc16CodeArray = getCRC(msgByte);
array[array.length - 2] = crc16CodeArray[0];
array[array.length - 1] = crc16CodeArray[1];
return array;
} catch (Exception ex) {
System.out.println(ex.getStackTrace());
}
return null;
}
private static byte[] getCRC(byte[] bytes) {
int crc = 0xFFFF; // 初始值
for (byte b : bytes) {
crc = (crc >> 8) ^ CRC16Table[(crc ^ b) & 0xff];
}
byte[] b = new byte[2];
b[0] = (byte) ((crc >> 8)^0xff);
b[1] = (byte) ((crc & 0xff)^0xff);
return b;
}
private static int[] CRC16Table = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624,
0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c,
0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5,
0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed,
0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726,
0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e,
0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7,
0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef,
0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420,
0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868,
0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1,
0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9,
0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522,
0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a,
0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3,
0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb,
0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c,
0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64,
0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad,
0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5,
0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e,
0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66,
0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af,
0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7,
0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028,
0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60,
0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9,
0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1,
0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a,
0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62,
0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab,
0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3,
0x2c6a, 0x1ef1, 0x0f78 };
}

@ -63,7 +63,7 @@ public class RechargeConfig {
paramMap.put("out_trade_num" , object.getString("out_trade_num"));
paramMap.put("product_id" , object.getString("product_id"));
paramMap.put("mobile" , object.getString("mobile"));
paramMap.put("notify_url" , CommonSysConst.getSysConfig().getJjNotifyUrl());
paramMap.put("notify_url" , object.getString("notifyUrl"));
paramMap.put("userid" , CommonSysConst.getSysConfig().getLyMemberId());
paramMap.put("sign", WxUtils.generateSignatureLy(paramMap , CommonSysConst.getSysConfig().getLyApiKey() , WXPayConstants.SignType.MD5));
return HttpsUtils.doPost(CommonSysConst.getSysConfig().getLyPostUrl()+ "index/recharge", paramMap);
@ -108,8 +108,7 @@ public class RechargeConfig {
map.put("app_key" , CommonSysConst.getSysConfig().getJjAppKey());
map.put("timestamp" , timestamp.substring(0,timestamp.length()-3));
map.put("is_fast" , object.getString("is_fast"));
map.put("notify_url" , CommonSysConst.getSysConfig().getJjNotifyUrl());
map.put("notify_url" , object.getString("notifyUrl"));
String signStr = WxUtils.generateSignatureAppSecret(map, CommonSysConst.getSysConfig().getJjAppSecret() , WXPayConstants.SignType.MD5);
map.put("sign" , signStr);

@ -0,0 +1,78 @@
package com.hai.config;
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.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.MD5Util;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* 壳牌接口服务
*/
public class ShellGroupService {
/**
* 查询全量加油站
* @param pageNum 当前页码
* @param pageSize 每页数据量最大值50
* @return
*/
public static JSONObject gasPageQueryAllStation(Integer pageNum,Integer pageSize) {
try {
Map<String, Object> param = new HashMap<>();
param.put("merchantOrderNo", System.currentTimeMillis());
param.put("partnerId", CommonSysConst.getSysConfig().getShellGroupPartnerId());
param.put("service", "gasPageQueryAllStation");
param.put("version", "1.0.0");
param.put("signType", "MD5");
param.put("platMerchantId", CommonSysConst.getSysConfig().getShellPlatMerchantId());
param.put("pageNo", pageNum);
param.put("pageSize", pageSize);
param.put("sign", MD5Util.encode(generateSignature(param, CommonSysConst.getSysConfig().getShellPlatMerchantKey()).getBytes()));
// 请求接口
JSONObject object = HttpsUtils.doPost(CommonSysConst.getSysConfig().getShellGroupUrl(), param);
if (object == null || !object.getString("status").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object == null?"请求失败":object.getString("message"));
}
return object;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 生成签名
* @param data 数据
* @param key 秘钥app_secret
* @return 加密结果
*/
public static String generateSignature(final Map<String, Object> data, String key){
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
sb.append(key);
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) {
continue;
}
if (data.get(k) != null) // 参数值为空,则不参与签名
sb.append(k).append(data.get(k));
}
sb.append(key);
return sb.toString();
}
}

@ -162,9 +162,9 @@ public class SpPrinterConfig {
throw new ClientProtocolException();
}
if (response.getStatusLine().getStatusCode() != 200) {
/* if (response.getStatusLine().getStatusCode() != 200) {
throw new ClientProtocolException(EntityUtils.toString(httpEntity));
}
}*/
return EntityUtils.toString(httpEntity);
}

@ -62,6 +62,12 @@ public class WxOrderConfig {
*/
public static final String MCH_ID_1619676214 = "1619676214";
/**
* 微信支付商户号
* 渝北区浩联物资经营部
*/
public static final String MCH_ID_1624126902 = "1624126902";
public static OrderRefundModel orderToRefund(String paySerialNo,BigDecimal totalFee,BigDecimal refundFee) throws Exception {
Map<String,String> param = new HashMap<>();

@ -0,0 +1,365 @@
package com.hai.config;
import com.hai.common.utils.DateUtil;
import java.io.ByteArrayOutputStream;
import java.util.Date;
/**
* ZKC云打印机模板
* @author hurui
*/
public class ZkcPrinterTemplate {
/**
* 加油站收银员存根模板
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @return
*/
public static byte[] oilCashierStubTemp(String gasName,
String orderNo,
String payTime,
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("来源:嗨森逛".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);
return getPrinterBytes(stream.toByteArray(), 1, "UTF-8");
}
/**
* 加油站客户存根模板
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @return
*/
public static byte[] oilClientStubTemp(String gasName,
String orderNo,
String payTime,
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("来源:嗨森逛".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);
return getPrinterBytes(stream.toByteArray(), 1, "UTF-8");
}
public static String hexStringToString(String s) {
if (s == null || s.equals("")) {
return null;
}
s = s.replace(" ", "");
byte[] baKeyword = new byte[s.length() / 2];
for (int i = 0; i < baKeyword.length; i++) {
try {
baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16));
} catch (Exception e) {
e.printStackTrace();
}
}
try {
s = new String(baKeyword, "UTF-8");
new String();
} catch (Exception e1) {
e1.printStackTrace();
}
return s;
}
/**
* 获取打印内容适用于云打印机
* @param printText 打印文本
* @param pageCount 打印联数
* @param encodingStr 编码方式默认UTF-8
* @return
*/
public static byte[] getPrinterBytes(final byte[] printText,
final int pageCount, String encodingStr) {
try {
if(encodingStr.equals("")){
encodingStr="UTF-8";
}
byte[] msgByte = printText;
// 消息数组
final byte[] dataByte = new byte[msgByte.length + 9];
dataByte[0] = 0x1E;
dataByte[1] = 0x10;
dataByte[2] = (byte) pageCount;// 打印多联
// 有效数据长度
final int len = dataByte.length - 5;
dataByte[3] = (byte) (len >> 8);
dataByte[4] = (byte) (len & 0xff);
// 数据内容
System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length);
// 标识字节
dataByte[dataByte.length - 4] = 0x1b;
dataByte[dataByte.length - 3] = 0x63;
// 打印内容CRC校验
final byte[] dtCRC = getCRC(msgByte);
dataByte[dataByte.length - 2] = (byte) (dtCRC[0]);
dataByte[dataByte.length - 1] = (byte) (dtCRC[1]);
msgByte = dataByte;
return msgByte;
} catch (Exception ex) {
System.out.println(ex.getStackTrace());
}
return null;
}
/**
* 获取打印内容适用于云打印机
* @param printText 打印文本
* @param pageCount 打印联数
* @param encodingStr 编码方式默认UTF-8
* @return
*/
public byte[] getPrinterBytes(final String printText,
final int pageCount, String encodingStr) {
try {
if(encodingStr.equals("")){
encodingStr="UTF-8";
}
byte[] msgByte = printText.getBytes(encodingStr);
// 消息数组
final byte[] dataByte = new byte[msgByte.length + 9];
dataByte[0] = 0x1E;
dataByte[1] = 0x10;
dataByte[2] = (byte) pageCount;// 打印多联
// 有效数据长度
final int len = dataByte.length - 5;
dataByte[3] = (byte) (len >> 8);
dataByte[4] = (byte) (len & 0xff);
// 数据内容
System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length);
// 标识字节
dataByte[dataByte.length - 4] = 0x1b;
dataByte[dataByte.length - 3] = 0x63;
// 打印内容CRC校验
final byte[] dtCRC = getCRC(msgByte);
dataByte[dataByte.length - 2] = (byte) (dtCRC[0]);
dataByte[dataByte.length - 1] = (byte) (dtCRC[1]);
msgByte = dataByte;
return msgByte;
} catch (Exception ex) {
System.out.println(ex.getStackTrace());
}
return null;
}
private static int[] CRC16Table = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624,
0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c,
0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5,
0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed,
0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726,
0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e,
0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7,
0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef,
0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420,
0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868,
0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1,
0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9,
0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522,
0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a,
0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3,
0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb,
0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c,
0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64,
0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad,
0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5,
0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e,
0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66,
0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af,
0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7,
0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028,
0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60,
0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9,
0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1,
0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a,
0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62,
0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab,
0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3,
0x2c6a, 0x1ef1, 0x0f78 };
private static byte[] getCRC(byte[] bytes) {
int crc = 0xFFFF; // 初始值
for (byte b : bytes) {
crc = (crc >> 8) ^ CRC16Table[(crc ^ b) & 0xff];
}
byte[] b = new byte[2];
b[0] = (byte) ((crc >> 8)^0xff);
b[1] = (byte) ((crc & 0xff)^0xff);
return b;
}
private static final char[] HEXES = { '0', '1', '2', '3', '4', '5', '6',
'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
/**
* byte数组 转换成 16进制小写字符串
*/
private static String bytes2Hex(byte[] bytes) {
if (bytes == null || bytes.length == 0) {
return null;
}
StringBuilder hex = new StringBuilder();
for (byte b : bytes) {
hex.append(HEXES[(b >> 4) & 0x0F]);
hex.append(HEXES[b & 0x0F]);
}
return hex.toString();
}
}

@ -4,4 +4,5 @@ package com.hai.dao;
* mapper扩展类
*/
public interface ApiAmountRecordMapperExt {
}
}

@ -1,7 +1,36 @@
package com.hai.dao;
import com.hai.entity.ApiOrderRecord;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import java.util.List;
/**
* mapper扩展类
*/
public interface ApiOrderRecordMapperExt {
}
@Select({"SELECT * FROM api_order_record aor WHERE TIMESTAMPDIFF(MINUTE,aor.request_time,SYSDATE()) < 15 AND aor.status = 100"})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mch_id", property="mchId", jdbcType=JdbcType.VARCHAR),
@Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="source_order_no", property="sourceOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_id", property="goodsId", jdbcType=JdbcType.VARCHAR),
@Result(column="notify_url", property="notifyUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="request_time", property="requestTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<ApiOrderRecord> callBackOrderList();
}

@ -46,31 +46,19 @@ public interface ApiProductConfigMapperExt {
@Select(value = {
"<script>",
" select ap.* , discount_price , apc.id as api_config_product_id , discount , apc.status as config_status from api_product ap join api_product_config apc on ap.id = apc.product_id where apc.status = 101",
" and merchants_id = #{merchantsId} and ap.recharge_type = = #{rechargeType}" +
" select recharge_type , phone_recharge_type ,operator_type , recharge_price , discount_price , apc.id as api_config_product_id , discount from api_product ap join api_product_config apc on ap.id = apc.product_id where apc.status = 101",
" and merchants_id = #{merchantsId} and ap.recharge_type = #{rechargeType}" +
"</script>"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_platform", property="rechargePlatform", jdbcType=JdbcType.VARCHAR),
@Result(column="phone_recharge_type", property="phoneRechargeType", jdbcType=JdbcType.INTEGER),
@Result(column="operator_type", property="operatorType", jdbcType=JdbcType.INTEGER),
@Result(column="recharge_price", property="rechargePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT),
@Result(column="api_config_product_id", property="apiConfigProductId", jdbcType=JdbcType.BIGINT),
@Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER),
@Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT),
@Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="config_status", property="configStatus", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<ApiProductConfigModel> getMerchProduct(Long merchantsId , Integer rechargeType);

@ -39,14 +39,16 @@ public interface HighAgentMapper extends HighAgentMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_agent (`type`, agent_key, ",
"insert into high_agent (`type`, parent_id, ",
"parent_name, agent_key, ",
"agent_name, agent_address, ",
"agent_user, agent_phone, ",
"create_time, `status`, ",
"user_name, operator_id, ",
"operator_name, ext_1, ",
"ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{agentKey,jdbcType=VARCHAR}, ",
"values (#{type,jdbcType=INTEGER}, #{parentId,jdbcType=BIGINT}, ",
"#{parentName,jdbcType=VARCHAR}, #{agentKey,jdbcType=VARCHAR}, ",
"#{agentName,jdbcType=VARCHAR}, #{agentAddress,jdbcType=VARCHAR}, ",
"#{agentUser,jdbcType=VARCHAR}, #{agentPhone,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
@ -65,6 +67,8 @@ public interface HighAgentMapper extends HighAgentMapperExt {
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT),
@Result(column="parent_name", property="parentName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_address", property="agentAddress", jdbcType=JdbcType.VARCHAR),
@ -83,14 +87,17 @@ public interface HighAgentMapper extends HighAgentMapperExt {
@Select({
"select",
"id, `type`, agent_key, agent_name, agent_address, agent_user, agent_phone, create_time, ",
"`status`, user_name, operator_id, operator_name, ext_1, ext_2, ext_3",
"id, `type`, parent_id, parent_name, agent_key, agent_name, agent_address, agent_user, ",
"agent_phone, create_time, `status`, user_name, operator_id, operator_name, ext_1, ",
"ext_2, ext_3",
"from high_agent",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT),
@Result(column="parent_name", property="parentName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
@Result(column="agent_address", property="agentAddress", jdbcType=JdbcType.VARCHAR),
@ -119,6 +126,8 @@ public interface HighAgentMapper extends HighAgentMapperExt {
@Update({
"update high_agent",
"set `type` = #{type,jdbcType=INTEGER},",
"parent_id = #{parentId,jdbcType=BIGINT},",
"parent_name = #{parentName,jdbcType=VARCHAR},",
"agent_key = #{agentKey,jdbcType=VARCHAR},",
"agent_name = #{agentName,jdbcType=VARCHAR},",
"agent_address = #{agentAddress,jdbcType=VARCHAR},",

@ -32,6 +32,14 @@ public class HighAgentSqlProvider {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getParentId() != null) {
sql.VALUES("parent_id", "#{parentId,jdbcType=BIGINT}");
}
if (record.getParentName() != null) {
sql.VALUES("parent_name", "#{parentName,jdbcType=VARCHAR}");
}
if (record.getAgentKey() != null) {
sql.VALUES("agent_key", "#{agentKey,jdbcType=VARCHAR}");
}
@ -95,6 +103,8 @@ public class HighAgentSqlProvider {
sql.SELECT("id");
}
sql.SELECT("`type`");
sql.SELECT("parent_id");
sql.SELECT("parent_name");
sql.SELECT("agent_key");
sql.SELECT("agent_name");
sql.SELECT("agent_address");
@ -133,6 +143,14 @@ public class HighAgentSqlProvider {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getParentId() != null) {
sql.SET("parent_id = #{record.parentId,jdbcType=BIGINT}");
}
if (record.getParentName() != null) {
sql.SET("parent_name = #{record.parentName,jdbcType=VARCHAR}");
}
if (record.getAgentKey() != null) {
sql.SET("agent_key = #{record.agentKey,jdbcType=VARCHAR}");
}
@ -195,6 +213,8 @@ public class HighAgentSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("parent_id = #{record.parentId,jdbcType=BIGINT}");
sql.SET("parent_name = #{record.parentName,jdbcType=VARCHAR}");
sql.SET("agent_key = #{record.agentKey,jdbcType=VARCHAR}");
sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}");
sql.SET("agent_address = #{record.agentAddress,jdbcType=VARCHAR}");
@ -222,6 +242,14 @@ public class HighAgentSqlProvider {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getParentId() != null) {
sql.SET("parent_id = #{parentId,jdbcType=BIGINT}");
}
if (record.getParentName() != null) {
sql.SET("parent_name = #{parentName,jdbcType=VARCHAR}");
}
if (record.getAgentKey() != null) {
sql.SET("agent_key = #{agentKey,jdbcType=VARCHAR}");
}

@ -44,19 +44,23 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
"coupon_agent_record_id, convert_user_phone, ",
"convert_code, coupon_code_id, ",
"coupon_code, qr_code, ",
"`status`, remark, ",
"create_time, sales_time, ",
"operator_id, operator_name, ",
"ext_1, ext_2, ext_3)",
"`status`, assign_coupon_agent_id, ",
"assign_agent_id, assign_agent_name, ",
"remark, create_time, ",
"sales_time, operator_id, ",
"operator_name, ext_1, ",
"ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{couponAgentId,jdbcType=BIGINT}, ",
"#{couponId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
"#{couponAgentRecordId,jdbcType=BIGINT}, #{convertUserPhone,jdbcType=VARCHAR}, ",
"#{convertCode,jdbcType=VARCHAR}, #{couponCodeId,jdbcType=BIGINT}, ",
"#{couponCode,jdbcType=VARCHAR}, #{qrCode,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{salesTime,jdbcType=TIMESTAMP}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{status,jdbcType=INTEGER}, #{assignCouponAgentId,jdbcType=BIGINT}, ",
"#{assignAgentId,jdbcType=BIGINT}, #{assignAgentName,jdbcType=VARCHAR}, ",
"#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{salesTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCouponAgentCode record);
@ -79,6 +83,9 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
@Result(column="coupon_code", property="couponCode", jdbcType=JdbcType.VARCHAR),
@Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="assign_coupon_agent_id", property="assignCouponAgentId", jdbcType=JdbcType.BIGINT),
@Result(column="assign_agent_id", property="assignAgentId", jdbcType=JdbcType.BIGINT),
@Result(column="assign_agent_name", property="assignAgentName", jdbcType=JdbcType.VARCHAR),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="sales_time", property="salesTime", jdbcType=JdbcType.TIMESTAMP),
@ -93,8 +100,9 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
@Select({
"select",
"id, `type`, coupon_agent_id, coupon_id, agent_id, coupon_agent_record_id, convert_user_phone, ",
"convert_code, coupon_code_id, coupon_code, qr_code, `status`, remark, create_time, ",
"sales_time, operator_id, operator_name, ext_1, ext_2, ext_3",
"convert_code, coupon_code_id, coupon_code, qr_code, `status`, assign_coupon_agent_id, ",
"assign_agent_id, assign_agent_name, remark, create_time, sales_time, operator_id, ",
"operator_name, ext_1, ext_2, ext_3",
"from high_coupon_agent_code",
"where id = #{id,jdbcType=BIGINT}"
})
@ -111,6 +119,9 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
@Result(column="coupon_code", property="couponCode", jdbcType=JdbcType.VARCHAR),
@Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="assign_coupon_agent_id", property="assignCouponAgentId", jdbcType=JdbcType.BIGINT),
@Result(column="assign_agent_id", property="assignAgentId", jdbcType=JdbcType.BIGINT),
@Result(column="assign_agent_name", property="assignAgentName", jdbcType=JdbcType.VARCHAR),
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="sales_time", property="salesTime", jdbcType=JdbcType.TIMESTAMP),
@ -144,6 +155,9 @@ public interface HighCouponAgentCodeMapper extends HighCouponAgentCodeMapperExt
"coupon_code = #{couponCode,jdbcType=VARCHAR},",
"qr_code = #{qrCode,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"assign_coupon_agent_id = #{assignCouponAgentId,jdbcType=BIGINT},",
"assign_agent_id = #{assignAgentId,jdbcType=BIGINT},",
"assign_agent_name = #{assignAgentName,jdbcType=VARCHAR},",
"remark = #{remark,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"sales_time = #{salesTime,jdbcType=TIMESTAMP},",

@ -72,6 +72,18 @@ public class HighCouponAgentCodeSqlProvider {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getAssignCouponAgentId() != null) {
sql.VALUES("assign_coupon_agent_id", "#{assignCouponAgentId,jdbcType=BIGINT}");
}
if (record.getAssignAgentId() != null) {
sql.VALUES("assign_agent_id", "#{assignAgentId,jdbcType=BIGINT}");
}
if (record.getAssignAgentName() != null) {
sql.VALUES("assign_agent_name", "#{assignAgentName,jdbcType=VARCHAR}");
}
if (record.getRemark() != null) {
sql.VALUES("remark", "#{remark,jdbcType=VARCHAR}");
}
@ -125,6 +137,9 @@ public class HighCouponAgentCodeSqlProvider {
sql.SELECT("coupon_code");
sql.SELECT("qr_code");
sql.SELECT("`status`");
sql.SELECT("assign_coupon_agent_id");
sql.SELECT("assign_agent_id");
sql.SELECT("assign_agent_name");
sql.SELECT("remark");
sql.SELECT("create_time");
sql.SELECT("sales_time");
@ -198,6 +213,18 @@ public class HighCouponAgentCodeSqlProvider {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getAssignCouponAgentId() != null) {
sql.SET("assign_coupon_agent_id = #{record.assignCouponAgentId,jdbcType=BIGINT}");
}
if (record.getAssignAgentId() != null) {
sql.SET("assign_agent_id = #{record.assignAgentId,jdbcType=BIGINT}");
}
if (record.getAssignAgentName() != null) {
sql.SET("assign_agent_name = #{record.assignAgentName,jdbcType=VARCHAR}");
}
if (record.getRemark() != null) {
sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
}
@ -250,6 +277,9 @@ public class HighCouponAgentCodeSqlProvider {
sql.SET("coupon_code = #{record.couponCode,jdbcType=VARCHAR}");
sql.SET("qr_code = #{record.qrCode,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("assign_coupon_agent_id = #{record.assignCouponAgentId,jdbcType=BIGINT}");
sql.SET("assign_agent_id = #{record.assignAgentId,jdbcType=BIGINT}");
sql.SET("assign_agent_name = #{record.assignAgentName,jdbcType=VARCHAR}");
sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("sales_time = #{record.salesTime,jdbcType=TIMESTAMP}");
@ -312,6 +342,18 @@ public class HighCouponAgentCodeSqlProvider {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getAssignCouponAgentId() != null) {
sql.SET("assign_coupon_agent_id = #{assignCouponAgentId,jdbcType=BIGINT}");
}
if (record.getAssignAgentId() != null) {
sql.SET("assign_agent_id = #{assignAgentId,jdbcType=BIGINT}");
}
if (record.getAssignAgentName() != null) {
sql.SET("assign_agent_name = #{assignAgentName,jdbcType=VARCHAR}");
}
if (record.getRemark() != null) {
sql.SET("remark = #{remark,jdbcType=VARCHAR}");
}

@ -39,20 +39,20 @@ public interface HighCouponAgentRelMapper extends HighCouponAgentRelMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_coupon_agent_rel (`type`, coupon_name, ",
"sales_price, coupon_id, ",
"agent_id, stock_count, ",
"sales_count, create_time, ",
"`status`, operator_id, ",
"operator_name, ext_1, ",
"ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{couponName,jdbcType=VARCHAR}, ",
"#{salesPrice,jdbcType=DECIMAL}, #{couponId,jdbcType=BIGINT}, ",
"#{agentId,jdbcType=BIGINT}, #{stockCount,jdbcType=INTEGER}, ",
"#{salesCount,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"insert into high_coupon_agent_rel (parent_coupon_agent_id, `type`, ",
"coupon_name, sales_price, ",
"coupon_id, agent_id, ",
"stock_count, sales_count, ",
"create_time, `status`, ",
"operator_id, operator_name, ",
"ext_1, ext_2, ext_3)",
"values (#{parentCouponAgentId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, ",
"#{couponName,jdbcType=VARCHAR}, #{salesPrice,jdbcType=DECIMAL}, ",
"#{couponId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
"#{stockCount,jdbcType=INTEGER}, #{salesCount,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCouponAgentRel record);
@ -64,6 +64,7 @@ public interface HighCouponAgentRelMapper extends HighCouponAgentRelMapperExt {
@SelectProvider(type=HighCouponAgentRelSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="parent_coupon_agent_id", property="parentCouponAgentId", jdbcType=JdbcType.BIGINT),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR),
@Result(column="sales_price", property="salesPrice", jdbcType=JdbcType.DECIMAL),
@ -83,13 +84,15 @@ public interface HighCouponAgentRelMapper extends HighCouponAgentRelMapperExt {
@Select({
"select",
"id, `type`, coupon_name, sales_price, coupon_id, agent_id, stock_count, sales_count, ",
"create_time, `status`, operator_id, operator_name, ext_1, ext_2, ext_3",
"id, parent_coupon_agent_id, `type`, coupon_name, sales_price, coupon_id, agent_id, ",
"stock_count, sales_count, create_time, `status`, operator_id, operator_name, ",
"ext_1, ext_2, ext_3",
"from high_coupon_agent_rel",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="parent_coupon_agent_id", property="parentCouponAgentId", jdbcType=JdbcType.BIGINT),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="coupon_name", property="couponName", jdbcType=JdbcType.VARCHAR),
@Result(column="sales_price", property="salesPrice", jdbcType=JdbcType.DECIMAL),
@ -118,7 +121,8 @@ public interface HighCouponAgentRelMapper extends HighCouponAgentRelMapperExt {
@Update({
"update high_coupon_agent_rel",
"set `type` = #{type,jdbcType=INTEGER},",
"set parent_coupon_agent_id = #{parentCouponAgentId,jdbcType=BIGINT},",
"`type` = #{type,jdbcType=INTEGER},",
"coupon_name = #{couponName,jdbcType=VARCHAR},",
"sales_price = #{salesPrice,jdbcType=DECIMAL},",
"coupon_id = #{couponId,jdbcType=BIGINT},",

@ -28,6 +28,10 @@ public class HighCouponAgentRelSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("high_coupon_agent_rel");
if (record.getParentCouponAgentId() != null) {
sql.VALUES("parent_coupon_agent_id", "#{parentCouponAgentId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
@ -94,6 +98,7 @@ public class HighCouponAgentRelSqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("parent_coupon_agent_id");
sql.SELECT("`type`");
sql.SELECT("coupon_name");
sql.SELECT("sales_price");
@ -129,6 +134,10 @@ public class HighCouponAgentRelSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getParentCouponAgentId() != null) {
sql.SET("parent_coupon_agent_id = #{record.parentCouponAgentId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
@ -194,6 +203,7 @@ public class HighCouponAgentRelSqlProvider {
sql.UPDATE("high_coupon_agent_rel");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("parent_coupon_agent_id = #{record.parentCouponAgentId,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("coupon_name = #{record.couponName,jdbcType=VARCHAR}");
sql.SET("sales_price = #{record.salesPrice,jdbcType=DECIMAL}");
@ -218,6 +228,10 @@ public class HighCouponAgentRelSqlProvider {
SQL sql = new SQL();
sql.UPDATE("high_coupon_agent_rel");
if (record.getParentCouponAgentId() != null) {
sql.SET("parent_coupon_agent_id = #{parentCouponAgentId,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}

@ -0,0 +1,155 @@
package com.hai.dao;
import com.hai.entity.HighDevice;
import com.hai.entity.HighDeviceExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface HighDeviceMapper extends HighDeviceMapperExt {
@SelectProvider(type=HighDeviceSqlProvider.class, method="countByExample")
long countByExample(HighDeviceExample example);
@DeleteProvider(type=HighDeviceSqlProvider.class, method="deleteByExample")
int deleteByExample(HighDeviceExample example);
@Delete({
"delete from high_device",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_device (`type`, company_id, ",
"company_name, mer_id, ",
"mer_name, mer_store_id, ",
"mer_store_name, device_name, ",
"device_sn, device_key, ",
"device_imei, device_iccid, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ",
"#{companyName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ",
"#{merName,jdbcType=VARCHAR}, #{merStoreId,jdbcType=BIGINT}, ",
"#{merStoreName,jdbcType=VARCHAR}, #{deviceName,jdbcType=VARCHAR}, ",
"#{deviceSn,jdbcType=VARCHAR}, #{deviceKey,jdbcType=VARCHAR}, ",
"#{deviceImei,jdbcType=VARCHAR}, #{deviceIccid,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(HighDevice record);
@InsertProvider(type=HighDeviceSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighDevice record);
@SelectProvider(type=HighDeviceSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR),
@Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR),
@Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR),
@Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR),
@Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR),
@Result(column="device_iccid", property="deviceIccid", 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),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<HighDevice> selectByExample(HighDeviceExample example);
@Select({
"select",
"id, `type`, company_id, company_name, mer_id, mer_name, mer_store_id, mer_store_name, ",
"device_name, device_sn, device_key, device_imei, device_iccid, `status`, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from high_device",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_store_id", property="merStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_store_name", property="merStoreName", jdbcType=JdbcType.VARCHAR),
@Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR),
@Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR),
@Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR),
@Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR),
@Result(column="device_iccid", property="deviceIccid", 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),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
HighDevice selectByPrimaryKey(Long id);
@UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighDevice record, @Param("example") HighDeviceExample example);
@UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighDevice record, @Param("example") HighDeviceExample example);
@UpdateProvider(type=HighDeviceSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(HighDevice record);
@Update({
"update high_device",
"set `type` = #{type,jdbcType=INTEGER},",
"company_id = #{companyId,jdbcType=BIGINT},",
"company_name = #{companyName,jdbcType=VARCHAR},",
"mer_id = #{merId,jdbcType=BIGINT},",
"mer_name = #{merName,jdbcType=VARCHAR},",
"mer_store_id = #{merStoreId,jdbcType=BIGINT},",
"mer_store_name = #{merStoreName,jdbcType=VARCHAR},",
"device_name = #{deviceName,jdbcType=VARCHAR},",
"device_sn = #{deviceSn,jdbcType=VARCHAR},",
"device_key = #{deviceKey,jdbcType=VARCHAR},",
"device_imei = #{deviceImei,jdbcType=VARCHAR},",
"device_iccid = #{deviceIccid,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighDevice record);
}

@ -0,0 +1,7 @@
package com.hai.dao;
/**
* mapper扩展类
*/
public interface HighDeviceMapperExt {
}

@ -0,0 +1,430 @@
package com.hai.dao;
import com.hai.entity.HighDevice;
import com.hai.entity.HighDeviceExample.Criteria;
import com.hai.entity.HighDeviceExample.Criterion;
import com.hai.entity.HighDeviceExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighDeviceSqlProvider {
public String countByExample(HighDeviceExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_device");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighDeviceExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_device");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighDevice record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_device");
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getCompanyId() != null) {
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}");
}
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}");
}
if (record.getMerStoreId() != null) {
sql.VALUES("mer_store_id", "#{merStoreId,jdbcType=BIGINT}");
}
if (record.getMerStoreName() != null) {
sql.VALUES("mer_store_name", "#{merStoreName,jdbcType=VARCHAR}");
}
if (record.getDeviceName() != null) {
sql.VALUES("device_name", "#{deviceName,jdbcType=VARCHAR}");
}
if (record.getDeviceSn() != null) {
sql.VALUES("device_sn", "#{deviceSn,jdbcType=VARCHAR}");
}
if (record.getDeviceKey() != null) {
sql.VALUES("device_key", "#{deviceKey,jdbcType=VARCHAR}");
}
if (record.getDeviceImei() != null) {
sql.VALUES("device_imei", "#{deviceImei,jdbcType=VARCHAR}");
}
if (record.getDeviceIccid() != null) {
sql.VALUES("device_iccid", "#{deviceIccid,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(HighDeviceExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("`type`");
sql.SELECT("company_id");
sql.SELECT("company_name");
sql.SELECT("mer_id");
sql.SELECT("mer_name");
sql.SELECT("mer_store_id");
sql.SELECT("mer_store_name");
sql.SELECT("device_name");
sql.SELECT("device_sn");
sql.SELECT("device_key");
sql.SELECT("device_imei");
sql.SELECT("device_iccid");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("high_device");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
HighDevice record = (HighDevice) parameter.get("record");
HighDeviceExample example = (HighDeviceExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_device");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
}
if (record.getMerStoreId() != null) {
sql.SET("mer_store_id = #{record.merStoreId,jdbcType=BIGINT}");
}
if (record.getMerStoreName() != null) {
sql.SET("mer_store_name = #{record.merStoreName,jdbcType=VARCHAR}");
}
if (record.getDeviceName() != null) {
sql.SET("device_name = #{record.deviceName,jdbcType=VARCHAR}");
}
if (record.getDeviceSn() != null) {
sql.SET("device_sn = #{record.deviceSn,jdbcType=VARCHAR}");
}
if (record.getDeviceKey() != null) {
sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}");
}
if (record.getDeviceImei() != null) {
sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}");
}
if (record.getDeviceIccid() != null) {
sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("high_device");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
sql.SET("mer_store_id = #{record.merStoreId,jdbcType=BIGINT}");
sql.SET("mer_store_name = #{record.merStoreName,jdbcType=VARCHAR}");
sql.SET("device_name = #{record.deviceName,jdbcType=VARCHAR}");
sql.SET("device_sn = #{record.deviceSn,jdbcType=VARCHAR}");
sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}");
sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}");
sql.SET("device_iccid = #{record.deviceIccid,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}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
HighDeviceExample example = (HighDeviceExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(HighDevice record) {
SQL sql = new SQL();
sql.UPDATE("high_device");
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}");
}
if (record.getMerStoreId() != null) {
sql.SET("mer_store_id = #{merStoreId,jdbcType=BIGINT}");
}
if (record.getMerStoreName() != null) {
sql.SET("mer_store_name = #{merStoreName,jdbcType=VARCHAR}");
}
if (record.getDeviceName() != null) {
sql.SET("device_name = #{deviceName,jdbcType=VARCHAR}");
}
if (record.getDeviceSn() != null) {
sql.SET("device_sn = #{deviceSn,jdbcType=VARCHAR}");
}
if (record.getDeviceKey() != null) {
sql.SET("device_key = #{deviceKey,jdbcType=VARCHAR}");
}
if (record.getDeviceImei() != null) {
sql.SET("device_imei = #{deviceImei,jdbcType=VARCHAR}");
}
if (record.getDeviceIccid() != null) {
sql.SET("device_iccid = #{deviceIccid,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, HighDeviceExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -42,12 +42,14 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
"insert into high_merchant_tripartite_platform (mer_id, platform_type, ",
"platform_mer_name, platform_mer_number, ",
"profit_sharing_status, profit_sharing_ratio, ",
"profit_sharing_receivers_number, profit_sharing_receivers_name, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ",
"#{platformMerName,jdbcType=VARCHAR}, #{platformMerNumber,jdbcType=VARCHAR}, ",
"#{profitSharingStatus,jdbcType=BIT}, #{profitSharingRatio,jdbcType=DECIMAL}, ",
"#{profitSharingReceiversNumber,jdbcType=VARCHAR}, #{profitSharingReceiversName,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
@ -68,6 +70,8 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
@Result(column="platform_mer_number", property="platformMerNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="profit_sharing_receivers_number", property="profitSharingReceiversNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_receivers_name", property="profitSharingReceiversName", 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 +84,8 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
@Select({
"select",
"id, mer_id, platform_type, platform_mer_name, platform_mer_number, profit_sharing_status, ",
"profit_sharing_ratio, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"profit_sharing_ratio, profit_sharing_receivers_number, profit_sharing_receivers_name, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from high_merchant_tripartite_platform",
"where id = #{id,jdbcType=BIGINT}"
})
@ -92,6 +97,8 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
@Result(column="platform_mer_number", property="platformMerNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_status", property="profitSharingStatus", jdbcType=JdbcType.BIT),
@Result(column="profit_sharing_ratio", property="profitSharingRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="profit_sharing_receivers_number", property="profitSharingReceiversNumber", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_receivers_name", property="profitSharingReceiversName", 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 +125,8 @@ public interface HighMerchantTripartitePlatformMapper extends HighMerchantTripar
"platform_mer_number = #{platformMerNumber,jdbcType=VARCHAR},",
"profit_sharing_status = #{profitSharingStatus,jdbcType=BIT},",
"profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL},",
"profit_sharing_receivers_number = #{profitSharingReceiversNumber,jdbcType=VARCHAR},",
"profit_sharing_receivers_name = #{profitSharingReceiversName,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",

@ -52,6 +52,14 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.VALUES("profit_sharing_ratio", "#{profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getProfitSharingReceiversNumber() != null) {
sql.VALUES("profit_sharing_receivers_number", "#{profitSharingReceiversNumber,jdbcType=VARCHAR}");
}
if (record.getProfitSharingReceiversName() != null) {
sql.VALUES("profit_sharing_receivers_name", "#{profitSharingReceiversName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -92,6 +100,8 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.SELECT("platform_mer_number");
sql.SELECT("profit_sharing_status");
sql.SELECT("profit_sharing_ratio");
sql.SELECT("profit_sharing_receivers_number");
sql.SELECT("profit_sharing_receivers_name");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
@ -143,6 +153,14 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getProfitSharingReceiversNumber() != null) {
sql.SET("profit_sharing_receivers_number = #{record.profitSharingReceiversNumber,jdbcType=VARCHAR}");
}
if (record.getProfitSharingReceiversName() != null) {
sql.SET("profit_sharing_receivers_name = #{record.profitSharingReceiversName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -182,6 +200,8 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.SET("platform_mer_number = #{record.platformMerNumber,jdbcType=VARCHAR}");
sql.SET("profit_sharing_status = #{record.profitSharingStatus,jdbcType=BIT}");
sql.SET("profit_sharing_ratio = #{record.profitSharingRatio,jdbcType=DECIMAL}");
sql.SET("profit_sharing_receivers_number = #{record.profitSharingReceiversNumber,jdbcType=VARCHAR}");
sql.SET("profit_sharing_receivers_name = #{record.profitSharingReceiversName,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 +242,14 @@ public class HighMerchantTripartitePlatformSqlProvider {
sql.SET("profit_sharing_ratio = #{profitSharingRatio,jdbcType=DECIMAL}");
}
if (record.getProfitSharingReceiversNumber() != null) {
sql.SET("profit_sharing_receivers_number = #{profitSharingReceiversNumber,jdbcType=VARCHAR}");
}
if (record.getProfitSharingReceiversName() != null) {
sql.SET("profit_sharing_receivers_name = #{profitSharingReceiversName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -1121,7 +1121,7 @@ public interface HighOrderMapperExt {
" from high_child_order a,high_order b " +
" where a.order_id = b.id " +
" and goods_type = 3 " +
"<if test='param.storeId != null'> and goods_id = #{param.storeId} </if>" +
"<if test='param.storeId != null'> and goods_id in (${param.storeId}) </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>",

@ -66,6 +66,9 @@ public interface OutRechargeOrderMapperExt {
"SELECT" +
" order_no as orderNo," +
" operator_name as operatorName," +
" labor_union_card as laborUnionCard," +
" refund_time as refundTime," +
" create_timed as createTime," +
" case recharge_type when 1 then '快充' when 2 then '慢充' end rechargeTypeName ," +
" case pay_type when 2 then '微信支付' when 3 then '工会卡支付' when 4 then '银联支付' when null then '积分抵扣' end payTypeName," +
" recharge_content as rechargeContent,recharge_price as rechargePrice,pay_price as payPrice,discount_deduction_price as discountDeductionPrice,integral_deduction_price as integralDeductionPrice,pay_real_price as payRealPrice," +

@ -1,5 +1,6 @@
package com.hai.entity;
import javax.persistence.Version;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@ -67,6 +68,7 @@ public class ApiMerchants implements Serializable {
/**
* 版本号
*/
@Version
private Integer version;
/**
@ -303,4 +305,4 @@ public class ApiMerchants implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

@ -74,7 +74,7 @@ public class ApiOrderRecord implements Serializable {
private Date updateTime;
/**
* 100 :未回调 101已回调 102回调未响应
* 100 :未回调 101已回调 102回调未响应 103 预回调
*/
private Integer status;
@ -302,4 +302,4 @@ public class ApiOrderRecord implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

@ -20,6 +20,16 @@ public class HighAgent implements Serializable {
*/
private Integer type;
/**
* 上级代理商id
*/
private Long parentId;
/**
* 上级代理商名称
*/
private String parentName;
/**
* 代理商编号
*/
@ -50,6 +60,9 @@ public class HighAgent implements Serializable {
*/
private Date createTime;
/**
* 状态0不可用1可用 2禁用
*/
private Integer status;
/**
@ -91,6 +104,22 @@ public class HighAgent implements Serializable {
this.type = type;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public String getAgentKey() {
return agentKey;
}
@ -209,6 +238,8 @@ public class HighAgent implements Serializable {
HighAgent other = (HighAgent) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
&& (this.getParentName() == null ? other.getParentName() == null : this.getParentName().equals(other.getParentName()))
&& (this.getAgentKey() == null ? other.getAgentKey() == null : this.getAgentKey().equals(other.getAgentKey()))
&& (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName()))
&& (this.getAgentAddress() == null ? other.getAgentAddress() == null : this.getAgentAddress().equals(other.getAgentAddress()))
@ -230,6 +261,8 @@ public class HighAgent implements Serializable {
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
result = prime * result + ((getParentName() == null) ? 0 : getParentName().hashCode());
result = prime * result + ((getAgentKey() == null) ? 0 : getAgentKey().hashCode());
result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode());
result = prime * result + ((getAgentAddress() == null) ? 0 : getAgentAddress().hashCode());
@ -254,6 +287,8 @@ public class HighAgent implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", type=").append(type);
sb.append(", parentId=").append(parentId);
sb.append(", parentName=").append(parentName);
sb.append(", agentKey=").append(agentKey);
sb.append(", agentName=").append(agentName);
sb.append(", agentAddress=").append(agentAddress);

@ -245,6 +245,136 @@ public class HighAgentExample {
return (Criteria) this;
}
public Criteria andParentIdIsNull() {
addCriterion("parent_id is null");
return (Criteria) this;
}
public Criteria andParentIdIsNotNull() {
addCriterion("parent_id is not null");
return (Criteria) this;
}
public Criteria andParentIdEqualTo(Long value) {
addCriterion("parent_id =", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(Long value) {
addCriterion("parent_id <>", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(Long value) {
addCriterion("parent_id >", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(Long value) {
addCriterion("parent_id >=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThan(Long value) {
addCriterion("parent_id <", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(Long value) {
addCriterion("parent_id <=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdIn(List<Long> values) {
addCriterion("parent_id in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<Long> values) {
addCriterion("parent_id not in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdBetween(Long value1, Long value2) {
addCriterion("parent_id between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(Long value1, Long value2) {
addCriterion("parent_id not between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentNameIsNull() {
addCriterion("parent_name is null");
return (Criteria) this;
}
public Criteria andParentNameIsNotNull() {
addCriterion("parent_name is not null");
return (Criteria) this;
}
public Criteria andParentNameEqualTo(String value) {
addCriterion("parent_name =", value, "parentName");
return (Criteria) this;
}
public Criteria andParentNameNotEqualTo(String value) {
addCriterion("parent_name <>", value, "parentName");
return (Criteria) this;
}
public Criteria andParentNameGreaterThan(String value) {
addCriterion("parent_name >", value, "parentName");
return (Criteria) this;
}
public Criteria andParentNameGreaterThanOrEqualTo(String value) {
addCriterion("parent_name >=", value, "parentName");
return (Criteria) this;
}
public Criteria andParentNameLessThan(String value) {
addCriterion("parent_name <", value, "parentName");
return (Criteria) this;
}
public Criteria andParentNameLessThanOrEqualTo(String value) {
addCriterion("parent_name <=", value, "parentName");
return (Criteria) this;
}
public Criteria andParentNameLike(String value) {
addCriterion("parent_name like", value, "parentName");
return (Criteria) this;
}
public Criteria andParentNameNotLike(String value) {
addCriterion("parent_name not like", value, "parentName");
return (Criteria) this;
}
public Criteria andParentNameIn(List<String> values) {
addCriterion("parent_name in", values, "parentName");
return (Criteria) this;
}
public Criteria andParentNameNotIn(List<String> values) {
addCriterion("parent_name not in", values, "parentName");
return (Criteria) this;
}
public Criteria andParentNameBetween(String value1, String value2) {
addCriterion("parent_name between", value1, value2, "parentName");
return (Criteria) this;
}
public Criteria andParentNameNotBetween(String value1, String value2) {
addCriterion("parent_name not between", value1, value2, "parentName");
return (Criteria) this;
}
public Criteria andAgentKeyIsNull() {
addCriterion("agent_key is null");
return (Criteria) this;

@ -71,10 +71,25 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
private String qrCode;
/**
* 状态1.待销售 2.未使用 3.已使用
* 状态0.删除 1.待销售 2.未使用 3.已使用 4. 分发代理商
*/
private Integer status;
/**
* 分配给卡券和代理商的id
*/
private Long assignCouponAgentId;
/**
* 分配代理商id
*/
private Long assignAgentId;
/**
* 分配代理商名称
*/
private String assignAgentName;
/**
* 备注
*/
@ -204,6 +219,30 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
this.status = status;
}
public Long getAssignCouponAgentId() {
return assignCouponAgentId;
}
public void setAssignCouponAgentId(Long assignCouponAgentId) {
this.assignCouponAgentId = assignCouponAgentId;
}
public Long getAssignAgentId() {
return assignAgentId;
}
public void setAssignAgentId(Long assignAgentId) {
this.assignAgentId = assignAgentId;
}
public String getAssignAgentName() {
return assignAgentName;
}
public void setAssignAgentName(String assignAgentName) {
this.assignAgentName = assignAgentName;
}
public String getRemark() {
return remark;
}
@ -292,6 +331,9 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
&& (this.getCouponCode() == null ? other.getCouponCode() == null : this.getCouponCode().equals(other.getCouponCode()))
&& (this.getQrCode() == null ? other.getQrCode() == null : this.getQrCode().equals(other.getQrCode()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getAssignCouponAgentId() == null ? other.getAssignCouponAgentId() == null : this.getAssignCouponAgentId().equals(other.getAssignCouponAgentId()))
&& (this.getAssignAgentId() == null ? other.getAssignAgentId() == null : this.getAssignAgentId().equals(other.getAssignAgentId()))
&& (this.getAssignAgentName() == null ? other.getAssignAgentName() == null : this.getAssignAgentName().equals(other.getAssignAgentName()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getSalesTime() == null ? other.getSalesTime() == null : this.getSalesTime().equals(other.getSalesTime()))
@ -318,6 +360,9 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
result = prime * result + ((getCouponCode() == null) ? 0 : getCouponCode().hashCode());
result = prime * result + ((getQrCode() == null) ? 0 : getQrCode().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getAssignCouponAgentId() == null) ? 0 : getAssignCouponAgentId().hashCode());
result = prime * result + ((getAssignAgentId() == null) ? 0 : getAssignAgentId().hashCode());
result = prime * result + ((getAssignAgentName() == null) ? 0 : getAssignAgentName().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getSalesTime() == null) ? 0 : getSalesTime().hashCode());
@ -347,6 +392,9 @@ public class HighCouponAgentCode extends HighCouponAgentCodeModel implements Ser
sb.append(", couponCode=").append(couponCode);
sb.append(", qrCode=").append(qrCode);
sb.append(", status=").append(status);
sb.append(", assignCouponAgentId=").append(assignCouponAgentId);
sb.append(", assignAgentId=").append(assignAgentId);
sb.append(", assignAgentName=").append(assignAgentName);
sb.append(", remark=").append(remark);
sb.append(", createTime=").append(createTime);
sb.append(", salesTime=").append(salesTime);

@ -885,6 +885,196 @@ public class HighCouponAgentCodeExample {
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdIsNull() {
addCriterion("assign_coupon_agent_id is null");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdIsNotNull() {
addCriterion("assign_coupon_agent_id is not null");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdEqualTo(Long value) {
addCriterion("assign_coupon_agent_id =", value, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdNotEqualTo(Long value) {
addCriterion("assign_coupon_agent_id <>", value, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdGreaterThan(Long value) {
addCriterion("assign_coupon_agent_id >", value, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdGreaterThanOrEqualTo(Long value) {
addCriterion("assign_coupon_agent_id >=", value, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdLessThan(Long value) {
addCriterion("assign_coupon_agent_id <", value, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdLessThanOrEqualTo(Long value) {
addCriterion("assign_coupon_agent_id <=", value, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdIn(List<Long> values) {
addCriterion("assign_coupon_agent_id in", values, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdNotIn(List<Long> values) {
addCriterion("assign_coupon_agent_id not in", values, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdBetween(Long value1, Long value2) {
addCriterion("assign_coupon_agent_id between", value1, value2, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignCouponAgentIdNotBetween(Long value1, Long value2) {
addCriterion("assign_coupon_agent_id not between", value1, value2, "assignCouponAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdIsNull() {
addCriterion("assign_agent_id is null");
return (Criteria) this;
}
public Criteria andAssignAgentIdIsNotNull() {
addCriterion("assign_agent_id is not null");
return (Criteria) this;
}
public Criteria andAssignAgentIdEqualTo(Long value) {
addCriterion("assign_agent_id =", value, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdNotEqualTo(Long value) {
addCriterion("assign_agent_id <>", value, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdGreaterThan(Long value) {
addCriterion("assign_agent_id >", value, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdGreaterThanOrEqualTo(Long value) {
addCriterion("assign_agent_id >=", value, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdLessThan(Long value) {
addCriterion("assign_agent_id <", value, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdLessThanOrEqualTo(Long value) {
addCriterion("assign_agent_id <=", value, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdIn(List<Long> values) {
addCriterion("assign_agent_id in", values, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdNotIn(List<Long> values) {
addCriterion("assign_agent_id not in", values, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdBetween(Long value1, Long value2) {
addCriterion("assign_agent_id between", value1, value2, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentIdNotBetween(Long value1, Long value2) {
addCriterion("assign_agent_id not between", value1, value2, "assignAgentId");
return (Criteria) this;
}
public Criteria andAssignAgentNameIsNull() {
addCriterion("assign_agent_name is null");
return (Criteria) this;
}
public Criteria andAssignAgentNameIsNotNull() {
addCriterion("assign_agent_name is not null");
return (Criteria) this;
}
public Criteria andAssignAgentNameEqualTo(String value) {
addCriterion("assign_agent_name =", value, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameNotEqualTo(String value) {
addCriterion("assign_agent_name <>", value, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameGreaterThan(String value) {
addCriterion("assign_agent_name >", value, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameGreaterThanOrEqualTo(String value) {
addCriterion("assign_agent_name >=", value, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameLessThan(String value) {
addCriterion("assign_agent_name <", value, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameLessThanOrEqualTo(String value) {
addCriterion("assign_agent_name <=", value, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameLike(String value) {
addCriterion("assign_agent_name like", value, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameNotLike(String value) {
addCriterion("assign_agent_name not like", value, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameIn(List<String> values) {
addCriterion("assign_agent_name in", values, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameNotIn(List<String> values) {
addCriterion("assign_agent_name not in", values, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameBetween(String value1, String value2) {
addCriterion("assign_agent_name between", value1, value2, "assignAgentName");
return (Criteria) this;
}
public Criteria andAssignAgentNameNotBetween(String value1, String value2) {
addCriterion("assign_agent_name not between", value1, value2, "assignAgentName");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;

@ -21,6 +21,11 @@ public class HighCouponAgentRel extends HighCouponAgentRelModel implements Seria
*/
private Long id;
/**
* 上级关系
*/
private Long parentCouponAgentId;
/**
* 类型 1销售码 2兑换码
*/
@ -92,6 +97,14 @@ public class HighCouponAgentRel extends HighCouponAgentRelModel implements Seria
this.id = id;
}
public Long getParentCouponAgentId() {
return parentCouponAgentId;
}
public void setParentCouponAgentId(Long parentCouponAgentId) {
this.parentCouponAgentId = parentCouponAgentId;
}
public Integer getType() {
return type;
}
@ -217,6 +230,7 @@ public class HighCouponAgentRel extends HighCouponAgentRelModel implements Seria
}
HighCouponAgentRel other = (HighCouponAgentRel) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getParentCouponAgentId() == null ? other.getParentCouponAgentId() == null : this.getParentCouponAgentId().equals(other.getParentCouponAgentId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getCouponName() == null ? other.getCouponName() == null : this.getCouponName().equals(other.getCouponName()))
&& (this.getSalesPrice() == null ? other.getSalesPrice() == null : this.getSalesPrice().equals(other.getSalesPrice()))
@ -238,6 +252,7 @@ public class HighCouponAgentRel extends HighCouponAgentRelModel implements Seria
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getParentCouponAgentId() == null) ? 0 : getParentCouponAgentId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getCouponName() == null) ? 0 : getCouponName().hashCode());
result = prime * result + ((getSalesPrice() == null) ? 0 : getSalesPrice().hashCode());
@ -262,6 +277,7 @@ public class HighCouponAgentRel extends HighCouponAgentRelModel implements Seria
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", parentCouponAgentId=").append(parentCouponAgentId);
sb.append(", type=").append(type);
sb.append(", couponName=").append(couponName);
sb.append(", salesPrice=").append(salesPrice);

@ -186,6 +186,66 @@ public class HighCouponAgentRelExample {
return (Criteria) this;
}
public Criteria andParentCouponAgentIdIsNull() {
addCriterion("parent_coupon_agent_id is null");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdIsNotNull() {
addCriterion("parent_coupon_agent_id is not null");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdEqualTo(Long value) {
addCriterion("parent_coupon_agent_id =", value, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdNotEqualTo(Long value) {
addCriterion("parent_coupon_agent_id <>", value, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdGreaterThan(Long value) {
addCriterion("parent_coupon_agent_id >", value, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdGreaterThanOrEqualTo(Long value) {
addCriterion("parent_coupon_agent_id >=", value, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdLessThan(Long value) {
addCriterion("parent_coupon_agent_id <", value, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdLessThanOrEqualTo(Long value) {
addCriterion("parent_coupon_agent_id <=", value, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdIn(List<Long> values) {
addCriterion("parent_coupon_agent_id in", values, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdNotIn(List<Long> values) {
addCriterion("parent_coupon_agent_id not in", values, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdBetween(Long value1, Long value2) {
addCriterion("parent_coupon_agent_id between", value1, value2, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andParentCouponAgentIdNotBetween(Long value1, Long value2) {
addCriterion("parent_coupon_agent_id not between", value1, value2, "parentCouponAgentId");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;

@ -0,0 +1,344 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* high_device
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighDevice implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 设备类型 1. 商鹏4G 2. 4G打印机
*/
private Integer type;
/**
* 公司id
*/
private Long companyId;
/**
* 公司名称
*/
private String companyName;
/**
* 商户id
*/
private Long merId;
/**
* 商户名称
*/
private String merName;
/**
* 门店id
*/
private Long merStoreId;
/**
* 门店名称
*/
private String merStoreName;
/**
* 设备名称
*/
private String deviceName;
/**
* 设备SN编号
*/
private String deviceSn;
/**
* 设备KEY编号
*/
private String deviceKey;
/**
* 设备IMEI
*/
private String deviceImei;
/**
* 设备ICCID
*/
private String deviceIccid;
/**
* 状态0删除1正常
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public Long getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public String getMerName() {
return merName;
}
public void setMerName(String merName) {
this.merName = merName;
}
public Long getMerStoreId() {
return merStoreId;
}
public void setMerStoreId(Long merStoreId) {
this.merStoreId = merStoreId;
}
public String getMerStoreName() {
return merStoreName;
}
public void setMerStoreName(String merStoreName) {
this.merStoreName = merStoreName;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceSn() {
return deviceSn;
}
public void setDeviceSn(String deviceSn) {
this.deviceSn = deviceSn;
}
public String getDeviceKey() {
return deviceKey;
}
public void setDeviceKey(String deviceKey) {
this.deviceKey = deviceKey;
}
public String getDeviceImei() {
return deviceImei;
}
public void setDeviceImei(String deviceImei) {
this.deviceImei = deviceImei;
}
public String getDeviceIccid() {
return deviceIccid;
}
public void setDeviceIccid(String deviceIccid) {
this.deviceIccid = deviceIccid;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
HighDevice other = (HighDevice) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName()))
&& (this.getMerStoreId() == null ? other.getMerStoreId() == null : this.getMerStoreId().equals(other.getMerStoreId()))
&& (this.getMerStoreName() == null ? other.getMerStoreName() == null : this.getMerStoreName().equals(other.getMerStoreName()))
&& (this.getDeviceName() == null ? other.getDeviceName() == null : this.getDeviceName().equals(other.getDeviceName()))
&& (this.getDeviceSn() == null ? other.getDeviceSn() == null : this.getDeviceSn().equals(other.getDeviceSn()))
&& (this.getDeviceKey() == null ? other.getDeviceKey() == null : this.getDeviceKey().equals(other.getDeviceKey()))
&& (this.getDeviceImei() == null ? other.getDeviceImei() == null : this.getDeviceImei().equals(other.getDeviceImei()))
&& (this.getDeviceIccid() == null ? other.getDeviceIccid() == null : this.getDeviceIccid().equals(other.getDeviceIccid()))
&& (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()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode());
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode());
result = prime * result + ((getMerStoreId() == null) ? 0 : getMerStoreId().hashCode());
result = prime * result + ((getMerStoreName() == null) ? 0 : getMerStoreName().hashCode());
result = prime * result + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode());
result = prime * result + ((getDeviceSn() == null) ? 0 : getDeviceSn().hashCode());
result = prime * result + ((getDeviceKey() == null) ? 0 : getDeviceKey().hashCode());
result = prime * result + ((getDeviceImei() == null) ? 0 : getDeviceImei().hashCode());
result = prime * result + ((getDeviceIccid() == null) ? 0 : getDeviceIccid().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());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", type=").append(type);
sb.append(", companyId=").append(companyId);
sb.append(", companyName=").append(companyName);
sb.append(", merId=").append(merId);
sb.append(", merName=").append(merName);
sb.append(", merStoreId=").append(merStoreId);
sb.append(", merStoreName=").append(merStoreName);
sb.append(", deviceName=").append(deviceName);
sb.append(", deviceSn=").append(deviceSn);
sb.append(", deviceKey=").append(deviceKey);
sb.append(", deviceImei=").append(deviceImei);
sb.append(", deviceIccid=").append(deviceIccid);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -46,6 +46,16 @@ public class HighMerchantTripartitePlatform implements Serializable {
*/
private BigDecimal profitSharingRatio;
/**
* 分账接收方账户
*/
private String profitSharingReceiversNumber;
/**
* 分账接收方名称
*/
private String profitSharingReceiversName;
/**
* 状态 0删除 1正常
*/
@ -125,6 +135,22 @@ public class HighMerchantTripartitePlatform implements Serializable {
this.profitSharingRatio = profitSharingRatio;
}
public String getProfitSharingReceiversNumber() {
return profitSharingReceiversNumber;
}
public void setProfitSharingReceiversNumber(String profitSharingReceiversNumber) {
this.profitSharingReceiversNumber = profitSharingReceiversNumber;
}
public String getProfitSharingReceiversName() {
return profitSharingReceiversName;
}
public void setProfitSharingReceiversName(String profitSharingReceiversName) {
this.profitSharingReceiversName = profitSharingReceiversName;
}
public Integer getStatus() {
return status;
}
@ -192,6 +218,8 @@ public class HighMerchantTripartitePlatform implements Serializable {
&& (this.getPlatformMerNumber() == null ? other.getPlatformMerNumber() == null : this.getPlatformMerNumber().equals(other.getPlatformMerNumber()))
&& (this.getProfitSharingStatus() == null ? other.getProfitSharingStatus() == null : this.getProfitSharingStatus().equals(other.getProfitSharingStatus()))
&& (this.getProfitSharingRatio() == null ? other.getProfitSharingRatio() == null : this.getProfitSharingRatio().equals(other.getProfitSharingRatio()))
&& (this.getProfitSharingReceiversNumber() == null ? other.getProfitSharingReceiversNumber() == null : this.getProfitSharingReceiversNumber().equals(other.getProfitSharingReceiversNumber()))
&& (this.getProfitSharingReceiversName() == null ? other.getProfitSharingReceiversName() == null : this.getProfitSharingReceiversName().equals(other.getProfitSharingReceiversName()))
&& (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()))
@ -211,6 +239,8 @@ public class HighMerchantTripartitePlatform implements Serializable {
result = prime * result + ((getPlatformMerNumber() == null) ? 0 : getPlatformMerNumber().hashCode());
result = prime * result + ((getProfitSharingStatus() == null) ? 0 : getProfitSharingStatus().hashCode());
result = prime * result + ((getProfitSharingRatio() == null) ? 0 : getProfitSharingRatio().hashCode());
result = prime * result + ((getProfitSharingReceiversNumber() == null) ? 0 : getProfitSharingReceiversNumber().hashCode());
result = prime * result + ((getProfitSharingReceiversName() == null) ? 0 : getProfitSharingReceiversName().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());
@ -233,6 +263,8 @@ public class HighMerchantTripartitePlatform implements Serializable {
sb.append(", platformMerNumber=").append(platformMerNumber);
sb.append(", profitSharingStatus=").append(profitSharingStatus);
sb.append(", profitSharingRatio=").append(profitSharingRatio);
sb.append(", profitSharingReceiversNumber=").append(profitSharingReceiversNumber);
sb.append(", profitSharingReceiversName=").append(profitSharingReceiversName);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);

@ -566,6 +566,146 @@ public class HighMerchantTripartitePlatformExample {
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberIsNull() {
addCriterion("profit_sharing_receivers_number is null");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberIsNotNull() {
addCriterion("profit_sharing_receivers_number is not null");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberEqualTo(String value) {
addCriterion("profit_sharing_receivers_number =", value, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberNotEqualTo(String value) {
addCriterion("profit_sharing_receivers_number <>", value, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberGreaterThan(String value) {
addCriterion("profit_sharing_receivers_number >", value, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberGreaterThanOrEqualTo(String value) {
addCriterion("profit_sharing_receivers_number >=", value, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberLessThan(String value) {
addCriterion("profit_sharing_receivers_number <", value, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberLessThanOrEqualTo(String value) {
addCriterion("profit_sharing_receivers_number <=", value, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberLike(String value) {
addCriterion("profit_sharing_receivers_number like", value, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberNotLike(String value) {
addCriterion("profit_sharing_receivers_number not like", value, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberIn(List<String> values) {
addCriterion("profit_sharing_receivers_number in", values, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberNotIn(List<String> values) {
addCriterion("profit_sharing_receivers_number not in", values, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberBetween(String value1, String value2) {
addCriterion("profit_sharing_receivers_number between", value1, value2, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNumberNotBetween(String value1, String value2) {
addCriterion("profit_sharing_receivers_number not between", value1, value2, "profitSharingReceiversNumber");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameIsNull() {
addCriterion("profit_sharing_receivers_name is null");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameIsNotNull() {
addCriterion("profit_sharing_receivers_name is not null");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameEqualTo(String value) {
addCriterion("profit_sharing_receivers_name =", value, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameNotEqualTo(String value) {
addCriterion("profit_sharing_receivers_name <>", value, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameGreaterThan(String value) {
addCriterion("profit_sharing_receivers_name >", value, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameGreaterThanOrEqualTo(String value) {
addCriterion("profit_sharing_receivers_name >=", value, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameLessThan(String value) {
addCriterion("profit_sharing_receivers_name <", value, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameLessThanOrEqualTo(String value) {
addCriterion("profit_sharing_receivers_name <=", value, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameLike(String value) {
addCriterion("profit_sharing_receivers_name like", value, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameNotLike(String value) {
addCriterion("profit_sharing_receivers_name not like", value, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameIn(List<String> values) {
addCriterion("profit_sharing_receivers_name in", values, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameNotIn(List<String> values) {
addCriterion("profit_sharing_receivers_name not in", values, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameBetween(String value1, String value2) {
addCriterion("profit_sharing_receivers_name between", value1, value2, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andProfitSharingReceiversNameNotBetween(String value1, String value2) {
addCriterion("profit_sharing_receivers_name not between", value1, value2, "profitSharingReceiversName");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -85,7 +85,7 @@ public class OutRechargeOrder implements Serializable {
private String rechargeContent;
/**
* 1支付宝 2微信 3汇联通工会卡 4银联 5银联分期
* 1支付宝 2微信 3汇联通工会卡 4银联 5银联分期 6:商户预充值
*/
private Integer payType;
@ -662,4 +662,4 @@ public class OutRechargeOrder implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

@ -0,0 +1,44 @@
package com.hai.enum_type;
import java.util.Objects;
/**
* 设备类型
* @author hurui
*/
public enum DeviceTypeEnum {
type1(1 , "商鹏云打印"),
type2(2, "ZKC云打印"),
;
private Integer type;
private String name;
DeviceTypeEnum(int type , String name) {
this.type = type;
this.name = name;
}
public static String getNameByType(Integer type) {
for (DeviceTypeEnum ele : values()) {
if(Objects.equals(type,ele.getType())) return ele.getName();
}
return null;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -5,7 +5,28 @@ import com.hai.entity.ApiProductConfig;
import java.math.BigDecimal;
public class ApiProductConfigModel extends ApiProduct {
public class ApiProductConfigModel {
/**
* 充值类型 1:话费
*/
private Integer rechargeType;
/**
* 话费充值方式 1.快充 2慢充
*/
private Integer phoneRechargeType;
/**
* 运营商 1 电信 2.移动 3.联通
*/
private Integer operatorType;
/**
* 充值金额
*/
private BigDecimal rechargePrice;
/**
* 折扣比例
*/
@ -21,25 +42,36 @@ public class ApiProductConfigModel extends ApiProduct {
*/
private Long apiConfigProductId;
/**
* 101 正常 102 下架 100 删除
*/
private Integer configStatus;
public Integer getRechargeType() {
return rechargeType;
}
public Integer getConfigStatus() {
return configStatus;
public void setRechargeType(Integer rechargeType) {
this.rechargeType = rechargeType;
}
public void setConfigStatus(Integer configStatus) {
this.configStatus = configStatus;
public Integer getPhoneRechargeType() {
return phoneRechargeType;
}
public Long getApiConfigProductId() {
return apiConfigProductId;
public void setPhoneRechargeType(Integer phoneRechargeType) {
this.phoneRechargeType = phoneRechargeType;
}
public void setApiConfigProductId(Long apiConfigProductId) {
this.apiConfigProductId = apiConfigProductId;
public Integer getOperatorType() {
return operatorType;
}
public void setOperatorType(Integer operatorType) {
this.operatorType = operatorType;
}
public BigDecimal getRechargePrice() {
return rechargePrice;
}
public void setRechargePrice(BigDecimal rechargePrice) {
this.rechargePrice = rechargePrice;
}
public BigDecimal getDiscount() {
@ -57,4 +89,12 @@ public class ApiProductConfigModel extends ApiProduct {
public void setDiscountPrice(BigDecimal discountPrice) {
this.discountPrice = discountPrice;
}
public Long getApiConfigProductId() {
return apiConfigProductId;
}
public void setApiConfigProductId(Long apiConfigProductId) {
this.apiConfigProductId = apiConfigProductId;
}
}

@ -23,6 +23,8 @@ public class OutRechargeOrderModel extends OutRechargeOrder {
private Date payTime;
private String payStatusName;
private String rechargeStatusName;
private String laborUnionCard;
private Date refundTime;
@Override
public String getOrderNo() {
@ -174,4 +176,24 @@ public class OutRechargeOrderModel extends OutRechargeOrder {
public void setRechargeStatusName(String rechargeStatusName) {
this.rechargeStatusName = rechargeStatusName;
}
@Override
public String getLaborUnionCard() {
return laborUnionCard;
}
@Override
public void setLaborUnionCard(String laborUnionCard) {
this.laborUnionCard = laborUnionCard;
}
@Override
public Date getRefundTime() {
return refundTime;
}
@Override
public void setRefundTime(Date refundTime) {
this.refundTime = refundTime;
}
}

@ -0,0 +1,47 @@
package com.hai.service;
import com.hai.entity.ApiAmountRecord;
import java.util.List;
import java.util.Map;
/**
* @serviceName ApiAmountRecordService.java
* @author Sum1Dream
* @version 1.0.0
* @Description // 商户金额记录接口
* @createTime 14:31 2022/6/13
**/
public interface ApiAmountRecordService {
/**
* @Author Sum1Dream
* @name insertAmountRecord.java
* @Description // 插入金额记录
* @Date 14:32 2022/6/13
* @Param [com.hai.entity.ApiAmountRecord]
* @return void
*/
void insertAmountRecord(ApiAmountRecord apiAmountRecord);
/**
* @Author Sum1Dream
* @name findById.java
* @Description // 查询详情
* @Date 15:39 2022/6/13
* @Param [java.lang.Long]
* @return com.hai.entity.ApiAmountRecord
*/
ApiAmountRecord findById(Long id);
/**
* @Author Sum1Dream
* @name isRefundOrder.java
* @Description // 查询是否已经退款
* @Date 10:35 2022/6/15
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.lang.Boolean
*/
List<ApiAmountRecord> getApiAmountRecordByList(Map<String , Object> map);
}

@ -0,0 +1,37 @@
package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.ApiMerchants;
import com.hai.entity.ApiProduct;
import com.hai.entity.ApiProductConfig;
/**
* @serviceName ApiOpenService.java
* @author Sum1Dream
* @version 1.0.0
* @Description // api开发接口
* @createTime 17:29 2022/6/10
**/
public interface ApiOpenService {
/**
* @Author Sum1Dream
* @name createOrder.java
* @Description // 充值预下单
* @Date 17:31 2022/6/10
* @Param [com.alibaba.fastjson.JSONObject]
* @return com.alibaba.fastjson.JSONObject
*/
void createOrder(JSONObject object , ApiMerchants apiMerchants , ApiProductConfig productConfig) throws Exception;
/**
* @Author Sum1Dream
* @name getAllCities.java
* @Description // 获取大陆所有城市
* @Date 10:16 2022/6/27
* @Param []
* @return com.alibaba.fastjson.JSONObject
*/
JSONObject getAllCities();
}

@ -2,6 +2,7 @@ package com.hai.service;
import com.hai.entity.ApiOrderRecord;
import java.util.List;
import java.util.Map;
/**
@ -22,4 +23,34 @@ public interface ApiOrderRecordService {
* @return com.hai.entity.ApiOrderRecord
*/
ApiOrderRecord queryOrderResult(Map<String , Object> map);
/**
* @Author Sum1Dream
* @name insertOrderRecord.java
* @Description // 插入订单记录
* @Date 15:28 2022/6/13
* @Param [com.hai.entity.ApiOrderRecord]
* @return void
*/
void insertOrderRecord(ApiOrderRecord apiOrderRecord);
/**
* @Author Sum1Dream
* @name updateOrderRecord.java
* @Description // 更新
* @Date 16:01 2022/6/13
* @Param [com.hai.entity.ApiOrderRecord]
* @return void
*/
void updateOrderRecord(ApiOrderRecord apiOrderRecord);
/**
* @Author Sum1Dream
* @name callBackOrderList.java
* @Description // 查询15分钟内的未回调的订单
* @Date 16:16 2022/6/15
* @Param []
* @return java.util.List<com.hai.entity.ApiOrderRecord>
*/
List<ApiOrderRecord> callBackOrderList();
}

@ -86,4 +86,14 @@ public interface ApiProductService {
* @return com.hai.entity.ApiProductConfig
*/
ApiProductConfig findProductConfigById(Long id);
/**
* @Author Sum1Dream
* @name findMchProduct.java
* @Description // 查询商户商品
* @Date 17:38 2022/6/10
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return com.hai.entity.ApiProductConfig
*/
ApiProductConfig findMchProduct(Map<String , Object> map);
}

@ -25,7 +25,7 @@ public interface HighAgentService {
* @throws Exception 抛出异常
*/
List<HighAgent> getListAgentMsg(Map<String , String> map) throws Exception;
List<HighAgent> getListAgentMsg(Map<String , Object> map) throws Exception;
/**
*
@ -61,6 +61,17 @@ public interface HighAgentService {
*/
void updateAgentMsg(HighAgentModel highAgentModel) throws Exception;
/**
*
* @Title: insertUser
* @Description: 新增代理商信息
* @author: Sum1Dream
* @Date: 2021/03/09 11:23
* @param: [highUser] 用户信息
* @return: com.hai.entity.HighAgentMsg
*/
void insertChildAgent(HighAgent agent) throws Exception ;
/**
*
* @Title: insertUser

@ -3,6 +3,7 @@ package com.hai.service;
import com.hai.entity.HighCouponAgentCode;
import com.hai.entity.HighCouponAgentRecord;
import com.hai.entity.HighCouponAgentRel;
import com.hai.entity.HighCouponCode;
import org.apache.ibatis.annotations.Param;
import java.security.PrivateKey;
@ -37,6 +38,13 @@ public interface HighCouponAgentService {
**/
HighCouponAgentRel getRelByCouponAgent(Long couponId,Long agentId, Integer type);
/**
* 根据id查询关系
* @param couponAgentRelId
* @return
*/
HighCouponAgentRel getRelById(Long couponAgentRelId);
/**
* @Author 胡锐
* @Description 查询卡券与代理商关系列表
@ -135,4 +143,10 @@ public interface HighCouponAgentService {
*/
Map<String, Object> pushGzSinopec(Long couponAgentRelId, String phone, String remark) throws Exception;
/**
* 查询代理商未分配的 销售码兑换码
* @param couponAgentRelId
* @return
*/
List<HighCouponAgentCode> getNoSaleCode(Long couponAgentRelId);
}

@ -0,0 +1,42 @@
package com.hai.service;
import com.hai.entity.HighDevice;
import java.util.List;
import java.util.Map;
/**
* 设备管理
* @author hurui
*/
public interface HighDeviceService {
/**
* 编辑设备
* @param device
*/
void editDevice(HighDevice device);
/**
* 查询设备详情
* @param deviceId
* @return
*/
HighDevice getDetailById(Long deviceId);
/**
* 查询设备列表
* @param param
* @return
*/
List<HighDevice> getDeviceList(Map<String, Object> param);
/**
* 根据门店id查询设备列表
* @param storeId
* @return
*/
List<HighDevice> getDeviceListByStoreId(Long storeId);
}

@ -70,6 +70,13 @@ public interface HighMerchantStoreService {
*/
HighMerchantStore getDetailById(Long id);
/**
* 查询门店列表
* @param merId
* @return
*/
List<HighMerchantStore> getStoreListByMer(Long merId);
/**
* @Author 胡锐
* @Description 查询门店列表

@ -428,4 +428,9 @@ public interface HighOrderService {
*/
GasOrderModel getGasOrderDetail(String orderNo);
/**
* 打印加油订单
* @param gasId
*/
void printGasOrder(Long gasId, HighOrder order);
}

@ -23,6 +23,15 @@ public interface SecConfigService {
**/
SecConfig findById(Integer id);
/**
* @ClassName SecConfigService.java
* @author Sum1Dream
* @version 1.0.0
* @Description //TODO
* @createTime 17:31 2021/6/23
**/
void insertSecConfig(SecConfig secConfig);
/**
* @ClassName SecConfigService.java
* @author Sum1Dream
@ -59,6 +68,6 @@ public interface SecConfigService {
* @Param [java.util.Map<java.lang.String,java.lang.Object>]
* @return java.lang.Boolean
*/
Boolean isSignVerify(Map<String, Object> map) throws Exception;
Boolean isSignVerify(Map<String, Object> map , String sign) throws Exception;
}

@ -0,0 +1,52 @@
package com.hai.service.impl;
import com.hai.dao.ApiAmountRecordMapper;
import com.hai.entity.ApiAmountRecord;
import com.hai.entity.ApiAmountRecordExample;
import com.hai.service.ApiAmountRecordService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("apiAmountRecordService")
public class ApiAmountRecordServiceImpl implements ApiAmountRecordService {
@Resource
private ApiAmountRecordMapper apiAmountRecordMapper;
@Override
public void insertAmountRecord(ApiAmountRecord apiAmountRecord) {
apiAmountRecord.setCreateTime(new Date());
apiAmountRecord.setUpdateTime(new Date());
apiAmountRecord.setStatus(100);
apiAmountRecordMapper.insert(apiAmountRecord);
}
@Override
public ApiAmountRecord findById(Long id) {
return apiAmountRecordMapper.selectByPrimaryKey(id);
}
@Override
public List<ApiAmountRecord> getApiAmountRecordByList(Map<String, Object> map) {
ApiAmountRecordExample example = new ApiAmountRecordExample();
ApiAmountRecordExample.Criteria criteria = example.createCriteria();
if (StringUtils.isBlank(MapUtils.getString(map , "orderNo"))) {
criteria.andSourceOrderNoEqualTo(MapUtils.getString(map , "orderNo"));
}
if (MapUtils.getInteger(map , "amountType") == null) {
criteria.andAmountTypeEqualTo(MapUtils.getInteger(map , "amountType"));
}
if (MapUtils.getInteger(map , "sourceType") == null) {
criteria.andSourceTypeEqualTo(MapUtils.getInteger(map , "sourceType"));
}
return apiAmountRecordMapper.selectByExample(example);
}
}

@ -48,7 +48,7 @@ public class ApiMerchantsServiceImpl implements ApiMerchantsService {
}
@Override
public void updateApiMerchants(ApiMerchants apiMerchants) {
public synchronized void updateApiMerchants(ApiMerchants apiMerchants) {
apiMerchantsMapper.updateByPrimaryKey(apiMerchants);
}

@ -0,0 +1,282 @@
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.config.CommonSysConst;
import com.hai.config.RechargeConfig;
import com.hai.dao.ApiAmountRecordMapper;
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;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("apiOpenService")
public class ApiOpenServiceImpl implements ApiOpenService {
@Resource
private ApiOrderRecordService apiOrderRecordService;
@Resource
private ApiMerchantsService apiMerchantsService;
@Resource
private ApiProductService apiProductService;
@Resource
private ApiAmountRecordService apiAmountRecordService;
@Resource
private OutRechargeOrderMapper outRechargeOrderMapper;
@Resource
private OutRechargeChildOrderService outRechargeChildOrderService;
@Resource
private BsRequestRecordService bsRequestRecordService;
@Resource
private OutRechargeOrderService outRechargeOrderService;
@Override
@Transactional(rollbackFor=Exception.class,isolation = Isolation.SERIALIZABLE,propagation= Propagation.REQUIRES_NEW)
public void createOrder(JSONObject object , ApiMerchants apiMerchants , ApiProductConfig productConfig) throws Exception {
Map<String, Object> orderMap = new HashMap<>();
orderMap.put("sourceOrderNo" , object.getString("orderNo"));
// 查询是否用重复订单
ApiOrderRecord apiOrderRecord = apiOrderRecordService.queryOrderResult(orderMap);
if (apiOrderRecord != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ORDER_ALREADY_EXISTS);
}
ApiProduct apiProduct = apiProductService.findById(productConfig.getProductId());
// 当前账号余额是否可以充值当前金额
if (apiMerchants.getAmounts().compareTo(productConfig.getDiscountPrice()) < 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.INSUFFICIENT_BALANCE);
}
// 插入金额记录
// 变更前金额
BigDecimal beforeAmount = apiMerchants.getAmounts();
// 计算金额
apiMerchants.setAmounts(apiMerchants.getAmounts().subtract(productConfig.getDiscountPrice()));
// 变更后金额
BigDecimal afterAmount = apiMerchants.getAmounts();
apiMerchantsService.updateApiMerchants(apiMerchants);
ApiAmountRecord apiAmountRecord = new ApiAmountRecord();
apiAmountRecord.setCreateTime(new Date());
apiAmountRecord.setUpdateTime(new Date());
apiAmountRecord.setMchId(apiMerchants.getMchId());
apiAmountRecord.setStatus(100);
apiAmountRecord.setAmount(productConfig.getDiscountPrice());
apiAmountRecord.setAfterAmount(afterAmount);
apiAmountRecord.setBeforeAmount(beforeAmount);
apiAmountRecord.setAmountType(2);
apiAmountRecord.setSourceType(3);
apiAmountRecord.setSourceOrderNo(object.getString("orderNo"));
apiAmountRecord.setSourceId(apiProduct.getId());
apiAmountRecord.setSourceContent(apiMerchants.getMerchantName() + "|" + object.getString("mobile") + "充值" + apiProduct.getRechargePrice() + "|扣款" + productConfig.getDiscountPrice());
apiAmountRecordService.insertAmountRecord(apiAmountRecord);
// 充值订单
OutRechargeOrder outRechargeOrder = new OutRechargeOrder();
outRechargeOrder.setPayStatus(102);
outRechargeOrder.setRechargeStatus(204);
outRechargeOrder.setOrderNo("RCG" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5));
outRechargeOrder.setPaySerialNo("22" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5));
outRechargeOrder.setRechargePrice(apiProduct.getRechargePrice());
outRechargeOrder.setRechargeType(apiProduct.getPhoneRechargeType());
outRechargeOrder.setOrderPrice(productConfig.getDiscountPrice());
outRechargeOrder.setPayPrice(productConfig.getDiscountPrice());
outRechargeOrder.setRechargeContent(object.getString("mobile"));
outRechargeOrder.setPayTime(new Date());
outRechargeOrder.setUserName(apiMerchants.getUserName());
outRechargeOrder.setUserPhone(apiMerchants.getPhone());
outRechargeOrder.setPayType(6);
outRechargeOrder.setCompanyId(6666L);
outRechargeOrder.setType(1);
outRechargeOrder.setCreateTimed(new Date());
outRechargeOrder.setOperatorName(apiProduct.getOperatorName());
outRechargeOrder.setOperatorType(apiProduct.getOperatorType());
outRechargeOrder.setGoodsId(apiProduct.getId());
outRechargeOrder.setMerchId(apiMerchants.getMchId());
outRechargeOrder.setUserId(apiMerchants.getId());
outRechargeOrderMapper.insert(outRechargeOrder);
pollRequest(outRechargeOrder);
// 插入订单记录
ApiOrderRecord apiOrderRecordPost = new ApiOrderRecord();
apiOrderRecordPost.setStatus(103);
apiOrderRecordPost.setOrderNo(outRechargeOrder.getOrderNo());
apiOrderRecordPost.setSourceOrderNo(apiAmountRecord.getSourceOrderNo());
apiOrderRecordPost.setCreateTime(new Date());
apiOrderRecordPost.setMchId(apiMerchants.getMchId());
apiOrderRecordPost.setOrderId(outRechargeOrder.getId());
apiOrderRecordPost.setGoodsId(productConfig.getId().toString());
apiOrderRecordPost.setNotifyUrl(object.getString("notifyUrl"));
apiOrderRecordPost.setUpdateTime(new Date());
apiOrderRecordService.insertOrderRecord(apiOrderRecordPost);
}
private void pollRequest(OutRechargeOrder outRechargeOrder) throws Exception {
// 查询充值产品
ApiProduct apiProduct = apiProductService.findById(outRechargeOrder.getGoodsId());
// 查询充值子订单
Map<String, Object> childOrderMap = new HashMap<>();
childOrderMap.put("parent_order_id", outRechargeOrder.getId());
childOrderMap.put("status", 102);
List<OutRechargeChildOrder> childOrderList = outRechargeChildOrderService.getListRechargeChildOrder(childOrderMap);
OutRechargeChildOrder childOrder = new OutRechargeChildOrder();
// 1:尖椒 2:龙阅 3:畅停
int type = 0;
int rechargePlatformType = 0;
// 判断子订单是否存在充值中订单
if (childOrderList.size() > 0) {
childOrder = childOrderList.get(0);
childOrder.setStatus(103);
childOrder.setUpdateTime(new Date());
outRechargeChildOrderService.updateOrder(childOrder);
type = childOrder.getRechargePlatform();
} else {
// 查询充值子订单
Map<String, Object> childOrderMap103 = new HashMap<>();
childOrderMap.put("parent_order_id", outRechargeOrder.getId());
childOrderMap.put("status", 103);
List<OutRechargeChildOrder> childOrderList103 = outRechargeChildOrderService.getListRechargeChildOrder(childOrderMap103);
if (childOrderList103.size() > 0) {
type = childOrderList103.get(0).getRechargePlatform();
}
}
if (type == 2) {
type = 1;
} else {
type++;
}
JSONObject object = new JSONObject();
String orderNo = "CZ" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5);
String[] rechargePlatform = apiProduct.getRechargePlatform().split("-");
for (String s : rechargePlatform) {
// 尖椒充值
if (s.equals("1") && type == 1) {
object.put("out_order_id", orderNo);
object.put("amount", apiProduct.getRechargePrice());
object.put("mobile", outRechargeOrder.getRechargeContent());
object.put("notifyUrl", CommonSysConst.getSysConfig().getJjNotifyUrl());
if (apiProduct.getRechargeType() == 1) {
object.put("is_fast", 1);
}
JSONObject returnObject = RechargeConfig.rechargeOrderByJj(object);
object.put("return_content", returnObject);
if (returnObject != null && returnObject.getLong("code") == 200) {
childOrder.setStatus(102);
} else {
childOrder.setStatus(103);
}
rechargePlatformType = 1;
break;
}
if (s.equals("2") && type == 2) {
object.put("out_trade_num", orderNo);
object.put("product_id", apiProduct.getProductId());
object.put("mobile", outRechargeOrder.getRechargeContent());
object.put("notifyUrl", CommonSysConst.getSysConfig().getLyNotifyUrl());
JSONObject returnObject = RechargeConfig.rechargeOrderByLy(object);
object.put("return_content", returnObject);
if (returnObject != null && returnObject.getLong("errno") == 0) {
childOrder.setStatus(102);
} else {
childOrder.setStatus(103);
}
rechargePlatformType = 2;
break;
}
}
childOrder.setOrderNo(orderNo);
childOrder.setCreateTime(new Date());
childOrder.setParentOrderId(outRechargeOrder.getId());
childOrder.setRechargePlatform(rechargePlatformType);
childOrder.setUpdateTime(new Date());
outRechargeChildOrderService.insertOrder(childOrder);
// 创建提交记录
BsRequestRecord requestRecord = new BsRequestRecord();
requestRecord.setCreateTime(new Date());
requestRecord.setUpdateTime(new Date());
requestRecord.setOrderNo(orderNo);
requestRecord.setRequestContent(object.toJSONString());
requestRecord.setOperatorId(0L);
requestRecord.setOperatorName("系统生成");
requestRecord.setSourceId(childOrder.getId().toString());
requestRecord.setSourceType(1);
bsRequestRecordService.insertRequestRecord(requestRecord);
// 判断是否充值提交成功
if (childOrder.getStatus() == 102) {
outRechargeOrder.setRechargeStatus(201);
}
if (childOrder.getStatus() == 103) {
outRechargeOrder.setRechargeStatus(204);
}
outRechargeOrderMapper.updateByPrimaryKey(outRechargeOrder);
}
@Override
public JSONObject getAllCities() {
JSONObject object = HttpsUtils.doPost(CommonSysConst.getSysConfig().getQinzhuUrl()+"/openApi/v2/cities/listAll", "");
if (object != null && !object.getBoolean("success")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR);
}
return object;
}
}

@ -6,6 +6,7 @@ import com.hai.entity.ApiOrderRecordExample;
import com.hai.service.ApiOrderRecordService;
import com.itextpdf.text.pdf.qrcode.MaskUtil;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -25,8 +26,15 @@ public class ApiOrderRecordServiceImpl implements ApiOrderRecordService {
ApiOrderRecordExample example = new ApiOrderRecordExample();
ApiOrderRecordExample.Criteria criteria = example.createCriteria();
criteria.andSourceOrderNoEqualTo(MapUtils.getString(map , "sourceOrderNo"));
criteria.andMchIdEqualTo(MapUtils.getString(map , "merchId"));
if (StringUtils.isNotBlank(MapUtils.getString(map , "sourceOrderNo"))) {
criteria.andSourceOrderNoEqualTo(MapUtils.getString(map , "sourceOrderNo"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map , "merchId"))) {
criteria.andMchIdEqualTo(MapUtils.getString(map , "merchId"));
}
if (MapUtils.getLong(map , "orderId") != null) {
criteria.andOrderIdEqualTo(MapUtils.getLong(map , "orderId"));
}
List<ApiOrderRecord> list = apiOrderRecordMapper.selectByExample(example);
@ -36,4 +44,19 @@ public class ApiOrderRecordServiceImpl implements ApiOrderRecordService {
return null;
}
}
@Override
public void insertOrderRecord(ApiOrderRecord apiOrderRecord) {
apiOrderRecordMapper.insert(apiOrderRecord);
}
@Override
public void updateOrderRecord(ApiOrderRecord apiOrderRecord) {
apiOrderRecordMapper.updateByPrimaryKey(apiOrderRecord);
}
@Override
public List<ApiOrderRecord> callBackOrderList() {
return apiOrderRecordMapper.callBackOrderList();
}
}

@ -138,4 +138,29 @@ public class ApiProductServiceImpl implements ApiProductService {
public void updateConfigApiProduct(ApiProductConfig apiProductConfig) {
apiProductConfigMapper.updateByPrimaryKey(apiProductConfig);
}
@Override
public ApiProductConfig findMchProduct(Map<String, Object> map) {
ApiProductConfigExample example = new ApiProductConfigExample();
ApiProductConfigExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map , "merchantsId") != null) {
criteria.andMerchantsIdEqualTo(MapUtils.getLong(map , "merchantsId"));
}
if (MapUtils.getLong(map , "productId") != null) {
criteria.andProductIdEqualTo(MapUtils.getLong(map , "productId"));
}
if (MapUtils.getLong(map , "id") != null) {
criteria.andIdEqualTo(MapUtils.getLong(map , "id"));
}
List<ApiProductConfig> list = apiProductConfigMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
} else {
return null;
}
}
}

@ -8,8 +8,11 @@ import com.hai.entity.SecUser;
import com.hai.model.HighAgentModel;
import com.hai.service.HighAgentService;
import com.hai.service.SecUserService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
@ -31,27 +34,36 @@ public class HighAgentServiceImpl implements HighAgentService {
private SecUserService secUserService;
@Override
public List<HighAgent> getListAgentMsg(Map<String, String> map) throws Exception {
public List<HighAgent> getListAgentMsg(Map<String, Object> map) throws Exception {
HighAgentExample example = new HighAgentExample();
HighAgentExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(map.get("agentName"))) {
if (MapUtils.getLong(map, "parentAgentId") != null) {
criteria.andParentIdEqualTo(MapUtils.getLong(map, "parentAgentId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "agentName"))) {
criteria.andAgentNameLike("%" + map.get("agentName") + "%");
}
if (StringUtils.isNotBlank(map.get("agentPhone"))) {
criteria.andAgentPhoneEqualTo( map.get("agentPhone"));
if (StringUtils.isNotBlank(MapUtils.getString(map, "agentPhone"))) {
criteria.andAgentPhoneEqualTo(MapUtils.getString(map, "agentPhone"));
}
if (StringUtils.isNotBlank(map.get("status"))) {
criteria.andStatusEqualTo(Integer.valueOf(map.get("status")));
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
}
if (StringUtils.isNotBlank(map.get("type"))) {
criteria.andTypeEqualTo(Integer.valueOf(map.get("type")));
if (MapUtils.getInteger(map, "type") != null) {
criteria.andTypeEqualTo(MapUtils.getInteger(map, "type"));
}
if (StringUtils.isNotBlank(map.get("operatorId"))) {
criteria.andOperatorIdEqualTo(Long.valueOf(map.get("operatorId")));
if (MapUtils.getLong(map, "operatorId") != null) {
criteria.andOperatorIdEqualTo(MapUtils.getLong(map, "operatorId"));
}
example.setOrderByClause("create_time desc");
return highAgentMapper.selectByExample(example);
}
@ -89,6 +101,25 @@ public class HighAgentServiceImpl implements HighAgentService {
}
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void insertChildAgent(HighAgent agent) throws Exception {
highAgentMapper.insert(agent);
SecUser secUser = new SecUser();
secUser.setUserName(agent.getUserName());
secUser.setLoginName(agent.getAgentPhone());
secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setAdminFlag(1);
secUser.setStatus(1);
secUser.setRoleId(6L);
secUser.setObjectType(4);
secUser.setObjectId(agent.getId());
secUser.setCreateTime(new Date());
secUser.setUpdateTime(new Date());
secUserService.addUser(secUser);
}
@Override
public void insertAgentMsg(HighAgentModel highAgentModel) throws Exception {
highAgentMapper.insert(highAgentModel);

@ -10,6 +10,7 @@ import com.hai.common.exception.SysCode;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.HuiLianTongConfig;
import com.hai.config.HuiLianTongUnionCardConfig;
import com.hai.dao.*;
import com.hai.entity.*;
import com.hai.enum_type.OrderPushType;
@ -72,7 +73,6 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void assignCouponAgent(HighCouponAgentRel highCouponAgentRel,Integer stockCount) {
if (highCouponAgentRel.getId() != null) {
highCouponAgentRelMapper.updateByPrimaryKey(highCouponAgentRel);
} else {
@ -99,51 +99,92 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
record.setCreateTime(new Date());
highCouponAgentRecordMapper.insert(record);
if (highCouponAgentRel.getType() == 1) {
// 查询未销售的卡券
List<HighCouponCode> codeList = highCouponCodeService.getNoSaleCode(highCouponAgentRel.getCouponId());
if (stockCount > codeList.size()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法分配,分配数量超过库存数量");
if (highCouponAgentRel.getParentCouponAgentId() == null) {
if (highCouponAgentRel.getType() == 1) {
// 查询未销售的卡券
List<HighCouponCode> codeList = highCouponCodeService.getNoSaleCode(highCouponAgentRel.getCouponId());
if (stockCount > codeList.size()) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法分配,分配数量超过库存数量");
}
List<HighCouponCode> assignCouponCodeList = codeList.stream().limit(stockCount).collect(Collectors.toList());
HighCouponAgentCode highCouponAgentCode;
for (HighCouponCode code : assignCouponCodeList) {
code.setAgentId(highCouponAgentRel.getAgentId());
code.setIsAssignAgent(true);
highCouponCodeService.updateCouponCode(code);
highCouponAgentCode = new HighCouponAgentCode();
highCouponAgentCode.setType(highCouponAgentRel.getType());
highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId());
highCouponAgentCode.setCouponAgentRecordId(record.getId());
highCouponAgentCode.setCouponId(code.getCouponId());
highCouponAgentCode.setAgentId(highCouponAgentRel.getAgentId());
highCouponAgentCode.setCouponCodeId(code.getId());
highCouponAgentCode.setCouponCode(code.getSalesCode());
highCouponAgentCode.setQrCode(code.getExt1());
highCouponAgentCode.setStatus(1);
highCouponAgentCode.setCreateTime(new Date());
highCouponAgentCode.setOperatorId(highCouponAgentRel.getOperatorId());
highCouponAgentCode.setOperatorName(highCouponAgentRel.getOperatorName());
highCouponAgentCodeMapper.insert(highCouponAgentCode);
}
}
List<HighCouponCode> assignCouponCodeList = codeList.stream().limit(stockCount).collect(Collectors.toList());
HighCouponAgentCode highCouponAgentCode;
for (HighCouponCode code : assignCouponCodeList) {
code.setAgentId(highCouponAgentRel.getAgentId());
code.setIsAssignAgent(true);
highCouponCodeService.updateCouponCode(code);
highCouponAgentCode = new HighCouponAgentCode();
highCouponAgentCode.setType(highCouponAgentRel.getType());
highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId());
highCouponAgentCode.setCouponAgentRecordId(record.getId());
highCouponAgentCode.setCouponId(code.getCouponId());
highCouponAgentCode.setAgentId(highCouponAgentRel.getAgentId());
highCouponAgentCode.setCouponCodeId(code.getId());
highCouponAgentCode.setCouponCode(code.getSalesCode());
highCouponAgentCode.setQrCode(code.getExt1());
highCouponAgentCode.setStatus(1);
highCouponAgentCode.setCreateTime(new Date());
highCouponAgentCode.setOperatorId(highCouponAgentRel.getOperatorId());
highCouponAgentCode.setOperatorName(highCouponAgentRel.getOperatorName());
highCouponAgentCodeMapper.insert(highCouponAgentCode);
if (highCouponAgentRel.getType() == 2) {
HighCouponAgentCode highCouponAgentCode;
for (int i = 0; i < stockCount; i++) {
highCouponAgentCode = new HighCouponAgentCode();
highCouponAgentCode.setType(highCouponAgentRel.getType());
highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId());
highCouponAgentCode.setCouponAgentRecordId(record.getId());
highCouponAgentCode.setCouponId(highCoupon.getId());
highCouponAgentCode.setAgentId(highCouponAgentRel.getAgentId());
highCouponAgentCode.setConvertCode(generateConvertCode(highCouponAgentRel.getId()));
highCouponAgentCode.setStatus(1);
highCouponAgentCode.setCreateTime(new Date());
highCouponAgentCode.setOperatorId(highCouponAgentRel.getOperatorId());
highCouponAgentCode.setOperatorName(highCouponAgentRel.getOperatorName());
highCouponAgentCodeMapper.insert(highCouponAgentCode);
}
}
}
if (highCouponAgentRel.getType() == 2) {
HighCouponAgentCode highCouponAgentCode;
if (highCouponAgentRel.getParentCouponAgentId() != null) {
// 父级代理商库存
HighCouponAgentRel parentRel = getRelById(highCouponAgentRel.getParentCouponAgentId());
if (parentRel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到代理商");
}
parentRel.setStockCount(parentRel.getStockCount() - stockCount);
parentRel.setSalesCount(parentRel.getSalesCount() + stockCount);
highCouponAgentRelMapper.updateByPrimaryKey(parentRel);
// 查询父代理商未分配的码值
List<HighCouponAgentCode> codeList = getNoSaleCode(parentRel.getId());
if (codeList.size() < stockCount) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "库存数量不足");
}
for (int i = 0; i < stockCount; i++) {
highCouponAgentCode = new HighCouponAgentCode();
highCouponAgentCode.setType(highCouponAgentRel.getType());
highCouponAgentCode.setCouponAgentId(highCouponAgentRel.getId());
highCouponAgentCode.setCouponAgentRecordId(record.getId());
highCouponAgentCode.setCouponId(highCoupon.getId());
highCouponAgentCode.setAgentId(highCouponAgentRel.getAgentId());
highCouponAgentCode.setConvertCode(generateConvertCode(highCouponAgentRel.getId()));
highCouponAgentCode.setStatus(1);
highCouponAgentCode.setCreateTime(new Date());
highCouponAgentCode.setOperatorId(highCouponAgentRel.getOperatorId());
highCouponAgentCode.setOperatorName(highCouponAgentRel.getOperatorName());
highCouponAgentCodeMapper.insert(highCouponAgentCode);
HighCouponAgentCode code = codeList.get(i);
code.setAssignCouponAgentId(highCouponAgentRel.getId());
code.setAssignAgentId(highAgent.getId());
code.setAssignAgentName(highAgent.getAgentName());
code.setStatus(4);
highCouponAgentCodeMapper.updateByPrimaryKey(code);
code.setId(null);
code.setAssignCouponAgentId(null);
code.setAssignAgentId(null);
code.setAssignAgentName(null);
code.setStatus(1);
code.setAgentId(highCouponAgentRel.getAgentId());
code.setCouponAgentId(highCouponAgentRel.getId());
code.setCouponAgentRecordId(record.getId());
code.setCreateTime(new Date());
code.setOperatorId(highCouponAgentRel.getOperatorId());
code.setOperatorName(highCouponAgentRel.getOperatorName());
highCouponAgentCodeMapper.insert(code);
}
}
}
@ -164,6 +205,11 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
return null;
}
@Override
public HighCouponAgentRel getRelById(Long couponAgentRelId) {
return highCouponAgentRelMapper.selectByPrimaryKey(couponAgentRelId);
}
@Override
public List<HighCouponAgentRel> getCouponAgentList(Map<String, Object> map) {
HighCouponAgentRelExample example = new HighCouponAgentRelExample();
@ -617,4 +663,13 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService {
map.put("couponAgentCode", convertCode);
return map;
}
@Override
public List<HighCouponAgentCode> getNoSaleCode(Long couponAgentRelId) {
HighCouponAgentCodeExample example = new HighCouponAgentCodeExample();
example.createCriteria().andStatusEqualTo(1).andCouponAgentIdEqualTo(couponAgentRelId);
example.setOrderByClause("create_time desc");
return highCouponAgentCodeMapper.selectByExample(example);
}
}

@ -380,7 +380,7 @@ public class HighCouponServiceImpl implements HighCouponService {
criteria.andCouponSourceNotEqualTo(MapUtils.getInteger(map, "notCouponSource"));
}
example.setOrderByClause("display_area desc");
example.setOrderByClause("create_time");
List<HighCoupon> coupons = highCouponMapper.selectByExample(example);
if (coupons != null && coupons.size() > 0) {
for (HighCoupon highCoupon : coupons) {

@ -0,0 +1,77 @@
package com.hai.service.impl;
import com.hai.dao.HighDeviceMapper;
import com.hai.entity.HighDevice;
import com.hai.entity.HighDeviceExample;
import com.hai.service.HighDeviceService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("deviceService")
public class HighDeviceServiceImpl implements HighDeviceService {
@Resource
private HighDeviceMapper deviceMapper;
@Override
public void editDevice(HighDevice device) {
if (device.getId() == null) {
device.setCreateTime(new Date());
device.setUpdateTime(new Date());
device.setStatus(1);
deviceMapper.insert(device);
} else {
device.setUpdateTime(new Date());
deviceMapper.updateByPrimaryKey(device);
}
}
@Override
public HighDevice getDetailById(Long deviceId) {
return deviceMapper.selectByPrimaryKey(deviceId);
}
@Override
public List<HighDevice> getDeviceList(Map<String, Object> param) {
HighDeviceExample example = new HighDeviceExample();
HighDeviceExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getInteger(param, "type") != null) {
criteria.andTypeEqualTo(MapUtils.getInteger(param, "type"));
}
if (MapUtils.getLong(param, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId"));
}
if (MapUtils.getLong(param, "merId") != null) {
criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId"));
}
if (MapUtils.getLong(param, "storeId") != null) {
criteria.andMerStoreIdEqualTo(MapUtils.getLong(param, "storeId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "deviceName"))) {
criteria.andDeviceNameLike("%" + MapUtils.getString(param, "deviceName") + "%");
}
example.setOrderByClause("create_time desc");
return deviceMapper.selectByExample(example);
}
@Override
public List<HighDevice> getDeviceListByStoreId(Long storeId) {
HighDeviceExample example = new HighDeviceExample();
example.createCriteria()
.andMerStoreIdEqualTo(storeId)
.andStatusNotEqualTo(0);
return deviceMapper.selectByExample(example);
}
}

@ -142,6 +142,8 @@ public class HighGasOilPriceOfficialServiceImpl implements HighGasOilPriceOffici
List<HighGasOilPrice> list = highGasOilPriceService.getPriceListByRegionAndOilNo(priceOfficial.getRegionId(), priceOfficial.getOilNo());
for (HighGasOilPrice gasOilPrice : list) {
gasOilPrice.setPriceOfficial(priceOfficial.getPriceOfficial());
gasOilPrice.setPriceGun(priceOfficial.getPriceOfficial());
gasOilPrice.setPriceVip(priceOfficial.getPriceOfficial().subtract(gasOilPrice.getPreferentialMargin()));
highGasOilPriceService.editGasOilPrice(gasOilPrice);
}
}

@ -98,9 +98,7 @@ public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskServic
}
gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice());
new Thread(() -> {
gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo());
}).start();
gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo());
}
// 油站价

@ -170,6 +170,13 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
return highMerchantStoreMapper.selectByPrimaryKey(id);
}
@Override
public List<HighMerchantStore> getStoreListByMer(Long merId) {
HighMerchantStoreExample example = new HighMerchantStoreExample();
example.createCriteria().andMerchantIdEqualTo(merId);
return highMerchantStoreMapper.selectByExample(example);
}
@Override
public List<HighMerchantStore> getMerchantStoreList(Map<String, Object> map) {
HighMerchantStoreExample example = new HighMerchantStoreExample();

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save