zhangherong
2025-06-25 23855599412c4d61b38d78f0f3abd3430a48b5b1
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/controller/ProcessSpecVersionController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package org.jeecg.modules.dnc.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.dnc.entity.ProcessSpecVersion;
import org.jeecg.modules.dnc.response.CommonCode;
import org.jeecg.modules.dnc.response.ResponseResult;
import org.jeecg.modules.dnc.service.IProcessSpecVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Slf4j
@Api(tags = "工艺规程版本")
@RestController
@RequestMapping("/nc/processSpecVersion")
public class ProcessSpecVersionController extends JeecgController<ProcessSpecVersion, IProcessSpecVersionService> {
    @Autowired
    private IProcessSpecVersionService processSpecVersionService;
    /**
     * æ ¹æ®å·¥è‰ºè§„程id查询,下级工序工步数量
     * @param processSpecId
     * @return
     */
    @AutoLog(value = "工艺规程版本表-根据工艺规程id查询,下级工序工步数量")
    @ApiOperation(value = "工艺规程版本表-根据工艺规程id查询,下级工序工步数量", notes = "工艺规程版本表-根据工艺规程id查询,下级工序工步数量")
    @GetMapping("/getWorkStepCountByProcessSpecId/{processSpecId}")
    public Result<?> getWorkStepCountByProcessSpecId(@PathVariable("processSpecId") String processSpecId) {
        return processSpecVersionService.getProcessSpecVersionCount(processSpecId);
    }
    @AutoLog(value = "工艺规程版本表-新增工艺规程版本信息")
    @ApiOperation(value = "工艺规程版本表-新增工艺规程版本信息", notes = "工艺规程版本表-新增工艺规程版本信息")
    @PostMapping("/add")
    public ResponseResult addWorkStep(@RequestBody ProcessSpecVersion processSpecVersion) {
        boolean b = processSpecVersionService.addProcessSpecVersion(processSpecVersion);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
    @AutoLog(value = "工艺规程版本表-编辑工艺规程版本信息")
    @ApiOperation(value = "工艺规程版本表-编辑工艺规程版本信息", notes = "工艺规程版本表-编辑工艺规程版本信息")
    @PutMapping("/edit/{id}")
    public ResponseResult editWorkStep(@PathVariable("id") String id, @RequestBody ProcessSpecVersion processSpecVersion) {
        boolean b = processSpecVersionService.editProcessSpecVersion(id, processSpecVersion);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
    @AutoLog(value = "工艺规程版本表-删除工艺规程版本信息")
    @ApiOperation(value = "工艺规程版本表-删除工艺规程版本信息", notes = "工艺规程版本表-删除工艺规程版本信息")
    @DeleteMapping("/delete/{id}")
    public ResponseResult deleteWorkStep(@PathVariable("id") String id) {
        boolean b = processSpecVersionService.deleteProcessSpecVersion(id);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
}