| | |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.mapper.UserMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | | import com.yuanchu.limslaboratory.pojo.vo.InspectionVo; |
| | |
| | | @Resource |
| | | LinkBasicInformationService linkBasicInformationService; |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @ApiOperation(value = "查询检验申请单列表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页数", dataTypeClass = Integer.class, required = true), |
| | |
| | | case 0: |
| | | //原材料 |
| | | return Result.success(rawMaterialService.selectRawmaAll()); |
| | | case 1: |
| | | case 2: |
| | | //委托单 |
| | | return Result.success(linkBasicInformationService.selectLinkAll()); |
| | | case 2: |
| | | case 1: |
| | | //成品检验 |
| | | return Result.success("请输入检验信息!"); |
| | | } |
| | |
| | | return Result.success(inspectionService.addInspect((Integer) unmarshal.get("id"), inspectionVo)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据检验单id查询原材料检验单详情") |
| | | @ApiOperation(value = "根据检验单id查询检验单详情") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | |
| | | return Result.success(inspectionService.selectInspectsListById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "上报(更新检验状态)") |
| | | @ApiOperation(value = "选择检验项目的责任人") |
| | | @GetMapping("/selectUser") |
| | | public Result selectUser() { |
| | | return Result.success(userMapper.selectUser()); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存检验项目责任人") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验单项目id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "userProId", value = "责任人id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseUseProId") |
| | | public Result chooseUseProId(Integer id,Integer userProId) { |
| | | return Result.success(inspectionService.chooseUseProId(id,userProId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "作废检验单") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/updateInspectsById") |
| | | public Result updateInspectsById(Integer id) { |
| | | //如果已经上报了不能再一次上报 |
| | | Inspection inspection = inspectionService.getById(id); |
| | | if (ObjectUtils.isNotEmpty(inspection.getInspectionStatus())) { |
| | | return Result.fail("已经上报过了,不能再次上报!"); |
| | | } |
| | | return Result.success(inspectionService.updateInspectsById(id)); |
| | | @PostMapping("/delInspect") |
| | | public Result delInspect(Integer id) { |
| | | return Result.success(inspectionService.delInspect(id)); |
| | | } |
| | | |
| | | |
| | | } |
| | | |