yangys
2024-09-11 f44cf32b7209f48f4b2efe07971bed7a67862be2
过程参数调试完成
已修改4个文件
51 ■■■■ 文件已修改
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/dto/ProcessParameterVO.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/ProcessParameterServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/dto/ProcessParameterVO.java
@@ -103,7 +103,11 @@
    }
    public Long getRealTime() {
        return this.realTime;
        if(this.time != null) {
            return this.time.getTime();
        }else {
            return null;
        }
    }
    public String getCollectItem() {
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.java
@@ -1,15 +1,19 @@
package com.qianwen.smartman.modules.mdc.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.qianwen.smartman.common.constant.FmsConstant;
import com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO;
import com.qianwen.smartman.modules.mdc.dto.TimeDTO;
import com.qianwen.smartman.modules.mdc.entity.LastProcessParam;
import com.qianwen.smartman.modules.mdc.entity.WorkstationCollectData;
//@DS("tdengine")
@DS("iotdb")
@InterceptorIgnore(tenantLine = FmsConstant.AUTOMATIC)
public interface SuperProcessParameterMapper {
    @Deprecated
    List<WorkstationCollectData> queryLastParameter(@Param("workstationId") String workstationId);
@@ -31,6 +35,14 @@
    List<ProcessParameterVO> processParameterListByShift(@Param("times") List<TimeDTO> times, @Param("collectItems") List<String> collectItems, @Param("workstationId") String workstationId);
    /**
     *
     * @param workstationId
     * @param item
     * @param startTime
     * @param endTime
     * @return
     */
    List<ProcessParameterVO> oldOneCollectList(@Param("workstationId") Long workstationId, @Param("item") String item, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
    /**
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/ProcessParameterServiceImpl.java
@@ -180,7 +180,7 @@
        String workstationId = vo.getWorkstationId();
        LocalDate queryTime = vo.getQueryTime();
        Integer shift = vo.getShift();
        Workstation workstation = (Workstation) this.workstationService.getById(Long.valueOf(Func.toLong(workstationId)));
        Workstation workstation = (Workstation) this.workstationService.getById(Func.toLong(workstationId));
        return (ShiftTimeVO) Optional.ofNullable(workstation).map(w -> {
            CalendarShiftTimeSlicesDTO timeSliceShift = TimeSliceCache.getTimeSliceShift(workstation.getCalendarCode(), queryTime, shift);
            return (ShiftTimeVO) Optional.ofNullable(timeSliceShift).map(time -> {
@@ -674,7 +674,13 @@
        return result;
    }
    
    /**
     * 获取工位最新参数值
     * @param workstationId 工位id
     * @param item 参数名称,如DeviceStatus/Output
     * @param time 时间,参数应小于该时间
     * @return
     */
    public ProcessParameterVO getLastParameterLessThanTime(long workstationId,String item,Long time) {
        //yys
        LastProcessParam lp = this.parameterMapper.lastParameterLessThanTime(workstationId,item,time);
@@ -697,6 +703,13 @@
        return vo;
    }
    
    /**
     * 获取工位最新参数值(采集时间应大于指定时间)
     * @param workstationId
     * @param item  参数名称,如DeviceStatus/Output
     * @param time 指定的时间
     * @return
     */
    public ProcessParameterVO getLastParameterGreaterThenTime(long workstationId,String item,Long time) {
        //yys
        LastProcessParam lp = this.parameterMapper.lastParameterGreaterThanTime(workstationId,item,time);
smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.xml
@@ -102,7 +102,7 @@
        </where>
        order by ts asc
    </select>
<!--
    <select id="oldOneCollectList" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
        select ts as realTime,
               n  as collectItem,
@@ -115,7 +115,7 @@
        order by ts
    </select>
      <!--
    <select id="oldFirstStatue" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
        select last(ts) as realTime,
               last(v)  as value_collect
@@ -159,5 +159,15 @@
          and ts &gt; #{endTime}
          and workstation_id = #{workstationId}
    </select>
    <select id="oldOneCollectList" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO">
        select n as collectItem,v  as valueCollect
        from root.f2.process_param_*
        where n = #{item}
          and time &gt;= #{startTime}
          and time &lt;= #{endTime}
          and workstation_id = #{workstationId}
        order by time
        align by device
    </select>
</mapper>