|
|
|
@ -6,8 +6,11 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.organization.entity.DeleteParam;
|
|
|
|
|
import com.engine.organization.entity.extend.bo.ExtendGroupBO;
|
|
|
|
|
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendInfoFieldParam;
|
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendTitleSaveParam;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendTitlePO;
|
|
|
|
|
import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam;
|
|
|
|
|
import com.engine.organization.entity.fieldset.vo.TypeTreeVO;
|
|
|
|
@ -65,9 +68,9 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|
|
|
|
tab.put("tabkey", idx++);
|
|
|
|
|
tab.put("title", extendTitle.getTitle());
|
|
|
|
|
tab.put("isShow", extendTitle.getIsShow());
|
|
|
|
|
tab.put("groupid", extendTitle.getGroupId());
|
|
|
|
|
tab.put("groupid", extendTitle.getId());
|
|
|
|
|
tab.put("viewAttr", extendTitle.getGroupId() < 0 ? 1 : 2);
|
|
|
|
|
tab.put("editable", !(getExtendInfoMapper().countFieldsByGroupId(extendTitle.getId()) > 0));
|
|
|
|
|
tab.put("editable", getExtendInfoMapper().countFieldsByGroupId(extendTitle.getId()) == 0);
|
|
|
|
|
tabs.add(tab);
|
|
|
|
|
}
|
|
|
|
|
datas.put("status", "1");
|
|
|
|
@ -84,15 +87,26 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|
|
|
|
// extend_group主键
|
|
|
|
|
Long groupType = jsonObject.getLong("groupType");
|
|
|
|
|
ExtendGroupPO extendGroup = getExtendGroupMapper().getGroupById(groupType);
|
|
|
|
|
Integer extendType = extendGroup.getExtendType();
|
|
|
|
|
String tableName = ExtendGroupBO.getTableNameByGroupPO(extendGroup);
|
|
|
|
|
|
|
|
|
|
// 主表、主表拓展表为extend_title主键;明细表为extend_group主键
|
|
|
|
|
Long extendGroupId = jsonObject.getLong("groupId");
|
|
|
|
|
|
|
|
|
|
JSONArray records = (JSONArray) jsonObject.get("records");
|
|
|
|
|
for (int i = 0; i < records.size(); i++) {
|
|
|
|
|
// 存在ID则更新 ,不存在ID则增加
|
|
|
|
|
ExtendInfoFieldParam infoFieldParam = JSONObject.toJavaObject((JSONObject) records.get(i), ExtendInfoFieldParam.class);
|
|
|
|
|
// TODO
|
|
|
|
|
ExtendInfoPO extendInfo = ExtendInfoBO.convertFieldParam2ExtendInfo(user, infoFieldParam, extendGroup, extendGroupId, i + 1);
|
|
|
|
|
|
|
|
|
|
if (null != extendInfo.getId()) {
|
|
|
|
|
// 更新 extend_title数据
|
|
|
|
|
getExtendInfoMapper().updateExtendInfo(extendInfo);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
// 新增extend_title数据
|
|
|
|
|
|
|
|
|
|
// 新增表结构
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
@ -176,6 +190,7 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteTitle(ExtendTitleSaveParam param) {
|
|
|
|
|
int countFields = getExtendInfoMapper().countFieldsByGroupId(param.getGroupType());
|
|
|
|
@ -214,7 +229,4 @@ public class FieldDefinedServiceImpl extends Service implements FieldDefinedServ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|