编辑时清空代替,被代替未删除对应标准
This commit is contained in:
+29
-1
@@ -1666,6 +1666,34 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
}
|
||||
}
|
||||
}
|
||||
if (null != beforeSarStandardsInfo) {
|
||||
String oldCiteStand = String.valueOf(beforeSarStandardsInfo.getAttrInfoMap().get("DTBJH"));
|
||||
if (StringUtils.isNotEmpty(oldCiteStand)) {
|
||||
String[] beforeEOrepNums = oldCiteStand.split(",");
|
||||
for (String beforeStr : beforeEOrepNums) {
|
||||
// 如果再旧的中包含,在新的中没有,需要删除,相关数据取第一条是因为标准号是唯一的
|
||||
sarStandardsSelectEO.setStandNumber(beforeStr);
|
||||
List<SarStandardsInfo> result = dao.selectStandardsByStandnumber(sarStandardsSelectEO);
|
||||
if (result != null && result.size() > 0) {
|
||||
String standId = result.get(0).getId();
|
||||
String field = "BDTBZH";
|
||||
String citedStand = sarStandAttrInfoEODao.selectFieldValByStandId(field, result.get(0).getId());
|
||||
String changeCitedStand = "";
|
||||
if (StringUtils.isNotBlank(citedStand)) {
|
||||
String[] beforerepalced = citedStand.split(",");
|
||||
ArrayList beforlist = new ArrayList<>(Arrays.asList(beforerepalced));
|
||||
if (beforlist.contains(beforeStrandNumber)) {
|
||||
beforlist.remove(beforeStrandNumber);
|
||||
changeCitedStand = StringUtils.join(beforlist.toArray(), ",");
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
sarStandAttrInfoEODao.updateStandInfo(standId, field, changeCitedStand);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1953,7 +1981,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
/**
|
||||
* 新增代替标准号修改其他被代替标准号
|
||||
*/
|
||||
updateCiteStand(sarStandardsInfoEO, null, "DTBZH", "BDTBZH");
|
||||
updateCiteStand(sarStandardsInfoEO, beforeSarStandardsInfo, "DTBZH", "BDTBZH");
|
||||
updateCiteStand(sarStandardsInfoEO, null, "BFDTBZ", "BBFDTBZ");
|
||||
// 根据对应其他标准修改其他对应其他标准
|
||||
// updateRelateStand(sarStandardsInfoEO, "CBBH");
|
||||
|
||||
Reference in New Issue
Block a user