| | |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | | import com.yuanchu.mom.dto.InsProductDto; |
| | | import com.yuanchu.mom.dto.InsProductResultDto; |
| | | import com.yuanchu.mom.dto.SubmitPlanDto; |
| | | import com.yuanchu.mom.pojo.InsOrderFile; |
| | | import com.yuanchu.mom.pojo.InsOrderState; |
| | | import com.yuanchu.mom.service.InsOrderFileService; |
| | | import com.yuanchu.mom.service.InsOrderPlanService; |
| | | import com.yuanchu.mom.service.InsOrderStateService; |
| | | import com.yuanchu.mom.service.InsProductService; |
| | | import com.yuanchu.mom.pojo.InsProductResult; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.InsProductResultVo; |
| | | import com.yuanchu.mom.vo.Result; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public class InsOrderPlanController { |
| | | |
| | | private InsOrderPlanService insOrderPlanService; |
| | | private InsOrderUserService insOrderUserService; |
| | | |
| | | private InsOrderFileService insOrderFileService; |
| | | |
| | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "执行检验操作") |
| | | @PostMapping("/doInsOrder") |
| | | public Result<?> doInsOrder(Integer id, String laboratory) { |
| | | return Result.success(insOrderPlanService.doInsOrder(id, laboratory)); |
| | | } |
| | | |
| | | @ApiOperation(value = "切换套管/光纤/光纤带记录模版查询检验内容") |
| | | @PostMapping("/getReportModel") |
| | | @ValueAuth |
| | | public Result<?> getReportModel(Integer sampleId) { |
| | | return Result.success(insOrderPlanService.getReportModel(sampleId)); |
| | | public Result<?> doInsOrder(Integer sampleId, String laboratory) { |
| | | return Result.success(insOrderPlanService.doInsOrder(sampleId, laboratory)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @PostMapping("/getInsProduct") |
| | | @ApiOperation("获取检验项目和模板内容") |
| | | //这里的id就是样品id |
| | | public Result<?> getInsProduct(Integer id, Integer type, String laboratory, HttpServletRequest request) { |
| | | return Result.success(insOrderPlanService.getInsProduct(id, type, laboratory, request)); |
| | | } |
| | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "任务交接") |
| | | @PostMapping("/upPlanUser") |
| | | public Result<?> upPlanUser(Integer userId, Integer orderId,String sonLaboratory) { |
| | | return Result.success(insOrderPlanService.upPlanUser(userId, orderId, sonLaboratory)); |
| | | public Result<?> upPlanUser(Integer userId, Integer sampleId, String sonLaboratory) { |
| | | return Result.success(insOrderPlanService.upPlanUser(userId, sampleId, sonLaboratory)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "判断交接的试验室") |
| | | @PostMapping("/upPlanUser2") |
| | | public Result<?> upPlanUser2(Integer orderId) { |
| | | return Result.success(insOrderPlanService.upPlanUser2(orderId)); |
| | | public Result<?> upPlanUser2(Integer sampleId) { |
| | | return Result.success(insOrderPlanService.upPlanUser2(sampleId)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "复核检验任务") |
| | | @PostMapping("/verifyPlan") |
| | | public Result<?> verifyPlan(Integer orderId, String laboratory, Integer type, String tell) { |
| | | return Result.success(insOrderPlanService.verifyPlan(orderId, laboratory, type, tell)); |
| | | public Result<?> verifyPlan(Integer sampleId, String laboratory, Integer type, String tell) throws IOException { |
| | | return Result.success(insOrderPlanService.verifyPlan(sampleId, laboratory, type, tell)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "校验检验任务提交") |
| | | @PostMapping("/checkSubmitPlan") |
| | | public Result<?> checkSubmitPlan(Integer orderId, String laboratory) { |
| | | return Result.success(insOrderPlanService.checkSubmitPlan(orderId, laboratory)); |
| | | public Result<?> checkSubmitPlan(Integer sampleId, String laboratory) { |
| | | return Result.success(insOrderPlanService.checkSubmitPlan(sampleId, laboratory)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "检验任务提交") |
| | | @PostMapping("/submitPlan") |
| | | public Result<?> submitPlan(Integer orderId,String laboratory, Integer verifyUser, String entrustCode) { |
| | | int num = insOrderPlanService.submitPlan(orderId, laboratory, verifyUser, entrustCode); |
| | | public Result<?> submitPlan(@RequestBody SubmitPlanDto submitPlanDto) { |
| | | int num = insOrderPlanService.submitPlan(submitPlanDto); |
| | | return num == 1 ? Result.success() : Result.fail("提交失败,部分项目还未进行检验"); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "保存检验内容") |
| | | @PostMapping("/saveInsContext") |
| | | @ValueAuth |
| | | public Result<?> saveInsContext(String param) { |
| | | public Result<?> saveInsContext(String param, Integer num) { |
| | | Map<String, Object> param2 = JSON.parseObject(param, Map.class); |
| | | insOrderPlanService.saveInsContext(param2); |
| | | insOrderPlanService.saveInsContext(param2, num); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "电路试验的保存检验内容") |
| | | @PostMapping("/saveInsContext2") |
| | | @ValueAuth |
| | | public Result<?> saveInsContext2(@RequestBody InsProductResultDto insProductResultDtos) { |
| | | return Result.success(insOrderPlanService.saveInsContext2(insProductResultDtos)); |
| | | } |
| | | |
| | | @ApiOperation(value = "温湿度试验+功率试验的保存检验内容") |
| | | @PostMapping("/saveInsContext3") |
| | | @ValueAuth |
| | | public Result<?> saveInsContext3(@RequestBody InsProductResult insProductResult) { |
| | | return Result.success(insOrderPlanService.saveInsContext3(insProductResult)); |
| | | } |
| | | |
| | | @ValueAuth |
| | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "上传附件") |
| | | @PostMapping("/uploadFile") |
| | | public Result<?> uploadFile(Integer orderId, MultipartFile file) { |
| | | return Result.success(insOrderPlanService.uploadFile(orderId, file)); |
| | | public Result<?> uploadFile(Integer orderId, MultipartFile file, String sonLaboratory,Integer sampleId) { |
| | | return Result.success(insOrderPlanService.uploadFile(orderId, file, sonLaboratory,sampleId)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "删除附件") |
| | | @PostMapping("/delfile") |
| | | public Result<?> delfile(Integer id) { |
| | | return Result.success(insOrderFileService.removeById(id)); |
| | | return Result.success(insOrderFileService.delfile(id)); |
| | | } |
| | | |
| | | @ValueAuth |
| | |
| | | return Result.success(insProductService.write(insProductDto)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "温度循环查看列表数据(包括通过样品id,循环次数,温度,循环次数进行筛选)") |
| | | @PostMapping("/temCycle") |
| | | public Result<?> temCycle(Integer sampleId, String inspectionItem, String inspectionItemSubclass) { |
| | | return Result.success(insOrderPlanService.temCycle(sampleId, inspectionItem, inspectionItemSubclass)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "插队操作") |
| | | @PostMapping("/jumpTeam") |
| | | public Result<?> jumpTeam(@RequestBody InsOrderState insOrderState) { |
| | | return Result.success(insOrderStateService.jumpTeam(insOrderState)); |
| | | } |
| | | |
| | | @ApiOperation(value = "电路试验的保存检验内容") |
| | | @PostMapping("/saveInsContext2") |
| | | @ValueAuth |
| | | public Result<?> saveInsContext2(@RequestBody InsProductResultDto insProductResultDtos) { |
| | | return Result.success(insOrderPlanService.saveInsContext2(insProductResultDtos)); |
| | | } |
| | | |
| | | @ApiOperation(value = "电路试验的删除频段") |
| | |
| | | return Result.success(insOrderPlanService.deleteInsContext(insProductResultVo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "电路试验的删除互调") |
| | | @PostMapping("/deleteInsContext2") |
| | | @ValueAuth |
| | | public Result<?> deleteInsContext2(String frequency,Integer productId,String often) { |
| | | return Result.success(insOrderPlanService.deleteInsContext2(frequency,productId,often)); |
| | | } |
| | | |
| | | @ApiOperation(value = "电路试验点击检验选择版本") |
| | | @PostMapping("/chooseVersion") |
| | | @ValueAuth |
| | | public Result<?> chooseVersion(Integer orderStateId,Integer version) { |
| | | public Result<?> chooseVersion(Integer orderStateId, Integer version) { |
| | | InsOrderState orderState = new InsOrderState(); |
| | | orderState.setId(orderStateId); |
| | | orderState.setVersion(version); |
| | | return Result.success(insOrderStateService.updateById(orderState)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @PostMapping("/getInsOrderUserList") |
| | | @ApiOperation("查看检验历史列表") |
| | | public Result<?> getInsOrderUserList(Integer insOrderStateId) { |
| | | return Result.success(insOrderPlanService.getInsOrderUserList(insOrderStateId)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @PostMapping("/getInsProduct2") |
| | | @ApiOperation("查看检验历史") |
| | | //这里的id是样品id |
| | | public Result<?> getInsProduct2(Integer id, Integer type, String laboratory, HttpServletRequest request, Integer num) { |
| | | return Result.success(insOrderPlanService.getInsProduct2(id, type, laboratory, request, num)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "扫码报检(入库)") |
| | | @PostMapping("/scanInsOrderState") |
| | | public Result scanInsOrderState(String sonLaboratory, String sampleCode, String trees) { |
| | | return Result.success(insOrderPlanService.scanInsOrderState(sonLaboratory, sampleCode, trees)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "扫码出库") |
| | | @PostMapping("/outInsOrderState") |
| | | public Result outInsOrderState(String sonLaboratory, String sampleCode) { |
| | | return Result.success(insOrderPlanService.outInsOrderState(sonLaboratory, sampleCode)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @PostMapping("/preview") |
| | | @ApiOperation("预览文件") |
| | | public Result<?> preview(Integer id) throws Exception { |
| | | return Result.success(insOrderPlanService.preview(id)); |
| | | } |
| | | |
| | | } |