花名册列定制模板查询20230112
This commit is contained in:
parent
f86562c802
commit
09d4dbddd5
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.organization.entity.hrmresource.po;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class JclOrgCustomTemplatePO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String basicFields;
|
||||
|
||||
private String personalFields;
|
||||
|
||||
private String workFields;
|
||||
|
||||
private Integer isused;
|
||||
|
||||
private Integer creator;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.engine.organization.entity.hrmresource.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@OrganizationTable(pageId = "8df45b09-0cda-4f57-a93a-ca9f96a4c111",
|
||||
fields = "t.id," +
|
||||
"t.name," +
|
||||
"t.basic_fields," +
|
||||
"t.personal_fields," +
|
||||
"t.work_fields," +
|
||||
"t.isused," +
|
||||
"t.creator," +
|
||||
"t.create_time," +
|
||||
"t.update_time",
|
||||
fromSql = "FROM jcl_org_custom_template t ",
|
||||
orderby = "id",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(index = "0", text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "另存为"),
|
||||
@OrganizationTableOperate(index = "2", text = "删除")
|
||||
},
|
||||
tableType = WeaTableType.CHECKBOX
|
||||
)
|
||||
public class JclOrgCustomTemplateVO {
|
||||
|
||||
@OrganizationTableColumn(column = "id", display = false)
|
||||
private Integer id;
|
||||
|
||||
@OrganizationTableColumn(text = "模板名称", width = "30%", column = "name")
|
||||
private String name;
|
||||
|
||||
@OrganizationTableColumn(column = "basic_fields", display = false)
|
||||
private String basicFields;
|
||||
|
||||
@OrganizationTableColumn(column = "personal_fields", display = false)
|
||||
private String personalFields;
|
||||
|
||||
@OrganizationTableColumn(column = "work_fields", display = false)
|
||||
private String workFields;
|
||||
|
||||
@OrganizationTableColumn(column = "isused", display = false)
|
||||
private Integer isUsed;
|
||||
|
||||
@OrganizationTableColumn(column = "creator", display = false)
|
||||
private Integer creator;
|
||||
|
||||
@OrganizationTableColumn(text = "创建时间",column = "create_time", width = "30%")
|
||||
private Date createTime;
|
||||
|
||||
@OrganizationTableColumn(text = "更新时间",column = "update_time", display = false)
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.resource.JclOrgCustomTemplateMapper">
|
||||
<resultMap id="resultMap" type="com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="isused" property="isused"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="baseColumns">
|
||||
t.id,
|
||||
t.name,
|
||||
t.basic_fields,
|
||||
t.personal_fields,
|
||||
t.work_fields text,
|
||||
t.isused,
|
||||
t.creator,
|
||||
t.create_time,
|
||||
t.update_time
|
||||
</sql>
|
||||
|
||||
<select id="listAll" resultType="com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_custom_template t order by t.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -142,4 +142,12 @@ public interface HrmResourceService {
|
|||
* @param id
|
||||
*/
|
||||
void deleteCustomTemplate(Integer id);
|
||||
|
||||
|
||||
/**
|
||||
* 展示所有模板
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getCustomTemplate(Map<String,Object> params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,16 @@ import com.engine.organization.entity.company.bo.CompBO;
|
|||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.bo.DepartmentBO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.extend.bo.ExtendInfoBO;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
|
||||
import com.engine.organization.entity.hrmresource.po.HrmRelationPO;
|
||||
import com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO;
|
||||
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
|
||||
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
||||
import com.engine.organization.entity.hrmresource.vo.JclOrgCustomTemplateVO;
|
||||
import com.engine.organization.entity.jclimport.po.CusFormFieldPO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
|
|
@ -35,7 +39,9 @@ import com.engine.organization.mapper.hrmresource.HrmRelationMapper;
|
|||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
||||
import com.engine.organization.mapper.resource.JclOrgCustomTemplateMapper;
|
||||
import com.engine.organization.service.HrmResourceService;
|
||||
import com.engine.organization.transmethod.SystemTransMethod;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
|
|
@ -55,6 +61,7 @@ import weaver.general.Util;
|
|||
import weaver.hrm.definedfield.HrmFieldManager;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -398,6 +405,48 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
return hrmRelationPO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCustomTemplate(Map<String, Object> params) {
|
||||
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().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<>();
|
||||
tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, 2, false, true));
|
||||
List<JclOrgCustomTemplatePO> jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAll();
|
||||
List<Integer> isUsed = new ArrayList<>();
|
||||
AtomicInteger index = new AtomicInteger(0);
|
||||
List<Map<String, Object>> collect = jclOrgCustomTemplatePOS.stream().map(item -> {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("id", item.getId());
|
||||
resultMap.put("name", item.getName());
|
||||
resultMap.put("createTime", item.getCreateTime());
|
||||
|
||||
if (1 == item.getIsused()) {
|
||||
isUsed.add(index.get());
|
||||
}
|
||||
index.getAndIncrement();
|
||||
|
||||
return resultMap;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
tabInfoMap.put("datas", collect);
|
||||
tabInfoMap.put("api_status", true);
|
||||
Map<String, List<Integer>> isUsedMap = new HashMap<>();
|
||||
isUsedMap.put("status", isUsed);
|
||||
tabInfoMap.put("selectedData", isUsedMap);
|
||||
tabInfoMap.put("isModalEdit", false);
|
||||
return tabInfoMap;
|
||||
|
||||
|
||||
// OrganizationWeaTable<JclOrgCustomTemplateVO> table = new OrganizationWeaTable<>(user, JclOrgCustomTemplateVO.class);
|
||||
// String sqlWhere = buildSqlWhere(params);
|
||||
// table.setSqlwhere(sqlWhere);
|
||||
// WeaResultMsg result = new WeaResultMsg(false);
|
||||
// result.putAll(table.makeDataResult());
|
||||
// result.success();
|
||||
// return new HashMap<>(result.getResultMap());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*
|
||||
|
|
|
|||
|
|
@ -305,4 +305,17 @@ public class HrmResourceController {
|
|||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getCustomTemplate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String,Object> params = request.getParameterMap();
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).getCustomTemplate(params));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,4 +99,8 @@ public class HrmResourceWrapper extends OrganizationWrapper {
|
|||
public void deleteCustomTemplate(Integer id) {
|
||||
getHrmResourceService(user).deleteCustomTemplate(id);
|
||||
}
|
||||
|
||||
public Map<String, Object> getCustomTemplate(Map<String,Object> params){
|
||||
return getHrmResourceService(user).getCustomTemplate(params);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue