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; + } +}