提交代码

dev-discount
胡锐 3 years ago
parent be5c1a82e5
commit 0b534f4a9e
  1. 60
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  2. 14
      hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java
  3. 6
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  4. 2
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  5. 2
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  6. 28
      hai-service/src/main/java/com/hai/config/CommonSysConfig.java
  7. 10
      hai-service/src/main/java/com/hai/config/UnionUserConfig.java
  8. 11
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapper.java
  9. 1
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java
  10. 14
      hai-service/src/main/java/com/hai/dao/HighGasOilPriceSqlProvider.java
  11. 29
      hai-service/src/main/java/com/hai/dao/HighTyAgentPriceMapper.java
  12. 14
      hai-service/src/main/java/com/hai/dao/HighTyAgentPriceSqlProvider.java
  13. 16
      hai-service/src/main/java/com/hai/entity/HighGasOilPrice.java
  14. 60
      hai-service/src/main/java/com/hai/entity/HighGasOilPriceExample.java
  15. 16
      hai-service/src/main/java/com/hai/entity/HighTyAgentPrice.java
  16. 60
      hai-service/src/main/java/com/hai/entity/HighTyAgentPriceExample.java
  17. 36
      hai-service/src/main/java/com/hai/enum_type/GasOilPriceStatusEnum.java
  18. 4
      hai-service/src/main/java/com/hai/service/HighTyAgentPriceService.java
  19. 4
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java
  20. 3
      hai-service/src/main/java/com/hai/service/impl/HighTyAgentPriceServiceImpl.java
  21. 5
      hai-service/src/main/resources/dev/commonConfig.properties
  22. 5
      hai-service/src/main/resources/pre/commonConfig.properties
  23. 4
      hai-service/src/main/resources/prod-9401/commonConfig.properties
  24. 5
      hai-service/src/main/resources/prod/commonConfig.properties

@ -9,7 +9,10 @@ import com.hai.common.utils.CoordCommonUtil;
import com.hai.common.utils.PageUtil;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.TuanYouConfig;
import com.hai.entity.HighGasDiscountOilPrice;
import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighOrder;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.model.ResponseData;
import com.hai.service.HighGasOilPriceService;
import com.hai.service.HighOrderService;
@ -22,10 +25,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Controller
@ -41,6 +41,58 @@ public class HighGasController {
@Resource
private HighOrderService highOrderService;
@RequestMapping(value="/disabledOil",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "禁用油品")
public ResponseData disabledOil(@RequestBody JSONObject body) {
try {
if (body.getLong("storeId") == null || body.getInteger("oilNo") == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询油品价格
HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), body.getInteger("oilNo"));
if (oilNo == null) {
log.error("HighGasController -> disabledOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
oilNo.setStatus(GasOilPriceStatusEnum.status2.getStatus());
highGasOilPriceService.editGasOilPrice(oilNo);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasController -> disabledOil() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/enableOil",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "启用油品")
public ResponseData enableOil(@RequestBody JSONObject body) {
try {
if (body.getLong("storeId") == null || body.getInteger("oilNo") == null) {
log.error("HighGasController -> enableOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询油品价格
HighGasOilPrice oilNo = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(body.getLong("storeId"), body.getInteger("oilNo"));
if (oilNo == null) {
log.error("HighGasController -> enableOil() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
oilNo.setStatus(GasOilPriceStatusEnum.status1.getStatus());
highGasOilPriceService.editGasOilPrice(oilNo);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighGasController -> enableOil() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGasStoreList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询加油站列表")

@ -66,7 +66,8 @@ public class HighTyAgentPriceController {
for (Object obj : bodyArray) {
JSONObject body = (JSONObject)JSONObject.toJSON(obj);
if (body.getLong("tyAgentOilStationId") == null
if (body.getInteger("belongType") == null
|| body.getLong("tyAgentOilStationId") == null
|| StringUtils.isBlank(body.getString("oilNoName"))
|| StringUtils.isBlank(body.getString("oilNo"))
|| body.getBigDecimal("priceRate") == null) {
@ -74,9 +75,10 @@ public class HighTyAgentPriceController {
}
// 查询油站
HighTyAgentPrice agentOilStation = tyAgentPriceService.getDetail(body.getLong("tyAgentOilStationId"), body.getString("oilNo"));
HighTyAgentPrice agentOilStation = tyAgentPriceService.getDetail(body.getInteger("belongType"),body.getLong("tyAgentOilStationId"), body.getString("oilNo"));
if (agentOilStation == null) {
agentOilStation = new HighTyAgentPrice();
agentOilStation.setBelongType(body.getInteger("belongType"));
agentOilStation.setTyAgentOilStationId(body.getLong("tyAgentOilStationId"));
agentOilStation.setOilNoName(body.getString("oilNoName"));
agentOilStation.setOilNo(body.getString("oilNo"));
@ -87,7 +89,6 @@ public class HighTyAgentPriceController {
tyAgentPriceService.editTyAgentPrice(agentOilStation);
}
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
@ -99,7 +100,8 @@ public class HighTyAgentPriceController {
@RequestMapping(value = "/getOilStationPrice", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "油站价格")
public ResponseData getOilStationPrice(@RequestParam(name = "oilStationId", required = true) Long oilStationId) {
public ResponseData getOilStationPrice(@RequestParam(name = "belongType", required = true) Integer belongType,
@RequestParam(name = "oilStationId", required = true) Long oilStationId) {
try {
HighTyAgentOilStation station = tyAgentOilStationService.getDetailByOilStationId(oilStationId);
@ -117,12 +119,14 @@ public class HighTyAgentPriceController {
for (HighGasOilPrice price : oilPriceList) {
oilPriceMap = new HashMap<>();
oilPriceMap.put("tyAgentOilStationId", station.getId());
oilPriceMap.put("oilStationId", price.getMerchantStoreId());
oilPriceMap.put("oilNo", price.getOilNo());
oilPriceMap.put("oilNoName", price.getOilNoName());
oilPriceMap.put("status", price.getStatus());
oilPriceMap.put("lowPrice", commonService.getDictionaryCodeName("TY_AGENT_OIL_STATION_LOW_PRICE", price.getOilNo().toString()));
// 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(station.getId(), price.getOilNo().toString());
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(belongType, station.getId(), price.getOilNo().toString());
if (priceRate == null) {
oilPriceMap.put("priceRate", gasDiscountOilPriceService.getDetailByOilNo(price.getOilNo().toString()).getPriceRate());
} else {

@ -113,7 +113,7 @@ public class HighGasController {
// 查询是否配置了优惠比例
HighTyAgentOilStation tyAgentOilStation = tyAgentOilStationService.getDetailByOilStationId(MapUtils.getLong(map, "id"));
if (tyAgentOilStation != null) {
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(tyAgentOilStation.getId(), MapUtils.getString(map, "oil_no"));
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(2,tyAgentOilStation.getId(), MapUtils.getString(map, "oil_no"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));
@ -147,7 +147,7 @@ public class HighGasController {
HighTyAgentOilStation oilStation = tyAgentOilStationService.getDetailByOilStationId(goodsId);
if (oilStation != null) {
// 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(oilStation.getId(), oilNo);
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(1, oilStation.getId(), oilNo);
if (priceRate == null) {
discount = gasDiscountOilPriceService.getDetailByOilNo(oilNo).getPriceRate();
} else {
@ -205,7 +205,7 @@ public class HighGasController {
// 查询是否配置了优惠比例
HighTyAgentOilStation tyAgentOilStation = tyAgentOilStationService.getDetailByOilStationId(store.getId());
if (tyAgentOilStation != null) {
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(tyAgentOilStation.getId(), price.getString("oilNo"));
HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(1, tyAgentOilStation.getId(), price.getString("oilNo"));
if (tyAgentPrice != null) {
// 优惠比例 / 100 = 最终优惠比例
BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN));

@ -246,7 +246,7 @@ public class HighOrderController {
childOrder.setGasOrgName(oilStation.getOrganizationName());
// 价格
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(oilStation.getId(), childOrder.getGasOilNo());
HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(1, oilStation.getId(), childOrder.getGasOilNo());
if (priceRate == null) {
discount = gasDiscountOilPriceService.getDetailByOilNo(childOrder.getGasOilNo()).getPriceRate();
} else {

@ -8,6 +8,7 @@ import com.hai.common.exception.SysCode;
import com.hai.config.TuanYouConfig;
import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighMerchantStore;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.model.HighMerchantModel;
import com.hai.model.HighMerchantStoreModel;
import com.hai.service.HighGasOilPriceService;
@ -88,6 +89,7 @@ public class HighGasSchedule {
highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial"));
highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType"));
highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName"));
highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus());
} else {
highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo"));

@ -62,6 +62,34 @@ public class CommonSysConfig {
private String CzUrl;
private String CzAppSecret;
private String unionAppId;
private String unionSecret;
private String unionRsaKey;
public String getUnionAppId() {
return unionAppId;
}
public void setUnionAppId(String unionAppId) {
this.unionAppId = unionAppId;
}
public String getUnionSecret() {
return unionSecret;
}
public void setUnionSecret(String unionSecret) {
this.unionSecret = unionSecret;
}
public String getUnionRsaKey() {
return unionRsaKey;
}
public void setUnionRsaKey(String unionRsaKey) {
this.unionRsaKey = unionRsaKey;
}
public String getTuanYouUrl() {
return tuanYouUrl;
}

@ -1,16 +1,13 @@
package com.hai.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.pay.util.sdk.WXPayConstants;
import com.hai.common.utils.HttpsUtils;
import com.hai.common.utils.RedisUtil;
import com.hai.common.utils.UnionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.ws.rs.core.MediaType;
import javax.xml.bind.DatatypeConverter;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
@ -28,12 +25,13 @@ import java.util.*;
public class UnionUserConfig {
private static String requestUrl = "https://open.95516.com/open/access/1.0/";
private static String appId = "cf56ac6f9f6b4744bfba9e5587db147c";
private static String secret = "665193ddd44248acb461594cfe0ded5b";
private static String rsaKey = "df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7";
private static String appId = CommonSysConst.getSysConfig().getUnionAppId();
private static String secret = CommonSysConst.getSysConfig().getUnionSecret();
private static String rsaKey = CommonSysConst.getSysConfig().getUnionRsaKey();
@Resource
private RedisUtil redisUtil;
/**
* 获取应用访问令牌backendToken
* @return

@ -43,12 +43,14 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
"oil_no_name, price_vip, ",
"price_gun, price_official, ",
"oil_type, oil_type_name, ",
"ext_1, ext_2, ext_3)",
"`status`, ext_1, ext_2, ",
"ext_3)",
"values (#{merchantStoreId,jdbcType=BIGINT}, #{oilNo,jdbcType=INTEGER}, ",
"#{oilNoName,jdbcType=VARCHAR}, #{priceVip,jdbcType=DECIMAL}, ",
"#{priceGun,jdbcType=DECIMAL}, #{priceOfficial,jdbcType=DECIMAL}, ",
"#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighGasOilPrice record);
@ -68,6 +70,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER),
@Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
@ -77,7 +80,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Select({
"select",
"id, merchant_store_id, oil_no, oil_no_name, price_vip, price_gun, price_official, ",
"oil_type, oil_type_name, ext_1, ext_2, ext_3",
"oil_type, oil_type_name, `status`, ext_1, ext_2, ext_3",
"from high_gas_oil_price",
"where id = #{id,jdbcType=BIGINT}"
})
@ -91,6 +94,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
@Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL),
@Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER),
@Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
@ -116,6 +120,7 @@ public interface HighGasOilPriceMapper extends HighGasOilPriceMapperExt {
"price_official = #{priceOfficial,jdbcType=DECIMAL},",
"oil_type = #{oilType,jdbcType=INTEGER},",
"oil_type_name = #{oilTypeName,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",

@ -25,6 +25,7 @@ public interface HighGasOilPriceMapperExt {
" WHERE" +
" a.merchant_store_id = b.id " +
" AND b.`status` = 1 " +
" AND a.`status` = 1 " +
" AND b.region_id = #{regionId} " +
" AND a.oil_no_name = #{oilNoName}" +
"<if test='storeName != null'> and b.store_name like '%${storeName}%'</if>" +

@ -60,6 +60,10 @@ public class HighGasOilPriceSqlProvider {
sql.VALUES("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
@ -90,6 +94,7 @@ public class HighGasOilPriceSqlProvider {
sql.SELECT("price_official");
sql.SELECT("oil_type");
sql.SELECT("oil_type_name");
sql.SELECT("`status`");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
@ -146,6 +151,10 @@ public class HighGasOilPriceSqlProvider {
sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
@ -175,6 +184,7 @@ public class HighGasOilPriceSqlProvider {
sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}");
sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}");
sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
@ -220,6 +230,10 @@ public class HighGasOilPriceSqlProvider {
sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}

@ -39,16 +39,16 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into high_ty_agent_price (ty_agent_oil_station_id, oil_no_name, ",
"oil_no, price_rate, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{tyAgentOilStationId,jdbcType=BIGINT}, #{oilNoName,jdbcType=VARCHAR}, ",
"#{oilNo,jdbcType=VARCHAR}, #{priceRate,jdbcType=DECIMAL}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"insert into high_ty_agent_price (belong_type, ty_agent_oil_station_id, ",
"oil_no_name, oil_no, ",
"price_rate, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{belongType,jdbcType=INTEGER}, #{tyAgentOilStationId,jdbcType=BIGINT}, ",
"#{oilNoName,jdbcType=VARCHAR}, #{oilNo,jdbcType=VARCHAR}, ",
"#{priceRate,jdbcType=DECIMAL}, #{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(HighTyAgentPrice record);
@ -60,6 +60,7 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt {
@SelectProvider(type=HighTyAgentPriceSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="belong_type", property="belongType", jdbcType=JdbcType.INTEGER),
@Result(column="ty_agent_oil_station_id", property="tyAgentOilStationId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@ -75,13 +76,14 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt {
@Select({
"select",
"id, ty_agent_oil_station_id, oil_no_name, oil_no, price_rate, `status`, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"id, belong_type, ty_agent_oil_station_id, oil_no_name, oil_no, price_rate, `status`, ",
"create_time, update_time, ext_1, ext_2, ext_3",
"from high_ty_agent_price",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="belong_type", property="belongType", jdbcType=JdbcType.INTEGER),
@Result(column="ty_agent_oil_station_id", property="tyAgentOilStationId", jdbcType=JdbcType.BIGINT),
@Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR),
@Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR),
@ -106,7 +108,8 @@ public interface HighTyAgentPriceMapper extends HighTyAgentPriceMapperExt {
@Update({
"update high_ty_agent_price",
"set ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT},",
"set belong_type = #{belongType,jdbcType=INTEGER},",
"ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT},",
"oil_no_name = #{oilNoName,jdbcType=VARCHAR},",
"oil_no = #{oilNo,jdbcType=VARCHAR},",
"price_rate = #{priceRate,jdbcType=DECIMAL},",

@ -28,6 +28,10 @@ public class HighTyAgentPriceSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("high_ty_agent_price");
if (record.getBelongType() != null) {
sql.VALUES("belong_type", "#{belongType,jdbcType=INTEGER}");
}
if (record.getTyAgentOilStationId() != null) {
sql.VALUES("ty_agent_oil_station_id", "#{tyAgentOilStationId,jdbcType=BIGINT}");
}
@ -78,6 +82,7 @@ public class HighTyAgentPriceSqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("belong_type");
sql.SELECT("ty_agent_oil_station_id");
sql.SELECT("oil_no_name");
sql.SELECT("oil_no");
@ -109,6 +114,10 @@ public class HighTyAgentPriceSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getBelongType() != null) {
sql.SET("belong_type = #{record.belongType,jdbcType=INTEGER}");
}
if (record.getTyAgentOilStationId() != null) {
sql.SET("ty_agent_oil_station_id = #{record.tyAgentOilStationId,jdbcType=BIGINT}");
}
@ -158,6 +167,7 @@ public class HighTyAgentPriceSqlProvider {
sql.UPDATE("high_ty_agent_price");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("belong_type = #{record.belongType,jdbcType=INTEGER}");
sql.SET("ty_agent_oil_station_id = #{record.tyAgentOilStationId,jdbcType=BIGINT}");
sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}");
sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}");
@ -178,6 +188,10 @@ public class HighTyAgentPriceSqlProvider {
SQL sql = new SQL();
sql.UPDATE("high_ty_agent_price");
if (record.getBelongType() != null) {
sql.SET("belong_type = #{belongType,jdbcType=INTEGER}");
}
if (record.getTyAgentOilStationId() != null) {
sql.SET("ty_agent_oil_station_id = #{tyAgentOilStationId,jdbcType=BIGINT}");
}

@ -58,6 +58,11 @@ public class HighGasOilPrice implements Serializable {
*/
private String oilTypeName;
/**
* 状态 0删除 1正常 2禁用
*/
private Integer status;
private String ext1;
private String ext2;
@ -138,6 +143,14 @@ public class HighGasOilPrice implements Serializable {
this.oilTypeName = oilTypeName;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getExt1() {
return ext1;
}
@ -183,6 +196,7 @@ public class HighGasOilPrice implements Serializable {
&& (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial()))
&& (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType()))
&& (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (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()));
@ -201,6 +215,7 @@ public class HighGasOilPrice implements Serializable {
result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode());
result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode());
result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().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());
@ -222,6 +237,7 @@ public class HighGasOilPrice implements Serializable {
sb.append(", priceOfficial=").append(priceOfficial);
sb.append(", oilType=").append(oilType);
sb.append(", oilTypeName=").append(oilTypeName);
sb.append(", status=").append(status);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);

@ -685,6 +685,66 @@ public class HighGasOilPriceExample {
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("`status` is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("`status` =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("`status` <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("`status` >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("`status` >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("`status` <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("`status` <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("`status` not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("`status` between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("`status` not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;

@ -16,6 +16,11 @@ import java.util.Date;
public class HighTyAgentPrice implements Serializable {
private Long id;
/**
* 类型 1平台 2代理商
*/
private Integer belongType;
/**
* 代理油站id
*/
@ -67,6 +72,14 @@ public class HighTyAgentPrice implements Serializable {
this.id = id;
}
public Integer getBelongType() {
return belongType;
}
public void setBelongType(Integer belongType) {
this.belongType = belongType;
}
public Long getTyAgentOilStationId() {
return tyAgentOilStationId;
}
@ -160,6 +173,7 @@ public class HighTyAgentPrice implements Serializable {
}
HighTyAgentPrice other = (HighTyAgentPrice) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getBelongType() == null ? other.getBelongType() == null : this.getBelongType().equals(other.getBelongType()))
&& (this.getTyAgentOilStationId() == null ? other.getTyAgentOilStationId() == null : this.getTyAgentOilStationId().equals(other.getTyAgentOilStationId()))
&& (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName()))
&& (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo()))
@ -177,6 +191,7 @@ public class HighTyAgentPrice implements Serializable {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getBelongType() == null) ? 0 : getBelongType().hashCode());
result = prime * result + ((getTyAgentOilStationId() == null) ? 0 : getTyAgentOilStationId().hashCode());
result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode());
result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode());
@ -197,6 +212,7 @@ public class HighTyAgentPrice implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", belongType=").append(belongType);
sb.append(", tyAgentOilStationId=").append(tyAgentOilStationId);
sb.append(", oilNoName=").append(oilNoName);
sb.append(", oilNo=").append(oilNo);

@ -186,6 +186,66 @@ public class HighTyAgentPriceExample {
return (Criteria) this;
}
public Criteria andBelongTypeIsNull() {
addCriterion("belong_type is null");
return (Criteria) this;
}
public Criteria andBelongTypeIsNotNull() {
addCriterion("belong_type is not null");
return (Criteria) this;
}
public Criteria andBelongTypeEqualTo(Integer value) {
addCriterion("belong_type =", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeNotEqualTo(Integer value) {
addCriterion("belong_type <>", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeGreaterThan(Integer value) {
addCriterion("belong_type >", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("belong_type >=", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeLessThan(Integer value) {
addCriterion("belong_type <", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeLessThanOrEqualTo(Integer value) {
addCriterion("belong_type <=", value, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeIn(List<Integer> values) {
addCriterion("belong_type in", values, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeNotIn(List<Integer> values) {
addCriterion("belong_type not in", values, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeBetween(Integer value1, Integer value2) {
addCriterion("belong_type between", value1, value2, "belongType");
return (Criteria) this;
}
public Criteria andBelongTypeNotBetween(Integer value1, Integer value2) {
addCriterion("belong_type not between", value1, value2, "belongType");
return (Criteria) this;
}
public Criteria andTyAgentOilStationIdIsNull() {
addCriterion("ty_agent_oil_station_id is null");
return (Criteria) this;

@ -0,0 +1,36 @@
package com.hai.enum_type;
/**
* 油站油品价格状态
* @author hurui
*/
public enum GasOilPriceStatusEnum {
status0(0 , "删除"),
status1(1 , "正常"),
status2(2 , "禁用"),
;
private Integer status;
private String name;
GasOilPriceStatusEnum(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;
}
}

@ -16,9 +16,11 @@ public interface HighTyAgentPriceService {
/**
* 根据代理油站id 查询详情
* @param belongType
* @param tyAgentOilStationId
* @param oilNo
* @return
*/
HighTyAgentPrice getDetail(Long tyAgentOilStationId, String oilNo);
HighTyAgentPrice getDetail(Integer belongType, Long tyAgentOilStationId, String oilNo);
}

@ -3,6 +3,7 @@ package com.hai.service.impl;
import com.hai.dao.HighGasOilPriceMapper;
import com.hai.entity.HighGasOilPrice;
import com.hai.entity.HighGasOilPriceExample;
import com.hai.enum_type.GasOilPriceStatusEnum;
import com.hai.service.HighGasOilPriceService;
import org.springframework.stereotype.Service;
@ -21,6 +22,7 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService {
if (highGasOilPrice.getId() != null) {
highGasOilPriceMapper.updateByPrimaryKey(highGasOilPrice);
} else {
highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus());
highGasOilPriceMapper.insert(highGasOilPrice);
}
}
@ -39,7 +41,7 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService {
@Override
public List<HighGasOilPrice> getGasOilPriceByStore(Long storeId) {
HighGasOilPriceExample example = new HighGasOilPriceExample();
example.createCriteria().andMerchantStoreIdEqualTo(storeId);
example.createCriteria().andMerchantStoreIdEqualTo(storeId).andStatusNotEqualTo(0);
return highGasOilPriceMapper.selectByExample(example);
}

@ -30,9 +30,10 @@ public class HighTyAgentPriceServiceImpl implements HighTyAgentPriceService {
}
@Override
public HighTyAgentPrice getDetail(Long tyAgentOilStationId, String oilNo) {
public HighTyAgentPrice getDetail(Integer belongType, Long tyAgentOilStationId, String oilNo) {
HighTyAgentPriceExample example = new HighTyAgentPriceExample();
example.createCriteria()
.andBelongTypeEqualTo(belongType)
.andStatusEqualTo(1)
.andTyAgentOilStationIdEqualTo(tyAgentOilStationId)
.andOilNoEqualTo(oilNo);

@ -56,3 +56,8 @@ CzNotifyUrl = https://hsgcs.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = eaomqcbpdz7yjfih
CzUrl = https://hfcs.dmjvip.com/index.php/third/mobile/
CzAppSecret = xkf9eoq2cjh6uvzp0mtrga134lnibdw8
unionAppId=7113783e75354df2a985efd3f31b9528
unionSecret=e2c731d2a026469aa6d218432f361653
unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c

@ -42,3 +42,8 @@ wx_cert=/home/project/wx_cert/
TelApiKey=2d01f6b520254b1a80f6b167832cea18
TelApiSecret=d11ee9b41e014a039f030e53ae6f5295
TelMemberId=d13091df65d64aafbf0f35d2093157b7
unionAppId=7113783e75354df2a985efd3f31b9528
unionSecret=e2c731d2a026469aa6d218432f361653
unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c

@ -51,3 +51,7 @@ CzNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = p429mlj3cvn5hb07
CzUrl = https://jj.dmjvip.com/index.php/third/mobile/
CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij
unionAppId=cf56ac6f9f6b4744bfba9e5587db147c
unionSecret=665193ddd44248acb461594cfe0ded5b
unionRsaKey=df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7

@ -51,3 +51,8 @@ CzNotifyUrl = https://hsg.dctpay.com/crest/czOrder/rechargeCallback
CzAppKey = p429mlj3cvn5hb07
CzUrl = https://jj.dmjvip.com/index.php/third/mobile/
CzAppSecret = bf57pnqy8mkexr0v169c3g4odazwu2ij
unionAppId=cf56ac6f9f6b4744bfba9e5587db147c
unionSecret=665193ddd44248acb461594cfe0ded5b
unionRsaKey=df0bdf7f5ef7bff770f2f21fe549c461df0bdf7f5ef7bff7

Loading…
Cancel
Save