| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.pojo.InsSample; |
| | | import com.yuanchu.mom.pojo.StandardProductList; |
| | | import com.yuanchu.mom.pojo.StandardTree; |
| | | import com.yuanchu.mom.service.StandardMethodListService; |
| | | import com.yuanchu.mom.service.StandardProductListService; |
| | | import com.yuanchu.mom.service.StandardTreeService; |
| | | 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 lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/standardTree") |
| | | @Api(tags="标准库") |
| | | public class StandardTreeController { |
| | | |
| | | private StandardTreeService standardTreeService; |
| | | |
| | | private StandardMethodListService standardMethodListService; |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "获取标准树") |
| | | @GetMapping("/selectStandardTreeList") |
| | | public Result selectStandardTreeList(){ |
| | | return Result.success(standardTreeService.selectStandardTreeList()); |
| | | } |
| | | |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "添加标准树") |
| | | @PostMapping("/addStandardTree") |
| | | public Result addStandardTree(@RequestBody StandardTree standardTree){ |
| | | if(standardTree.getModel().equals("")) standardTree.setModel(null); |
| | | return Result.success(standardTreeService.addStandardTree(standardTree)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "给标准树添加检验标准") |
| | | @PostMapping("/addStandardMethodList") |
| | | public Result addStandardMethodList(String tree, Integer standardId){ |
| | |
| | | public Result selectsStandardMethodByFLSSM(String tree){ |
| | | return Result.success(standardMethodListService.selectsStandardMethodByFLSSM(tree)); |
| | | } |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "修改标准库中的内容") |
| | | @PostMapping("/upStandardProductList") |
| | | public Result upStandardProductList(@RequestBody StandardProductList list){ |
| | | return Result.success(standardProductListService.upStandardProductList(list)); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "删除标准树下的检验标准") |
| | | @PostMapping("/delStandardMethodByFLSSM") |
| | | public Result delStandardMethodByFLSSM(Integer id){ |
| | | return Result.success(standardMethodListService.delStandardMethodByFLSSM(id)); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "删除标准树下的检验项目") |
| | | @PostMapping("/delStandardProductByIds") |
| | | public Result delStandardProductByIds(String ids){ |
| | | JSONArray lists = JSON.parseArray(ids); |
| | | return Result.success(standardProductListService.delStandardProduct(lists)); |
| | | } |
| | | @ValueAuth |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "新增标准树下的检验项目") |
| | | @PostMapping("/addStandardProduct") |
| | | public Result addStandardProduct(String ids, String tree){ |
| | | return Result.success(standardTreeService.addStandardProduct(ids, tree)); |
| | | } |
| | | |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "删除标准树的层级") |
| | | @PostMapping("/delStandardTree") |
| | | public Result delStandardTree(String tree){ |
| | | return Result.success(standardTreeService.delStandardTree(tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过标准树查询对应的检验项目") |
| | | @PostMapping("/selectStandardProductList") |
| | | @ValueAuth |
| | | public Result selectStandardProductList(@RequestBody InsSample insSample){ |
| | | return Result.success(standardProductListService.selectStandardProductList(insSample)); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过检验标准查询检验项目") |
| | | @PostMapping("/selectStandardProductListByMethodId") |
| | | @ValueAuth |
| | | public Result selectStandardProductListByMethodId(Integer id, String tree, Integer page){ |
| | | return Result.success(standardProductListService.selectStandardProductListByMethodId(id, tree, page)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量编辑查询检验项目") |
| | | @PostMapping("/selectStandardProductByMethodId") |
| | | @ValueAuth |
| | | public Result selectStandardProductByMethodId(Integer id, String tree, Integer page,String laboratory,String item,String items){ |
| | | return Result.success(standardProductListService.selectStandardProductByMethodId(id, tree, page, laboratory, item, items)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量编辑查询所有检验项目和检验子项枚举") |
| | | @PostMapping("/selectStandardProductEnumByMethodId") |
| | | @ValueAuth |
| | | public Result selectStandardProductEnumByMethodId(Integer id, String tree){ |
| | | return Result.success(standardProductListService.selectStandardProductEnumByMethodId(id, tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取标准树下标准方法枚举") |
| | | @GetMapping("/selectStandardMethodEnum") |
| | | @ValueAuth |
| | | public Result selectStandardMethodEnum(){ |
| | | return Result.success(standardMethodListService.selectStandardMethodEnum()); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取产品架构") |
| | | @GetMapping("/getStandardTree2") |
| | | @ValueAuth |
| | | public Result getStandardTree2(){ |
| | | return Result.success(standardTreeService.getStandardTree2()); |
| | | } |
| | | |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "批量修改项目内容") |
| | | @PostMapping("/upStandardProducts") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "standardProductList",dataTypeClass = StandardProductList.class), |
| | | @ApiImplicitParam(name = "ids",dataTypeClass = Integer.class) |
| | | }) |
| | | public Result upStandardProducts(@RequestBody Map<String, Object> product){ |
| | | return Result.success(standardTreeService.upStandardProducts(product)); |
| | | } |
| | | } |