package com.shkj.wms.controller.busin;

import com.shkj.common.annotation.Log;
import com.shkj.common.annotation.RepeatSubmit;
import com.shkj.common.core.controller.BaseController;
import com.shkj.common.core.domain.Result;
import com.shkj.common.enums.BusinessType;
import com.shkj.wms.bo.AGVStatesBo;
import com.shkj.wms.bo.AGVTaskBo;
import com.shkj.wms.bo.AGVUploadStatusBo;
import com.shkj.wms.bo.DpsStatesBo;
import com.shkj.wms.third.dps.DpsCallUtil;
import com.shkj.wms.third.rcs.RCSUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RequiredArgsConstructor(onConstructor_ =@Autowired)
@RestController
@RequestMapping("/wcs/plc")
public class DpsController extends BaseController{


  private final DpsCallUtil dpsCallUtil;

  /**
   * AGV放空治具或物料时，握手输送线PLC验证
   */
  @Log(title = "AGV放空治具或物料时，握手PLC验证",businessType = BusinessType.UPDATE)
  @PostMapping("/getPlcStatus")
  @RepeatSubmit
  public Result<DpsStatesBo> getDpsStatus(@Valid @RequestBody AGVTaskBo bo){
    return dpsCallUtil.getDpsStatus(bo);
  }


  /**
   * AGV放空治具或物料时，握手输送线PLC验证
   */
  @Log(title = "AGV放空治具或物料时，握手PLC验证",businessType = BusinessType.UPDATE)
  @PostMapping("/getDpsStatusTemp")
  @RepeatSubmit
  public Result<DpsStatesBo> getDpsStatusTemp(){
    return dpsCallUtil.getDpsStatusTemp();
  }
}
