| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.dto.PageTestObjectDto; |
| | | import com.yuanchu.mom.pojo.Product; |
| | | import com.yuanchu.mom.pojo.StructureItemParameter; |
| | | import com.yuanchu.mom.pojo.StructureTestObject; |
| | | import com.yuanchu.mom.service.CapacityScopeService; |
| | | import com.yuanchu.mom.service.ProductService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | public class CapacityScopeController { |
| | | |
| | | private CapacityScopeService capacityScopeService; |
| | | |
| | | private ProductService productService; |
| | | |
| | | @ApiOperation(value = "获取项目检验参数列表") |
| | | @PostMapping("/selectItemParameterList") |
| | |
| | | public Result selectTestObjectByName() { |
| | | return Result.success(capacityScopeService.selectTestObjectByName()); |
| | | } |
| | | |
| | | @ApiOperation(value = "设备里面选择检验项目(树形结构)") |
| | | @PostMapping("/getInsProduction") |
| | | public Result getInsProduction(){ |
| | | return Result.success(capacityScopeService.getInsProduction()); |
| | | } |
| | | |
| | | @ApiOperation(value = "维护检验对象的产品") |
| | | @PostMapping("/selectProductListByObjectId") |
| | | public Result selectProductListByObjectId(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | Product product = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Product.class); |
| | | return Result.success(productService.selectProductListByObjectId(page, product)); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加产品") |
| | | @PostMapping("/addProduct") |
| | | @ValueAuth |
| | | public Result addProduct(@RequestBody Product product) { |
| | | return Result.success(productService.addProduct(product)); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改产品") |
| | | @PostMapping("/upProduct") |
| | | @ValueAuth |
| | | public Result upProduct(@RequestBody Product product) { |
| | | return Result.success(productService.upProduct(product)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除产品") |
| | | @PostMapping("/delProduct") |
| | | @ValueAuth |
| | | public Result delProduct(Integer id) { |
| | | return Result.success(productService.delProduct(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取检验对象树") |
| | | @GetMapping("/getItemTree") |
| | | @ValueAuth |
| | | public Result getItemTree() { |
| | | return Result.success(capacityScopeService.getItemTree()); |
| | | } |
| | | |
| | | } |
| | | |