Merge pull request 'BUG修复' (#139) from feature/dxf into develop

Reviewed-on: #139
pull/141/head^2^2
dxfeng 2 years ago
commit 30615f9727

@ -81,6 +81,36 @@ public class ExtendInfoBO {
} }
/**
* viewAttr
* @param user
* @param infoPOList
* @param showLabel
* @param checkBox
* @return
*/
public static List<Map<String, Object>> convertInfoListToTable(User user, List<ExtendInfoPO> infoPOList, boolean showLabel, boolean checkBox) {
List<Map<String, Object>> lsCol = new ArrayList<>();
Map<String, Object> col;
int width = 100 / infoPOList.size();
for (ExtendInfoPO extendInfoPO : infoPOList) {
String tmpkey = extendInfoPO.getFieldName();
col = new HashMap<>();
col.put("title", extendInfoPO.getFieldNameDesc());
col.put("key", tmpkey);
col.put("dataIndex", tmpkey);
col.put("com", getFieldDetailInfo(user, extendInfoPO, extendInfoPO.getViewAttr(), showLabel, width));
col.put("width", width + "%");
if (checkBox && Integer.valueOf(7).equals(extendInfoPO.getControlType())) {
col.put("checkType", "checkbox");
}
lsCol.add(col);
}
return lsCol;
}
public static List<Map<String, Object>> convertInfoListToTable(User user, List<ExtendInfoPO> infoPOList, int viewAttr, boolean showLabel) { public static List<Map<String, Object>> convertInfoListToTable(User user, List<ExtendInfoPO> infoPOList, int viewAttr, boolean showLabel) {
return convertInfoListToTable(user, infoPOList, viewAttr, showLabel, false); return convertInfoListToTable(user, infoPOList, viewAttr, showLabel, false);
} }

@ -131,4 +131,6 @@ public class ExtendInfoPO {
private int deleteType; private int deleteType;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
private Integer viewAttr;
} }

@ -17,7 +17,6 @@ import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.bo.DepartmentBO; import com.engine.organization.entity.department.bo.DepartmentBO;
import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.extend.bo.ExtendInfoBO; import com.engine.organization.entity.extend.bo.ExtendInfoBO;
import com.engine.organization.entity.extend.param.ExtendInfoParams;
import com.engine.organization.entity.extend.po.ExtendInfoPO; import com.engine.organization.entity.extend.po.ExtendInfoPO;
import com.engine.organization.entity.hrmresource.bo.HrmRelationBO; import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam; import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
@ -35,7 +34,6 @@ import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.enums.HrmGroupEnum; import com.engine.organization.enums.HrmGroupEnum;
import com.engine.organization.mapper.comp.CompMapper; import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.hrmresource.HrmRelationMapper; import com.engine.organization.mapper.hrmresource.HrmRelationMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper; import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.mapper.job.JobMapper;
@ -55,12 +53,12 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import weaver.common.DateUtil;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.general.StringUtil; import weaver.general.StringUtil;
import weaver.general.Util; import weaver.general.Util;
import weaver.hrm.definedfield.HrmFieldManager; import weaver.hrm.definedfield.HrmFieldManager;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -137,7 +135,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
WeaTableColumn weaTableColumn = new WeaTableColumn(); WeaTableColumn weaTableColumn = new WeaTableColumn();
List<com.alibaba.fastjson.JSONObject> jsonObjectList = getHrmResourceMapper().queryAllResColumns(level,grade); //List<com.alibaba.fastjson.JSONObject> jsonObjectList = getHrmResourceMapper().queryAllResColumns(level, grade);
// for (com.alibaba.fastjson.JSONObject jsonObject : jsonObjectList){ // for (com.alibaba.fastjson.JSONObject jsonObject : jsonObjectList){
// System.out.println(jsonObject.getString("level_name")); // System.out.println(jsonObject.getString("level_name"));
// weaTableColumn.setText("职等"); // weaTableColumn.setText("职等");
@ -476,10 +474,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
@Override @Override
public Map<String, Object> getCustomTemplate(Map<String, Object> params) { public Map<String, Object> getCustomTemplate(Map<String, Object> params) {
List<ExtendInfoPO> infoPOList = new ArrayList<>(); List<ExtendInfoPO> infoPOList = new ArrayList<>();
infoPOList.add(ExtendInfoPO.builder().id(null).fieldName("name").fieldNameDesc("模板名称").fieldType("varchar(255)").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(1).isrequired(0).isSystemDefault(0).build()); infoPOList.add(ExtendInfoPO.builder().viewAttr(2).id(null).fieldName("name").fieldNameDesc("模板名称").fieldType("varchar(255)").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(1).isrequired(0).isSystemDefault(0).build());
infoPOList.add(ExtendInfoPO.builder().id(null).fieldName("createTime").fieldNameDesc("创建时间").fieldType("date").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(2).isrequired(0).isSystemDefault(0).build()); infoPOList.add(ExtendInfoPO.builder().viewAttr(1).id(null).fieldName("createTime").fieldNameDesc("创建时间").fieldType("date").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(2).isrequired(0).isSystemDefault(0).build());
Map<String, Object> tabInfoMap = new HashMap<>(); Map<String, Object> tabInfoMap = new HashMap<>();
tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, 2, false, true)); tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, false, true));
List<JclOrgCustomTemplatePO> jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAll(); List<JclOrgCustomTemplatePO> jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAll();
List<Integer> isUsed = new ArrayList<>(); List<Integer> isUsed = new ArrayList<>();
AtomicInteger index = new AtomicInteger(0); AtomicInteger index = new AtomicInteger(0);
@ -487,9 +485,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("id", item.getId()); resultMap.put("id", item.getId());
resultMap.put("name", item.getName()); resultMap.put("name", item.getName());
resultMap.put("createTime", item.getCreateTime()); resultMap.put("createTime", DateUtil.getDate(item.getCreateTime()));
if(item.getIsused()!=null){ if (item.getIsused() != null) {
if (1 == item.getIsused()) { if (1 == item.getIsused()) {
isUsed.add(index.get()); isUsed.add(index.get());
@ -1067,7 +1065,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
private static String getFieldName(String fieldabel) { private static String getFieldName(String fieldabel) {
RecordSet recordSet = new RecordSet(); RecordSet recordSet = new RecordSet();
String fieldname = null; String fieldname = null;
recordSet.executeQuery("select fieldname from jcl_org_field where fieldlabel='" + fieldabel+"'"); recordSet.executeQuery("select fieldname from jcl_org_field where fieldlabel='" + fieldabel + "'");
if (recordSet.next()) { if (recordSet.next()) {
fieldname = recordSet.getString("fieldname"); fieldname = recordSet.getString("fieldname");
} }

@ -332,6 +332,7 @@ public class HrmResourceController {
} }
} }
@POST
@Path("/updateCustomTemplate") @Path("/updateCustomTemplate")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public ReturnResult updateCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) { public ReturnResult updateCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) {

Loading…
Cancel
Save