package com.inspect.metadata.mqtt.controller;

import com.inspect.base.core.web.controller.BaseController;
import com.inspect.base.core.web.page.TableDataInfo;
import com.inspect.metadata.mqtt.domain.HrTaskProcess;
import com.inspect.metadata.mqtt.enums.HrTaskStepEnum;
import com.inspect.metadata.mqtt.service.IHrTaskProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/hr/inspection")
public class HrInspectionController extends BaseController {
    @Autowired
    private IHrTaskProcessService iHrTaskProcessService;

    @GetMapping("/list")
    public TableDataInfo list(HrTaskProcess process) {
        startPage();
        process.setResult(2);
        List<HrTaskProcess> list = iHrTaskProcessService.selectTaskProcessList(process);
        for(HrTaskProcess p:list) {
            p.setAdvice(HrTaskStepEnum.getDescription(p.getStepid()));
        }
        return getDataTable(list);
    }
}
