jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/DryFaultRecordController.java
@@ -1,9 +1,11 @@ package org.jeecg.modules.dry.controller; import java.util.Arrays; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jeecg.common.api.vo.Result; import org.jeecg.common.config.TenantContext; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.dry.entity.DryFaultRecord; @@ -61,6 +63,21 @@ IPage<DryFaultRecord> pageList = dryEqpFaultService.page(page, queryWrapper); return Result.OK(pageList); } @RequestMapping(value = "/queryByOrderId", method = RequestMethod.GET) public Result<List<DryFaultRecord>> queryByOrderId(@RequestParam(name="orderId",required=true) String orderId, @RequestParam(name="tenantId",required=true) String tenantId) { TenantContext.setTenant(tenantId); Result<List<DryFaultRecord>> result = new Result<List<DryFaultRecord>>(); try { List<DryFaultRecord> pageList = dryEqpFaultService.queryByOrderId(orderId); result.setResult(pageList); result.setSuccess(true); } catch (Exception e) { log.error(e.getMessage(),e); } return result; } /** * 添加 jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/DryOpcDeviceController.java
@@ -30,6 +30,7 @@ import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecg.common.system.base.controller.JeecgController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; @@ -50,6 +51,7 @@ @RestController @RequestMapping("/dry/dryOpcDevice") @Slf4j @ConditionalOnProperty(name = "kangaroohy.milo.enabled", havingValue = "true") public class DryOpcDeviceController extends JeecgController<DryOpcDevice, IDryOpcDeviceService> { @Autowired private IDryOpcDeviceService dryOpcDeviceService; jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/OpcController.java
@@ -15,6 +15,7 @@ import org.jeecg.modules.dry.service.IDryOpcDeviceService; import org.jeecg.modules.dry.vo.CommandMessageVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -31,6 +32,7 @@ @RestController @RequestMapping("/dry/opc") @Slf4j @ConditionalOnProperty(name = "kangaroohy.milo.enabled", havingValue = "true") public class OpcController { @Autowired jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/runner/OpcCustomRunner.java
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; import java.util.ArrayList; @@ -17,6 +18,7 @@ @Component @Slf4j @ConditionalOnProperty(name = "kangaroohy.milo.enabled", havingValue = "true") public class OpcCustomRunner implements ApplicationRunner { @Autowired private MiloService miloService; jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/service/IDryFaultRecordService.java
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.dry.entity.DryFaultRecord; import java.util.List; /** * @Description: dry_eqp_fault * @Author: jeecg-boot @@ -12,4 +14,5 @@ */ public interface IDryFaultRecordService extends IService<DryFaultRecord> { List<DryFaultRecord> queryByOrderId(String orderId); } jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/service/impl/DryFaultRecordServiceImpl.java
@@ -1,11 +1,14 @@ package org.jeecg.modules.dry.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.modules.dry.entity.DryFaultRecord; import org.jeecg.modules.dry.mapper.DryFaultRecordMapper; import org.jeecg.modules.dry.service.IDryFaultRecordService; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import java.util.List; /** * @Description: dry_eqp_fault @@ -16,4 +19,10 @@ @Service public class DryFaultRecordServiceImpl extends ServiceImpl<DryFaultRecordMapper, DryFaultRecord> implements IDryFaultRecordService { @Override public List<DryFaultRecord> queryByOrderId(String orderId) { LambdaQueryWrapper<DryFaultRecord> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(DryFaultRecord::getOrderId, orderId); return baseMapper.selectList(queryWrapper); } }