|
|
|
@ -6,6 +6,7 @@ import com.api.browser.bean.SearchConditionOption;
|
|
|
|
|
import com.api.browser.util.ConditionType;
|
|
|
|
|
import com.api.hrm.bean.HrmFieldBean;
|
|
|
|
|
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
|
|
|
|
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
@ -132,22 +133,47 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
OrganizationWeaTable<HrmResourceVO> table = new OrganizationWeaTable<>(user, HrmResourceVO.class);
|
|
|
|
|
String sqlWhere = buildSqlWhere(params);
|
|
|
|
|
table.setSqlwhere(sqlWhere);
|
|
|
|
|
|
|
|
|
|
String[] str={"lastname","departmentid","subcompanyid1","jobtitle","mobile","telephone","managerid","dsporder"} ;
|
|
|
|
|
String columns = (String) params.get("columns");
|
|
|
|
|
if (StringUtils.isNotBlank(columns)){
|
|
|
|
|
String[] tmp = columns.split(",");
|
|
|
|
|
str = new String[tmp.length];
|
|
|
|
|
for (int i=0;i<tmp.length;i++){
|
|
|
|
|
str[i] = tmp[i].substring(tmp[i].lastIndexOf("_")+1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String templateId = (String) params.get("templateId");
|
|
|
|
|
if (StringUtils.isNotBlank(templateId)){
|
|
|
|
|
MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).updateUsed("0",null, String.valueOf(user.getUID()));
|
|
|
|
|
MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).updateUsed("1",templateId, String.valueOf(user.getUID()));
|
|
|
|
|
}
|
|
|
|
|
// 默认显示列
|
|
|
|
|
List<WeaTableColumn> weaTableColumnList = new ArrayList<>();
|
|
|
|
|
WeaTableColumn weaTableColumn = new WeaTableColumn();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<com.alibaba.fastjson.JSONObject> jsonObjectList = getHrmResourceMapper().queryAllResColumns(level,grade);
|
|
|
|
|
// for (com.alibaba.fastjson.JSONObject jsonObject : jsonObjectList){
|
|
|
|
|
// System.out.println(jsonObject.getString("level_name"));
|
|
|
|
|
// weaTableColumn.setText("职等");
|
|
|
|
|
// weaTableColumn.setDisplay(WeaBoolAttr.TRUE);
|
|
|
|
|
// weaTableColumn.setColumn("levelName");
|
|
|
|
|
// weaTableColumnList.add(weaTableColumn);
|
|
|
|
|
// }
|
|
|
|
|
// table.setColumns(weaTableColumnList);
|
|
|
|
|
|
|
|
|
|
// weaTableColumnList = columns.stream().map(v -> new WeaTableColumn("100", v.getTitle(), v.getKey())).collect(Collectors.toList());
|
|
|
|
|
for (com.alibaba.fastjson.JSONObject jsonObject : jsonObjectList){
|
|
|
|
|
WeaTableColumn weaTableColumn = new WeaTableColumn();
|
|
|
|
|
weaTableColumn.setText(jsonObject.getString("labelname"));
|
|
|
|
|
weaTableColumn.setColumn(jsonObject.getString("fieldname"));
|
|
|
|
|
weaTableColumn.setDisplay(WeaBoolAttr.FALSE);
|
|
|
|
|
if(Arrays.asList(str).contains(jsonObject.getString("fieldname"))){
|
|
|
|
|
weaTableColumn.setDisplay(WeaBoolAttr.TRUE);
|
|
|
|
|
}
|
|
|
|
|
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue");
|
|
|
|
|
String param = "-1_hrm_"+jsonObject.getString("fieldname")+"_"+user.getUID();
|
|
|
|
|
weaTableColumn.setOtherpara(param);
|
|
|
|
|
weaTableColumnList.add(weaTableColumn);
|
|
|
|
|
}
|
|
|
|
|
// 增加id字段
|
|
|
|
|
WeaTableColumn weaTableColumn = new WeaTableColumn();
|
|
|
|
|
weaTableColumn.setText("id");
|
|
|
|
|
weaTableColumn.setColumn("id");
|
|
|
|
|
weaTableColumn.setDisplay(WeaBoolAttr.FALSE);
|
|
|
|
|
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue");
|
|
|
|
|
String param = "-1_hrm_id_"+user.getUID();
|
|
|
|
|
weaTableColumn.setOtherpara(param);
|
|
|
|
|
weaTableColumnList.add(weaTableColumn);
|
|
|
|
|
|
|
|
|
|
table.setColumns(weaTableColumnList);
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
result.success();
|
|
|
|
|