| | |
| | | package com.ruoyi.inspect.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.inspect.dto.InsOrderPlanDTO; |
| | | import com.ruoyi.inspect.dto.InsOrderPlanProductDto; |
| | | import com.ruoyi.inspect.dto.InsProductBindingDto; |
| | | import com.ruoyi.inspect.dto.SaveInsContextDto; |
| | | import com.ruoyi.inspect.pojo.InsOrder; |
| | | import com.ruoyi.inspect.pojo.InsOrderFactoryVerify; |
| | | import com.ruoyi.inspect.pojo.InsOrderFile; |
| | | import com.ruoyi.inspect.pojo.InsProduct; |
| | | import com.ruoyi.inspect.service.InsOrderFileService; |
| | | import com.ruoyi.inspect.service.InsOrderPlanService; |
| | | import com.ruoyi.inspect.service.InsOrderRatesService; |
| | | import com.ruoyi.inspect.service.InsProductService; |
| | | import com.ruoyi.performance.dto.AuxiliaryOutputWorkingHoursTemporaryDto; |
| | | import com.ruoyi.performance.pojo.AuxiliaryOutputWorkingHoursTemporary; |
| | | import com.ruoyi.performance.service.AuxiliaryOutputWorkingHoursTemporaryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | public class InsOrderPlanController { |
| | | |
| | | private InsOrderPlanService insOrderPlanService; |
| | | |
| | | private InsOrderFileService insOrderFileService; |
| | | |
| | | private InsProductService insProductService; |
| | | private AuxiliaryOutputWorkingHoursTemporaryService auxiliaryOutputWorkingHoursTemporaryService; |
| | | |
| | | |
| | | @ApiOperation(value = "获取检验任务列表") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "执行检验操作") |
| | | @PostMapping("/doInsOrder") |
| | | @ApiOperation(value = "查询检验操作") |
| | | @GetMapping("/doInsOrder") |
| | | public Result<?> doInsOrder(Integer id, String laboratory) { |
| | | return Result.success(insOrderPlanService.doInsOrder(id, laboratory)); |
| | | } |
| | | |
| | | @PostMapping("/getInsProduct") |
| | | @ApiOperation("获取检验项目和模板内容") |
| | | @GetMapping("/getInsProduct") |
| | | public Result<?> getInsProduct(InsOrderPlanProductDto insOrderPlanProductDto) { |
| | | return Result.success(insOrderPlanService.getInsProduct(insOrderPlanProductDto)); |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "判断交接的试验室") |
| | | @PostMapping("/upPlanUser2") |
| | | @GetMapping("/upPlanUser2") |
| | | public Result<?> upPlanUser2(Integer orderId) { |
| | | return Result.success(insOrderPlanService.upPlanUser2(orderId)); |
| | | } |
| | |
| | | return num == 1 ? Result.success() : Result.fail("提交失败,部分项目还未进行检验"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @param param 模板内容 |
| | | * @param currentTable 当前模板id |
| | | * @param sampleId 当前样品id |
| | | * @param orderId 当前订单id |
| | | * @param sonLaboratory 子试验室 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "保存检验内容") |
| | | @PostMapping("/saveInsContext") |
| | | public Result<?> saveInsContext(String param, Integer currentTable, Integer sampleId, Integer orderId, String sonLaboratory) { |
| | | Map<String, Object> param2 = JSON.parseObject(param, Map.class); |
| | | insOrderPlanService.saveInsContext(param2, currentTable, sampleId, orderId, sonLaboratory); |
| | | public Result<?> saveInsContext(@RequestBody SaveInsContextDto saveInsContextDto) { |
| | | insOrderPlanService.saveInsContext(saveInsContextDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "上传附件") |
| | | @PreAuthorize("@ss.hasPermi('upload:order:file')") |
| | | @PostMapping("/uploadFile") |
| | | public Result<?> taskUploadFile(Integer orderId, MultipartFile file) { |
| | | return Result.success(insOrderPlanService.uploadFile(orderId, file)); |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "删除附件") |
| | | @PostMapping("/delfile") |
| | | @PreAuthorize("@ss.hasPermi('del:order:file')") |
| | | @DeleteMapping("/delfile") |
| | | public Result<?> delfile(Integer id) { |
| | | return Result.success(insOrderFileService.removeById(id)); |
| | | } |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "电缆配置,查看配置标识") |
| | | @PostMapping("/getCableTag") |
| | | @GetMapping("/getCableTag") |
| | | public Result<?> getCableTag(Integer id, String laboratory) { |
| | | return Result.success(insOrderPlanService.getCableTag(id, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "原材料,查看配置标识") |
| | | @PostMapping("/getRawMaterialTag") |
| | | @GetMapping("/getRawMaterialTag") |
| | | public Result<?> getRawMaterialTag(Integer id, String laboratory) { |
| | | return Result.success(insOrderPlanService.getRawMaterialTag(id, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "查看重复标识") |
| | | @PostMapping("/getRepetitionTag") |
| | | @GetMapping("/getRepetitionTag") |
| | | public Result<?> getRepetitionTag(Integer id, String laboratory, String cableTag) { |
| | | return Result.success(insOrderPlanService.getRepetitionTag(id, laboratory, cableTag)); |
| | | } |
| | | |
| | | @ApiOperation("获取不合格数据") |
| | | @PostMapping("/getInsProductUnqualified") |
| | | public Result<?> getInsProductUnqualified(InsOrderPlanProductDto insOrderPlanProductDto) { |
| | | return Result.success(insOrderPlanService.getInsProductUnqualified(insOrderPlanProductDto)); |
| | | } |
| | | |
| | | @ApiOperation("新增不合格复测信息") |
| | | @PostMapping("/addUnqualifiedRetest") |
| | | public Result<?> addDisqualificationRetest(@RequestBody Map<String, Object> params) { |
| | | // 获取检验对象的id |
| | | List<Integer> ids = (List<Integer>) params.get("ids"); |
| | | return Result.success(insOrderPlanService.addDisqualificationRetest(ids)); |
| | | public Result<?> addDisqualificationRetest(@RequestBody List<InsProduct> insProductsList) { |
| | | return Result.success(insOrderPlanService.addDisqualificationRetest(insProductsList)); |
| | | } |
| | | |
| | | @ApiOperation("获取不合格复测数据") |
| | | @PostMapping("/getInsProductUnqualifiedRetest") |
| | | public Result<?> getInsProductUnqualifiedRetest(Integer id, Integer type, String laboratory, String cableTag, String rawMaterialTag, String retestTag) { |
| | | return Result.success(insOrderPlanService.getInsProductUnqualifiedRetest(id, type, laboratory, cableTag, rawMaterialTag, retestTag)); |
| | | @GetMapping("/getInsProductUnqualifiedRetest") |
| | | public Result<?> getInsProductUnqualifiedRetest(InsOrderPlanProductDto insOrderPlanProductDto) { |
| | | return Result.success(insOrderPlanService.getInsProductUnqualifiedRetest(insOrderPlanProductDto)); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param param 模板内容 |
| | | * @param currentTable 当前模板id |
| | | * @param sampleId 当前样品id |
| | | * @param orderId 当前订单id |
| | | * @param sonLaboratory 子试验室 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "保存不合格复测检验内容") |
| | | @ApiOperation(value = "保存 不合格复测检验内容") |
| | | @PostMapping("/saveUnqualifiedContext") |
| | | public Result<?> saveUnqualifiedContext(String param, Integer currentTable, Integer sampleId, Integer orderId, String sonLaboratory) { |
| | | Map<String, Object> param2 = JSON.parseObject(param, Map.class); |
| | | insOrderPlanService.saveUnqualifiedContext(param2, currentTable, sampleId, orderId, sonLaboratory); |
| | | public Result<?> saveUnqualifiedContext(@RequestBody SaveInsContextDto saveInsContextDto) { |
| | | Map<String, Object> param2 = JSON.parseObject(saveInsContextDto.getParam(), Map.class); |
| | | insOrderPlanService.saveUnqualifiedContext(param2, saveInsContextDto.getCurrentTable(), saveInsContextDto.getSampleId(), saveInsContextDto.getOrderId(), saveInsContextDto.getSonLaboratory()); |
| | | return Result.success(); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | @ApiOperation(value = "修改检验项内容") |
| | | @PreAuthorize("@ss.hasPermi('update:product:onPlan')") |
| | | @PostMapping("/updateProductOnPlan") |
| | | public Result<?> updateProductOnPlan(@RequestBody InsProduct insProduct) { |
| | | insProductService.updateById(insProduct); |
| | |
| | | @GetMapping("/getBindingProductByProductId") |
| | | public Result<List<InsProduct>> getBindingProductByProductId(Integer productId) { |
| | | return Result.success(insProductService.list(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getBindingProductId, productId))); |
| | | .eq(InsProduct::getBindingProductId, productId) |
| | | .orderByAsc(InsProduct::getSort))); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "删除特殊检验项绑定信息") |
| | | @GetMapping("/delProductTreeByProductId") |
| | | @DeleteMapping("/delProductTreeByProductId") |
| | | public Result<?> delProductTreeByProductId(Integer productId) { |
| | | return Result.success(insProductService.removeBindingProductTree(productId)); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单查询工时详情 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "根据订单查询工时详情") |
| | | @PreAuthorize("@ss.hasPermi('get:working:hours:byOrder')") |
| | | @GetMapping("/getWorkingHoursByOrderId") |
| | | public Result<IPage<AuxiliaryOutputWorkingHoursTemporaryDto>> getWorkingHoursByOrderId(Page page, AuxiliaryOutputWorkingHoursTemporaryDto workingHoursTemporary) { |
| | | return Result.success(auxiliaryOutputWorkingHoursTemporaryService.getWorkingHoursByOrderId(page, workingHoursTemporary)); |
| | | } |
| | | |
| | | /** |
| | | * 修改工时详情 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改工时详情") |
| | | @PreAuthorize("@ss.hasPermi('update:order:workingHours')") |
| | | @PostMapping("/updateWorkingHours") |
| | | public Result updateWorkingHours(@RequestBody AuxiliaryOutputWorkingHoursTemporary workingHoursTemporary) { |
| | | return Result.success(auxiliaryOutputWorkingHoursTemporaryService.updateById(workingHoursTemporary)); |
| | | } |
| | | } |