|
|
|
@ -2906,6 +2906,470 @@ public class QcServiceImpl implements QcService { |
|
|
|
return importCount; |
|
|
|
} |
|
|
|
|
|
|
|
// ======================== IQC检验项目操作和模板导入 ======================== |
|
|
|
/** |
|
|
|
* 获取IQC检验项目列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Map<String, Object> getIQCItemList(Map<String, Object> params) { |
|
|
|
List<EamPropertiesItemData> availableItems = qcMapper.getIQCAvailableItems(params); |
|
|
|
List<EamPropertiesItemData> selectedItems = qcMapper.getIQCSelectedItems(params); |
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
result.put("code", 0); |
|
|
|
result.put("row1", availableItems); |
|
|
|
result.put("row2", selectedItems); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 添加IQC检验项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void addIQCItemDetails(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> itemList = (List<Map<String, Object>>) params.get("itemList"); |
|
|
|
|
|
|
|
if (itemList != null && !itemList.isEmpty()) { |
|
|
|
// 查询当前检验单是否已有检验项目 |
|
|
|
Map<String, Object> queryParams = new HashMap<>(); |
|
|
|
queryParams.put("site", site); |
|
|
|
queryParams.put("buNo", buNo); |
|
|
|
queryParams.put("inspectionNo", inspectionNo); |
|
|
|
List<EamPropertiesItemData> existingItems = qcMapper.getExistingIQCItems(queryParams); |
|
|
|
|
|
|
|
// 确定template_id和foreign_flag |
|
|
|
String templateId; |
|
|
|
String foreignFlag = "Y"; // 后来添加的项目标记为Y |
|
|
|
|
|
|
|
if (existingItems != null && !existingItems.isEmpty()) { |
|
|
|
templateId = existingItems.get(0).getTemplateId(); |
|
|
|
} else { |
|
|
|
templateId = "*"; |
|
|
|
} |
|
|
|
|
|
|
|
for (Map<String, Object> item : itemList) { |
|
|
|
Map<String, Object> insertParams = new HashMap<>(); |
|
|
|
insertParams.put("site", site); |
|
|
|
insertParams.put("buNo", buNo); |
|
|
|
insertParams.put("inspectionNo", inspectionNo); |
|
|
|
insertParams.put("itemNo", item.get("itemNo")); |
|
|
|
insertParams.put("templateId", templateId); |
|
|
|
insertParams.put("foreignFlag", foreignFlag); |
|
|
|
|
|
|
|
qcMapper.insertIQCItemDetail(insertParams); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除IQC检验项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void deleteIQCItemDetails(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> itemList = (List<Map<String, Object>>) params.get("itemList"); |
|
|
|
|
|
|
|
if (itemList != null && !itemList.isEmpty()) { |
|
|
|
for (Map<String, Object> item : itemList) { |
|
|
|
String itemNo = (String) item.get("itemNo"); |
|
|
|
|
|
|
|
Map<String, Object> deleteParams = new HashMap<>(); |
|
|
|
deleteParams.put("site", site); |
|
|
|
deleteParams.put("buNo", buNo); |
|
|
|
deleteParams.put("inspectionNo", inspectionNo); |
|
|
|
deleteParams.put("itemNo", itemNo); |
|
|
|
|
|
|
|
qcMapper.deleteIQCSubDetailByItem(deleteParams); |
|
|
|
qcMapper.deleteIQCItemDetail(deleteParams); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取IQC模板列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<Map<String, Object>> getIQCTemplateList(Map<String, Object> params) { |
|
|
|
return qcMapper.getIQCTemplateList(params); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 导入IQC模板项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public int importIQCTemplateItems(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> templateList = (List<Map<String, Object>>) params.get("templateList"); |
|
|
|
|
|
|
|
int importCount = 0; |
|
|
|
|
|
|
|
if (templateList != null && !templateList.isEmpty()) { |
|
|
|
Map<String, Object> queryParams = new HashMap<>(); |
|
|
|
queryParams.put("site", site); |
|
|
|
queryParams.put("buNo", buNo); |
|
|
|
queryParams.put("inspectionNo", inspectionNo); |
|
|
|
List<EamPropertiesItemData> existingItems = qcMapper.getExistingIQCItems(queryParams); |
|
|
|
|
|
|
|
String targetTemplateId; |
|
|
|
String foreignFlag = "Y"; |
|
|
|
|
|
|
|
if (existingItems != null && !existingItems.isEmpty()) { |
|
|
|
targetTemplateId = existingItems.get(0).getTemplateId(); |
|
|
|
} else { |
|
|
|
targetTemplateId = "*"; |
|
|
|
} |
|
|
|
|
|
|
|
for (Map<String, Object> template : templateList) { |
|
|
|
String templateId = (String) template.get("templateId"); |
|
|
|
|
|
|
|
Map<String, Object> templateItemParams = new HashMap<>(); |
|
|
|
templateItemParams.put("site", site); |
|
|
|
templateItemParams.put("buNo", buNo); |
|
|
|
templateItemParams.put("templateId", templateId); |
|
|
|
List<EamPropertiesItemData> templateItems = qcMapper.getTemplateItems(templateItemParams); |
|
|
|
|
|
|
|
List<String> existingItemNos = qcMapper.getExistingIQCItemNos(queryParams); |
|
|
|
|
|
|
|
for (EamPropertiesItemData item : templateItems) { |
|
|
|
if (existingItemNos.contains(item.getItemNo())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Object> insertParams = new HashMap<>(); |
|
|
|
insertParams.put("site", site); |
|
|
|
insertParams.put("buNo", buNo); |
|
|
|
insertParams.put("inspectionNo", inspectionNo); |
|
|
|
insertParams.put("itemNo", item.getItemNo()); |
|
|
|
insertParams.put("templateId", targetTemplateId); |
|
|
|
insertParams.put("foreignFlag", foreignFlag); |
|
|
|
|
|
|
|
qcMapper.insertIQCItemDetail(insertParams); |
|
|
|
importCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return importCount; |
|
|
|
} |
|
|
|
|
|
|
|
// ======================== FQC检验项目操作和模板导入 ======================== |
|
|
|
/** |
|
|
|
* 获取FQC检验项目列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Map<String, Object> getFQCItemList(Map<String, Object> params) { |
|
|
|
List<EamPropertiesItemData> availableItems = qcMapper.getFQCAvailableItems(params); |
|
|
|
List<EamPropertiesItemData> selectedItems = qcMapper.getFQCSelectedItems(params); |
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
result.put("code", 0); |
|
|
|
result.put("row1", availableItems); |
|
|
|
result.put("row2", selectedItems); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 添加FQC检验项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void addFQCItemDetails(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> itemList = (List<Map<String, Object>>) params.get("itemList"); |
|
|
|
|
|
|
|
if (itemList != null && !itemList.isEmpty()) { |
|
|
|
Map<String, Object> queryParams = new HashMap<>(); |
|
|
|
queryParams.put("site", site); |
|
|
|
queryParams.put("buNo", buNo); |
|
|
|
queryParams.put("inspectionNo", inspectionNo); |
|
|
|
List<EamPropertiesItemData> existingItems = qcMapper.getExistingFQCItems(queryParams); |
|
|
|
|
|
|
|
String templateId; |
|
|
|
String foreignFlag = "Y"; |
|
|
|
|
|
|
|
if (existingItems != null && !existingItems.isEmpty()) { |
|
|
|
templateId = existingItems.get(0).getTemplateId(); |
|
|
|
} else { |
|
|
|
templateId = "*"; |
|
|
|
} |
|
|
|
|
|
|
|
for (Map<String, Object> item : itemList) { |
|
|
|
Map<String, Object> insertParams = new HashMap<>(); |
|
|
|
insertParams.put("site", site); |
|
|
|
insertParams.put("buNo", buNo); |
|
|
|
insertParams.put("inspectionNo", inspectionNo); |
|
|
|
insertParams.put("itemNo", item.get("itemNo")); |
|
|
|
insertParams.put("templateId", templateId); |
|
|
|
insertParams.put("foreignFlag", foreignFlag); |
|
|
|
|
|
|
|
qcMapper.insertFQCItemDetail(insertParams); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除FQC检验项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void deleteFQCItemDetails(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> itemList = (List<Map<String, Object>>) params.get("itemList"); |
|
|
|
|
|
|
|
if (itemList != null && !itemList.isEmpty()) { |
|
|
|
for (Map<String, Object> item : itemList) { |
|
|
|
String itemNo = (String) item.get("itemNo"); |
|
|
|
|
|
|
|
Map<String, Object> deleteParams = new HashMap<>(); |
|
|
|
deleteParams.put("site", site); |
|
|
|
deleteParams.put("buNo", buNo); |
|
|
|
deleteParams.put("inspectionNo", inspectionNo); |
|
|
|
deleteParams.put("itemNo", itemNo); |
|
|
|
|
|
|
|
qcMapper.deleteFQCSubDetailByItem(deleteParams); |
|
|
|
qcMapper.deleteFQCItemDetail(deleteParams); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取FQC模板列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<Map<String, Object>> getFQCTemplateList(Map<String, Object> params) { |
|
|
|
return qcMapper.getFQCTemplateList(params); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 导入FQC模板项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public int importFQCTemplateItems(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> templateList = (List<Map<String, Object>>) params.get("templateList"); |
|
|
|
|
|
|
|
int importCount = 0; |
|
|
|
|
|
|
|
if (templateList != null && !templateList.isEmpty()) { |
|
|
|
Map<String, Object> queryParams = new HashMap<>(); |
|
|
|
queryParams.put("site", site); |
|
|
|
queryParams.put("buNo", buNo); |
|
|
|
queryParams.put("inspectionNo", inspectionNo); |
|
|
|
List<EamPropertiesItemData> existingItems = qcMapper.getExistingFQCItems(queryParams); |
|
|
|
|
|
|
|
String targetTemplateId; |
|
|
|
String foreignFlag = "Y"; |
|
|
|
|
|
|
|
if (existingItems != null && !existingItems.isEmpty()) { |
|
|
|
targetTemplateId = existingItems.get(0).getTemplateId(); |
|
|
|
} else { |
|
|
|
targetTemplateId = "*"; |
|
|
|
} |
|
|
|
|
|
|
|
for (Map<String, Object> template : templateList) { |
|
|
|
String templateId = (String) template.get("templateId"); |
|
|
|
|
|
|
|
Map<String, Object> templateItemParams = new HashMap<>(); |
|
|
|
templateItemParams.put("site", site); |
|
|
|
templateItemParams.put("buNo", buNo); |
|
|
|
templateItemParams.put("templateId", templateId); |
|
|
|
List<EamPropertiesItemData> templateItems = qcMapper.getTemplateItems(templateItemParams); |
|
|
|
|
|
|
|
List<String> existingItemNos = qcMapper.getExistingFQCItemNos(queryParams); |
|
|
|
|
|
|
|
for (EamPropertiesItemData item : templateItems) { |
|
|
|
if (existingItemNos.contains(item.getItemNo())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Object> insertParams = new HashMap<>(); |
|
|
|
insertParams.put("site", site); |
|
|
|
insertParams.put("buNo", buNo); |
|
|
|
insertParams.put("inspectionNo", inspectionNo); |
|
|
|
insertParams.put("itemNo", item.getItemNo()); |
|
|
|
insertParams.put("templateId", targetTemplateId); |
|
|
|
insertParams.put("foreignFlag", foreignFlag); |
|
|
|
|
|
|
|
qcMapper.insertFQCItemDetail(insertParams); |
|
|
|
importCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return importCount; |
|
|
|
} |
|
|
|
|
|
|
|
// ======================== OQC检验项目操作和模板导入 ======================== |
|
|
|
/** |
|
|
|
* 获取OQC检验项目列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Map<String, Object> getOQCItemList(Map<String, Object> params) { |
|
|
|
List<EamPropertiesItemData> availableItems = qcMapper.getOQCAvailableItems(params); |
|
|
|
List<EamPropertiesItemData> selectedItems = qcMapper.getOQCSelectedItems(params); |
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
result.put("code", 0); |
|
|
|
result.put("row1", availableItems); |
|
|
|
result.put("row2", selectedItems); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 添加OQC检验项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void addOQCItemDetails(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> itemList = (List<Map<String, Object>>) params.get("itemList"); |
|
|
|
|
|
|
|
if (itemList != null && !itemList.isEmpty()) { |
|
|
|
Map<String, Object> queryParams = new HashMap<>(); |
|
|
|
queryParams.put("site", site); |
|
|
|
queryParams.put("buNo", buNo); |
|
|
|
queryParams.put("inspectionNo", inspectionNo); |
|
|
|
List<EamPropertiesItemData> existingItems = qcMapper.getExistingOQCItems(queryParams); |
|
|
|
|
|
|
|
String templateId; |
|
|
|
String foreignFlag = "Y"; |
|
|
|
|
|
|
|
if (existingItems != null && !existingItems.isEmpty()) { |
|
|
|
templateId = existingItems.get(0).getTemplateId(); |
|
|
|
} else { |
|
|
|
templateId = "*"; |
|
|
|
} |
|
|
|
|
|
|
|
for (Map<String, Object> item : itemList) { |
|
|
|
Map<String, Object> insertParams = new HashMap<>(); |
|
|
|
insertParams.put("site", site); |
|
|
|
insertParams.put("buNo", buNo); |
|
|
|
insertParams.put("inspectionNo", inspectionNo); |
|
|
|
insertParams.put("itemNo", item.get("itemNo")); |
|
|
|
insertParams.put("templateId", templateId); |
|
|
|
insertParams.put("foreignFlag", foreignFlag); |
|
|
|
|
|
|
|
qcMapper.insertOQCItemDetail(insertParams); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除OQC检验项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void deleteOQCItemDetails(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> itemList = (List<Map<String, Object>>) params.get("itemList"); |
|
|
|
|
|
|
|
if (itemList != null && !itemList.isEmpty()) { |
|
|
|
for (Map<String, Object> item : itemList) { |
|
|
|
String itemNo = (String) item.get("itemNo"); |
|
|
|
|
|
|
|
Map<String, Object> deleteParams = new HashMap<>(); |
|
|
|
deleteParams.put("site", site); |
|
|
|
deleteParams.put("buNo", buNo); |
|
|
|
deleteParams.put("inspectionNo", inspectionNo); |
|
|
|
deleteParams.put("itemNo", itemNo); |
|
|
|
|
|
|
|
qcMapper.deleteOQCSubDetailByItem(deleteParams); |
|
|
|
qcMapper.deleteOQCItemDetail(deleteParams); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取OQC模板列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<Map<String, Object>> getOQCTemplateList(Map<String, Object> params) { |
|
|
|
return qcMapper.getOQCTemplateList(params); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 导入OQC模板项目 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public int importOQCTemplateItems(Map<String, Object> params) { |
|
|
|
String site = (String) params.get("site"); |
|
|
|
String buNo = (String) params.get("buNo"); |
|
|
|
String inspectionNo = (String) params.get("inspectionNo"); |
|
|
|
List<Map<String, Object>> templateList = (List<Map<String, Object>>) params.get("templateList"); |
|
|
|
|
|
|
|
int importCount = 0; |
|
|
|
|
|
|
|
if (templateList != null && !templateList.isEmpty()) { |
|
|
|
Map<String, Object> queryParams = new HashMap<>(); |
|
|
|
queryParams.put("site", site); |
|
|
|
queryParams.put("buNo", buNo); |
|
|
|
queryParams.put("inspectionNo", inspectionNo); |
|
|
|
List<EamPropertiesItemData> existingItems = qcMapper.getExistingOQCItems(queryParams); |
|
|
|
|
|
|
|
String targetTemplateId; |
|
|
|
String foreignFlag = "Y"; |
|
|
|
|
|
|
|
if (existingItems != null && !existingItems.isEmpty()) { |
|
|
|
targetTemplateId = existingItems.get(0).getTemplateId(); |
|
|
|
} else { |
|
|
|
targetTemplateId = "*"; |
|
|
|
} |
|
|
|
|
|
|
|
for (Map<String, Object> template : templateList) { |
|
|
|
String templateId = (String) template.get("templateId"); |
|
|
|
|
|
|
|
Map<String, Object> templateItemParams = new HashMap<>(); |
|
|
|
templateItemParams.put("site", site); |
|
|
|
templateItemParams.put("buNo", buNo); |
|
|
|
templateItemParams.put("templateId", templateId); |
|
|
|
List<EamPropertiesItemData> templateItems = qcMapper.getTemplateItems(templateItemParams); |
|
|
|
|
|
|
|
List<String> existingItemNos = qcMapper.getExistingOQCItemNos(queryParams); |
|
|
|
|
|
|
|
for (EamPropertiesItemData item : templateItems) { |
|
|
|
if (existingItemNos.contains(item.getItemNo())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, Object> insertParams = new HashMap<>(); |
|
|
|
insertParams.put("site", site); |
|
|
|
insertParams.put("buNo", buNo); |
|
|
|
insertParams.put("inspectionNo", inspectionNo); |
|
|
|
insertParams.put("itemNo", item.getItemNo()); |
|
|
|
insertParams.put("templateId", targetTemplateId); |
|
|
|
insertParams.put("foreignFlag", foreignFlag); |
|
|
|
|
|
|
|
qcMapper.insertOQCItemDetail(insertParams); |
|
|
|
importCount++; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return importCount; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取检验标准 |
|
|
|
*/ |
|
|
|
|