|
|
@ -11,25 +11,37 @@ import com.api.browser.util.BrowserInitUtil;
|
|
|
|
import com.api.browser.util.ConditionFactory;
|
|
|
|
import com.api.browser.util.ConditionFactory;
|
|
|
|
import com.api.browser.util.ConditionType;
|
|
|
|
import com.api.browser.util.ConditionType;
|
|
|
|
import com.api.hrm.bean.FieldItem;
|
|
|
|
import com.api.hrm.bean.FieldItem;
|
|
|
|
import com.api.hrm.util.FieldType;
|
|
|
|
import com.api.hrm.bean.HrmFieldBean;
|
|
|
|
import com.api.hrm.util.ServiceUtil;
|
|
|
|
import com.api.hrm.util.*;
|
|
|
|
|
|
|
|
import com.cloudstore.dev.api.util.TextUtil;
|
|
|
|
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
|
|
|
|
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
|
|
|
|
import com.engine.organization.entity.SelectOptionParam;
|
|
|
|
import com.engine.organization.entity.SelectOptionParam;
|
|
|
|
|
|
|
|
import com.engine.organization.entity.browser.po.CustomBrowserBean;
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendInfoFieldParam;
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendInfoFieldParam;
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendGroupPO;
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
import com.engine.organization.mapper.extend.ExtendInfoMapper;
|
|
|
|
import com.engine.organization.mapper.extend.ExtendInfoMapper;
|
|
|
|
import com.engine.organization.entity.browser.po.CustomBrowserBean;
|
|
|
|
|
|
|
|
import com.engine.organization.util.OrganizationFormItemUtil;
|
|
|
|
import com.engine.organization.util.OrganizationFormItemUtil;
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
import com.engine.sensitive.biz.SensitiveWordTypeComInfo;
|
|
|
|
import com.engine.sensitive.biz.SensitiveWordTypeComInfo;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
import weaver.common.StringUtil;
|
|
|
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
|
|
|
import weaver.docs.docs.CustomFieldManager;
|
|
|
|
|
|
|
|
import weaver.encrypt.EncryptUtil;
|
|
|
|
import weaver.file.ImageFileManager;
|
|
|
|
import weaver.file.ImageFileManager;
|
|
|
|
|
|
|
|
import weaver.general.BaseBean;
|
|
|
|
import weaver.general.Util;
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
import weaver.hrm.HrmUserVarify;
|
|
|
|
import weaver.hrm.User;
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
|
import weaver.hrm.definedfield.HrmFieldGroupComInfo;
|
|
|
|
import weaver.hrm.definedfield.HrmFieldManager;
|
|
|
|
import weaver.hrm.definedfield.HrmFieldManager;
|
|
|
|
|
|
|
|
import weaver.hrm.moduledetach.ManageDetachComInfo;
|
|
|
|
|
|
|
|
import weaver.hrm.resource.CustomFieldTreeManager;
|
|
|
|
|
|
|
|
import weaver.hrm.resource.HrmListValidate;
|
|
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
|
|
|
|
import weaver.systeminfo.systemright.CheckSubCompanyRight;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
@ -546,4 +558,309 @@ public class ExtendInfoBO {
|
|
|
|
|
|
|
|
|
|
|
|
return searchConditionItem;
|
|
|
|
return searchConditionItem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 基本信息明细表
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 个人信息明细表
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 工作信息明细表
|
|
|
|
|
|
|
|
public Map<String, Object> getFormFields(User user, String id, Integer viewAttr, boolean isAdd) {
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
List<Object> lsGroup = new ArrayList<Object>();
|
|
|
|
|
|
|
|
Map<String, Object> groupitem = null;
|
|
|
|
|
|
|
|
List<Object> itemlist = null;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (isAdd) viewAttr = 2;
|
|
|
|
|
|
|
|
if (id.length() == 0) {
|
|
|
|
|
|
|
|
id = "" + user.getUID();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
boolean isSelf = false;
|
|
|
|
|
|
|
|
if (id.equals("" + user.getUID())) {
|
|
|
|
|
|
|
|
isSelf = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String subcompanyid = "", departmentId = "";
|
|
|
|
|
|
|
|
RecordSet recordSet = new RecordSet();
|
|
|
|
|
|
|
|
//不能直接判断是否有人力资源维护权限,也需要根据分权进行判断
|
|
|
|
|
|
|
|
boolean canEdit = false;
|
|
|
|
|
|
|
|
recordSet.executeSql("select subcompanyid1, status, departmentId from hrmresource where id = " + id);
|
|
|
|
|
|
|
|
if (recordSet.next()) {
|
|
|
|
|
|
|
|
subcompanyid = Util.toScreen(recordSet.getString("subcompanyid1"), user.getLanguage());
|
|
|
|
|
|
|
|
departmentId = StringUtil.vString(recordSet.getString("departmentId"));
|
|
|
|
|
|
|
|
if (subcompanyid == null || subcompanyid.equals("") || subcompanyid.equalsIgnoreCase("null"))
|
|
|
|
|
|
|
|
subcompanyid = "-1";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int operatelevel = -1;
|
|
|
|
|
|
|
|
//人力资源模块是否开启了管理分权,如不是,则不显示框架,直接转向到列表页面(新的分权管理)
|
|
|
|
|
|
|
|
int hrmdetachable = 0;
|
|
|
|
|
|
|
|
ManageDetachComInfo ManageDetachComInfo = new ManageDetachComInfo();
|
|
|
|
|
|
|
|
boolean isUseHrmManageDetach = ManageDetachComInfo.isUseHrmManageDetach();
|
|
|
|
|
|
|
|
if (isUseHrmManageDetach) {
|
|
|
|
|
|
|
|
hrmdetachable = 1;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
hrmdetachable = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hrmdetachable == 1) {
|
|
|
|
|
|
|
|
CheckSubCompanyRight CheckSubCompanyRight = new CheckSubCompanyRight();
|
|
|
|
|
|
|
|
operatelevel = CheckSubCompanyRight.ChkComRightByUserRightCompanyId(user.getUID(), "HrmResourceEdit:Edit", Util.getIntValue(subcompanyid));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (HrmUserVarify.checkUserRight("HrmResourceEdit:Edit", user, departmentId)) {
|
|
|
|
|
|
|
|
operatelevel = 2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (operatelevel > 0) {
|
|
|
|
|
|
|
|
canEdit = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int scopeId = 1;
|
|
|
|
|
|
|
|
HrmFieldGroupComInfo HrmFieldGroupComInfo = new HrmFieldGroupComInfo();
|
|
|
|
|
|
|
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
|
|
|
|
|
|
|
com.engine.hrm.biz.HrmFieldManager hfm = new com.engine.hrm.biz.HrmFieldManager("HrmCustomFieldByInfoType", scopeId);
|
|
|
|
|
|
|
|
CustomFieldManager cfm = new CustomFieldManager("HrmCustomFieldByInfoType", scopeId);
|
|
|
|
|
|
|
|
if (viewAttr != 1) hfm.isReturnDecryptData(true);
|
|
|
|
|
|
|
|
hfm.getHrmData(Util.getIntValue(id));
|
|
|
|
|
|
|
|
cfm.getCustomData(Util.getIntValue(id));
|
|
|
|
|
|
|
|
HrmListValidate hrmListValidate = new HrmListValidate();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (HrmFieldGroupComInfo.next()) {
|
|
|
|
|
|
|
|
int grouptype = Util.getIntValue(HrmFieldGroupComInfo.getType());
|
|
|
|
|
|
|
|
if (grouptype != scopeId) continue;
|
|
|
|
|
|
|
|
int grouplabel = Util.getIntValue(HrmFieldGroupComInfo.getLabel());
|
|
|
|
|
|
|
|
int groupid = Util.getIntValue(HrmFieldGroupComInfo.getid());
|
|
|
|
|
|
|
|
hfm.getCustomFields(groupid);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
groupitem = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
itemlist = new ArrayList<Object>();
|
|
|
|
|
|
|
|
groupitem.put("title", SystemEnv.getHtmlLabelName(grouplabel, user.getLanguage()));
|
|
|
|
|
|
|
|
groupitem.put("defaultshow", true);
|
|
|
|
|
|
|
|
if (groupid == 4) {
|
|
|
|
|
|
|
|
groupitem.put("hide", (!isAdd && !canEdit && isSelf && viewAttr == 2 && hfm.getContactEditCount() == 0) || !hrmListValidate.isValidate(42));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
groupitem.put("hide", (!isAdd && !canEdit && isSelf && viewAttr == 2 && hfm.getContactEditCount() == 0) || !Util.null2String(HrmFieldGroupComInfo.getIsShow()).equals("1"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
groupitem.put("items", itemlist);
|
|
|
|
|
|
|
|
lsGroup.add(groupitem);
|
|
|
|
|
|
|
|
while (hfm.next()) {
|
|
|
|
|
|
|
|
int tmpviewattr = viewAttr;
|
|
|
|
|
|
|
|
String fieldName = hfm.getFieldname();
|
|
|
|
|
|
|
|
String cusFieldname = "";
|
|
|
|
|
|
|
|
String fieldValue = "";
|
|
|
|
|
|
|
|
if (hfm.isBaseField(fieldName)) {
|
|
|
|
|
|
|
|
fieldValue = hfm.getHrmData(fieldName);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fieldValue = Util.null2String(new EncryptUtil().decrypt("cus_fielddata", "field" + hfm.getFieldid(), "HrmCustomFieldByInfoType", "" + scopeId, cfm.getData("field" + hfm.getFieldid()), viewAttr == 2, true));
|
|
|
|
|
|
|
|
cusFieldname = "customfield" + hfm.getFieldid();
|
|
|
|
|
|
|
|
if (isAdd) cusFieldname = "customfield_1_" + hfm.getFieldid();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!hfm.isUse() || (!isAdd && viewAttr == 2 && !canEdit && isSelf && !hfm.isModify())) {
|
|
|
|
|
|
|
|
HrmFieldBean hrmFieldBean = new HrmFieldBean();
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldname(cusFieldname.length() > 0 ? cusFieldname : fieldName);
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldhtmltype("1");
|
|
|
|
|
|
|
|
hrmFieldBean.setType("1");
|
|
|
|
|
|
|
|
if (!isAdd) {
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldvalue(fieldValue);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
hrmFieldBean.setIsFormField(true);
|
|
|
|
|
|
|
|
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
|
|
|
|
|
|
|
Map<String, Object> otherParams = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
otherParams.put("hide", true);
|
|
|
|
|
|
|
|
searchConditionItem.setOtherParams(otherParams);
|
|
|
|
|
|
|
|
itemlist.add(searchConditionItem);
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
org.json.JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName);
|
|
|
|
|
|
|
|
HrmFieldBean hrmFieldBean = new HrmFieldBean();
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldid((String) hrmFieldConf.get("id"));
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldname(cusFieldname.length() > 0 ? cusFieldname : fieldName);
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldlabel(hfm.getLable());
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldhtmltype((String) hrmFieldConf.get("fieldhtmltype"));
|
|
|
|
|
|
|
|
hrmFieldBean.setType((String) hrmFieldConf.get("type"));
|
|
|
|
|
|
|
|
hrmFieldBean.setDmlurl((String) hrmFieldConf.get("dmlurl"));
|
|
|
|
|
|
|
|
hrmFieldBean.setIssystem("" + (Integer) hrmFieldConf.get("issystem"));
|
|
|
|
|
|
|
|
if (!isAdd) {
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldvalue(fieldValue);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
hrmFieldBean.setIsFormField(true);
|
|
|
|
|
|
|
|
if (viewAttr == 2 && ((String) hrmFieldConf.get("ismand")).equals("1")) {
|
|
|
|
|
|
|
|
tmpviewattr = 3;
|
|
|
|
|
|
|
|
if (hrmFieldBean.getFieldhtmltype().equals("3")) {
|
|
|
|
|
|
|
|
hrmFieldBean.setRules("required|string");
|
|
|
|
|
|
|
|
// if (hrmFieldBean.getType().equals("2")||hrmFieldBean.getType().equals("161")||hrmFieldBean.getType().equals("162")) {
|
|
|
|
|
|
|
|
// hrmFieldBean.setRules("required|string");
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// hrmFieldBean.setRules("required|integer");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
} else if (hrmFieldBean.getFieldhtmltype().equals("4") ||
|
|
|
|
|
|
|
|
hrmFieldBean.getFieldhtmltype().equals("5")) {
|
|
|
|
|
|
|
|
hrmFieldBean.setRules("required|integer");
|
|
|
|
|
|
|
|
} else if (hrmFieldBean.getFieldhtmltype().equals("1") && hrmFieldBean.getType().equals("2")) {
|
|
|
|
|
|
|
|
hrmFieldBean.setRules("required|integer");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
hrmFieldBean.setRules("required|string");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
|
|
|
|
|
|
|
if (searchConditionItem == null) continue;
|
|
|
|
|
|
|
|
if (searchConditionItem.getBrowserConditionParam() != null) {
|
|
|
|
|
|
|
|
searchConditionItem.getBrowserConditionParam().setViewAttr(tmpviewattr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
searchConditionItem.setViewAttr(tmpviewattr);
|
|
|
|
|
|
|
|
itemlist.add(searchConditionItem);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (itemlist.size() == 0) lsGroup.remove(groupitem);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
result.put("conditions", lsGroup);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//明细信息
|
|
|
|
|
|
|
|
List<Object> lsTable = new ArrayList<Object>();
|
|
|
|
|
|
|
|
List<HrmFieldBean> titles = null;
|
|
|
|
|
|
|
|
Map<String, Object> table = null;
|
|
|
|
|
|
|
|
Map<String, Object> maptab = null;
|
|
|
|
|
|
|
|
HrmFieldBean hrmFieldBean = null;
|
|
|
|
|
|
|
|
List<Map<String, Object>> columns = null;
|
|
|
|
|
|
|
|
List<Map<String, Object>> datas = null;
|
|
|
|
|
|
|
|
Map<String, Object> data = null;
|
|
|
|
|
|
|
|
result.put("tables", lsTable);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//标头信息--家庭信息
|
|
|
|
|
|
|
|
HrmFieldDetailComInfo HrmFieldDetailComInfo = new HrmFieldDetailComInfo();
|
|
|
|
|
|
|
|
LinkedHashMap<String, List<HrmFieldBean>> detialTable = HrmFieldDetailComInfo.getDetialTable("" + scopeId, viewAttr, "80%");
|
|
|
|
|
|
|
|
Iterator<Map.Entry<String, List<HrmFieldBean>>> entries = detialTable.entrySet().iterator();
|
|
|
|
|
|
|
|
while (entries.hasNext()) {
|
|
|
|
|
|
|
|
Map.Entry<String, List<HrmFieldBean>> entry = entries.next();
|
|
|
|
|
|
|
|
String tablename = entry.getKey();
|
|
|
|
|
|
|
|
titles = entry.getValue();
|
|
|
|
|
|
|
|
table = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
columns = HrmFieldUtil.getHrmDetailTable(titles, null, user);
|
|
|
|
|
|
|
|
table.put("columns", columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
datas = new ArrayList<Map<String, Object>>();
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
|
|
|
String sql = "select * from " + tablename + " where resourceid = " + id;
|
|
|
|
|
|
|
|
rs.executeSql(sql);
|
|
|
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
|
|
|
data = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
for (HrmFieldBean fieldInfo : titles) {
|
|
|
|
|
|
|
|
if (!isAdd) {
|
|
|
|
|
|
|
|
data.put(fieldInfo.getFieldname(), TextUtil.toBase64ForMultilang(Util.null2String(rs.getString(fieldInfo.getFieldname()))));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
datas.add(data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
table.put("datas", datas);
|
|
|
|
|
|
|
|
table.put("rownum", "rownum");
|
|
|
|
|
|
|
|
maptab = new Hashtable<String, Object>();
|
|
|
|
|
|
|
|
String tablabel = HrmResourceDetailTab.HrmResourceDetailTabInfo.get(tablename.toUpperCase());
|
|
|
|
|
|
|
|
maptab.put("tabname", SystemEnv.getHtmlLabelNames(tablabel, user.getLanguage()));
|
|
|
|
|
|
|
|
maptab.put("hide", (!hrmListValidate.isValidate(45) || (!isAdd && !canEdit && isSelf && viewAttr == 2)));
|
|
|
|
|
|
|
|
maptab.put("tabinfo", table);
|
|
|
|
|
|
|
|
lsTable.add(maptab);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//自定义信息
|
|
|
|
|
|
|
|
RecordSet RecordSet = new RecordSet();
|
|
|
|
|
|
|
|
CustomFieldTreeManager CustomFieldTreeManager = new CustomFieldTreeManager();
|
|
|
|
|
|
|
|
LinkedHashMap<String, String> ht = new LinkedHashMap<String, String>();
|
|
|
|
|
|
|
|
RecordSet.executeSql("select id, formlabel,viewtype from cus_treeform where parentid=" + scopeId + " order by scopeorder");
|
|
|
|
|
|
|
|
while (RecordSet.next()) {
|
|
|
|
|
|
|
|
if (RecordSet.getInt("viewtype") != 1) continue;
|
|
|
|
|
|
|
|
titles = new ArrayList<HrmFieldBean>();
|
|
|
|
|
|
|
|
int subId = RecordSet.getInt("id");
|
|
|
|
|
|
|
|
CustomFieldManager cfm2 = new CustomFieldManager("HrmCustomFieldByInfoType", subId);
|
|
|
|
|
|
|
|
cfm2.getCustomFields();
|
|
|
|
|
|
|
|
CustomFieldTreeManager.getMutiCustomData("HrmCustomFieldByInfoType", subId, Util.getIntValue(id, 0));
|
|
|
|
|
|
|
|
int colcount1 = 0;
|
|
|
|
|
|
|
|
int rowcount = 0;
|
|
|
|
|
|
|
|
int col = 0;
|
|
|
|
|
|
|
|
while (cfm2.next()) {
|
|
|
|
|
|
|
|
rowcount++;
|
|
|
|
|
|
|
|
if (!cfm2.isUse() || (!isAdd && viewAttr == 2 && !canEdit && isSelf && !cfm2.isModify())) continue;
|
|
|
|
|
|
|
|
col++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rowcount == 0) continue;
|
|
|
|
|
|
|
|
cfm2.beforeFirst();
|
|
|
|
|
|
|
|
ht.put("cus_list_" + subId, RecordSet.getString("formlabel"));
|
|
|
|
|
|
|
|
cfm2.beforeFirst();
|
|
|
|
|
|
|
|
while (cfm2.next()) {
|
|
|
|
|
|
|
|
if (!cfm2.isUse() || (!isAdd && viewAttr == 2 && !canEdit && isSelf && !cfm2.isModify())) continue;
|
|
|
|
|
|
|
|
int tmpviewattr = viewAttr;
|
|
|
|
|
|
|
|
//创建表头
|
|
|
|
|
|
|
|
String fieldname = "customfield" + cfm2.getId() + "_" + subId;
|
|
|
|
|
|
|
|
if (isAdd) fieldname = "customfield_1_" + cfm2.getId() + "_" + subId;
|
|
|
|
|
|
|
|
hrmFieldBean = new HrmFieldBean();
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldid("" + cfm2.getId());
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldname(fieldname);
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldlabel(cfm2.getLable());
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldhtmltype(cfm2.getHtmlType());
|
|
|
|
|
|
|
|
hrmFieldBean.setType("" + cfm2.getType());
|
|
|
|
|
|
|
|
hrmFieldBean.setDmlurl(cfm2.getDmrUrl());
|
|
|
|
|
|
|
|
if (viewAttr == 2 && cfm2.isMand()) {
|
|
|
|
|
|
|
|
tmpviewattr = 3;
|
|
|
|
|
|
|
|
hrmFieldBean.setRules("required|string");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
hrmFieldBean.setViewAttr(tmpviewattr);
|
|
|
|
|
|
|
|
hrmFieldBean.setWidth("80%");
|
|
|
|
|
|
|
|
titles.add(hrmFieldBean);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
table = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
if (col > 0) {
|
|
|
|
|
|
|
|
columns = HrmFieldUtil.getHrmDetailTable(titles, null, user);
|
|
|
|
|
|
|
|
table.put("columns", columns);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
datas = new ArrayList<Map<String, Object>>();
|
|
|
|
|
|
|
|
cfm2.beforeFirst();
|
|
|
|
|
|
|
|
while (CustomFieldTreeManager.nextMutiData()) {
|
|
|
|
|
|
|
|
data = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
while (cfm2.next()) {
|
|
|
|
|
|
|
|
// if(!cfm2.isUse()||(!isAdd&&viewAttr==2&&!canEdit&&isSelf&&!cfm2.isModify()))continue;
|
|
|
|
|
|
|
|
int fieldid = cfm2.getId(); //字段id
|
|
|
|
|
|
|
|
int type = cfm2.getType();
|
|
|
|
|
|
|
|
String dmlurl = cfm2.getDmrUrl();
|
|
|
|
|
|
|
|
int fieldhtmltype = Util.getIntValue(cfm2.getHtmlType());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String fieldname = "customfield" + cfm2.getId() + "_" + subId;
|
|
|
|
|
|
|
|
if (isAdd) fieldname = "customfield_1_" + cfm2.getId() + "_" + subId;
|
|
|
|
|
|
|
|
String fieldvalue = "";
|
|
|
|
|
|
|
|
if (!isAdd) {
|
|
|
|
|
|
|
|
fieldvalue = Util.null2String(CustomFieldTreeManager.getMutiData("field" + fieldid));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
data.put(fieldname, fieldvalue);
|
|
|
|
|
|
|
|
if (cfm2.getHtmlType().equals("1") && cfm2.getType() == 1) {
|
|
|
|
|
|
|
|
data.put(fieldname, TextUtil.toBase64ForMultilang(Util.null2String(fieldvalue)));
|
|
|
|
|
|
|
|
} else if (cfm2.getHtmlType().equals("3")) {
|
|
|
|
|
|
|
|
String fieldshowname = hfm.getFieldvalue(user, dmlurl, fieldid, fieldhtmltype, type, fieldvalue, 0);
|
|
|
|
|
|
|
|
data.put(fieldname, fieldvalue);
|
|
|
|
|
|
|
|
data.put(fieldname + "span", fieldshowname);
|
|
|
|
|
|
|
|
} else if (cfm2.getHtmlType().equals("4")) {
|
|
|
|
|
|
|
|
data.put(fieldname, fieldvalue.equals("1"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//只允许有权限的人删除明细行,没有权限的人只能修改不能删除
|
|
|
|
|
|
|
|
if (canEdit) {
|
|
|
|
|
|
|
|
data.put("viewAttr", 2);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
data.put("viewAttr", 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cfm2.beforeFirst();
|
|
|
|
|
|
|
|
datas.add(data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
table.put("datas", datas);
|
|
|
|
|
|
|
|
table.put("rownum", "nodesnum_" + subId);
|
|
|
|
|
|
|
|
maptab = new Hashtable<String, Object>();
|
|
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
|
|
|
rs.executeSql("select id, formlabel from cus_treeform where parentid=" + scopeId + " and id=" + subId + " order by scopeorder");
|
|
|
|
|
|
|
|
if (rs.next()) {
|
|
|
|
|
|
|
|
maptab.put("tabname", rs.getString("id"));
|
|
|
|
|
|
|
|
maptab.put("tabname", rs.getString("formlabel"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
maptab.put("hide", col == 0);
|
|
|
|
|
|
|
|
maptab.put("tabinfo", table);
|
|
|
|
|
|
|
|
lsTable.add(maptab);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
new BaseBean().writeLog(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|