change - 电检数据存到质检、过点数据工位

master
yinq 8 months ago
parent b3f8727e9c
commit df62f31f8d

@ -99,15 +99,4 @@ public class ReportQualityInspectionController extends BaseController {
public AjaxResult remove(@PathVariable Long[] objIds) {
return toAjax(reportQualityInspectionService.deleteReportQualityInspectionByObjIds(objIds));
}
/**
*
* @param temperatureHistory
* @return
*/
@PostMapping("/temperatureApi" )
public AjaxResult temperatureApi(BoxTemperatureHistory temperatureHistory) {
System.out.println(temperatureHistory.toString());
return success(null);
}
}

@ -68,4 +68,10 @@ public interface ReportQualityInspectionMapper
*/
public HashMap<String, Integer> pdaQueryQuantityNumber(String stationCode);
/**
*
* @param barcode
* @return
*/
ReportQualityInspection selectReportQualityInspectionByBarcode(String barcode);
}

@ -70,11 +70,9 @@ public interface IReportQualityInspectionService {
public HashMap<String, Integer> pdaQueryQuantityNumber(String reportQualityInspection);
/**
*
*
* @param reportQualityInspection
* @return
*
* @param barcode
* @return
*/
public int temperatureApi(BoxTemperatureHistory temperatureHistory);
public ReportQualityInspection selectReportQualityInspectionByBarcode(String barcode);
}

@ -2,7 +2,9 @@ package com.aucma.report.service.impl;
import java.util.List;
import com.aucma.common.utils.StringUtils;
import com.aucma.report.domain.ReportQualityInspection;
import com.aucma.report.service.IReportQualityInspectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.report.mapper.MaterialCompletionMapper;
@ -20,6 +22,9 @@ public class MaterialCompletionServiceImpl implements IMaterialCompletionService
@Autowired
private MaterialCompletionMapper materialCompletionMapper;
@Autowired
private IReportQualityInspectionService qualityInspectionService;
/**
*
*
@ -88,18 +93,21 @@ public class MaterialCompletionServiceImpl implements IMaterialCompletionService
/**
* 线
*
* @param inspection
*/
@Override
public void inspectionProcessing(ReportQualityInspection inspection) {
MaterialCompletion materialCompletion = new MaterialCompletion();
//质检转过点数据
// if (StringUtils.isNotEmpty(inspection.getBarCode())){
// //1001
// }
// materialCompletion.setOrderCode();
// materialCompletion.setPlanCode();
if (StringUtils.isNotEmpty(inspection.getBarCode())) {
ReportQualityInspection qualityInspection = qualityInspectionService.selectReportQualityInspectionByBarcode(inspection.getBarCode());
if (StringUtils.isNotEmpty(qualityInspection.getOrderCode())){
materialCompletion.setOrderCode(qualityInspection.getOrderCode());
}
}
materialCompletion.setMaterialBarcode(inspection.getBarCode());
materialCompletion.setMaterialCode(inspection.getBarCode().substring(7, 18));
materialCompletion.setMaterialName(inspection.getMaterialName());
materialCompletion.setStationName(inspection.getStationCode());
materialCompletion.setCompleteDate(inspection.getInspectorTime());

@ -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);
}
}
}

@ -104,15 +104,16 @@ public class ReportQualityInspectionServiceImpl implements IReportQualityInspect
}
/**
*
* @param temperatureHistory
*
* @param barcode
* @return
*/
@Override
public int temperatureApi(BoxTemperatureHistory temperatureHistory) {
return 1;
public ReportQualityInspection selectReportQualityInspectionByBarcode(String barcode) {
return reportQualityInspectionMapper.selectReportQualityInspectionByBarcode(barcode);
}

@ -29,6 +29,7 @@
<result property="processName" column="processName"/>
<result property="groupName" column="groupName"/>
<result property="inspectorName" column="inspectorName"/>
<result property="orderCode" column="ORDER_CODE"/>
</resultMap>
<sql id="selectReportQualityInspectionVo">
@ -207,6 +208,22 @@
</foreach>
</delete>
<select id="selectReportQualityInspectionByBarcode" parameterType="String"
resultMap="ReportQualityInspectionResult">
SELECT PB.MATERIAL_BARCODE BAR_CODE,
PB.ORDER_CODE,
ML.MATERIAL_NAME,
PS.PROCESS_CODE PROCESS_CODE,
'ZLJY-01' GROUP_CODE,
'djcj' INSPECTOR_CODE,
'2005' STATION_CODE,
SYSDATE INSPECTOR_TIME,
0 REWORK_NUMBER,
1 IS_FLAG
FROM C##AUCMA_SCADA.PRINT_BARCODE PB
JOIN C##AUCMA_MES.BASE_MATERIALINFO ML ON PB.MATERIAL_CODE = ML.MATERIAL_CODE
JOIN C##AUCMA_MES.BASE_PROCESS_STATION PS ON PROCESS_TYPE = 2 AND PS.PARENT_ID LIKE '%2005%'
WHERE PB.MATERIAL_BARCODE = #{barcode}
</select>
</mapper>
Loading…
Cancel
Save