diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapper.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapper.java index 2b603b4..89f8933 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapper.java @@ -40,11 +40,13 @@ public interface BsGasOilPriceOfficialMapper extends BsGasOilPriceOfficialMapper @Insert({ "insert into bs_gas_oil_price_official (region_id, region_name, ", + "oil_price_zone_id, oil_price_zone_name, ", "oil_no, oil_no_name, ", "price_official, oil_type, ", "oil_type_name, `status`, ", "ext_1, ext_2, ext_3)", "values (#{regionId,jdbcType=BIGINT}, #{regionName,jdbcType=VARCHAR}, ", + "#{oilPriceZoneId,jdbcType=INTEGER}, #{oilPriceZoneName,jdbcType=VARCHAR}, ", "#{oilNo,jdbcType=VARCHAR}, #{oilNoName,jdbcType=VARCHAR}, ", "#{priceOfficial,jdbcType=DECIMAL}, #{oilType,jdbcType=INTEGER}, ", "#{oilTypeName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", @@ -62,6 +64,8 @@ public interface BsGasOilPriceOfficialMapper extends BsGasOilPriceOfficialMapper @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_price_zone_id", property="oilPriceZoneId", jdbcType=JdbcType.INTEGER), + @Result(column="oil_price_zone_name", property="oilPriceZoneName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), @@ -76,8 +80,9 @@ public interface BsGasOilPriceOfficialMapper extends BsGasOilPriceOfficialMapper @Select({ "select", - "id, region_id, region_name, oil_no, oil_no_name, price_official, oil_type, oil_type_name, ", - "`status`, ext_1, ext_2, ext_3", + "id, region_id, region_name, oil_price_zone_id, oil_price_zone_name, oil_no, ", + "oil_no_name, price_official, oil_type, oil_type_name, `status`, ext_1, ext_2, ", + "ext_3", "from bs_gas_oil_price_official", "where id = #{id,jdbcType=BIGINT}" }) @@ -85,6 +90,8 @@ public interface BsGasOilPriceOfficialMapper extends BsGasOilPriceOfficialMapper @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_price_zone_id", property="oilPriceZoneId", jdbcType=JdbcType.INTEGER), + @Result(column="oil_price_zone_name", property="oilPriceZoneName", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), @@ -110,6 +117,8 @@ public interface BsGasOilPriceOfficialMapper extends BsGasOilPriceOfficialMapper "update bs_gas_oil_price_official", "set region_id = #{regionId,jdbcType=BIGINT},", "region_name = #{regionName,jdbcType=VARCHAR},", + "oil_price_zone_id = #{oilPriceZoneId,jdbcType=INTEGER},", + "oil_price_zone_name = #{oilPriceZoneName,jdbcType=VARCHAR},", "oil_no = #{oilNo,jdbcType=VARCHAR},", "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", "price_official = #{priceOfficial,jdbcType=DECIMAL},", diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialSqlProvider.java index c9034bd..09c29cb 100644 --- a/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialSqlProvider.java @@ -36,6 +36,14 @@ public class BsGasOilPriceOfficialSqlProvider { sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}"); } + if (record.getOilPriceZoneId() != null) { + sql.VALUES("oil_price_zone_id", "#{oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.VALUES("oil_price_zone_name", "#{oilPriceZoneName,jdbcType=VARCHAR}"); + } + if (record.getOilNo() != null) { sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}"); } @@ -84,6 +92,8 @@ public class BsGasOilPriceOfficialSqlProvider { } sql.SELECT("region_id"); sql.SELECT("region_name"); + sql.SELECT("oil_price_zone_id"); + sql.SELECT("oil_price_zone_name"); sql.SELECT("oil_no"); sql.SELECT("oil_no_name"); sql.SELECT("price_official"); @@ -122,6 +132,14 @@ public class BsGasOilPriceOfficialSqlProvider { sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); } + if (record.getOilPriceZoneId() != null) { + sql.SET("oil_price_zone_id = #{record.oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.SET("oil_price_zone_name = #{record.oilPriceZoneName,jdbcType=VARCHAR}"); + } + if (record.getOilNo() != null) { sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); } @@ -169,6 +187,8 @@ public class BsGasOilPriceOfficialSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + sql.SET("oil_price_zone_id = #{record.oilPriceZoneId,jdbcType=INTEGER}"); + sql.SET("oil_price_zone_name = #{record.oilPriceZoneName,jdbcType=VARCHAR}"); sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}"); @@ -196,6 +216,14 @@ public class BsGasOilPriceOfficialSqlProvider { sql.SET("region_name = #{regionName,jdbcType=VARCHAR}"); } + if (record.getOilPriceZoneId() != null) { + sql.SET("oil_price_zone_id = #{oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.SET("oil_price_zone_name = #{oilPriceZoneName,jdbcType=VARCHAR}"); + } + if (record.getOilNo() != null) { sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}"); } diff --git a/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficial.java b/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficial.java index 27a4e6b..c2c93dc 100644 --- a/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficial.java +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficial.java @@ -28,6 +28,16 @@ public class BsGasOilPriceOfficial implements Serializable { */ private String regionName; + /** + * 油价价区id + */ + private Integer oilPriceZoneId; + + /** + * 油价价区名称 + */ + private String oilPriceZoneName; + /** * 油号 */ @@ -90,6 +100,22 @@ public class BsGasOilPriceOfficial implements Serializable { this.regionName = regionName; } + public Integer getOilPriceZoneId() { + return oilPriceZoneId; + } + + public void setOilPriceZoneId(Integer oilPriceZoneId) { + this.oilPriceZoneId = oilPriceZoneId; + } + + public String getOilPriceZoneName() { + return oilPriceZoneName; + } + + public void setOilPriceZoneName(String oilPriceZoneName) { + this.oilPriceZoneName = oilPriceZoneName; + } + public String getOilNo() { return oilNo; } @@ -177,6 +203,8 @@ public class BsGasOilPriceOfficial implements Serializable { return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId())) && (this.getRegionName() == null ? other.getRegionName() == null : this.getRegionName().equals(other.getRegionName())) + && (this.getOilPriceZoneId() == null ? other.getOilPriceZoneId() == null : this.getOilPriceZoneId().equals(other.getOilPriceZoneId())) + && (this.getOilPriceZoneName() == null ? other.getOilPriceZoneName() == null : this.getOilPriceZoneName().equals(other.getOilPriceZoneName())) && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) && (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial())) @@ -195,6 +223,8 @@ public class BsGasOilPriceOfficial implements Serializable { result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode()); result = prime * result + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); + result = prime * result + ((getOilPriceZoneId() == null) ? 0 : getOilPriceZoneId().hashCode()); + result = prime * result + ((getOilPriceZoneName() == null) ? 0 : getOilPriceZoneName().hashCode()); result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode()); @@ -216,6 +246,8 @@ public class BsGasOilPriceOfficial implements Serializable { sb.append(", id=").append(id); sb.append(", regionId=").append(regionId); sb.append(", regionName=").append(regionName); + sb.append(", oilPriceZoneId=").append(oilPriceZoneId); + sb.append(", oilPriceZoneName=").append(oilPriceZoneName); sb.append(", oilNo=").append(oilNo); sb.append(", oilNoName=").append(oilNoName); sb.append(", priceOfficial=").append(priceOfficial); diff --git a/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficialExample.java b/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficialExample.java index 23452a7..6ef0c6b 100644 --- a/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficialExample.java +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficialExample.java @@ -315,6 +315,136 @@ public class BsGasOilPriceOfficialExample { return (Criteria) this; } + public Criteria andOilPriceZoneIdIsNull() { + addCriterion("oil_price_zone_id is null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdIsNotNull() { + addCriterion("oil_price_zone_id is not null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdEqualTo(Integer value) { + addCriterion("oil_price_zone_id =", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotEqualTo(Integer value) { + addCriterion("oil_price_zone_id <>", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdGreaterThan(Integer value) { + addCriterion("oil_price_zone_id >", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_price_zone_id >=", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdLessThan(Integer value) { + addCriterion("oil_price_zone_id <", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdLessThanOrEqualTo(Integer value) { + addCriterion("oil_price_zone_id <=", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdIn(List values) { + addCriterion("oil_price_zone_id in", values, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotIn(List values) { + addCriterion("oil_price_zone_id not in", values, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdBetween(Integer value1, Integer value2) { + addCriterion("oil_price_zone_id between", value1, value2, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotBetween(Integer value1, Integer value2) { + addCriterion("oil_price_zone_id not between", value1, value2, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIsNull() { + addCriterion("oil_price_zone_name is null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIsNotNull() { + addCriterion("oil_price_zone_name is not null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameEqualTo(String value) { + addCriterion("oil_price_zone_name =", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotEqualTo(String value) { + addCriterion("oil_price_zone_name <>", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameGreaterThan(String value) { + addCriterion("oil_price_zone_name >", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_price_zone_name >=", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLessThan(String value) { + addCriterion("oil_price_zone_name <", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLessThanOrEqualTo(String value) { + addCriterion("oil_price_zone_name <=", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLike(String value) { + addCriterion("oil_price_zone_name like", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotLike(String value) { + addCriterion("oil_price_zone_name not like", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIn(List values) { + addCriterion("oil_price_zone_name in", values, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotIn(List values) { + addCriterion("oil_price_zone_name not in", values, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameBetween(String value1, String value2) { + addCriterion("oil_price_zone_name between", value1, value2, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotBetween(String value1, String value2) { + addCriterion("oil_price_zone_name not between", value1, value2, "oilPriceZoneName"); + return (Criteria) this; + } + public Criteria andOilNoIsNull() { addCriterion("oil_no is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java index 8f6dbe3..b56368e 100644 --- a/service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java @@ -65,7 +65,7 @@ public class BsAgentServiceImpl implements BsAgentService { SecUser secUser = new SecUser(); secUser.setUserName(agent.getName()); secUser.setLoginName(loginName); - secUser.setPassword(MD5Util.encode("123456".getBytes())); + secUser.setPassword(MD5Util.encode("123654".getBytes())); secUser.setRoleId(5L); secUser.setObjectType(SecUserObjectTypeEnum.type4.getCode()); secUser.setObjectId(agent.getId()); diff --git a/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceOfficialService.java b/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceOfficialService.java index ef9edb6..ec4d54d 100644 --- a/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceOfficialService.java +++ b/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceOfficialService.java @@ -17,7 +17,7 @@ public interface BsGasOilPriceOfficialService { * @param regionId * @param oilNo */ - void editPrice(Long regionId, String oilNo, BigDecimal price); + void editPrice(Long regionId, Integer oilPriceZoneId, String oilNo, BigDecimal price); /** * 查询价格 @@ -25,7 +25,7 @@ public interface BsGasOilPriceOfficialService { * @param oilNo * @return */ - BsGasOilPriceOfficial getPrice(Long regionId, String oilNo); + BsGasOilPriceOfficial getPrice(Long regionId, Integer oilPriceZoneId, String oilNo); /** * 查询价格列表 diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceOfficialServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceOfficialServiceImpl.java index 053a8f2..5b587e9 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceOfficialServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceOfficialServiceImpl.java @@ -31,16 +31,17 @@ public class BsGasOilPriceOfficialServiceImpl implements BsGasOilPriceOfficialSe private CommonService commonService; @Override - public void editPrice(Long regionId, String oilNo, BigDecimal price) { - BsGasOilPriceOfficial priceOfficial = getPrice(regionId, oilNo); + public void editPrice(Long regionId, Integer oilPriceZoneId, String oilNo, BigDecimal price) { + BsGasOilPriceOfficial priceOfficial = getPrice(regionId, oilPriceZoneId, oilNo); if (priceOfficial != null) { priceOfficial.setPriceOfficial(price); gasOilPriceOfficialMapper.updateByPrimaryKey(priceOfficial); } else { - SecDictionary oil = commonService.mappingSysCode("GAS_OIL_TYPE", oilNo.toString()); + SecDictionary oil = commonService.mappingSysCode("OIL_NO", oilNo.toString()); SecRegion region = commonService.getRegionsById(regionId); priceOfficial = new BsGasOilPriceOfficial(); + priceOfficial.setOilPriceZoneId(oilPriceZoneId); priceOfficial.setRegionId(region.getRegionId()); priceOfficial.setRegionName(region.getRegionName()); priceOfficial.setOilNo(oil.getCodeValue()); @@ -49,14 +50,25 @@ public class BsGasOilPriceOfficialServiceImpl implements BsGasOilPriceOfficialSe priceOfficial.setOilType(Integer.valueOf(oil.getExt1())); priceOfficial.setOilTypeName(oil.getExt2()); priceOfficial.setStatus(1); + if (oilPriceZoneId != null) { + // 查询价区 + SecDictionary oilPriceZone = commonService.mappingSysCode("OIL_PRICE_ZONE", "" + oilPriceZoneId); + if (oilPriceZone != null) { + priceOfficial.setOilPriceZoneId(Integer.valueOf(oilPriceZone.getCodeValue())); + priceOfficial.setOilPriceZoneName(oilPriceZone.getCodeName()); + } + } gasOilPriceOfficialMapper.insert(priceOfficial); } } @Override - public BsGasOilPriceOfficial getPrice(Long regionId, String oilNo) { + public BsGasOilPriceOfficial getPrice(Long regionId, Integer oilPriceZoneId,String oilNo) { BsGasOilPriceOfficialExample example = new BsGasOilPriceOfficialExample(); - example.createCriteria().andRegionIdEqualTo(regionId).andOilNoEqualTo(oilNo); + BsGasOilPriceOfficialExample.Criteria criteria = example.createCriteria().andRegionIdEqualTo(regionId).andOilNoEqualTo(oilNo); + if (oilPriceZoneId != null) { + criteria.andOilPriceZoneIdEqualTo(oilPriceZoneId); + } List list = gasOilPriceOfficialMapper.selectByExample(example); if (list.size() > 0) { return list.get(0); diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceTaskServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceTaskServiceImpl.java index 47162af..2c8ea75 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceTaskServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceTaskServiceImpl.java @@ -90,12 +90,8 @@ public class BsGasOilPriceTaskServiceImpl implements BsGasOilPriceTaskService { // 国标价 if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) { - // 查询国标价油品价格 - BsGasOilPriceOfficial price = gasOilPriceOfficialService.getPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo()); - if (price == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); - } - gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice()); + // 更新国标价 + gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(),gasOilPriceTask.getOilPriceZoneId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice()); // 更新自建站的国标价 gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo()); diff --git a/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java b/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java index 8b4468b..22a71be 100644 --- a/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java @@ -73,7 +73,7 @@ public class SecUserServiceImpl implements SecUserService { if (secUser == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的账户"); } - secUser.setPassword(MD5Util.encode("123456".getBytes())); + secUser.setPassword(MD5Util.encode("123654".getBytes())); editUser(secUser); }