|
|
|
@ -120,7 +120,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
double temp = threadSize - maxThreadSize; |
|
|
|
maxThreadSize = (int) (Math.ceil(temp / maxThreadSize) * maxThreadSize); |
|
|
|
} |
|
|
|
if(maxThreadSize < threadSize){ |
|
|
|
if (maxThreadSize < threadSize) { |
|
|
|
maxThreadSize = threadSize; |
|
|
|
} |
|
|
|
|
|
|
|
@ -246,7 +246,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
double temp = threadSize - maxThreadSize; |
|
|
|
maxThreadSize = (int) (Math.ceil(temp / maxThreadSize) * maxThreadSize); |
|
|
|
} |
|
|
|
if(maxThreadSize < threadSize){ |
|
|
|
if (maxThreadSize < threadSize) { |
|
|
|
maxThreadSize = threadSize; |
|
|
|
} |
|
|
|
|
|
|
|
@ -376,7 +376,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
double temp = threadSize - maxThreadSize; |
|
|
|
maxThreadSize = (int) (Math.ceil(temp / maxThreadSize) * maxThreadSize); |
|
|
|
} |
|
|
|
if(maxThreadSize < threadSize){ |
|
|
|
if (maxThreadSize < threadSize) { |
|
|
|
maxThreadSize = threadSize; |
|
|
|
} |
|
|
|
|
|
|
|
@ -747,7 +747,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
} |
|
|
|
} |
|
|
|
ExcelFileInfoPool.removeUserExcelInventoryInfo(number); |
|
|
|
log.info("【批量添加】批量添加数据:{}", JSON.toJSONString(excelVosForInventory) + ";导入人员" + userByPort.getName() + ":" + userByPort.getNumber()+";导入总数为:"+successCount); |
|
|
|
log.info("【批量添加】批量添加数据:{}", JSON.toJSONString(excelVosForInventory) + ";导入人员" + userByPort.getName() + ":" + userByPort.getNumber() + ";导入总数为:" + successCount); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -774,7 +774,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
} else { |
|
|
|
insert.put("materialTypeId", info.getParentId()); |
|
|
|
} |
|
|
|
successNum+=materialTypeService.insertMaterialType(insert); |
|
|
|
successNum += materialTypeService.insertMaterialType(insert); |
|
|
|
success.add(info); |
|
|
|
if ((i + 1) % 100 == 0 || excelVosForMaterialType.size() - 1 == i) { |
|
|
|
// 如果凑够100条或者已经循环完成 发送消息
|
|
|
|
@ -788,7 +788,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
|
|
|
|
} |
|
|
|
ExcelFileInfoPool.removeUserExcelMaterialTypeInfo(number); |
|
|
|
log.info("【批量添加】批量添加数据:{}", JSON.toJSONString(excelVosForMaterialType) + ";导入人员" + userByPort.getName() + ":" + userByPort.getNumber()+";导入总数"+successNum); |
|
|
|
log.info("【批量添加】批量添加数据:{}", JSON.toJSONString(excelVosForMaterialType) + ";导入人员" + userByPort.getName() + ":" + userByPort.getNumber() + ";导入总数" + successNum); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -825,7 +825,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
} |
|
|
|
OldIdList = (List<Long>) CollectionUtils.subtract(OldIdList, parentOldIdList); |
|
|
|
oldId = OldIdList.get(0); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
oldId = materialTypeByNames.get(0).getOldId(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -848,7 +848,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
} |
|
|
|
} |
|
|
|
ExcelFileInfoPool.removeUserExcelMaterialInfo(number); |
|
|
|
log.info("【批量添加】批量添加数据:{}", JSON.toJSONString(excelVosForMaterial) + ";导入人员" + userByPort.getName() + ":" + userByPort.getNumber()+";导入总数"+successNum); |
|
|
|
log.info("【批量添加】批量添加数据:{}", JSON.toJSONString(excelVosForMaterial) + ";导入人员" + userByPort.getName() + ":" + userByPort.getNumber() + ";导入总数" + successNum); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -1065,6 +1065,7 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
List<String> errMsg = new ArrayList<>(); |
|
|
|
for (int i = 0; i < excelInfoByMaterialS.size(); i++) { |
|
|
|
ExcelInfoForMaterial excelInfoForMaterial = excelInfoByMaterialS.get(i); |
|
|
|
log.info("处理的数据" + JSONObject.toJSONString(excelInfoForMaterial)); |
|
|
|
Map<String, Object> paramForMaterial = new HashMap<>(); |
|
|
|
String mname = excelInfoForMaterial.getMname(); |
|
|
|
if (mname == null) { |
|
|
|
@ -1075,8 +1076,8 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
} |
|
|
|
paramForMaterial.put("mname", mname); |
|
|
|
paramForMaterial.put("version", excelInfoForMaterial.getVersion()); |
|
|
|
Material material = materialMapper.findMaterialByMnameAndVersion(paramForMaterial); |
|
|
|
if (material != null) { |
|
|
|
List<Material> materials = materialMapper.findMaterialByMnameAndVersion(paramForMaterial); |
|
|
|
if (materials != null && materials.size() > 0) { |
|
|
|
String s = dataIndex.get(i); |
|
|
|
String msg = s + "出现异常,名称为:" + mname + ",型号为:" + excelInfoForMaterial.getVersion() + "的物料已存在"; |
|
|
|
errMsg.add(msg); |
|
|
|
@ -1115,7 +1116,9 @@ public class ExcelServiceImpl implements ExcelService { |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
ExcelFileInfoPool.getUserExcelMaterialInfo(userByPort.getNumber()).add(excelInfoForMaterial); |
|
|
|
log.info("添加的数据" + JSONObject.toJSONString(excelInfoForMaterial)); |
|
|
|
List<ExcelInfoForMaterial> userExcelMaterialInfo = ExcelFileInfoPool.getUserExcelMaterialInfo(userByPort.getNumber()); |
|
|
|
userExcelMaterialInfo.add(excelInfoForMaterial); |
|
|
|
} |
|
|
|
return errMsg; |
|
|
|
} |
|
|
|
|