'提交代码'

dev-discount
= 4 years ago
parent 29d6c134ec
commit ec607f9a74
  1. 14
      hai-bweb/src/main/java/com/bweb/controller/HighGasDiscountOilPriceController.java
  2. 71
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  3. 21
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  4. 20
      hai-service/src/main/java/com/hai/dao/HighGasDiscountOilPriceMapper.java
  5. 14
      hai-service/src/main/java/com/hai/dao/HighGasDiscountOilPriceSqlProvider.java
  6. 18
      hai-service/src/main/java/com/hai/entity/HighGasDiscountOilPrice.java
  7. 70
      hai-service/src/main/java/com/hai/entity/HighGasDiscountOilPriceExample.java
  8. 9
      hai-service/src/main/java/com/hai/service/HighGasDiscountOilPriceService.java
  9. 15
      hai-service/src/main/java/com/hai/service/impl/HighGasDiscountOilPriceServiceImpl.java

@ -43,21 +43,23 @@ public class HighGasDiscountOilPriceController {
@ApiOperation(value = "编辑油品价格") @ApiOperation(value = "编辑油品价格")
public ResponseData editGasDiscountOilPrice(@RequestBody JSONObject body) { public ResponseData editGasDiscountOilPrice(@RequestBody JSONObject body) {
try { try {
if (StringUtils.isBlank(body.getString("oilNoName")) || body.getBigDecimal("priceRate") == null) { if (StringUtils.isBlank(body.getString("oilNo")) || body.getBigDecimal("priceRate") == null) {
log.error("HighGasDiscountOilPriceController -> editGasDiscountOilPrice() error!",""); log.error("HighGasDiscountOilPriceController -> editGasDiscountOilPrice() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
if (StringUtils.isBlank(commonService.getDictionaryCodeName("GAS_OIL_TYPE", body.getString("oilNoName")))) { String oilNoName = commonService.getDictionaryCodeName("GAS_OIL_TYPE", body.getString("oilNo"));
if (StringUtils.isBlank(oilNoName)) {
log.error("HighGasDiscountOilPriceController -> editGasDiscountOilPrice() error!",""); log.error("HighGasDiscountOilPriceController -> editGasDiscountOilPrice() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未在系统中找到此油品"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未在系统中找到此油品");
} }
HighGasDiscountOilPrice detail; HighGasDiscountOilPrice detail;
detail = highGasDiscountOilPriceService.getDetailByOilNoName(body.getString("oilNoName")); detail = highGasDiscountOilPriceService.getDetailByOilNoName(body.getString("oilNo"));
if (detail == null) { if (detail == null) {
detail = new HighGasDiscountOilPrice(); detail = new HighGasDiscountOilPrice();
detail.setOilNoName(body.getString("oilNoName")); detail.setOilNo(body.getString("oilNo"));
detail.setOilNoName(oilNoName);
detail.setPriceRate(body.getBigDecimal("priceRate")); detail.setPriceRate(body.getBigDecimal("priceRate"));
detail.setCreateTime(new Date()); detail.setCreateTime(new Date());
detail.setUpdateTime(new Date()); detail.setUpdateTime(new Date());
@ -133,12 +135,14 @@ public class HighGasDiscountOilPriceController {
@RequestMapping(value="/getList",method = RequestMethod.GET) @RequestMapping(value="/getList",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询列表") @ApiOperation(value = "查询列表")
public ResponseData getList(@RequestParam(name = "oilNoName", required = false) String oilNoName, public ResponseData getList(@RequestParam(name = "oilNo", required = false) String oilNo,
@RequestParam(name = "oilNoName", required = false) String oilNoName,
@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> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("oilNo", oilNo);
map.put("oilNoName", oilNoName); map.put("oilNoName", oilNoName);
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);

@ -1,5 +1,7 @@
package com.cweb.controller; package com.cweb.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorCode;
@ -11,11 +13,13 @@ import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst; import com.hai.config.CommonSysConst;
import com.hai.config.TuanYouConfig; import com.hai.config.TuanYouConfig;
import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighGasOrderPushMapper;
import com.hai.entity.HighGasDiscountOilPrice;
import com.hai.entity.HighGasOrderPush; import com.hai.entity.HighGasOrderPush;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.entity.SecRegion; import com.hai.entity.SecRegion;
import com.hai.model.ResponseData; import com.hai.model.ResponseData;
import com.hai.service.CommonService; import com.hai.service.CommonService;
import com.hai.service.HighGasDiscountOilPriceService;
import com.hai.service.HighGasOilPriceService; import com.hai.service.HighGasOilPriceService;
import com.hai.service.HighOrderService; import com.hai.service.HighOrderService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -47,6 +51,9 @@ public class HighGasController {
@Resource @Resource
private CommonService commonService; private CommonService commonService;
@Resource
private HighGasDiscountOilPriceService highGasDiscountOilPriceService;
@Resource @Resource
private HighGasOrderPushMapper highGasOrderPushMapper; private HighGasOrderPushMapper highGasOrderPushMapper;
@ -100,6 +107,27 @@ public class HighGasController {
JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(storeKey); JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(storeKey);
if (jsonObject != null && jsonObject.getString("code").equals("200")) { if (jsonObject != null && jsonObject.getString("code").equals("200")) {
JSONObject result = jsonObject.getJSONObject("result"); JSONObject result = jsonObject.getJSONObject("result");
// 原始油品价格
JSONArray originalOilPriceList = result.getJSONArray("oilPriceList");
// 新油品价格
JSONArray newOilPriceList = new JSONArray();
// 处理油品价格
for (Object oilPriceObject : originalOilPriceList) {
JSONObject price = JSON.parseObject(JSONObject.toJSONString(oilPriceObject), JSONObject.class);
// 查询是否配置了优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNoName(price.getString("oilNoName"));
if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(1, BigDecimal.ROUND_DOWN));
}
newOilPriceList.add(price);
}
result.put("oilPriceList", newOilPriceList);
double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude)); double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));
result.put("distance", Math.round(distance/100d)/10d); result.put("distance", Math.round(distance/100d)/10d);
return ResponseMsgUtil.success(jsonObject.get("result")); return ResponseMsgUtil.success(jsonObject.get("result"));
@ -112,7 +140,7 @@ public class HighGasController {
} }
} }
@RequestMapping(value="/getGasPriceDetail",method = RequestMethod.GET) /* @RequestMapping(value="/getGasPriceDetail",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "根据门店key和油号 查询油价") @ApiOperation(value = "根据门店key和油号 查询油价")
public ResponseData getGasPriceDetail(@RequestParam(name = "storeKey", required = true) String storeKey, public ResponseData getGasPriceDetail(@RequestParam(name = "storeKey", required = true) String storeKey,
@ -124,7 +152,7 @@ public class HighGasController {
if(jsonObject.getJSONArray("result").size() == 0) { if(jsonObject.getJSONArray("result").size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到价格信息"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到价格信息");
} }
return ResponseMsgUtil.success(jsonObject.get("result")); return ResponseMsgUtil.success(jsonObject);
} }
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到价格信息"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到价格信息");
@ -132,7 +160,7 @@ public class HighGasController {
log.error("HighGasController -> getGasPriceDetail() error!",e); log.error("HighGasController -> getGasPriceDetail() error!",e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);
} }
} }*/
@RequestMapping(value="/refuelingOrderRefund",method = RequestMethod.POST) @RequestMapping(value="/refuelingOrderRefund",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ -174,7 +202,7 @@ public class HighGasController {
@RequestMapping(value="/refuelingOrderPush",method = RequestMethod.GET) @RequestMapping(value="/refuelingOrderPush",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "推送订单") @ApiOperation(value = "手动推送订单")
public ResponseData refuelingOrderPush() { public ResponseData refuelingOrderPush() {
try { try {
@ -221,39 +249,4 @@ public class HighGasController {
} }
} }
@RequestMapping(value="/queryThirdOrderDretail",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询订单信息")
public ResponseData queryThirdOrderDretail() {
try {
return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDretail("1624611159129"));
//return ResponseMsgUtil.success(map);
} catch (Exception e) {
log.error("HighGasController -> queryThirdOrderDretail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/test",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "测试")
public ResponseData test() {
try {
String data = "{\"data\":\"ui2KbK5jpLtw7YaA52uSt1TzDpaE5OjeW5O6xg+saM4nN4aVnpoT1aTgJwQt/DuNSbs7LrX6q1B0cpW5T531ltYl1ERxyKXqZyMKBNWzDFuB5QSww22VGfypchGNm+oW\",\"timestamp\":1624611912047,\"companyCode\":\"208241666939552\"}";
JSONObject jsonObject = JSONObject.parseObject(data, JSONObject.class);
//return ResponseMsgUtil.success(AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(jsonObject.getString("data")), SysConst.getSysConfig().getTuanYouAppSecret()));
return ResponseMsgUtil.success(CommonSysConst.getSysConfig().getTuanYouUrl());
} catch (Exception e) {
log.error("HighGasController -> queryThirdOrderDretail() error!",e);
return ResponseMsgUtil.exception(e);
}
}
} }

@ -1,5 +1,7 @@
package com.cweb.controller; package com.cweb.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -187,6 +189,19 @@ public class HighOrderController {
if(jsonObject.getJSONArray("result").size() == 0) { if(jsonObject.getJSONArray("result").size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油价格"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油价格");
} }
/* // 处理油品价格
for (Object oilPriceObject : originalOilPriceList) {
JSONObject price = JSON.parseObject(JSONObject.toJSONString(oilPriceObject), JSONObject.class);
// 查询是否配置了优惠比例
HighGasDiscountOilPrice gasDiscountOilPrice = highGasDiscountOilPriceService.getDetailByOilNoName(price.getString("oilNoName"));
if (gasDiscountOilPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(1, BigDecimal.ROUND_DOWN));
}
newOilPriceList.add(price);
}*/
JSONObject priceDetail = JSONObject.parseObject(JSONObject.toJSONString(jsonObject.getJSONArray("result").get(0)), JSONObject.class); JSONObject priceDetail = JSONObject.parseObject(JSONObject.toJSONString(jsonObject.getJSONArray("result").get(0)), JSONObject.class);
childOrder.setGoodsName(store.getStoreName()); childOrder.setGoodsName(store.getStoreName());
childOrder.setGoodsImg(store.getStoreLogo()); childOrder.setGoodsImg(store.getStoreLogo());
@ -353,7 +368,7 @@ public class HighOrderController {
@RequestMapping(value = "/cancelOrder", method = RequestMethod.GET) @RequestMapping(value = "/cancelOrder", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "取消订单") @ApiOperation(value = "根据订单id 取消订单")
public ResponseData cancelOrder(@RequestParam(name = "orderId", required = true) Long orderId) { public ResponseData cancelOrder(@RequestParam(name = "orderId", required = true) Long orderId) {
try { try {
@ -369,8 +384,8 @@ public class HighOrderController {
@RequestMapping(value = "/cancelOrderByOrderNo", method = RequestMethod.GET) @RequestMapping(value = "/cancelOrderByOrderNo", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "取消订单") @ApiOperation(value = "根据订单号 取消订单")
public ResponseData cancelOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { public ResponseData cancelOrderByOrderNo(@RequestParam(name = "orderNo", required = true) String orderNo) {
try { try {
HighOrder order = highOrderService.getOrderByOrderNo(orderNo); HighOrder order = highOrderService.getOrderByOrderNo(orderNo);

@ -39,12 +39,14 @@ public interface HighGasDiscountOilPriceMapper extends HighGasDiscountOilPriceMa
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
@Insert({ @Insert({
"insert into high_gas_discount_oil_price (oil_no_name, price_rate, ", "insert into high_gas_discount_oil_price (oil_no_name, oil_no, ",
"create_time, update_time, ", "price_rate, create_time, ",
"ext_1, ext_2, ext_3)", "update_time, ext_1, ",
"values (#{oilNoName,jdbcType=VARCHAR}, #{priceRate,jdbcType=DECIMAL}, ", "ext_2, ext_3)",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", "values (#{oilNoName,jdbcType=VARCHAR}, #{oilNo,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" "#{priceRate,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighGasDiscountOilPrice record); int insert(HighGasDiscountOilPrice record);
@ -57,6 +59,7 @@ public interface HighGasDiscountOilPriceMapper extends HighGasDiscountOilPriceMa
@Results({ @Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="price_rate", property="priceRate", jdbcType=JdbcType.DECIMAL), @Result(column="price_rate", property="priceRate", jdbcType=JdbcType.DECIMAL),
@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),
@ -68,13 +71,15 @@ public interface HighGasDiscountOilPriceMapper extends HighGasDiscountOilPriceMa
@Select({ @Select({
"select", "select",
"id, oil_no_name, price_rate, create_time, update_time, ext_1, ext_2, ext_3", "id, oil_no_name, oil_no, price_rate, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from high_gas_discount_oil_price", "from high_gas_discount_oil_price",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@Results({ @Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@Result(column="price_rate", property="priceRate", jdbcType=JdbcType.DECIMAL), @Result(column="price_rate", property="priceRate", jdbcType=JdbcType.DECIMAL),
@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),
@ -96,6 +101,7 @@ public interface HighGasDiscountOilPriceMapper extends HighGasDiscountOilPriceMa
@Update({ @Update({
"update high_gas_discount_oil_price", "update high_gas_discount_oil_price",
"set oil_no_name = #{oilNoName,jdbcType=VARCHAR},", "set oil_no_name = #{oilNoName,jdbcType=VARCHAR},",
"oil_no = #{oilNo,jdbcType=VARCHAR},",
"price_rate = #{priceRate,jdbcType=DECIMAL},", "price_rate = #{priceRate,jdbcType=DECIMAL},",
"create_time = #{createTime,jdbcType=TIMESTAMP},", "create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},", "update_time = #{updateTime,jdbcType=TIMESTAMP},",

@ -32,6 +32,10 @@ public class HighGasDiscountOilPriceSqlProvider {
sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}"); sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}");
} }
if (record.getOilNo() != null) {
sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}");
}
if (record.getPriceRate() != null) { if (record.getPriceRate() != null) {
sql.VALUES("price_rate", "#{priceRate,jdbcType=DECIMAL}"); sql.VALUES("price_rate", "#{priceRate,jdbcType=DECIMAL}");
} }
@ -67,6 +71,7 @@ public class HighGasDiscountOilPriceSqlProvider {
sql.SELECT("id"); sql.SELECT("id");
} }
sql.SELECT("oil_no_name"); sql.SELECT("oil_no_name");
sql.SELECT("oil_no");
sql.SELECT("price_rate"); sql.SELECT("price_rate");
sql.SELECT("create_time"); sql.SELECT("create_time");
sql.SELECT("update_time"); sql.SELECT("update_time");
@ -98,6 +103,10 @@ public class HighGasDiscountOilPriceSqlProvider {
sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}");
} }
if (record.getOilNo() != null) {
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
}
if (record.getPriceRate() != null) { if (record.getPriceRate() != null) {
sql.SET("price_rate = #{record.priceRate,jdbcType=DECIMAL}"); sql.SET("price_rate = #{record.priceRate,jdbcType=DECIMAL}");
} }
@ -132,6 +141,7 @@ public class HighGasDiscountOilPriceSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}");
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
sql.SET("price_rate = #{record.priceRate,jdbcType=DECIMAL}"); sql.SET("price_rate = #{record.priceRate,jdbcType=DECIMAL}");
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}");
@ -152,6 +162,10 @@ public class HighGasDiscountOilPriceSqlProvider {
sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}"); sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}");
} }
if (record.getOilNo() != null) {
sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}");
}
if (record.getPriceRate() != null) { if (record.getPriceRate() != null) {
sql.SET("price_rate = #{priceRate,jdbcType=DECIMAL}"); sql.SET("price_rate = #{priceRate,jdbcType=DECIMAL}");
} }

@ -17,10 +17,15 @@ public class HighGasDiscountOilPrice implements Serializable {
private Long id; private Long id;
/** /**
* 名称 * 名称
*/ */
private String oilNoName; private String oilNoName;
/**
* 油号
*/
private String oilNo;
/** /**
* 优惠比例 * 优惠比例
*/ */
@ -60,6 +65,14 @@ public class HighGasDiscountOilPrice implements Serializable {
this.oilNoName = oilNoName; this.oilNoName = oilNoName;
} }
public String getOilNo() {
return oilNo;
}
public void setOilNo(String oilNo) {
this.oilNo = oilNo;
}
public BigDecimal getPriceRate() { public BigDecimal getPriceRate() {
return priceRate; return priceRate;
} }
@ -122,6 +135,7 @@ public class HighGasDiscountOilPrice implements Serializable {
HighGasDiscountOilPrice other = (HighGasDiscountOilPrice) that; HighGasDiscountOilPrice other = (HighGasDiscountOilPrice) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName()))
&& (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo()))
&& (this.getPriceRate() == null ? other.getPriceRate() == null : this.getPriceRate().equals(other.getPriceRate())) && (this.getPriceRate() == null ? other.getPriceRate() == null : this.getPriceRate().equals(other.getPriceRate()))
&& (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()))
@ -136,6 +150,7 @@ public class HighGasDiscountOilPrice implements Serializable {
int result = 1; int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode());
result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode());
result = prime * result + ((getPriceRate() == null) ? 0 : getPriceRate().hashCode()); result = prime * result + ((getPriceRate() == null) ? 0 : getPriceRate().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());
@ -153,6 +168,7 @@ public class HighGasDiscountOilPrice implements Serializable {
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", oilNoName=").append(oilNoName); sb.append(", oilNoName=").append(oilNoName);
sb.append(", oilNo=").append(oilNo);
sb.append(", priceRate=").append(priceRate); sb.append(", priceRate=").append(priceRate);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);

@ -256,6 +256,76 @@ public class HighGasDiscountOilPriceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOilNoIsNull() {
addCriterion("oil_no is null");
return (Criteria) this;
}
public Criteria andOilNoIsNotNull() {
addCriterion("oil_no is not null");
return (Criteria) this;
}
public Criteria andOilNoEqualTo(String value) {
addCriterion("oil_no =", value, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoNotEqualTo(String value) {
addCriterion("oil_no <>", value, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoGreaterThan(String value) {
addCriterion("oil_no >", value, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoGreaterThanOrEqualTo(String value) {
addCriterion("oil_no >=", value, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoLessThan(String value) {
addCriterion("oil_no <", value, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoLessThanOrEqualTo(String value) {
addCriterion("oil_no <=", value, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoLike(String value) {
addCriterion("oil_no like", value, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoNotLike(String value) {
addCriterion("oil_no not like", value, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoIn(List<String> values) {
addCriterion("oil_no in", values, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoNotIn(List<String> values) {
addCriterion("oil_no not in", values, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoBetween(String value1, String value2) {
addCriterion("oil_no between", value1, value2, "oilNo");
return (Criteria) this;
}
public Criteria andOilNoNotBetween(String value1, String value2) {
addCriterion("oil_no not between", value1, value2, "oilNo");
return (Criteria) this;
}
public Criteria andPriceRateIsNull() { public Criteria andPriceRateIsNull() {
addCriterion("price_rate is null"); addCriterion("price_rate is null");
return (Criteria) this; return (Criteria) this;

@ -26,7 +26,14 @@ public interface HighGasDiscountOilPriceService {
HighGasDiscountOilPrice getDetail(Long id); HighGasDiscountOilPrice getDetail(Long id);
/** /**
* 根据油品名称 查询 * 根据油号 查询
* @param oilNoName
* @return
*/
HighGasDiscountOilPrice getDetailByOilNo(String oilNo);
/**
* 根据油号名称 查询
* @param oilNoName * @param oilNoName
* @return * @return
*/ */

@ -37,6 +37,17 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
return highGasDiscountOilPriceMapper.selectByPrimaryKey(id); return highGasDiscountOilPriceMapper.selectByPrimaryKey(id);
} }
@Override
public HighGasDiscountOilPrice getDetailByOilNo(String oilNo) {
HighGasDiscountOilPriceExample example = new HighGasDiscountOilPriceExample();
example.createCriteria().andOilNoEqualTo(oilNo);
List<HighGasDiscountOilPrice> list = highGasDiscountOilPriceMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override @Override
public HighGasDiscountOilPrice getDetailByOilNoName(String oilNoName) { public HighGasDiscountOilPrice getDetailByOilNoName(String oilNoName) {
HighGasDiscountOilPriceExample example = new HighGasDiscountOilPriceExample(); HighGasDiscountOilPriceExample example = new HighGasDiscountOilPriceExample();
@ -53,6 +64,10 @@ public class HighGasDiscountOilPriceServiceImpl implements HighGasDiscountOilPri
HighGasDiscountOilPriceExample example = new HighGasDiscountOilPriceExample(); HighGasDiscountOilPriceExample example = new HighGasDiscountOilPriceExample();
HighGasDiscountOilPriceExample.Criteria criteria = example.createCriteria(); HighGasDiscountOilPriceExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(MapUtils.getString(map, "oilNo"))) {
criteria.andOilNoEqualTo(MapUtils.getString(map, "oilNo"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "oilNoName"))) { if (StringUtils.isNotBlank(MapUtils.getString(map, "oilNoName"))) {
criteria.andOilNoNameEqualTo(MapUtils.getString(map, "oilNoName")); criteria.andOilNoNameEqualTo(MapUtils.getString(map, "oilNoName"));
} }

Loading…
Cancel
Save