|
|
@@ -790,7 +790,16 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
|
|
|
if (obj != 1) {
|
|
|
throw new ServiceException(StringUtil.format("未获取到 {} 对应实体表信息,关联失败", wbsTree.getNodeName()));
|
|
|
}
|
|
|
-
|
|
|
+ //查询清表细信息
|
|
|
+ ExcelTab excelTab = excelTabMapper.selectById(formElementDTO.getExcelTabId());
|
|
|
+ if(StringUtils.isNotEmpty(excelTab.getTabId()) && !excelTab.getTabId().equals(wbsTree.getInitTableId().toString())){
|
|
|
+ throw new ServiceException(StringUtil.format("当前清表与元素表不一致,无法关联"));
|
|
|
+ }
|
|
|
+ //如果没有 就设置清表的tab_id为选择元素表的tab_id
|
|
|
+ if(StringUtils.isEmpty(excelTab.getTabId())){
|
|
|
+ excelTab.setTabId(wbsTree.getInitTableId().toString());
|
|
|
+ excelTabMapper.updateById(excelTab);
|
|
|
+ }
|
|
|
//获取当前元素表与清表关系信息
|
|
|
List<WbsTabRelationExcelTab> list = baseMapper.selectWbsTabRelationExcelTab(String.valueOf(formElementDTO.getId()), String.valueOf(formElementDTO.getExcelTabId()));
|
|
|
if (list.size() <= 0) {
|