提交代码

master
胡锐 5 months ago
parent 9aa7a535fd
commit 21c1e8c1c2
  1. 13
      service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapper.java
  2. 28
      service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialSqlProvider.java
  3. 32
      service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficial.java
  4. 130
      service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficialExample.java
  5. 2
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentServiceImpl.java
  6. 4
      service/src/main/java/com/hfkj/service/gas/BsGasOilPriceOfficialService.java
  7. 22
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceOfficialServiceImpl.java
  8. 8
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceTaskServiceImpl.java
  9. 2
      service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.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},",

@ -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}");
}

@ -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);

@ -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<Integer> values) {
addCriterion("oil_price_zone_id in", values, "oilPriceZoneId");
return (Criteria) this;
}
public Criteria andOilPriceZoneIdNotIn(List<Integer> 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<String> values) {
addCriterion("oil_price_zone_name in", values, "oilPriceZoneName");
return (Criteria) this;
}
public Criteria andOilPriceZoneNameNotIn(List<String> 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;

@ -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());

@ -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);
/**
* 查询价格列表

@ -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<BsGasOilPriceOfficial> list = gasOilPriceOfficialMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);

@ -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());

@ -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);
}

Loading…
Cancel
Save