package com.sw.mes.yb.pad.controller;

import com.alibaba.fastjson.JSONObject;
import com.sw.mes.base.workinprocess.dto.PdaProcessLogDto;
import com.sw.mes.base.workinprocess.service.ProcessLogService;
import com.sw.mes.core.response.Result;
import com.sw.mes.core.response.ResultGenerator;
import com.sw.mes.redis.server.RedisUtils;
import com.sw.mes.yb.accessory.entity.EquipmentDeviceStatus;
import com.sw.mes.yb.accessory.service.EquipmentDeviceStatusService;
import com.sw.mes.yb.deviceCheck.dto.DeviceCheckPadDto;
import com.sw.mes.yb.deviceCheck.entity.DeviceCheck;
import com.sw.mes.yb.deviceCheck.entity.DeviceCleanRecord;
import com.sw.mes.yb.deviceCheck.entity.SpotCheckItem;
import com.sw.mes.yb.deviceCheck.service.DeviceCheckService;
import com.sw.mes.yb.deviceCheck.service.DeviceCleanRecordService;
import com.sw.mes.yb.deviceCheck.service.SpotCheckItemService;
import com.sw.mes.yb.pad.service.PdaProcessService;
import com.sw.mes.yb.pc.service.StoreMixInfoService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

import java.util.*;
import java.util.concurrent.TimeUnit;

/**
 * @author liuzemin
 * @date 2022/5/18 15:30
 * @description
 */
@RestController
@RequestMapping("/padProcess")
@Slf4j
@Api(description = "PDA追溯")
public class PadProcessController {


    @Autowired
    private PdaProcessService pdaProcessService;


    @ApiOperation(value = "pda通过编码获取过站履历详细信息")
    @GetMapping("/pdaFindProcessLogByCode")
    public Result<PdaProcessLogDto> get(@ApiParam(value = "工单单号code") String code) {

        PdaProcessLogDto dto = new PdaProcessLogDto();
        try {
            dto = pdaProcessService.findByProcessingOrderCode(code);
        } catch (Exception e) {
            e.printStackTrace();
            ResultGenerator.fail(e.getMessage());
        }

        return ResultGenerator.success(dto);
    }




}
