干燥机配套车间生产管理系统/云平台服务端
zhuguifei
2024-11-27 86f19c30b243337f1400244f3a0426c13e54a475
Merge branch 'herb' of https://gitee.com/baoshwi/herb into herb
已修改9个文件
92 ■■■■ 文件已修改
jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusSaasConfig.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/DryEquipmentController.java 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/DryFaultRecordController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/DryOpcDeviceController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/DryRealTimeDataController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/OpcController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/runner/OpcCustomRunner.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/service/IDryFaultRecordService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/service/impl/DryFaultRecordServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusSaasConfig.java
@@ -75,6 +75,10 @@
        TENANT_TABLE.add("dry_herb_type");
        TENANT_TABLE.add("dry_order");
        TENANT_TABLE.add("dry_shop");
        TENANT_TABLE.add("dry_herb_formula");
        TENANT_TABLE.add("dry_herb_formula_his");
        TENANT_TABLE.add("dry_fault_record");
    }
jeecg-module-dry/jeecg-module-dry-biz/src/main/java/org/jeecg/modules/dry/controller/DryEquipmentController.java
@@ -36,6 +36,7 @@
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -106,21 +107,39 @@
        //------------------------------------------------------------------------------------------------
        QueryWrapper<DryEquipment> queryWrapper = QueryGenerator.initQueryWrapper(dryEquipment, req.getParameterMap());
        queryWrapper.orderByAsc("code");
        List<DryEquipment> eqps = dryEquipmentService.list(queryWrapper);
        List<DryEquipmentVo> equipmentVos = new ArrayList<>();
        eqps.stream().forEach(item -> {
            DryEquipmentVo dryEquipmentVo = BeanUtil.toBean(item, DryEquipmentVo.class);
            DryEqpType dryEqpType = dryEqpTypeService.getById(item.getType());
            dryEquipmentVo.setType(dryEqpType.getName());
            dryEquipmentVo.setDryEfficiency(dryEqpType.getDryEfficiency());
            dryEquipmentVo.setSteamConsumption(dryEqpType.getSteamConsumption());
            dryEquipmentVo.setPowerConsumption(dryEqpType.getPowerConsumption());
            equipmentVos.add(dryEquipmentVo);
        });
        return Result.OK(equipmentVos);
         List<DryEquipmentVo> equipmentVos = getDryEquipmentVos(queryWrapper);
         return Result.OK(equipmentVos);
    }
     @NotNull
     private List<DryEquipmentVo> getDryEquipmentVos(QueryWrapper<DryEquipment> queryWrapper) {
         queryWrapper.orderByAsc("code");
         List<DryEquipment> eqps = dryEquipmentService.list(queryWrapper);
         List<DryEquipmentVo> equipmentVos = new ArrayList<>();
         eqps.stream().forEach(item -> {
             DryEquipmentVo dryEquipmentVo = BeanUtil.toBean(item, DryEquipmentVo.class);
             DryEqpType dryEqpType = dryEqpTypeService.getById(item.getType());
             dryEquipmentVo.setType(dryEqpType.getName());
             dryEquipmentVo.setDryEfficiency(dryEqpType.getDryEfficiency());
             dryEquipmentVo.setSteamConsumption(dryEqpType.getSteamConsumption());
             dryEquipmentVo.setPowerConsumption(dryEqpType.getPowerConsumption());
             equipmentVos.add(dryEquipmentVo);
         });
         return equipmentVos;
     }
     @ApiOperation(value="查询租户所有干燥机", notes="查询租户所有干燥机")
     @GetMapping(value = "/listTenantEqp")
     public Result<List<DryEquipmentVo>> queryTenantAllEquipment(DryEquipment dryEquipment, HttpServletRequest req) {
        TenantContext.setTenant(dryEquipment.getTenantId()+"");
         QueryWrapper<DryEquipment> queryWrapper = QueryGenerator.initQueryWrapper(dryEquipment, req.getParameterMap());
         List<DryEquipmentVo> equipmentVos = getDryEquipmentVos(queryWrapper);
         return Result.OK(equipmentVos);
     }
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/DryRealTimeDataController.java
@@ -178,6 +178,14 @@
//            return Result.error("AI识别服务异常");
//        }
//    }
    /**
     * 根据设备和租户查询该设备类型的干燥配方,将配方转成xml格式,以字符串方式返回
     * @param tenantId
     * @param eqpCode
     * @return
     * @throws JAXBException
     */
    @ApiOperation(value="干燥配方获取", notes="干燥配方下发")
    @GetMapping(value = "/queryFormula")
    public Result<String> queryFormulaByEqpType(Integer tenantId, String eqpCode) throws JAXBException {
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);
    }
}