DrawController.java 1.21 KB
package com.huaheng.pc.draw.controller;

import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.draw.domain.Draw;
import com.huaheng.pc.draw.service.IDrawService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *查看图纸控制层
 * @author xcq
 */
@RestController
@RequestMapping("/draw")
@Slf4j
public class DrawController {
    @Resource
    private IDrawService drawService;

    //@RequiresPermissions("srm:srmDetail:selectDraw")
    @GetMapping(value = "/selectDraw")
    @ApiOperation("通过物料编码查询plm图纸")
    public AjaxResult selectDraw(String no){
        try {
            String rid = drawService.getRid();
            Draw draw = drawService.getDrawPartsList(rid, no);
            draw = drawService.getDraw2DList(draw);
            return AjaxResult.success(draw);
        }catch (Exception e){
            return AjaxResult.error(e.getMessage());
        }
    }

}