update - 质量检测接口优化

master
yinq 2 days ago
parent 6c284589bc
commit 51dec5f9b3

@ -12,6 +12,8 @@ import com.aucma.report.domain.RecordExceptionProcess;
import com.aucma.report.domain.ReportQualityInspection; import com.aucma.report.domain.ReportQualityInspection;
import com.aucma.report.service.IMaterialCompletionService; import com.aucma.report.service.IMaterialCompletionService;
import com.aucma.report.service.IReportQualityInspectionService; import com.aucma.report.service.IReportQualityInspectionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -28,7 +30,7 @@ import static com.aucma.common.core.domain.AjaxResult.success;
@RestController @RestController
@RequestMapping("/api") @RequestMapping("/api")
public class PdaApiController { public class PdaApiController {
private static final Logger logger = LoggerFactory.getLogger(PdaApiController.class);
@Autowired @Autowired
private IPdaBindingService service; private IPdaBindingService service;
@ -89,31 +91,39 @@ public class PdaApiController {
/** /**
* *
*
* @param code * @param code
* @return * @return
*/ */
@PostMapping("/check/query") @PostMapping("/check/query")
public AjaxResult checkQuery(String code, String station) { public AjaxResult checkQuery(String code, String station) {
long begin = System.currentTimeMillis();
logger.info("质量检测checkQuery1:" + code + "工位: " + station);
String boxName = service.selectBoxNameByCode(code); String boxName = service.selectBoxNameByCode(code);
if (boxName == null) { if (boxName == null) {
// boxName = "固定数据"; // boxName = "固定数据";
return error("条码信息扫描错误!"); return error("条码信息扫描错误!");
} }
//检验前一工位是否已完成质检 //检验前一工位是否已完成质检
logger.info("质量检测checkQuery2:" + code + "工位:"+ station);
if (StringUtils.isNotEmpty(station)) { if (StringUtils.isNotEmpty(station)) {
//箱体发泡检验01工位 对 壳胆绑定进行验证 //箱体发泡检验01工位、二线箱体预装检验工位 对 壳胆绑定进行验证
if (station.equals("2003")){ if (station.equals("2003") || station.equals("2018") || station.equals("2103") || station.equals("2104")) {
String result = service.checkShellBinding(code, station); String result = service.checkShellBinding(code, station);
logger.info("质量检测checkQuery3:" + code + "工位:" + station);
if (StringUtils.isNotNull(result)) { if (StringUtils.isNotNull(result)) {
return error(result); return error(result);
} }
} }
String result = qualityService.checkBeforeStationInspection(code, station); String result = qualityService.checkBeforeStationInspection(code, station);
logger.info("质量检测checkQuery4:" + code + "工位:" + station);
if (StringUtils.isNotNull(result)) { if (StringUtils.isNotNull(result)) {
return error(result); return error(result);
} }
} }
List<ReportQualityInspection> list = service.checkSelectRepairInfo(code); List<ReportQualityInspection> list = service.checkSelectRepairInfo(code);
long end = System.currentTimeMillis();
logger.info("质量检测checkQuery5:" + code + "运行时间:" + (end - begin) + "工位:" + station);
return success(boxName, list); return success(boxName, list);
} }
@ -121,13 +131,16 @@ public class PdaApiController {
// 质检提交 // 质检提交
@PostMapping("/checkSubmit") @PostMapping("/checkSubmit")
public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo) { public AjaxResult checkSubmit(@RequestBody CheckInfoDto checkInfo) {
long begin = System.currentTimeMillis();
List<CheckInfoDto.DefectBeen> list = checkInfo.getList(); List<CheckInfoDto.DefectBeen> list = checkInfo.getList();
int size = (list == null || list.isEmpty()) ? 1 : list.size(); int size = (list == null || list.isEmpty()) ? 1 : list.size();
logger.info("质检提交checkSubmit1:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
ReportQualityInspection inspection = new ReportQualityInspection(); ReportQualityInspection inspection = new ReportQualityInspection();
inspection.setBarCode(checkInfo.getCode()); inspection.setBarCode(checkInfo.getCode());
String boxName = service.selectBoxNameBarCode(checkInfo.getCode()); String boxName = service.selectBoxNameBarCode(checkInfo.getCode());
logger.info("质检提交checkSubmit2:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
inspection.setMaterialName(boxName); inspection.setMaterialName(boxName);
String measure = checkInfo.getMeasure(); String measure = checkInfo.getMeasure();
@ -147,6 +160,7 @@ public class PdaApiController {
BaseProcessStation processStation = new BaseProcessStation(); BaseProcessStation processStation = new BaseProcessStation();
processStation.setParentId(checkInfo.getStationCode()); processStation.setParentId(checkInfo.getStationCode());
List<BaseProcessStation> processStations = baseProcessStationService.selectBaseProcessStationList(processStation); List<BaseProcessStation> processStations = baseProcessStationService.selectBaseProcessStationList(processStation);
logger.info("质检提交checkSubmit3:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
inspection.setProcessCode(processStations.get(0).getProcessCode()); inspection.setProcessCode(processStations.get(0).getProcessCode());
inspection.setProductLineName(processStations.get(0).getProductLineCode()); inspection.setProductLineName(processStations.get(0).getProductLineCode());
} catch (Exception e) { } catch (Exception e) {
@ -162,16 +176,19 @@ public class PdaApiController {
inspection.setQualityDefectName(list.get(i).getQualityDefectName()); inspection.setQualityDefectName(list.get(i).getQualityDefectName());
} }
qualityService.insertReportQualityInspection(inspection); qualityService.insertReportQualityInspection(inspection);
logger.info("质检提交checkSubmit4:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
//质检处理措施3=合格,1=返修) //质检处理措施3=合格,1=返修)
if (inspection.getTreatmentMeasure().equals("3")) { if (inspection.getTreatmentMeasure().equals("3")) {
try { try {
completionService.inspectionProcessing(inspection); completionService.inspectionProcessing(inspection);
logger.info("质检提交checkSubmit5:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
long end = System.currentTimeMillis();
logger.info("质量检测checkQuery6:" + checkInfo.getCode() + "运行时间:"+ (end - begin) + "工位:" + checkInfo.getStationCode());
return success(); return success();
} }
@ -248,6 +265,7 @@ public class PdaApiController {
/** /**
* PDA * PDA
*
* @param userName * @param userName
* @return * @return
*/ */
@ -262,6 +280,7 @@ public class PdaApiController {
/** /**
* PDA * PDA
*
* @param barCode * @param barCode
* @param stationCode * @param stationCode
* @return * @return
@ -277,6 +296,7 @@ public class PdaApiController {
/** /**
* PDA * PDA
*
* @param inspectionUserFlag (1=2=) * @param inspectionUserFlag (1=2=)
* @return * @return
*/ */

@ -65,17 +65,18 @@
<select id="checkSelectRepairInfo" resultMap="com.aucma.report.mapper.ReportQualityInspectionMapper.ReportQualityInspectionResult"> <select id="checkSelectRepairInfo" resultMap="com.aucma.report.mapper.ReportQualityInspectionMapper.ReportQualityInspectionResult">
select rqi.OBJ_ID, select rqi.OBJ_ID,
MATERIAL_NAME, rqi.MATERIAL_NAME,
TEST_ITEM_CODE as STATION_CODE, rqi.STATION_CODE as STATION_CODE,
QUALITY_DEFECT_CODE, rqi.QUALITY_DEFECT_CODE,
QUALITY_DEFECT_NAME, nvl(rqi.QUALITY_DEFECT_NAME,'完成') QUALITY_DEFECT_NAME,
nvl( PROCESS_RESULT,'未完成') as PROCESS_RESULT, nvl(rqi.PROCESS_RESULT, '未完成') as PROCESS_RESULT,
br.PRODUCT_LINE_NAME, br.PRODUCT_LINE_NAME,
rqi.INSPECTOR_TIME inspector_time rqi.INSPECTOR_TIME inspector_time
from REPORT_QUALITY_INSPECTION rqi from REPORT_QUALITY_INSPECTION rqi
left join BASE_PRODUCTLINE br on rqi.STATION_CODE=br.PRODUCT_LINE_CODE left join BASE_PRODUCTLINE br on rqi.STATION_CODE=br.PRODUCT_LINE_CODE
where BAR_CODE =#{code} where BAR_CODE =#{code}
and TREATMENT_MEASURE=1 and TREATMENT_MEASURE in (1, 3)
order by rqi.TREATMENT_MEASURE, rqi.INSPECTOR_TIME
</select> </select>
<select id="selectPrintBarcode" resultType="java.util.HashMap"> <select id="selectPrintBarcode" resultType="java.util.HashMap">

Loading…
Cancel
Save