|
|
|
@ -111,6 +111,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private JclOrgCustomTemplateMapper getJclOrgCustomTemplateMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 所有满足条件的岗位ID
|
|
|
|
|
private List<Integer> jobTitleList = null;
|
|
|
|
|
// 是否
|
|
|
|
@ -131,43 +135,43 @@ 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);
|
|
|
|
|
List<WeaTableColumn> weaTableColumnList = new ArrayList<>();
|
|
|
|
|
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID()));
|
|
|
|
|
String columns = null;
|
|
|
|
|
if (jclOrgCustomTemplatePO != null) {
|
|
|
|
|
columns = jclOrgCustomTemplatePO.getBasicFields();
|
|
|
|
|
if (StringUtils.isNotBlank(jclOrgCustomTemplatePO.getPersonalFields())) {
|
|
|
|
|
columns = "," + jclOrgCustomTemplatePO.getPersonalFields();
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(jclOrgCustomTemplatePO.getWorkFields())) {
|
|
|
|
|
columns = "," + jclOrgCustomTemplatePO.getWorkFields();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//初次使用,无模板初始值
|
|
|
|
|
columns = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_subcompanyid1,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid,-1_hrm_sporder";
|
|
|
|
|
}
|
|
|
|
|
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<>();
|
|
|
|
|
List<com.alibaba.fastjson.JSONObject> jsonObjectList = getHrmResourceMapper().queryAllResColumns(level,grade);
|
|
|
|
|
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"))){
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(columns)) {
|
|
|
|
|
String[] tmp = columns.split(",");
|
|
|
|
|
for (int i = 0; i < tmp.length; i++) {
|
|
|
|
|
String fieldName = tmp[i].substring(tmp[i].lastIndexOf("_") + 1);
|
|
|
|
|
WeaTableColumn weaTableColumn = new WeaTableColumn();
|
|
|
|
|
weaTableColumn.setText(getHrmResourceMapper().queryLabelName(fieldName));
|
|
|
|
|
weaTableColumn.setColumn(fieldName);
|
|
|
|
|
weaTableColumn.setDisplay(WeaBoolAttr.TRUE);
|
|
|
|
|
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue");
|
|
|
|
|
String param = tmp[i];
|
|
|
|
|
weaTableColumn.setOtherpara(param);
|
|
|
|
|
weaTableColumnList.add(weaTableColumn);
|
|
|
|
|
}
|
|
|
|
|
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue");
|
|
|
|
|
String param = "-1_hrm_"+jsonObject.getString("fieldname")+"_"+user.getUID();
|
|
|
|
|
weaTableColumn.setOtherpara(param);
|
|
|
|
|
weaTableColumnList.add(weaTableColumn);
|
|
|
|
|
}
|
|
|
|
|
// 增加id字段
|
|
|
|
|
// 增加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();
|
|
|
|
|
String param = "-1_hrm_id_" + user.getUID();
|
|
|
|
|
weaTableColumn.setOtherpara(param);
|
|
|
|
|
weaTableColumnList.add(weaTableColumn);
|
|
|
|
|
|
|
|
|
@ -277,6 +281,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
}
|
|
|
|
|
templatePO.setName(params.getShowname());
|
|
|
|
|
templatePO.setCreator(user.getUID());
|
|
|
|
|
templatePO.setIsused("0");
|
|
|
|
|
templatePO.setCreateTime(new Date());
|
|
|
|
|
templatePO.setUpdateTime(new Date());
|
|
|
|
|
getHrmResourceMapper().insertCustomTemplate(templatePO);
|
|
|
|
@ -354,6 +359,29 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Integer saveColumnsCustomTemplate(Map<String, Object> params) {
|
|
|
|
|
String columns = Util.null2String(params.get("columns"));
|
|
|
|
|
String templateId = Util.null2String(params.get("templateId"));
|
|
|
|
|
SearchTemplatePO templatePO = buildSearchTemplateByFields(columns);
|
|
|
|
|
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = new JclOrgCustomTemplatePO();
|
|
|
|
|
if (StringUtils.isNotBlank(templateId)){
|
|
|
|
|
jclOrgCustomTemplatePO = getJclOrgCustomTemplateMapper().selectByPrimaryKey(Long.parseLong(templateId));
|
|
|
|
|
if (jclOrgCustomTemplatePO!=null){
|
|
|
|
|
jclOrgCustomTemplatePO.setId(Integer.valueOf(templateId));
|
|
|
|
|
jclOrgCustomTemplatePO.setBasicFields(templatePO.getBasicFields());
|
|
|
|
|
jclOrgCustomTemplatePO.setPersonalFields(templatePO.getPersonalFields());
|
|
|
|
|
jclOrgCustomTemplatePO.setWorkFields(templatePO.getWorkFields());
|
|
|
|
|
jclOrgCustomTemplatePO.setIsused(1);
|
|
|
|
|
//取消已启用模板
|
|
|
|
|
getJclOrgCustomTemplateMapper().updateUsed("0",templateId,String.valueOf(user.getUID()));
|
|
|
|
|
//启用当前模板
|
|
|
|
|
getJclOrgCustomTemplateMapper().updateByPrimaryKeySelective(jclOrgCustomTemplatePO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return jclOrgCustomTemplatePO.getId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
|
|
|
|
String templateId = Util.null2String(params.get("templateId"));
|
|
|
|
|