Commit cb5f0988 authored by chenhao's avatar chenhao

修改装备和车辆的数据刷新的功能

parent 29f1024d
......@@ -251,6 +251,16 @@ public class CarController extends AbstractBaseController {
}
}
@Async
public void refreshCount(List<Car> list) {
list.forEach(i->{
iCarService.refreshStaData();
try {
fireFightingSystemServiceImpl.refreshCarTypeAndCount(i.getBizOrgCode());
} catch (Exception e) {
}
});
}
/**
* 根据iotCode查询
......@@ -310,7 +320,7 @@ public class CarController extends AbstractBaseController {
// carInstance = iCarService.saveCar(getUserInfo(), carInstance, carInfo, carpList);
// saveFile(carInstance);视频图片文件后期统一处理
EquipmentSpecificSerivceImpl.registerMqttTopic(car.getIotCode(), equipmentIotMqttReceiveConfig);
Car car1= iCarService.updateOneById(car);
Car car1= iCarService.updateOneById(car);
refreshCount(car.getBizOrgCode());
return car1;
}
......@@ -1085,8 +1095,13 @@ public class CarController extends AbstractBaseController {
}
}
}
});
return iCarService.removeOneByIds(idList);
boolean flag = iCarService.removeOneByIds(idList);
if(flag) {
refreshCount(cars) ;
}
return flag;
}
/**
......
......@@ -99,7 +99,6 @@ public class EquipmentDetailController extends AbstractBaseController {
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public EquipmentDetail saveEquipmentDetail(HttpServletRequest request, @RequestBody EquipmentDetail equipmentDetail) {
EquipmentDetail detail= iEquipmentDetailService.saveOne(equipmentDetail);
equipmentSpecificSerivce.refreshStaData();
return detail;
}
......@@ -107,7 +106,7 @@ public class EquipmentDetailController extends AbstractBaseController {
public void refreshCount(String bizOrgCode) {
equipmentSpecificSerivce.refreshStaData();
try {
fireFightingSystemServiceImpl.refreshCarTypeAndCount(bizOrgCode);
fireFightingSystemServiceImpl.refreshEquipmentTypeAndCount(bizOrgCode);
} catch (Exception e) {
}
......@@ -156,7 +155,7 @@ public class EquipmentDetailController extends AbstractBaseController {
if (syncSwitch) {
equipmentSpecificSerivce.equipSpecificDataSync(equipmentId);
}
equipmentSpecificSerivce.refreshStaData();
refreshCount(vo.getBizOrgCode());
return date;
}
......@@ -264,7 +263,7 @@ public class EquipmentDetailController extends AbstractBaseController {
if (syncSwitch) {
equipmentSpecificSerivce.equipSpecificDataSync(bean.getEquipmentId());
}
equipmentSpecificSerivce.refreshStaData();
refreshCount(vo.getBizOrgCode());
return equipmentDate;
}
......
......@@ -221,4 +221,8 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @throws Exception
*/
Object getCarTypeAndCount(String bizOrgCode) throws Exception;
public Object refreshEquipmentTypeAndCount(String bizOrgCode) throws Exception;
public Object refreshCarTypeAndCount(String bizOrgCode) throws Exception;
}
......@@ -395,7 +395,7 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
}
equipmentSpecificMapper.insert(equipmentSpecific);
refreshCount(equipmentSpecific.getBizOrgCode());//添加对于装备类型统计数据的刷新
//位置编码不为空入库
if (equipmentDetailDownloadVOS.get(i) != null && equipmentDetailDownloadVOS.get(i).getWarehouseStructCode() != null) {
QueryWrapper<WarehouseStructure> warehouseStructureQueryWrapper = new QueryWrapper<>();
......@@ -467,10 +467,18 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
this.equipmentSpecificIndexSave(equipmentDetail, equipmentSpecific);
}
relationRedisUtil.delSysRedisKey(fireFightSysIdsBuffer.toString());
equipmentSpecificSerivce.refreshStaData();//添加对于装备类型统计数据的刷新
return list;
}
@Async
public void refreshCount(String bizOrgCode) {
equipmentSpecificSerivce.refreshStaData();
try {
fireFightingSystemService.refreshEquipmentTypeAndCount(bizOrgCode);
} catch (Exception e) {
}
}
private void equipmentSpecificIndexSave(EquipmentDetail equipmentDetail, EquipmentSpecific equipmentSpecific) {
List<EquipmentIndex> equipmentIndexList = iEquipmentIndexService.list(new LambdaQueryWrapper<EquipmentIndex>().eq(EquipmentIndex::getEquipmentId, equipmentDetail.getEquipmentId()));
List<EquipmentSpecificIndex> equipmentSpecificIndices = equipmentIndexList.stream().map(index -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment