| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.dto.CopyStandardProductListDto; |
| | | import com.ruoyi.basic.dto.FactoryDto; |
| | | import com.ruoyi.basic.dto.InsSampleReceiveDto; |
| | | import com.ruoyi.basic.dto.ResetTreeDragDTO; |
| | | import com.ruoyi.basic.pojo.InsSample1; |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.pojo.StandardProductListSupplierAsk; |
| | | import com.ruoyi.basic.pojo.StandardTree; |
| | | import com.ruoyi.basic.service.StandardMethodListService; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.basic.service.StandardProductListService; |
| | | import com.ruoyi.basic.service.StandardProductListSupplierAskService; |
| | | import com.ruoyi.basic.service.StandardTreeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | |
| | | |
| | | private StandardProductListService standardProductListService; |
| | | |
| | | private StandardProductListSupplierAskService standardProductListSupplierAskService; |
| | | |
| | | @ApiOperation(value = "获取标准树") |
| | | @ApiOperation(value = "查看标准库列表") |
| | | @GetMapping("/selectStandardTreeList") |
| | | public Result selectStandardTreeList() { |
| | | return Result.success(standardTreeService.selectStandardTreeList()); |
| | |
| | | |
| | | @ApiOperation(value = "给标准树添加检验标准") |
| | | @PostMapping("/addStandardMethodList") |
| | | public Result addStandardMethodList(String tree, Integer standardId) { |
| | | public Result addStandardMethodList(@RequestBody Map<String,Object> map) { |
| | | Integer standardId =(Integer) map.get("standardId"); |
| | | String tree =(String) map.get("tree"); |
| | | return Result.success(standardMethodListService.addStandardMethodList(standardId, tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据标准树进行标准查询") |
| | | @PostMapping("/selectsStandardMethodByFLSSM") |
| | | @GetMapping("/selectsStandardMethodByFLSSM") |
| | | public Result selectsStandardMethodByFLSSM(String tree) { |
| | | return Result.success(standardMethodListService.selectsStandardMethodByFLSSM(tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改标准库中的内容") |
| | | @PostMapping("/upStandardProductList") |
| | | public Result upStandardProductList(String str) { |
| | | public Result upStandardProductList(@RequestBody Map<String, String> map) { |
| | | String str = map.get("str"); |
| | | StandardProductList list = JSON.parseObject(str, StandardProductList.class); |
| | | return Result.success(standardProductListService.upStandardProductList(list)); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改标准库区间") |
| | | @PostMapping("/updateSection") |
| | | public Result updateSection(String str) { |
| | | StandardProductList list = JSON.parseObject(str, StandardProductList.class); |
| | | return Result.success(standardProductListService.updateSection(list)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除标准树下的检验标准") |
| | | @PostMapping("/delStandardMethodByFLSSM") |
| | | @DeleteMapping("/delStandardMethodByFLSSM") |
| | | public Result delStandardMethodByFLSSM(Integer id) { |
| | | return Result.success(standardMethodListService.delStandardMethodByFLSSM(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除标准树下的检验项目") |
| | | @PostMapping("/delStandardProductByIds") |
| | | @DeleteMapping("/delStandardProductByIds") |
| | | public Result delStandardProductByIds(String ids) { |
| | | JSONArray lists = JSON.parseArray(ids); |
| | | return Result.success(standardProductListService.delStandardProduct(lists)); |
| | |
| | | |
| | | @ApiOperation(value = "新增标准树下的检验项目") |
| | | @PostMapping("/addStandardProduct") |
| | | public Result addStandardProduct(String ids, String tree) { |
| | | public Result addStandardProduct(@RequestBody Map<String,Object> map) { |
| | | String ids =(String) map.get("ids"); |
| | | String tree =(String) map.get("tree"); |
| | | return Result.success(standardTreeService.addStandardProduct(ids, tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除标准树的层级") |
| | | @PostMapping("/delStandardTree") |
| | | @DeleteMapping("/delStandardTree") |
| | | public Result delStandardTree(String tree) { |
| | | return Result.success(standardTreeService.delStandardTree(tree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过标准树查询对应的检验项目") |
| | | @PostMapping("/selectStandardProductList") |
| | | public Result selectStandardProductList(@RequestBody InsSampleReceiveDto insSample) { |
| | | @GetMapping("/selectStandardProductList") |
| | | public Result selectStandardProductList( InsSample1 insSample) { |
| | | return Result.success(standardProductListService.selectStandardProductList(insSample)); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过检验标准查询检验项目") |
| | | @PostMapping("/selectStandardProductListByMethodId") |
| | | public Result selectStandardProductListByMethodId(Integer id, String tree, Integer page) { |
| | | public Result selectStandardProductListByMethodId(@RequestBody Map<String,Object> map ) { |
| | | Integer id =(Integer) map.get("id"); |
| | | String tree = (String)map.get("tree"); |
| | | Integer page = (Integer)map.get("page"); |
| | | return Result.success(standardProductListService.selectStandardProductListByMethodId(id, tree, page)); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量编辑查询检验项目") |
| | | @PostMapping("/selectStandardProductByMethodId") |
| | | @GetMapping("/selectStandardProductByMethodId") |
| | | 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") |
| | | @GetMapping("/selectStandardProductEnumByMethodId") |
| | | public Result selectStandardProductEnumByMethodId(Integer id, String tree, String item) { |
| | | return Result.success(standardProductListService.selectStandardProductEnumByMethodId(id, tree, item)); |
| | | } |
| | |
| | | return Result.success(standardTreeService.upStandardProducts(product)); |
| | | } |
| | | |
| | | @PostMapping("/getStandTreeBySampleType") |
| | | @GetMapping("/getStandTreeBySampleType") |
| | | @ApiOperation("仅获取光纤的型号") |
| | | public Result<?> getStandTreeBySampleType(String laboratory, String sampleType) { |
| | | return Result.success(standardTreeService.getStandTreeBySampleType(laboratory, sampleType)); |
| | |
| | | |
| | | @ApiOperation("重置标准库单价") |
| | | @PostMapping("/resetTreeOfPrice") |
| | | public Result resetTreeOfPrice(String tree, Integer standardId) { |
| | | public Result resetTreeOfPrice(@RequestBody Map<String,Object> map) { |
| | | Integer standardId =(Integer) map.get("standardId"); |
| | | String tree =(String) map.get("tree"); |
| | | standardTreeService.resetTreeOfPrice(tree, standardId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("重置标准库工时系数") |
| | | @PostMapping("/resetTreeOfHour") |
| | | public Result resetTreeOfHour(String tree, Integer standardId) { |
| | | public Result resetTreeOfHour(@RequestBody Map<String,Object> map) { |
| | | Integer standardId =(Integer) map.get("standardId"); |
| | | String tree =(String) map.get("tree"); |
| | | standardTreeService.resetTreeOfHour(tree, standardId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("重置标准库要求描述和要求值") |
| | | @PostMapping("/resetTreeOfAsk") |
| | | public Result resetTreeOfAsk(String tree, Integer standardId) { |
| | | public Result resetTreeOfAsk(@RequestBody Map<String,Object> map) { |
| | | Integer standardId =(Integer) map.get("standardId"); |
| | | String tree =(String) map.get("tree"); |
| | | standardTreeService.resetTreeOfAsk(tree, standardId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("标准库拖拽") |
| | | @PostMapping("/resetTreeDrag") |
| | | public Result resetTreeDrag(@RequestBody ResetTreeDragDTO resetTreeDragDTO) { |
| | | standardProductListService.resetTreeDrag(resetTreeDragDTO); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("标准库拖拽全部") |
| | | @PostMapping("/resetTreeDragBatch") |
| | | public Result resetTreeDragBatch(@RequestBody Map<String, Object> params) { |
| | | List<StandardProductList> standardProductLists = (List<StandardProductList>) params.get("params"); |
| | | standardProductListService.resetTreeDragBatch(standardProductLists); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "标准树排序") |
| | | @PostMapping("/updateTreeSort") |
| | | public Result updateTreeSort(@RequestBody List<FactoryDto> list) { |
| | | return Result.success(standardTreeService.updateTreeSort(list)); |
| | | } |
| | | |
| | | /*************************************************** 厂家特殊要求值处理 ************************************************************/ |
| | | |
| | | @ApiOperation(value = "根据产品id查询厂家要求值绑定") |
| | | @PostMapping("/selectSupplierAsk") |
| | | public Result selectSupplierAsk(StandardProductListSupplierAsk supplierAsk) throws Exception { |
| | | return Result.success(standardProductListSupplierAskService.selectByProductId(supplierAsk)); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增厂家要求值绑定") |
| | | @PostMapping("/addProductSupplierAsk") |
| | | public Result addProductSupplierAsk(String str) { |
| | | StandardProductListSupplierAsk supplierAsk = JSON.parseObject(str, StandardProductListSupplierAsk.class); |
| | | return Result.success(standardProductListSupplierAskService.addProductSupplierAsk(supplierAsk)); |
| | | } |
| | | |
| | | @ApiOperation(value = "更新厂家要求值绑定") |
| | | @PostMapping("/updateProductSupplierAsk") |
| | | public Result updateProductSupplierAsk(String str) { |
| | | StandardProductListSupplierAsk supplierAsk = JSON.parseObject(str, StandardProductListSupplierAsk.class); |
| | | standardProductListSupplierAskService.updateProductSupplierAsk(supplierAsk); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除厂家要求值绑定") |
| | | @PostMapping("/deleteProductSupplierAsk") |
| | | public Result deleteProductSupplierAsk(Integer supplierAskId) { |
| | | standardProductListSupplierAskService.removeById(supplierAskId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改标准树") |
| | | @PostMapping("/updateStandardTree") |
| | | public Result updateStandardTree(@RequestBody StandardTree standardTree) { |
| | | return Result.success(standardTreeService.updateStandardTree(standardTree)); |
| | | } |
| | | |
| | | @ApiOperation(value = "检验项要求值复制对比") |
| | | @PostMapping("/copyStandardProductList") |
| | | public Result copyStandardProductList(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { |
| | | return Result.success(standardProductListService.copyStandardProductList(copyStandardProductListDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "检验项要求值单独对比") |
| | | @PostMapping("/copyStandardProductOne") |
| | | public Result copyStandardProductOne(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { |
| | | return Result.success(standardProductListService.copyStandardProductOne(copyStandardProductListDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "检验项批量修改要求值要求描述") |
| | | @PostMapping("/updateStandardProductListBatch") |
| | | public Result updateStandardProductListBatch(@RequestBody Map<String, Object> param) { |
| | | List<StandardProductList> standardProductList = (List<StandardProductList>) param.get("standardProductList"); |
| | | return Result.success(standardProductListService.updateBatchById(standardProductList)); |
| | | } |
| | | |
| | | @ApiOperation(value = "检验项复制排序") |
| | | @PostMapping("/copyStandardProductSort") |
| | | public Result copyStandardProductSort(@RequestBody CopyStandardProductListDto copyStandardProductListDto) { |
| | | return Result.success(standardProductListService.copyStandardProductSort(copyStandardProductListDto)); |
| | | } |
| | | } |