Merge branch 'develop' of http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization into feature/dxf
This commit is contained in:
commit
0afff811c0
|
|
@ -63,6 +63,8 @@ public interface HrmResourceMapper {
|
|||
|
||||
SearchTemplatePO getCustomTemplateByName(@Param("userId") Integer userId, @Param("name") String name);
|
||||
|
||||
SearchTemplatePO getUsedCustomTemplateByUser(@Param("userId") Integer userId);
|
||||
|
||||
Integer insertSearchTemplate(SearchTemplatePO templatePO);
|
||||
|
||||
Integer deleteSearchTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
|
||||
|
|
@ -71,9 +73,9 @@ public interface HrmResourceMapper {
|
|||
|
||||
Integer deleteCustomTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
|
||||
|
||||
List<JSONObject> queryAllResColumns(@Param("level") String level,@Param("grade") String grade);
|
||||
List<JSONObject> queryAllResColumns(@Param("level") String level, @Param("grade") String grade);
|
||||
|
||||
String queryLabelName(@Param("fieldName") String fieldName,@Param("scopeId") String scopeId);
|
||||
String queryLabelName(@Param("fieldName") String fieldName, @Param("scopeId") String scopeId);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
|
||||
SELECT DISTINCT subcompanyid1, departmentid, jobtitle
|
||||
from hrmresource
|
||||
from hrmresource where status < 4
|
||||
</select>
|
||||
<select id="listByFilter" resultMap="HrmResourceMap">
|
||||
select id, subcompanyid1 , departmentid , jobtitle , lastname , dspOrder from hrmresource t
|
||||
|
|
@ -397,8 +397,8 @@
|
|||
|
||||
<select id="queryAllResColumns" parameterType="java.lang.String" resultType="com.alibaba.fastjson.JSONObject">
|
||||
select a.fieldid, a.fieldname, b.labelname, a.issystem, a.ismand
|
||||
from hrm_formfield a
|
||||
inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = 7
|
||||
from hrm_formfield a
|
||||
inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = 7
|
||||
</select>
|
||||
<select id="getSearchTemplateByName"
|
||||
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
|
||||
|
|
@ -416,8 +416,12 @@
|
|||
</select>
|
||||
|
||||
<select id="queryLabelName" parameterType="java.lang.String" resultType="java.lang.String">
|
||||
select b.LABELNAME from hrm_formfield a inner join htmllabelinfo b on a.fieldlabel = b.indexid where a.FIELDNAME = #{fieldName} and b.LANGUAGEID ='7'
|
||||
union all
|
||||
select b.LABELNAME
|
||||
from hrm_formfield a
|
||||
inner join htmllabelinfo b on a.fieldlabel = b.indexid
|
||||
where a.FIELDNAME = #{fieldName}
|
||||
and b.LANGUAGEID = '7'
|
||||
union all
|
||||
SELECT t1.hrm_fieldlable as labelname
|
||||
FROM cus_formfield t1,
|
||||
cus_formdict t2
|
||||
|
|
@ -426,5 +430,12 @@
|
|||
and t1.SCOPEID = #{scopeId}
|
||||
and t2.fieldname = #{fieldName}
|
||||
</select>
|
||||
<select id="getUsedCustomTemplateByUser"
|
||||
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
|
||||
select *
|
||||
from jcl_org_custom_template
|
||||
where ISUSED = 1
|
||||
and creator = #{userId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -4,7 +4,6 @@ import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
|||
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -126,7 +125,7 @@ public interface HrmResourceService {
|
|||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<SearchTemplateParam> getSearchTemplate(Map<String, Object> params);
|
||||
Map<String, Object> getSearchTemplate(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 保存定制列模板
|
||||
|
|
|
|||
|
|
@ -284,18 +284,26 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<SearchTemplateParam> getSearchTemplate(Map<String, Object> params) {
|
||||
public Map<String, Object> getSearchTemplate(Map<String, Object> params) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
String type = Util.null2String(params.get("type"));
|
||||
int userUID = user.getUID();
|
||||
// 根据ID查询所存储的模板
|
||||
List<SearchTemplateParam> templates;
|
||||
if ("custom".equals(type)) {
|
||||
templates = getHrmResourceMapper().getCustomTemplatesByUser(userUID);
|
||||
SearchTemplatePO usedCustomTemplate = getHrmResourceMapper().getUsedCustomTemplateByUser(user.getUID());
|
||||
if (null != usedCustomTemplate) {
|
||||
returnMap.put("templateId", usedCustomTemplate.getId().toString());
|
||||
} else {
|
||||
returnMap.put("templateId", "-1");
|
||||
}
|
||||
} else {
|
||||
templates = getHrmResourceMapper().getSearchTemplatesByUser(userUID);
|
||||
}
|
||||
templates.add(0, SearchTemplateParam.builder().key("-1").showname("默认模板").build());
|
||||
return templates;
|
||||
returnMap.put("templates", templates);
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -384,8 +392,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
transferOptions.add(SearchTemplateParam.builder().key(Integer.toString(idx.getAndIncrement())).showname(allCondition.getTitle()).build());
|
||||
}
|
||||
if ("-1".equals(templateId)) {
|
||||
String selectKeys = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid";
|
||||
transferKeys = Arrays.asList(selectKeys.split(","));
|
||||
// 查询当前使用的模板,没有使用的,则展示默认模板
|
||||
SearchTemplatePO usedCustomTemplate = getHrmResourceMapper().getUsedCustomTemplateByUser(user.getUID());
|
||||
if (null == usedCustomTemplate) {
|
||||
String selectKeys = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid";
|
||||
transferKeys = Arrays.asList(selectKeys.split(","));
|
||||
} else {
|
||||
transferKeys = getSelectKeys(usedCustomTemplate);
|
||||
templateId = usedCustomTemplate.getId().toString();
|
||||
}
|
||||
} else {
|
||||
SearchTemplatePO searchTemplateById = getHrmResourceMapper().getCustomTemplateById(templateId);
|
||||
transferKeys = getSelectKeys(searchTemplateById);
|
||||
|
|
@ -394,6 +409,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
resultMap.put("transferDatas", transferDatas);
|
||||
resultMap.put("transferKeys", transferKeys);
|
||||
resultMap.put("transferOptions", transferOptions);
|
||||
resultMap.put("templateId", templateId);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import com.engine.organization.service.impl.HrmResourceServiceImpl;
|
|||
import com.engine.organization.util.OrganizationWrapper;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -88,7 +87,7 @@ public class HrmResourceWrapper extends OrganizationWrapper {
|
|||
return getHrmResourceService(user).updateTabForm(params);
|
||||
}
|
||||
|
||||
public List<SearchTemplateParam> getSearchTemplate(Map<String, Object> params) {
|
||||
public Map<String, Object> getSearchTemplate(Map<String, Object> params) {
|
||||
return getHrmResourceService(user).getSearchTemplate(params);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue