|
|
|
@ -2252,12 +2252,14 @@ public class QcServiceImpl implements QcService { |
|
|
|
qcMapper.updateFAIDetailSubmitFlag(qcData); |
|
|
|
// 修改子明细记录标识为已提交 |
|
|
|
qcMapper.updateFAISubDetailSubmitFlag(qcData); |
|
|
|
} |
|
|
|
for (QcFAIRecordData recordData : data.getSubmitList()) { |
|
|
|
// 发送邮件 |
|
|
|
if ("不合格".equals(qcData.getInspectionResult())) { |
|
|
|
if ("不合格".equals(recordData.getInspectionResult())) { |
|
|
|
try { |
|
|
|
List<QcFAIRecordData> list = qcMapper.faiDetailSearch(qcData); |
|
|
|
qcData.setItemList(list); |
|
|
|
sendMail(qcData, "FAI"); |
|
|
|
List<QcFAIRecordData> list = qcMapper.faiDetailSearch(recordData); |
|
|
|
recordData.setItemList(list); |
|
|
|
sendMail(recordData, "FAI"); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.info(e.getMessage()); |
|
|
|
} |
|
|
|
@ -2839,12 +2841,14 @@ public class QcServiceImpl implements QcService { |
|
|
|
qcMapper.updateFQCDetailSubmitFlag(qcData); |
|
|
|
// 修改子明细记录标识为已提交 |
|
|
|
qcMapper.updateFQCSubDetailSubmitFlag(qcData); |
|
|
|
// 发送邮件 |
|
|
|
if ("不合格".equals(qcData.getInspectionResult())) { |
|
|
|
} |
|
|
|
// 发送邮件 |
|
|
|
for (QcFAIRecordData recordData : data.getSubmitList()) { |
|
|
|
if ("不合格".equals(recordData.getInspectionResult())) { |
|
|
|
try { |
|
|
|
List<QcFAIRecordData> list = qcMapper.fqcDetailSearch(qcData); |
|
|
|
qcData.setItemList(list); |
|
|
|
sendMail(qcData, "FQC"); |
|
|
|
List<QcFAIRecordData> list = qcMapper.fqcDetailSearch(recordData); |
|
|
|
recordData.setItemList(list); |
|
|
|
sendMail(recordData, "FQC"); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.info(e.getMessage()); |
|
|
|
} |
|
|
|
@ -3454,15 +3458,16 @@ public class QcServiceImpl implements QcService { |
|
|
|
qcMapper.updateIPQCDetailSubmitFlag(qcData); |
|
|
|
// 修改子明细记录标识为已提交 |
|
|
|
qcMapper.updateIPQCSubDetailSubmitFlag(qcData); |
|
|
|
// 发送邮件 |
|
|
|
if ("不合格".equals(qcData.getInspectionResult())) { |
|
|
|
} |
|
|
|
// 发送邮件 |
|
|
|
for (QcFAIRecordData recordData : data.getSubmitList()) { |
|
|
|
if ("不合格".equals(recordData.getInspectionResult())) { |
|
|
|
try { |
|
|
|
List<QcFAIRecordData> list = qcMapper.ipqcDetailSearch(qcData); |
|
|
|
qcData.setItemList(list); |
|
|
|
sendMail(qcData, "IPQC"); |
|
|
|
List<QcFAIRecordData> list = qcMapper.ipqcDetailSearch(recordData); |
|
|
|
recordData.setItemList(list); |
|
|
|
sendMail(recordData, "IPQC"); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.info(e.getMessage()); |
|
|
|
//throw new RuntimeException(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -4088,25 +4093,27 @@ public class QcServiceImpl implements QcService { |
|
|
|
qcMapper.updateIQCDetailSubmitFlag(qcData); |
|
|
|
// 修改子明细记录标识为已提交 |
|
|
|
qcMapper.updateIQCSubDetailSubmitFlag(qcData); |
|
|
|
} |
|
|
|
|
|
|
|
for (QcFAIRecordData recordData : data.getSubmitList()) { |
|
|
|
// 判断检验结论是否合格 |
|
|
|
if ("合格".equals(qcData.getInspectionResult()) || "让步接收".equals(qcData.getDisposalMeasures()) || "挑选使用".equals(qcData.getDisposalMeasures())) { |
|
|
|
if ("合格".equals(recordData.getInspectionResult()) || "让步接收".equals(recordData.getDisposalMeasures()) || "挑选使用".equals(recordData.getDisposalMeasures())) { |
|
|
|
// 根据 site、po_orderNo、po_itemNo 从 view_po_order 中查出数据 |
|
|
|
List<PoOrderData> poOrderData = qcMapper.queryDataFromViewPoOrder(qcData); |
|
|
|
List<PoOrderData> poOrderData = qcMapper.queryDataFromViewPoOrder(recordData); |
|
|
|
if (!poOrderData.isEmpty() && poOrderData.get(0) != null) { |
|
|
|
// 修改order_qty为送检数量 |
|
|
|
poOrderData.get(0).setOrderQty(qcData.getRollQty().toString()); |
|
|
|
poOrderData.get(0).setInspectionNo(qcData.getInspectionNo()); |
|
|
|
poOrderData.get(0).setOrderQty(recordData.getRollQty().toString()); |
|
|
|
poOrderData.get(0).setInspectionNo(recordData.getInspectionNo()); |
|
|
|
|
|
|
|
// 获取物料的 control_mes |
|
|
|
List<QcFAIRecordData> partInformationList = qcMapper.getPartInformation(qcData); |
|
|
|
List<QcFAIRecordData> partInformationList = qcMapper.getPartInformation(recordData); |
|
|
|
if (partInformationList.isEmpty()) { |
|
|
|
throw new RuntimeException("未查到该物料数据!"); |
|
|
|
} |
|
|
|
// control_mes 为 Y 的插入task表 |
|
|
|
if ("G".equals(partInformationList.get(0).getControlMes())) { |
|
|
|
// 获取接口时间 |
|
|
|
String interfaceDate = getInterfaceDate(qcData.getSite()); |
|
|
|
String interfaceDate = getInterfaceDate(recordData.getSite()); |
|
|
|
Date dateByParten = DateUtils.getStringToDate(interfaceDate, "yyyy-MM-dd"); |
|
|
|
//获取当前时间 |
|
|
|
String stringNow = DateUtils.getStringNow(); |
|
|
|
@ -4117,19 +4124,19 @@ public class QcServiceImpl implements QcService { |
|
|
|
throw new RuntimeException("获取收发类别失败!"); |
|
|
|
} |
|
|
|
String cdepcode = ""; |
|
|
|
if ("4".equals(qcData.getSite())){ |
|
|
|
if ("4".equals(recordData.getSite())){ |
|
|
|
cdepcode = "100"; |
|
|
|
} |
|
|
|
HardtagPurchaseInStorageCountData inStorageCountData = new HardtagPurchaseInStorageCountData(qcData.getSite(), qcData.getInspectionNo(), stringNow, data.getUpdateBy(), "0", toacc, stringDate, |
|
|
|
poOrderData.get(0).getOrderNo(), partInformationList.get(0).getDefaultWarehouseId(), rdstyleList.get(0).getCrdcode(), qcData.getInspectionNo(), DateUtils.getStringDate(dateByParten), "1", "", |
|
|
|
"1", poOrderData.get(0).getItemNo(), qcData.getPartNo(), qcData.getRollQty().doubleValue(), poOrderData.get(0).getCitemCode(), stringNow, "采购订单"); |
|
|
|
HardtagPurchaseInStorageCountData inStorageCountData = new HardtagPurchaseInStorageCountData(recordData.getSite(), recordData.getInspectionNo(), stringNow, data.getUpdateBy(), "0", toacc, stringDate, |
|
|
|
poOrderData.get(0).getOrderNo(), partInformationList.get(0).getDefaultWarehouseId(), rdstyleList.get(0).getCrdcode(), recordData.getInspectionNo(), DateUtils.getStringDate(dateByParten), "1", "", |
|
|
|
"1", poOrderData.get(0).getItemNo(), recordData.getPartNo(), recordData.getRollQty().doubleValue(), poOrderData.get(0).getCitemCode(), stringNow, "采购订单"); |
|
|
|
inStorageCountData.setTransType("采购材料订单入库"); |
|
|
|
inStorageCountData.setCdepcode(cdepcode); |
|
|
|
//批量添加汇总数据 |
|
|
|
int i = qcMapper.insertHardtagPurchaseInStorageData(inStorageCountData); |
|
|
|
|
|
|
|
//生成Transheader |
|
|
|
HardtagTransHeaderData inData = new HardtagTransHeaderData(qcData.getInspectionNo(),qcData.getSite(),partInformationList.get(0).getDefaultWarehouseId(),dateByParten,"CRT","采购材料订单入库",data.getUpdateBy(), |
|
|
|
HardtagTransHeaderData inData = new HardtagTransHeaderData(recordData.getInspectionNo(),recordData.getSite(),partInformationList.get(0).getDefaultWarehouseId(),dateByParten,"CRT","采购材料订单入库",data.getUpdateBy(), |
|
|
|
data.getUpdateBy(),0,0,"*","D","N","N",new Date(), |
|
|
|
"N",poOrderData.get(0).getOrderNo(),"Y","已录入",partInformationList.get(0).getDefaultWarehouseId(),"1","","", |
|
|
|
"","",""); |
|
|
|
@ -4138,7 +4145,7 @@ public class QcServiceImpl implements QcService { |
|
|
|
//保存transHeader数据 |
|
|
|
qcMapper.batchSaveHrdtagTransHeader(inData); |
|
|
|
|
|
|
|
HardtagTransDetailData hardtagTransDetailData = new HardtagTransDetailData(qcData.getInspectionNo(), qcData.getSite(), 1, qcData.getPartNo(), "", qcData.getRollQty(), "+", poOrderData.get(0).getOrderNo(), "0", poOrderData.get(0).getCitemCode()); |
|
|
|
HardtagTransDetailData hardtagTransDetailData = new HardtagTransDetailData(recordData.getInspectionNo(), recordData.getSite(), 1, recordData.getPartNo(), "", recordData.getRollQty(), "+", poOrderData.get(0).getOrderNo(), "0", poOrderData.get(0).getCitemCode()); |
|
|
|
//保存transDetail数据 |
|
|
|
qcMapper.batchSaveHardtagTransDetail(hardtagTransDetailData); |
|
|
|
} else { |
|
|
|
@ -4149,13 +4156,14 @@ public class QcServiceImpl implements QcService { |
|
|
|
throw new RuntimeException("未查询到采购订单!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
for (QcFAIRecordData recordData : data.getSubmitList()) { |
|
|
|
// 发送邮件 |
|
|
|
if ("不合格".equals(qcData.getInspectionResult())) { |
|
|
|
if ("不合格".equals(recordData.getInspectionResult())) { |
|
|
|
try { |
|
|
|
List<QcFAIRecordData> list = qcMapper.iqcDetailSearch(qcData); |
|
|
|
qcData.setItemList(list); |
|
|
|
sendMailIQC(qcData, "IQC"); |
|
|
|
List<QcFAIRecordData> list = qcMapper.iqcDetailSearch(recordData); |
|
|
|
recordData.setItemList(list); |
|
|
|
sendMailIQC(recordData, "IQC"); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.info(e.getMessage()); |
|
|
|
} |
|
|
|
|