Merge branch 'shift' into pre

dev-discount
胡锐 3 years ago
commit ab26b50f31
  1. 22
      hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java
  2. 168
      hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupController.java
  3. 253
      hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupTaskController.java
  4. 75
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  5. 79
      hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceController.java
  6. 8
      hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java
  7. 2
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  8. 18
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  9. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  10. 2
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  11. 66
      hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java
  12. 182
      hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java
  13. 46
      hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java
  14. 42
      hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java
  15. 28
      hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java
  16. 42
      hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java
  17. 125
      hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapper.java
  18. 7
      hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapperExt.java
  19. 332
      hai-service/src/main/java/com/hai/dao/HighGasClassGroupSqlProvider.java
  20. 139
      hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapper.java
  21. 62
      hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapperExt.java
  22. 374
      hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskSqlProvider.java
  23. 27
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java
  24. 3
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java
  25. 14
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java
  26. 48
      hai-service/src/main/java/com/hai/entity/HighChildOrder.java
  27. 190
      hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java
  28. 48
      hai-service/src/main/java/com/hai/entity/HighDevice.java
  29. 210
      hai-service/src/main/java/com/hai/entity/HighDeviceExample.java
  30. 232
      hai-service/src/main/java/com/hai/entity/HighGasClassGroup.java
  31. 1013
      hai-service/src/main/java/com/hai/entity/HighGasClassGroupExample.java
  32. 280
      hai-service/src/main/java/com/hai/entity/HighGasClassGroupTask.java
  33. 1183
      hai-service/src/main/java/com/hai/entity/HighGasClassGroupTaskExample.java
  34. 18
      hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java
  35. 60
      hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java
  36. 36
      hai-service/src/main/java/com/hai/enum_type/GasClassGroupTaskStatus.java
  37. 3
      hai-service/src/main/java/com/hai/enum_type/GasTaskPriceTypeEnum.java
  38. 155
      hai-service/src/main/java/com/hai/model/GasClassGroupTaskDataCount.java
  39. 62
      hai-service/src/main/java/com/hai/model/GasClassGroupTaskOilCount.java
  40. 39
      hai-service/src/main/java/com/hai/model/GasPayPriceModel.java
  41. 13
      hai-service/src/main/java/com/hai/model/HighCouponCodeModel.java
  42. 40
      hai-service/src/main/java/com/hai/service/HighGasClassGroupService.java
  43. 64
      hai-service/src/main/java/com/hai/service/HighGasClassGroupTaskService.java
  44. 2
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  45. 1
      hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java
  46. 81
      hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupServiceImpl.java
  47. 222
      hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupTaskServiceImpl.java
  48. 57
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java
  49. 4
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java
  50. 20
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java
  51. 35
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  52. 4
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java
  53. 1
      v1/src/main/java/com/v1/controller/RechargeProductController.java

@ -57,10 +57,7 @@ public class HighDeviceController {
public ResponseData editDevice(@RequestBody HighDevice body) {
try {
if (body.getMerStoreId() == null
|| body.getType() == null
|| StringUtils.isBlank(body.getDeviceName())
) {
if (body.getMerStoreId() == null || body.getType() == null) {
log.error("HighDeviceController -> editDevice() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
@ -114,11 +111,13 @@ public class HighDeviceController {
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"));
if (body.getId() == null) {
if (body.getType().equals(DeviceTypeEnum.type1.getType())) {
SpPrinterConfig sp = new SpPrinterConfig();
JSONObject jsonObject = JSONObject.parseObject(sp.addPrinter(body.getDeviceSn(), body.getDeviceKey(), store.getStoreName()));
if (!jsonObject.getInteger("errorcode").equals(0)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errormsg"));
}
}
}
@ -129,11 +128,14 @@ public class HighDeviceController {
device.setMerStoreId(store.getId());
device.setMerStoreName(store.getStoreName());
device.setType(body.getType());
device.setDeviceName(body.getDeviceName());
device.setDeviceName(store.getStoreName());
device.setDeviceSn(body.getDeviceSn());
device.setDeviceKey(body.getDeviceKey());
device.setDeviceImei(body.getDeviceImei());
device.setDeviceIccid(body.getDeviceIccid());
device.setReceiptTop(body.getReceiptTop());
device.setReceiptSource(body.getReceiptSource());
device.setReceiptBottom(body.getReceiptBottom());
deviceService.editDevice(device);
return ResponseMsgUtil.success("操作成功");

@ -0,0 +1,168 @@
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.entity.HighGasClassGroup;
import com.hai.entity.HighGasClassGroupTask;
import com.hai.enum_type.GasClassGroupTaskStatus;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighGasClassGroupService;
import com.hai.service.HighGasClassGroupTaskService;
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.List;
import java.util.Map;
/**
* 加油站班组
* @author hurui
*/
@Controller
@RequestMapping(value = "/gasClassGroup")
@Api(value = "加油站班组")
public class HighGasClassGroupController {
private static Logger log = LoggerFactory.getLogger(HighGasClassGroupController.class);
@Resource
private HighGasClassGroupService gasClassGroupService;
@Resource
private HighGasClassGroupTaskService gasClassGroupTaskService;
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private UserCenter userCenter;
@RequestMapping(value = "/editClassGroup", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑班组")
public ResponseData editClassGroup(@RequestBody JSONObject body) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null || userInfoModel.getMerchantStore() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
if (body == null
|| StringUtils.isBlank(body.getString("name"))
|| StringUtils.isBlank(body.getString("principalName"))
|| StringUtils.isBlank(body.getString("principalPhone"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
HighGasClassGroup gasClassGroup;
if (body.getLong("id") != null) {
// 查询班组
gasClassGroup = gasClassGroupService.getDetailById(body.getLong("id"));
if (gasClassGroup == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
} else {
gasClassGroup = new HighGasClassGroup();
gasClassGroup.setMerchantStoreId(userInfoModel.getMerchantStore().getId());
gasClassGroup.setMerchantStoreName(userInfoModel.getMerchantStore().getStoreName());
}
gasClassGroup.setName(body.getString("name"));
gasClassGroup.setPrincipalName(body.getString("principalName"));
gasClassGroup.setPrincipalPhone(body.getString("principalPhone"));
gasClassGroupService.editGroup(gasClassGroup);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasClassGroupController --> editClassGroup() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/delClassGroup", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "删除班组")
public ResponseData delClassGroup(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("id") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
Map<String, Object> param = new HashMap<>();
param.put("gasClassGroupId", body.getLong("id"));
param.put("status", GasClassGroupTaskStatus.status1.getStatus());
List<HighGasClassGroupTask> groupTaskList = gasClassGroupTaskService.getGroupTaskList(param);
if (groupTaskList.size() > 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "班组有任务进行中,暂时无法删除");
}
gasClassGroupService.delGroup(body.getLong("id"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasClassGroupController --> delClassGroup() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getClassGroupById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询班组详情")
public ResponseData getClassGroupById(@RequestParam(name = "groupId", required = true) Long groupId) {
try {
return ResponseMsgUtil.success(gasClassGroupService.getDetailById(groupId));
} catch (Exception e) {
log.error("HighGasClassGroupController --> getClassGroupById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getClassGroupList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询班组列表")
public ResponseData getClassGroupList(@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "principalName", required = false) String principalName,
@RequestParam(name = "principalPhone", required = false) String principalPhone,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null || userInfoModel.getMerchantStore() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
Map<String,Object> param = new HashMap<>();
param.put("merchantStoreId", userInfoModel.getMerchantStore().getId());
param.put("name", name);
param.put("principalName", principalName);
param.put("principalPhone", principalPhone);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasClassGroupService.getGroupList(param)));
} catch (Exception e) {
log.error("HighGasClassGroupController --> getClassGroupList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,253 @@
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.MqttProviderConfig;
import com.hai.config.SpPrinterConfig;
import com.hai.config.SpPrinterTemplate;
import com.hai.config.ZkcPrinterTemplate;
import com.hai.entity.HighDevice;
import com.hai.entity.HighGasClassGroupTask;
import com.hai.enum_type.DeviceTypeEnum;
import com.hai.enum_type.GasClassGroupTaskStatus;
import com.hai.enum_type.UserObjectTypeEnum;
import com.hai.model.GasClassGroupTaskDataCount;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.HighDeviceService;
import com.hai.service.HighGasClassGroupTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 加油站班组任务
* @author hurui
*/
@Controller
@RequestMapping(value = "/gasClassGroupTask")
@Api(value = "加油站班组任务")
public class HighGasClassGroupTaskController {
private static Logger log = LoggerFactory.getLogger(HighGasClassGroupTaskController.class);
@Resource
private HighGasClassGroupTaskService gasClassGroupTaskService;
@Resource
private HighDeviceService deviceService;
@Resource
private MqttProviderConfig mqttProviderConfig;
@Resource
private UserCenter userCenter;
@RequestMapping(value = "/startGroupTask", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "开启班组任务")
public ResponseData startGroupTask(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("gasId") == null || body.getLong("gasClassGroupId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasClassGroupTaskService.startGroupTask(body.getLong("gasId"), body.getLong("gasClassGroupId"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasClassGroupTaskController --> startGroupTask() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/endGroupTask", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "结束班组任务")
public ResponseData endGroupTask(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("gasId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasClassGroupTaskService.endGroupTask(body.getLong("gasId"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasClassGroupTaskController --> endGroupTask() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/swapGroupTask", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "交换班组任务")
public ResponseData swapGroupTask(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("gasId") == null || body.getLong("gasClassGroupId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasClassGroupTaskService.swapGroupTask(body.getLong("gasId"), body.getLong("gasClassGroupId"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasClassGroupTaskController --> swapGroupTask() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getCurrentClassGroupTask", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询当前班次")
public ResponseData getCurrentClassGroupTask(@RequestParam(name = "gasId", required = true) Long gasId) {
try {
GasClassGroupTaskDataCount dataCount;
Map<String,Object> param = new HashMap<>();
param.put("merchantStoreId", gasId);
param.put("status", GasClassGroupTaskStatus.status1.getStatus());
List<HighGasClassGroupTask> list = gasClassGroupTaskService.getGroupTaskList(param);
if (list.size() > 0) {
dataCount = gasClassGroupTaskService.countGroupTaskData(gasId,
list.get(0).getClassNum(),
list.get(0).getId(),
list.get(0).getStatus(),
list.get(0).getStartTime(),
null
);
return ResponseMsgUtil.success(dataCount);
}
dataCount = new GasClassGroupTaskDataCount();
dataCount.setStatus(0);
dataCount.setRefuelPrice(new BigDecimal("0"));
dataCount.setRefuelNum(0);
dataCount.setRefuelLiters(new BigDecimal("0"));
dataCount.setRefundPrice(new BigDecimal("0"));
dataCount.setRefundNum(0);
dataCount.setRefundLiters(new BigDecimal("0"));
return ResponseMsgUtil.success(dataCount);
} catch (Exception e) {
log.error("HighGasClassGroupTaskController --> getCurrentClassGroupTask() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getClassGroupTaskById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询班组任务记录")
public ResponseData getClassGroupTaskById(@RequestParam(name = "gasClassGroupTaskId", required = true) Long gasClassGroupTaskId) {
try {
return ResponseMsgUtil.success(gasClassGroupTaskService.getDetailById(gasClassGroupTaskId));
} catch (Exception e) {
log.error("HighGasClassGroupTaskController --> getClassGroupTaskById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getClassGroupTaskList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询班组任务记录")
public ResponseData getClassGroupTaskList(@RequestParam(name = "gasClassGroupId", required = false) Long gasClassGroupId,
@RequestParam(name = "merchantStoreId", required = false) Long merchantStoreId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String,Object> param = new HashMap<>();
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type3.getType())) {
param.put("merchantStoreId", userInfoModel.getMerchantStore().getId());
} else if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type8.getType())) {
param.put("merchantStoreId", userInfoModel.getMerchantStore().getId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
param.put("gasClassGroupId", gasClassGroupId);
param.put("status", status);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasClassGroupTaskService.getGroupTaskList(param)));
} catch (Exception e) {
log.error("HighGasClassGroupTaskController --> getClassGroupTaskList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/print", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "打印小票")
public ResponseData print(@RequestParam(name = "gasClassGroupTaskId", required = true) Long gasClassGroupTaskId) {
try {
HighGasClassGroupTask groupTask = gasClassGroupTaskService.getDetailById(gasClassGroupTaskId);
if (groupTask == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到班次");
}
GasClassGroupTaskDataCount dataCount = JSONObject.parseObject(groupTask.getDataCount(), GasClassGroupTaskDataCount.class);
// 查询加油站打印机
List<HighDevice> deviceList = deviceService.getDeviceListByStoreId(groupTask.getMerchantStoreId());
for (HighDevice device : deviceList) {
if (device.getType().equals(DeviceTypeEnum.type1.getType())) {
new Thread(() -> {
try {
// 推送打印机
SpPrinterConfig spPrinterConfig = new SpPrinterConfig();
spPrinterConfig.print(device.getDeviceSn(), SpPrinterTemplate.classGroupCountTemp(dataCount, true), 1);
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}
if (device.getType().equals(DeviceTypeEnum.type2.getType())) {
new Thread(() -> {
try {
// 推送打印机
mqttProviderConfig.publish(2,false, device.getDeviceImei(), ZkcPrinterTemplate.classGroupCountTemp(dataCount,true));
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}
}
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasClassGroupTaskController --> getClassGroupTaskById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -268,6 +268,81 @@ public class HighGasController {
}
}
@RequestMapping(value="/getGasOrderCount",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油站订单列表")
public ResponseData getGasOrderCount(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "storeId", required = false) Long storeId,
@RequestParam(name = "staffId", required = false) Long staffId,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
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);
}
}
param.put("gasStaffId", staffId);
} else if (userInfoModel.getSecUser().getObjectType().equals(3)) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
param.put("gasStaffId", staffId);
} else if (userInfoModel.getSecUser().getObjectType().equals(8)) {
if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status1.getStatus())) {
param.put("storeId", userInfoModel.getMerchantStore().getId());
}
if (userInfoModel.getGasStaff().getPositionType().equals(GasPositionType.status2.getStatus())) {
param.put("gasStaffId", userInfoModel.getGasStaff().getId());
}
} else {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
param.put("orderNo", orderNo);
param.put("createTimeS", createTimeS);
param.put("createTimeE", createTimeE);
if (status == null) {
param.put("status", "2,3,4,6,7");
} else {
param.put("status", status);
}
Map<String, Object> map = new HashMap<>();
return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("HighGasController -> getGasOrderCount() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGasSelectList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询油站选择列表")

@ -25,6 +25,7 @@ import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@ -37,9 +38,15 @@ public class HighGasOilPriceController {
@Resource
private HighGasOilPriceService gasOilPriceService;
@Resource
private HighTyAgentPriceService tyAgentPriceService;
@Resource
private HighGasOilPriceOfficialService gasOilPriceOfficialService;
@Resource
private HighGasDiscountOilPriceService gasDiscountOilPriceService;
@Resource
private HighMerchantStoreService merchantStoreService;
@ -51,23 +58,10 @@ public class HighGasOilPriceController {
@ApiOperation(value = "编辑油品价格")
public ResponseData editGasOilPrice(@RequestBody JSONObject body) {
try {
if (body.getLong("storeId") == null
|| body.getInteger("oilNo") == null
|| body.getBigDecimal("priceGun") == null
|| body.getBigDecimal("preferentialMargin") == null
) {
if (body.getLong("storeId") == null || body.getInteger("oilNo") == null) {
log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (body.getBigDecimal("preferentialMargin").compareTo(body.getBigDecimal("priceGun")) == 0) {
log.error("HighGasDiscountOilPriceController -> editGasOilPrice() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "优惠幅度不能与油枪价相同");
}
if (body.getBigDecimal("preferentialMargin").compareTo(body.getBigDecimal("priceGun")) == 1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "优惠幅度不能大于枪价");
}
// 查询门店详情
HighMerchantStoreModel store = merchantStoreService.getMerchantStoreById(body.getLong("storeId"));
if (store == null) {
@ -87,25 +81,28 @@ public class HighGasOilPriceController {
HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), Integer.valueOf(body.getString("oilNo")));
if (price == null) {
price = new HighGasOilPrice();
}
price.setMerchantStoreId(body.getLong("storeId"));
price.setOilNo(Integer.parseInt(oilNo.getCodeValue()));
price.setOilNoName(oilNo.getCodeName());
price.setPriceVip(body.getBigDecimal("priceGun").subtract(body.getBigDecimal("preferentialMargin")));
price.setPreferentialMargin(body.getBigDecimal("preferentialMargin"));
price.setPriceGun(body.getBigDecimal("priceGun"));
// 查询国标价格
HighGasOilPriceOfficial priceOfficial = gasOilPriceOfficialService.getPrice(store.getRegionId(), body.getInteger("oilNo"));
if (priceOfficial != null) {
// 查询国标价格
HighGasOilPriceOfficial priceOfficial = gasOilPriceOfficialService.getPrice(store.getRegionId(), body.getInteger("oilNo"));
if (priceOfficial == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂时无法添加,系统未配置"+body.getInteger("oilNo")+"油号的国标价");
}
price.setMerchantStoreId(body.getLong("storeId"));
price.setOilType(Integer.parseInt(oilNo.getExt1()));
price.setOilTypeName(oilNo.getExt2());
price.setOilNo(Integer.parseInt(oilNo.getCodeValue()));
price.setOilNoName(oilNo.getCodeName());
price.setPriceOfficial(priceOfficial.getPriceOfficial());
}
price.setPriceGun(priceOfficial.getPriceOfficial());
price.setPriceVip(priceOfficial.getPriceOfficial());
price.setOilType(Integer.parseInt(oilNo.getExt1()));
price.setOilTypeName(oilNo.getExt2());
gasOilPriceService.editGasOilPrice(price);
price.setGasStationDrop(new BigDecimal("0"));
price.setPreferentialMargin(new BigDecimal("0"));
return ResponseMsgUtil.success("操作成功");
gasOilPriceService.editGasOilPrice(price);
return ResponseMsgUtil.success("操作成功");
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已添加" + body.getInteger("oilNo") + "油号");
} catch (Exception e) {
log.error("HighGasDiscountOilPriceController -> getGasDetailByStoreKey() error!",e);
@ -178,7 +175,27 @@ public class HighGasOilPriceController {
public ResponseData getOilPriceListByStore(@RequestParam(name = "storeId", required = true) Long storeId) {
try {
return ResponseMsgUtil.success(gasOilPriceService.getGasOilPriceByStore(storeId));
List<HighGasOilPrice> gasOilPriceList = gasOilPriceService.getGasOilPriceByStore(storeId);
for (HighGasOilPrice gasOilPrice : gasOilPriceList) {
BigDecimal discount = new BigDecimal("100");
// 查询是否配置了【油站的】优惠比例
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, gasOilPrice.getMerchantStoreId(), gasOilPrice.getOilNo().toString());
if (tyAgentPrice != null) {
discount = tyAgentPrice.getPriceRate();
} else {
// 查询是否配置了【油品】优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = gasDiscountOilPriceService.getDetailByOilNo(gasOilPrice.getOilNo().toString());
if (gasDiscountOilPrice != null) {
discount = gasDiscountOilPrice.getPriceRate();
}
}
// 油枪价 - 优惠幅度
BigDecimal price = gasOilPrice.getPriceGun().subtract(gasOilPrice.getPreferentialMargin());
gasOilPrice.setPriceVip(price.multiply(discount.divide(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP));
gasOilPrice.setExt1(discount.toString());
}
return ResponseMsgUtil.success(gasOilPriceList);
} catch (Exception e) {
log.error("HighGasDiscountOilPriceController -> getOilPriceListByStore() error!",e);

@ -80,7 +80,7 @@ public class HighGasOilPriceTaskController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置执行时间");
}
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
// 价格类型 1. 国标价 2. 油站价 3. 平台优惠 4. 油站直降
if (task.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) {
if (task.getRegionId() == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");
@ -96,9 +96,11 @@ public class HighGasOilPriceTaskController {
task.setRegionName(region.getRegionName());
}
// 价格类型 1. 国标价 2. 油站价 3. 优惠幅度
// 价格类型 1. 国标价 2. 油站价 3. 平台优惠 4. 油站直降
if (task.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus())
|| task.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) {
|| task.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())
|| task.getPriceType().equals(GasTaskPriceTypeEnum.type4.getStatus())
) {
if (task.getMerStoreId() == null) {
log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!","");

@ -90,7 +90,7 @@ public class HighOrderController {
// 1. 热敏打印机 2. 云打印机
if (printType == 2) {
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order);
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, true);
}
return ResponseMsgUtil.success("操作成功");

@ -19,6 +19,7 @@ import com.hai.config.CommonSysConst;
import com.hai.config.TuanYouConfig;
import com.hai.entity.*;
import com.hai.enum_type.DiscountUseScope;
import com.hai.enum_type.GasClassGroupTaskStatus;
import com.hai.model.GasPayPriceModel;
import com.hai.model.HighMerchantStoreModel;
import com.hai.model.HighUserModel;
@ -99,6 +100,9 @@ public class HighOrderController {
@Resource
private HighGasStaffService gasStaffService;
@Resource
private HighGasClassGroupTaskService gasClassGroupTaskService;
@RequestMapping(value="/addOrder",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "增加订单")
@ -271,6 +275,18 @@ public class HighOrderController {
}
}
// 查询加油站是否开启班组
Map<String, Object> classGroup = new HashMap<>();
classGroup.put("merchantStoreId", childOrder.getGoodsId());
classGroup.put("status", GasClassGroupTaskStatus.status1.getStatus());
List<HighGasClassGroupTask> groupTaskList = gasClassGroupTaskService.getGroupTaskList(classGroup);
if (groupTaskList.size() > 0) {
HighGasClassGroupTask groupTask = groupTaskList.get(0);
childOrder.setGasClassGroupId(groupTask.getGasClassGroupId());
childOrder.setGasClassGroupName(groupTask.getGasClassGroupName());
childOrder.setGasClassGroupTaskId(groupTask.getId());
}
// 查询门店
HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(childOrder.getGoodsId());
if (store == null) {
@ -305,7 +321,7 @@ public class HighOrderController {
childOrder.setGasOilLiters(priceModel.getOilLiters());
childOrder.setGasDiscount(priceModel.getDiscount());
childOrder.setExt1(priceModel.getPricePlatform().toString());
childOrder.setGasOilSubsidy(priceModel.getOilSubsidy());
childOrder.setGasOilSubsidy(priceModel.getPreferentialMargin());
childOrder.setGasLitersPreferences(priceModel.getLitersPreferences());
childOrder.setGasPricePreferences(priceModel.getPricePreferences());

File diff suppressed because one or more lines are too long

@ -374,7 +374,7 @@ public class UnionPayController {
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
new Thread(() -> {
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order);
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, false);
}).start();
}
}

@ -1,8 +1,13 @@
package com.hai.config;
import com.hai.common.utils.DateUtil;
import com.hai.model.GasClassGroupTaskDataCount;
import com.hai.model.GasClassGroupTaskOilCount;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
import java.util.Map;
/**
* 商鹏打印机模板
@ -10,28 +15,62 @@ import java.util.Date;
*/
public class SpPrinterTemplate {
/**
* 加油站收银员存根模板
*/
public static String classGroupCountTemp(GasClassGroupTaskDataCount dataCount, boolean makeUp) throws Exception {
String str = "<C>" + dataCount.getClassNum() + "班结流水" + (makeUp?"(补打)":"") + "</C> <BR> " +
"===============================<BR>" +
"开始时间:" + DateUtil.date2String(dataCount.getStartTime(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"结束时间:" + DateUtil.date2String(dataCount.getEndTime(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"<BR>" +
"加油金额汇总:" + dataCount.getRefuelPrice() + "元<BR>" +
"加油笔数汇总:" + dataCount.getRefuelNum() + "笔<BR>" +
"加油升数汇总:" + dataCount.getRefuelLiters() + "升<BR>" +
"<BR>" +
"退款金额汇总:" + dataCount.getRefundPrice() + "元<BR>" +
"退款笔数汇总:" + dataCount.getRefundNum() + "笔<BR>" +
"退款升数汇总:" + dataCount.getRefundLiters() + "升<BR>" +
"<BR>" +
"--------------收款-------------<BR>" +
"油号 金额(元) 升数 笔数<BR>";
String oilCountStr = "";
for (GasClassGroupTaskOilCount oilCount : dataCount.getGroupTaskOilCountList()) {
oilCountStr += oilCount.getOilNo() + "# " + oilCount.getRefuelPrice() + " " + oilCount.getRefuelLiters() + " " + oilCount.getRefuelNum() + "<BR>";
}
str += oilCountStr +
"================================<BR>" +
"<C>" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") +"</C> <BR>";
return str;
}
/**
* 加油站收银员存根模板
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @param receiptMap 小票配置
* @param makeUp 重复打印
* @return
*/
public static String oilCashierStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice) throws Exception {
String str = "<C><B>" + gasName + "</B></C> <BR> " +
String orderPrice,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
String str = "<C><L1>" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨森逛") + "</L1></C> <BR> " +
"<C><B>" + gasName + (makeUp?"(补打)":"") + "</B></C> <BR> " +
"<C>(收银员存根)</C> <BR>" +
"------------------------------<BR>" +
"流水:" + orderNo + "<BR>" +
@ -39,7 +78,7 @@ public class SpPrinterTemplate {
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"支付时间:" + payTime + "<BR>" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "<BR>" +
"来源:" + source + "<BR>" +
"来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "<BR>" +
"油枪:"+ gunNo + "号<BR>" +
"油品:" + oilNo + "#<BR>" +
"升数:" + oilLiters +"升<BR>" +
@ -48,7 +87,7 @@ public class SpPrinterTemplate {
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"------------------------------<BR>" +
"<C><B>开心又省钱; 来"嗨森逛"</B></C>";
"<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"") + "</B></C>";
return str;
}
@ -57,23 +96,26 @@ public class SpPrinterTemplate {
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @param receiptMap 小票配置
* @param makeUp 重复打印
* @return
*/
public static String oilClientStubTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice) throws Exception {
String str = "<C><B>" + gasName + "</B></C> <BR> " +
String orderPrice,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
String str = "<C><L1>" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨森逛") + "</L1></C> <BR> " +
"<C><B>" + gasName + (makeUp?"(补打)":"") + "</B></C> <BR> " +
"<C>(客户存根)</C> <BR>" +
"------------------------------<BR>" +
"流水:" + orderNo + "<BR>" +
@ -81,7 +123,7 @@ public class SpPrinterTemplate {
"打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "<BR>" +
"支付时间:" + payTime + "<BR>" +
"电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "<BR>" +
"来源:" + source + "<BR>" +
"来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "<BR>" +
"油枪:"+ gunNo + "号<BR>" +
"油品:" + oilNo + "#<BR>" +
"升数:" + oilLiters +"升<BR>" +
@ -90,7 +132,7 @@ public class SpPrinterTemplate {
"<L1>加油金额</L1><BR>" +
"<L1>¥" + orderPrice + "元</L1><BR>" +
"------------------------------<BR>" +
"<C><B>开心又省钱; 来"嗨森逛"</B></C>";
"<C><B>"+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"") + "</B></C>";
return str;
}

@ -1,9 +1,14 @@
package com.hai.config;
import com.hai.common.utils.DateUtil;
import com.hai.model.GasClassGroupTaskDataCount;
import com.hai.model.GasClassGroupTaskOilCount;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.ByteArrayOutputStream;
import java.util.Date;
import java.util.Map;
/**
* ZKC云打印机模板
@ -13,34 +18,18 @@ public class ZkcPrinterTemplate {
/**
* 加油站
* @param gasName 油站名称
* @param orderNo 订单号
* @param payTime 支付时间
* @param source 来源
* @param gunNo 抢号
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @return
*/
public static byte[] oilTemp(String gasName,
String orderNo,
String payTime,
String phone,
String source,
String gunNo,
String oilNo,
String oilLiters,
String orderPrice) throws Exception {
public static byte[] classGroupCountTemp(GasClassGroupTaskDataCount dataCount, boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write(gasName.getBytes("UTF-8"));
stream.write((dataCount.getClassNum() + "班结流水"+ (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("(收银员存根)".getBytes("UTF-8"));
stream.write("================================".getBytes("UTF-8"));
stream.write(0x0A);
// 左对齐
@ -48,140 +37,55 @@ public class ZkcPrinterTemplate {
stream.write(0x61);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("流水号:" + orderNo).getBytes("UTF-8"));
stream.write(("开始时间:" + DateUtil.date2String(dataCount.getStartTime(), "yyyy-MM-dd HH:mm:ss")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(("结束时间:" + DateUtil.date2String(dataCount.getEndTime(), "yyyy-MM-dd HH:mm:ss")).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(("加油金额汇总:" + dataCount.getRefuelPrice() + "元").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(("加油笔数汇总:" + dataCount.getRefuelNum() + "笔").getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(("加油升数汇总:" + dataCount.getRefuelLiters() + "升").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油品:" + oilNo).getBytes("UTF-8"));
stream.write(("退款金额汇总:" + dataCount.getRefundPrice() + "元").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));
stream.write(("退款笔数汇总:" + dataCount.getRefundNum() + "笔").getBytes("UTF-8"));
stream.write(0x0A);
stream.write("实际加油升数以加油机为准!".getBytes("UTF-8"));
stream.write(("退款升数汇总:" + dataCount.getRefundLiters() + "升").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("--------------收款--------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x21);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
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);
for (GasClassGroupTaskOilCount oilCount : dataCount.getGroupTaskOilCountList()) {
stream.write((oilCount.getOilNo() + "# " + oilCount.getRefuelPrice() + " " + oilCount.getRefuelLiters() + " " + oilCount.getRefuelNum()).getBytes("UTF-8"));
stream.write(0x0A);
}
stream.write("================================".getBytes("UTF-8"));
stream.write(0x0A);
// 居中
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write(gasName.getBytes("UTF-8"));
stream.write(0x0A);
stream.write("(客户存根)".getBytes("UTF-8"));
stream.write(0x0A);
// 左对齐
stream.write(0x1B);
stream.write(0x61);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("流水号:" + orderNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("支付时间:" + payTime).getBytes("UTF-8"));
stream.write(DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油品:" + oilNo).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));
stream.write(0x0A);
stream.write("实际加油升数以加油机为准!".getBytes("UTF-8"));
stream.write(0x0A);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x0E);
stream.write("加油金额".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("¥" + orderPrice).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x21);
stream.write(0x00);
stream.write("--------------------------------".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write("开心又省钱;来“ 嗨森逛 ”".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x0A);
return getPrinterBytes(stream.toByteArray(), 1, "UTF-8");
}
@ -195,6 +99,8 @@ public class ZkcPrinterTemplate {
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @param receiptMap 小票配置
* @param makeUp 重复打印
* @return
*/
public static byte[] oilCashierStubTemp(String gasName,
@ -205,14 +111,26 @@ public class ZkcPrinterTemplate {
String gunNo,
String oilNo,
String oilLiters,
String orderPrice) throws Exception {
String orderPrice,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write(gasName.getBytes("UTF-8"));
stream.write(0x1B);
stream.write(0x0E);
stream.write((StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨森逛").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x0A);
stream.write(0x1B);
stream.write(0x21);
stream.write(0x00);
stream.write((gasName + (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("(收银员存根)".getBytes("UTF-8"));
stream.write(0x0A);
@ -238,13 +156,13 @@ public class ZkcPrinterTemplate {
stream.write(("电话:" + phone.substring(0, 3) + "****" + phone.substring(7)).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(("来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo).getBytes("UTF-8"));
stream.write(("油枪:" + gunNo + "号").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油品:" + oilNo).getBytes("UTF-8"));
stream.write(("油品:" + oilNo + "#").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));
@ -273,7 +191,7 @@ public class ZkcPrinterTemplate {
stream.write(0x1B);
stream.write(0x61);
stream.write(0x01);
stream.write("开心又省钱;来“ 嗨森逛 ”".getBytes("UTF-8"));
stream.write((StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(0x0A);
@ -294,6 +212,8 @@ public class ZkcPrinterTemplate {
* @param oilNo 油号
* @param oilLiters 升数
* @param orderPrice 加油金额
* @param receiptMap 小票配置
* @param makeUp 重复打印
* @return
*/
public static byte[] oilClientStubTemp(String gasName,
@ -304,7 +224,9 @@ public class ZkcPrinterTemplate {
String gunNo,
String oilNo,
String oilLiters,
String orderPrice) throws Exception {
String orderPrice,
Map<String, Object> receiptMap,
boolean makeUp) throws Exception {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
// 居中
@ -312,7 +234,7 @@ public class ZkcPrinterTemplate {
stream.write(0x61);
stream.write(0x01);
stream.write(gasName.getBytes("UTF-8"));
stream.write((gasName + (makeUp?"(补打)":"")).getBytes("UTF-8"));
stream.write(0x0A);
stream.write("(客户存根)".getBytes("UTF-8"));
stream.write(0x0A);
@ -341,10 +263,10 @@ public class ZkcPrinterTemplate {
stream.write("来源:嗨森逛".getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油枪:" + gunNo).getBytes("UTF-8"));
stream.write(("油枪:" + gunNo + "号").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("油品:" + oilNo).getBytes("UTF-8"));
stream.write(("油品:" + oilNo + "#").getBytes("UTF-8"));
stream.write(0x0A);
stream.write(("升数:" + oilLiters + "升").getBytes("UTF-8"));

@ -54,13 +54,14 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
"gas_price_vip, gas_price_official, ",
"gas_oil_liters, gas_discount, ",
"gas_oil_subsidy, gas_liters_preferences, ",
"gas_price_preferences, gas_staff_id, ",
"gas_staff_name, gas_salesman_id, ",
"gas_salesman_name, gas_agent_id, ",
"gas_agent_name, gas_org_id, ",
"gas_org_name, ext_1, ",
"ext_2, ext_3, ext_4, ",
"ext_5, ext_6)",
"gas_price_preferences, gas_class_group_id, ",
"gas_class_group_name, gas_class_group_task_id, ",
"gas_staff_id, gas_staff_name, ",
"gas_salesman_id, gas_salesman_name, ",
"gas_agent_id, gas_agent_name, ",
"gas_org_id, gas_org_name, ",
"ext_1, ext_2, ext_3, ",
"ext_4, ext_5, ext_6)",
"values (#{orderId,jdbcType=BIGINT}, #{memId,jdbcType=BIGINT}, ",
"#{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
"#{storeAddress,jdbcType=VARCHAR}, #{goodsType,jdbcType=INTEGER}, ",
@ -76,13 +77,14 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
"#{gasPriceVip,jdbcType=DECIMAL}, #{gasPriceOfficial,jdbcType=DECIMAL}, ",
"#{gasOilLiters,jdbcType=DECIMAL}, #{gasDiscount,jdbcType=DECIMAL}, ",
"#{gasOilSubsidy,jdbcType=DECIMAL}, #{gasLitersPreferences,jdbcType=DECIMAL}, ",
"#{gasPricePreferences,jdbcType=DECIMAL}, #{gasStaffId,jdbcType=BIGINT}, ",
"#{gasStaffName,jdbcType=VARCHAR}, #{gasSalesmanId,jdbcType=BIGINT}, ",
"#{gasSalesmanName,jdbcType=VARCHAR}, #{gasAgentId,jdbcType=BIGINT}, ",
"#{gasAgentName,jdbcType=VARCHAR}, #{gasOrgId,jdbcType=BIGINT}, ",
"#{gasOrgName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR}, ",
"#{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})"
"#{gasPricePreferences,jdbcType=DECIMAL}, #{gasClassGroupId,jdbcType=BIGINT}, ",
"#{gasClassGroupName,jdbcType=VARCHAR}, #{gasClassGroupTaskId,jdbcType=BIGINT}, ",
"#{gasStaffId,jdbcType=BIGINT}, #{gasStaffName,jdbcType=VARCHAR}, ",
"#{gasSalesmanId,jdbcType=BIGINT}, #{gasSalesmanName,jdbcType=VARCHAR}, ",
"#{gasAgentId,jdbcType=BIGINT}, #{gasAgentName,jdbcType=VARCHAR}, ",
"#{gasOrgId,jdbcType=BIGINT}, #{gasOrgName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
"#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighChildOrder record);
@ -125,6 +127,9 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
@Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_liters_preferences", property="gasLitersPreferences", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_preferences", property="gasPricePreferences", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_class_group_id", property="gasClassGroupId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_class_group_name", property="gasClassGroupName", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_class_group_task_id", property="gasClassGroupTaskId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_salesman_id", property="gasSalesmanId", jdbcType=JdbcType.BIGINT),
@ -149,9 +154,10 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
"sale_count, total_price, giveaway_type, child_orde_status, praise_status, gas_oil_no, ",
"gas_gun_no, gas_oil_type, gas_order_no, gas_price_platform, gas_price_gun, gas_price_vip, ",
"gas_price_official, gas_oil_liters, gas_discount, gas_oil_subsidy, gas_liters_preferences, ",
"gas_price_preferences, gas_staff_id, gas_staff_name, gas_salesman_id, gas_salesman_name, ",
"gas_agent_id, gas_agent_name, gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ",
"ext_4, ext_5, ext_6",
"gas_price_preferences, gas_class_group_id, gas_class_group_name, gas_class_group_task_id, ",
"gas_staff_id, gas_staff_name, gas_salesman_id, gas_salesman_name, gas_agent_id, ",
"gas_agent_name, gas_org_id, gas_org_name, ext_1, ext_2, ext_3, ext_4, ext_5, ",
"ext_6",
"from high_child_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -188,6 +194,9 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
@Result(column="gas_oil_subsidy", property="gasOilSubsidy", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_liters_preferences", property="gasLitersPreferences", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_price_preferences", property="gasPricePreferences", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_class_group_id", property="gasClassGroupId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_class_group_name", property="gasClassGroupName", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_class_group_task_id", property="gasClassGroupTaskId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_id", property="gasStaffId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_staff_name", property="gasStaffName", jdbcType=JdbcType.VARCHAR),
@Result(column="gas_salesman_id", property="gasSalesmanId", jdbcType=JdbcType.BIGINT),
@ -247,6 +256,9 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt {
"gas_oil_subsidy = #{gasOilSubsidy,jdbcType=DECIMAL},",
"gas_liters_preferences = #{gasLitersPreferences,jdbcType=DECIMAL},",
"gas_price_preferences = #{gasPricePreferences,jdbcType=DECIMAL},",
"gas_class_group_id = #{gasClassGroupId,jdbcType=BIGINT},",
"gas_class_group_name = #{gasClassGroupName,jdbcType=VARCHAR},",
"gas_class_group_task_id = #{gasClassGroupTaskId,jdbcType=BIGINT},",
"gas_staff_id = #{gasStaffId,jdbcType=BIGINT},",
"gas_staff_name = #{gasStaffName,jdbcType=VARCHAR},",
"gas_salesman_id = #{gasSalesmanId,jdbcType=BIGINT},",

@ -152,6 +152,18 @@ public class HighChildOrderSqlProvider {
sql.VALUES("gas_price_preferences", "#{gasPricePreferences,jdbcType=DECIMAL}");
}
if (record.getGasClassGroupId() != null) {
sql.VALUES("gas_class_group_id", "#{gasClassGroupId,jdbcType=BIGINT}");
}
if (record.getGasClassGroupName() != null) {
sql.VALUES("gas_class_group_name", "#{gasClassGroupName,jdbcType=VARCHAR}");
}
if (record.getGasClassGroupTaskId() != null) {
sql.VALUES("gas_class_group_task_id", "#{gasClassGroupTaskId,jdbcType=BIGINT}");
}
if (record.getGasStaffId() != null) {
sql.VALUES("gas_staff_id", "#{gasStaffId,jdbcType=BIGINT}");
}
@ -249,6 +261,9 @@ public class HighChildOrderSqlProvider {
sql.SELECT("gas_oil_subsidy");
sql.SELECT("gas_liters_preferences");
sql.SELECT("gas_price_preferences");
sql.SELECT("gas_class_group_id");
sql.SELECT("gas_class_group_name");
sql.SELECT("gas_class_group_task_id");
sql.SELECT("gas_staff_id");
sql.SELECT("gas_staff_name");
sql.SELECT("gas_salesman_id");
@ -408,6 +423,18 @@ public class HighChildOrderSqlProvider {
sql.SET("gas_price_preferences = #{record.gasPricePreferences,jdbcType=DECIMAL}");
}
if (record.getGasClassGroupId() != null) {
sql.SET("gas_class_group_id = #{record.gasClassGroupId,jdbcType=BIGINT}");
}
if (record.getGasClassGroupName() != null) {
sql.SET("gas_class_group_name = #{record.gasClassGroupName,jdbcType=VARCHAR}");
}
if (record.getGasClassGroupTaskId() != null) {
sql.SET("gas_class_group_task_id = #{record.gasClassGroupTaskId,jdbcType=BIGINT}");
}
if (record.getGasStaffId() != null) {
sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}");
}
@ -504,6 +531,9 @@ public class HighChildOrderSqlProvider {
sql.SET("gas_oil_subsidy = #{record.gasOilSubsidy,jdbcType=DECIMAL}");
sql.SET("gas_liters_preferences = #{record.gasLitersPreferences,jdbcType=DECIMAL}");
sql.SET("gas_price_preferences = #{record.gasPricePreferences,jdbcType=DECIMAL}");
sql.SET("gas_class_group_id = #{record.gasClassGroupId,jdbcType=BIGINT}");
sql.SET("gas_class_group_name = #{record.gasClassGroupName,jdbcType=VARCHAR}");
sql.SET("gas_class_group_task_id = #{record.gasClassGroupTaskId,jdbcType=BIGINT}");
sql.SET("gas_staff_id = #{record.gasStaffId,jdbcType=BIGINT}");
sql.SET("gas_staff_name = #{record.gasStaffName,jdbcType=VARCHAR}");
sql.SET("gas_salesman_id = #{record.gasSalesmanId,jdbcType=BIGINT}");
@ -652,6 +682,18 @@ public class HighChildOrderSqlProvider {
sql.SET("gas_price_preferences = #{gasPricePreferences,jdbcType=DECIMAL}");
}
if (record.getGasClassGroupId() != null) {
sql.SET("gas_class_group_id = #{gasClassGroupId,jdbcType=BIGINT}");
}
if (record.getGasClassGroupName() != null) {
sql.SET("gas_class_group_name = #{gasClassGroupName,jdbcType=VARCHAR}");
}
if (record.getGasClassGroupTaskId() != null) {
sql.SET("gas_class_group_task_id = #{gasClassGroupTaskId,jdbcType=BIGINT}");
}
if (record.getGasStaffId() != null) {
sql.SET("gas_staff_id = #{gasStaffId,jdbcType=BIGINT}");
}

@ -45,18 +45,20 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
"mer_store_name, device_name, ",
"device_sn, device_key, ",
"device_imei, device_iccid, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"receipt_top, receipt_source, ",
"receipt_bottom, `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})"
"#{receiptTop,jdbcType=VARCHAR}, #{receiptSource,jdbcType=VARCHAR}, ",
"#{receiptBottom,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);
@ -80,6 +82,9 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
@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="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_bottom", property="receiptBottom", 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),
@ -92,8 +97,9 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
@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",
"device_name, device_sn, device_key, device_imei, device_iccid, receipt_top, ",
"receipt_source, receipt_bottom, `status`, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from high_device",
"where id = #{id,jdbcType=BIGINT}"
})
@ -111,6 +117,9 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
@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="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR),
@Result(column="receipt_bottom", property="receiptBottom", 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),
@ -143,6 +152,9 @@ public interface HighDeviceMapper extends HighDeviceMapperExt {
"device_key = #{deviceKey,jdbcType=VARCHAR},",
"device_imei = #{deviceImei,jdbcType=VARCHAR},",
"device_iccid = #{deviceIccid,jdbcType=VARCHAR},",
"receipt_top = #{receiptTop,jdbcType=VARCHAR},",
"receipt_source = #{receiptSource,jdbcType=VARCHAR},",
"receipt_bottom = #{receiptBottom,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",

@ -76,6 +76,18 @@ public class HighDeviceSqlProvider {
sql.VALUES("device_iccid", "#{deviceIccid,jdbcType=VARCHAR}");
}
if (record.getReceiptTop() != null) {
sql.VALUES("receipt_top", "#{receiptTop,jdbcType=VARCHAR}");
}
if (record.getReceiptSource() != null) {
sql.VALUES("receipt_source", "#{receiptSource,jdbcType=VARCHAR}");
}
if (record.getReceiptBottom() != null) {
sql.VALUES("receipt_bottom", "#{receiptBottom,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -122,6 +134,9 @@ public class HighDeviceSqlProvider {
sql.SELECT("device_key");
sql.SELECT("device_imei");
sql.SELECT("device_iccid");
sql.SELECT("receipt_top");
sql.SELECT("receipt_source");
sql.SELECT("receipt_bottom");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
@ -197,6 +212,18 @@ public class HighDeviceSqlProvider {
sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}");
}
if (record.getReceiptTop() != null) {
sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}");
}
if (record.getReceiptSource() != null) {
sql.SET("receipt_source = #{record.receiptSource,jdbcType=VARCHAR}");
}
if (record.getReceiptBottom() != null) {
sql.SET("receipt_bottom = #{record.receiptBottom,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -242,6 +269,9 @@ public class HighDeviceSqlProvider {
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("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}");
sql.SET("receipt_source = #{record.receiptSource,jdbcType=VARCHAR}");
sql.SET("receipt_bottom = #{record.receiptBottom,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}");
@ -306,6 +336,18 @@ public class HighDeviceSqlProvider {
sql.SET("device_iccid = #{deviceIccid,jdbcType=VARCHAR}");
}
if (record.getReceiptTop() != null) {
sql.SET("receipt_top = #{receiptTop,jdbcType=VARCHAR}");
}
if (record.getReceiptSource() != null) {
sql.SET("receipt_source = #{receiptSource,jdbcType=VARCHAR}");
}
if (record.getReceiptBottom() != null) {
sql.SET("receipt_bottom = #{receiptBottom,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -0,0 +1,125 @@
package com.hai.dao;
import com.hai.entity.HighGasClassGroup;
import com.hai.entity.HighGasClassGroupExample;
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 HighGasClassGroupMapper extends HighGasClassGroupMapperExt {
@SelectProvider(type=HighGasClassGroupSqlProvider.class, method="countByExample")
long countByExample(HighGasClassGroupExample example);
@DeleteProvider(type=HighGasClassGroupSqlProvider.class, method="deleteByExample")
int deleteByExample(HighGasClassGroupExample example);
@Delete({
"delete from high_gas_class_group",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_gas_class_group (merchant_store_id, merchant_store_name, ",
"`name`, principal_name, ",
"principal_phone, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merchantStoreId,jdbcType=BIGINT}, #{merchantStoreName,jdbcType=VARCHAR}, ",
"#{name,jdbcType=VARCHAR}, #{principalName,jdbcType=VARCHAR}, ",
"#{principalPhone,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(HighGasClassGroup record);
@InsertProvider(type=HighGasClassGroupSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighGasClassGroup record);
@SelectProvider(type=HighGasClassGroupSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="merchant_store_name", property="merchantStoreName", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="principal_name", property="principalName", jdbcType=JdbcType.VARCHAR),
@Result(column="principal_phone", property="principalPhone", 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<HighGasClassGroup> selectByExample(HighGasClassGroupExample example);
@Select({
"select",
"id, merchant_store_id, merchant_store_name, `name`, principal_name, principal_phone, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from high_gas_class_group",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="merchant_store_name", property="merchantStoreName", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="principal_name", property="principalName", jdbcType=JdbcType.VARCHAR),
@Result(column="principal_phone", property="principalPhone", 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)
})
HighGasClassGroup selectByPrimaryKey(Long id);
@UpdateProvider(type=HighGasClassGroupSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighGasClassGroup record, @Param("example") HighGasClassGroupExample example);
@UpdateProvider(type=HighGasClassGroupSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighGasClassGroup record, @Param("example") HighGasClassGroupExample example);
@UpdateProvider(type=HighGasClassGroupSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(HighGasClassGroup record);
@Update({
"update high_gas_class_group",
"set merchant_store_id = #{merchantStoreId,jdbcType=BIGINT},",
"merchant_store_name = #{merchantStoreName,jdbcType=VARCHAR},",
"`name` = #{name,jdbcType=VARCHAR},",
"principal_name = #{principalName,jdbcType=VARCHAR},",
"principal_phone = #{principalPhone,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(HighGasClassGroup record);
}

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

@ -0,0 +1,332 @@
package com.hai.dao;
import com.hai.entity.HighGasClassGroup;
import com.hai.entity.HighGasClassGroupExample.Criteria;
import com.hai.entity.HighGasClassGroupExample.Criterion;
import com.hai.entity.HighGasClassGroupExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighGasClassGroupSqlProvider {
public String countByExample(HighGasClassGroupExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_gas_class_group");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighGasClassGroupExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_gas_class_group");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighGasClassGroup record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_gas_class_group");
if (record.getMerchantStoreId() != null) {
sql.VALUES("merchant_store_id", "#{merchantStoreId,jdbcType=BIGINT}");
}
if (record.getMerchantStoreName() != null) {
sql.VALUES("merchant_store_name", "#{merchantStoreName,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
}
if (record.getPrincipalName() != null) {
sql.VALUES("principal_name", "#{principalName,jdbcType=VARCHAR}");
}
if (record.getPrincipalPhone() != null) {
sql.VALUES("principal_phone", "#{principalPhone,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(HighGasClassGroupExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("merchant_store_id");
sql.SELECT("merchant_store_name");
sql.SELECT("`name`");
sql.SELECT("principal_name");
sql.SELECT("principal_phone");
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_gas_class_group");
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) {
HighGasClassGroup record = (HighGasClassGroup) parameter.get("record");
HighGasClassGroupExample example = (HighGasClassGroupExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_gas_class_group");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMerchantStoreId() != null) {
sql.SET("merchant_store_id = #{record.merchantStoreId,jdbcType=BIGINT}");
}
if (record.getMerchantStoreName() != null) {
sql.SET("merchant_store_name = #{record.merchantStoreName,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
}
if (record.getPrincipalName() != null) {
sql.SET("principal_name = #{record.principalName,jdbcType=VARCHAR}");
}
if (record.getPrincipalPhone() != null) {
sql.SET("principal_phone = #{record.principalPhone,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_gas_class_group");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("merchant_store_id = #{record.merchantStoreId,jdbcType=BIGINT}");
sql.SET("merchant_store_name = #{record.merchantStoreName,jdbcType=VARCHAR}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("principal_name = #{record.principalName,jdbcType=VARCHAR}");
sql.SET("principal_phone = #{record.principalPhone,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}");
HighGasClassGroupExample example = (HighGasClassGroupExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(HighGasClassGroup record) {
SQL sql = new SQL();
sql.UPDATE("high_gas_class_group");
if (record.getMerchantStoreId() != null) {
sql.SET("merchant_store_id = #{merchantStoreId,jdbcType=BIGINT}");
}
if (record.getMerchantStoreName() != null) {
sql.SET("merchant_store_name = #{merchantStoreName,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{name,jdbcType=VARCHAR}");
}
if (record.getPrincipalName() != null) {
sql.SET("principal_name = #{principalName,jdbcType=VARCHAR}");
}
if (record.getPrincipalPhone() != null) {
sql.SET("principal_phone = #{principalPhone,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, HighGasClassGroupExample 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());
}
}
}

@ -0,0 +1,139 @@
package com.hai.dao;
import com.hai.entity.HighGasClassGroupTask;
import com.hai.entity.HighGasClassGroupTaskExample;
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 HighGasClassGroupTaskMapper extends HighGasClassGroupTaskMapperExt {
@SelectProvider(type=HighGasClassGroupTaskSqlProvider.class, method="countByExample")
long countByExample(HighGasClassGroupTaskExample example);
@DeleteProvider(type=HighGasClassGroupTaskSqlProvider.class, method="deleteByExample")
int deleteByExample(HighGasClassGroupTaskExample example);
@Delete({
"delete from high_gas_class_group_task",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_gas_class_group_task (gas_class_group_id, gas_class_group_name, ",
"merchant_store_id, merchant_store_name, ",
"class_num, start_time, ",
"end_time, data_count, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{gasClassGroupId,jdbcType=BIGINT}, #{gasClassGroupName,jdbcType=VARCHAR}, ",
"#{merchantStoreId,jdbcType=BIGINT}, #{merchantStoreName,jdbcType=VARCHAR}, ",
"#{classNum,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, ",
"#{endTime,jdbcType=TIMESTAMP}, #{dataCount,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(HighGasClassGroupTask record);
@InsertProvider(type=HighGasClassGroupTaskSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(HighGasClassGroupTask record);
@SelectProvider(type=HighGasClassGroupTaskSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="gas_class_group_id", property="gasClassGroupId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_class_group_name", property="gasClassGroupName", jdbcType=JdbcType.VARCHAR),
@Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="merchant_store_name", property="merchantStoreName", jdbcType=JdbcType.VARCHAR),
@Result(column="class_num", property="classNum", jdbcType=JdbcType.INTEGER),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="data_count", property="dataCount", 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<HighGasClassGroupTask> selectByExample(HighGasClassGroupTaskExample example);
@Select({
"select",
"id, gas_class_group_id, gas_class_group_name, merchant_store_id, merchant_store_name, ",
"class_num, start_time, end_time, data_count, `status`, create_time, update_time, ",
"ext_1, ext_2, ext_3",
"from high_gas_class_group_task",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="gas_class_group_id", property="gasClassGroupId", jdbcType=JdbcType.BIGINT),
@Result(column="gas_class_group_name", property="gasClassGroupName", jdbcType=JdbcType.VARCHAR),
@Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="merchant_store_name", property="merchantStoreName", jdbcType=JdbcType.VARCHAR),
@Result(column="class_num", property="classNum", jdbcType=JdbcType.INTEGER),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="data_count", property="dataCount", 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)
})
HighGasClassGroupTask selectByPrimaryKey(Long id);
@UpdateProvider(type=HighGasClassGroupTaskSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") HighGasClassGroupTask record, @Param("example") HighGasClassGroupTaskExample example);
@UpdateProvider(type=HighGasClassGroupTaskSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") HighGasClassGroupTask record, @Param("example") HighGasClassGroupTaskExample example);
@UpdateProvider(type=HighGasClassGroupTaskSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(HighGasClassGroupTask record);
@Update({
"update high_gas_class_group_task",
"set gas_class_group_id = #{gasClassGroupId,jdbcType=BIGINT},",
"gas_class_group_name = #{gasClassGroupName,jdbcType=VARCHAR},",
"merchant_store_id = #{merchantStoreId,jdbcType=BIGINT},",
"merchant_store_name = #{merchantStoreName,jdbcType=VARCHAR},",
"class_num = #{classNum,jdbcType=INTEGER},",
"start_time = #{startTime,jdbcType=TIMESTAMP},",
"end_time = #{endTime,jdbcType=TIMESTAMP},",
"data_count = #{dataCount,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(HighGasClassGroupTask record);
}

@ -0,0 +1,62 @@
package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface HighGasClassGroupTaskMapperExt {
@Select("<script>" +
" select " +
" case when SUM(a.total_price) is not null then SUM(a.total_price) else 0 end refuelPrice," +
" COUNT(1) refuelNum," +
" case when SUM(a.gas_oil_liters) is not null then SUM(a.gas_oil_liters) else 0 end refuelLiters" +
" from high_child_order a" +
" LEFT JOIN high_order b on b.id = a.order_id" +
" where a.goods_type = 3 " +
" and a.gas_class_group_task_id = #{gasClassGroupTaskId} " +
" and b.order_status in (2,3)" +
"</script>")
Map<String, Object> countRefuelData(@Param("gasClassGroupTaskId") Long gasClassGroupTaskId);
@Select("<script>" +
" select" +
" case when SUM(a.total_price) is not null then SUM(a.total_price) else 0 end refundPrice," +
" COUNT(1) refundNum," +
" case when SUM(a.gas_oil_liters) is not null then SUM(a.gas_oil_liters) else 0 end refundLiters" +
" from high_child_order a" +
" LEFT JOIN high_order b on b.id = a.order_id" +
" where a.goods_type = 3 " +
" and a.gas_class_group_task_id = #{gasClassGroupTaskId}" +
" and b.order_status in (4)" +
"</script>")
Map<String, Object> countRefundData(@Param("gasClassGroupTaskId") Long gasClassGroupTaskId);
@Select("<script>" +
" SELECT" +
" a.oil_no oilNo," +
" case when b.refuelPrice is not null then b.refuelPrice else 0 end refuelPrice," +
" case when b.refuelNum is not null then b.refuelNum else 0 end refuelNum," +
" case when b.refuelLiters is not null then b.refuelLiters else 0 end refuelLiters" +
" FROM" +
" high_gas_oil_price a " +
" LEFT JOIN (select gas_oil_no," +
" case when SUM(a.total_price) is not null then SUM(a.total_price) else 0 end refuelPrice," +
" COUNT(1) refuelNum," +
" case when SUM(a.gas_oil_liters) is not null then SUM(a.gas_oil_liters) else 0 end refuelLiters" +
" from high_child_order a" +
" LEFT JOIN high_order b on b.id = a.order_id" +
" where a.gas_class_group_task_id = #{gasClassGroupTaskId} and a.goods_type = 3 and b.order_status in (2,3)" +
" GROUP BY a.gas_oil_no) b on b.gas_oil_no = a.oil_no" +
" WHERE a.merchant_store_id = #{gasId} and <![CDATA[ `status` <> 0 ]]> " +
"</script>")
List<Map<String, Object>> countOilData(@Param("gasId") Long gasId, @Param("gasClassGroupTaskId") Long gasClassGroupTaskId);
@Select("select count(1) from high_gas_class_group_task where merchant_store_id = #{gasId} and `status` <> 0")
int getLatestClassNum(@Param("gasId") Long gasId);
}

@ -0,0 +1,374 @@
package com.hai.dao;
import com.hai.entity.HighGasClassGroupTask;
import com.hai.entity.HighGasClassGroupTaskExample.Criteria;
import com.hai.entity.HighGasClassGroupTaskExample.Criterion;
import com.hai.entity.HighGasClassGroupTaskExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class HighGasClassGroupTaskSqlProvider {
public String countByExample(HighGasClassGroupTaskExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("high_gas_class_group_task");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(HighGasClassGroupTaskExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("high_gas_class_group_task");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(HighGasClassGroupTask record) {
SQL sql = new SQL();
sql.INSERT_INTO("high_gas_class_group_task");
if (record.getGasClassGroupId() != null) {
sql.VALUES("gas_class_group_id", "#{gasClassGroupId,jdbcType=BIGINT}");
}
if (record.getGasClassGroupName() != null) {
sql.VALUES("gas_class_group_name", "#{gasClassGroupName,jdbcType=VARCHAR}");
}
if (record.getMerchantStoreId() != null) {
sql.VALUES("merchant_store_id", "#{merchantStoreId,jdbcType=BIGINT}");
}
if (record.getMerchantStoreName() != null) {
sql.VALUES("merchant_store_name", "#{merchantStoreName,jdbcType=VARCHAR}");
}
if (record.getClassNum() != null) {
sql.VALUES("class_num", "#{classNum,jdbcType=INTEGER}");
}
if (record.getStartTime() != null) {
sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}");
}
if (record.getEndTime() != null) {
sql.VALUES("end_time", "#{endTime,jdbcType=TIMESTAMP}");
}
if (record.getDataCount() != null) {
sql.VALUES("data_count", "#{dataCount,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(HighGasClassGroupTaskExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("gas_class_group_id");
sql.SELECT("gas_class_group_name");
sql.SELECT("merchant_store_id");
sql.SELECT("merchant_store_name");
sql.SELECT("class_num");
sql.SELECT("start_time");
sql.SELECT("end_time");
sql.SELECT("data_count");
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_gas_class_group_task");
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) {
HighGasClassGroupTask record = (HighGasClassGroupTask) parameter.get("record");
HighGasClassGroupTaskExample example = (HighGasClassGroupTaskExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("high_gas_class_group_task");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getGasClassGroupId() != null) {
sql.SET("gas_class_group_id = #{record.gasClassGroupId,jdbcType=BIGINT}");
}
if (record.getGasClassGroupName() != null) {
sql.SET("gas_class_group_name = #{record.gasClassGroupName,jdbcType=VARCHAR}");
}
if (record.getMerchantStoreId() != null) {
sql.SET("merchant_store_id = #{record.merchantStoreId,jdbcType=BIGINT}");
}
if (record.getMerchantStoreName() != null) {
sql.SET("merchant_store_name = #{record.merchantStoreName,jdbcType=VARCHAR}");
}
if (record.getClassNum() != null) {
sql.SET("class_num = #{record.classNum,jdbcType=INTEGER}");
}
if (record.getStartTime() != null) {
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
}
if (record.getEndTime() != null) {
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}");
}
if (record.getDataCount() != null) {
sql.SET("data_count = #{record.dataCount,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_gas_class_group_task");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("gas_class_group_id = #{record.gasClassGroupId,jdbcType=BIGINT}");
sql.SET("gas_class_group_name = #{record.gasClassGroupName,jdbcType=VARCHAR}");
sql.SET("merchant_store_id = #{record.merchantStoreId,jdbcType=BIGINT}");
sql.SET("merchant_store_name = #{record.merchantStoreName,jdbcType=VARCHAR}");
sql.SET("class_num = #{record.classNum,jdbcType=INTEGER}");
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}");
sql.SET("data_count = #{record.dataCount,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}");
HighGasClassGroupTaskExample example = (HighGasClassGroupTaskExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(HighGasClassGroupTask record) {
SQL sql = new SQL();
sql.UPDATE("high_gas_class_group_task");
if (record.getGasClassGroupId() != null) {
sql.SET("gas_class_group_id = #{gasClassGroupId,jdbcType=BIGINT}");
}
if (record.getGasClassGroupName() != null) {
sql.SET("gas_class_group_name = #{gasClassGroupName,jdbcType=VARCHAR}");
}
if (record.getMerchantStoreId() != null) {
sql.SET("merchant_store_id = #{merchantStoreId,jdbcType=BIGINT}");
}
if (record.getMerchantStoreName() != null) {
sql.SET("merchant_store_name = #{merchantStoreName,jdbcType=VARCHAR}");
}
if (record.getClassNum() != null) {
sql.SET("class_num = #{classNum,jdbcType=INTEGER}");
}
if (record.getStartTime() != null) {
sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}");
}
if (record.getEndTime() != null) {
sql.SET("end_time = #{endTime,jdbcType=TIMESTAMP}");
}
if (record.getDataCount() != null) {
sql.SET("data_count = #{dataCount,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, HighGasClassGroupTaskExample 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());
}
}
}

@ -41,16 +41,18 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Insert({
"insert into high_gas_oil_price (merchant_store_id, oil_no, ",
"oil_no_name, preferential_margin, ",
"price_vip, price_gun, ",
"price_official, oil_type, ",
"oil_type_name, `status`, ",
"ext_1, ext_2, ext_3)",
"gas_station_drop, price_vip, ",
"price_gun, price_official, ",
"oil_type, oil_type_name, ",
"`status`, ext_1, ext_2, ",
"ext_3)",
"values (#{merchantStoreId,jdbcType=BIGINT}, #{oilNo,jdbcType=INTEGER}, ",
"#{oilNoName,jdbcType=VARCHAR}, #{preferentialMargin,jdbcType=DECIMAL}, ",
"#{priceVip,jdbcType=DECIMAL}, #{priceGun,jdbcType=DECIMAL}, ",
"#{priceOfficial,jdbcType=DECIMAL}, #{oilType,jdbcType=INTEGER}, ",
"#{oilTypeName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{gasStationDrop,jdbcType=DECIMAL}, #{priceVip,jdbcType=DECIMAL}, ",
"#{priceGun,jdbcType=DECIMAL}, #{priceOfficial,jdbcType=DECIMAL}, ",
"#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighGasOilPrice record);
@ -66,6 +68,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_station_drop", property="gasStationDrop", jdbcType=JdbcType.DECIMAL),
@Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@ -80,9 +83,9 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Select({
"select",
"id, merchant_store_id, oil_no, oil_no_name, preferential_margin, price_vip, ",
"price_gun, price_official, oil_type, oil_type_name, `status`, ext_1, ext_2, ",
"ext_3",
"id, merchant_store_id, oil_no, oil_no_name, preferential_margin, gas_station_drop, ",
"price_vip, price_gun, price_official, oil_type, oil_type_name, `status`, ext_1, ",
"ext_2, ext_3",
"from high_gas_oil_price",
"where id = #{id,jdbcType=BIGINT}"
})
@ -92,6 +95,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_station_drop", property="gasStationDrop", jdbcType=JdbcType.DECIMAL),
@Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@ -119,6 +123,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
"oil_no = #{oilNo,jdbcType=INTEGER},",
"oil_no_name = #{oilNoName,jdbcType=VARCHAR},",
"preferential_margin = #{preferentialMargin,jdbcType=DECIMAL},",
"gas_station_drop = #{gasStationDrop,jdbcType=DECIMAL},",
"price_vip = #{priceVip,jdbcType=DECIMAL},",
"price_gun = #{priceGun,jdbcType=DECIMAL},",
"price_official = #{priceOfficial,jdbcType=DECIMAL},",

@ -49,11 +49,12 @@ public interface HighGasOilPriceMapperExt {
" and a.region_id = #{regionId} " +
" and b.oil_no = #{oilNo} "})
@Results({
@Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true),
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL),
@Result(column="gas_station_drop", property="gasStationDrop", jdbcType=JdbcType.DECIMAL),
@Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL),
@Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL),
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),

@ -44,6 +44,10 @@ public class HighGasOilPriceSqlProvider {
sql.VALUES("preferential_margin", "#{preferentialMargin,jdbcType=DECIMAL}");
}
if (record.getGasStationDrop() != null) {
sql.VALUES("gas_station_drop", "#{gasStationDrop,jdbcType=DECIMAL}");
}
if (record.getPriceVip() != null) {
sql.VALUES("price_vip", "#{priceVip,jdbcType=DECIMAL}");
}
@ -94,6 +98,7 @@ public class HighGasOilPriceSqlProvider {
sql.SELECT("oil_no");
sql.SELECT("oil_no_name");
sql.SELECT("preferential_margin");
sql.SELECT("gas_station_drop");
sql.SELECT("price_vip");
sql.SELECT("price_gun");
sql.SELECT("price_official");
@ -140,6 +145,10 @@ public class HighGasOilPriceSqlProvider {
sql.SET("preferential_margin = #{record.preferentialMargin,jdbcType=DECIMAL}");
}
if (record.getGasStationDrop() != null) {
sql.SET("gas_station_drop = #{record.gasStationDrop,jdbcType=DECIMAL}");
}
if (record.getPriceVip() != null) {
sql.SET("price_vip = #{record.priceVip,jdbcType=DECIMAL}");
}
@ -189,6 +198,7 @@ public class HighGasOilPriceSqlProvider {
sql.SET("oil_no = #{record.oilNo,jdbcType=INTEGER}");
sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}");
sql.SET("preferential_margin = #{record.preferentialMargin,jdbcType=DECIMAL}");
sql.SET("gas_station_drop = #{record.gasStationDrop,jdbcType=DECIMAL}");
sql.SET("price_vip = #{record.priceVip,jdbcType=DECIMAL}");
sql.SET("price_gun = #{record.priceGun,jdbcType=DECIMAL}");
sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}");
@ -224,6 +234,10 @@ public class HighGasOilPriceSqlProvider {
sql.SET("preferential_margin = #{preferentialMargin,jdbcType=DECIMAL}");
}
if (record.getGasStationDrop() != null) {
sql.SET("gas_station_drop = #{gasStationDrop,jdbcType=DECIMAL}");
}
if (record.getPriceVip() != null) {
sql.SET("price_vip = #{priceVip,jdbcType=DECIMAL}");
}

@ -173,6 +173,21 @@ public class HighChildOrder implements Serializable {
*/
private BigDecimal gasPricePreferences;
/**
* 加油站班组id
*/
private Long gasClassGroupId;
/**
* 加油站班组名称
*/
private String gasClassGroupName;
/**
* 加油站班组任务id
*/
private Long gasClassGroupTaskId;
/**
* 加油站加油员id
*/
@ -483,6 +498,30 @@ public class HighChildOrder implements Serializable {
this.gasPricePreferences = gasPricePreferences;
}
public Long getGasClassGroupId() {
return gasClassGroupId;
}
public void setGasClassGroupId(Long gasClassGroupId) {
this.gasClassGroupId = gasClassGroupId;
}
public String getGasClassGroupName() {
return gasClassGroupName;
}
public void setGasClassGroupName(String gasClassGroupName) {
this.gasClassGroupName = gasClassGroupName;
}
public Long getGasClassGroupTaskId() {
return gasClassGroupTaskId;
}
public void setGasClassGroupTaskId(Long gasClassGroupTaskId) {
this.gasClassGroupTaskId = gasClassGroupTaskId;
}
public Long getGasStaffId() {
return gasStaffId;
}
@ -639,6 +678,9 @@ public class HighChildOrder implements Serializable {
&& (this.getGasOilSubsidy() == null ? other.getGasOilSubsidy() == null : this.getGasOilSubsidy().equals(other.getGasOilSubsidy()))
&& (this.getGasLitersPreferences() == null ? other.getGasLitersPreferences() == null : this.getGasLitersPreferences().equals(other.getGasLitersPreferences()))
&& (this.getGasPricePreferences() == null ? other.getGasPricePreferences() == null : this.getGasPricePreferences().equals(other.getGasPricePreferences()))
&& (this.getGasClassGroupId() == null ? other.getGasClassGroupId() == null : this.getGasClassGroupId().equals(other.getGasClassGroupId()))
&& (this.getGasClassGroupName() == null ? other.getGasClassGroupName() == null : this.getGasClassGroupName().equals(other.getGasClassGroupName()))
&& (this.getGasClassGroupTaskId() == null ? other.getGasClassGroupTaskId() == null : this.getGasClassGroupTaskId().equals(other.getGasClassGroupTaskId()))
&& (this.getGasStaffId() == null ? other.getGasStaffId() == null : this.getGasStaffId().equals(other.getGasStaffId()))
&& (this.getGasStaffName() == null ? other.getGasStaffName() == null : this.getGasStaffName().equals(other.getGasStaffName()))
&& (this.getGasSalesmanId() == null ? other.getGasSalesmanId() == null : this.getGasSalesmanId().equals(other.getGasSalesmanId()))
@ -691,6 +733,9 @@ public class HighChildOrder implements Serializable {
result = prime * result + ((getGasOilSubsidy() == null) ? 0 : getGasOilSubsidy().hashCode());
result = prime * result + ((getGasLitersPreferences() == null) ? 0 : getGasLitersPreferences().hashCode());
result = prime * result + ((getGasPricePreferences() == null) ? 0 : getGasPricePreferences().hashCode());
result = prime * result + ((getGasClassGroupId() == null) ? 0 : getGasClassGroupId().hashCode());
result = prime * result + ((getGasClassGroupName() == null) ? 0 : getGasClassGroupName().hashCode());
result = prime * result + ((getGasClassGroupTaskId() == null) ? 0 : getGasClassGroupTaskId().hashCode());
result = prime * result + ((getGasStaffId() == null) ? 0 : getGasStaffId().hashCode());
result = prime * result + ((getGasStaffName() == null) ? 0 : getGasStaffName().hashCode());
result = prime * result + ((getGasSalesmanId() == null) ? 0 : getGasSalesmanId().hashCode());
@ -746,6 +791,9 @@ public class HighChildOrder implements Serializable {
sb.append(", gasOilSubsidy=").append(gasOilSubsidy);
sb.append(", gasLitersPreferences=").append(gasLitersPreferences);
sb.append(", gasPricePreferences=").append(gasPricePreferences);
sb.append(", gasClassGroupId=").append(gasClassGroupId);
sb.append(", gasClassGroupName=").append(gasClassGroupName);
sb.append(", gasClassGroupTaskId=").append(gasClassGroupTaskId);
sb.append(", gasStaffId=").append(gasStaffId);
sb.append(", gasStaffName=").append(gasStaffName);
sb.append(", gasSalesmanId=").append(gasSalesmanId);

@ -2135,6 +2135,196 @@ public class HighChildOrderExample {
return (Criteria) this;
}
public Criteria andGasClassGroupIdIsNull() {
addCriterion("gas_class_group_id is null");
return (Criteria) this;
}
public Criteria andGasClassGroupIdIsNotNull() {
addCriterion("gas_class_group_id is not null");
return (Criteria) this;
}
public Criteria andGasClassGroupIdEqualTo(Long value) {
addCriterion("gas_class_group_id =", value, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdNotEqualTo(Long value) {
addCriterion("gas_class_group_id <>", value, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdGreaterThan(Long value) {
addCriterion("gas_class_group_id >", value, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdGreaterThanOrEqualTo(Long value) {
addCriterion("gas_class_group_id >=", value, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdLessThan(Long value) {
addCriterion("gas_class_group_id <", value, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdLessThanOrEqualTo(Long value) {
addCriterion("gas_class_group_id <=", value, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdIn(List<Long> values) {
addCriterion("gas_class_group_id in", values, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdNotIn(List<Long> values) {
addCriterion("gas_class_group_id not in", values, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdBetween(Long value1, Long value2) {
addCriterion("gas_class_group_id between", value1, value2, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupIdNotBetween(Long value1, Long value2) {
addCriterion("gas_class_group_id not between", value1, value2, "gasClassGroupId");
return (Criteria) this;
}
public Criteria andGasClassGroupNameIsNull() {
addCriterion("gas_class_group_name is null");
return (Criteria) this;
}
public Criteria andGasClassGroupNameIsNotNull() {
addCriterion("gas_class_group_name is not null");
return (Criteria) this;
}
public Criteria andGasClassGroupNameEqualTo(String value) {
addCriterion("gas_class_group_name =", value, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameNotEqualTo(String value) {
addCriterion("gas_class_group_name <>", value, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameGreaterThan(String value) {
addCriterion("gas_class_group_name >", value, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameGreaterThanOrEqualTo(String value) {
addCriterion("gas_class_group_name >=", value, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameLessThan(String value) {
addCriterion("gas_class_group_name <", value, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameLessThanOrEqualTo(String value) {
addCriterion("gas_class_group_name <=", value, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameLike(String value) {
addCriterion("gas_class_group_name like", value, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameNotLike(String value) {
addCriterion("gas_class_group_name not like", value, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameIn(List<String> values) {
addCriterion("gas_class_group_name in", values, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameNotIn(List<String> values) {
addCriterion("gas_class_group_name not in", values, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameBetween(String value1, String value2) {
addCriterion("gas_class_group_name between", value1, value2, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupNameNotBetween(String value1, String value2) {
addCriterion("gas_class_group_name not between", value1, value2, "gasClassGroupName");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdIsNull() {
addCriterion("gas_class_group_task_id is null");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdIsNotNull() {
addCriterion("gas_class_group_task_id is not null");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdEqualTo(Long value) {
addCriterion("gas_class_group_task_id =", value, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdNotEqualTo(Long value) {
addCriterion("gas_class_group_task_id <>", value, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdGreaterThan(Long value) {
addCriterion("gas_class_group_task_id >", value, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdGreaterThanOrEqualTo(Long value) {
addCriterion("gas_class_group_task_id >=", value, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdLessThan(Long value) {
addCriterion("gas_class_group_task_id <", value, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdLessThanOrEqualTo(Long value) {
addCriterion("gas_class_group_task_id <=", value, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdIn(List<Long> values) {
addCriterion("gas_class_group_task_id in", values, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdNotIn(List<Long> values) {
addCriterion("gas_class_group_task_id not in", values, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdBetween(Long value1, Long value2) {
addCriterion("gas_class_group_task_id between", value1, value2, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasClassGroupTaskIdNotBetween(Long value1, Long value2) {
addCriterion("gas_class_group_task_id not between", value1, value2, "gasClassGroupTaskId");
return (Criteria) this;
}
public Criteria andGasStaffIdIsNull() {
addCriterion("gas_staff_id is null");
return (Criteria) this;

@ -78,6 +78,21 @@ public class HighDevice implements Serializable {
*/
private String deviceIccid;
/**
* 小票顶部显示
*/
private String receiptTop;
/**
* 小票来源显示
*/
private String receiptSource;
/**
* 小票底部显示
*/
private String receiptBottom;
/**
* 状态0删除1正常
*/
@ -205,6 +220,30 @@ public class HighDevice implements Serializable {
this.deviceIccid = deviceIccid;
}
public String getReceiptTop() {
return receiptTop;
}
public void setReceiptTop(String receiptTop) {
this.receiptTop = receiptTop;
}
public String getReceiptSource() {
return receiptSource;
}
public void setReceiptSource(String receiptSource) {
this.receiptSource = receiptSource;
}
public String getReceiptBottom() {
return receiptBottom;
}
public void setReceiptBottom(String receiptBottom) {
this.receiptBottom = receiptBottom;
}
public Integer getStatus() {
return status;
}
@ -278,6 +317,9 @@ public class HighDevice implements Serializable {
&& (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.getReceiptTop() == null ? other.getReceiptTop() == null : this.getReceiptTop().equals(other.getReceiptTop()))
&& (this.getReceiptSource() == null ? other.getReceiptSource() == null : this.getReceiptSource().equals(other.getReceiptSource()))
&& (this.getReceiptBottom() == null ? other.getReceiptBottom() == null : this.getReceiptBottom().equals(other.getReceiptBottom()))
&& (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()))
@ -303,6 +345,9 @@ public class HighDevice implements Serializable {
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 + ((getReceiptTop() == null) ? 0 : getReceiptTop().hashCode());
result = prime * result + ((getReceiptSource() == null) ? 0 : getReceiptSource().hashCode());
result = prime * result + ((getReceiptBottom() == null) ? 0 : getReceiptBottom().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());
@ -331,6 +376,9 @@ public class HighDevice implements Serializable {
sb.append(", deviceKey=").append(deviceKey);
sb.append(", deviceImei=").append(deviceImei);
sb.append(", deviceIccid=").append(deviceIccid);
sb.append(", receiptTop=").append(receiptTop);
sb.append(", receiptSource=").append(receiptSource);
sb.append(", receiptBottom=").append(receiptBottom);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);

@ -985,6 +985,216 @@ public class HighDeviceExample {
return (Criteria) this;
}
public Criteria andReceiptTopIsNull() {
addCriterion("receipt_top is null");
return (Criteria) this;
}
public Criteria andReceiptTopIsNotNull() {
addCriterion("receipt_top is not null");
return (Criteria) this;
}
public Criteria andReceiptTopEqualTo(String value) {
addCriterion("receipt_top =", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopNotEqualTo(String value) {
addCriterion("receipt_top <>", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopGreaterThan(String value) {
addCriterion("receipt_top >", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopGreaterThanOrEqualTo(String value) {
addCriterion("receipt_top >=", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopLessThan(String value) {
addCriterion("receipt_top <", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopLessThanOrEqualTo(String value) {
addCriterion("receipt_top <=", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopLike(String value) {
addCriterion("receipt_top like", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopNotLike(String value) {
addCriterion("receipt_top not like", value, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopIn(List<String> values) {
addCriterion("receipt_top in", values, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopNotIn(List<String> values) {
addCriterion("receipt_top not in", values, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopBetween(String value1, String value2) {
addCriterion("receipt_top between", value1, value2, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptTopNotBetween(String value1, String value2) {
addCriterion("receipt_top not between", value1, value2, "receiptTop");
return (Criteria) this;
}
public Criteria andReceiptSourceIsNull() {
addCriterion("receipt_source is null");
return (Criteria) this;
}
public Criteria andReceiptSourceIsNotNull() {
addCriterion("receipt_source is not null");
return (Criteria) this;
}
public Criteria andReceiptSourceEqualTo(String value) {
addCriterion("receipt_source =", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceNotEqualTo(String value) {
addCriterion("receipt_source <>", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceGreaterThan(String value) {
addCriterion("receipt_source >", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceGreaterThanOrEqualTo(String value) {
addCriterion("receipt_source >=", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceLessThan(String value) {
addCriterion("receipt_source <", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceLessThanOrEqualTo(String value) {
addCriterion("receipt_source <=", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceLike(String value) {
addCriterion("receipt_source like", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceNotLike(String value) {
addCriterion("receipt_source not like", value, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceIn(List<String> values) {
addCriterion("receipt_source in", values, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceNotIn(List<String> values) {
addCriterion("receipt_source not in", values, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceBetween(String value1, String value2) {
addCriterion("receipt_source between", value1, value2, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptSourceNotBetween(String value1, String value2) {
addCriterion("receipt_source not between", value1, value2, "receiptSource");
return (Criteria) this;
}
public Criteria andReceiptBottomIsNull() {
addCriterion("receipt_bottom is null");
return (Criteria) this;
}
public Criteria andReceiptBottomIsNotNull() {
addCriterion("receipt_bottom is not null");
return (Criteria) this;
}
public Criteria andReceiptBottomEqualTo(String value) {
addCriterion("receipt_bottom =", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomNotEqualTo(String value) {
addCriterion("receipt_bottom <>", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomGreaterThan(String value) {
addCriterion("receipt_bottom >", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomGreaterThanOrEqualTo(String value) {
addCriterion("receipt_bottom >=", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomLessThan(String value) {
addCriterion("receipt_bottom <", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomLessThanOrEqualTo(String value) {
addCriterion("receipt_bottom <=", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomLike(String value) {
addCriterion("receipt_bottom like", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomNotLike(String value) {
addCriterion("receipt_bottom not like", value, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomIn(List<String> values) {
addCriterion("receipt_bottom in", values, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomNotIn(List<String> values) {
addCriterion("receipt_bottom not in", values, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomBetween(String value1, String value2) {
addCriterion("receipt_bottom between", value1, value2, "receiptBottom");
return (Criteria) this;
}
public Criteria andReceiptBottomNotBetween(String value1, String value2) {
addCriterion("receipt_bottom not between", value1, value2, "receiptBottom");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -0,0 +1,232 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* high_gas_class_group
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighGasClassGroup implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 加油站id
*/
private Long merchantStoreId;
/**
* 加油站名称
*/
private String merchantStoreName;
/**
* 班组名称
*/
private String name;
/**
* 负责人名称
*/
private String principalName;
/**
* 负责人电话
*/
private String principalPhone;
/**
* 状态 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 Long getMerchantStoreId() {
return merchantStoreId;
}
public void setMerchantStoreId(Long merchantStoreId) {
this.merchantStoreId = merchantStoreId;
}
public String getMerchantStoreName() {
return merchantStoreName;
}
public void setMerchantStoreName(String merchantStoreName) {
this.merchantStoreName = merchantStoreName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPrincipalName() {
return principalName;
}
public void setPrincipalName(String principalName) {
this.principalName = principalName;
}
public String getPrincipalPhone() {
return principalPhone;
}
public void setPrincipalPhone(String principalPhone) {
this.principalPhone = principalPhone;
}
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;
}
HighGasClassGroup other = (HighGasClassGroup) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMerchantStoreId() == null ? other.getMerchantStoreId() == null : this.getMerchantStoreId().equals(other.getMerchantStoreId()))
&& (this.getMerchantStoreName() == null ? other.getMerchantStoreName() == null : this.getMerchantStoreName().equals(other.getMerchantStoreName()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getPrincipalName() == null ? other.getPrincipalName() == null : this.getPrincipalName().equals(other.getPrincipalName()))
&& (this.getPrincipalPhone() == null ? other.getPrincipalPhone() == null : this.getPrincipalPhone().equals(other.getPrincipalPhone()))
&& (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 + ((getMerchantStoreId() == null) ? 0 : getMerchantStoreId().hashCode());
result = prime * result + ((getMerchantStoreName() == null) ? 0 : getMerchantStoreName().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getPrincipalName() == null) ? 0 : getPrincipalName().hashCode());
result = prime * result + ((getPrincipalPhone() == null) ? 0 : getPrincipalPhone().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(", merchantStoreId=").append(merchantStoreId);
sb.append(", merchantStoreName=").append(merchantStoreName);
sb.append(", name=").append(name);
sb.append(", principalName=").append(principalName);
sb.append(", principalPhone=").append(principalPhone);
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();
}
}

@ -0,0 +1,280 @@
package com.hai.entity;
import java.io.Serializable;
import java.util.Date;
/**
* high_gas_class_group_task
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class HighGasClassGroupTask implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 班组id
*/
private Long gasClassGroupId;
/**
* 班组名称
*/
private String gasClassGroupName;
/**
* 加油站id
*/
private Long merchantStoreId;
/**
* 加油站名称
*/
private String merchantStoreName;
/**
* 班次
*/
private Integer classNum;
/**
* 开始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
/**
* 数据统计
*/
private String dataCount;
/**
* 状态 0删除 1进行中 2已结束
*/
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 Long getGasClassGroupId() {
return gasClassGroupId;
}
public void setGasClassGroupId(Long gasClassGroupId) {
this.gasClassGroupId = gasClassGroupId;
}
public String getGasClassGroupName() {
return gasClassGroupName;
}
public void setGasClassGroupName(String gasClassGroupName) {
this.gasClassGroupName = gasClassGroupName;
}
public Long getMerchantStoreId() {
return merchantStoreId;
}
public void setMerchantStoreId(Long merchantStoreId) {
this.merchantStoreId = merchantStoreId;
}
public String getMerchantStoreName() {
return merchantStoreName;
}
public void setMerchantStoreName(String merchantStoreName) {
this.merchantStoreName = merchantStoreName;
}
public Integer getClassNum() {
return classNum;
}
public void setClassNum(Integer classNum) {
this.classNum = classNum;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getDataCount() {
return dataCount;
}
public void setDataCount(String dataCount) {
this.dataCount = dataCount;
}
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;
}
HighGasClassGroupTask other = (HighGasClassGroupTask) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getGasClassGroupId() == null ? other.getGasClassGroupId() == null : this.getGasClassGroupId().equals(other.getGasClassGroupId()))
&& (this.getGasClassGroupName() == null ? other.getGasClassGroupName() == null : this.getGasClassGroupName().equals(other.getGasClassGroupName()))
&& (this.getMerchantStoreId() == null ? other.getMerchantStoreId() == null : this.getMerchantStoreId().equals(other.getMerchantStoreId()))
&& (this.getMerchantStoreName() == null ? other.getMerchantStoreName() == null : this.getMerchantStoreName().equals(other.getMerchantStoreName()))
&& (this.getClassNum() == null ? other.getClassNum() == null : this.getClassNum().equals(other.getClassNum()))
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
&& (this.getDataCount() == null ? other.getDataCount() == null : this.getDataCount().equals(other.getDataCount()))
&& (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 + ((getGasClassGroupId() == null) ? 0 : getGasClassGroupId().hashCode());
result = prime * result + ((getGasClassGroupName() == null) ? 0 : getGasClassGroupName().hashCode());
result = prime * result + ((getMerchantStoreId() == null) ? 0 : getMerchantStoreId().hashCode());
result = prime * result + ((getMerchantStoreName() == null) ? 0 : getMerchantStoreName().hashCode());
result = prime * result + ((getClassNum() == null) ? 0 : getClassNum().hashCode());
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
result = prime * result + ((getDataCount() == null) ? 0 : getDataCount().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(", gasClassGroupId=").append(gasClassGroupId);
sb.append(", gasClassGroupName=").append(gasClassGroupName);
sb.append(", merchantStoreId=").append(merchantStoreId);
sb.append(", merchantStoreName=").append(merchantStoreName);
sb.append(", classNum=").append(classNum);
sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime);
sb.append(", dataCount=").append(dataCount);
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();
}
}

@ -34,10 +34,15 @@ public class HighGasOilPrice implements Serializable {
private String oilNoName;
/**
* 优惠幅度
* 平台优惠
*/
private BigDecimal preferentialMargin;
/**
* 油站直降
*/
private BigDecimal gasStationDrop;
/**
* 优惠价
*/
@ -116,6 +121,14 @@ public class HighGasOilPrice implements Serializable {
this.preferentialMargin = preferentialMargin;
}
public BigDecimal getGasStationDrop() {
return gasStationDrop;
}
public void setGasStationDrop(BigDecimal gasStationDrop) {
this.gasStationDrop = gasStationDrop;
}
public BigDecimal getPriceVip() {
return priceVip;
}
@ -205,6 +218,7 @@ public class HighGasOilPrice implements Serializable {
&& (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo()))
&& (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName()))
&& (this.getPreferentialMargin() == null ? other.getPreferentialMargin() == null : this.getPreferentialMargin().equals(other.getPreferentialMargin()))
&& (this.getGasStationDrop() == null ? other.getGasStationDrop() == null : this.getGasStationDrop().equals(other.getGasStationDrop()))
&& (this.getPriceVip() == null ? other.getPriceVip() == null : this.getPriceVip().equals(other.getPriceVip()))
&& (this.getPriceGun() == null ? other.getPriceGun() == null : this.getPriceGun().equals(other.getPriceGun()))
&& (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial()))
@ -225,6 +239,7 @@ public class HighGasOilPrice implements Serializable {
result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode());
result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode());
result = prime * result + ((getPreferentialMargin() == null) ? 0 : getPreferentialMargin().hashCode());
result = prime * result + ((getGasStationDrop() == null) ? 0 : getGasStationDrop().hashCode());
result = prime * result + ((getPriceVip() == null) ? 0 : getPriceVip().hashCode());
result = prime * result + ((getPriceGun() == null) ? 0 : getPriceGun().hashCode());
result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode());
@ -248,6 +263,7 @@ public class HighGasOilPrice implements Serializable {
sb.append(", oilNo=").append(oilNo);
sb.append(", oilNoName=").append(oilNoName);
sb.append(", preferentialMargin=").append(preferentialMargin);
sb.append(", gasStationDrop=").append(gasStationDrop);
sb.append(", priceVip=").append(priceVip);
sb.append(", priceGun=").append(priceGun);
sb.append(", priceOfficial=").append(priceOfficial);

@ -435,6 +435,66 @@ public class HighGasOilPriceExample {
return (Criteria) this;
}
public Criteria andGasStationDropIsNull() {
addCriterion("gas_station_drop is null");
return (Criteria) this;
}
public Criteria andGasStationDropIsNotNull() {
addCriterion("gas_station_drop is not null");
return (Criteria) this;
}
public Criteria andGasStationDropEqualTo(BigDecimal value) {
addCriterion("gas_station_drop =", value, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropNotEqualTo(BigDecimal value) {
addCriterion("gas_station_drop <>", value, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropGreaterThan(BigDecimal value) {
addCriterion("gas_station_drop >", value, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("gas_station_drop >=", value, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropLessThan(BigDecimal value) {
addCriterion("gas_station_drop <", value, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropLessThanOrEqualTo(BigDecimal value) {
addCriterion("gas_station_drop <=", value, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropIn(List<BigDecimal> values) {
addCriterion("gas_station_drop in", values, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropNotIn(List<BigDecimal> values) {
addCriterion("gas_station_drop not in", values, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("gas_station_drop between", value1, value2, "gasStationDrop");
return (Criteria) this;
}
public Criteria andGasStationDropNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("gas_station_drop not between", value1, value2, "gasStationDrop");
return (Criteria) this;
}
public Criteria andPriceVipIsNull() {
addCriterion("price_vip is null");
return (Criteria) this;

@ -0,0 +1,36 @@
package com.hai.enum_type;
/**
* 加油站员工状态
* @author hurui
*/
public enum GasClassGroupTaskStatus {
status0(0 , "删除"),
status1(1 , "进行中"),
status2(2 , "已结束"),
;
private Integer status;
private String name;
GasClassGroupTaskStatus(int status , String name) {
this.status = status;
this.name = name;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -7,7 +7,8 @@ package com.hai.enum_type;
public enum GasTaskPriceTypeEnum {
type1(1 , "国标价"),
type2(2 , "油站价"),
type3(3 , "优惠幅度"),
type3(3 , "平台优惠"),
type4(4 , "油站直降"),
;
private Integer status;

@ -0,0 +1,155 @@
package com.hai.model;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 加油站 班组任务数据统计模型
* @author hurui
*/
public class GasClassGroupTaskDataCount {
/**
* 班次
*/
private Integer classNum;
/**
* 开始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
/**
* 班次状态
*/
private Integer status;
/**
* 加油总金额
*/
private BigDecimal refuelPrice;
/**
* 加油总笔数
*/
private Integer refuelNum;
/**
* 加油总升数
*/
private BigDecimal refuelLiters;
/**
* 退款总金额
*/
private BigDecimal refundPrice;
/**
* 退款总笔数
*/
private Integer refundNum;
/**
* 退款总升数
*/
private BigDecimal refundLiters;
/**
* 班组油品数据统计
*/
List<GasClassGroupTaskOilCount> groupTaskOilCountList;
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getClassNum() {
return classNum;
}
public void setClassNum(Integer classNum) {
this.classNum = classNum;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public BigDecimal getRefuelPrice() {
return refuelPrice;
}
public void setRefuelPrice(BigDecimal refuelPrice) {
this.refuelPrice = refuelPrice;
}
public Integer getRefuelNum() {
return refuelNum;
}
public void setRefuelNum(Integer refuelNum) {
this.refuelNum = refuelNum;
}
public BigDecimal getRefuelLiters() {
return refuelLiters;
}
public void setRefuelLiters(BigDecimal refuelLiters) {
this.refuelLiters = refuelLiters;
}
public BigDecimal getRefundPrice() {
return refundPrice;
}
public void setRefundPrice(BigDecimal refundPrice) {
this.refundPrice = refundPrice;
}
public Integer getRefundNum() {
return refundNum;
}
public void setRefundNum(Integer refundNum) {
this.refundNum = refundNum;
}
public BigDecimal getRefundLiters() {
return refundLiters;
}
public void setRefundLiters(BigDecimal refundLiters) {
this.refundLiters = refundLiters;
}
public List<GasClassGroupTaskOilCount> getGroupTaskOilCountList() {
return groupTaskOilCountList;
}
public void setGroupTaskOilCountList(List<GasClassGroupTaskOilCount> groupTaskOilCountList) {
this.groupTaskOilCountList = groupTaskOilCountList;
}
}

@ -0,0 +1,62 @@
package com.hai.model;
import java.math.BigDecimal;
/**
* 加油站 班组任务加油统计
* @author hurui
*/
public class GasClassGroupTaskOilCount {
/**
* 油号
*/
private Integer oilNo;
/**
* 加油总金额
*/
private BigDecimal refuelPrice;
/**
* 加油总数量
*/
private Integer refuelNum;
/**
* 加油总升数
*/
private BigDecimal refuelLiters;
public Integer getOilNo() {
return oilNo;
}
public void setOilNo(Integer oilNo) {
this.oilNo = oilNo;
}
public BigDecimal getRefuelPrice() {
return refuelPrice;
}
public void setRefuelPrice(BigDecimal refuelPrice) {
this.refuelPrice = refuelPrice;
}
public Integer getRefuelNum() {
return refuelNum;
}
public void setRefuelNum(Integer refuelNum) {
this.refuelNum = refuelNum;
}
public BigDecimal getRefuelLiters() {
return refuelLiters;
}
public void setRefuelLiters(BigDecimal refuelLiters) {
this.refuelLiters = refuelLiters;
}
}

@ -33,6 +33,16 @@ public class GasPayPriceModel {
*/
private BigDecimal pricePlatform;
/**
* 油站直降
*/
private BigDecimal gasStationDrop;
/**
* 平台补贴
*/
private BigDecimal preferentialMargin;
/**
* 加油升数计算方式加油金额 / 国标价
*/
@ -43,11 +53,6 @@ public class GasPayPriceModel {
*/
private BigDecimal discount;
/**
* 加油补贴, 计算方式国标价-团油VIP价
*/
private BigDecimal oilSubsidy;
/**
* 每升优惠
*/
@ -68,6 +73,22 @@ public class GasPayPriceModel {
*/
private BigDecimal payPrice;
public BigDecimal getPreferentialMargin() {
return preferentialMargin;
}
public void setPreferentialMargin(BigDecimal preferentialMargin) {
this.preferentialMargin = preferentialMargin;
}
public BigDecimal getGasStationDrop() {
return gasStationDrop;
}
public void setGasStationDrop(BigDecimal gasStationDrop) {
this.gasStationDrop = gasStationDrop;
}
public BigDecimal getOilingPrice() {
return oilingPrice;
}
@ -124,14 +145,6 @@ public class GasPayPriceModel {
this.discount = discount;
}
public BigDecimal getOilSubsidy() {
return oilSubsidy;
}
public void setOilSubsidy(BigDecimal oilSubsidy) {
this.oilSubsidy = oilSubsidy;
}
public BigDecimal getLitersPreferences() {
return litersPreferences;
}

@ -1,13 +0,0 @@
package com.hai.model;
/**
* @ClassName HighCouponCodeModel
* @Description:
* @Author 胡锐
* @Date 2021/3/16
**/
public interface HighCouponCodeModel {
}

@ -0,0 +1,40 @@
package com.hai.service;
import com.hai.entity.HighGasClassGroup;
import java.util.List;
import java.util.Map;
/**
* 加油站班组服务
* @author hurui
*/
public interface HighGasClassGroupService {
/**
* 编辑班组
* @param gasClassGroup
*/
void editGroup(HighGasClassGroup gasClassGroup);
/**
* 删除班组
* @param groupId
*/
void delGroup(Long groupId);
/**
* 根据id查询详情
* @param groupId
* @return
*/
HighGasClassGroup getDetailById(Long groupId);
/**
* 查询班组列表
* @param param
* @return
*/
List<HighGasClassGroup> getGroupList(Map<String, Object> param);
}

@ -0,0 +1,64 @@
package com.hai.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighGasClassGroupTask;
import com.hai.model.GasClassGroupTaskDataCount;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 加油站班组任务
* @author hurui
*/
public interface HighGasClassGroupTaskService {
/**
* 开始班组
* @param gasId 油站id
* @param gasClassGroupId 班组id
*/
void startGroupTask(Long gasId, Long gasClassGroupId);
/**
* 结束班组任务
* @param gasId 油站id
*/
void endGroupTask(Long gasId);
/**
* 交接班组任务
* @param gasId 油站id
* @param gasClassGroupId 班组id
*/
void swapGroupTask(Long gasId, Long gasClassGroupId);
/**
* 统计班组任务数据
* @param groupTaskId
* @return
*/
GasClassGroupTaskDataCount countGroupTaskData(Long gasId, Integer classNum, Long groupTaskId, Integer status, Date startTime, Date endTime);
/**
* 编辑班组任务
* @param gasClassGroupTask
*/
void editGroupTask(HighGasClassGroupTask gasClassGroupTask);
/**
* 根据id查询详情
* @param groupTaskId
* @return
*/
HighGasClassGroupTask getDetailById(Long groupTaskId);
/**
* 查询班组任务列表
* @param param
* @return
*/
List<HighGasClassGroupTask> getGroupTaskList(Map<String, Object> param);
}

@ -468,7 +468,7 @@ public interface HighOrderService {
* 打印加油订单
* @param gasId
*/
void printGasOrder(Long gasId, HighOrder order);
void printGasOrder(Long gasId, HighOrder order, boolean makeUp);
/**
* @Author Sum1Dream

@ -7,7 +7,6 @@ import com.hai.common.exception.SysCode;
import com.hai.dao.HighCouponHandselMapper;
import com.hai.dao.HighCouponMapper;
import com.hai.entity.*;
import com.hai.model.HighCouponCodeModel;
import com.hai.model.HighCouponHandselModel;
import com.hai.model.HighCouponModel;
import com.hai.service.*;

@ -0,0 +1,81 @@
package com.hai.service.impl;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.dao.HighGasClassGroupMapper;
import com.hai.entity.HighGasClassGroup;
import com.hai.entity.HighGasClassGroupExample;
import com.hai.service.HighGasClassGroupService;
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("gasClassGroupService")
public class HighGasClassGroupServiceImpl implements HighGasClassGroupService {
@Resource
private HighGasClassGroupMapper gasClassGroupMapper;
@Override
public void editGroup(HighGasClassGroup gasClassGroup) {
if (gasClassGroup.getId() == null) {
gasClassGroup.setStatus(1);
gasClassGroup.setCreateTime(new Date());
gasClassGroup.setUpdateTime(new Date());
gasClassGroupMapper.insert(gasClassGroup);
} else {
gasClassGroup.setUpdateTime(new Date());
gasClassGroupMapper.updateByPrimaryKey(gasClassGroup);
}
}
@Override
public void delGroup(Long groupId) {
HighGasClassGroup classGroup = getDetailById(groupId);
if (classGroup == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到班组");
}
classGroup.setStatus(0);
editGroup(classGroup);
}
@Override
public HighGasClassGroup getDetailById(Long groupId) {
return gasClassGroupMapper.selectByPrimaryKey(groupId);
}
@Override
public List<HighGasClassGroup> getGroupList(Map<String, Object> param) {
HighGasClassGroupExample example = new HighGasClassGroupExample();
HighGasClassGroupExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "merchantStoreId") != null) {
criteria.andMerchantStoreIdEqualTo(MapUtils.getLong(param, "merchantStoreId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "merchantStoreName"))) {
criteria.andMerchantStoreNameLike("%" + MapUtils.getString(param, "merchantStoreId") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "name"))) {
criteria.andNameLike("%" + MapUtils.getString(param, "name") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "principalName"))) {
criteria.andPrincipalNameLike("%" + MapUtils.getString(param, "principalName") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "principalPhone"))) {
criteria.andPrincipalPhoneLike("%" + MapUtils.getString(param, "principalPhone") + "%");
}
example.setOrderByClause("create_time desc");
return gasClassGroupMapper.selectByExample(example);
}
}

@ -0,0 +1,222 @@
package com.hai.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.config.MqttProviderConfig;
import com.hai.config.SpPrinterConfig;
import com.hai.config.SpPrinterTemplate;
import com.hai.config.ZkcPrinterTemplate;
import com.hai.dao.HighGasClassGroupTaskMapper;
import com.hai.entity.*;
import com.hai.enum_type.DeviceTypeEnum;
import com.hai.enum_type.GasClassGroupTaskStatus;
import com.hai.model.GasClassGroupTaskDataCount;
import com.hai.model.GasClassGroupTaskOilCount;
import com.hai.service.HighDeviceService;
import com.hai.service.HighGasClassGroupService;
import com.hai.service.HighGasClassGroupTaskService;
import com.hai.service.HighMerchantStoreService;
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.math.BigDecimal;
import java.util.*;
@Service("gasClassGroupTask")
public class HighGasClassGroupTaskServiceImpl implements HighGasClassGroupTaskService {
@Resource
private HighGasClassGroupTaskMapper gasClassGroupTaskMapper;
@Resource
private HighGasClassGroupService gasClassGroupService;
@Resource
private HighMerchantStoreService merchantStoreService;
@Resource
private HighDeviceService deviceService;
@Resource
private MqttProviderConfig mqttProviderConfig;
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void startGroupTask(Long gasId, Long gasClassGroupId) {
// 查询加油站
HighMerchantStore merchantStore = merchantStoreService.getDetailById(gasId);
if (merchantStore == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站信息");
}
// 查询进行中的任务
Map<String, Object> param = new HashMap<>();
param.put("merchantStoreId", merchantStore.getId());
param.put("status", GasClassGroupTaskStatus.status1.getStatus());
List<HighGasClassGroupTask> list = getGroupTaskList(param);
if (list.size() > 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已有班组正在进行中,请结束班组或交换班组");
}
// 查询班组信息
HighGasClassGroup group = gasClassGroupService.getDetailById(gasClassGroupId);
if (group == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到班组信息");
}
HighGasClassGroupTask groupTask = new HighGasClassGroupTask();
groupTask.setGasClassGroupId(group.getId());
groupTask.setGasClassGroupName(group.getName());
groupTask.setMerchantStoreId(merchantStore.getId());
groupTask.setMerchantStoreName(merchantStore.getStoreName());
groupTask.setStartTime(new Date());
groupTask.setClassNum(gasClassGroupTaskMapper.getLatestClassNum(merchantStore.getId()) + 1);
editGroupTask(groupTask);
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void endGroupTask(Long gasId) {
// 查询进行中的任务
Map<String, Object> param = new HashMap<>();
param.put("merchantStoreId", gasId);
param.put("status", GasClassGroupTaskStatus.status1.getStatus());
List<HighGasClassGroupTask> list = getGroupTaskList(param);
if (list.size() > 0) {
HighGasClassGroupTask groupTask = list.get(0);
groupTask.setEndTime(new Date());
groupTask.setStatus(GasClassGroupTaskStatus.status2.getStatus());
// 统计
GasClassGroupTaskDataCount dataCount = countGroupTaskData(gasId, groupTask.getClassNum(), groupTask.getId(), groupTask.getStatus(), groupTask.getStartTime(), groupTask.getEndTime());
groupTask.setDataCount(JSONObject.toJSONString(dataCount));
editGroupTask(groupTask);
// 查询加油站打印机
List<HighDevice> deviceList = deviceService.getDeviceListByStoreId(gasId);
for (HighDevice device : deviceList) {
if (device.getType().equals(DeviceTypeEnum.type1.getType())) {
new Thread(() -> {
try {
// 推送打印机
SpPrinterConfig spPrinterConfig = new SpPrinterConfig();
spPrinterConfig.print(device.getDeviceSn(), SpPrinterTemplate.classGroupCountTemp(dataCount, false), 1);
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}
if (device.getType().equals(DeviceTypeEnum.type2.getType())) {
new Thread(() -> {
try {
// 推送打印机
mqttProviderConfig.publish(2,false, device.getDeviceImei(), ZkcPrinterTemplate.classGroupCountTemp(dataCount, false));
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}
}
}
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void swapGroupTask(Long gasId, Long gasClassGroupId) {
// 任务结束
endGroupTask(gasId);
// 开启新的任务
startGroupTask(gasId, gasClassGroupId);
}
@Override
public GasClassGroupTaskDataCount countGroupTaskData(Long gasId, Integer classNum, Long groupTaskId, Integer status, Date startTime, Date endTime) {
GasClassGroupTaskDataCount dataCount = new GasClassGroupTaskDataCount();
dataCount.setClassNum(classNum);
dataCount.setStatus(status);
dataCount.setStartTime(startTime);
dataCount.setEndTime(endTime);
// 加油汇总
Map<String, Object> refuelData = gasClassGroupTaskMapper.countRefuelData(groupTaskId);
dataCount.setRefuelPrice(new BigDecimal(MapUtils.getString(refuelData, "refuelPrice")));
dataCount.setRefuelNum(MapUtils.getInteger(refuelData, "refuelNum"));
dataCount.setRefuelLiters(new BigDecimal(MapUtils.getString(refuelData, "refuelLiters")));
// 退款汇总
Map<String, Object> refundData = gasClassGroupTaskMapper.countRefundData(groupTaskId);
dataCount.setRefundPrice(new BigDecimal(MapUtils.getString(refundData, "refundPrice")));
dataCount.setRefundNum(MapUtils.getInteger(refundData, "refundNum"));
dataCount.setRefundLiters(new BigDecimal(MapUtils.getString(refundData, "refundLiters")));
// 油品汇总
List<Map<String, Object>> oilDataList = gasClassGroupTaskMapper.countOilData(gasId, groupTaskId);
List<GasClassGroupTaskOilCount> oilCountList = new ArrayList<>();
for (Map<String, Object> oilData : oilDataList) {
GasClassGroupTaskOilCount oilCount = new GasClassGroupTaskOilCount();
oilCount.setOilNo(MapUtils.getInteger(oilData, "oilNo"));
oilCount.setRefuelPrice(new BigDecimal(MapUtils.getString(oilData, "refuelPrice")));
oilCount.setRefuelNum(MapUtils.getInteger(oilData, "refuelNum"));
oilCount.setRefuelLiters(new BigDecimal(MapUtils.getString(oilData, "refuelLiters")));
oilCountList.add(oilCount);
}
dataCount.setGroupTaskOilCountList(oilCountList);
return dataCount;
}
@Override
public void editGroupTask(HighGasClassGroupTask gasClassGroupTask) {
if (gasClassGroupTask.getId() == null) {
gasClassGroupTask.setStatus(GasClassGroupTaskStatus.status1.getStatus());
gasClassGroupTask.setCreateTime(new Date());
gasClassGroupTask.setUpdateTime(new Date());
gasClassGroupTaskMapper.insert(gasClassGroupTask);
} else {
gasClassGroupTask.setUpdateTime(new Date());
gasClassGroupTaskMapper.updateByPrimaryKey(gasClassGroupTask);
}
}
@Override
public HighGasClassGroupTask getDetailById(Long groupTaskId) {
return gasClassGroupTaskMapper.selectByPrimaryKey(groupTaskId);
}
@Override
public List<HighGasClassGroupTask> getGroupTaskList(Map<String, Object> param) {
HighGasClassGroupTaskExample example = new HighGasClassGroupTaskExample();
HighGasClassGroupTaskExample.Criteria criteria = example.createCriteria()
.andStatusNotEqualTo(GasClassGroupTaskStatus.status0.getStatus());
if (MapUtils.getLong(param, "gasClassGroupId") != null) {
criteria.andGasClassGroupIdEqualTo(MapUtils.getLong(param, "gasClassGroupId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "gasClassGroupName"))) {
criteria.andGasClassGroupNameLike("%" + MapUtils.getString(param, "gasClassGroupName") + "%");
}
if (MapUtils.getLong(param, "merchantStoreId") != null) {
criteria.andMerchantStoreIdEqualTo(MapUtils.getLong(param, "merchantStoreId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "gasClassGroupName"))) {
criteria.andGasClassGroupNameLike("%" + MapUtils.getString(param, "gasClassGroupName") + "%");
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status"));
}
example.setOrderByClause("create_time desc");
return gasClassGroupTaskMapper.selectByExample(example);
}
}

@ -134,27 +134,26 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
}
}
discount = discount.divide(new BigDecimal("100"));
// 枪价
BigDecimal priceGun;
// 优惠价
BigDecimal priceVip;
// 优惠幅度
BigDecimal preferentialMargin = new BigDecimal("0");
// 查询油站价格
HighGasOilPrice gasOilPrice = gasOilPriceService.getGasOilPriceByStoreAndOilNo(goodsId, Integer.parseInt(oilNo));
if (gasOilPrice == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站价格");
}
priceGun = gasOilPrice.getPriceGun();
priceVip = gasOilPrice.getPriceVip();
preferentialMargin = gasOilPrice.getPreferentialMargin();
// 国标价
BigDecimal priceOfficial = gasOilPrice.getPriceOfficial();
// 油站价
BigDecimal priceGun = gasOilPrice.getPriceGun();
// 油站直降
BigDecimal gasStationDrop = gasOilPrice.getGasStationDrop();
// 油站优惠价
BigDecimal priceVip = gasOilPrice.getPriceVip();
// 平台优惠
BigDecimal preferentialMargin = gasOilPrice.getPreferentialMargin();
GasPayPriceModel payPriceModel = new GasPayPriceModel();
// 1:平台自建 2:团油 3: 壳牌
if (store.getSourceType().equals(1)) {
// 嗨森逛平台价 国标价 * 折扣
@ -163,15 +162,21 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
// 加油金额
payPriceModel.setOilingPrice(oilingPrice);
// 油站枪价
// 油站枪价
payPriceModel.setPriceGun(priceGun);
// 油站优惠价
// 油站优惠价
payPriceModel.setPriceVip(priceVip);
// 油站国标价
// 油站国标价
payPriceModel.setPriceOfficial(priceOfficial);
// 油站直降
payPriceModel.setGasStationDrop(gasStationDrop);
// 平台补贴
payPriceModel.setPreferentialMargin(gasOilPrice.getPreferentialMargin());
// 平台价
payPriceModel.setPricePlatform(pricePlatform);
@ -179,22 +184,22 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("100") : discount);
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("1.00") : discount);
// 加油补贴, 计算方式:加油站枪价 - 加油站VIP价
payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// 折扣,1 -平台折扣
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);
// 油枪价 - 优惠幅度
BigDecimal price = payPriceModel.getPriceGun().subtract(preferentialMargin);
// 油枪价 - 平台补贴
// BigDecimal price = payPriceModel.getPriceGun().subtract(preferentialMargin);
// 优惠价格 (油枪价 - 优惠幅度) * 系统折扣
payPriceModel.setPricePreferences(price.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
// 优惠价格 油站VIP价 * 系统折扣
payPriceModel.setPricePreferences(priceVip.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
// 每升优惠 价 - 优惠价格
payPriceModel.setLitersPreferences(priceGun.subtract(payPriceModel.getPricePreferences()));
// 每升优惠 国标价 - 优惠价格
payPriceModel.setLitersPreferences(payPriceModel.getPriceOfficial().subtract(payPriceModel.getPricePreferences()));
// 本次优惠 加油升数 * 每升优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_DOWN));
@ -233,6 +238,12 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
// 团油国标价
payPriceModel.setPriceOfficial(priceOfficial);
// 油站直降
payPriceModel.setGasStationDrop(gasStationDrop);
// 平台补贴
payPriceModel.setPreferentialMargin(gasOilPrice.getPreferentialMargin());
// 平台价
payPriceModel.setPricePlatform(pricePlatform);
@ -240,10 +251,10 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
payPriceModel.setOilLiters(oilingPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("100") : discount);
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("1.00") : discount);
// 加油补贴, 计算方式:团油枪价 - 团油VIP价
payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// 折扣,1 -平台折扣
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);

@ -142,8 +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()));
gasOilPrice.setPriceGun(priceOfficial.getPriceOfficial().subtract(gasOilPrice.getGasStationDrop()));
gasOilPrice.setPriceVip(gasOilPrice.getPriceGun().subtract(gasOilPrice.getPreferentialMargin()));
highGasOilPriceService.editGasOilPrice(gasOilPrice);
}
}

@ -98,6 +98,7 @@ public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskServic
}
gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice());
// 更新自建站的国标价
gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo());
}
@ -108,12 +109,12 @@ public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskServic
if (price == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格");
}
price.setPriceGun(gasOilPriceTask.getPrice());
price.setPriceVip(gasOilPriceTask.getPrice().subtract(price.getPreferentialMargin()));
price.setPriceGun(gasOilPriceTask.getPrice().subtract(price.getGasStationDrop()));
price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin()));
gasOilPriceService.editGasOilPrice(price);
}
// 优惠幅度
// 平台优惠
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) {
// 查询油品价格
HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(gasOilPriceTask.getMerStoreId(), gasOilPriceTask.getOilNo());
@ -125,6 +126,19 @@ public class HighGasOilPriceTaskServiceImpl implements HighGasOilPriceTaskServic
gasOilPriceService.editGasOilPrice(price);
}
// 油站直降
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type4.getStatus())) {
// 查询油品价格
HighGasOilPrice price = gasOilPriceService.getGasOilPriceByStoreAndOilNo(gasOilPriceTask.getMerStoreId(), gasOilPriceTask.getOilNo());
if (price == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格");
}
price.setGasStationDrop(gasOilPriceTask.getPrice());
price.setPriceGun(price.getPriceOfficial().subtract(price.getGasStationDrop()));
price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin()));
gasOilPriceService.editGasOilPrice(price);
}
}
@Override

@ -492,7 +492,7 @@ public class HighOrderServiceImpl implements HighOrderService {
new Thread(() -> {
if (highOrder.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
printGasOrder(highOrder.getHighChildOrderList().get(0).getGoodsId(), highOrder);
printGasOrder(highOrder.getHighChildOrderList().get(0).getGoodsId(), highOrder, false);
Map<String, Object> pushMsg = new HashMap<>();
pushMsg.put("userId", highOrder.getHighChildOrderList().get(0).getGoodsId());
@ -736,7 +736,7 @@ public class HighOrderServiceImpl implements HighOrderService {
new Thread(() -> {
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order);
printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, false);
Map<String, Object> pushMsg = new HashMap<>();
pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId());
@ -1065,7 +1065,7 @@ public class HighOrderServiceImpl implements HighOrderService {
new Thread(() -> {
if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) {
printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order);
printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, false);
Map<String, Object> pushMsg = new HashMap<>();
pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId());
@ -1713,7 +1713,7 @@ public class HighOrderServiceImpl implements HighOrderService {
}
@Override
public void printGasOrder(Long gasId, HighOrder order) {
public void printGasOrder(Long gasId, HighOrder order, boolean makeUp) {
if (order == null) {
return;
}
@ -1724,6 +1724,10 @@ public class HighOrderServiceImpl implements HighOrderService {
// 查询油站云打印设备
List<HighDevice> deviceList = deviceService.getDeviceListByStoreId(gasId);
for (HighDevice device : deviceList) {
Map<String, Object> receiptMap = new HashMap<>();
receiptMap.put("receiptTop", device.getReceiptTop());
receiptMap.put("receiptSource", device.getReceiptSource());
receiptMap.put("receiptBottom", device.getReceiptBottom());
if (device.getType().equals(DeviceTypeEnum.type1.getType())) {
new Thread(() -> {
@ -1735,24 +1739,13 @@ public class HighOrderServiceImpl implements HighOrderService {
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
order.getMemPhone(),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
) + "<BR>";
/* +
SpPrinterTemplate.oilClientStubTemp(
childOrder.getGoodsName(),
order.getOrderNo(),
DateUtil.date2String(order.getPayTime(), "yyyy-MM-dd HH:mm:ss"),
order.getMemPhone(),
"嗨森逛",
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
) + "<BR>";*/
order.getTotalPrice().toString(),
receiptMap,
makeUp
);
sp.print(device.getDeviceSn(), printStr, 1);
} catch (Exception e) {
e.printStackTrace();
@ -1773,7 +1766,9 @@ public class HighOrderServiceImpl implements HighOrderService {
childOrder.getGasGunNo(),
childOrder.getGasOilNo(),
childOrder.getGasOilLiters().toString(),
order.getTotalPrice().toString()
order.getTotalPrice().toString(),
receiptMap,
makeUp
));
} catch (Exception e) {
e.getMessage();

@ -430,8 +430,8 @@ public class GoodsOrderServiceImpl implements PayService {
}).start();
}
}
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order);
} catch (Exception e){
highOrderService.printGasOrder(order.getHighChildOrderList().get(0).getGoodsId(), order, false);
} catch (Exception e) {
}
}).start();

@ -10,7 +10,6 @@ import com.hai.model.ResponseData;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jdk.jfr.consumer.RecordedObject;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;

Loading…
Cancel
Save