ansteel-api/src/main/java/com/iailab/module/sms/api/AnSteelApi.java
对比新文件 @@ -0,0 +1,27 @@ package com.iailab.module.model.api.mcs; import com.iailab.module.sms.api.dto.PowerRunStateDTO; import com.iailab.module.sms.enums.ApiConstants; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import java.util.List; /** * @author lirm * @Description * @createTime 2025年03月17日 */ @FeignClient(name = ApiConstants.NAME) @Tag(name = "RPC 服务 - 信息接口") public interface AnSteelApi { String PREFIX = ApiConstants.PREFIX + "/mcs"; @GetMapping(PREFIX + "/power-run-state/list") @Operation(summary = "发电厂机组运行情况") List<PowerRunStateDTO> getPowerRunState(); } ansteel-api/src/main/java/com/iailab/module/sms/api/dto/PowerRunStateDTO.java
对比新文件 @@ -0,0 +1,26 @@ package com.iailab.module.sms.api.dto; import lombok.Data; import java.io.Serializable; /** * @author lirm * @date 2025年03月13日 */ @Data public class PowerRunStateDTO implements Serializable { private static final long serialVersionUID = 1L; private String id; private String machineName; private String qhRate; private String fhRate; private String gasTotal; private String gasCost; private String gasSurplus; private String bfg; private String ldg; private String cog; } ansteel-api/src/main/java/com/iailab/module/sms/enums/ApiConstants.java
对比新文件 @@ -0,0 +1,21 @@ package com.iailab.module.sms.enums; import com.iailab.framework.common.enums.RpcConstants; /** * @author PanZhibao * @Description * @createTime 2024年08月26日 */ public class ApiConstants { /** * 服务名 * * 注意,需要保证和 spring.application.name 保持一致 */ public static final String NAME = "model-server"; public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/model"; public static final String VERSION = "1.0.0"; } ansteel-biz/pom.xml
@@ -19,11 +19,11 @@ <dependencies> <!-- 依赖服务 --> <!-- <dependency>--> <!-- <groupId>com.iailab</groupId>--> <!-- <artifactId>ansteel-api</artifactId>--> <!-- <version>${revision}</version>--> <!-- </dependency>--> <dependency> <groupId>com.iailab</groupId> <artifactId>ansteel-api</artifactId> <version>${revision}</version> </dependency> <dependency> <groupId>com.iailab</groupId> <artifactId>iailab-module-infra-api</artifactId> @@ -125,6 +125,12 @@ <groupId>com.iailab</groupId> <artifactId>iailab-common-mq</artifactId> </dependency> <dependency> <groupId>com.iailab</groupId> <artifactId>ansteel-api</artifactId> <version>1.0.0</version> <scope>compile</scope> </dependency> </dependencies> ansteel-biz/src/main/java/com/iailab/module/ansteel/api/McsServiceImpl.java
文件名从 ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/service/impl/PowerRunStateServiceImpl.java 修改 @@ -1,12 +1,11 @@ package com.iailab.module.ansteel.mpk.service.impl; package com.iailab.module.ansteel.api; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.ConvertUtils; import com.iailab.module.ansteel.mpk.dao.PowerRunStateDao; import com.iailab.module.ansteel.mpk.entity.PowerRunStateEntity; import com.iailab.module.ansteel.mpk.service.PowerRunStateService; import com.iailab.module.ansteel.api.dao.PowerRunStateDao; import com.iailab.module.data.api.point.DataPointApi; import com.iailab.module.model.api.mcs.AnSteelApi; import com.iailab.module.sms.api.dto.PowerRunStateDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -21,14 +20,17 @@ @Slf4j @Service public class PowerRunStateServiceImpl extends BaseServiceImpl<PowerRunStateDao, PowerRunStateEntity> implements PowerRunStateService { public class McsServiceImpl implements AnSteelApi { @Autowired private DataPointApi dataPointApi; @Autowired private PowerRunStateDao powerRunStateDao; @Override public List<PowerRunStateEntity> list() { List<PowerRunStateEntity> list = baseDao.selectList(new QueryWrapper<>()); public List<PowerRunStateDTO> getPowerRunState() { List<PowerRunStateDTO> list = ConvertUtils.sourceToTarget(powerRunStateDao.selectList(new QueryWrapper<>()), PowerRunStateDTO.class); if (!CollectionUtils.isEmpty(list)) { list.stream().map(item -> { StringBuffer sb = new StringBuffer(); ansteel-biz/src/main/java/com/iailab/module/ansteel/api/controller/McsController.java
对比新文件 @@ -0,0 +1,36 @@ package com.iailab.module.ansteel.api.controller; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.module.model.api.mcs.AnSteelApi; import com.iailab.module.sms.api.dto.PowerRunStateDTO; import io.swagger.v3.oas.annotations.tags.Tag; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.Map; import static com.iailab.framework.common.pojo.CommonResult.success; /** * @author: lirm * @date: 2025/03/17 **/ @Tag(name = "发电厂机组运行情况") @RestController @RequestMapping("/mcs/power-run-state") public class McsController { @Autowired private AnSteelApi anSteelApi; @GetMapping("list") public CommonResult<List<PowerRunStateDTO>> list(@RequestParam Map<String, Object> params) { List<PowerRunStateDTO> list = anSteelApi.getPowerRunState(); return success(list); } } ansteel-biz/src/main/java/com/iailab/module/ansteel/api/dao/PowerRunStateDao.java
文件名从 ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/dao/PowerRunStateDao.java 修改 @@ -1,8 +1,8 @@ package com.iailab.module.ansteel.mpk.dao; package com.iailab.module.ansteel.api.dao; import com.iailab.framework.common.dao.BaseDao; import com.iailab.framework.tenant.core.db.dynamic.TenantDS; import com.iailab.module.ansteel.mpk.entity.PowerRunStateEntity; import com.iailab.module.ansteel.api.entity.PowerRunStateEntity; import org.apache.ibatis.annotations.Mapper; @TenantDS ansteel-biz/src/main/java/com/iailab/module/ansteel/api/entity/PowerRunStateEntity.java
文件名从 ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/entity/PowerRunStateEntity.java 修改 @@ -1,4 +1,4 @@ package com.iailab.module.ansteel.mpk.entity; package com.iailab.module.ansteel.api.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; ansteel-biz/src/main/java/com/iailab/module/ansteel/api/entity/ProductProcessEntity.java
文件名从 ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/entity/ProductProcessEntity.java 修改 @@ -1,4 +1,4 @@ package com.iailab.module.ansteel.mpk.entity; package com.iailab.module.ansteel.api.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/controller/PowerRunStateController.java
文件已删除 ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/dao/ProductProcessDao.java
文件已删除 ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/service/PowerRunStateService.java
文件已删除 ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/service/ProductProcessService.java
文件已删除 ansteel-biz/src/main/java/com/iailab/module/ansteel/mpk/service/impl/ProductProcessServiceImpl.java
文件已删除