diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java index 3c6a433d..56b5c29a 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDeviceController.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("操作成功"); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupController.java new file mode 100644 index 00000000..3bb5de58 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupController.java @@ -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 param = new HashMap<>(); + param.put("gasClassGroupId", body.getLong("id")); + param.put("status", GasClassGroupTaskStatus.status1.getStatus()); + List 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 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); + } + } + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupTaskController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupTaskController.java new file mode 100644 index 00000000..7960671a --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasClassGroupTaskController.java @@ -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 param = new HashMap<>(); + param.put("merchantStoreId", gasId); + param.put("status", GasClassGroupTaskStatus.status1.getStatus()); + List 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 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 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); + } + } + + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java index d2eeb5d8..9d60bb8f 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -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 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 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 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 = "查询油站选择列表") diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceController.java index 0414e5ab..3b12b1be 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceController.java @@ -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 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); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java index 223d1f26..1dea4a56 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasOilPriceTaskController.java @@ -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!",""); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index 91d4a969..784b15d9 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -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("操作成功"); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index fbd8b4d1..2789b840 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -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 classGroup = new HashMap<>(); + classGroup.put("merchantStoreId", childOrder.getGoodsId()); + classGroup.put("status", GasClassGroupTaskStatus.status1.getStatus()); + List 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()); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index 269c1b82..5aa44cef 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -1 +1 @@ -package com.cweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.hai.common.Base64Util; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.*; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.bouncycastle.util.encoders.UrlBase64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.IdGenerator; import org.springframework.web.bind.annotation.*; import sun.nio.cs.StreamEncoder; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HighOrderService highOrderService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @Resource private HighGasOrderPushMapper highGasOrderPushMapper; @Resource private HuiLianTongConfig huiLianTongConfig; @Resource private UnionPayConfig unionPayConfig; @Resource private UnionStagingPayConfig unionStagingPayConfig; @Resource private UnionUserConfig unionUserConfig; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOilCardService oilCardService; @Resource private BaiduVoiceService baiduVoiceService; @Resource private MqttProviderConfig mqttProviderConfig; @Autowired private WebSocket webSocket; @RequestMapping(value = "/wxGasProfitsharing", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "wxGasProfitsharing") public ResponseData wxGasProfitsharing(@RequestParam(name = "orderNo", required = true) String orderNo, HttpServletRequest request) { try { // 查询订单 HighOrder order = highOrderService.getOrderByOrderNo(orderNo); BigDecimal rake = new BigDecimal("0.05"); // 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal wxHandlingFee = order.getPayRealPrice().multiply(new BigDecimal("0.002")).setScale(2, BigDecimal.ROUND_HALF_DOWN); BigDecimal price = order.getPayRealPrice().subtract(wxHandlingFee); // 计算分账金额 手续费后的价格 * 0.05 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal profitSharingAmount = price.multiply(rake).setScale(2, BigDecimal.ROUND_DOWN); this.wxGasProfitsharing(order.getExt1(), order.getPaySerialNo(), order.getOrderNo(), profitSharingAmount); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } public void wxGasProfitsharing(String appid, String transaction_id, String out_order_no, BigDecimal amount) { try { Map param = new LinkedHashMap<>(); param.put("appid", appid); param.put("mch_id", "1289663601"); param.put("sub_mch_id", "1624126902"); // 个体户黎杨珍 param.put("transaction_id", transaction_id); param.put("out_order_no", out_order_no); param.put("nonce_str", WxUtils.makeNonStr()); // 分账金额 BigDecimal porofitSharingAmount = amount; List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers", JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5", WXPayConstants.SignType.HMACSHA256); param.put("sign", signStr); String resultXmL = this.doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(out_order_no); sharingRecord.setTransactionId(transaction_id); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(amount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); } } @RequestMapping(value = "/addPrinter", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡详情") public ResponseData addPrinter(HttpServletRequest request) { try { SpPrinterConfig spPrinterConfig = new SpPrinterConfig(); return ResponseMsgUtil.success( spPrinterConfig.addPrinter( "1540500213", "bxpjpnh4", "丹凤加油站打印机" ) ); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryThirdOrderDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单结果查询") public ResponseData queryThirdOrderDretail(HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDetail("HF2022051214411536507")); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/spPrint", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发送打印机消息") public ResponseData spPrint(@RequestParam(name = "orderNo", required = true) String orderNo, HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderByOrderNo(orderNo); for (HighChildOrder highChildOrder : highOrder.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); new Thread(() -> { try { SpPrinterConfig sp = new SpPrinterConfig(); sp.print(store.getDeviceSn(), SpPrinterTemplate.oilCashierStubTemp( highChildOrder.getGoodsName(), highOrder.getOrderNo(), DateUtil.date2String(highOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), "嗨森逛", "嗨森逛", highChildOrder.getGasGunNo(), highChildOrder.getGasOilNo(), highChildOrder.getGasOilLiters().toString(), highOrder.getTotalPrice().toString() ), 1); Thread.sleep(6000); sp.print(store.getDeviceSn(), SpPrinterTemplate.oilClientStubTemp( highChildOrder.getGoodsName(), highOrder.getOrderNo(), DateUtil.date2String(highOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), "嗨森逛", "嗨森逛", highChildOrder.getGasGunNo(), highChildOrder.getGasOilNo(), highChildOrder.getGasOilLiters().toString(), highOrder.getTotalPrice().toString() ), 1); } catch (Exception e) { e.printStackTrace(); } }).start(); } return ResponseMsgUtil.success("发送成功"); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/text2audio", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "文本转语音") public ResponseData text2audio(HttpServletRequest request) { try { return ResponseMsgUtil.success(baiduVoiceService.text2audio("加油站收款400元")); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getGasDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡详情") public ResponseData getGasDetail(@RequestParam(name = "cardNo", required = true) String cardNo, HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryGasInfoByGasId(cardNo)); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoByGasId", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据油站 id 拉取最新的油站数据") public ResponseData queryGasInfoByGasId(@RequestParam(name = "gasId", required = true) String gasId, HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryGasInfoByGasId(gasId)); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } // // @RequestMapping(value = "/getMobile", method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "话费充值") // public ResponseData getMobile( // @RequestParam(name = "orderNo", required = true) String orderNo, // @RequestParam(name = "amount", required = true) Integer amount, // @RequestParam(name = "phone", required = true) String phone, // HttpServletRequest request) { // try { // return ResponseMsgUtil.success(outRechargeOrderService.getMobile(phone,amount,orderNo)); // // } catch (Exception e) { // log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "初始化加油站") public ResponseData initTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue(); i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); if (store != null) { store.setType(1); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } } return ResponseMsgUtil.success("初始化完成"); } @RequestMapping(value = "/detectTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "检测加油站") public ResponseData detectTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } Map param = new HashMap<>(); param.put("merchantId", merchant.getId()); List stores = highMerchantStoreService.getMerchantStoreList(param); for (HighMerchantStore store : stores) { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(store.getStoreKey()); if (jsonObject != null && jsonObject.getString("code").equals("200")) { JSONObject result = jsonObject.getJSONObject("result"); store.setStatus(result.getInteger("gasStatus")); } else { store.setStatus(0); } highMerchantStoreService.updateMerchantStoreDetail(store); } return ResponseMsgUtil.success("初始化完成"); } /* @RequestMapping(value = "/pushTuanYouOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "推送团油订单") public ResponseData pushTuanYouOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); // 推送团油订单 Map paramMap = new HashMap<>(); paramMap.put("gasId", store.getStoreKey()); paramMap.put("oilNo", highChildOrder.getGasOilNo()); paramMap.put("gunNo", highChildOrder.getGasGunNo()); BigDecimal priceGun = highChildOrder.getGasPriceGun(); BigDecimal priceVip = highChildOrder.getGasPriceVip(); paramMap.put("priceGun", priceGun); // 枪单价 paramMap.put("priceVip", priceVip); // 优惠价 paramMap.put("driverPhone", order.getMemPhone()); // paramMap.put("driverPhone", "17726395120"); paramMap.put("thirdSerialNo", order.getOrderNo()); paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); // 油品类型 1:汽油:2:柴油;3:天然气 if (highChildOrder.getGasOilType() == 1) { paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount()); } else if (highChildOrder.getGasOilType() == 2) { paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount()); } JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); // 推送团油订单记录 HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); highGasOrderPush.setCreateTime(new Date()); highGasOrderPush.setCode(orderPushObject.getString("code")); highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap)); highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); highGasOrderPushMapper.insert(highGasOrderPush); if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); } highOrderService.updateOrder(order); } return ResponseMsgUtil.success(order); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } */ @RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyAccountInfo2JD() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryCompanyPriceDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyPriceDetail() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyPriceDetail("LW000115995", "92")); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/couJointDist", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "派发贵州卡券") public ResponseData couJointDist(@RequestParam(name = "token", required = true) String token) { try { return ResponseMsgUtil.success(HuiLianTongConfig.couJointDist(token, "HF2022031509263475105", "20JY000575", 1, "18385214742", "oArhO6QZSIJAcawo1Wwx5cKKZ0ns")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/tradeQuery", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "派发贵州卡券") public ResponseData tradeQuery(@RequestParam(name = "token", required = true) String token) { try { return ResponseMsgUtil.success(UnionPayConfig.tradeQuery(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, "HF2022031215130820400")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/zwrefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "派发贵州卡券") public ResponseData zwrefund() { try { return ResponseMsgUtil.success(UnionPayConfig.cancel(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, "HF" + System.currentTimeMillis(), "31720220622093814132759")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/unionPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "银联支付") public ResponseData unionPay(HttpServletRequest request) { try { // return ResponseMsgUtil.success(RequestUtils.getIpAddress(request)); return ResponseMsgUtil.success(unionPayConfig.upPreOrder(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, "HF" + System.currentTimeMillis(), new BigDecimal("1"), "test", CommonSysConst.getSysConfig().getUnionPayNotifyUrl(), request)); } catch (Exception e) { log.error("HighOrderController --> unionPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取贵州中石化token") public ResponseData getToken() { try { return ResponseMsgUtil.success(huiLianTongConfig.getToken()); } catch (Exception e) { log.error("HighOrderController --> getToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/unionTradeQuery", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "银联交易查询") public ResponseData unionTradeQuery(@RequestParam(name = "paySerialNo", required = true) String paySerialNo) { try { return ResponseMsgUtil.success(UnionPayConfig.tradeQuery(UnionPayConfig.MER_ID1, UnionPayConfig.TERM_ID1, paySerialNo)); } catch (Exception e) { log.error("HighOrderController --> unionTradeQuery() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrdersPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "星巴克支付") public ResponseData starbucksOrdersPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrdersPay(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payKfcOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "肯德基支付") public ResponseData payKfcOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.payKfcOrder(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deposit", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") public ResponseData deposit(@RequestParam(name = "orderNo", required = true) String orderNo) { try { // 汇联通充值 String goodsDesc = "汇联通充值1元"; String tranDesc = ""; String businessType = "ghk_deposit"; // 汇联通卡充值 JSONObject deposit = HuiLianTongUnionCardConfig.deposit("TEST2022334532783", "8800030115015135432", new BigDecimal(1), businessType, "1231231223", tranDesc); return ResponseMsgUtil.success(deposit); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxSplitAccount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "微信分账") public ResponseData wxSplitAccount() { try { HighOrder orderNo = highOrderService.getOrderByOrderNo("HF2021101812025050304"); wxProfitsharing(orderNo.getOrderNo(), orderNo.getPaySerialNo(), orderNo.getPayRealPrice()); return ResponseMsgUtil.success("分账成功"); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/unionStagingPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "银联分期支付") public ResponseData unionStagingPay(HttpServletRequest request) { try { /* String orderNo = DateUtil.format(new Date(), DateUtil.YMDHMS); orderNo += IDGenerator.nextId(28 - orderNo.length());*/ String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(unionStagingPayConfig.advancePay( orgTrace, orgTrace, new BigDecimal("1"), CommonSysConst.getSysConfig().getUnionStagingPayNotifyUrl(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryStaging", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期查询") public ResponseData queryStaging(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.queryStaging(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } /* @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "退款") public ResponseData orderToRefund(HttpServletRequest request) { try { OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund("4200001301202202035413938093", new BigDecimal("30.80"), new BigDecimal("16.90")); return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } }*/ @RequestMapping(value = "/query", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单查询") public ResponseData query(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.query(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/mposrefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期退款") public ResponseData mposrefund(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.standardRefund(orgTrace, oriOrgTrace, new BigDecimal("1"), "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/mposfindrefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期退款查询") public ResponseData mposfindrefund(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.mposfindrefund(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } public void wxProfitsharing(String transaction_id, String out_order_no, BigDecimal amount) { try { Map param = new LinkedHashMap<>(); param.put("appid", "wx637bd6f7314daa46"); param.put("mch_id", "1289663601"); param.put("sub_mch_id", "1609882817"); // 个体户黎杨珍 param.put("transaction_id", transaction_id); param.put("out_order_no", out_order_no); param.put("nonce_str", WxUtils.makeNonStr()); // 分账金额 BigDecimal porofitSharingAmount = amount; List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers", JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5", WXPayConstants.SignType.HMACSHA256); param.put("sign", signStr); String resultXmL = this.doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); if (!resultProfitSharing.getResult_code().equals("FAIL")) { HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(resultProfitSharing.getOut_order_no()); sharingRecord.setTransactionId(resultProfitSharing.getTransaction_id()); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(amount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); } } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); } } public CloseableHttpClient readCertificate(String mchId) throws Exception { /** * 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 */ KeyStore keyStore = KeyStore.getInstance("PKCS12"); //P12文件目录 证书路径,这里需要你自己修改,linux下还是windows下的根路径 FileInputStream instream = new FileInputStream("/home/project/wx_cert/1289663601_apiclient_cert.p12"); // FileInputStream instream = new FileInputStream("G:\\hurui-project/hai-parent/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12"); try { keyStore.load(instream, "1289663601".toCharArray());//这里写密码..默认是你的MCHID } finally { instream.close(); } SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, "1289663601".toCharArray()).build();//这里也是写密码的 SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, SSLConnectionSocketFactory.getDefaultHostnameVerifier()); // Allow TLSv1 protocol only return HttpClients.custom().setSSLSocketFactory(sslsf).build(); } public String doRefundRequest(String mchId, String url, String data) throws Exception { //小程序退款需要调用双向证书的认证 CloseableHttpClient httpClient = readCertificate(mchId); try { HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/profitsharing"); // 设置响应头信息 httpost.addHeader("Connection", "keep-alive"); httpost.addHeader("Accept", "*/*"); httpost.addHeader("Content-Type", "text/xml"); httpost.addHeader("Host", "api.mch.weixin.qq.com"); httpost.addHeader("X-Requested-With", "XMLHttpRequest"); httpost.addHeader("Cache-Control", "max-age=0"); httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); httpost.setEntity(new StringEntity(data, "UTF-8")); CloseableHttpResponse response = httpClient.execute(httpost); try { HttpEntity entity = response.getEntity(); String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); EntityUtils.consume(entity); return jsonStr; } finally { response.close(); } } catch (Exception e) { throw new RuntimeException(e); } finally { httpClient.close(); } } @RequestMapping(value = "/websocket", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "websocket") public ResponseData websocket(@RequestParam(name = "orderNo", required = true) String orderNo ) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { Map pushMsg = new HashMap<>(); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); Map msgContent = new HashMap<>(); msgContent.put("order", highOrderService.getGasOrderDetail(order.getOrderNo())); msgContent.put("voice", baiduVoiceService.text2audio(order.getHighChildOrderList().get(0).getGoodsName() + "加油站,收款:" + order.getTotalPrice())); pushMsg.put("message", JSONObject.toJSONString(msgContent)); HttpsUtils.doPost("http://127.0.0.1:9901/msg/test/websocket", pushMsg, new HashMap<>()); } return ResponseMsgUtil.success("null"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasPageQueryAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasPageQueryAllStation") public ResponseData gasPageQueryAllStation() { try { return ResponseMsgUtil.success(ShellGroupService.gasPageQueryAllStation(1, 50)); } catch (Exception e) { log.error("HighOrderController --> gasPageQueryAllStation() error!", e); return ResponseMsgUtil.exception(e); } } public static String hexStringToString(String s) { if (s == null || s.equals("")) { return null; } s = s.replace(" ", ""); byte[] baKeyword = new byte[s.length() / 2]; for (int i = 0; i < baKeyword.length; i++) { try { baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16)); } catch (Exception e) { e.printStackTrace(); } } try { s = new String(baKeyword, "UTF-8"); } catch (Exception e1) { e1.printStackTrace(); } return s; } /** * 获取打印内容,适用于云打印机 * * @param printText 打印文本 * @param pageCount 打印联数 * @param encodingStr 编码方式,默认UTF-8 * @return */ public byte[] getPrinterBytes(final byte[] printText, final int pageCount, String encodingStr) { try { byte[] array = new byte[printText.length + 9]; array[0] = 30; array[1] = 16; array[2] = (byte) pageCount;//打印份数 int num = array.length - 5; array[3] = (byte) (num >> 8); //array[4] = (byte)((uint)num & 0xFFu); array[4] = (byte) (num & 0xFF); for (int i = 0; i < printText.length; i++) { array[i + 5] = printText[i]; } array[array.length - 4] = 27; array[array.length - 3] = 99; byte[] crc16CodeArray = getCRC(printText); array[array.length - 2] = crc16CodeArray[0]; array[array.length - 1] = crc16CodeArray[1]; return array; /* if(encodingStr.equals("")){ encodingStr="UTF-8"; } byte[] msgByte = printText; // 消息数组 final byte[] dataByte = new byte[msgByte.length + 9]; dataByte[0] = 0x1E; dataByte[1] = 0x10; dataByte[2] = (byte) pageCount;// 打印多联 // 有效数据长度 final int len = dataByte.length - 5; dataByte[3] = (byte) (len >> 8); dataByte[4] = (byte) (len & 0xff); // 数据内容 System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length); // 标识字节 dataByte[dataByte.length - 4] = 0x1b; dataByte[dataByte.length - 3] = 0x63; // 打印内容CRC校验 final byte[] dtCRC = getCRC(msgByte); dataByte[dataByte.length - 2] = (byte) (dtCRC[0]); dataByte[dataByte.length - 1] = (byte) (dtCRC[1]); msgByte = dataByte; return msgByte;*/ } catch (Exception ex) { System.out.println(ex.getStackTrace()); } return null; } /** * 获取打印内容,适用于云打印机 * * @param printText 打印文本 * @param pageCount 打印联数 * @param encodingStr 编码方式,默认UTF-8 * @return */ public byte[] getPrinterBytes(final String printText, final int pageCount, String encodingStr) { try { if (encodingStr.equals("")) { encodingStr = "UTF-8"; } byte[] msgByte = printText.getBytes(encodingStr); // 消息数组 final byte[] dataByte = new byte[msgByte.length + 9]; dataByte[0] = 0x1E; dataByte[1] = 0x10; dataByte[2] = (byte) pageCount;// 打印多联 // 有效数据长度 final int len = dataByte.length - 5; dataByte[3] = (byte) (len >> 8); dataByte[4] = (byte) (len & 0xff); // 数据内容 System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length); // 标识字节 dataByte[dataByte.length - 4] = 0x1b; dataByte[dataByte.length - 3] = 0x63; // 打印内容CRC校验 final byte[] dtCRC = getCRC(msgByte); dataByte[dataByte.length - 2] = (byte) (dtCRC[0]); dataByte[dataByte.length - 1] = (byte) (dtCRC[1]); msgByte = dataByte; return msgByte; } catch (Exception ex) { System.out.println(ex.getStackTrace()); } return null; } private static int[] CRC16Table = {0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78}; private static byte[] getCRC(byte[] bytes) { int crc = 0xFFFF; // 初始值 for (byte b : bytes) { crc = (crc >> 8) ^ CRC16Table[(crc ^ b) & 0xff]; } byte[] b = new byte[2]; b[0] = (byte) ((crc >> 8) ^ 0xff); b[1] = (byte) ((crc & 0xff) ^ 0xff); return b; } private static final char[] HEXES = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; /** * byte数组 转换成 16进制小写字符串 */ private String bytes2Hex(byte[] bytes) { if (bytes == null || bytes.length == 0) { return null; } StringBuilder hex = new StringBuilder(); for (byte b : bytes) { hex.append(HEXES[(b >> 4) & 0x0F]); hex.append(HEXES[b & 0x0F]); } return hex.toString(); } @RequestMapping(value = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { String orderNo = "HF" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); JSONObject object = QianZhuConfig.insertV2("PLM100068", orderNo, "18090580471"); object.put("orderNo", orderNo); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/QueryV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单号") public ResponseData QueryV2(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); JSONObject orderObject = QianZhuConfig.QueryV2(orderNo); if (orderObject != null && orderObject.getLong("Code") == 999) { // 订单失败 // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 3) { // 订单失败 if (order.getOrderStatus() == 2) { highOrderService.thirdOrderToRefund(order.getId()); } else { highOrderService.thirdCancelOrder(order.getId()); } } // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 2) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(3); } order.setOrderStatus(3); order.setFinishTime(new Date()); highOrderService.updateOrder(order); } } return ResponseMsgUtil.success(QianZhuConfig.QueryV2(orderNo)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基订单") public ResponseData getKfcOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.getKfcOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询星巴克订单") public ResponseData starbucksOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/thirdOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "第三方退款") public ResponseData thirdOrderToRefund(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); highOrderService.thirdOrderToRefund(order.getId()); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇话费充值 ") public ResponseData rechargeOrderByCy() { try { JSONObject object = new JSONObject(); object.put("mobile" , "18090580471"); object.put("productId" , 172); object.put("agentOrderId" , "RCG" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); return ResponseMsgUtil.success(RechargeConfig.rechargeOrderByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryRechargeByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇查询订单") public ResponseData queryRechargeByCy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); object.put("orderNo" , orderNo); return ResponseMsgUtil.success(RechargeConfig.queryRechargeByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/postIp", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求ip地址") public ResponseData postIp() { try { return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/brest/openApi/test")); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.cweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.hai.common.Base64Util; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.*; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.bouncycastle.util.encoders.UrlBase64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.IdGenerator; import org.springframework.web.bind.annotation.*; import sun.nio.cs.StreamEncoder; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import java.io.*; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HighOrderService highOrderService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @Resource private HighGasOrderPushMapper highGasOrderPushMapper; @Resource private HuiLianTongConfig huiLianTongConfig; @Resource private UnionPayConfig unionPayConfig; @Resource private UnionStagingPayConfig unionStagingPayConfig; @Resource private UnionUserConfig unionUserConfig; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HighOilCardService oilCardService; @Resource private BaiduVoiceService baiduVoiceService; @Resource private MqttProviderConfig mqttProviderConfig; @Autowired private WebSocket webSocket; @RequestMapping(value = "/wxGasProfitsharing", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "wxGasProfitsharing") public ResponseData wxGasProfitsharing(@RequestParam(name = "orderNo", required = true) String orderNo, HttpServletRequest request) { try { // 查询订单 HighOrder order = highOrderService.getOrderByOrderNo(orderNo); BigDecimal rake = new BigDecimal("0.05"); // 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal wxHandlingFee = order.getPayRealPrice().multiply(new BigDecimal("0.002")).setScale(2, BigDecimal.ROUND_HALF_DOWN); BigDecimal price = order.getPayRealPrice().subtract(wxHandlingFee); // 计算分账金额 手续费后的价格 * 0.05 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal profitSharingAmount = price.multiply(rake).setScale(2, BigDecimal.ROUND_DOWN); this.wxGasProfitsharing(order.getExt1(), order.getPaySerialNo(), order.getOrderNo(), profitSharingAmount); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } public void wxGasProfitsharing(String appid, String transaction_id, String out_order_no, BigDecimal amount) { try { Map param = new LinkedHashMap<>(); param.put("appid", appid); param.put("mch_id", "1289663601"); param.put("sub_mch_id", "1624126902"); // 个体户黎杨珍 param.put("transaction_id", transaction_id); param.put("out_order_no", out_order_no); param.put("nonce_str", WxUtils.makeNonStr()); // 分账金额 BigDecimal porofitSharingAmount = amount; List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers", JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5", WXPayConstants.SignType.HMACSHA256); param.put("sign", signStr); String resultXmL = this.doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(out_order_no); sharingRecord.setTransactionId(transaction_id); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(amount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); } } @RequestMapping(value = "/addPrinter", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡详情") public ResponseData addPrinter(HttpServletRequest request) { try { SpPrinterConfig spPrinterConfig = new SpPrinterConfig(); return ResponseMsgUtil.success( spPrinterConfig.addPrinter( "1540500213", "bxpjpnh4", "丹凤加油站打印机" ) ); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryThirdOrderDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单结果查询") public ResponseData queryThirdOrderDretail(HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDetail("HF2022051214411536507")); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/spPrint", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发送打印机消息") public ResponseData spPrint(@RequestParam(name = "orderNo", required = true) String orderNo, HttpServletRequest request) { try { HighOrder highOrder = highOrderService.getOrderByOrderNo(orderNo); for (HighChildOrder highChildOrder : highOrder.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); new Thread(() -> { try { SpPrinterConfig sp = new SpPrinterConfig(); sp.print(store.getDeviceSn(), SpPrinterTemplate.oilCashierStubTemp( highChildOrder.getGoodsName(), highOrder.getOrderNo(), DateUtil.date2String(highOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), "嗨森逛", highChildOrder.getGasGunNo(), highChildOrder.getGasOilNo(), highChildOrder.getGasOilLiters().toString(), highOrder.getTotalPrice().toString(), new HashMap<>(), false ), 1); Thread.sleep(6000); sp.print(store.getDeviceSn(), SpPrinterTemplate.oilClientStubTemp( highChildOrder.getGoodsName(), highOrder.getOrderNo(), DateUtil.date2String(highOrder.getPayTime(), "yyyy-MM-dd HH:mm:ss"), "嗨森逛", highChildOrder.getGasGunNo(), highChildOrder.getGasOilNo(), highChildOrder.getGasOilLiters().toString(), highOrder.getTotalPrice().toString(), new HashMap<>(), false ), 1); } catch (Exception e) { e.printStackTrace(); } }).start(); } return ResponseMsgUtil.success("发送成功"); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/text2audio", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "文本转语音") public ResponseData text2audio(HttpServletRequest request) { try { JSONObject jsonObject = new JSONObject(); jsonObject.put("type", "tts_dynamic"); jsonObject.put("msgid", System.currentTimeMillis() + ""); // jsonObject.put("txt", "有新的加油站订单,请及时处理".getBytes("GBK")); jsonObject.put("txt", "有新的加油站订单,请及时查看".getBytes("GBK")); // mqttProviderConfig.publish(2, false, "869298051949691", jsonObject.toJSONString()); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getGasDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡详情") public ResponseData getGasDetail(@RequestParam(name = "cardNo", required = true) String cardNo, HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryGasInfoByGasId(cardNo)); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoByGasId", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据油站 id 拉取最新的油站数据") public ResponseData queryGasInfoByGasId(@RequestParam(name = "gasId", required = true) String gasId, HttpServletRequest request) { try { return ResponseMsgUtil.success(TuanYouConfig.queryGasInfoByGasId(gasId)); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); return ResponseMsgUtil.exception(e); } } // // @RequestMapping(value = "/getMobile", method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "话费充值") // public ResponseData getMobile( // @RequestParam(name = "orderNo", required = true) String orderNo, // @RequestParam(name = "amount", required = true) Integer amount, // @RequestParam(name = "phone", required = true) String phone, // HttpServletRequest request) { // try { // return ResponseMsgUtil.success(outRechargeOrderService.getMobile(phone,amount,orderNo)); // // } catch (Exception e) { // log.error("HighUserCardController --> getHuiLianTongCardInfo() error!", e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value = "/initTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "初始化加油站") public ResponseData initTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue(); i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); if (store != null) { store.setType(1); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } } return ResponseMsgUtil.success("初始化完成"); } @RequestMapping(value = "/detectTYMerchantStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "检测加油站") public ResponseData detectTYMerchantStore(@RequestParam(name = "merchantId", required = true) Long merchantId) throws Exception { HighMerchantModel merchant = highMerchantService.getMerchantById(merchantId); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } Map param = new HashMap<>(); param.put("merchantId", merchant.getId()); List stores = highMerchantStoreService.getMerchantStoreList(param); for (HighMerchantStore store : stores) { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(store.getStoreKey()); if (jsonObject != null && jsonObject.getString("code").equals("200")) { JSONObject result = jsonObject.getJSONObject("result"); store.setStatus(result.getInteger("gasStatus")); } else { store.setStatus(0); } highMerchantStoreService.updateMerchantStoreDetail(store); } return ResponseMsgUtil.success("初始化完成"); } /* @RequestMapping(value = "/pushTuanYouOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "推送团油订单") public ResponseData pushTuanYouOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); for (HighChildOrder highChildOrder : order.getHighChildOrderList()) { HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); // 推送团油订单 Map paramMap = new HashMap<>(); paramMap.put("gasId", store.getStoreKey()); paramMap.put("oilNo", highChildOrder.getGasOilNo()); paramMap.put("gunNo", highChildOrder.getGasGunNo()); BigDecimal priceGun = highChildOrder.getGasPriceGun(); BigDecimal priceVip = highChildOrder.getGasPriceVip(); paramMap.put("priceGun", priceGun); // 枪单价 paramMap.put("priceVip", priceVip); // 优惠价 paramMap.put("driverPhone", order.getMemPhone()); // paramMap.put("driverPhone", "17726395120"); paramMap.put("thirdSerialNo", order.getOrderNo()); paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); // 油品类型 1:汽油:2:柴油;3:天然气 if (highChildOrder.getGasOilType() == 1) { paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouGasolineAccount()); } else if (highChildOrder.getGasOilType() == 2) { paramMap.put("accountNo", CommonSysConst.getSysConfig().getTuanYouDieselAccount()); } JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); // 推送团油订单记录 HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); highGasOrderPush.setCreateTime(new Date()); highGasOrderPush.setCode(orderPushObject.getString("code")); highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap)); highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); highGasOrderPushMapper.insert(highGasOrderPush); if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); } highOrderService.updateOrder(order); } return ResponseMsgUtil.success(order); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } */ @RequestMapping(value = "/queryCompanyAccountInfo2JD", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyAccountInfo2JD() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyAccountInfo2JD()); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryCompanyPriceDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油余额") public ResponseData queryCompanyPriceDetail() { try { return ResponseMsgUtil.success(TuanYouConfig.queryCompanyPriceDetail("LW000115995", "92")); } catch (Exception e) { log.error("HighOrderController --> queryCompanyAccountInfo2JD() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/couJointDist", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "派发贵州卡券") public ResponseData couJointDist(@RequestParam(name = "token", required = true) String token) { try { return ResponseMsgUtil.success(HuiLianTongConfig.couJointDist(token, "HF2022031509263475105", "20JY000575", 1, "18385214742", "oArhO6QZSIJAcawo1Wwx5cKKZ0ns")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/tradeQuery", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "派发贵州卡券") public ResponseData tradeQuery(@RequestParam(name = "token", required = true) String token) { try { return ResponseMsgUtil.success(UnionPayConfig.tradeQuery(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, "HF2022031215130820400")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/zwrefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "派发贵州卡券") public ResponseData zwrefund() { try { return ResponseMsgUtil.success(UnionPayConfig.cancel(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, "HF" + System.currentTimeMillis(), "31720220622093814132759")); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/unionPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "银联支付") public ResponseData unionPay(HttpServletRequest request) { try { // return ResponseMsgUtil.success(RequestUtils.getIpAddress(request)); return ResponseMsgUtil.success(unionPayConfig.upPreOrder(UnionPayConfig.MER_ID3, UnionPayConfig.TERM_ID3, "HF" + System.currentTimeMillis(), new BigDecimal("1"), "test", CommonSysConst.getSysConfig().getUnionPayNotifyUrl(), request)); } catch (Exception e) { log.error("HighOrderController --> unionPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取贵州中石化token") public ResponseData getToken() { try { return ResponseMsgUtil.success(huiLianTongConfig.getToken()); } catch (Exception e) { log.error("HighOrderController --> getToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/unionTradeQuery", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "银联交易查询") public ResponseData unionTradeQuery(@RequestParam(name = "paySerialNo", required = true) String paySerialNo) { try { return ResponseMsgUtil.success(UnionPayConfig.tradeQuery(UnionPayConfig.MER_ID1, UnionPayConfig.TERM_ID1, paySerialNo)); } catch (Exception e) { log.error("HighOrderController --> unionTradeQuery() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrdersPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "星巴克支付") public ResponseData starbucksOrdersPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrdersPay(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payKfcOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "肯德基支付") public ResponseData payKfcOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.payKfcOrder(orderNo)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deposit", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") public ResponseData deposit(@RequestParam(name = "orderNo", required = true) String orderNo) { try { // 汇联通充值 String goodsDesc = "汇联通充值1元"; String tranDesc = ""; String businessType = "ghk_deposit"; // 汇联通卡充值 JSONObject deposit = HuiLianTongUnionCardConfig.deposit("TEST2022334532783", "8800030115015135432", new BigDecimal(1), businessType, "1231231223", tranDesc); return ResponseMsgUtil.success(deposit); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/wxSplitAccount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "微信分账") public ResponseData wxSplitAccount() { try { HighOrder orderNo = highOrderService.getOrderByOrderNo("HF2021101812025050304"); wxProfitsharing(orderNo.getOrderNo(), orderNo.getPaySerialNo(), orderNo.getPayRealPrice()); return ResponseMsgUtil.success("分账成功"); } catch (Exception e) { log.error("HighOrderController --> getOrderById() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/unionStagingPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "银联分期支付") public ResponseData unionStagingPay(HttpServletRequest request) { try { /* String orderNo = DateUtil.format(new Date(), DateUtil.YMDHMS); orderNo += IDGenerator.nextId(28 - orderNo.length());*/ String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(unionStagingPayConfig.advancePay( orgTrace, orgTrace, new BigDecimal("1"), CommonSysConst.getSysConfig().getUnionStagingPayNotifyUrl(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryStaging", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期查询") public ResponseData queryStaging(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.queryStaging(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } /* @RequestMapping(value = "/orderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "退款") public ResponseData orderToRefund(HttpServletRequest request) { try { OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund("4200001301202202035413938093", new BigDecimal("30.80"), new BigDecimal("16.90")); return ResponseMsgUtil.success(orderRefundModel); } catch (Exception e) { log.error("HighOrderController --> orderToRefund() error!", e); return ResponseMsgUtil.exception(e); } }*/ @RequestMapping(value = "/query", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单查询") public ResponseData query(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.query(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/mposrefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期退款") public ResponseData mposrefund(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.standardRefund(orgTrace, oriOrgTrace, new BigDecimal("1"), "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/mposfindrefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "分期退款查询") public ResponseData mposfindrefund(@RequestParam(name = "oriOrgTrace", required = true) String oriOrgTrace, HttpServletRequest request) { try { String orgTrace = CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(0, 4) + CommonSysConst.getSysConfig().getUnionStagingPayOrgId().substring(CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length() - 4, CommonSysConst.getSysConfig().getUnionStagingPayOrgId().length()) + DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(6); return ResponseMsgUtil.success(UnionStagingPayConfig.mposfindrefund(orgTrace, oriOrgTrace, "", new Date(), request)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } public void wxProfitsharing(String transaction_id, String out_order_no, BigDecimal amount) { try { Map param = new LinkedHashMap<>(); param.put("appid", "wx637bd6f7314daa46"); param.put("mch_id", "1289663601"); param.put("sub_mch_id", "1609882817"); // 个体户黎杨珍 param.put("transaction_id", transaction_id); param.put("out_order_no", out_order_no); param.put("nonce_str", WxUtils.makeNonStr()); // 分账金额 BigDecimal porofitSharingAmount = amount; List> receiversList = new ArrayList<>(); Map receiversMap = new LinkedHashMap<>(); receiversMap.put("type", "MERCHANT_ID"); receiversMap.put("account", "1603942866"); receiversMap.put("amount", porofitSharingAmount.multiply(new BigDecimal("100")).intValue()); receiversMap.put("description", "分给商户【惠昕石化】"); receiversList.add(receiversMap); param.put("receivers", JSONObject.toJSONString(receiversList)); String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5", WXPayConstants.SignType.HMACSHA256); param.put("sign", signStr); String resultXmL = this.doRefundRequest(param.get("mch_id"), null, WxUtils.mapToXml(param)); // 请求分账返回的结果 ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class); if (!resultProfitSharing.getResult_code().equals("FAIL")) { HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord(); sharingRecord.setOutOrderNo(resultProfitSharing.getOut_order_no()); sharingRecord.setTransactionId(resultProfitSharing.getTransaction_id()); sharingRecord.setOrderId(resultProfitSharing.getOrder_id()); sharingRecord.setStatus(resultProfitSharing.getResult_code()); sharingRecord.setPrice(amount); sharingRecord.setCreateTime(new Date()); sharingRecord.setContent(resultXmL); highProfitSharingRecordService.insert(sharingRecord); } } catch (Exception e) { log.error("CmsContentController --> getCorporateAdvertising() error!", e); } } public CloseableHttpClient readCertificate(String mchId) throws Exception { /** * 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 */ KeyStore keyStore = KeyStore.getInstance("PKCS12"); //P12文件目录 证书路径,这里需要你自己修改,linux下还是windows下的根路径 FileInputStream instream = new FileInputStream("/home/project/wx_cert/1289663601_apiclient_cert.p12"); // FileInputStream instream = new FileInputStream("G:\\hurui-project/hai-parent/hai-service/src/main/java/privatekey/1289663601_apiclient_cert.p12"); try { keyStore.load(instream, "1289663601".toCharArray());//这里写密码..默认是你的MCHID } finally { instream.close(); } SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, "1289663601".toCharArray()).build();//这里也是写密码的 SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, SSLConnectionSocketFactory.getDefaultHostnameVerifier()); // Allow TLSv1 protocol only return HttpClients.custom().setSSLSocketFactory(sslsf).build(); } public String doRefundRequest(String mchId, String url, String data) throws Exception { //小程序退款需要调用双向证书的认证 CloseableHttpClient httpClient = readCertificate(mchId); try { HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/profitsharing"); // 设置响应头信息 httpost.addHeader("Connection", "keep-alive"); httpost.addHeader("Accept", "*/*"); httpost.addHeader("Content-Type", "text/xml"); httpost.addHeader("Host", "api.mch.weixin.qq.com"); httpost.addHeader("X-Requested-With", "XMLHttpRequest"); httpost.addHeader("Cache-Control", "max-age=0"); httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); httpost.setEntity(new StringEntity(data, "UTF-8")); CloseableHttpResponse response = httpClient.execute(httpost); try { HttpEntity entity = response.getEntity(); String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); EntityUtils.consume(entity); return jsonStr; } finally { response.close(); } } catch (Exception e) { throw new RuntimeException(e); } finally { httpClient.close(); } } @RequestMapping(value = "/websocket", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "websocket") public ResponseData websocket(@RequestParam(name = "orderNo", required = true) String orderNo ) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getHighChildOrderList().get(0).getGoodsType().equals(3)) { Map pushMsg = new HashMap<>(); pushMsg.put("userId", order.getHighChildOrderList().get(0).getGoodsId()); Map msgContent = new HashMap<>(); msgContent.put("order", highOrderService.getGasOrderDetail(order.getOrderNo())); msgContent.put("voice", baiduVoiceService.text2audio(order.getHighChildOrderList().get(0).getGoodsName() + "加油站,收款:" + order.getTotalPrice())); pushMsg.put("message", JSONObject.toJSONString(msgContent)); HttpsUtils.doPost("http://127.0.0.1:9901/msg/test/websocket", pushMsg, new HashMap<>()); } return ResponseMsgUtil.success("null"); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/gasPageQueryAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "gasPageQueryAllStation") public ResponseData gasPageQueryAllStation() { try { return ResponseMsgUtil.success(ShellGroupService.gasPageQueryAllStation(1, 50)); } catch (Exception e) { log.error("HighOrderController --> gasPageQueryAllStation() error!", e); return ResponseMsgUtil.exception(e); } } public static String hexStringToString(String s) { if (s == null || s.equals("")) { return null; } s = s.replace(" ", ""); byte[] baKeyword = new byte[s.length() / 2]; for (int i = 0; i < baKeyword.length; i++) { try { baKeyword[i] = (byte) (0xff & Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16)); } catch (Exception e) { e.printStackTrace(); } } try { s = new String(baKeyword, "UTF-8"); } catch (Exception e1) { e1.printStackTrace(); } return s; } /** * 获取打印内容,适用于云打印机 * * @param printText 打印文本 * @param pageCount 打印联数 * @param encodingStr 编码方式,默认UTF-8 * @return */ public byte[] getPrinterBytes(final byte[] printText, final int pageCount, String encodingStr) { try { byte[] array = new byte[printText.length + 9]; array[0] = 30; array[1] = 16; array[2] = (byte) pageCount;//打印份数 int num = array.length - 5; array[3] = (byte) (num >> 8); //array[4] = (byte)((uint)num & 0xFFu); array[4] = (byte) (num & 0xFF); for (int i = 0; i < printText.length; i++) { array[i + 5] = printText[i]; } array[array.length - 4] = 27; array[array.length - 3] = 99; byte[] crc16CodeArray = getCRC(printText); array[array.length - 2] = crc16CodeArray[0]; array[array.length - 1] = crc16CodeArray[1]; return array; /* if(encodingStr.equals("")){ encodingStr="UTF-8"; } byte[] msgByte = printText; // 消息数组 final byte[] dataByte = new byte[msgByte.length + 9]; dataByte[0] = 0x1E; dataByte[1] = 0x10; dataByte[2] = (byte) pageCount;// 打印多联 // 有效数据长度 final int len = dataByte.length - 5; dataByte[3] = (byte) (len >> 8); dataByte[4] = (byte) (len & 0xff); // 数据内容 System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length); // 标识字节 dataByte[dataByte.length - 4] = 0x1b; dataByte[dataByte.length - 3] = 0x63; // 打印内容CRC校验 final byte[] dtCRC = getCRC(msgByte); dataByte[dataByte.length - 2] = (byte) (dtCRC[0]); dataByte[dataByte.length - 1] = (byte) (dtCRC[1]); msgByte = dataByte; return msgByte;*/ } catch (Exception ex) { System.out.println(ex.getStackTrace()); } return null; } /** * 获取打印内容,适用于云打印机 * * @param printText 打印文本 * @param pageCount 打印联数 * @param encodingStr 编码方式,默认UTF-8 * @return */ public byte[] getPrinterBytes(final String printText, final int pageCount, String encodingStr) { try { if (encodingStr.equals("")) { encodingStr = "UTF-8"; } byte[] msgByte = printText.getBytes(encodingStr); // 消息数组 final byte[] dataByte = new byte[msgByte.length + 9]; dataByte[0] = 0x1E; dataByte[1] = 0x10; dataByte[2] = (byte) pageCount;// 打印多联 // 有效数据长度 final int len = dataByte.length - 5; dataByte[3] = (byte) (len >> 8); dataByte[4] = (byte) (len & 0xff); // 数据内容 System.arraycopy(msgByte, 0, dataByte, 5, msgByte.length); // 标识字节 dataByte[dataByte.length - 4] = 0x1b; dataByte[dataByte.length - 3] = 0x63; // 打印内容CRC校验 final byte[] dtCRC = getCRC(msgByte); dataByte[dataByte.length - 2] = (byte) (dtCRC[0]); dataByte[dataByte.length - 1] = (byte) (dtCRC[1]); msgByte = dataByte; return msgByte; } catch (Exception ex) { System.out.println(ex.getStackTrace()); } return null; } private static int[] CRC16Table = {0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78}; private static byte[] getCRC(byte[] bytes) { int crc = 0xFFFF; // 初始值 for (byte b : bytes) { crc = (crc >> 8) ^ CRC16Table[(crc ^ b) & 0xff]; } byte[] b = new byte[2]; b[0] = (byte) ((crc >> 8) ^ 0xff); b[1] = (byte) ((crc & 0xff) ^ 0xff); return b; } private static final char[] HEXES = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; /** * byte数组 转换成 16进制小写字符串 */ private String bytes2Hex(byte[] bytes) { if (bytes == null || bytes.length == 0) { return null; } StringBuilder hex = new StringBuilder(); for (byte b : bytes) { hex.append(HEXES[(b >> 4) & 0x0F]); hex.append(HEXES[b & 0x0F]); } return hex.toString(); } @RequestMapping(value = "/insertV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付") public ResponseData insertV2() { try { String orderNo = "HF" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5); JSONObject object = QianZhuConfig.insertV2("PLM100068", orderNo, "18090580471"); object.put("orderNo", orderNo); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/QueryV2", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单号") public ResponseData QueryV2(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); JSONObject orderObject = QianZhuConfig.QueryV2(orderNo); if (orderObject != null && orderObject.getLong("Code") == 999) { // 订单失败 // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 3) { // 订单失败 if (order.getOrderStatus() == 2) { highOrderService.thirdOrderToRefund(order.getId()); } else { highOrderService.thirdCancelOrder(order.getId()); } } // 订单状态 1:订单正在处理中 2;订单成功: 3 订单失败 if (orderObject.getJSONObject("Data").getInteger("OrderState") == 2) { for (HighChildOrder childOrder : order.getHighChildOrderList()) { childOrder.setChildOrdeStatus(3); } order.setOrderStatus(3); order.setFinishTime(new Date()); highOrderService.updateOrder(order); } } return ResponseMsgUtil.success(QianZhuConfig.QueryV2(orderNo)); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getKfcOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询肯德基订单") public ResponseData getKfcOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.getKfcOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/starbucksOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询星巴克订单") public ResponseData starbucksOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { return ResponseMsgUtil.success(QianZhuConfig.starbucksOrderByOrderNo(orderNo)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/thirdOrderToRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "第三方退款") public ResponseData thirdOrderToRefund(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); highOrderService.thirdOrderToRefund(order.getId()); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇话费充值 ") public ResponseData rechargeOrderByCy() { try { JSONObject object = new JSONObject(); object.put("mobile" , "18090580471"); object.put("productId" , 172); object.put("agentOrderId" , "RCG" + DateUtil.date2String(new Date(), "yyyyMMddHHmmss") + IDGenerator.nextId(5)); return ResponseMsgUtil.success(RechargeConfig.rechargeOrderByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryRechargeByCy", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "城宇查询订单") public ResponseData queryRechargeByCy(@RequestParam(name = "orderNo", required = true) String orderNo) { try { JSONObject object = new JSONObject(); object.put("orderNo" , orderNo); return ResponseMsgUtil.success(RechargeConfig.queryRechargeByCy(object)); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/postIp", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求ip地址") public ResponseData postIp() { try { return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsgcs.dctpay.com/brest/openApi/test")); } catch (Exception e) { log.error("HighOrderController -> addOrder() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java index 47e51c13..df13d2dd 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java @@ -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(); } } diff --git a/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java b/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java index 88fb65ff..d2b3aecc 100644 --- a/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java +++ b/hai-service/src/main/java/com/hai/config/SpPrinterTemplate.java @@ -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 = "" + dataCount.getClassNum() + "班结流水" + (makeUp?"(补打)":"") + "
" + + "===============================
" + + "开始时间:" + DateUtil.date2String(dataCount.getStartTime(), "yyyy-MM-dd HH:mm:ss") + "
" + + "结束时间:" + DateUtil.date2String(dataCount.getEndTime(), "yyyy-MM-dd HH:mm:ss") + "
" + + "
" + + "加油金额汇总:" + dataCount.getRefuelPrice() + "元
" + + "加油笔数汇总:" + dataCount.getRefuelNum() + "笔
" + + "加油升数汇总:" + dataCount.getRefuelLiters() + "升
" + + "
" + + "退款金额汇总:" + dataCount.getRefundPrice() + "元
" + + "退款笔数汇总:" + dataCount.getRefundNum() + "笔
" + + "退款升数汇总:" + dataCount.getRefundLiters() + "升
" + + "
" + + "--------------收款-------------
" + + "油号 金额(元) 升数 笔数
"; + + String oilCountStr = ""; + for (GasClassGroupTaskOilCount oilCount : dataCount.getGroupTaskOilCountList()) { + oilCountStr += oilCount.getOilNo() + "# " + oilCount.getRefuelPrice() + " " + oilCount.getRefuelLiters() + " " + oilCount.getRefuelNum() + "
"; + } + str += oilCountStr + + "================================
" + + "" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") +"
"; + 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 = "" + gasName + "
" + + String orderPrice, + Map receiptMap, + boolean makeUp) throws Exception { + + String str = "" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨森逛") + "
" + + "" + gasName + (makeUp?"(补打)":"") + "
" + "(收银员存根)
" + "------------------------------
" + "流水:" + orderNo + "
" + @@ -39,7 +78,7 @@ public class SpPrinterTemplate { "打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "
" + "支付时间:" + payTime + "
" + "电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "
" + - "来源:" + source + "
" + + "来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "
" + "油枪:"+ gunNo + "号
" + "油品:" + oilNo + "#
" + "升数:" + oilLiters +"升
" + @@ -48,7 +87,7 @@ public class SpPrinterTemplate { "加油金额
" + "¥" + orderPrice + "元
" + "------------------------------
" + - "开心又省钱; 来"嗨森逛""; + ""+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"") + ""; 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 = "" + gasName + "
" + + String orderPrice, + Map receiptMap, + boolean makeUp) throws Exception { + String str = "" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨森逛") + "
" + + "" + gasName + (makeUp?"(补打)":"") + "
" + "(客户存根)
" + "------------------------------
" + "流水:" + orderNo + "
" + @@ -81,7 +123,7 @@ public class SpPrinterTemplate { "打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "
" + "支付时间:" + payTime + "
" + "电话:" + phone.substring(0, 3) + "****" + phone.substring(7) + "
" + - "来源:" + source + "
" + + "来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "
" + "油枪:"+ gunNo + "号
" + "油品:" + oilNo + "#
" + "升数:" + oilLiters +"升
" + @@ -90,7 +132,7 @@ public class SpPrinterTemplate { "加油金额
" + "¥" + orderPrice + "元
" + "------------------------------
" + - "开心又省钱; 来"嗨森逛""; + ""+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"") + ""; return str; } diff --git a/hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java b/hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java index 2bc51261..d10150ec 100644 --- a/hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java +++ b/hai-service/src/main/java/com/hai/config/ZkcPrinterTemplate.java @@ -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 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 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")); diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java index e252526a..c92fd604 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java @@ -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},", diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java index 80f9f769..e89debe9 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java @@ -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}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java b/hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java index e0bef313..747c7ef4 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighDeviceMapper.java @@ -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},", diff --git a/hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java index 5ab171a7..c80fc52a 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighDeviceSqlProvider.java @@ -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}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapper.java new file mode 100644 index 00000000..a16ab939 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapper.java @@ -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 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); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapperExt.java new file mode 100644 index 00000000..503e6a44 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface HighGasClassGroupMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupSqlProvider.java new file mode 100644 index 00000000..c969449a --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupSqlProvider.java @@ -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 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 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 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 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()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapper.java new file mode 100644 index 00000000..2575fc07 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapper.java @@ -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 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); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapperExt.java new file mode 100644 index 00000000..82bba05d --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskMapperExt.java @@ -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("") + Map countRefuelData(@Param("gasClassGroupTaskId") Long gasClassGroupTaskId); + + @Select("") + Map countRefundData(@Param("gasClassGroupTaskId") Long gasClassGroupTaskId); + + @Select("") + List> 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); +} diff --git a/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskSqlProvider.java new file mode 100644 index 00000000..21438453 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/HighGasClassGroupTaskSqlProvider.java @@ -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 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 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 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 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()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java index 482c4dd4..41b38ac2 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java @@ -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},", diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java index c1aa28b9..58c40e8f 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java @@ -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), diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java index 8287ae2e..714766f9 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java @@ -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}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java index 66cfea4f..4ed30445 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java @@ -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); diff --git a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java index e852c7fc..cdde1256 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java @@ -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 values) { + addCriterion("gas_class_group_id in", values, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdNotIn(List 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 values) { + addCriterion("gas_class_group_name in", values, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameNotIn(List 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 values) { + addCriterion("gas_class_group_task_id in", values, "gasClassGroupTaskId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupTaskIdNotIn(List 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; diff --git a/hai-service/src/main/java/com/hai/entity/HighDevice.java b/hai-service/src/main/java/com/hai/entity/HighDevice.java index 6b681185..0a1e1542 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDevice.java +++ b/hai-service/src/main/java/com/hai/entity/HighDevice.java @@ -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); diff --git a/hai-service/src/main/java/com/hai/entity/HighDeviceExample.java b/hai-service/src/main/java/com/hai/entity/HighDeviceExample.java index 0c510035..3380cdd7 100644 --- a/hai-service/src/main/java/com/hai/entity/HighDeviceExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighDeviceExample.java @@ -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 values) { + addCriterion("receipt_top in", values, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopNotIn(List 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 values) { + addCriterion("receipt_source in", values, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceNotIn(List 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 values) { + addCriterion("receipt_bottom in", values, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomNotIn(List 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; diff --git a/hai-service/src/main/java/com/hai/entity/HighGasClassGroup.java b/hai-service/src/main/java/com/hai/entity/HighGasClassGroup.java new file mode 100644 index 00000000..03cc5801 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasClassGroup.java @@ -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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighGasClassGroupExample.java b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupExample.java new file mode 100644 index 00000000..29c66a91 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupExample.java @@ -0,0 +1,1013 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighGasClassGroupExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighGasClassGroupExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIsNull() { + addCriterion("merchant_store_id is null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIsNotNull() { + addCriterion("merchant_store_id is not null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdEqualTo(Long value) { + addCriterion("merchant_store_id =", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotEqualTo(Long value) { + addCriterion("merchant_store_id <>", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdGreaterThan(Long value) { + addCriterion("merchant_store_id >", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("merchant_store_id >=", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdLessThan(Long value) { + addCriterion("merchant_store_id <", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdLessThanOrEqualTo(Long value) { + addCriterion("merchant_store_id <=", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIn(List values) { + addCriterion("merchant_store_id in", values, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotIn(List values) { + addCriterion("merchant_store_id not in", values, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdBetween(Long value1, Long value2) { + addCriterion("merchant_store_id between", value1, value2, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotBetween(Long value1, Long value2) { + addCriterion("merchant_store_id not between", value1, value2, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIsNull() { + addCriterion("merchant_store_name is null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIsNotNull() { + addCriterion("merchant_store_name is not null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameEqualTo(String value) { + addCriterion("merchant_store_name =", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotEqualTo(String value) { + addCriterion("merchant_store_name <>", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameGreaterThan(String value) { + addCriterion("merchant_store_name >", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("merchant_store_name >=", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLessThan(String value) { + addCriterion("merchant_store_name <", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLessThanOrEqualTo(String value) { + addCriterion("merchant_store_name <=", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLike(String value) { + addCriterion("merchant_store_name like", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotLike(String value) { + addCriterion("merchant_store_name not like", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIn(List values) { + addCriterion("merchant_store_name in", values, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotIn(List values) { + addCriterion("merchant_store_name not in", values, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameBetween(String value1, String value2) { + addCriterion("merchant_store_name between", value1, value2, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotBetween(String value1, String value2) { + addCriterion("merchant_store_name not between", value1, value2, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andPrincipalNameIsNull() { + addCriterion("principal_name is null"); + return (Criteria) this; + } + + public Criteria andPrincipalNameIsNotNull() { + addCriterion("principal_name is not null"); + return (Criteria) this; + } + + public Criteria andPrincipalNameEqualTo(String value) { + addCriterion("principal_name =", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameNotEqualTo(String value) { + addCriterion("principal_name <>", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameGreaterThan(String value) { + addCriterion("principal_name >", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameGreaterThanOrEqualTo(String value) { + addCriterion("principal_name >=", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameLessThan(String value) { + addCriterion("principal_name <", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameLessThanOrEqualTo(String value) { + addCriterion("principal_name <=", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameLike(String value) { + addCriterion("principal_name like", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameNotLike(String value) { + addCriterion("principal_name not like", value, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameIn(List values) { + addCriterion("principal_name in", values, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameNotIn(List values) { + addCriterion("principal_name not in", values, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameBetween(String value1, String value2) { + addCriterion("principal_name between", value1, value2, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalNameNotBetween(String value1, String value2) { + addCriterion("principal_name not between", value1, value2, "principalName"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneIsNull() { + addCriterion("principal_phone is null"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneIsNotNull() { + addCriterion("principal_phone is not null"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneEqualTo(String value) { + addCriterion("principal_phone =", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneNotEqualTo(String value) { + addCriterion("principal_phone <>", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneGreaterThan(String value) { + addCriterion("principal_phone >", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneGreaterThanOrEqualTo(String value) { + addCriterion("principal_phone >=", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneLessThan(String value) { + addCriterion("principal_phone <", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneLessThanOrEqualTo(String value) { + addCriterion("principal_phone <=", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneLike(String value) { + addCriterion("principal_phone like", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneNotLike(String value) { + addCriterion("principal_phone not like", value, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneIn(List values) { + addCriterion("principal_phone in", values, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneNotIn(List values) { + addCriterion("principal_phone not in", values, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneBetween(String value1, String value2) { + addCriterion("principal_phone between", value1, value2, "principalPhone"); + return (Criteria) this; + } + + public Criteria andPrincipalPhoneNotBetween(String value1, String value2) { + addCriterion("principal_phone not between", value1, value2, "principalPhone"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTask.java b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTask.java new file mode 100644 index 00000000..d27250f6 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTask.java @@ -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(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTaskExample.java b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTaskExample.java new file mode 100644 index 00000000..97944e37 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasClassGroupTaskExample.java @@ -0,0 +1,1183 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighGasClassGroupTaskExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighGasClassGroupTaskExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + 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 values) { + addCriterion("gas_class_group_id in", values, "gasClassGroupId"); + return (Criteria) this; + } + + public Criteria andGasClassGroupIdNotIn(List 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 values) { + addCriterion("gas_class_group_name in", values, "gasClassGroupName"); + return (Criteria) this; + } + + public Criteria andGasClassGroupNameNotIn(List 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 andMerchantStoreIdIsNull() { + addCriterion("merchant_store_id is null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIsNotNull() { + addCriterion("merchant_store_id is not null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdEqualTo(Long value) { + addCriterion("merchant_store_id =", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotEqualTo(Long value) { + addCriterion("merchant_store_id <>", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdGreaterThan(Long value) { + addCriterion("merchant_store_id >", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdGreaterThanOrEqualTo(Long value) { + addCriterion("merchant_store_id >=", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdLessThan(Long value) { + addCriterion("merchant_store_id <", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdLessThanOrEqualTo(Long value) { + addCriterion("merchant_store_id <=", value, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdIn(List values) { + addCriterion("merchant_store_id in", values, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotIn(List values) { + addCriterion("merchant_store_id not in", values, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdBetween(Long value1, Long value2) { + addCriterion("merchant_store_id between", value1, value2, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreIdNotBetween(Long value1, Long value2) { + addCriterion("merchant_store_id not between", value1, value2, "merchantStoreId"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIsNull() { + addCriterion("merchant_store_name is null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIsNotNull() { + addCriterion("merchant_store_name is not null"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameEqualTo(String value) { + addCriterion("merchant_store_name =", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotEqualTo(String value) { + addCriterion("merchant_store_name <>", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameGreaterThan(String value) { + addCriterion("merchant_store_name >", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameGreaterThanOrEqualTo(String value) { + addCriterion("merchant_store_name >=", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLessThan(String value) { + addCriterion("merchant_store_name <", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLessThanOrEqualTo(String value) { + addCriterion("merchant_store_name <=", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameLike(String value) { + addCriterion("merchant_store_name like", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotLike(String value) { + addCriterion("merchant_store_name not like", value, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameIn(List values) { + addCriterion("merchant_store_name in", values, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotIn(List values) { + addCriterion("merchant_store_name not in", values, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameBetween(String value1, String value2) { + addCriterion("merchant_store_name between", value1, value2, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andMerchantStoreNameNotBetween(String value1, String value2) { + addCriterion("merchant_store_name not between", value1, value2, "merchantStoreName"); + return (Criteria) this; + } + + public Criteria andClassNumIsNull() { + addCriterion("class_num is null"); + return (Criteria) this; + } + + public Criteria andClassNumIsNotNull() { + addCriterion("class_num is not null"); + return (Criteria) this; + } + + public Criteria andClassNumEqualTo(Integer value) { + addCriterion("class_num =", value, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumNotEqualTo(Integer value) { + addCriterion("class_num <>", value, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumGreaterThan(Integer value) { + addCriterion("class_num >", value, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumGreaterThanOrEqualTo(Integer value) { + addCriterion("class_num >=", value, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumLessThan(Integer value) { + addCriterion("class_num <", value, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumLessThanOrEqualTo(Integer value) { + addCriterion("class_num <=", value, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumIn(List values) { + addCriterion("class_num in", values, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumNotIn(List values) { + addCriterion("class_num not in", values, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumBetween(Integer value1, Integer value2) { + addCriterion("class_num between", value1, value2, "classNum"); + return (Criteria) this; + } + + public Criteria andClassNumNotBetween(Integer value1, Integer value2) { + addCriterion("class_num not between", value1, value2, "classNum"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Date value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Date value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Date value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Date value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Date value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Date value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Date value1, Date value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Date value1, Date value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Date value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Date value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Date value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Date value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Date value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Date value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Date value1, Date value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Date value1, Date value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andDataCountIsNull() { + addCriterion("data_count is null"); + return (Criteria) this; + } + + public Criteria andDataCountIsNotNull() { + addCriterion("data_count is not null"); + return (Criteria) this; + } + + public Criteria andDataCountEqualTo(String value) { + addCriterion("data_count =", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountNotEqualTo(String value) { + addCriterion("data_count <>", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountGreaterThan(String value) { + addCriterion("data_count >", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountGreaterThanOrEqualTo(String value) { + addCriterion("data_count >=", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountLessThan(String value) { + addCriterion("data_count <", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountLessThanOrEqualTo(String value) { + addCriterion("data_count <=", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountLike(String value) { + addCriterion("data_count like", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountNotLike(String value) { + addCriterion("data_count not like", value, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountIn(List values) { + addCriterion("data_count in", values, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountNotIn(List values) { + addCriterion("data_count not in", values, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountBetween(String value1, String value2) { + addCriterion("data_count between", value1, value2, "dataCount"); + return (Criteria) this; + } + + public Criteria andDataCountNotBetween(String value1, String value2) { + addCriterion("data_count not between", value1, value2, "dataCount"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java b/hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java index 94f7c58c..202d2494 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java @@ -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); diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java index 82cf93ae..313cda7f 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java @@ -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 values) { + addCriterion("gas_station_drop in", values, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropNotIn(List 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; diff --git a/hai-service/src/main/java/com/hai/enum_type/GasClassGroupTaskStatus.java b/hai-service/src/main/java/com/hai/enum_type/GasClassGroupTaskStatus.java new file mode 100644 index 00000000..8cc16a62 --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/GasClassGroupTaskStatus.java @@ -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; + } +} diff --git a/hai-service/src/main/java/com/hai/enum_type/GasTaskPriceTypeEnum.java b/hai-service/src/main/java/com/hai/enum_type/GasTaskPriceTypeEnum.java index 50a9e1da..ffd69631 100644 --- a/hai-service/src/main/java/com/hai/enum_type/GasTaskPriceTypeEnum.java +++ b/hai-service/src/main/java/com/hai/enum_type/GasTaskPriceTypeEnum.java @@ -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; diff --git a/hai-service/src/main/java/com/hai/model/GasClassGroupTaskDataCount.java b/hai-service/src/main/java/com/hai/model/GasClassGroupTaskDataCount.java new file mode 100644 index 00000000..c10cb88b --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/GasClassGroupTaskDataCount.java @@ -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 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 getGroupTaskOilCountList() { + return groupTaskOilCountList; + } + + public void setGroupTaskOilCountList(List groupTaskOilCountList) { + this.groupTaskOilCountList = groupTaskOilCountList; + } +} diff --git a/hai-service/src/main/java/com/hai/model/GasClassGroupTaskOilCount.java b/hai-service/src/main/java/com/hai/model/GasClassGroupTaskOilCount.java new file mode 100644 index 00000000..7c43ab3f --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/GasClassGroupTaskOilCount.java @@ -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; + } +} diff --git a/hai-service/src/main/java/com/hai/model/GasPayPriceModel.java b/hai-service/src/main/java/com/hai/model/GasPayPriceModel.java index fe408fa2..3807cb91 100644 --- a/hai-service/src/main/java/com/hai/model/GasPayPriceModel.java +++ b/hai-service/src/main/java/com/hai/model/GasPayPriceModel.java @@ -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; } diff --git a/hai-service/src/main/java/com/hai/model/HighCouponCodeModel.java b/hai-service/src/main/java/com/hai/model/HighCouponCodeModel.java deleted file mode 100644 index 08cb1a56..00000000 --- a/hai-service/src/main/java/com/hai/model/HighCouponCodeModel.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.hai.model; - -/** - * @ClassName HighCouponCodeModel - * @Description: - * @Author 胡锐 - * @Date 2021/3/16 - **/ -public interface HighCouponCodeModel { - - - -} diff --git a/hai-service/src/main/java/com/hai/service/HighGasClassGroupService.java b/hai-service/src/main/java/com/hai/service/HighGasClassGroupService.java new file mode 100644 index 00000000..c5b9f75b --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighGasClassGroupService.java @@ -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 getGroupList(Map param); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighGasClassGroupTaskService.java b/hai-service/src/main/java/com/hai/service/HighGasClassGroupTaskService.java new file mode 100644 index 00000000..f0981183 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighGasClassGroupTaskService.java @@ -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 getGroupTaskList(Map param); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 7e6863a3..fd34be09 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -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 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java index 2114240c..3a3fdc35 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponServiceImpl.java @@ -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.*; diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupServiceImpl.java new file mode 100644 index 00000000..fb6b2cc9 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupServiceImpl.java @@ -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 getGroupList(Map 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); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupTaskServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupTaskServiceImpl.java new file mode 100644 index 00000000..3a751d36 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasClassGroupTaskServiceImpl.java @@ -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 param = new HashMap<>(); + param.put("merchantStoreId", merchantStore.getId()); + param.put("status", GasClassGroupTaskStatus.status1.getStatus()); + List 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 param = new HashMap<>(); + param.put("merchantStoreId", gasId); + param.put("status", GasClassGroupTaskStatus.status1.getStatus()); + List 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 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 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 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> oilDataList = gasClassGroupTaskMapper.countOilData(gasId, groupTaskId); + + List oilCountList = new ArrayList<>(); + for (Map 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 getGroupTaskList(Map 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); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java index 5de5044a..f511f5ae 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java @@ -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); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java index 6472416e..d53fcbfd 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceOfficialServiceImpl.java @@ -142,8 +142,8 @@ public class HighGasOilPriceOfficialServiceImpl implements HighGasOilPriceOffici List 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); } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java index c249563b..83be2968 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceTaskServiceImpl.java @@ -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 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index b666242c..ca098709 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -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 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 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 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 deviceList = deviceService.getDeviceListByStoreId(gasId); for (HighDevice device : deviceList) { + Map 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() - ) + "
"; - /* + - 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() - ) + "
";*/ + 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(); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index 8480634d..3c0e777e 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -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(); diff --git a/v1/src/main/java/com/v1/controller/RechargeProductController.java b/v1/src/main/java/com/v1/controller/RechargeProductController.java index a85cd3bb..a821900b 100644 --- a/v1/src/main/java/com/v1/controller/RechargeProductController.java +++ b/v1/src/main/java/com/v1/controller/RechargeProductController.java @@ -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;