package com.yuanchu.mom.controller;
|
|
|
import com.yuanchu.mom.pojo.dto.MbomModelDto;
|
import com.yuanchu.mom.utils.JackSonUtil;
|
import com.yuanchu.mom.vo.Result;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
import com.yuanchu.mom.service.MbomModelService;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.Arrays;
|
import java.util.List;
|
import java.util.Map;
|
|
|
/**
|
* 物料清单维护表(MbomModel)表控制层
|
*
|
* @author zss
|
* @since 2023-08-30 09:17:26
|
*/
|
@Api(tags = "基础数据-->物料清单维护")
|
@RestController
|
@RequestMapping("/mbomModel")
|
public class MbomModelController {
|
|
@Autowired
|
private MbomModelService mbomModelService;
|
|
/*查询物料清单维护列表-->左边二级展示工序和工艺*/
|
//使用技术指标维护的接口
|
|
@ApiOperation(value = "查询物料清单维护列表-->右边展示该工艺所需要的原材料")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true)
|
})
|
@GetMapping("/selectAllMbom")
|
public Result selectAllMbom(Integer id) {
|
return Result.success(mbomModelService.selectAllMbom(id));
|
}
|
|
/*新增物料清单维护-->选择工序和工艺*/
|
//使用技术指标维护的接口
|
|
@ApiOperation(value = "新增物料清单维护")
|
@PostMapping("/addMbom")
|
public Result addMbom(@Validated @RequestBody MbomModelDto mbomModelDto) {
|
mbomModelService.addMbom(mbomModelDto);
|
return Result.success("新增成功!");
|
}
|
|
@ApiOperation(value = "删除")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "id", value = "物料清单id", dataTypeClass = Integer.class, required = true)
|
})
|
@PostMapping("/delMbomById")
|
public Result delMbomById(Integer id) {
|
mbomModelService.delMbomById(id);
|
return Result.success("删除" + id + "成功!");
|
}
|
|
@ApiOperation(value = "批量删除")
|
@ApiImplicitParams(value = {
|
@ApiImplicitParam(name = "ids", value = "物料清单id", dataTypeClass = String.class, required = true)
|
})
|
@PostMapping("/delAllMbom")
|
public Result delAllMbom(String ids) {
|
mbomModelService.delAllMbom(ids);
|
return Result.success("批量删除成功!");
|
}
|
|
@ApiOperation(value = "下载模板")
|
@PostMapping("/downloadTemplate")
|
public void downloadMBomTemplate(@RequestBody Map<String,Object> map,HttpServletResponse response){
|
mbomModelService.downloadTemplate(map,response);
|
}
|
|
@ApiOperation(value = "导出物料清单")
|
@PostMapping("/exportMBom")
|
public void exportMBom(@RequestBody Map<String,Object> map, HttpServletResponse response){
|
mbomModelService.exportMBom(map,response);
|
}
|
|
}
|