diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java index 47b1b17..c663834 100644 --- a/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java +++ b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java @@ -116,7 +116,7 @@ public class BsGasOilPriceController { oilPrice.setPreferentialMargin(new BigDecimal("0")); oilPrice.setPriceOfficial(priceOfficial.getPriceOfficial()); oilPrice.setGasStationDrop(new BigDecimal("0")); - oilPrice.setPriceGun(oilPrice.getPriceOfficial().subtract(body.getGasStationDrop())); + oilPrice.setPriceGun(oilPrice.getPriceOfficial().subtract(oilPrice.getGasStationDrop())); oilPrice.setPriceVip(oilPrice.getPriceGun()); oilPrice.setStatus(GasOilPriceStatusEnum.status1.getNumber()); gasOilPriceService.editOilPrice(oilPrice); diff --git a/cweb/src/main/java/com/cweb/controller/BsGasController.java b/cweb/src/main/java/com/cweb/controller/BsGasController.java index b00c0f6..652154d 100644 --- a/cweb/src/main/java/com/cweb/controller/BsGasController.java +++ b/cweb/src/main/java/com/cweb/controller/BsGasController.java @@ -12,10 +12,12 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsAgentPrice; +import com.hfkj.entity.BsDevice; import com.hfkj.entity.BsGasOilPrice; import com.hfkj.model.GasListModel; import com.hfkj.model.GasModel; import com.hfkj.model.ResponseData; +import com.hfkj.service.BsDeviceService; import com.hfkj.service.agent.BsAgentPriceService; import com.hfkj.service.gas.BsGasOilPriceWeekService; import com.hfkj.service.gas.BsGasService; @@ -46,23 +48,6 @@ public class BsGasController { private NewLinkGasService newLinkGasService; @Resource private CqShellPetroleumGasService cqShellPetroleumGasService; - @Resource - private BsGasOilPriceWeekService gasOilPriceWeekService; - @RequestMapping(value="/updatePriceWeek",method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "updatePriceWeek") - public ResponseData updatePriceWeek(@RequestParam(name = "week", required = true) Integer week) { - try { - - // 更新价格 - gasOilPriceWeekService.updatePriceWeek(week); - - return ResponseMsgUtil.success("操作成功"); - - } catch (Exception e) { - return ResponseMsgUtil.exception(e); - } - } @RequestMapping(value="/refresh",method = RequestMethod.GET) @ResponseBody diff --git a/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceWeekService.java b/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceWeekService.java index a8096fa..061b0c3 100644 --- a/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceWeekService.java +++ b/service/src/main/java/com/hfkj/service/gas/BsGasOilPriceWeekService.java @@ -25,6 +25,13 @@ public interface BsGasOilPriceWeekService { */ void updatePrice(BsGasOilPriceWeek priceWeek); + /** + * 删除价格 + * @param merNo + * @param oilNo + */ + void deletePrice(String merNo,String oilNo); + /** * 修改价格 * @param week 周期 diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java index 9cc430b..dd91cf7 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java @@ -4,9 +4,12 @@ import com.hfkj.common.utils.RedisUtil; import com.hfkj.dao.BsGasOilPriceMapper; import com.hfkj.entity.BsGasOilPrice; import com.hfkj.entity.BsGasOilPriceExample; +import com.hfkj.entity.BsGasOilPriceWeek; import com.hfkj.service.gas.BsGasOilGunNoService; import com.hfkj.service.gas.BsGasOilPriceService; +import com.hfkj.service.gas.BsGasOilPriceWeekService; import com.hfkj.service.gas.BsGasService; +import com.hfkj.sysenum.gas.GasOilNoEnum; import com.hfkj.sysenum.gas.GasOilPriceStatusEnum; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -33,7 +36,8 @@ public class BsGasOilPriceServiceImpl implements BsGasOilPriceService { private BsGasOilGunNoService gasOilGunNoService; @Resource private BsGasService gasService; - + @Resource + private BsGasOilPriceWeekService gasOilPriceWeekService; @Override public void editData(BsGasOilPrice data) { if (data.getId() == null) { @@ -67,6 +71,9 @@ public class BsGasOilPriceServiceImpl implements BsGasOilPriceService { data.setStatus(GasOilPriceStatusEnum.status0.getNumber()); editOilPrice(data); + // 删除油价日期任务 + gasOilPriceWeekService.deletePrice(data.getMerNo(), data.getOilNo()); + // 删除抢号 gasOilGunNoService.delete(data.getMerNo(), data.getOilNo()); } diff --git a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceWeekServiceImpl.java b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceWeekServiceImpl.java index 545d3a1..7126e40 100644 --- a/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceWeekServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceWeekServiceImpl.java @@ -79,6 +79,13 @@ public class BsGasOilPriceWeekServiceImpl implements BsGasOilPriceWeekService { } } + @Override + public void deletePrice(String merNo, String oilNo) { + BsGasOilPriceWeekExample example = new BsGasOilPriceWeekExample(); + example.createCriteria().andMerNoEqualTo(merNo).andOilNoEqualTo(oilNo); + gasOilPriceWeekMapper.deleteByExample(example); + } + @Override public void updatePriceWeek(Integer week) { // 更新价格