| | |
| | | * @author zss |
| | | * @since 2023-08-01 13:52:30 |
| | | */ |
| | | @Api(tags = "QMS管理-->原材料检验-->检验项目") |
| | | @Api(tags = "QMS管理-->原材料检验") |
| | | @RestController |
| | | @RequestMapping("/rawInsProduct") |
| | | public class RawInsProductController { |
| | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "查询所有设备") |
| | | @ApiOperation(value = "选择设备") |
| | | @GetMapping("/selectDevice") |
| | | public Result selectDevice() { |
| | | return Result.success(deviceService.selectDevice()); |
| | | return Result.success(deviceService.chooseDevice()); |
| | | } |
| | | |
| | | @ApiOperation("选择设备信息") |
| | | @ApiOperation(value = "更新检验项目(填写检验值,检验设备)") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "设备ID", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "rpId", value = "原材料检验项目id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "testValue", value = "检测值", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "DevId", value = "设备id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/selectDeviceById") |
| | | public Result selectDeviceById(Integer id) { |
| | | return Result.success( deviceService.getDeviceNameById(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "更新检验项目") |
| | | @PostMapping("/updaterawInsProduct") |
| | | public Result updaterawInsProduct(@RequestHeader("token") String token, @RequestBody RawInsProduct rawInsProduct) throws Exception { |
| | | public Result updaterawInsProduct(@RequestHeader("token") String token,Integer rpId ,String testValue,Integer devId) throws Exception { |
| | | Map<String, String> map = jwt.readJWT(token); |
| | | String data = map.get("data"); |
| | | JSONObject jsonObject = new JSONObject(data); |
| | | int userId = Integer.parseInt(jsonObject.getString("id")); |
| | | rawInsProductService.updaterawInsProduct(userId,rawInsProduct); |
| | | rawInsProductService.updaterawInsProduct(userId,rpId,testValue,devId); |
| | | return Result.success(); |
| | | } |
| | | } |