Fancy
2024-07-04 ddd56a8f37eb47d933a7064be9341feb8dbd8165
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
@@ -2,13 +2,17 @@
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pmsGlobal.pojoPlt.PltProductFile;
import com.dy.pmsGlobal.pojoPlt.PltProductParams;
import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems;
import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems;
import com.dy.pmsGlobal.pojoPr.PrProductionNode;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 *记录组装各步骤
@@ -44,4 +48,62 @@
            return BaseResponseUtils.buildSuccess(true);
        }
    }
    /**
     * 根据节点的查出节点作业指导书
     * @param
     * @return
     */
    @GetMapping(path="getSopByNodeId")
    public BaseResponse<PrProductionNode> getSopByNodeId(String nodeId){
        PrProductionNode result = sv.getSopByNodeId(nodeId);
        return BaseResponseUtils.buildSuccess(result);
    }
    /**
     * 根据产品查出 主要技术参数
     * @param
     * @return
     */
    @GetMapping(path="getParamsByProId")
    public BaseResponse<List<PltProductParams>> getParamsByProId(String proId){
        List<PltProductParams> result = sv.getParamsByProId(proId);
        return BaseResponseUtils.buildSuccess(result);
    }
    /**
     * 根据产品查出产品文件 主要技术参数
     * @param
     * @return
     */
    @GetMapping(path="getFileByProId")
    public BaseResponse<List<PltProductFile>> getFileByProId(String proId){
        List<PltProductFile> result = sv.getFileByProId(proId);
        return BaseResponseUtils.buildSuccess(result);
    }
    @GetMapping(path = "getQualityItems")
    public BaseResponse<List<PltProductQualityInspectionItems>> getQualityItems(String proId) {
        log.info("AssemblyStepCtrl.getQualityItems()");
        List<PltProductQualityInspectionItems> result = sv.getQualityItems(proId);
        return BaseResponseUtils.buildSuccess(result);
    }
    @GetMapping(path = "getTestItems")
    public BaseResponse<List<PltProductTestInspectionItems>> getTestItems(String proId) {
        log.info("AssemblyStepCtrl.getTestItems()");
        List<PltProductTestInspectionItems> result = sv.getTestItems(proId);
        return BaseResponseUtils.buildSuccess(result);
    }
    /**
     * 测试或品检都调用这个接口
     * @param vo
     * @return
     */
    @PostMapping(path = "testing")
    public BaseResponse testing(@RequestBody @Valid QueryVo vo) {
        log.info("AssemblyStepCtrl.testing()");
        int count = sv.testing(vo);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
}