From f2b44fbe8d4194a5195085b9685be934d251ebc6 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期三, 11 十月 2023 16:54:45 +0800 Subject: [PATCH] 大屏信息接口 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcBigScreenEquipmentDto.java | 39 +++++++++++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java | 7 ++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java | 12 ++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java | 10 +++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java | 42 +++++++++++++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml | 18 ++++++ 6 files changed, 127 insertions(+), 1 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java index b85d532..b0d1347 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcWorkshopInfoController.java @@ -12,6 +12,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto; import org.jeecg.modules.mdc.entity.MdcEquipment; import org.jeecg.modules.mdc.entity.MdcWorkshopEquipment; import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; @@ -27,6 +28,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Arrays; +import java.util.List; /** * @Description: 澶у睆杞﹂棿淇℃伅 @@ -165,6 +167,7 @@ /** * 鑾峰彇璁惧鍒楄〃 + * * @return */ @AutoLog(value = "澶у睆杞﹂棿淇℃伅-鏍规嵁澶у睆杞﹂棿id鏌ヨ璁惧鍒楄〃") @@ -204,7 +207,7 @@ @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-鎵归噺鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯�", notes = "澶у睆杞﹂棿淇℃伅-鎵归噺鍒犻櫎鎸囧畾澶у睆杞﹂棿鍜岃澶囧叧绯�") @DeleteMapping(value = "/deleteWorkshopEquipmentBatch") public Result deleteWorkshopEquipmentBatch(@RequestParam(name = "workshopId") String workshopId, - @RequestParam(name = "equipmentIds", required = true) String equipmentIds) { + @RequestParam(name = "equipmentIds", required = true) String equipmentIds) { try { LambdaQueryWrapper<MdcWorkshopEquipment> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(MdcWorkshopEquipment::getWorkshopId, workshopId).in(MdcWorkshopEquipment::getEquipmentId, Arrays.asList(equipmentIds.split(","))); @@ -245,4 +248,41 @@ } } + /** + * 鏂板澶у睆杞﹂棿涓庤澶囧叧绯� + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-棣栭〉鑾峰彇澶у睆鍏ュ彛鍒楄〃") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-棣栭〉鑾峰彇澶у睆鍏ュ彛鍒楄〃", notes = "澶у睆杞﹂棿淇℃伅-棣栭〉鑾峰彇澶у睆鍏ュ彛鍒楄〃") + @GetMapping(value = "/getWorkshopList") + public Result<List<MdcWorkshopInfo>> getWorkshopList() { + List<MdcWorkshopInfo> list = mdcWorkshopInfoService.list(); + return Result.OK(list); + } + + /** + * 澶у睆 + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-澶у睆淇℃伅") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-澶у睆淇℃伅", notes = "澶у睆杞﹂棿淇℃伅-澶у睆淇℃伅") + @GetMapping(value = "/getBigScreenInfo") + public Result getBigScreenInfo(@RequestParam(name = "workshopId", required = true) String workshopId) { + List<MdcBigScreenEquipmentDto> result = mdcWorkshopInfoService.getBigScreenInfo(workshopId); + return Result.OK(result); + } + + /** + * 澶у睆 + */ + @AutoLog(value = "澶у睆杞﹂棿淇℃伅-淇濆瓨璁惧鍧愭爣澶у皬淇℃伅") + @ApiOperation(value = "澶у睆杞﹂棿淇℃伅-淇濆瓨璁惧鍧愭爣澶у皬淇℃伅", notes = "澶у睆杞﹂棿淇℃伅-淇濆瓨璁惧鍧愭爣澶у皬淇℃伅") + @PutMapping(value = "/saveEquipmentCoordinate") + public Result saveEquipmentCoordinate(@RequestBody List<MdcWorkshopEquipment> workshopEquipmentList) { + try { + mdcWorkshopEquipmentService.updateBatchById(workshopEquipmentList); + return Result.OK("淇濆瓨鎴愬姛锛�"); + } catch (Exception e) { + return Result.error("淇濆瓨澶辫触锛�"); + } + } + } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcBigScreenEquipmentDto.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcBigScreenEquipmentDto.java new file mode 100644 index 0000000..b5bfef0 --- /dev/null +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/dto/MdcBigScreenEquipmentDto.java @@ -0,0 +1,39 @@ +package org.jeecg.modules.mdc.dto; + +import lombok.Data; + +/** + * @author: LiuS + * @create: 2023-10-11 13:47 + */ +@Data +public class MdcBigScreenEquipmentDto { + + private String id; + + private String equipmentId; + + private String equipmentImage; + + private Integer equipmentStatus; + + /** + * 鍧愭爣-宸� + */ + private Integer coordinateLeft; + + /** + * 鍧愭爣-宸� + */ + private Integer coordinateTop; + + /** + * 澶у皬-瀹� + */ + private Integer vw; + + /** + * 澶у皬-楂� + */ + private Integer vh; +} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java index 443366c..ba8cada 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcWorkshopInfoMapper.java @@ -2,7 +2,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto; import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; + +import java.util.List; /** * @Description: 澶у睆杞﹂棿淇℃伅 @@ -12,4 +16,10 @@ */ public interface MdcWorkshopInfoMapper extends BaseMapper<MdcWorkshopInfo> { + /** + * 澶у睆淇℃伅 + * @param workshopId + * @return + */ + List<MdcBigScreenEquipmentDto> getBigScreenInfo(@Param("workshopId") String workshopId); } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml index e5b93ca..5d1b1ab 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml @@ -2,4 +2,22 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.jeecg.modules.mdc.mapper.MdcWorkshopInfoMapper"> + + <select id="getBigScreenInfo" resultType="org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto"> + SELECT + mew.id id, + a.EquipmentID equipmentId, + a.EquipmentName equipmentName, + a.Oporation equipmentStatus, + mew.coordinate_left coordinateLeft, + mew.coordinate_top coordinateTop, + mew.vw vw, + mew.vh vh + FROM + EquipmentLog a + INNER JOIN ( SELECT EquipmentID, MAX ( CollectTime ) 'maxgdtime' FROM EquipmentLog GROUP BY EquipmentID ) b ON a.EquipmentID= b.EquipmentID + INNER JOIN mdc_workshop_equipment mew ON mew.equipment_id = a.EquipmentID + AND a.CollectTime= b.maxgdtime + AND mew.workshop_id = #{ workshopId } + </select> </mapper> \ No newline at end of file diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java index 7692fbb..ce53b6c 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcWorkshopInfoService.java @@ -2,7 +2,10 @@ import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto; import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; + +import java.util.List; /** * @Description: 澶у睆杞﹂棿淇℃伅 @@ -12,4 +15,8 @@ */ public interface IMdcWorkshopInfoService extends IService<MdcWorkshopInfo> { + /** + * 澶у睆淇℃伅 + */ + List<MdcBigScreenEquipmentDto> getBigScreenInfo(String workshopId); } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java index c7327be..c3b18d37 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java @@ -2,10 +2,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto; import org.jeecg.modules.mdc.entity.MdcWorkshopInfo; import org.jeecg.modules.mdc.mapper.MdcWorkshopInfoMapper; import org.jeecg.modules.mdc.service.IMdcWorkshopInfoService; import org.springframework.stereotype.Service; + +import java.util.List; /** * @Description: 澶у睆杞﹂棿淇℃伅 @@ -16,4 +19,13 @@ @Service public class MdcWorkshopInfoServiceImpl extends ServiceImpl<MdcWorkshopInfoMapper, MdcWorkshopInfo> implements IMdcWorkshopInfoService { + /** + * 澶у睆淇℃伅 + * @param workshopId + * @return + */ + @Override + public List<MdcBigScreenEquipmentDto> getBigScreenInfo(String workshopId) { + return this.baseMapper.getBigScreenInfo(workshopId); + } } -- Gitblit v1.9.3