| | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.InspectionItemDto; |
| | | import com.yuanchu.mom.pojo.dto.UpdateInspectionItemDto; |
| | | import com.yuanchu.mom.service.DeviceService; |
| | | import com.yuanchu.mom.service.InspectionItemService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author 江苏鵷雏网络科技有限公司 |
| | | * @since 2023-08-01 |
| | | */ |
| | | @Api(tags = "QMS管理-->成品检验") |
| | | @Api(tags = "QMS管理-->成品过程检验项目") |
| | | @RestController |
| | | @RequestMapping("/inspection-item") |
| | | public class InspectionItemController { |
| | |
| | | @Autowired |
| | | private InspectionItemService inspectionItemService; |
| | | |
| | | @Resource |
| | | DeviceService deviceService; |
| | | |
| | | |
| | | @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 = "新增检验单-->选择检验设备") |
| | | @GetMapping("/chooseDev") |
| | | public Result<?> chooseDev() { |
| | | return Result.success(deviceService.chooseDevice()); |
| | | } |
| | | |
| | | @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(); |
| | | } |
| | | |
| | | } |