提交代码

master
胡锐 6 months ago
parent e31ee1efef
commit eaf7871b10
  1. 14
      bweb/src/main/java/com/bweb/controller/BsAgentController.java
  2. 13
      bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java
  3. 4
      bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java
  4. 8
      bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java
  5. 284
      bweb/src/main/java/com/bweb/controller/BsGasStaffController.java
  6. 3
      bweb/src/main/java/com/bweb/controller/BsMerchantController.java
  7. 21
      bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java
  8. 8
      cweb/src/main/java/com/CWebApplication.java
  9. 1
      cweb/src/main/java/com/cweb/config/AuthConfig.java
  10. 79
      cweb/src/main/java/com/cweb/controller/BsGasController.java
  11. 28
      cweb/src/main/resources/dev/application.yml
  12. 2
      schedule/src/main/java/com/hfkj/msg/RedisKeyExpirationListener.java
  13. 133
      service/src/main/java/com/hfkj/dao/BsGasStaffMapper.java
  14. 7
      service/src/main/java/com/hfkj/dao/BsGasStaffMapperExt.java
  15. 360
      service/src/main/java/com/hfkj/dao/BsGasStaffSqlProvider.java
  16. 36
      service/src/main/java/com/hfkj/dao/BsMerchantMapperExt.java
  17. 15
      service/src/main/java/com/hfkj/dao/BsMerchantPayConfigMapper.java
  18. 28
      service/src/main/java/com/hfkj/dao/BsMerchantPayConfigSqlProvider.java
  19. 264
      service/src/main/java/com/hfkj/entity/BsGasStaff.java
  20. 1143
      service/src/main/java/com/hfkj/entity/BsGasStaffExample.java
  21. 32
      service/src/main/java/com/hfkj/entity/BsMerchantPayConfig.java
  22. 130
      service/src/main/java/com/hfkj/entity/BsMerchantPayConfigExample.java
  23. 59
      service/src/main/java/com/hfkj/model/GasListModel.java
  24. 22
      service/src/main/java/com/hfkj/model/GasModel.java
  25. 23
      service/src/main/java/com/hfkj/model/GasOilPriceModel.java
  26. 84
      service/src/main/java/com/hfkj/model/GasPayPriceModel.java
  27. 2
      service/src/main/java/com/hfkj/service/gas/BsGasOilGunNoService.java
  28. 2
      service/src/main/java/com/hfkj/service/gas/BsGasOilPriceOfficialService.java
  29. 9
      service/src/main/java/com/hfkj/service/gas/BsGasOilPriceService.java
  30. 2
      service/src/main/java/com/hfkj/service/gas/BsGasOilPriceTaskService.java
  31. 54
      service/src/main/java/com/hfkj/service/gas/BsGasService.java
  32. 51
      service/src/main/java/com/hfkj/service/gas/BsGasStaffService.java
  33. 4
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilGunNoServiceImpl.java
  34. 6
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceOfficialServiceImpl.java
  35. 17
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java
  36. 16
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceTaskServiceImpl.java
  37. 180
      service/src/main/java/com/hfkj/service/gas/impl/BsGasServiceImpl.java
  38. 150
      service/src/main/java/com/hfkj/service/gas/impl/BsGasStaffServiceImpl.java
  39. 10
      service/src/main/java/com/hfkj/service/impl/BsAgentServiceImpl.java
  40. 10
      service/src/main/java/com/hfkj/service/impl/BsMerchantServiceImpl.java
  41. 14
      service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java
  42. 2
      service/src/main/java/com/hfkj/sysenum/gas/GasOilPriceStatusEnum.java
  43. 2
      service/src/main/java/com/hfkj/sysenum/gas/GasOilPriceTaskExecutionTypeEnum.java
  44. 36
      service/src/main/java/com/hfkj/sysenum/gas/GasStaffStatus.java
  45. 2
      service/src/main/java/com/hfkj/sysenum/gas/GasTaskExecutionTypeEnum.java
  46. 2
      service/src/main/java/com/hfkj/sysenum/gas/GasTaskPriceTypeEnum.java
  47. 2
      service/src/main/java/com/hfkj/sysenum/gas/GasTaskStatusEnum.java

@ -6,12 +6,10 @@ import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsAgent; import com.hfkj.entity.BsAgent;
import com.hfkj.entity.SecUser; import com.hfkj.entity.SecUser;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.BsAgentService; import com.hfkj.service.BsAgentService;
import com.hfkj.service.sec.SecUserService; import com.hfkj.service.sec.SecUserService;
import com.hfkj.sysenum.SecUserObjectTypeEnum; import com.hfkj.sysenum.SecUserObjectTypeEnum;
@ -26,7 +24,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
@Controller @Controller
@RequestMapping(value = "/agent") @RequestMapping(value = "/agent")
@ -39,8 +36,6 @@ public class BsAgentController {
private BsAgentService agentService; private BsAgentService agentService;
@Resource @Resource
private SecUserService secUserService; private SecUserService secUserService;
@Resource
private UserCenter userCenter;
@RequestMapping(value = "/createAgent", method = RequestMethod.POST) @RequestMapping(value = "/createAgent", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ -118,14 +113,13 @@ public class BsAgentController {
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("agent", agent); param.put("agent", agent);
/* SecUser secUser = secUserService.getDetail(SecUserObjectTypeEnum.type2.getNumber(), agent.getId()); SecUser secUser = secUserService.getDetail(SecUserObjectTypeEnum.type4, agent.getId());
if (secUser == null) { if (secUser == null) {
log.error("BsAgentController --> queryAgentDetail() error!", "未找到代理商登录账户"); log.error("BsAgentController --> queryAgentDetail() error!", "未找到代理商登录账户");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到代理商登录账户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到代理商登录账户");
} }
secUser.setPassword(null); secUser.setPassword(null);
param.put("account", secUser);*/ param.put("account", secUser);
param.put("account", null);
return ResponseMsgUtil.success(param); return ResponseMsgUtil.success(param);
} catch (Exception e) { } catch (Exception e) {
@ -137,14 +131,12 @@ public class BsAgentController {
@RequestMapping(value = "/queryAgentList", method = RequestMethod.GET) @RequestMapping(value = "/queryAgentList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询代理商列表") @ApiOperation(value = "查询代理商列表")
public ResponseData queryAgentList(@RequestParam(name = "companyId", required = false) Long companyId, public ResponseData queryAgentList(@RequestParam(name = "agentNo", required = false) String agentNo,
@RequestParam(name = "agentNo", required = false) String agentNo,
@RequestParam(name = "agentName", required = false) String agentName, @RequestParam(name = "agentName", required = false) String agentName,
@RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) { @RequestParam(name = "pageSize", required = true) Integer pageSize) {
try { try {
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("companyId", companyId);
param.put("agentNo", agentNo); param.put("agentNo", agentNo);
param.put("agentName", agentName); param.put("agentName", agentName);

@ -1,8 +1,6 @@
package com.bweb.controller; package com.bweb.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
@ -11,15 +9,11 @@ import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsGasOilGunNo; import com.hfkj.entity.BsGasOilGunNo;
import com.hfkj.entity.BsGasOilPrice; import com.hfkj.entity.BsGasOilPrice;
import com.hfkj.entity.BsMerchant; import com.hfkj.entity.BsMerchant;
import com.hfkj.entity.SecDictionary;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilGunNoService;
import com.hfkj.service.BsGasOilPriceService; import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.service.BsMerchantService; import com.hfkj.service.BsMerchantService;
import com.hfkj.service.CommonService;
import com.hfkj.sysenum.GasOilPriceStatusEnum;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -29,10 +23,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Controller @Controller

@ -11,10 +11,10 @@ import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.*; import com.hfkj.entity.*;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.BsGasOilPriceService; import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.service.BsMerchantService; import com.hfkj.service.BsMerchantService;
import com.hfkj.service.CommonService; import com.hfkj.service.CommonService;
import com.hfkj.sysenum.GasOilPriceStatusEnum; import com.hfkj.sysenum.gas.GasOilPriceStatusEnum;
import com.hfkj.sysenum.SecUserObjectTypeEnum; import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;

@ -14,12 +14,11 @@ import com.hfkj.entity.SecDictionary;
import com.hfkj.entity.SecRegion; import com.hfkj.entity.SecRegion;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.BsAgentService; import com.hfkj.service.gas.BsGasOilPriceTaskService;
import com.hfkj.service.BsGasOilPriceTaskService;
import com.hfkj.service.BsMerchantService; import com.hfkj.service.BsMerchantService;
import com.hfkj.service.CommonService; import com.hfkj.service.CommonService;
import com.hfkj.sysenum.GasOilPriceTaskExecutionTypeEnum; import com.hfkj.sysenum.gas.GasOilPriceTaskExecutionTypeEnum;
import com.hfkj.sysenum.GasTaskPriceTypeEnum; import com.hfkj.sysenum.gas.GasTaskPriceTypeEnum;
import com.hfkj.sysenum.SecUserObjectTypeEnum; import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -30,7 +29,6 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;

@ -0,0 +1,284 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.bweb.config.SysConst;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.QRCodeGenerator;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.AESEncodeUtil;
import com.hfkj.common.security.SessionObject;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.IDGenerator;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsGasStaff;
import com.hfkj.entity.BsMerchant;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.BsMerchantService;
import com.hfkj.service.CommonService;
import com.hfkj.service.gas.BsGasStaffService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import com.hfkj.sysenum.gas.GasStaffStatus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.net.URLEncoder;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value = "/gasStaff")
@Api(value = "加油站员工管理")
public class BsGasStaffController {
private static Logger log = LoggerFactory.getLogger(BsGasStaffController.class);
@Resource
private BsGasStaffService gasStaffService;
@Resource
private BsMerchantService merchantService;
@Resource
private CommonService commonService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/addGasStaff",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "增加员工")
public ResponseData addStaff(@RequestBody JSONObject body) {
try {
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
if (!userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
if (StringUtils.isBlank(body.getString("name"))
|| StringUtils.isBlank(body.getString("telephone"))
|| StringUtils.isBlank(body.getString("positionType"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
BsGasStaff gasStaff = new BsGasStaff();
gasStaff.setMerId(userInfoModel.getAccount().getObjectId());
gasStaff.setAvatar(body.getString("avatar"));
gasStaff.setName(body.getString("name"));
gasStaff.setTelephone(body.getString("telephone"));
gasStaff.setPositionType(body.getInteger("positionType"));
gasStaff.setPositionName(commonService.getDictionaryCodeName("GAS_STAFF_POSITION_TYPE", body.getString("positionType")));
gasStaffService.addStaff(gasStaff);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasStaffController -> addStaff() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/updateGasStaff",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改员工")
public ResponseData updateGasStaff(@RequestBody JSONObject body) {
try {
if (body.getLong("id") == null
|| StringUtils.isBlank(body.getString("name"))
|| StringUtils.isBlank(body.getString("telephone"))
|| StringUtils.isBlank(body.getString("positionType"))
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询员工信息
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(body.getLong("id"));
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到员工信息");
}
gasStaff.setAvatar(body.getString("avatar"));
gasStaff.setName(body.getString("name"));
gasStaff.setTelephone(body.getString("telephone"));
gasStaff.setPositionType(body.getInteger("positionType"));
gasStaff.setPositionName(commonService.getDictionaryCodeName("GAS_STAFF_POSITION_TYPE", body.getString("positionType")));
gasStaffService.updateStaff(gasStaff);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasStaffController -> updateGasStaff() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryQrCode",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询二维码")
public ResponseData queryQrCode(@RequestBody JSONObject body) {
try {
if (body.getLong("gasStaffId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询员工信息
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(body.getLong("gasStaffId"));
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到员工信息");
}
if (StringUtils.isBlank(gasStaff.getQrCodeImgUrl())) {
// 查询加油站
BsMerchant merchantStore = merchantService.getMerchant(gasStaff.getMerId());
if (merchantStore == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站信息");
}
// 员工ID签名
String signId = AESEncodeUtil.aesEncrypt(gasStaff.getId().toString());
// 生成二维码
String param = "/hsgH5?accountId=0000021";
String qrCodeImgUrl = DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(1) +".jpg";
QRCodeGenerator.generateQRCodeImage(param, 350, 350, SysConst.getSysConfig().getFileUrl()+"/gasStaff/"+qrCodeImgUrl);
gasStaff.setQrCodeImgUrl(qrCodeImgUrl);
gasStaffService.updateStaff(gasStaff);
}
return ResponseMsgUtil.success(gasStaff.getQrCodeImgUrl());
} catch (Exception e) {
log.error("HighGasStaffController -> queryQrCode() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/disabled",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "禁用员工")
public ResponseData disabled(@RequestBody JSONObject body) {
try {
if (body.getLong("staffId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询油站员工
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(body.getLong("staffId"));
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到员工");
}
gasStaff.setStatus(GasStaffStatus.status2.getStatus());
gasStaffService.editData(gasStaff);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasStaffController -> disabled() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/recover",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "恢复正常")
public ResponseData recover(@RequestBody JSONObject body) {
try {
if (body.getLong("staffId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询油站员工
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(body.getLong("staffId"));
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到员工");
}
gasStaff.setStatus(GasStaffStatus.status1.getStatus());
gasStaffService.editData(gasStaff);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasStaffController -> delStaff() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/delStaff",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "删除员工")
public ResponseData delStaff(@RequestBody JSONObject body) {
try {
if (body.getLong("staffId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasStaffService.delStaff(body.getLong("staffId"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasStaffController -> delStaff() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getStaffDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询员工详情")
public ResponseData getStaffDetail(@RequestParam(name = "staffId", required = true) Long staffId) {
try {
return ResponseMsgUtil.success(gasStaffService.getStaffDetailById(staffId));
} catch (Exception e) {
log.error("HighGasStaffController -> getStaffDetail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getStaffList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询员工列表")
public ResponseData getStaffList(@RequestParam(name = "merchantStoreId", required = false) Long merchantStoreId,
@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "telephone", required = false) String telephone,
@RequestParam(name = "positionType", required = false) Integer positionType,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (userInfoModel == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, "");
}
Map<String,Object> param = new HashMap<>();
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
param.put("merchantStoreId", merchantStoreId);
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
param.put("merchantStoreId", userInfoModel.getAccount().getObjectId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
param.put("name", name);
param.put("telephone", telephone);
param.put("positionType", positionType);
param.put("status", status);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasStaffService.getStaffList(param)));
} catch (Exception e) {
log.error("HighGasStaffController -> getStaffList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -11,8 +11,9 @@ import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.*; import com.hfkj.entity.*;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
import com.hfkj.service.*; import com.hfkj.service.*;
import com.hfkj.service.gas.BsGasOilGunNoService;
import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.sysenum.MerchantStatusEnum; import com.hfkj.sysenum.MerchantStatusEnum;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;

@ -1,5 +1,7 @@
package com.bweb.controller; package com.bweb.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
@ -44,7 +46,9 @@ public class BsMerchantPayConfigController {
if (body == null if (body == null
|| body.getMerNo() == null || body.getMerNo() == null
|| StringUtils.isBlank(body.getChannelMerNo()) || StringUtils.isBlank(body.getChannelMerNo())
|| StringUtils.isBlank(body.getChannelMerKey())) { || StringUtils.isBlank(body.getChannelMerKey())
|| body.getLedgerAccountFlag() == null
) {
log.error("BsMerchantPayConfigController --> editConfig() error!", "参数错误"); log.error("BsMerchantPayConfigController --> editConfig() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
@ -59,6 +63,20 @@ public class BsMerchantPayConfigController {
if (config == null) { if (config == null) {
config = new BsMerchantPayConfig(); config = new BsMerchantPayConfig();
} }
if(body.getLedgerAccountFlag().equals(true)) {
if (StringUtils.isBlank(body.getLedgerAccountData())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
JSONArray ledgerAccountArray = JSONArray.parseArray(body.getLedgerAccountData());
for (Object obj : ledgerAccountArray) {
JSONObject ledgerAccount = (JSONObject) obj;
if (StringUtils.isBlank(ledgerAccount.getString("receiverMerNo"))
|| ledgerAccount.getBigDecimal("receiverRatio") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
}
config.setLedgerAccountData(body.getLedgerAccountData());
}
config.setMerId(merchant.getId()); config.setMerId(merchant.getId());
config.setMerNo(merchant.getMerNo()); config.setMerNo(merchant.getMerNo());
config.setMerName(merchant.getMerName()); config.setMerName(merchant.getMerName());
@ -66,6 +84,7 @@ public class BsMerchantPayConfigController {
config.setChannelCode("HUI_PAY"); config.setChannelCode("HUI_PAY");
config.setChannelMerNo(body.getChannelMerNo()); config.setChannelMerNo(body.getChannelMerNo());
config.setChannelMerKey(body.getChannelMerKey()); config.setChannelMerKey(body.getChannelMerKey());
config.setLedgerAccountFlag(body.getLedgerAccountFlag());
merchantPayConfigService.editData(config); merchantPayConfigService.editData(config);
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");

@ -1,19 +1,25 @@
package com; package com;
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
import com.alicp.jetcache.anno.config.EnableMethodCache;
import com.hfkj.common.utils.SpringContextUtil; import com.hfkj.common.utils.SpringContextUtil;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication @SpringBootApplication
//@ComponentScan // @ComponentScan
@EnableTransactionManagement @EnableTransactionManagement
@EnableScheduling @EnableScheduling
@EnableMethodCache(basePackages = "com.hfkj")
@EnableCreateCacheAnnotation
@ServletComponentScan @ServletComponentScan
@EnableAspectJAutoProxy(proxyTargetClass = true)
@MapperScan("com.hfkj.dao") @MapperScan("com.hfkj.dao")
public class CWebApplication public class CWebApplication
{ {

@ -87,6 +87,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/**/swagger-ui.html") .excludePathPatterns("/**/swagger-ui.html")
.excludePathPatterns("/client/*") .excludePathPatterns("/client/*")
.excludePathPatterns("/sms/*") .excludePathPatterns("/sms/*")
.excludePathPatterns("/gas/*")
.excludePathPatterns("/secUser/login") .excludePathPatterns("/secUser/login")
.excludePathPatterns("/secUser/loginOut") .excludePathPatterns("/secUser/loginOut")
; ;

@ -0,0 +1,79 @@
package com.cweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import com.hfkj.service.gas.BsGasService;
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;
@Controller
@RequestMapping(value = "/gas")
@Api(value = "油站管理")
public class BsGasController {
private static Logger log = LoggerFactory.getLogger(BsGasController.class);
@Resource
private BsGasService gasService;
@RequestMapping(value="/oilPriceCompute",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "油价计算")
public ResponseData oilPriceCompute(@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent,
@RequestParam(name = "refuelPrice", required = true) BigDecimal refuelPrice,
@RequestParam(name = "merNo", required = true) String merNo,
@RequestParam(name = "oilNo", required = true) String oilNo) {
try {
return ResponseMsgUtil.success(gasService.refuelPriceCompute(refuelPrice,merNo,oilNo,isTyAgent));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryGasList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询加油站列表")
public ResponseData queryGasList(@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent,
@RequestParam(name = "gasName", required = false) String gasName,
@RequestParam(name = "distanceLimit", required = false) Integer distanceLimit,
@RequestParam(name = "oilNo", required = true) String oilNo,
@RequestParam(name = "longitude", required = true) String longitude,
@RequestParam(name = "latitude", required = true) String latitude,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize
) {
try {
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(gasService.getGasList(longitude,latitude,oilNo,gasName,distanceLimit)));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryGasDetail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询加油站详情")
public ResponseData queryGasDetail(@RequestParam(name = "merNo", required = true) String merNo,
@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent) {
try {
return ResponseMsgUtil.success(gasService.getGasDetail(merNo));
} catch (Exception e) {
return ResponseMsgUtil.exception(e);
}
}
}

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://139.9.154.68:3306/hai_oil?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
@ -29,7 +29,7 @@ spring:
maxOpenPreparedStatements: 20 maxOpenPreparedStatements: 20
redis: redis:
database: 0 database: 0
host: 139.159.177.244 host: 139.9.154.68
port: 36379 port: 36379
password: HF123456.Redis password: HF123456.Redis
timeout: 1000 timeout: 1000
@ -43,6 +43,30 @@ spring:
jackson: jackson:
serialization: serialization:
write-dates-as-timestamps: true write-dates-as-timestamps: true
jetcache:
statIntervalMinutes: 15
areaInCacheName: false
local:
default:
type: linkedhashmap
keyConvertor: fastjson
remote:
default:
type: redis
host: 139.9.154.68
port: 36379
password: HF123456.Redis
database: 0
keyConvertor: fastjson
broadcastChannel: projectA
valueEncoder: java
valueDecoder: java
poolConfig:
minIdle: 5
maxIdle: 20
maxTotal: 50
mybatis: mybatis:
mapperLocations: mapperLocations:
- classpath*:sqlmap*/*.xml - classpath*:sqlmap*/*.xml

@ -1,7 +1,7 @@
package com.hfkj.msg; package com.hfkj.msg;
import com.hfkj.entity.BsGasOilPriceTask; import com.hfkj.entity.BsGasOilPriceTask;
import com.hfkj.service.BsGasOilPriceTaskService; import com.hfkj.service.gas.BsGasOilPriceTaskService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

@ -0,0 +1,133 @@
package com.hfkj.dao;
import com.hfkj.entity.BsGasStaff;
import com.hfkj.entity.BsGasStaffExample;
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 BsGasStaffMapper extends BsGasStaffMapperExt {
@SelectProvider(type=BsGasStaffSqlProvider.class, method="countByExample")
long countByExample(BsGasStaffExample example);
@DeleteProvider(type=BsGasStaffSqlProvider.class, method="deleteByExample")
int deleteByExample(BsGasStaffExample example);
@Delete({
"delete from bs_gas_staff",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_gas_staff (mer_id, avatar, ",
"`name`, telephone, ",
"position_type, position_name, ",
"qr_code_img_url, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{avatar,jdbcType=VARCHAR}, ",
"#{name,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, ",
"#{positionType,jdbcType=INTEGER}, #{positionName,jdbcType=VARCHAR}, ",
"#{qrCodeImgUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsGasStaff record);
@InsertProvider(type=BsGasStaffSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsGasStaff record);
@SelectProvider(type=BsGasStaffSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
@Result(column="position_type", property="positionType", jdbcType=JdbcType.INTEGER),
@Result(column="position_name", property="positionName", jdbcType=JdbcType.VARCHAR),
@Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@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<BsGasStaff> selectByExample(BsGasStaffExample example);
@Select({
"select",
"id, mer_id, avatar, `name`, telephone, position_type, position_name, qr_code_img_url, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_gas_staff",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR),
@Result(column="position_type", property="positionType", jdbcType=JdbcType.INTEGER),
@Result(column="position_name", property="positionName", jdbcType=JdbcType.VARCHAR),
@Result(column="qr_code_img_url", property="qrCodeImgUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@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)
})
BsGasStaff selectByPrimaryKey(Long id);
@UpdateProvider(type=BsGasStaffSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsGasStaff record, @Param("example") BsGasStaffExample example);
@UpdateProvider(type=BsGasStaffSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsGasStaff record, @Param("example") BsGasStaffExample example);
@UpdateProvider(type=BsGasStaffSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsGasStaff record);
@Update({
"update bs_gas_staff",
"set mer_id = #{merId,jdbcType=BIGINT},",
"avatar = #{avatar,jdbcType=VARCHAR},",
"`name` = #{name,jdbcType=VARCHAR},",
"telephone = #{telephone,jdbcType=VARCHAR},",
"position_type = #{positionType,jdbcType=INTEGER},",
"position_name = #{positionName,jdbcType=VARCHAR},",
"qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsGasStaff record);
}

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

@ -0,0 +1,360 @@
package com.hfkj.dao;
import com.hfkj.entity.BsGasStaff;
import com.hfkj.entity.BsGasStaffExample.Criteria;
import com.hfkj.entity.BsGasStaffExample.Criterion;
import com.hfkj.entity.BsGasStaffExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsGasStaffSqlProvider {
public String countByExample(BsGasStaffExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_gas_staff");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsGasStaffExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_gas_staff");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsGasStaff record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_gas_staff");
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getAvatar() != null) {
sql.VALUES("avatar", "#{avatar,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
}
if (record.getTelephone() != null) {
sql.VALUES("telephone", "#{telephone,jdbcType=VARCHAR}");
}
if (record.getPositionType() != null) {
sql.VALUES("position_type", "#{positionType,jdbcType=INTEGER}");
}
if (record.getPositionName() != null) {
sql.VALUES("position_name", "#{positionName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.VALUES("qr_code_img_url", "#{qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
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(BsGasStaffExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("mer_id");
sql.SELECT("avatar");
sql.SELECT("`name`");
sql.SELECT("telephone");
sql.SELECT("position_type");
sql.SELECT("position_name");
sql.SELECT("qr_code_img_url");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_gas_staff");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsGasStaff record = (BsGasStaff) parameter.get("record");
BsGasStaffExample example = (BsGasStaffExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_gas_staff");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getAvatar() != null) {
sql.SET("avatar = #{record.avatar,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
}
if (record.getTelephone() != null) {
sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}");
}
if (record.getPositionType() != null) {
sql.SET("position_type = #{record.positionType,jdbcType=INTEGER}");
}
if (record.getPositionName() != null) {
sql.SET("position_name = #{record.positionName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_gas_staff");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("avatar = #{record.avatar,jdbcType=VARCHAR}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}");
sql.SET("position_type = #{record.positionType,jdbcType=INTEGER}");
sql.SET("position_name = #{record.positionName,jdbcType=VARCHAR}");
sql.SET("qr_code_img_url = #{record.qrCodeImgUrl,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsGasStaffExample example = (BsGasStaffExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsGasStaff record) {
SQL sql = new SQL();
sql.UPDATE("bs_gas_staff");
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getAvatar() != null) {
sql.SET("avatar = #{avatar,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{name,jdbcType=VARCHAR}");
}
if (record.getTelephone() != null) {
sql.SET("telephone = #{telephone,jdbcType=VARCHAR}");
}
if (record.getPositionType() != null) {
sql.SET("position_type = #{positionType,jdbcType=INTEGER}");
}
if (record.getPositionName() != null) {
sql.SET("position_name = #{positionName,jdbcType=VARCHAR}");
}
if (record.getQrCodeImgUrl() != null) {
sql.SET("qr_code_img_url = #{qrCodeImgUrl,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
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, BsGasStaffExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -1,7 +1,43 @@
package com.hfkj.dao; package com.hfkj.dao;
import com.hfkj.model.GasListModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* mapper扩展类 * mapper扩展类
*/ */
public interface BsMerchantMapperExt { public interface BsMerchantMapperExt {
@Select("<script>" +
" select * from (SELECT" +
" b.mer_no merNo," +
" b.mer_name merName," +
" b.address," +
" b.longitude," +
" b.latitude," +
" round(ST_Distance_Sphere(" +
" point(#{longitude}, #{latitude})," +
" point(b.longitude, b.latitude)" +
" ) / 1000, 2) as distance," +
" a.oil_no oilNo," +
" a.price_official priceOfficial," +
" a.price_gun priceGun," +
" a.price_vip priceVip," +
" a.gas_station_drop gasStationDrop" +
" FROM" +
" bs_gas_oil_price a" +
" LEFT JOIN bs_merchant b on b.id = a.mer_id" +
" where a.oil_no = #{oilNo} and a.`status` = 1" +
" ORDER BY distance asc) a where 1 = 1" +
"<if test='gasName != null'> and a.merName like concat('%',#{gasName},'%') </if>" +
"<if test='distanceLimit != null'> <![CDATA[ and a.distance <= #{distanceLimit} ]]> </if>" +
"</script>")
List<GasListModel> queryGasList(@Param("longitude") String longitude,
@Param("latitude") String latitude,
@Param("oilNo") String oilNo,
@Param("gasName") String gasName,
@Param("distanceLimit") Integer distanceLimit);
} }

@ -42,13 +42,15 @@ public interface BsMerchantPayConfigMapper extends BsMerchantPayConfigMapperExt
"insert into bs_merchant_pay_config (mer_id, mer_no, ", "insert into bs_merchant_pay_config (mer_id, mer_no, ",
"mer_name, channel_code, ", "mer_name, channel_code, ",
"channel_name, channel_mer_no, ", "channel_name, channel_mer_no, ",
"channel_mer_key, create_time, ", "channel_mer_key, ledger_account_flag, ",
"ledger_account_data, create_time, ",
"update_time, `status`, ", "update_time, `status`, ",
"ext_1, ext_2, ext_3)", "ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
"#{merName,jdbcType=VARCHAR}, #{channelCode,jdbcType=VARCHAR}, ", "#{merName,jdbcType=VARCHAR}, #{channelCode,jdbcType=VARCHAR}, ",
"#{channelName,jdbcType=VARCHAR}, #{channelMerNo,jdbcType=VARCHAR}, ", "#{channelName,jdbcType=VARCHAR}, #{channelMerNo,jdbcType=VARCHAR}, ",
"#{channelMerKey,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", "#{channelMerKey,jdbcType=VARCHAR}, #{ledgerAccountFlag,jdbcType=BIT}, ",
"#{ledgerAccountData,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@ -69,6 +71,8 @@ public interface BsMerchantPayConfigMapper extends BsMerchantPayConfigMapperExt
@Result(column="channel_name", property="channelName", jdbcType=JdbcType.VARCHAR), @Result(column="channel_name", property="channelName", jdbcType=JdbcType.VARCHAR),
@Result(column="channel_mer_no", property="channelMerNo", jdbcType=JdbcType.VARCHAR), @Result(column="channel_mer_no", property="channelMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="channel_mer_key", property="channelMerKey", jdbcType=JdbcType.VARCHAR), @Result(column="channel_mer_key", property="channelMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="ledger_account_flag", property="ledgerAccountFlag", jdbcType=JdbcType.BIT),
@Result(column="ledger_account_data", property="ledgerAccountData", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -81,7 +85,8 @@ public interface BsMerchantPayConfigMapper extends BsMerchantPayConfigMapperExt
@Select({ @Select({
"select", "select",
"id, mer_id, mer_no, mer_name, channel_code, channel_name, channel_mer_no, channel_mer_key, ", "id, mer_id, mer_no, mer_name, channel_code, channel_name, channel_mer_no, channel_mer_key, ",
"create_time, update_time, `status`, ext_1, ext_2, ext_3", "ledger_account_flag, ledger_account_data, create_time, update_time, `status`, ",
"ext_1, ext_2, ext_3",
"from bs_merchant_pay_config", "from bs_merchant_pay_config",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -94,6 +99,8 @@ public interface BsMerchantPayConfigMapper extends BsMerchantPayConfigMapperExt
@Result(column="channel_name", property="channelName", jdbcType=JdbcType.VARCHAR), @Result(column="channel_name", property="channelName", jdbcType=JdbcType.VARCHAR),
@Result(column="channel_mer_no", property="channelMerNo", jdbcType=JdbcType.VARCHAR), @Result(column="channel_mer_no", property="channelMerNo", jdbcType=JdbcType.VARCHAR),
@Result(column="channel_mer_key", property="channelMerKey", jdbcType=JdbcType.VARCHAR), @Result(column="channel_mer_key", property="channelMerKey", jdbcType=JdbcType.VARCHAR),
@Result(column="ledger_account_flag", property="ledgerAccountFlag", jdbcType=JdbcType.BIT),
@Result(column="ledger_account_data", property="ledgerAccountData", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -121,6 +128,8 @@ public interface BsMerchantPayConfigMapper extends BsMerchantPayConfigMapperExt
"channel_name = #{channelName,jdbcType=VARCHAR},", "channel_name = #{channelName,jdbcType=VARCHAR},",
"channel_mer_no = #{channelMerNo,jdbcType=VARCHAR},", "channel_mer_no = #{channelMerNo,jdbcType=VARCHAR},",
"channel_mer_key = #{channelMerKey,jdbcType=VARCHAR},", "channel_mer_key = #{channelMerKey,jdbcType=VARCHAR},",
"ledger_account_flag = #{ledgerAccountFlag,jdbcType=BIT},",
"ledger_account_data = #{ledgerAccountData,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},", "create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},",
"`status` = #{status,jdbcType=INTEGER},", "`status` = #{status,jdbcType=INTEGER},",

@ -56,6 +56,14 @@ public class BsMerchantPayConfigSqlProvider {
sql.VALUES("channel_mer_key", "#{channelMerKey,jdbcType=VARCHAR}"); sql.VALUES("channel_mer_key", "#{channelMerKey,jdbcType=VARCHAR}");
} }
if (record.getLedgerAccountFlag() != null) {
sql.VALUES("ledger_account_flag", "#{ledgerAccountFlag,jdbcType=BIT}");
}
if (record.getLedgerAccountData() != null) {
sql.VALUES("ledger_account_data", "#{ledgerAccountData,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
} }
@ -97,6 +105,8 @@ public class BsMerchantPayConfigSqlProvider {
sql.SELECT("channel_name"); sql.SELECT("channel_name");
sql.SELECT("channel_mer_no"); sql.SELECT("channel_mer_no");
sql.SELECT("channel_mer_key"); sql.SELECT("channel_mer_key");
sql.SELECT("ledger_account_flag");
sql.SELECT("ledger_account_data");
sql.SELECT("create_time"); sql.SELECT("create_time");
sql.SELECT("update_time"); sql.SELECT("update_time");
sql.SELECT("`status`"); sql.SELECT("`status`");
@ -152,6 +162,14 @@ public class BsMerchantPayConfigSqlProvider {
sql.SET("channel_mer_key = #{record.channelMerKey,jdbcType=VARCHAR}"); sql.SET("channel_mer_key = #{record.channelMerKey,jdbcType=VARCHAR}");
} }
if (record.getLedgerAccountFlag() != null) {
sql.SET("ledger_account_flag = #{record.ledgerAccountFlag,jdbcType=BIT}");
}
if (record.getLedgerAccountData() != null) {
sql.SET("ledger_account_data = #{record.ledgerAccountData,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
} }
@ -192,6 +210,8 @@ public class BsMerchantPayConfigSqlProvider {
sql.SET("channel_name = #{record.channelName,jdbcType=VARCHAR}"); sql.SET("channel_name = #{record.channelName,jdbcType=VARCHAR}");
sql.SET("channel_mer_no = #{record.channelMerNo,jdbcType=VARCHAR}"); sql.SET("channel_mer_no = #{record.channelMerNo,jdbcType=VARCHAR}");
sql.SET("channel_mer_key = #{record.channelMerKey,jdbcType=VARCHAR}"); sql.SET("channel_mer_key = #{record.channelMerKey,jdbcType=VARCHAR}");
sql.SET("ledger_account_flag = #{record.ledgerAccountFlag,jdbcType=BIT}");
sql.SET("ledger_account_data = #{record.ledgerAccountData,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
@ -236,6 +256,14 @@ public class BsMerchantPayConfigSqlProvider {
sql.SET("channel_mer_key = #{channelMerKey,jdbcType=VARCHAR}"); sql.SET("channel_mer_key = #{channelMerKey,jdbcType=VARCHAR}");
} }
if (record.getLedgerAccountFlag() != null) {
sql.SET("ledger_account_flag = #{ledgerAccountFlag,jdbcType=BIT}");
}
if (record.getLedgerAccountData() != null) {
sql.SET("ledger_account_data = #{ledgerAccountData,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) { if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
} }

@ -0,0 +1,264 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_gas_staff
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsGasStaff implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 商户id
*/
private Long merId;
/**
* 员工头像
*/
private String avatar;
/**
* 员工名称
*/
private String name;
/**
* 员工电话
*/
private String telephone;
/**
* 职位类型 1加油员
*/
private Integer positionType;
/**
* 职位类型名称
*/
private String positionName;
/**
* 二维码图片地址
*/
private String qrCodeImgUrl;
/**
* 状态 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 getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public Integer getPositionType() {
return positionType;
}
public void setPositionType(Integer positionType) {
this.positionType = positionType;
}
public String getPositionName() {
return positionName;
}
public void setPositionName(String positionName) {
this.positionName = positionName;
}
public String getQrCodeImgUrl() {
return qrCodeImgUrl;
}
public void setQrCodeImgUrl(String qrCodeImgUrl) {
this.qrCodeImgUrl = qrCodeImgUrl;
}
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;
}
BsGasStaff other = (BsGasStaff) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone()))
&& (this.getPositionType() == null ? other.getPositionType() == null : this.getPositionType().equals(other.getPositionType()))
&& (this.getPositionName() == null ? other.getPositionName() == null : this.getPositionName().equals(other.getPositionName()))
&& (this.getQrCodeImgUrl() == null ? other.getQrCodeImgUrl() == null : this.getQrCodeImgUrl().equals(other.getQrCodeImgUrl()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (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 + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getAvatar() == null) ? 0 : getAvatar().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode());
result = prime * result + ((getPositionType() == null) ? 0 : getPositionType().hashCode());
result = prime * result + ((getPositionName() == null) ? 0 : getPositionName().hashCode());
result = prime * result + ((getQrCodeImgUrl() == null) ? 0 : getQrCodeImgUrl().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
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(", merId=").append(merId);
sb.append(", avatar=").append(avatar);
sb.append(", name=").append(name);
sb.append(", telephone=").append(telephone);
sb.append(", positionType=").append(positionType);
sb.append(", positionName=").append(positionName);
sb.append(", qrCodeImgUrl=").append(qrCodeImgUrl);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
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();
}
}

File diff suppressed because it is too large Load Diff

@ -50,6 +50,16 @@ public class BsMerchantPayConfig implements Serializable {
*/ */
private String channelMerKey; private String channelMerKey;
/**
* 是否分账 0
*/
private Boolean ledgerAccountFlag;
/**
* 分账接收方数据
*/
private String ledgerAccountData;
/** /**
* 创建时间 * 创建时间
*/ */
@ -137,6 +147,22 @@ public class BsMerchantPayConfig implements Serializable {
this.channelMerKey = channelMerKey; this.channelMerKey = channelMerKey;
} }
public Boolean getLedgerAccountFlag() {
return ledgerAccountFlag;
}
public void setLedgerAccountFlag(Boolean ledgerAccountFlag) {
this.ledgerAccountFlag = ledgerAccountFlag;
}
public String getLedgerAccountData() {
return ledgerAccountData;
}
public void setLedgerAccountData(String ledgerAccountData) {
this.ledgerAccountData = ledgerAccountData;
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
@ -205,6 +231,8 @@ public class BsMerchantPayConfig implements Serializable {
&& (this.getChannelName() == null ? other.getChannelName() == null : this.getChannelName().equals(other.getChannelName())) && (this.getChannelName() == null ? other.getChannelName() == null : this.getChannelName().equals(other.getChannelName()))
&& (this.getChannelMerNo() == null ? other.getChannelMerNo() == null : this.getChannelMerNo().equals(other.getChannelMerNo())) && (this.getChannelMerNo() == null ? other.getChannelMerNo() == null : this.getChannelMerNo().equals(other.getChannelMerNo()))
&& (this.getChannelMerKey() == null ? other.getChannelMerKey() == null : this.getChannelMerKey().equals(other.getChannelMerKey())) && (this.getChannelMerKey() == null ? other.getChannelMerKey() == null : this.getChannelMerKey().equals(other.getChannelMerKey()))
&& (this.getLedgerAccountFlag() == null ? other.getLedgerAccountFlag() == null : this.getLedgerAccountFlag().equals(other.getLedgerAccountFlag()))
&& (this.getLedgerAccountData() == null ? other.getLedgerAccountData() == null : this.getLedgerAccountData().equals(other.getLedgerAccountData()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
@ -225,6 +253,8 @@ public class BsMerchantPayConfig implements Serializable {
result = prime * result + ((getChannelName() == null) ? 0 : getChannelName().hashCode()); result = prime * result + ((getChannelName() == null) ? 0 : getChannelName().hashCode());
result = prime * result + ((getChannelMerNo() == null) ? 0 : getChannelMerNo().hashCode()); result = prime * result + ((getChannelMerNo() == null) ? 0 : getChannelMerNo().hashCode());
result = prime * result + ((getChannelMerKey() == null) ? 0 : getChannelMerKey().hashCode()); result = prime * result + ((getChannelMerKey() == null) ? 0 : getChannelMerKey().hashCode());
result = prime * result + ((getLedgerAccountFlag() == null) ? 0 : getLedgerAccountFlag().hashCode());
result = prime * result + ((getLedgerAccountData() == null) ? 0 : getLedgerAccountData().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
@ -248,6 +278,8 @@ public class BsMerchantPayConfig implements Serializable {
sb.append(", channelName=").append(channelName); sb.append(", channelName=").append(channelName);
sb.append(", channelMerNo=").append(channelMerNo); sb.append(", channelMerNo=").append(channelMerNo);
sb.append(", channelMerKey=").append(channelMerKey); sb.append(", channelMerKey=").append(channelMerKey);
sb.append(", ledgerAccountFlag=").append(ledgerAccountFlag);
sb.append(", ledgerAccountData=").append(ledgerAccountData);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", status=").append(status); sb.append(", status=").append(status);

@ -665,6 +665,136 @@ public class BsMerchantPayConfigExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andLedgerAccountFlagIsNull() {
addCriterion("ledger_account_flag is null");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagIsNotNull() {
addCriterion("ledger_account_flag is not null");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagEqualTo(Boolean value) {
addCriterion("ledger_account_flag =", value, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagNotEqualTo(Boolean value) {
addCriterion("ledger_account_flag <>", value, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagGreaterThan(Boolean value) {
addCriterion("ledger_account_flag >", value, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagGreaterThanOrEqualTo(Boolean value) {
addCriterion("ledger_account_flag >=", value, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagLessThan(Boolean value) {
addCriterion("ledger_account_flag <", value, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagLessThanOrEqualTo(Boolean value) {
addCriterion("ledger_account_flag <=", value, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagIn(List<Boolean> values) {
addCriterion("ledger_account_flag in", values, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagNotIn(List<Boolean> values) {
addCriterion("ledger_account_flag not in", values, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagBetween(Boolean value1, Boolean value2) {
addCriterion("ledger_account_flag between", value1, value2, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountFlagNotBetween(Boolean value1, Boolean value2) {
addCriterion("ledger_account_flag not between", value1, value2, "ledgerAccountFlag");
return (Criteria) this;
}
public Criteria andLedgerAccountDataIsNull() {
addCriterion("ledger_account_data is null");
return (Criteria) this;
}
public Criteria andLedgerAccountDataIsNotNull() {
addCriterion("ledger_account_data is not null");
return (Criteria) this;
}
public Criteria andLedgerAccountDataEqualTo(String value) {
addCriterion("ledger_account_data =", value, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataNotEqualTo(String value) {
addCriterion("ledger_account_data <>", value, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataGreaterThan(String value) {
addCriterion("ledger_account_data >", value, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataGreaterThanOrEqualTo(String value) {
addCriterion("ledger_account_data >=", value, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataLessThan(String value) {
addCriterion("ledger_account_data <", value, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataLessThanOrEqualTo(String value) {
addCriterion("ledger_account_data <=", value, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataLike(String value) {
addCriterion("ledger_account_data like", value, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataNotLike(String value) {
addCriterion("ledger_account_data not like", value, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataIn(List<String> values) {
addCriterion("ledger_account_data in", values, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataNotIn(List<String> values) {
addCriterion("ledger_account_data not in", values, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataBetween(String value1, String value2) {
addCriterion("ledger_account_data between", value1, value2, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andLedgerAccountDataNotBetween(String value1, String value2) {
addCriterion("ledger_account_data not between", value1, value2, "ledgerAccountData");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;

@ -0,0 +1,59 @@
package com.hfkj.model;
import lombok.Data;
import java.math.BigDecimal;
/**
* 油站列表模型
* @className: GasListModel
* @author: HuRui
* @date: 2024/6/4
**/
@Data
public class GasListModel {
/**
* 商户号
*/
private String merNo;
/**
* 商户名称
*/
private String merName;
/**
* 商户地址
*/
private String address;
/**
* 商户经度
*/
private String longitude;
/**
* 商户纬度
*/
private String latitude;
/**
* 距离
*/
private String distance;
/**
* 油品
*/
private String oilNo;
/**
* 国标价
*/
private BigDecimal priceOfficial;
/**
* 枪价
*/
private BigDecimal priceGun;
/**
* VIP价
*/
private BigDecimal priceVip;
/**
* 油站直降
*/
private BigDecimal gasStationDrop;
}

@ -0,0 +1,22 @@
package com.hfkj.model;
import com.hfkj.entity.BsMerchant;
import lombok.Data;
import java.util.List;
/**
* 油站信息模型
* @className: GasModel
* @author: HuRui
* @date: 2024/6/4
**/
@Data
public class GasModel extends BsMerchant {
/**
* 油站油品
*/
private List<GasOilPriceModel> gasOilPrice;
}

@ -0,0 +1,23 @@
package com.hfkj.model;
import com.hfkj.entity.BsGasOilGunNo;
import com.hfkj.entity.BsGasOilPrice;
import lombok.Data;
import java.util.List;
/**
* 油站油品
* @className: GasOilPriceModel
* @author: HuRui
* @date: 2024/6/4
**/
@Data
public class GasOilPriceModel extends BsGasOilPrice {
/**
* 油站抢号
*/
public List<BsGasOilGunNo> gasOilGunNo;
}

@ -0,0 +1,84 @@
package com.hfkj.model;
import lombok.Data;
import java.math.BigDecimal;
/**
* 团购支付价格模型
* @author hurui
*/
@Data
public class GasPayPriceModel {
/**
* 加油金额
*/
private BigDecimal oilingPrice;
/**
* 优惠价
*/
private BigDecimal priceVip;
/**
* 枪价
*/
private BigDecimal priceGun;
/**
* 成本价
*/
private BigDecimal priceCost;
/**
* 国标价
*/
private BigDecimal priceOfficial;
/**
* 平台价
*/
private BigDecimal pricePlatform;
/**
* 油站直降
*/
private BigDecimal gasStationDrop;
/**
* 平台补贴
*/
private BigDecimal preferentialMargin;
/**
* 加油升数计算方式加油金额 / 国标价
*/
private BigDecimal oilLiters;
/**
* 平台折扣我们平台或者代理商设置的折扣
*/
private BigDecimal discount;
/**
* 每升优惠
*/
private BigDecimal litersPreferences;
/**
* 优惠价格
*/
private BigDecimal pricePreferences;
/**
* 本次优惠
*/
private BigDecimal totalPreferences;
/**
* 支付价格计算方式加油金额 - 本次优惠
*/
private BigDecimal payPrice;
}

@ -1,4 +1,4 @@
package com.hfkj.service; package com.hfkj.service.gas;
import com.hfkj.entity.BsGasOilGunNo; import com.hfkj.entity.BsGasOilGunNo;
import com.hfkj.entity.BsGasOilPrice; import com.hfkj.entity.BsGasOilPrice;

@ -1,4 +1,4 @@
package com.hfkj.service; package com.hfkj.service.gas;
import com.hfkj.entity.BsGasOilPriceOfficial; import com.hfkj.entity.BsGasOilPriceOfficial;

@ -1,4 +1,4 @@
package com.hfkj.service; package com.hfkj.service.gas;
import com.hfkj.entity.BsGasOilPrice; import com.hfkj.entity.BsGasOilPrice;
@ -45,6 +45,13 @@ public interface BsGasOilPriceService {
*/ */
BsGasOilPrice getGasOilPrice(Long merId,String oilNo); BsGasOilPrice getGasOilPrice(Long merId,String oilNo);
/**
* 查询油价列表
* @param merId
* @return
*/
List<BsGasOilPrice> getGasOilPriceList(Long merId);
/** /**
* 查询油价列表 * 查询油价列表
* @param param * @param param

@ -1,4 +1,4 @@
package com.hfkj.service; package com.hfkj.service.gas;
import com.hfkj.entity.BsGasOilPriceTask; import com.hfkj.entity.BsGasOilPriceTask;

@ -0,0 +1,54 @@
package com.hfkj.service.gas;
import com.hfkj.model.GasListModel;
import com.hfkj.model.GasModel;
import com.hfkj.model.GasPayPriceModel;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* @className: BsGasService
* @author: HuRui
* @date: 2024/6/4
**/
public interface BsGasService {
/**
* 更新缓存
* @param data
*/
void cache(GasModel data);
/**
* 清除缓存
* @param merNo
*/
void clean(String merNo);
/**
* 加油计算
* @param refuelPrice
* @param merNo
* @param oilNo
* @param isTyAgent
* @return
* @throws Exception
*/
GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Boolean isTyAgent) ;
/**
* 查询油站信息
* @param merNo 商户号
* @return
*/
GasModel getGasDetail(String merNo);
/**
* 查询油站列表
* @param
* @return
*/
List<GasListModel> getGasList(String longitude,String latitude,String oilNo,String gasName,Integer distanceLimit);
}

@ -0,0 +1,51 @@
package com.hfkj.service.gas;
import com.hfkj.entity.BsGasStaff;
import java.util.List;
import java.util.Map;
/**
* 加油站员工
* @author hurui
*/
public interface BsGasStaffService {
/**
* 编辑员工数据
* @param gasStaff
*/
void editData(BsGasStaff gasStaff);
/**
* 增加员工
* @param gasStaff
*/
void addStaff(BsGasStaff gasStaff) throws Exception;
/**
* 修改员工
* @param gasStaff
*/
void updateStaff(BsGasStaff gasStaff);
/**
* 删除员工
* @param id
*/
void delStaff(Long id);
/**
* 根据id查询
* @param id
* @return
*/
BsGasStaff getStaffDetailById(Long id);
/**
* 查询员工列表
* @param param
* @return
*/
List<BsGasStaff> getStaffList(Map<String, Object> param);
}

@ -1,4 +1,4 @@
package com.hfkj.service.impl; package com.hfkj.service.gas.impl;
import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
@ -7,7 +7,7 @@ import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsGasOilGunNoMapper; import com.hfkj.dao.BsGasOilGunNoMapper;
import com.hfkj.entity.BsGasOilGunNo; import com.hfkj.entity.BsGasOilGunNo;
import com.hfkj.entity.BsGasOilGunNoExample; import com.hfkj.entity.BsGasOilGunNoExample;
import com.hfkj.service.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilGunNoService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;

@ -1,12 +1,12 @@
package com.hfkj.service.impl; package com.hfkj.service.gas.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.dao.BsGasOilPriceOfficialMapper; import com.hfkj.dao.BsGasOilPriceOfficialMapper;
import com.hfkj.entity.*; import com.hfkj.entity.*;
import com.hfkj.service.BsGasOilPriceOfficialService; import com.hfkj.service.gas.BsGasOilPriceOfficialService;
import com.hfkj.service.BsGasOilPriceService; import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.service.CommonService; import com.hfkj.service.CommonService;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;

@ -1,12 +1,12 @@
package com.hfkj.service.impl; package com.hfkj.service.gas.impl;
import com.hfkj.common.utils.RedisUtil; import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsGasOilPriceMapper; import com.hfkj.dao.BsGasOilPriceMapper;
import com.hfkj.entity.BsGasOilPrice; import com.hfkj.entity.BsGasOilPrice;
import com.hfkj.entity.BsGasOilPriceExample; import com.hfkj.entity.BsGasOilPriceExample;
import com.hfkj.service.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilGunNoService;
import com.hfkj.service.BsGasOilPriceService; import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.sysenum.GasOilPriceStatusEnum; import com.hfkj.sysenum.gas.GasOilPriceStatusEnum;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -84,6 +84,15 @@ public class BsGasOilPriceServiceImpl implements BsGasOilPriceService {
return null; return null;
} }
@Override
public List<BsGasOilPrice> getGasOilPriceList(Long merId) {
BsGasOilPriceExample example = new BsGasOilPriceExample();
example.createCriteria()
.andMerIdEqualTo(merId)
.andStatusNotEqualTo(GasOilPriceStatusEnum.status0.getNumber());
return gasOilPriceMapper.selectByExample(example);
}
@Override @Override
public List<BsGasOilPrice> getGasOilPriceList(Map<String, Object> param) { public List<BsGasOilPrice> getGasOilPriceList(Map<String, Object> param) {
BsGasOilPriceExample example = new BsGasOilPriceExample(); BsGasOilPriceExample example = new BsGasOilPriceExample();

@ -1,4 +1,4 @@
package com.hfkj.service.impl; package com.hfkj.service.gas.impl;
import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
@ -11,12 +11,12 @@ import com.hfkj.entity.BsGasOilPriceOfficial;
import com.hfkj.entity.BsGasOilPriceTask; import com.hfkj.entity.BsGasOilPriceTask;
import com.hfkj.entity.BsGasOilPriceTaskExample; import com.hfkj.entity.BsGasOilPriceTaskExample;
import com.hfkj.msg.MsgTopic; import com.hfkj.msg.MsgTopic;
import com.hfkj.service.BsGasOilPriceOfficialService; import com.hfkj.service.gas.BsGasOilPriceOfficialService;
import com.hfkj.service.BsGasOilPriceService; import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.service.BsGasOilPriceTaskService; import com.hfkj.service.gas.BsGasOilPriceTaskService;
import com.hfkj.sysenum.GasTaskExecutionTypeEnum; import com.hfkj.sysenum.gas.GasTaskExecutionTypeEnum;
import com.hfkj.sysenum.GasTaskPriceTypeEnum; import com.hfkj.sysenum.gas.GasTaskPriceTypeEnum;
import com.hfkj.sysenum.GasTaskStatusEnum; import com.hfkj.sysenum.gas.GasTaskStatusEnum;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -31,7 +31,7 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service("gasOilPriceTaskService") @Service("gasOilPriceTaskService")
public class HighGasOilPriceTaskServiceImpl implements BsGasOilPriceTaskService { public class BsGasOilPriceTaskServiceImpl implements BsGasOilPriceTaskService {
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;

@ -0,0 +1,180 @@
package com.hfkj.service.gas.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsMerchantMapper;
import com.hfkj.entity.BsGasOilPrice;
import com.hfkj.entity.BsMerchant;
import com.hfkj.model.GasListModel;
import com.hfkj.model.GasModel;
import com.hfkj.model.GasOilPriceModel;
import com.hfkj.model.GasPayPriceModel;
import com.hfkj.service.gas.BsGasOilGunNoService;
import com.hfkj.service.gas.BsGasOilPriceService;
import com.hfkj.service.gas.BsGasService;
import com.hfkj.service.BsMerchantService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* @className: BsGasServiceImpl
* @author: HuRui
* @date: 2024/6/4
**/
@Service("gasService")
public class BsGasServiceImpl implements BsGasService {
@Resource
private BsMerchantMapper merchantMapper;
@Resource
private BsMerchantService merchantService;
@Resource
private BsGasOilPriceService gasOilPriceService;
@Resource
private BsGasOilGunNoService gasOilGunNoService;
@Resource
private RedisUtil redisUtil;
private final static String CACHE_GAS_KEY = "GAS:";
@Override
public void cache(GasModel data) {
redisUtil.set(CACHE_GAS_KEY + data.getMerNo(), data);
}
@Override
public void clean(String merNo) {
redisUtil.del(CACHE_GAS_KEY+merNo);
}
@Override
public GasPayPriceModel refuelPriceCompute(BigDecimal refuelPrice, String merNo, String oilNo, Boolean isTyAgent) {
// 查询油站信息
BsMerchant merchant = merchantService.getMerchant(merNo);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站");
}
// 优惠比例
BigDecimal discount = new BigDecimal("100");
if (isTyAgent != null && isTyAgent.equals(true)) {
}
discount = discount.divide(new BigDecimal("100"));
// 查询油站价格
BsGasOilPrice gasOilPrice = gasOilPriceService.getGasOilPrice(merchant.getId(), oilNo);
if (gasOilPrice == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站价格");
}
// 国标价
BigDecimal priceOfficial = gasOilPrice.getPriceOfficial();
// 油站价
BigDecimal priceGun = gasOilPrice.getPriceGun();
// 油站直降
BigDecimal gasStationDrop = gasOilPrice.getGasStationDrop();
// 油站优惠价
BigDecimal priceVip = gasOilPrice.getPriceVip();
GasPayPriceModel payPriceModel = new GasPayPriceModel();
// 嗨森逛平台价 油枪价 * 折扣
BigDecimal pricePlatform = priceGun.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP);
// 加油金额
payPriceModel.setOilingPrice(refuelPrice);
// 油站枪价
payPriceModel.setPriceGun(priceGun);
// 油站优惠价
payPriceModel.setPriceVip(priceVip);
// 油站国标价
payPriceModel.setPriceOfficial(priceOfficial);
// 油站直降
payPriceModel.setGasStationDrop(gasStationDrop);
// 平台补贴
payPriceModel.setPreferentialMargin(gasOilPrice.getPreferentialMargin());
// 平台价
payPriceModel.setPricePlatform(pricePlatform);
// 加油升数,计算方式:加油金额 / 枪价
payPriceModel.setOilLiters(refuelPrice.divide(priceGun, 2, BigDecimal.ROUND_HALF_DOWN));
// 平台折扣,我们平台或者代理商设置的折扣
payPriceModel.setDiscount(discount.compareTo(new BigDecimal("1.00")) == 0 ? new BigDecimal("1.00") : discount);
// 加油补贴, 计算方式:加油站枪价 - 加油站VIP价
// payPriceModel.setOilSubsidy(priceGun.subtract(priceVip));
// 折扣,1 -平台折扣
BigDecimal decimal1 = new BigDecimal("1").subtract(discount);
// 油枪价 - 平台补贴
// BigDecimal price = payPriceModel.getPriceGun().subtract(preferentialMargin);
// 优惠价格 油站VIP价 * 系统折扣
payPriceModel.setPricePreferences(priceVip.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP));
// 每升优惠 油站价 - 优惠价格
payPriceModel.setLitersPreferences(payPriceModel.getPriceGun().subtract(payPriceModel.getPricePreferences()));
// 本次优惠 加油升数 * 每升优惠
payPriceModel.setTotalPreferences(payPriceModel.getOilLiters().multiply(payPriceModel.getLitersPreferences()).setScale(2, BigDecimal.ROUND_HALF_UP));
// 支付价格 加油金额 - 本次优惠
payPriceModel.setPayPrice(refuelPrice.subtract(payPriceModel.getTotalPreferences()));
return payPriceModel;
}
@Override
public GasModel getGasDetail(String merNo) {
// 缓存
Object cacheObj = redisUtil.get(CACHE_GAS_KEY + merNo);
if (cacheObj != null) {
return (GasModel) cacheObj;
}
// 查询商户
BsMerchant merchant = merchantService.getMerchant(merNo);
if (merchant == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油站");
}
GasModel gasModel = new GasModel();
BeanUtils.copyProperties(merchant, gasModel);
// 查询油品
List<BsGasOilPrice> oilNoList = gasOilPriceService.getGasOilPriceList(merchant.getId());
List<GasOilPriceModel> oilNoModelList = new ArrayList<>();
for (BsGasOilPrice gasOilPrice : oilNoList) {
GasOilPriceModel oilNo = new GasOilPriceModel();
BeanUtils.copyProperties(gasOilPrice, oilNo);
// 查询抢号
oilNo.setGasOilGunNo(gasOilGunNoService.getOilGunNoList(merNo));
oilNoModelList.add(oilNo);
}
gasModel.setGasOilPrice(oilNoModelList);
// 存入缓存
cache(gasModel);
return gasModel;
}
@Override
public List<GasListModel> getGasList(String longitude, String latitude, String oilNo, String gasName, Integer distanceLimit) {
return merchantMapper.queryGasList(longitude,latitude,oilNo,gasName,distanceLimit);
}
}

@ -0,0 +1,150 @@
package com.hfkj.service.gas.impl;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.MD5Util;
import com.hfkj.dao.BsGasStaffMapper;
import com.hfkj.entity.BsGasStaff;
import com.hfkj.entity.BsGasStaffExample;
import com.hfkj.entity.SecUser;
import com.hfkj.service.gas.BsGasStaffService;
import com.hfkj.service.sec.SecUserService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import com.hfkj.sysenum.gas.GasStaffStatus;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("gasStaffService")
public class BsGasStaffServiceImpl implements BsGasStaffService {
@Resource
private BsGasStaffMapper gasStaffMapper;
@Resource
private SecUserService userService;
@Override
public void editData(BsGasStaff gasStaff) {
if (gasStaff.getId() == null) {
gasStaff.setCreateTime(new Date());
gasStaff.setUpdateTime(new Date());
gasStaff.setStatus(GasStaffStatus.status1.getStatus());
gasStaffMapper.insert(gasStaff);
} else {
gasStaff.setUpdateTime(new Date());
gasStaffMapper.updateByPrimaryKey(gasStaff);
}
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void addStaff(BsGasStaff gasStaff) throws Exception {
if (userService.getDetailByLoginName(gasStaff.getTelephone()) != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "电话已存在,请更换");
}
editData(gasStaff);
SecUser secUser = new SecUser();
secUser.setAvatar(gasStaff.getAvatar());
secUser.setUserName(gasStaff.getName());
secUser.setLoginName(gasStaff.getTelephone());
secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setStatus(1);
secUser.setRoleId(4L);
secUser.setObjectType(SecUserObjectTypeEnum.type3.getCode());
secUser.setObjectId(gasStaff.getId());
secUser.setCreateTime(new Date());
secUser.setUpdateTime(new Date());
userService.editUser(secUser);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void updateStaff(BsGasStaff gasStaff) {
BsGasStaff detail = getStaffDetailById(gasStaff.getId());
if (detail == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (!detail.getTelephone().equals(gasStaff.getTelephone())) {
if (userService.getDetailByLoginName(gasStaff.getTelephone()) != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "电话已存在,请更换");
}
}
editData(gasStaff);
// 查询账户
SecUser account = userService.getDetail(SecUserObjectTypeEnum.type3, gasStaff.getId());
if (account == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到账户");
}
account.setAvatar(gasStaff.getAvatar());
account.setUserName(gasStaff.getName());
account.setLoginName(gasStaff.getTelephone());
account.setUpdateTime(new Date());
userService.editUser(account);
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void delStaff(Long id) {
BsGasStaff gasStaff = getStaffDetailById(id);
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到员工");
}
gasStaff.setStatus(GasStaffStatus.status0.getStatus());
editData(gasStaff);
// 查询账户
SecUser account = userService.getDetail(SecUserObjectTypeEnum.type3, gasStaff.getId());
if (account == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到账户");
}
account.setStatus(0);
userService.editUser(account);
}
@Override
public BsGasStaff getStaffDetailById(Long id) {
return gasStaffMapper.selectByPrimaryKey(id);
}
@Override
public List<BsGasStaff> getStaffList(Map<String, Object> param) {
BsGasStaffExample example = new BsGasStaffExample();
BsGasStaffExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "merchantStoreId") != null) {
criteria.andMerchantStoreIdEqualTo(MapUtils.getLong(param, "merchantStoreId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "name"))) {
criteria.andNameLike("%" + MapUtils.getString(param, "name") + "%");
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "telephone"))) {
criteria.andTelephoneLike("%" + MapUtils.getString(param, "telephone") + "%");
}
if (MapUtils.getInteger(param, "positionType") != null) {
criteria.andPositionTypeEqualTo(MapUtils.getInteger(param, "positionType"));
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status"));
}
example.setOrderByClause("create_time desc");
return gasStaffMapper.selectByExample(example);
}
}

@ -62,19 +62,17 @@ public class BsAgentServiceImpl implements BsAgentService {
public BsAgent createAgent(String loginName, BsAgent agent) throws Exception { public BsAgent createAgent(String loginName, BsAgent agent) throws Exception {
editData(agent); editData(agent);
/*SecUser secUser = new SecUser(); SecUser secUser = new SecUser();
secUser.setUserName(agent.getName()); secUser.setUserName(agent.getName());
secUser.setLoginName(loginName); secUser.setLoginName(loginName);
secUser.setPassword(MD5Util.encode("123456".getBytes())); secUser.setPassword(MD5Util.encode("123456".getBytes()));
secUser.setAdminFlag(1); secUser.setRoleId(5L);
secUser.setCompanyId(agent.getCompanyId()); secUser.setObjectType(SecUserObjectTypeEnum.type4.getCode());
secUser.setRoleId(SecUserRoleIdEnum.roleId3.getRoleId());
secUser.setObjectType(SecUserObjectTypeEnum.type3.getNumber());
secUser.setObjectId(agent.getId()); secUser.setObjectId(agent.getId());
secUser.setStatus(1); secUser.setStatus(1);
secUser.setCreateTime(new Date()); secUser.setCreateTime(new Date());
secUser.setUpdateTime(new Date()); secUser.setUpdateTime(new Date());
secUserService.editUser(secUser);*/ secUserService.editUser(secUser);
return agent; return agent;
} }

@ -158,14 +158,4 @@ public class BsMerchantServiceImpl implements BsMerchantService {
return merchantMapper.selectByExample(example); return merchantMapper.selectByExample(example);
} }
public static void main(String[] args) {
Map<String,Object> param = new HashMap<>();
param.put("merNoList", "");
List<String> merNoList = Arrays.stream(MapUtils.getString(param, "merNoList").split(",")).collect(Collectors.toList());
for (String mer : merNoList) {
System.out.println(mer);
}
}
} }

@ -7,16 +7,26 @@ package com.hfkj.sysenum;
* @date: 2024/4/23 * @date: 2024/4/23
**/ **/
public enum SecUserObjectTypeEnum { public enum SecUserObjectTypeEnum {
/** /**
* 系统账户 * 系统账户
*/ */
type1(1, "系统账户"), type1(1, "系统账户"),
/** /**
* 商户 * 商户
*/ */
type2(2, "商户"), type2(2, "商户"),
/**
* 商户员工
*/
type3(3, "商户员工"),
/**
* 代理商
*/
type4(4, "代理商"),
/**
* 业务员
*/
type5(5, "业务员"),
; ;
private int code; private int code;

@ -1,4 +1,4 @@
package com.hfkj.sysenum; package com.hfkj.sysenum.gas;
import java.util.Objects; import java.util.Objects;

@ -1,4 +1,4 @@
package com.hfkj.sysenum; package com.hfkj.sysenum.gas;
import java.util.Objects; import java.util.Objects;

@ -0,0 +1,36 @@
package com.hfkj.sysenum.gas;
/**
* 加油站员工状态
* @author hurui
*/
public enum GasStaffStatus {
status0(0 , "删除"),
status1(1 , "正常"),
status2(2 , "禁用"),
;
private Integer status;
private String name;
GasStaffStatus(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;
}
}

@ -1,4 +1,4 @@
package com.hfkj.sysenum; package com.hfkj.sysenum.gas;
/** /**
* 加油站价格任务 * 加油站价格任务

@ -1,4 +1,4 @@
package com.hfkj.sysenum; package com.hfkj.sysenum.gas;
/** /**
* 加油站价格任务 * 加油站价格任务

@ -1,4 +1,4 @@
package com.hfkj.sysenum; package com.hfkj.sysenum.gas;
/** /**
* 加油站价格任务 * 加油站价格任务
Loading…
Cancel
Save