|
|
|
@ -3,8 +3,13 @@ package com.aucma.report.service.impl;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import com.aucma.base.domain.BaseQualityInspectionItem;
|
|
|
|
|
import com.aucma.base.service.IBaseQualityInspectionItemService;
|
|
|
|
|
import com.aucma.common.utils.DateUtils;
|
|
|
|
|
import com.aucma.common.utils.uuid.UUID;
|
|
|
|
|
import com.aucma.report.domain.ReportQualityInspection;
|
|
|
|
|
import com.aucma.report.service.IMaterialCompletionService;
|
|
|
|
|
import com.aucma.report.service.IReportQualityInspectionService;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -33,6 +38,15 @@ public class RecordElectricalInspectionServiceImpl implements IRecordElectricalI
|
|
|
|
|
@Autowired
|
|
|
|
|
private RecordElectricalInspectionMapper recordElectricalInspectionMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IReportQualityInspectionService qualityInspectionService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IBaseQualityInspectionItemService itemService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMaterialCompletionService materialCompletionService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询电检数据记录
|
|
|
|
|
*
|
|
|
|
@ -141,6 +155,7 @@ public class RecordElectricalInspectionServiceImpl implements IRecordElectricalI
|
|
|
|
|
public HashMap<String, String> analysisElectricalInspectionData(Map paramMap) {
|
|
|
|
|
HashMap<String, String> resultData = new HashMap<>();
|
|
|
|
|
RecordElectricalInspection inspection = new RecordElectricalInspection();
|
|
|
|
|
ArrayList<DetailElectricalinspection> detailList = new ArrayList<>();
|
|
|
|
|
String uuid = String.valueOf(paramMap.get("uuid"));
|
|
|
|
|
try {
|
|
|
|
|
String result = String.valueOf(paramMap.get("result"));
|
|
|
|
@ -170,8 +185,10 @@ public class RecordElectricalInspectionServiceImpl implements IRecordElectricalI
|
|
|
|
|
testData.setTestresult(testDataParts[4]);
|
|
|
|
|
testData.setRecordtime(DateUtils.getNowDate());
|
|
|
|
|
recordElectricalInspectionMapper.insertDetailElectricalinspection(testData);
|
|
|
|
|
detailList.add(testData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.insertQualityInspectionByElectrical(inspection, detailList);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("解析电检数据接口数据:" + paramMap.toString() + ";异常:" + e);
|
|
|
|
|
}
|
|
|
|
@ -180,4 +197,69 @@ public class RecordElectricalInspectionServiceImpl implements IRecordElectricalI
|
|
|
|
|
return resultData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 电检结果存入质检数据
|
|
|
|
|
*
|
|
|
|
|
* @param inspectionInfo
|
|
|
|
|
* @param detailList
|
|
|
|
|
*/
|
|
|
|
|
private void insertQualityInspectionByElectrical(RecordElectricalInspection inspectionInfo, ArrayList<DetailElectricalinspection> detailList) {
|
|
|
|
|
if (StringUtils.isNull(inspectionInfo.getBarcode()) || StringUtils.isNull(detailList)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String barcode = inspectionInfo.getBarcode();
|
|
|
|
|
ReportQualityInspection qualityInspection = qualityInspectionService.selectReportQualityInspectionByBarcode(barcode);
|
|
|
|
|
if (StringUtils.isNull(qualityInspection)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//质检合格存入质检数据
|
|
|
|
|
if (StringUtils.isNotEmpty(inspectionInfo.getResult()) && inspectionInfo.getResult().equals("OK")) {
|
|
|
|
|
qualityInspection.setTreatmentMeasure("3");
|
|
|
|
|
qualityInspectionService.insertReportQualityInspection(qualityInspection);
|
|
|
|
|
materialCompletionService.inspectionProcessing(qualityInspection);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//质检不合格存入质检数据
|
|
|
|
|
for (DetailElectricalinspection detail : detailList) {
|
|
|
|
|
if (StringUtils.isNotEmpty(detail.getTestresult()) || detail.getTestresult().equals("OK")) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
String projectName = detail.getProjectname();
|
|
|
|
|
BaseQualityInspectionItem item = new BaseQualityInspectionItem();
|
|
|
|
|
String qualityDefectCode = null;
|
|
|
|
|
String qualityDefectName = null;
|
|
|
|
|
qualityInspection.setTestItemCode(qualityInspection.getStationCode());
|
|
|
|
|
if (projectName.equals("gnd")) {
|
|
|
|
|
item.setQualityDefectCode("5002");
|
|
|
|
|
List<BaseQualityInspectionItem> itemList = itemService.selectBaseQualityInspectionItemList(item);
|
|
|
|
|
qualityDefectCode = itemList.get(0).getQualityDefectCode();
|
|
|
|
|
qualityDefectName = itemList.get(0).getQualityDefectName();
|
|
|
|
|
}else if (projectName.equals("acw")){
|
|
|
|
|
item.setQualityDefectCode("5004");
|
|
|
|
|
List<BaseQualityInspectionItem> itemList = itemService.selectBaseQualityInspectionItemList(item);
|
|
|
|
|
qualityDefectCode = itemList.get(0).getQualityDefectCode();
|
|
|
|
|
qualityDefectName = itemList.get(0).getQualityDefectName();
|
|
|
|
|
}else if (projectName.equals("lvs")){
|
|
|
|
|
item.setQualityDefectCode("5001");
|
|
|
|
|
List<BaseQualityInspectionItem> itemList = itemService.selectBaseQualityInspectionItemList(item);
|
|
|
|
|
qualityDefectCode = itemList.get(0).getQualityDefectCode();
|
|
|
|
|
qualityDefectName = itemList.get(0).getQualityDefectName();
|
|
|
|
|
}else if (projectName.equals("ttl")){
|
|
|
|
|
item.setQualityDefectCode("5003");
|
|
|
|
|
List<BaseQualityInspectionItem> itemList = itemService.selectBaseQualityInspectionItemList(item);
|
|
|
|
|
qualityDefectCode = itemList.get(0).getQualityDefectCode();
|
|
|
|
|
qualityDefectName = itemList.get(0).getQualityDefectName();
|
|
|
|
|
}
|
|
|
|
|
qualityInspection.setQualityDefectCode(qualityDefectCode);
|
|
|
|
|
qualityInspection.setQualityDefectName(qualityDefectName);
|
|
|
|
|
qualityInspection.setTreatmentMeasure("1");
|
|
|
|
|
qualityInspection.setProcessResult("返修合格");
|
|
|
|
|
qualityInspection.setReworkNumber(1L);
|
|
|
|
|
qualityInspection.setFinishTime(DateUtils.getNowDate());
|
|
|
|
|
qualityInspection.setUpdatedBy(qualityInspection.getInspectorCode());
|
|
|
|
|
qualityInspection.setUpdatedTime(DateUtils.getNowDate());
|
|
|
|
|
qualityInspectionService.insertReportQualityInspection(qualityInspection);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|