| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.enums.InterfaceType; |
| | | import com.yuanchu.limslaboratory.enums.MenuEnums; |
| | | import com.yuanchu.limslaboratory.mapper.InstrumentMapper; |
| | | import com.yuanchu.limslaboratory.mapper.UserMapper; |
| | | import com.yuanchu.limslaboratory.pojo.Inspection; |
| | | import com.yuanchu.limslaboratory.pojo.Report; |
| | |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Resource |
| | | private InstrumentMapper instrumentMapper; |
| | | |
| | | @ApiOperation(value = "查询检验申请单列表") |
| | | @ApiImplicitParams(value = { |
| | |
| | | |
| | | @ApiOperation(value = "新增检验单") |
| | | @PostMapping("/addInspect") |
| | | public Result addInspect(@RequestHeader("token") String token, @Validated @RequestBody InspectionVo inspectionVo) throws Exception { |
| | | @AuthHandler |
| | | public Result addInspect(@RequestHeader("X-Token") String token, @Validated @RequestBody InspectionVo inspectionVo) throws Exception { |
| | | Object object = RedisUtil.get(token); |
| | | Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class); |
| | | return Result.success(inspectionService.addInspect((Integer) unmarshal.get("id"), inspectionVo)); |
| | |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectInspectsListById") |
| | | @AuthHandler |
| | | public Result selectInspectsListById(Integer id) { |
| | | return Result.success(inspectionService.selectInspectsListById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "选择检验项目的责任人") |
| | | @GetMapping("/selectUser") |
| | | @AuthHandler |
| | | public Result selectUser() { |
| | | return Result.success(userMapper.selectUser()); |
| | | } |
| | | |
| | | @ApiOperation(value = "选择检验设备") |
| | | @GetMapping("/selectEquipment") |
| | | @AuthHandler |
| | | public Result selectEquipment(){return Result.success(instrumentMapper.getInstrument());} |
| | | |
| | | @ApiOperation(value = "保存检验项目责任人") |
| | | @ApiImplicitParams(value = { |
| | |
| | | @ApiImplicitParam(name = "userProId", value = "责任人id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseUseProId") |
| | | @AuthHandler |
| | | public Result chooseUseProId(Integer id, Integer userProId) { |
| | | return Result.success(inspectionService.chooseUseProId(id, userProId)); |
| | | } |
| | | |
| | | @ApiOperation("保存设备id") |
| | | @GetMapping("/chooseEquipment") |
| | | @AuthHandler |
| | | public Result chooseEquipment(Integer id,Integer equipmentId){ |
| | | return Result.success(inspectionService.chooseEquipment(id, equipmentId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "作废检验单") |
| | |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delInspect") |
| | | @AuthHandler |
| | | public Result delInspect(Integer id) { |
| | | return Result.success(inspectionService.delInspect(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取成品信息") |
| | | @PostMapping("/getMaterielTypeIsOne") |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.inspectionApplication,isAdd = true) |
| | | public Result getMaterielTypeIsOne(){ |
| | | return Result.success(inspectionService.getMaterielTypeIsOne()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "根据成品获取规格型号") |
| | | @PostMapping("/getSpecificationByMaterielId") |
| | | @AuthHandler(type = InterfaceType.SELECT,menuId = MenuEnums.inspectionApplication,isAdd = true) |
| | | public Result getSpecification(Integer id){ |
| | | return Result.success(inspectionService.getSpecification(id)); |
| | | } |
| | | } |
| | | |