| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.InsOrderPlanDTO; |
| | | import com.yuanchu.mom.service.InsOrderPlanService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/insOrderPlan") |
| | | @Api(tags = "检验任务") |
| | | @AllArgsConstructor |
| | | public class InsOrderPlanController { |
| | | |
| | | private InsOrderPlanService insOrderPlanService; |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "获取检验任务列表") |
| | | @PostMapping("/selectInsOrderPlanList") |
| | | public Result selectInsOrderPlanList(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | page.setOptimizeCountSql(false); |
| | | InsOrderPlanDTO insOrderPlanDTO = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), InsOrderPlanDTO.class); |
| | | return Result.success(insOrderPlanService.selectInsOrderPlanList(page, insOrderPlanDTO)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "认领任务计划") |
| | | @PostMapping("/claimInsOrderPlan") |
| | | public Result claimInsOrderPlan(@RequestBody InsOrderPlanDTO data) { |
| | | return Result.success(insOrderPlanService.claimInsOrderPlan(data)); |
| | | } |
| | | |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "执行检验操作") |
| | | @PostMapping("/doInsOrder") |
| | | public Result<?> doInsOrder(Integer id) { |
| | | return Result.success(insOrderPlanService.doInsOrder(id)); |
| | | public Result<?> doInsOrder(Integer id, String laboratory) { |
| | | return Result.success(insOrderPlanService.doInsOrder(id, laboratory)); |
| | | } |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "任务交接") |
| | | @PostMapping("/upPlanUser") |
| | | public Result<?> upPlanUser(Integer userId, Integer orderId) { |
| | | return Result.success(insOrderPlanService.upPlanUser(userId, orderId)); |
| | | } |
| | | @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)); |
| | | } |
| | | @ValueClassify("检验任务") |
| | | @ApiOperation(value = "检验任务提交") |
| | | @PostMapping("/submitPlan") |
| | | public Result<?> submitPlan(Integer orderId, String laboratory, Integer verifyUser) { |
| | | int num = insOrderPlanService.submitPlan(orderId, laboratory, verifyUser); |
| | | return num==1?Result.success():Result.fail("提交失败,部分项目还未进行检验"); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存检验内容") |
| | | @PostMapping("/saveInsContext") |
| | | @ValueAuth |
| | | public Result<?> saveInsContext(String param){ |
| | | Map<String, Object> param2 = JSON.parseObject(param, Map.class); |
| | | insOrderPlanService.saveInsContext(param2); |
| | | return Result.success(); |
| | | } |
| | | } |