249-配置标准bug修改

This commit is contained in:
liyawei
2022-11-17 13:42:02 +08:00
parent a41ec08f4f
commit 143719dccc
2 changed files with 51 additions and 20 deletions
@@ -62,6 +62,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.sf.json.JSONObject;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.json.JSONTokener;
import org.slf4j.Logger;
@@ -1333,6 +1334,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
String treeType = standardsInfoEO.getTreeType();
String menuName = standardsInfoEO.getMenuName();
sarStandMenuEO.setMenuId(nowMenuId);
QueryWrapper<SarBussStandMenu> queryWrapper = new QueryWrapper<>();
List<String> menuOldIds = new ArrayList<>();
for (int i = 0; i < standardsInfoEO.getIdlist().length; i++) {
String standId = standardsInfoEO.getIdlist()[i];
sarStandMenuEO.setBussStandId(standId);
@@ -1375,20 +1378,36 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
sarBussStandMenuEODao.deleteByStandIdAndMenuId(sarStandMenuDel);
int op = 0;
if (getInfo == null || getInfo.isEmpty()) {
sarStandMenuEO.setId(UUIDUtils.randomUUID20());
op = sarBussStandMenuEODao.insertSelective(sarStandMenuEO);
queryWrapper.lambda().eq(SarBussStandMenu::getBussStandId, standId);
List<SarBussStandMenu> oldList = sarBussStandMenuEODao.selectList(queryWrapper);
if (CollectionUtils.isNotEmpty(oldList)) {
menuOldIds = oldList.stream().map(SarBussStandMenu::getMenuId).collect(Collectors.toList());
if (!menuOldIds.contains(nowMenuId)) {
sarStandMenuEO.setId(UUIDUtils.randomUUID20());
op = sarBussStandMenuEODao.insertSelective(sarStandMenuEO);
}
}
} else {
sarStandMenuEO.setOldMenuId(secondLevelId);
List<String> menuOldIds = new ArrayList<>();
if(StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)) {
menuOldIds = iSarMenuStandardService.getChildMenuList(secondLevelId);
sarStandMenuEO.setMenuIds(menuOldIds);
sarStandMenuEO.setId(getInfo.get(0).getId());
op = sarBussStandMenuEODao.updateById(sarStandMenuEO);
}else {
menuOldIds= iTsResourceService.getChildMenuList(secondLevelId);
sarStandMenuEO.setMenuIds(menuOldIds);
op = sarBussStandMenuEODao.updateByStandIdAndMenuId(sarStandMenuEO);
// menuOldIds= iTsResourceService.getChildMenuList(secondLevelId);
// sarStandMenuEO.setMenuIds(menuOldIds);
// op = sarBussStandMenuEODao.updateByStandIdAndMenuId(sarStandMenuEO);
queryWrapper.lambda().eq(SarBussStandMenu::getBussStandId, standId);
List<SarBussStandMenu> oldList = sarBussStandMenuEODao.selectList(queryWrapper);
if (CollectionUtils.isNotEmpty(oldList)) {
menuOldIds = oldList.stream().map(SarBussStandMenu::getMenuId).collect(Collectors.toList());
if (!menuOldIds.contains(nowMenuId)) {
sarStandMenuEO.setId(UUIDUtils.randomUUID20());
op = sarBussStandMenuEODao.insertSelective(sarStandMenuEO);
}
}
}
}
if(StringUtils.isNotBlank(treeType) && "sarMs".equals(treeType)) {