花名册,状态查询功能完善
This commit is contained in:
parent
0afff811c0
commit
6ac651e8bd
|
|
@ -86,8 +86,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
|
||||
private static final String RIGHT_NAME = "Roster:All";
|
||||
|
||||
private static final String level = getFieldName("职等");
|
||||
private static final String grade = getFieldName("职级");
|
||||
|
||||
private HrmRelationMapper getHrmRelationMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmRelationMapper.class);
|
||||
|
|
@ -179,24 +177,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
weaTableColumnList.add(weaTableColumn);
|
||||
}
|
||||
}
|
||||
// if (StringUtils.isNotBlank(columns)) {
|
||||
// String[] tmp = columns.split(",");
|
||||
// for (int i = 0; i < tmp.length; i++) {
|
||||
// String scopeId = tmp[i].split("_")[0];
|
||||
// String fieldName = tmp[i].substring(tmp[i].lastIndexOf("_") + 1);
|
||||
// WeaTableColumn weaTableColumn = new WeaTableColumn();
|
||||
// weaTableColumn.setText(getHrmResourceMapper().queryLabelName(fieldName, scopeId));
|
||||
// weaTableColumn.setColumn(buildTableSql(tmp[i]).replace(".", "_"));
|
||||
// weaTableColumn.setDisplay(WeaBoolAttr.TRUE);
|
||||
// weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue");
|
||||
// String param = tmp[i];
|
||||
// weaTableColumn.setOtherpara(param);
|
||||
// weaTableColumnList.add(weaTableColumn);
|
||||
// }
|
||||
// }
|
||||
// 增加id字段,跳转人员卡片
|
||||
WeaTableColumn weaTableColumn = new WeaTableColumn();
|
||||
// weaTableColumn.setText("id");
|
||||
weaTableColumn.setColumn("id");
|
||||
weaTableColumn.setDisplay(WeaBoolAttr.FALSE);
|
||||
|
||||
|
|
@ -654,15 +636,20 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
|
||||
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
StringBuilder sb = new StringBuilder(" where 1=1 and t.status <4 ");
|
||||
StringBuilder sb = new StringBuilder(" where 1=1 ");
|
||||
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = Util.null2String(entry.getValue());
|
||||
if (StringUtils.isBlank(value)) {
|
||||
if ("lastName".equals(key)) {
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
sb.append(" and t.lastname ").append(dbType.like(value));
|
||||
}
|
||||
sb.append(" and t.status = 1");
|
||||
continue;
|
||||
}
|
||||
String key = entry.getKey();
|
||||
if ("lastName".equals(key)) {
|
||||
sb.append(" and t.lastname ").append(dbType.like(value));
|
||||
|
||||
if (StringUtils.isBlank(value)) {
|
||||
continue;
|
||||
}
|
||||
SearchConditionItem searchConditionItem = allFieldsMap.get(key);
|
||||
// 根据不同的类型,不同的查询方式
|
||||
|
|
@ -918,6 +905,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
hrmFieldBean.setDmlurl(cusFormFieldPO.getDmlUrl());
|
||||
hrmFieldBean.setIssystem("hrm".equals(cusFormFieldPO.getTableName()) ? "1" : "0");
|
||||
hrmFieldBean.setIsFormField(true);
|
||||
if ("-1_hrm_status".equals(hrmFieldBean.getFieldname())) {
|
||||
hrmFieldBean.setFieldvalue("1");
|
||||
}
|
||||
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
||||
conditionItems.add(searchConditionItem);
|
||||
// 如果为下拉框,添加一条空选项
|
||||
|
|
@ -1095,6 +1085,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
sb.append(" and ").append(dbType.ifNull(tableSql, "0")).append(" = '").append(value).append("' ");
|
||||
break;
|
||||
case SELECT://选择框
|
||||
if (!"-1".equals(value)) {
|
||||
sb.append(" and ").append(tableSql).append(" = '").append(value).append("' ");
|
||||
}
|
||||
break;
|
||||
case DATE:
|
||||
case DATEPICKER:
|
||||
case TIMEPICKER:
|
||||
|
|
@ -1161,10 +1155,13 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
* @param searchConditionItem
|
||||
*/
|
||||
private void addEmptyForSelect(SearchConditionItem searchConditionItem) {
|
||||
searchConditionItem.setValue("");
|
||||
searchConditionItem.setValue("-1");
|
||||
if ("-1_hrm_status".equals(searchConditionItem.getDomkey()[0])) {
|
||||
searchConditionItem.setValue("1");
|
||||
}
|
||||
List<SearchConditionOption> options = searchConditionItem.getOptions();
|
||||
SearchConditionOption searchConditionOption = new SearchConditionOption();
|
||||
searchConditionOption.setKey("");
|
||||
searchConditionOption.setKey("-1");
|
||||
options.add(0, searchConditionOption);
|
||||
options.forEach(item -> {
|
||||
item.setSelected(false);
|
||||
|
|
@ -1194,13 +1191,4 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
return selectKeys;
|
||||
}
|
||||
|
||||
private static String getFieldName(String fieldabel) {
|
||||
RecordSet recordSet = new RecordSet();
|
||||
String fieldname = null;
|
||||
recordSet.executeQuery("select fieldname from jcl_org_field where fieldlabel='" + fieldabel + "'");
|
||||
if (recordSet.next()) {
|
||||
fieldname = recordSet.getString("fieldname");
|
||||
}
|
||||
return fieldname;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.engine.organization.mapper.department.DepartmentMapper;
|
|||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.json.JSONObject;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.definedfield.HrmFieldManager;
|
||||
|
||||
|
|
@ -19,15 +18,13 @@ public class HrmResourceTransMethod {
|
|||
|
||||
public static String getFieldTrueValue(String id, String para) {
|
||||
HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", Integer.parseInt(para.split("_")[0]));
|
||||
hfm.getCustomFields();
|
||||
|
||||
String fieldName = hfm.getFieldname();
|
||||
JSONObject hrmFieldConf = hfm.getHrmFieldConf(para.substring(para.lastIndexOf("_") + 1));
|
||||
String hrmData = id;
|
||||
// hfm.getCustomFields();
|
||||
String fieldName = para.substring(para.lastIndexOf("_") + 1);
|
||||
JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName);
|
||||
User user = new User();
|
||||
user.setUid(1);
|
||||
try {
|
||||
return hfm.getFieldvalue(null, user, null, hrmFieldConf.getString("dmlurl"), hrmFieldConf.getInt("id"), hrmFieldConf.getInt("fieldhtmltype"), hrmFieldConf.getInt("type"), hrmData, 0, fieldName);
|
||||
return hfm.getFieldvalue(null, user, null, hrmFieldConf.getString("dmlurl"), hrmFieldConf.getInt("id"), hrmFieldConf.getInt("fieldhtmltype"), hrmFieldConf.getInt("type"), id, 0, fieldName);
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue