package com.web.pda.lyt.lytPda.controller;
|
|
import com.app.base.control.WebController;
|
import com.app.base.data.ApiResponseResult;
|
import com.web.pda.lyt.lytPda.service.DefectInputService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.*;
|
|
@Api(description = "不良投入")
|
@CrossOrigin
|
@ControllerAdvice
|
//@RestController
|
@Controller
|
@RequestMapping(value = "defect_input")
|
public class DefectIputController extends WebController {
|
|
@Autowired
|
private DefectInputService defectInputService;
|
|
@ApiOperation(value = "获取出现频率最高排序不良类型", notes = "获取出现频率最高排序不良类型")
|
@RequestMapping(value = "/getDefect", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult getDefect(@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company,
|
@RequestParam(value = "procLine") String procLine) {
|
try {
|
return defectInputService.getDefect(factory,company,procLine);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "获取其他不良类型选择(低频率)", notes = "获取其他不良类型选择(低频率)")
|
@RequestMapping(value = "/getDefectOther", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult getDefectOther(@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company,
|
@RequestParam(value = "procLine") String procLine) {
|
try {
|
return defectInputService.getDefectOther(factory,company,procLine);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "获取其他不良类型选择(低频率)-查询", notes = "获取其他不良类型选择(低频率)-查询 ")
|
@RequestMapping(value = "/searchDefectOther", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult searchDefectOther(@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company,
|
@RequestParam(value = "procLine") String procLine,
|
@RequestParam(value = "keyword") String keyword) {
|
try {
|
return defectInputService.searchDefectOther(factory,company,procLine,keyword);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "获取设备编码", notes = "获取设备编码")
|
@RequestMapping(value = "/getDeviceCode", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult getDeviceCode() {
|
try {
|
return defectInputService.getDeviceCode();
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "获取工单", notes = "获取工单")
|
@RequestMapping(value = "/getTaskNo", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult getTaskNo(@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company,
|
@RequestParam(value = "procLine") String procLine,
|
@RequestParam(value = "keyword") String keyword) {
|
try {
|
return defectInputService.getTaskNo( factory, company, procLine, keyword);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "获取工序线体", notes = "获取工序线体")
|
@RequestMapping(value = "/getProcLine", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult getProcLine(@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company,
|
@RequestParam(value = "userNo") String userNo) {
|
try {
|
return defectInputService.getProcLine(factory,company,userNo);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "通过工号获取对应工序线体", notes = "通过工号获取对应工序线体")
|
@RequestMapping(value = "/getProcLineByUser", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult getProcLineByUser(@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company,
|
@RequestParam(value = "userNo") String userNo) {
|
try {
|
return defectInputService.getProcLineByUser(factory,company,userNo);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "获取投入明细", notes = "获取投入明细")
|
@RequestMapping(value = "/getRecord", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult getRecord(
|
@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company,
|
@RequestParam(value = "taskNo") String taskNo,
|
@RequestParam(value = "procLine") String procLine,
|
@RequestParam(value = "devCode") String devCode) {
|
try {
|
return defectInputService.getRecord( factory, company, taskNo,procLine, devCode);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "保存结果", notes = "保存结果")
|
@RequestMapping(value = "/setDefectData", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult setDefectData(
|
@RequestParam(value = "userNo") String userNo,
|
@RequestParam(value = "taskNo") String taskNo,
|
@RequestParam(value = "procLine") String procLine,
|
@RequestParam(value = "defCode") String defCode,
|
@RequestParam(value = "num") int num,
|
@RequestParam(value = "type") int type,
|
@RequestParam(value = "devCode") String devCode,
|
@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company) {
|
try {
|
return defectInputService.setDefectData(userNo, taskNo, procLine,defCode,num,type,devCode,factory,company);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
|
@ApiOperation(value = "获取不良列表及明细", notes = "获取不良列表及明细")
|
@RequestMapping(value = "/getBadList", method = RequestMethod.POST, produces = "application/json")
|
@ResponseBody
|
public ApiResponseResult getBadList(
|
@RequestParam(value = "factory") String factory,
|
@RequestParam(value = "company") String company,
|
@RequestParam(value = "keyword") String keyword,
|
@RequestParam(value = "releaseNo") String releaseNo,
|
@RequestParam(value = "size") int size,
|
@RequestParam(value = "page") int page) {
|
try {
|
return defectInputService.getBadList(factory, company, keyword,releaseNo,size,page);
|
} catch (Exception e) {
|
e.printStackTrace();
|
return ApiResponseResult.failure(e.toString());
|
}
|
}
|
}
|