|
@@ -5,6 +5,8 @@ import org.jeecg.modules.deviceLesm.entity.DeviceRegion;
|
|
|
import org.jeecg.modules.deviceLesm.entity.DeviceRegionInformation;
|
|
|
import org.jeecg.modules.deviceLesm.mapper.DevicePointMapper;
|
|
|
import org.jeecg.modules.deviceLesm.service.IDeviceRegionService;
|
|
|
+import org.jeecg.modules.fpgLeanModel.entity.FpgLeanModel;
|
|
|
+import org.jeecg.modules.fpgLeanModel.service.IFpgLeanModelService;
|
|
|
import org.jeecg.modules.gatherData.entity.FpgMiddleTwoData;
|
|
|
import org.jeecg.modules.gatherData.mapper.FpgGatherDataMapper;
|
|
|
import org.jeecg.modules.homePageData.entity.LeanEventWarnInfoResult;
|
|
@@ -39,9 +41,13 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
|
|
|
@Autowired
|
|
|
private LeanEventWarnInfoMapper leanEventWarnInfoMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IFpgLeanModelService fpgLeanModelService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
- public List<Map<String, String>> regionPfvElectricity() {
|
|
|
+ public List<Map<String, String>> regionPfvElectricity(String modelId) {
|
|
|
+ String leanModelCode = queryLeanModelCodeById(modelId);
|
|
|
Date today = new Date();
|
|
|
String dayDate = new SimpleDateFormat("yyyy-MM-dd").format(today);
|
|
|
List<DeviceRegion> list = deviceRegionService.list();
|
|
@@ -137,9 +143,11 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Map<String, String>> illegalMetering() {
|
|
|
- List<DeviceRegion> list = deviceRegionService.list();
|
|
|
+ public List<Map<String, String>> illegalMetering(String modelId) {
|
|
|
List<Map<String, String>> res = new ArrayList<>();
|
|
|
+ String leanModelCode = queryLeanModelCodeById(modelId);
|
|
|
+
|
|
|
+ List<DeviceRegion> list = deviceRegionService.list();
|
|
|
list.forEach(deviceRegion -> {
|
|
|
Map<String,String> map = new HashMap<>();
|
|
|
map.put("name",deviceRegion.getRegionTitle());
|
|
@@ -151,8 +159,10 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Map<String, String>> rollingControl() {
|
|
|
+ public List<Map<String, String>> rollingControl(String modelId) {
|
|
|
List<Map<String, String>> res = new ArrayList<>();
|
|
|
+ String leanModelCode = queryLeanModelCodeById(modelId);
|
|
|
+
|
|
|
String[] names = {"棒一","棒二","棒三","高线","板带"};
|
|
|
Arrays.asList(names).forEach(name -> {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
@@ -169,7 +179,10 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, List> fpvTimeElectricity() {
|
|
|
+ public Map<String, List> fpvTimeElectricity(String modelId) {
|
|
|
+ Map<String, List> res = new HashMap<>();
|
|
|
+ String leanModelCode = queryLeanModelCodeById(modelId);
|
|
|
+
|
|
|
Date today = new Date();
|
|
|
String dayDate = new SimpleDateFormat("yyyy-MM-dd 00:00:00").format(today);
|
|
|
List<Map<String,String>> tops = new ArrayList<>();
|
|
@@ -192,7 +205,7 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
|
|
|
calendar.set(Calendar.MINUTE, 0);
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
|
- Map<String, List> res = new HashMap<>();
|
|
|
+
|
|
|
for (int i = 0; i < 24; i++) {
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, i);
|
|
|
Double electricity = Math.random()*100+200;
|
|
@@ -279,4 +292,17 @@ public class HomePageDataServiceImpl implements IHomePageDataService {
|
|
|
res.put("value",value);
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据模型ID查询模型编码
|
|
|
+ * @param modelId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String queryLeanModelCodeById(String modelId) {
|
|
|
+ FpgLeanModel fpgLeanModel = fpgLeanModelService.getById(modelId);
|
|
|
+ if (oConvertUtils.isEmpty(fpgLeanModel)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return fpgLeanModel.getLeanModelCode();
|
|
|
+ }
|
|
|
}
|