Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev

2.0-dev
袁野 5 months ago
commit 29993303f2
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighGasController.java
  2. 2
      hai-bweb/src/main/java/com/bweb/controller/HighMerchantStoreController.java
  3. 6
      hai-service/src/main/java/com/hai/service/HighGasOilGunNoService.java
  4. 7
      hai-service/src/main/java/com/hai/service/impl/HighGasOilGunNoServiceImpl.java
  5. 11
      hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java
  6. 13
      hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java

@ -447,7 +447,7 @@ public class HighGasController {
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("type", 1); param.put("type", 1);
param.put("sourceType", 1); param.put("sourceType", "1,3");
param.put("status", 1); param.put("status", 1);
if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) { if (userInfoModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type0.getType())) {

@ -128,7 +128,7 @@ public class HighMerchantStoreController {
if (highMerchantStore.getType().equals(1) && StringUtils.isBlank(highMerchantStore.getStoreLogo())) { if (highMerchantStore.getType().equals(1) && StringUtils.isBlank(highMerchantStore.getStoreLogo())) {
highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getGasDefaultOilStationImg()); highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getGasDefaultOilStationImg());
} }
if (highMerchantStore.getSourceType() == 7) { if (highMerchantStore.getSourceType() != null && highMerchantStore.getSourceType() == 7) {
highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getFileUrl() + highMerchantStore.getStoreLogo()); highMerchantStore.setStoreLogo(CommonSysConst.getSysConfig().getFileUrl() + highMerchantStore.getStoreLogo());
} }
highMerchantStore.setCreateTime(new Date()); highMerchantStore.setCreateTime(new Date());

@ -23,6 +23,12 @@ public interface HighGasOilGunNoService {
*/ */
HighGasOilGunNo getGunNoById(Long id); HighGasOilGunNo getGunNoById(Long id);
/**
* 清除油号
* @param storeId
*/
void cleanGunNo(Long storeId);
/** /**
* 根据门店和抢号查询 * 根据门店和抢号查询
* @param storeId * @param storeId

@ -34,6 +34,13 @@ public class HighGasOilGunNoServiceImpl implements HighGasOilGunNoService {
return gasOilGunNoMapper.selectByPrimaryKey(id); return gasOilGunNoMapper.selectByPrimaryKey(id);
} }
@Override
public void cleanGunNo(Long storeId) {
HighGasOilGunNoExample example = new HighGasOilGunNoExample();
example.createCriteria().andStoreIdEqualTo(storeId);
gasOilGunNoMapper.deleteByExample(example);
}
@Override @Override
public HighGasOilGunNo getDetailByStoreAndGunNo(Long storeId, String gunNo) { public HighGasOilGunNo getDetailByStoreAndGunNo(Long storeId, String gunNo) {
HighGasOilGunNoExample example = new HighGasOilGunNoExample(); HighGasOilGunNoExample example = new HighGasOilGunNoExample();

@ -98,6 +98,8 @@ public class HighGasServiceImpl implements HighGasService {
store.setUpdateTime(new Date()); store.setUpdateTime(new Date());
highMerchantStoreService.updateMerchantStoreDetail(store); highMerchantStoreService.updateMerchantStoreDetail(store);
gasOilGunNoService.cleanGunNo(store.getId());
JSONArray oilPriceList = station.getJSONArray("oilPriceList"); JSONArray oilPriceList = station.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) { for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
@ -112,7 +114,7 @@ public class HighGasServiceImpl implements HighGasService {
highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")); highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")); highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount")); highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount"));
highGasOilPrice.setPreferentialMargin(new BigDecimal("0"));
// 油品类型 1:汽油:2:柴油;3:天然气 // 油品类型 1:汽油:2:柴油;3:天然气
if (oilPriceObject.getString("goodsGroupType").equals("GASOLINE")) { if (oilPriceObject.getString("goodsGroupType").equals("GASOLINE")) {
highGasOilPrice.setOilType(1); highGasOilPrice.setOilType(1);
@ -144,11 +146,12 @@ public class HighGasServiceImpl implements HighGasService {
} }
} else { } else {
highGasOilPrice.setPreferentialMargin(highGasOilPrice.getPreferentialMargin()!=null?highGasOilPrice.getPreferentialMargin():new BigDecimal("0"));
highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getString("goodsCode")); highGasOilPrice.setOilNo(oilPriceObject.getString("goodsCode"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("goodsCode") + "#"); highGasOilPrice.setOilNoName(oilPriceObject.getString("goodsCode") + "#");
highGasOilPrice.setGasStationDrop(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount").subtract(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"))); highGasOilPrice.setGasStationDrop(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount").subtract(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")));
highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")); highGasOilPrice.setPriceVip(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount").subtract(highGasOilPrice.getPreferentialMargin()));
highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount")); highGasOilPrice.setPriceGun(oilPriceObject.getJSONObject("goodsPrice").getBigDecimal("amount"));
highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount")); highGasOilPrice.setPriceOfficial(oilPriceObject.getJSONObject("listedPrice").getBigDecimal("amount"));
@ -297,6 +300,8 @@ public class HighGasServiceImpl implements HighGasService {
store.setUpdateTime(new Date()); store.setUpdateTime(new Date());
highMerchantStoreService.updateMerchantStoreDetail(store); highMerchantStoreService.updateMerchantStoreDetail(store);
gasOilGunNoService.cleanGunNo(store.getId());
JSONArray oilPriceList = station.getJSONArray("oilPriceList"); JSONArray oilPriceList = station.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) { for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
@ -657,6 +662,8 @@ public class HighGasServiceImpl implements HighGasService {
store.setUpdateTime(new Date()); store.setUpdateTime(new Date());
highMerchantStoreService.updateMerchantStoreDetail(store); highMerchantStoreService.updateMerchantStoreDetail(store);
gasOilGunNoService.cleanGunNo(store.getId());
JSONArray oilPriceList = station.getJSONArray("oils"); JSONArray oilPriceList = station.getJSONArray("oils");
for (Object oilPrice : oilPriceList) { for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));

@ -26,11 +26,9 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Comparator; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.IntStream;
@Service("highMerchantStoreService") @Service("highMerchantStoreService")
@ -207,8 +205,11 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService {
criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); criteria.andTypeEqualTo(MapUtils.getInteger(map, "type"));
} }
if (MapUtils.getInteger(map, "sourceType") != null) { if (StringUtils.isNotBlank(MapUtils.getString(map, "sourceType"))) {
criteria.andSourceTypeEqualTo(MapUtils.getInteger(map, "sourceType")); List<Integer> sourceType = Arrays.stream(MapUtils.getString(map, "sourceType").split(","))
.flatMapToInt(num -> IntStream.of(Integer.parseInt(num))).boxed()
.collect(Collectors.toList());
criteria.andSourceTypeIn(sourceType);
} }
if (MapUtils.getLong(map, "companyId") != null) { if (MapUtils.getLong(map, "companyId") != null) {

Loading…
Cancel
Save