Merge pull request '花名册高级搜索BUG修复' (#133) from feature/dxf into develop
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization/pulls/133
This commit is contained in:
commit
6934133e0a
|
|
@ -51,4 +51,8 @@ public interface HrmResourceMapper {
|
|||
Integer insertSearchTemplate(SearchTemplatePO templatePO);
|
||||
|
||||
Integer deleteSearchTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
|
||||
|
||||
Integer insertCustomTemplate(SearchTemplatePO templatePO);
|
||||
|
||||
Integer deleteCustomTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,6 +234,111 @@
|
|||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertCustomTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
|
||||
keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
INSERT INTO JCL_ORG_CUSTOM_TEMPLATE
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="basicFields != null">
|
||||
basic_fields,
|
||||
</if>
|
||||
<if test="personalFields != null">
|
||||
personal_fields,
|
||||
</if>
|
||||
<if test="workFields != null">
|
||||
work_fields,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="basicFields != null">
|
||||
#{basicFields},
|
||||
</if>
|
||||
<if test="personalFields != null">
|
||||
#{personalFields},
|
||||
</if>
|
||||
<if test="workFields != null">
|
||||
#{workFields},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertCustomTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
|
||||
databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="int" order="AFTER">
|
||||
select JCL_ORG_CUSTOM_TEMPLATE_ID.currval from dual
|
||||
</selectKey>
|
||||
INSERT INTO JCL_ORG_CUSTOM_TEMPLATE
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="basicFields != null">
|
||||
basic_fields,
|
||||
</if>
|
||||
<if test="personalFields != null">
|
||||
personal_fields,
|
||||
</if>
|
||||
<if test="workFields != null">
|
||||
work_fields,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="basicFields != null">
|
||||
#{basicFields},
|
||||
</if>
|
||||
<if test="personalFields != null">
|
||||
#{personalFields},
|
||||
</if>
|
||||
<if test="workFields != null">
|
||||
#{workFields},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteSearchTemplate">
|
||||
delete
|
||||
|
|
@ -242,6 +347,13 @@
|
|||
and creator = #{userId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCustomTemplate">
|
||||
delete
|
||||
from jcl_org_custom_template
|
||||
where id = #{id}
|
||||
and creator = #{userId}
|
||||
</delete>
|
||||
|
||||
<sql id="likeSql">
|
||||
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
|
||||
AND t.lastname like CONCAT('%',#{resourcePO.lastName},'%')
|
||||
|
|
|
|||
|
|
@ -127,4 +127,19 @@ public interface HrmResourceService {
|
|||
* @return
|
||||
*/
|
||||
List<SearchTemplateParam> getSearchTemplate(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 保存定制列模板
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Integer saveCustomTemplate(SearchTemplateParam params);
|
||||
|
||||
/**
|
||||
* 删除定制列模板
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void deleteCustomTemplate(Integer id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,11 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
// 所有满足条件的岗位ID
|
||||
private List<String> jobTitleList = new ArrayList<>();
|
||||
// 是否
|
||||
boolean searchJobTitle = false;
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
|
|
@ -203,6 +208,25 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
return templates;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer saveCustomTemplate(SearchTemplateParam params) {
|
||||
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
|
||||
if (null == templatePO) {
|
||||
return -1;
|
||||
}
|
||||
templatePO.setName(params.getShowname());
|
||||
templatePO.setCreator(user.getUID());
|
||||
templatePO.setCreateTime(new Date());
|
||||
templatePO.setUpdateTime(new Date());
|
||||
getHrmResourceMapper().insertCustomTemplate(templatePO);
|
||||
return templatePO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCustomTemplate(Integer id) {
|
||||
getHrmResourceMapper().deleteCustomTemplate(id, user.getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
String templateId = Util.null2String(params.get("templateId"));
|
||||
|
|
@ -755,6 +779,16 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
if (key.endsWith("workyear") || key.endsWith("companyworkyear")) {
|
||||
conditionItem.setConditionType(ConditionType.INPUTNUMBER);
|
||||
}
|
||||
//
|
||||
if (key.endsWith("jobactivity")) {
|
||||
searchJobTitle = true;
|
||||
}
|
||||
if (key.endsWith("jobGroupId")) {
|
||||
searchJobTitle = true;
|
||||
}
|
||||
if (key.endsWith("jobtitle")) {
|
||||
searchJobTitle = true;
|
||||
}
|
||||
String tableSql = buildTableSql(key);
|
||||
if (StringUtils.isBlank(tableSql)) {
|
||||
return;
|
||||
|
|
@ -800,9 +834,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
String scopeId = s[0];
|
||||
String tableName = s[1];
|
||||
String fieldName = s[2];
|
||||
if ("jobactivity".equals(fieldName)) {
|
||||
fieldName = "jobactivitydesc";
|
||||
}
|
||||
if ("hrm".equals(tableName)) {
|
||||
sb.append("t.").append(fieldName);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -279,4 +279,30 @@ public class HrmResourceController {
|
|||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/saveCustomTemplate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SearchTemplateParam params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Integer templateId = getHrmResourceWrapper(user).saveCustomTemplate(params);
|
||||
return ReturnResult.successed(Util.null2String(templateId));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/deleteCustomTemplate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult deleteCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SearchTemplatePO params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
getHrmResourceWrapper(user).deleteCustomTemplate(params.getId());
|
||||
return ReturnResult.successed();
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,4 +91,12 @@ public class HrmResourceWrapper extends OrganizationWrapper {
|
|||
public List<SearchTemplateParam> getSearchTemplate(Map<String, Object> params) {
|
||||
return getHrmResourceService(user).getSearchTemplate(params);
|
||||
}
|
||||
|
||||
public Integer saveCustomTemplate(SearchTemplateParam params) {
|
||||
return getHrmResourceService(user).saveCustomTemplate(params);
|
||||
}
|
||||
|
||||
public void deleteCustomTemplate(Integer id) {
|
||||
getHrmResourceService(user).deleteCustomTemplate(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue