| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 江苏鵷雏网络科技有限公司 |
| | | * @since 2023-08-01 |
| | | */ |
| | | @Api(tags = "QMS管理-->成品检验") |
| | | @Api(tags = "QMS管理-->成品过程检验项目") |
| | | @RestController |
| | | @RequestMapping("/inspection-item") |
| | | public class InspectionItemController { |
| | |
| | | @Autowired |
| | | private InspectionItemService inspectionItemService; |
| | | |
| | | |
| | | @Autowired |
| | | private Jwt jwt; |
| | | |
| | | @ApiOperation(value = "新增按钮-->2、查询所有检验项目") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "finishInspectId",value = "成品检验单Id",dataTypeClass = Integer.class,required = true) |
| | | @ApiImplicitParam(name = "id", value = "检验单Id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "类型", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/list_user") |
| | | public Result<?> selectInspectionItem(Integer finishInspectId){ |
| | | List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(finishInspectId); |
| | | public Result<?> selectInspectionItem(Integer id, Integer type) { |
| | | List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(id, type); |
| | | return Result.success(inspectionItemDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增按钮-->2、检验项目-->失去焦点发起该请求") |
| | | @ApiOperation(value = "新增检验单-->选择设备") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "关联的工艺路线id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "father", value = "项目父名称", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "name", value = "项目名称", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseDev") |
| | | public Result<?> chooseDev(Integer technologyId, String father, String name) { |
| | | return Result.success(inspectionItemService.chooseDev(technologyId, father, name)); |
| | | } |
| | | |
| | | @ApiOperation(value = "检验项目的检验值-->失去焦点发起该请求") |
| | | @PostMapping("/lose_focus_update") |
| | | public Result<?> addInspectionItem(@RequestHeader("token")String token, @RequestBody UpdateInspectionItemDto updateInspectionItemDto) throws Exception { |
| | | public Result<?> addInspectionItem(@RequestHeader("token") String token, @RequestBody UpdateInspectionItemDto updateInspectionItemDto) throws Exception { |
| | | Map<String, String> usernameMessage = jwt.readJWT(token); |
| | | Map<String, Object> usernameAndId = JackSonUtil.unmarshal(usernameMessage.get("data"), Map.class); |
| | | String name = usernameAndId.get("name").toString().replaceAll("\"", ""); |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增按钮-->2、检验项目-->试验设备下拉框") |
| | | @GetMapping("/list_device") |
| | | public Result<?> selectDeviceIdAndName(){ |
| | | List<Map<String, Object>> maps = inspectionItemService.selectDeviceIdAndName(); |
| | | return Result.success(maps); |
| | | @ApiOperation(value = "更改设备") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验单Id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "类型", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "DevId", value = "设备id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/updateDevByInsId") |
| | | public Result updateDevByInsId(Integer id, Integer type, Integer devId) { |
| | | inspectionItemService.updateDevByInsId(id, type, devId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |