修复删除油价未删除日期油价数据问题

master
胡锐 4 months ago
parent 4e4deb398e
commit bd870a5fd4
  1. 2
      bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java
  2. 19
      cweb/src/main/java/com/cweb/controller/BsGasController.java
  3. 7
      service/src/main/java/com/hfkj/service/gas/BsGasOilPriceWeekService.java
  4. 9
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceServiceImpl.java
  5. 7
      service/src/main/java/com/hfkj/service/gas/impl/BsGasOilPriceWeekServiceImpl.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);

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

@ -25,6 +25,13 @@ public interface BsGasOilPriceWeekService {
*/
void updatePrice(BsGasOilPriceWeek priceWeek);
/**
* 删除价格
* @param merNo
* @param oilNo
*/
void deletePrice(String merNo,String oilNo);
/**
* 修改价格
* @param week 周期

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

@ -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) {
// 更新价格

Loading…
Cancel
Save