fix: 修复

dev_unify
chenhc 5 months ago
parent 011d559cfa
commit 3eee851ec1

@ -55,64 +55,64 @@ public class ThirdAliDrugService extends ServiceImpl<ThirdAliDrugMapper, ThirdAl
String[] fields = fillEmptyParts(line);
Date createTime = new Date();
if (fields.length == 9) {
ThirdAliDrug medicine = new ThirdAliDrug(
fields[0].trim(),
fields[1].trim(),
fields[2].trim(),
fields[3].trim(),
fields[4].trim(),
fields[5].trim(),
fields[5].trim(),
fields[5].trim(),
fields[6].trim(),
fields[7].trim(),
fields[8].trim(),
createTime,
createTime
);
if (StrUtil.isNotEmpty(medicine.getNameCode())) {
int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
if (i == 0) {
medicine.setErpId(customerId);
thirdAliDrugs.add(medicine);
if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
thirdAliDrugs.clear();
}
}
}
}else
if (fields.length == 10) {
ThirdAliDrug medicine = new ThirdAliDrug(
fields[0].trim(),
fields[1].trim(),
fields[2].trim(),
fields[3].trim(),
fields[4].trim(),
fields[4].trim(),
fields[6].trim(),
fields[6].trim(),
fields[7].trim(),
fields[8].trim(),
fields[9].trim(),
createTime,
createTime
);
if (StrUtil.isNotEmpty(medicine.getNameCode())) {
int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
if (i == 0) {
medicine.setErpId(customerId);
thirdAliDrugs.add(medicine);
if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
thirdAliDrugs.clear();
}
}
}
}else
// if (fields.length == 9) {
// ThirdAliDrug medicine = new ThirdAliDrug(
// fields[0].trim(),
// fields[1].trim(),
// fields[2].trim(),
// fields[3].trim(),
// fields[4].trim(),
// fields[5].trim(),
// fields[5].trim(),
// fields[5].trim(),
// fields[6].trim(),
// fields[7].trim(),
// fields[8].trim(),
// createTime,
// createTime
// );
//
// if (StrUtil.isNotEmpty(medicine.getNameCode())) {
// int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
// if (i == 0) {
// medicine.setErpId(customerId);
// thirdAliDrugs.add(medicine);
// if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
// this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
// thirdAliDrugs.clear();
// }
// }
// }
// }else
// if (fields.length == 10) {
// ThirdAliDrug medicine = new ThirdAliDrug(
// fields[0].trim(),
// fields[1].trim(),
// fields[2].trim(),
// fields[3].trim(),
// fields[4].trim(),
// fields[4].trim(),
// fields[6].trim(),
// fields[6].trim(),
// fields[7].trim(),
// fields[8].trim(),
// fields[9].trim(),
// createTime,
// createTime
// );
//
// if (StrUtil.isNotEmpty(medicine.getNameCode())) {
// int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
// if (i == 0) {
// medicine.setErpId(customerId);
// thirdAliDrugs.add(medicine);
// if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
// this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
// thirdAliDrugs.clear();
// }
// }
// }
// }else
if (fields.length == 11) {
ThirdAliDrug medicine = new ThirdAliDrug(
fields[0].trim(),
@ -141,34 +141,35 @@ public class ThirdAliDrugService extends ServiceImpl<ThirdAliDrugMapper, ThirdAl
}
}
}
}else if (fields.length > 11) {
ThirdAliDrug medicine = new ThirdAliDrug(
fields[0].trim(),
fields[1].trim(),
fields[2].trim(),
fields[3].trim(),
fields[4].trim(),
fields[5].trim(),
fields[7].trim(),
fields[8].trim(),
fields[9].trim(),
fields[10].trim(),
fields[11].trim(),
createTime,
createTime
);
if (StrUtil.isNotEmpty(medicine.getNameCode())) {
int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
if (i == 0) {
thirdAliDrugs.add(medicine);
if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
thirdAliDrugs.clear();
}
}
}
}
// else if (fields.length > 11) {
// ThirdAliDrug medicine = new ThirdAliDrug(
// fields[0].trim(),
// fields[1].trim(),
// fields[2].trim(),
// fields[3].trim(),
// fields[4].trim(),
// fields[5].trim(),
// fields[7].trim(),
// fields[8].trim(),
// fields[9].trim(),
// fields[10].trim(),
// fields[11].trim(),
// createTime,
// createTime
// );
//
// if (StrUtil.isNotEmpty(medicine.getNameCode())) {
// int i = this.baseMapper.selectDrugsByNameCodes(medicine.getNameCode());
// if (i == 0) {
// thirdAliDrugs.add(medicine);
// if (CollUtil.isNotEmpty(thirdAliDrugs) && thirdAliDrugs.size() >= 500) {
// this.baseMapper.saveOrUpdateBatch(thirdAliDrugs);
// thirdAliDrugs.clear();
// }
// }
// }
// }
}
} catch (IOException e) {
throw new JsonException("上传失败:" + "标识重复");

Loading…
Cancel
Save