package com.ruoyi.inspect.controller;
|
|
import com.alibaba.fastjson.JSON;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.ruoyi.common.core.domain.Result;
|
import com.ruoyi.inspect.dto.*;
|
import com.ruoyi.inspect.pojo.InsOrderFile;
|
import com.ruoyi.inspect.service.InsOrderFileService;
|
import com.ruoyi.inspect.service.InsOrderPlanService;
|
import com.ruoyi.inspect.service.InsProductService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.HashMap;
|
import java.util.Map;
|
|
/**
|
* 检验任务-控制层
|
*/
|
@RestController
|
@RequestMapping("/insOrderPlan")
|
@Api(tags = "检验任务")
|
@AllArgsConstructor
|
public class InsOrderPlanController {
|
|
private InsOrderPlanService insOrderPlanService;
|
|
private InsOrderFileService insOrderFileService;
|
|
private InsProductService insProductService;
|
|
@ApiOperation(value = "动态获取tab表头")
|
@GetMapping("/getTabHeader")
|
public Result<?> getTabHeader(@RequestParam("sonLaboratory") String sonLaboratory, String samples) {
|
return Result.success(insOrderPlanService.getTabHeader(sonLaboratory, samples));
|
}
|
|
@ApiOperation(value = "查看结果按钮")
|
@PostMapping("/getInsOrderPlanList")
|
public Result getInsOrderPlanList(@RequestBody QueryResultDTO queryResultDTO) {
|
return Result.success(insOrderPlanService.getInsOrderPlanList(queryResultDTO));
|
}
|
|
@ApiOperation(value = "导出委托费用")
|
@GetMapping("/exportCommissionFees")
|
public void exportCommissionFees(@RequestParam Map<String, Object> data,HttpServletResponse response) {
|
insOrderPlanService.exportCommissionFees(data,response);
|
}
|
|
@ApiOperation(value = "导出待检任务")
|
@GetMapping("/exportUnInsProducts")
|
public void exportUnInsProducts(UnInsProductsDTO unInsProductsDTO, HttpServletResponse response) {
|
insOrderPlanService.exportUnInsProducts(unInsProductsDTO,response);
|
}
|
|
@ApiOperation(value = "导出查看检验结果Excel")
|
@PostMapping("/exportInsOrderPlanResult")
|
public void exportInsOrderPlanResult(@RequestBody QueryResultDTO data, HttpServletResponse response) {
|
insOrderPlanService.exportInsOrderPlanResult(data, response);
|
}
|
|
@ApiOperation(value = "查看检验任务列表")
|
@GetMapping("/selectInsOrderPlanList")
|
public Result selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) {
|
return Result.success(insOrderPlanService.selectInsOrderPlanList(page, insOrderPlanDTO));
|
}
|
|
@ApiOperation(value = "检验单详情-任务切换")
|
@GetMapping("/inspectionOrderDetailsTaskSwitching")
|
public Result inspectionOrderDetailsTaskSwitching(Page page,InsOrderPlanDTO insOrderPlanDTO) {
|
return Result.success(insOrderPlanService.inspectionOrderDetailsTaskSwitching(page, insOrderPlanDTO));
|
}
|
|
@ApiOperation(value = "认领按钮")
|
@PostMapping("/claimInsOrderPlan")
|
public Result claimInsOrderPlan(@RequestBody InsOrderPlanDTO data) {
|
return Result.success(insOrderPlanService.claimInsOrderPlan(data));
|
}
|
|
@ApiOperation(value = "检验按钮")
|
@GetMapping("/doInsOrder")
|
public Result<?> doInsOrder(Integer id, String laboratory) {
|
return Result.success(insOrderPlanService.doInsOrder(id, laboratory));
|
}
|
|
@ApiOperation(value = "切换套管/光纤/光纤带记录模版查询检验内容")
|
@GetMapping("/getReportModel")
|
public Result<?> getReportModel(Integer sampleId, String sonLaboratory) {
|
return Result.success(insOrderPlanService.getReportModel(sampleId,sonLaboratory));
|
}
|
|
@GetMapping("/getInsProduct")
|
@ApiOperation("获取检验项目和模板内容")
|
public Result<?> getInsProduct(Integer id, Integer type, String laboratory, HttpServletRequest request) {
|
return Result.success(insOrderPlanService.getInsProduct(id, type, laboratory, request));
|
}
|
|
@ApiOperation(value = "交接按钮")
|
@PostMapping("/upPlanUser")
|
public Result<?> upPlanUser(@RequestBody UpInsOrderDTO upInsOrderDTO) {
|
return Result.success(insOrderPlanService.upPlanUser(upInsOrderDTO.getUserId(), upInsOrderDTO.getOrderId(), upInsOrderDTO.getSonLaboratory()));
|
}
|
|
@ApiOperation(value = "判断交接的试验室")
|
@GetMapping("/upPlanUser2")
|
public Result<?> upPlanUser2(Integer orderId) {
|
return Result.success(insOrderPlanService.upPlanUser2(orderId));
|
}
|
|
@ApiOperation(value = "复核按钮")
|
@PostMapping("/verifyPlan")
|
public Result<?> verifyPlan(Integer orderId, String laboratory, Integer type, String tell) {
|
return Result.success(insOrderPlanService.verifyPlan(orderId, laboratory, type, tell));
|
}
|
|
@ApiOperation(value = "校验检验任务提交")
|
@PostMapping("/checkSubmitPlan")
|
public Result<?> checkSubmitPlan(Integer orderId, String laboratory, String temperature,String humidity) {
|
return Result.success(insOrderPlanService.checkSubmitPlan(orderId, laboratory ,temperature,humidity));
|
}
|
|
@ApiOperation(value = "提交检验任务")
|
@PostMapping("/submitPlan")
|
public Result<?> submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode) {
|
int num = insOrderPlanService.submitPlan(orderId, laboratory, verifyUser, entrustCode);
|
return num == 1 ? Result.success() : Result.fail("提交失败,部分项目还未进行检验");
|
}
|
|
/**
|
*
|
* @param orderId
|
* @return
|
*/
|
@GetMapping("/getEquipName")
|
public Result<?> getEquipName(@RequestParam("orderId") Integer orderId,@RequestParam("sonLaboratory") String sonLaboratory) {
|
return Result.success(insOrderPlanService.getEquipName(orderId,sonLaboratory));
|
}
|
|
/**
|
* @param inspectionOrderDTO 检验数据
|
* @return
|
*/
|
@ApiOperation(value = "保存检验内容")
|
@PostMapping("/saveInsContext")
|
public Result<?> saveInsContext(@RequestBody InspectionOrderDTO inspectionOrderDTO) {
|
insOrderPlanService.saveInsContext(inspectionOrderDTO.getParam(),
|
inspectionOrderDTO.getCurrentTable(),
|
inspectionOrderDTO.getSampleId(),
|
inspectionOrderDTO.getOrderId(),
|
inspectionOrderDTO.getSonLaboratory(),
|
inspectionOrderDTO.getIsDelete());
|
return Result.success();
|
}
|
|
@ApiOperation(value = "查看检验单下的附件列表")
|
@GetMapping("/getFileList")
|
public Result<?> getFileList(Page page,InsOrderFile insOrderFile) {
|
return Result.success(insOrderPlanService.getFileList(page, insOrderFile));
|
}
|
|
@ApiOperation(value = "上传附件按钮")
|
@PostMapping("/uploadFile")
|
public Result<?> uploadFile(Integer orderId, MultipartFile file) {
|
return Result.success(insOrderPlanService.uploadFile(orderId, file));
|
}
|
|
@ApiOperation(value = "删除附件按钮")
|
@PostMapping("/delfile")
|
public Result<?> delfile(Integer id) {
|
return Result.success(insOrderFileService.removeById(id));
|
}
|
|
@ApiOperation(value = "下载附件")
|
@GetMapping("/downFile")
|
public Result<?> downFile(Integer id) {
|
InsOrderFile insOrderFile = insOrderFileService.getById(id);
|
HashMap<String, Object> map = new HashMap<>();
|
map.put("type", insOrderFile.getType());
|
map.put("fileUrl", insOrderFile.getFileUrl());
|
return Result.success(map);
|
}
|
|
@ApiOperation(value = "填写温度与湿度")
|
@PostMapping("/write")
|
public Result<?> write(@RequestBody InsProductDto insProductDto) {
|
return Result.success(insProductService.write(insProductDto));
|
}
|
|
@ApiOperation(value = "温度循环查看列表数据(包括通过样品id,循环次数,温度,循环次数进行筛选)")
|
@GetMapping("/temCycle")
|
public Result<?> temCycle(Integer sampleId, String inspectionItem, String inspectionItemSubclass) {
|
return Result.success(insOrderPlanService.temCycle(sampleId, inspectionItem, inspectionItemSubclass));
|
}
|
|
@ApiOperation(value = "弧垂特殊项查看列表数据")
|
@GetMapping("/getSagTemperatureProducts")
|
public Result<?> getSagTemperatureProducts(Integer sampleId) {
|
return Result.success(insOrderPlanService.getSagTemperatureProducts(sampleId));
|
}
|
|
@ApiOperation(value = "(电力的应力应变)保存检验内容")
|
@PostMapping("/saveInsContext2")
|
public Result<?> saveInsContext2(@RequestBody InsProductResultDTO insProductResult) {
|
return Result.success(insOrderPlanService.saveInsContext2(insProductResult));
|
}
|
|
@ApiOperation("根据订单id查询样品信息")
|
@GetMapping("/getSampleInfoByOrderId")
|
public Result<?> getSampleInfoByOrderId(@RequestParam Integer id,@RequestParam String sonLaboratory){
|
return Result.success(insOrderPlanService.getSampleInfoByOrderId(id,sonLaboratory));
|
}
|
|
|
@ApiOperation("任务展示")
|
@GetMapping("/tasksShow")
|
public Result<?> tasksShow(Page page,String sonLaboratory){
|
return Result.success(insOrderPlanService.tasksShow(page,sonLaboratory));
|
}
|
|
@ApiOperation("获取子试验室当月的总检验任务数量")
|
@GetMapping("/getCurrentMonthPlanTotalBySonLaboratory")
|
public Result<?> getCurrentMonthPlanTotalBySonLaboratory(InsOrderPlanCountDTO insOrderPlanCountDTO){
|
return Result.success(insOrderPlanService.getCurrentMonthPlanTotalBySonLaboratory(insOrderPlanCountDTO.getSonLaboratory(),insOrderPlanCountDTO.getStartTime(),insOrderPlanCountDTO.getEndTime()));
|
}
|
|
}
|