From e8f116054e4260836b13e81b34d9f74afb5be063 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Mon, 8 May 2023 17:26:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=BE=E5=A4=87=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=20=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=205.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/config/shiro/ShiroConfig.java | 1 + jeecg-boot/jeecg-boot-module-system/pom.xml | 4 +- .../LargeScreenController.java | 2 +- .../ProductionLargeScreenController.java | 36 +++++++++++++++ .../service/ProductionLargeService.java | 8 ++++ .../impl/ProductionLargeServiceImpl.java | 46 +++++++++++++++++++ 6 files changed, 94 insertions(+), 3 deletions(-) rename jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/{ => controller}/LargeScreenController.java (98%) create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index 76b381ad..0fdc2539 100644 --- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -128,6 +128,7 @@ public class ShiroConfig { filterChainDefinitionMap.put("/zyShopOrder/shopOrder/**","anon"); //大屏数据 filterChainDefinitionMap.put("/largeScreen/**","anon"); + filterChainDefinitionMap.put("/productionLargeScreen/**","anon"); //人员管理 filterChainDefinitionMap.put("/zyPerson/**","anon"); diff --git a/jeecg-boot/jeecg-boot-module-system/pom.xml b/jeecg-boot/jeecg-boot-module-system/pom.xml index f5d0e640..df6bef7e 100644 --- a/jeecg-boot/jeecg-boot-module-system/pom.xml +++ b/jeecg-boot/jeecg-boot-module-system/pom.xml @@ -135,11 +135,11 @@ 5.2.4.RELEASE - + com.hynnet diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/LargeScreenController.java similarity index 98% rename from jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java rename to jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/LargeScreenController.java index bd9277d1..f077dada 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/LargeScreenController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/LargeScreenController.java @@ -1,4 +1,4 @@ -package org.jeecg.modules.largeScreen; +package org.jeecg.modules.largeScreen.controller; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java new file mode 100644 index 00000000..8e452b39 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/controller/ProductionLargeScreenController.java @@ -0,0 +1,36 @@ +package org.jeecg.modules.largeScreen.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.largeScreen.service.ProductionLargeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@Api(tags = "生产设备大屏数据") +@RequestMapping("/productionLargeScreen") +@RestController +@Slf4j +public class ProductionLargeScreenController { + + @Autowired + private ProductionLargeService productionLargeService; + + /** + * 查询订单的状态 + * + * @return + */ + @ApiOperation(value = "获取生产设备大屏数据", notes = "获取生产设备大屏数据") + @GetMapping("/getData") + public Result getData() { + Map data = productionLargeService.getData(); + return Result.OK(data); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java new file mode 100644 index 00000000..cacff101 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/ProductionLargeService.java @@ -0,0 +1,8 @@ +package org.jeecg.modules.largeScreen.service; + +import java.util.Map; + +public interface ProductionLargeService { + + Map getData(); +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java new file mode 100644 index 00000000..330f8f6d --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java @@ -0,0 +1,46 @@ +package org.jeecg.modules.largeScreen.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import org.jeecg.modules.hanger.entity.HangRecord; +import org.jeecg.modules.hanger.service.IHangRecordService; +import org.jeecg.modules.largeScreen.service.ProductionLargeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.ObjectUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class ProductionLargeServiceImpl implements ProductionLargeService { + + @Autowired + private IHangRecordService iHangRecordService; + + @Override + public Map getData() { + + Map resultMap = new HashMap<>(); + + //1,吊挂 分组统计,获取最新时间5条吊挂运行记录 + List recordList = iHangRecordService.list(new LambdaQueryWrapper().groupBy(HangRecord::getHangCode)); + Map diaoguaData = new HashMap<>(); + if (!ObjectUtils.isEmpty(recordList)) { + recordList.stream().forEach(e -> { + List records = iHangRecordService.list(new LambdaQueryWrapper() + .eq(HangRecord::getHangCode, e.getHangCode()) + .orderByDesc(HangRecord::getCreateTime) + .last("limit 5") + ); + diaoguaData.put(e.getHangCode(), records); + }); + } + resultMap.put("diaogua_Data", diaoguaData); + + + //2,TODO + + return resultMap; + } +}