花名册高级搜索相关接口
This commit is contained in:
parent
b2500cfbd0
commit
92c51cfe18
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.organization.entity.fieldset.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/01/05
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TransferDataParam {
|
||||
private String id;
|
||||
private String label;
|
||||
private String title;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.organization.entity.hrmresource.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/01/05
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SearchTemplateParam {
|
||||
private String key;
|
||||
private boolean selected;
|
||||
private String showName;
|
||||
private String fields;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.organization.entity.hrmresource.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/01/06
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SearchTemplatePO {
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String basicFields;
|
||||
private String personalFields;
|
||||
private String workFields;
|
||||
private Integer creator;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ public interface SystemDataMapper {
|
|||
|
||||
String getScCompanyNameById(@Param("companyId") String companyId);
|
||||
|
||||
List<Map<String,Object>> getBrowserDatas(@Param("ids") Collection<Long> ids);
|
||||
List<Map<String, Object>> getBrowserDatas(@Param("ids") Collection<Long> ids);
|
||||
|
||||
String getScDepartmentNameById(@Param("departmentId") String departmentId);
|
||||
|
||||
|
|
@ -59,6 +59,8 @@ public interface SystemDataMapper {
|
|||
|
||||
Long getHrmResourceMaxId();
|
||||
|
||||
List<String> getBatchUuidByIds(@Param("tableName") String tableName,@Param("ecIds") List<String> ecIds);
|
||||
List<String> getBatchUuidByIds(@Param("tableName") String tableName, @Param("ecIds") List<String> ecIds);
|
||||
|
||||
List<CusFormFieldPO> getHrmFieldsByScopeId(@Param("scopeId") String scopeId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
<result column="dmlurl" property="dmlUrl"/>
|
||||
<result column="scopeid" property="scopeId"/>
|
||||
<result column="tablename" property="tableName"/>
|
||||
<!-- <result column="fielddbtype" property="fielddbtype"/>-->
|
||||
<!-- <result column="fieldorder" property="fieldorder"/>-->
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SelectItemMap" type="com.engine.organization.entity.jclimport.po.JclSelectItem">
|
||||
|
|
@ -100,7 +102,7 @@
|
|||
</select>
|
||||
<select id="getHrmFieldBeanList" resultMap="CustomFieldMap">
|
||||
select b.labelname as fieldlable,
|
||||
'0' as scopeid,
|
||||
'0' as scopeid,
|
||||
a.fieldid,
|
||||
a.fieldname,
|
||||
a.ismand,
|
||||
|
|
@ -165,6 +167,42 @@
|
|||
#{ecId}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getHrmFieldsByScopeId" resultMap="CustomFieldMap">
|
||||
SELECT *
|
||||
FROM (SELECT t1.fieldid,
|
||||
t2.fieldname,
|
||||
t1.fieldlable,
|
||||
t1.ismand,
|
||||
t2.fielddbtype,
|
||||
t2.fieldhtmltype,
|
||||
t2.type,
|
||||
t1.dmlurl,
|
||||
fieldorder,
|
||||
groupid,
|
||||
#{scopeId} as scopeId,
|
||||
'cus' as tablename
|
||||
FROM cus_formfield t1,
|
||||
cus_formdict t2
|
||||
WHERE t1.fieldid = t2.id
|
||||
AND t1.scope = 'HrmCustomFieldByInfoType'
|
||||
AND t1.scopeid = #{scopeId}
|
||||
UNION ALL
|
||||
SELECT fieldid,
|
||||
fieldname,
|
||||
fieldlabel,
|
||||
ismand,
|
||||
fielddbtype,
|
||||
fieldhtmltype,
|
||||
TYPE,
|
||||
dmlurl,
|
||||
fieldorder,
|
||||
groupid,
|
||||
#{scopeId} as scopeId,
|
||||
'hrm' as tablename
|
||||
FROM hrm_formfield) hrmallfield
|
||||
WHERE FIELDHTMLTYPE != '6' and groupid IN (SELECT id FROM hrm_fieldgroup WHERE grouptype = #{scopeId})
|
||||
ORDER BY hrmallfield.groupid, hrmallfield.fieldorder
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.engine.organization.mapper.resource;
|
||||
|
||||
import com.engine.organization.entity.hrmresource.po.ResourcePO;
|
||||
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
|
||||
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
|
||||
import com.engine.organization.entity.resume.po.HrmFamilyInfoPO;
|
||||
import com.engine.organization.entity.resume.po.PersonnelResumePO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -23,5 +25,26 @@ public interface HrmResourceMapper {
|
|||
|
||||
List<HrmFamilyInfoPO> getHrmFamilyInfoByUser(@Param("resourceId") Integer resourceId);
|
||||
|
||||
/**
|
||||
* 获取人员过滤后的人员信息
|
||||
*
|
||||
* @param subcompanyid1
|
||||
* @param departmentid
|
||||
* @param jobId
|
||||
* @param resourceId
|
||||
* @return
|
||||
*/
|
||||
List<ResourcePO> getPersonnelScreening(@Param("subCompanyIds") List<Integer> subcompanyid1, @Param("departmentIds") List<Integer> departmentid, @Param("jobIds") List<Long> jobId, @Param("resourceIds") List<Long> resourceId);
|
||||
|
||||
/**
|
||||
* 根据用户ID获取查询模板
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<SearchTemplateParam> getSearchTemplatesByUser(@Param("userId") Integer userId);
|
||||
|
||||
SearchTemplatePO getSearchTemplateById(@Param("id") String id);
|
||||
|
||||
Integer insertSearchTemplate(SearchTemplatePO templatePO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@
|
|||
<result column="lastname" property="lastName"/>
|
||||
<result column="dspOrder" property="dspOrder"/>
|
||||
</resultMap>
|
||||
<resultMap id="SearchTemplateMap" type="com.engine.organization.entity.hrmresource.param.SearchTemplateParam">
|
||||
<result column="id" property="key"/>
|
||||
<result column="name" property="showName"/>
|
||||
<result column="selected" property="selected"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
|
||||
|
|
@ -86,6 +91,69 @@
|
|||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSearchTemplatesByUser" resultMap="SearchTemplateMap">
|
||||
select id,
|
||||
name,
|
||||
'false' as selected
|
||||
from jcl_org_search_template
|
||||
where creator = #{userId}
|
||||
</select>
|
||||
<select id="getSearchTemplateById"
|
||||
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
|
||||
select *
|
||||
from jcl_org_search_template
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSearchTemplate">
|
||||
INSERT INTO JCL_ORG_SEARCH_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>
|
||||
|
||||
<sql id="likeSql">
|
||||
<if test="resourcePO.lastName != null and resourcePO.lastName != ''">
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -95,4 +98,20 @@ public interface HrmResourceService {
|
|||
* @return
|
||||
*/
|
||||
long updateTabForm(HrmRelationSaveParam params);
|
||||
|
||||
/**
|
||||
* 获取当前人员搜索模板信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SearchTemplateParam> getSearchTemplate();
|
||||
|
||||
/**
|
||||
* 获取所有搜索条件字段
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SearchConditionGroup> getAllConditions();
|
||||
|
||||
void saveSearchTemplate(SearchTemplateParam params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,52 +1,41 @@
|
|||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.hrm.bean.HrmFieldBean;
|
||||
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrm.entity.RuleCodeType;
|
||||
import com.engine.hrm.util.face.HrmFaceCheckManager;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.browser.po.CustomBrowserBean;
|
||||
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
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.po.ExtendTitlePO;
|
||||
import com.engine.organization.entity.fieldset.param.TransferDataParam;
|
||||
import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
|
||||
import com.engine.organization.entity.hrmresource.po.HrmRelationPO;
|
||||
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
|
||||
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
|
||||
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
||||
import com.engine.organization.entity.jclimport.po.CusFormFieldPO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
||||
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.ResourceMapper;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
||||
import com.engine.organization.service.HrmResourceService;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.coderule.CodeRuleUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.engine.organization.util.detach.DetachUtil;
|
||||
|
|
@ -54,10 +43,13 @@ import com.engine.organization.util.page.PageUtil;
|
|||
import com.engine.organization.util.tree.SearchTreeUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.definedfield.HrmFieldManager;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -80,33 +72,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
private static final String TYPE_DEPT = "2";
|
||||
private static final String TYPE_JOB = "3";
|
||||
|
||||
private static final Long GROUP_ID = 4L;
|
||||
|
||||
/**
|
||||
* 分组类型
|
||||
* 1:分部
|
||||
* 2:部门
|
||||
* 3:岗位
|
||||
* 4:人员
|
||||
*/
|
||||
private static final String EXTEND_TYPE = "4";
|
||||
|
||||
/**
|
||||
* 主表表名
|
||||
*/
|
||||
private static final String JCL_ORG_HRM = "JCL_ORG_HRMRESOURCE";
|
||||
/**
|
||||
* 主表拓展表
|
||||
*/
|
||||
private static final String JCL_ORG_HRMEXT = "JCL_ORG_HRMRESOURCEEXT";
|
||||
/**
|
||||
* 明细表拓展表
|
||||
*/
|
||||
private static final String JCL_ORG_HRMEXT_DT1 = "JCL_ORG_HRMRESOURCEEXT_DT1";
|
||||
|
||||
private static final String HRM_RESOURCE = "hrmresource";
|
||||
|
||||
|
||||
private static final String RIGHT_NAME = "Roster:All";
|
||||
|
||||
private HrmRelationMapper getHrmRelationMapper() {
|
||||
|
|
@ -125,22 +90,14 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
return MapperProxyFactory.getProxy(JobMapper.class);
|
||||
}
|
||||
|
||||
private static ResourceMapper getResourceMapper() {
|
||||
return MapperProxyFactory.getProxy(ResourceMapper.class);
|
||||
}
|
||||
|
||||
private ExtendTitleMapper getExtendTitleMapper() {
|
||||
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
|
||||
private HrmResourceMapper getHrmResourceMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
|
||||
}
|
||||
|
||||
private SystemDataMapper getSystemDataMapper() {
|
||||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
private ExtService getExtService(User user) {
|
||||
return ServiceUtil.getService(ExtServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
|
|
@ -166,146 +123,231 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
public Map<String, Object> getSaveForm() {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID, "1");
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_HRM, 2, extendTitle.getId().toString(), null, null, null);
|
||||
if (CollectionUtils.isNotEmpty(items)) {
|
||||
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
||||
}
|
||||
}
|
||||
}
|
||||
//List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID, "1");
|
||||
//if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
// for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
// List<SearchConditionItem> items = getExtService(user).getExtSaveForm(user, EXTEND_TYPE + "", JCL_ORG_HRM, 2, extendTitle.getId().toString(), null, null, null);
|
||||
// if (CollectionUtils.isNotEmpty(items)) {
|
||||
// addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
apiDatas.put("condition", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long saveBaseForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
String workCode = (String) params.get("work_code");
|
||||
// 判断是否开启自动编号
|
||||
workCode = repeatDetermine(workCode);
|
||||
params.put("work_code", workCode);
|
||||
// 完善新增参数
|
||||
completeParams(params);
|
||||
|
||||
// 新增EC人员,新增成功后,新增到聚才林人员表
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.RESOURCE, OperateTypeEnum.ADD, params).sync();
|
||||
String ecResourceId = Util.null2String(syncMap.get("id"));
|
||||
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecResourceId), Util.null2String(syncMap.get("message")));
|
||||
// 获取人员UUID
|
||||
RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_RESOURCE, ecResourceId);
|
||||
params.put("uuid", recordInfo.getUuid());
|
||||
Long resourceId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", null);
|
||||
//HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
//String workCode = (String) params.get("work_code");
|
||||
//// 判断是否开启自动编号
|
||||
//workCode = repeatDetermine(workCode);
|
||||
//params.put("work_code", workCode);
|
||||
//// 完善新增参数
|
||||
//completeParams(params);
|
||||
//
|
||||
//// 新增EC人员,新增成功后,新增到聚才林人员表
|
||||
//Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.RESOURCE, OperateTypeEnum.ADD, params).sync();
|
||||
//String ecResourceId = Util.null2String(syncMap.get("id"));
|
||||
//OrganizationAssert.isTrue(StringUtils.isNotBlank(ecResourceId), Util.null2String(syncMap.get("message")));
|
||||
//// 获取人员UUID
|
||||
//RecordInfo recordInfo = getSystemDataMapper().getHrmObjectByID(HRM_RESOURCE, ecResourceId);
|
||||
//params.put("uuid", recordInfo.getUuid());
|
||||
//Long resourceId = getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", null);
|
||||
// TODO new HrmResourceTriggerRunnable(resourceId).run();
|
||||
return resourceId;
|
||||
//return resourceId;
|
||||
return 0L;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getBaseForm(Map<String, Object> params) {
|
||||
OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
|
||||
// 2编辑 1查看
|
||||
int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
|
||||
long id = Long.parseLong((String) params.get("id"));
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
|
||||
HashMap<String, Object> buttonsMap = new HashMap<>();
|
||||
buttonsMap.put("hasEdit", true);
|
||||
buttonsMap.put("hasSave", true);
|
||||
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId), "1");
|
||||
|
||||
if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_HRM : JCL_ORG_HRMEXT, viewAttr, id, extendTitle.getId() + "", "");
|
||||
if (CollectionUtils.isNotEmpty(items)) {
|
||||
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("buttons", buttonsMap);
|
||||
resultMap.put("conditions", addGroups);
|
||||
resultMap.put("id", id);
|
||||
// 拓展页面分组
|
||||
resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_HRMEXT));
|
||||
// 处理明细表
|
||||
resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId), JCL_ORG_HRMEXT_DT1, id, viewAttr, false));
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
|
||||
apiDatas.put("result", resultMap);
|
||||
|
||||
return apiDatas;
|
||||
//OrganizationAssert.notNull(params.get("viewAttr"), "请标识操作类型");
|
||||
//// 2编辑 1查看
|
||||
//int viewAttr = Integer.parseInt((String) params.get("viewAttr"));
|
||||
//long id = Long.parseLong((String) params.get("id"));
|
||||
//String groupId = (String) params.get("viewCondition");
|
||||
//
|
||||
//HashMap<String, Object> buttonsMap = new HashMap<>();
|
||||
//buttonsMap.put("hasEdit", true);
|
||||
//buttonsMap.put("hasSave", true);
|
||||
//
|
||||
//List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
//if ("0".equals(groupId)) {
|
||||
// groupId = GROUP_ID.toString();
|
||||
//}
|
||||
//List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId), "1");
|
||||
//
|
||||
//if (CollectionUtils.isNotEmpty(extendTitles)) {
|
||||
// for (ExtendTitlePO extendTitle : extendTitles) {
|
||||
// List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_HRM : JCL_ORG_HRMEXT, viewAttr, id, extendTitle.getId() + "", "");
|
||||
// if (CollectionUtils.isNotEmpty(items)) {
|
||||
// addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//HashMap<String, Object> resultMap = new HashMap<>();
|
||||
//resultMap.put("buttons", buttonsMap);
|
||||
//resultMap.put("conditions", addGroups);
|
||||
//resultMap.put("id", id);
|
||||
//// 拓展页面分组
|
||||
//resultMap.put("tabInfo", getExtService(user).getTabInfo(EXTEND_TYPE, JCL_ORG_HRMEXT));
|
||||
//// 处理明细表
|
||||
//resultMap.put("tables", getExtService(user).getExtendTables(user, EXTEND_TYPE, Long.parseLong(groupId), JCL_ORG_HRMEXT_DT1, id, viewAttr, false));
|
||||
//Map<String, Object> apiDatas = new HashMap<>();
|
||||
//
|
||||
//apiDatas.put("result", resultMap);
|
||||
//
|
||||
//return apiDatas;
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateForm(Map<String, Object> params) {
|
||||
Long id = Long.parseLong((String) params.get("id"));
|
||||
String groupId = (String) params.get("viewCondition");
|
||||
int updateCount = 0;
|
||||
if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
|
||||
// 判断编号是否重复
|
||||
String workCode = Util.null2String(params.get("work_code"));
|
||||
HrmResourcePO resourceById = getResourceMapper().getResourceById(id.toString());
|
||||
if (!workCode.equals(resourceById.getWorkCode())) {
|
||||
workCode = repeatDetermine(workCode);
|
||||
params.put("work_code", workCode);
|
||||
}
|
||||
//Long id = Long.parseLong((String) params.get("id"));
|
||||
//String groupId = (String) params.get("viewCondition");
|
||||
//int updateCount = 0;
|
||||
//if ("0".equals(groupId) || GROUP_ID.toString().equals(groupId)) {
|
||||
// // 判断编号是否重复
|
||||
// String workCode = Util.null2String(params.get("work_code"));
|
||||
// HrmResourcePO resourceById = getResourceMapper().getResourceById(id.toString());
|
||||
// if (!workCode.equals(resourceById.getWorkCode())) {
|
||||
// workCode = repeatDetermine(workCode);
|
||||
// params.put("work_code", workCode);
|
||||
// }
|
||||
//
|
||||
// // 完善更新参数
|
||||
// completeParams(params);
|
||||
//
|
||||
// // 更新EC人员,更新成功后,更新聚才林人员表
|
||||
// Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.RESOURCE, OperateTypeEnum.UPDATE, params).sync();
|
||||
// String ecResourceId = Util.null2String(syncMap.get("id"));
|
||||
// OrganizationAssert.isTrue(StringUtils.isNotBlank(ecResourceId), Util.null2String(syncMap.get("message")));
|
||||
//
|
||||
// // 更新主表数据
|
||||
// updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", id);
|
||||
//
|
||||
// // TODO new HrmResourceTriggerRunnable(id).run();
|
||||
//} else {
|
||||
// // 更新主表拓展表
|
||||
// getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, "", id);
|
||||
//}
|
||||
////更新明细表
|
||||
//getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_HRMEXT_DT1, params, id);
|
||||
//
|
||||
//return updateCount;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 完善更新参数
|
||||
completeParams(params);
|
||||
@Override
|
||||
public List<SearchTemplateParam> getSearchTemplate() {
|
||||
int userUID = user.getUID();
|
||||
// 根据ID查询所存储的模板
|
||||
List<SearchTemplateParam> templates = getHrmResourceMapper().getSearchTemplatesByUser(userUID);
|
||||
templates.add(0, SearchTemplateParam.builder().key("-1").selected(false).showName("默认模板").build());
|
||||
return templates;
|
||||
}
|
||||
|
||||
// 更新EC人员,更新成功后,更新聚才林人员表
|
||||
Map<String, Object> syncMap = new OrganizationSyncEc(user, LogModuleNameEnum.RESOURCE, OperateTypeEnum.UPDATE, params).sync();
|
||||
String ecResourceId = Util.null2String(syncMap.get("id"));
|
||||
OrganizationAssert.isTrue(StringUtils.isNotBlank(ecResourceId), Util.null2String(syncMap.get("message")));
|
||||
@Override
|
||||
public List<SearchConditionGroup> getAllConditions() {
|
||||
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> basicConditionItems = new ArrayList<>();
|
||||
List<SearchConditionItem> personalConditionItems = new ArrayList<>();
|
||||
List<SearchConditionItem> workConditionItems = new ArrayList<>();
|
||||
|
||||
// 更新主表数据
|
||||
updateCount += getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRM, params, "", id);
|
||||
|
||||
// TODO new HrmResourceTriggerRunnable(id).run();
|
||||
} else {
|
||||
// 更新主表拓展表
|
||||
getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_HRMEXT, params, "", id);
|
||||
// 基本信息:-1
|
||||
List<CusFormFieldPO> hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("-1");
|
||||
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems);
|
||||
if (CollectionUtils.isNotEmpty(basicConditionItems)) {
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, basicConditionItems));
|
||||
}
|
||||
//更新明细表
|
||||
getExtService(user).updateExtDT(user, EXTEND_TYPE, JCL_ORG_HRMEXT_DT1, params, id);
|
||||
|
||||
return updateCount;
|
||||
// 个人信息:1
|
||||
hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("1");
|
||||
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, personalConditionItems);
|
||||
if (CollectionUtils.isNotEmpty(personalConditionItems)) {
|
||||
addGroups.add(new SearchConditionGroup("个人信息", true, personalConditionItems));
|
||||
}
|
||||
|
||||
// 工作信息:3
|
||||
hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("3");
|
||||
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, workConditionItems);
|
||||
if (CollectionUtils.isNotEmpty(workConditionItems)) {
|
||||
addGroups.add(new SearchConditionGroup("工作信息", true, workConditionItems));
|
||||
}
|
||||
return addGroups;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveSearchTemplate(SearchTemplateParam params) {
|
||||
String[] split = params.getFields().split(",");
|
||||
if (split.length > 0) {
|
||||
List<String> basicFieldsBuilder = new ArrayList<>();
|
||||
List<String> personalFieldsBuilder = new ArrayList<>();
|
||||
List<String> workFieldsBuilder = new ArrayList<>();
|
||||
for (String fieldName : split) {
|
||||
if (fieldName.startsWith("-1")) {
|
||||
basicFieldsBuilder.add(fieldName.substring(fieldName.lastIndexOf("_") + 1));
|
||||
} else if (fieldName.startsWith("1")) {
|
||||
personalFieldsBuilder.add(fieldName.substring(fieldName.lastIndexOf("_") + 1));
|
||||
} else if (fieldName.startsWith("3")) {
|
||||
workFieldsBuilder.add(fieldName.substring(fieldName.lastIndexOf("_") + 1));
|
||||
}
|
||||
}
|
||||
SearchTemplatePO searchTemplatePO = SearchTemplatePO.builder().name(params.getShowName()).basicFields(StringUtils.join(basicFieldsBuilder, ",")).personalFields(StringUtils.join(personalFieldsBuilder, ",")).workFields(StringUtils.join(workFieldsBuilder, ",")).creator(user.getUID()).createTime(new Date()).updateTime(new Date()).build();
|
||||
getHrmResourceMapper().insertSearchTemplate(searchTemplatePO);
|
||||
// 保存模板
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
String templateId = Util.null2String(params.get("templateId"));
|
||||
if (StringUtils.isBlank(templateId)) {
|
||||
templateId = "-1";
|
||||
}
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
SearchConditionItem lastNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "姓名", "lastName");
|
||||
SearchConditionItem jobTitleItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "666", "jobTitle", "");
|
||||
BrowserBean browserBean = jobTitleItem.getBrowserConditionParam();
|
||||
String s = JSONObject.toJSONString(browserBean);
|
||||
CustomBrowserBean customBrowserBean = JSONObject.parseObject(s, CustomBrowserBean.class);
|
||||
customBrowserBean.setHasLeftTree(true);
|
||||
customBrowserBean.setLeftToSearchKey("treeKey");
|
||||
jobTitleItem.setBrowserConditionParam(customBrowserBean);
|
||||
SearchConditionItem companyIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "164", "ecCompany", "");
|
||||
SearchConditionItem departmentIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "4", "ecDepartment", "");
|
||||
SearchConditionItem telephoneItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "办公电话", "telephone");
|
||||
SearchConditionItem mobileItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "移动电话", "mobile");
|
||||
List<SearchConditionGroup> allConditions = getAllConditions();
|
||||
// 穿梭框ID,展示所选字段信息
|
||||
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
||||
if ("-1".equals(templateId)) {
|
||||
// 未选择模板展示默认模板搜索条件
|
||||
List<SearchConditionItem> searchConditionItems = new ArrayList<>();
|
||||
List<CusFormFieldPO> hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId("-1");
|
||||
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, searchConditionItems);
|
||||
if (CollectionUtils.isNotEmpty(searchConditionItems)) {
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, searchConditionItems));
|
||||
}
|
||||
} else {
|
||||
// 选择模板则遍历所选模板所选字段
|
||||
SearchTemplatePO searchTemplateById = getHrmResourceMapper().getSearchTemplateById(templateId);
|
||||
String[] basicFields = Util.null2String(searchTemplateById.getBasicFields()).split(",");
|
||||
if (basicFields.length > 0) {
|
||||
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, "基本信息", -1, basicFields);
|
||||
}
|
||||
|
||||
conditionItems.add(lastNameItem);
|
||||
conditionItems.add(jobTitleItem);
|
||||
conditionItems.add(companyIdItem);
|
||||
conditionItems.add(departmentIdItem);
|
||||
conditionItems.add(telephoneItem);
|
||||
conditionItems.add(mobileItem);
|
||||
String[] personalFields = Util.null2String(searchTemplateById.getPersonalFields()).split(",");
|
||||
if (personalFields.length > 0) {
|
||||
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, "个人信息", 1, personalFields);
|
||||
}
|
||||
String[] workFields = Util.null2String(searchTemplateById.getWorkFields()).split(",");
|
||||
if (workFields.length > 0) {
|
||||
getTemplateItems(hrmFieldSearchConditionComInfo, addGroups, "工作信息", 3, workFields);
|
||||
}
|
||||
|
||||
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||
apiDatas.put("conditions", addGroups);
|
||||
}
|
||||
apiDatas.put("defaultcondition", addGroups);
|
||||
apiDatas.put("conditions", allConditions);
|
||||
List<SearchTemplateParam> searchTemplate = getSearchTemplate();
|
||||
String finalTemplateId = templateId;
|
||||
searchTemplate.forEach(item -> {
|
||||
if (finalTemplateId.equals(item.getKey())) {
|
||||
item.setSelected(true);
|
||||
}
|
||||
});
|
||||
apiDatas.put("templates", searchTemplate);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
|
|
@ -657,63 +699,131 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
}
|
||||
}
|
||||
|
||||
private void completeParams(Map<String, Object> params) {
|
||||
String jobId = Util.null2String(params.get("job_title"));
|
||||
if (StringUtils.isNotBlank(jobId)) {
|
||||
JobPO jobById = getJobMapper().getJobById(Long.parseLong(jobId));
|
||||
params.put("department_id", jobById.getEcDepartment());
|
||||
params.put("company_id", jobById.getEcCompany());
|
||||
params.put("ec_department", jobById.getEcDepartment());
|
||||
params.put("ec_company", jobById.getEcCompany());
|
||||
// 等级方案、岗位序列、职等、职级
|
||||
params.put("scheme_id", jobById.getSchemeId());
|
||||
params.put("sequence_id", jobById.getSequenceId());
|
||||
params.put("job_level", jobById.getLevelId());
|
||||
params.put("job_grade", jobById.getGradeId());
|
||||
String showOrder = Util.null2String(params.get("show_order"));
|
||||
// 初始化排序字段
|
||||
if (StringUtils.isBlank(showOrder)) {
|
||||
Long orderNum = getResourceMapper().getMaxShowOrder();
|
||||
params.put("show_order", null == orderNum ? 1 : orderNum + 1);
|
||||
}
|
||||
|
||||
// 人员状态
|
||||
String status = Util.null2String(params.get("status"));
|
||||
if (StringUtils.isBlank(status)) {
|
||||
params.put("status", "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
//private void completeParams(Map<String, Object> params) {
|
||||
// String jobId = Util.null2String(params.get("job_title"));
|
||||
// if (StringUtils.isNotBlank(jobId)) {
|
||||
// JobPO jobById = getJobMapper().getJobById(Long.parseLong(jobId));
|
||||
// params.put("department_id", jobById.getEcDepartment());
|
||||
// params.put("company_id", jobById.getEcCompany());
|
||||
// params.put("ec_department", jobById.getEcDepartment());
|
||||
// params.put("ec_company", jobById.getEcCompany());
|
||||
// // 等级方案、岗位序列、职等、职级
|
||||
// params.put("scheme_id", jobById.getSchemeId());
|
||||
// params.put("sequence_id", jobById.getSequenceId());
|
||||
// params.put("job_level", jobById.getLevelId());
|
||||
// params.put("job_grade", jobById.getGradeId());
|
||||
// String showOrder = Util.null2String(params.get("show_order"));
|
||||
// // 初始化排序字段
|
||||
// if (StringUtils.isBlank(showOrder)) {
|
||||
// Long orderNum = getResourceMapper().getMaxShowOrder();
|
||||
// params.put("show_order", null == orderNum ? 1 : orderNum + 1);
|
||||
// }
|
||||
//
|
||||
// // 人员状态
|
||||
// String status = Util.null2String(params.get("status"));
|
||||
// if (StringUtils.isBlank(status)) {
|
||||
// params.put("status", "0");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
/**
|
||||
* 判断编号是否重复
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String repeatDetermine(String workCode) {
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.USER.getValue());
|
||||
if (StringUtils.isNotBlank(workCode)) {
|
||||
workCode = CodeRuleUtil.generateCode(RuleCodeType.USER, workCode);
|
||||
List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(workCode));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
} else {
|
||||
OrganizationAssert.isTrue(null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable()), "编号不允许为空");
|
||||
workCode = autoCreateWorkCode();
|
||||
}
|
||||
return workCode;
|
||||
}
|
||||
//public static String repeatDetermine(String workCode) {
|
||||
// CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.USER.getValue());
|
||||
// if (StringUtils.isNotBlank(workCode)) {
|
||||
// workCode = CodeRuleUtil.generateCode(RuleCodeType.USER, workCode);
|
||||
// List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(workCode));
|
||||
// OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
// } else {
|
||||
// OrganizationAssert.isTrue(null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable()), "编号不允许为空");
|
||||
// workCode = autoCreateWorkCode();
|
||||
// }
|
||||
// return workCode;
|
||||
//}
|
||||
|
||||
/**
|
||||
* 自动编号处理
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static String autoCreateWorkCode() {
|
||||
String generateCode = CodeRuleUtil.generateCode(RuleCodeType.USER, "");
|
||||
List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(generateCode));
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
generateCode = autoCreateWorkCode();
|
||||
//private static String autoCreateWorkCode() {
|
||||
// String generateCode = CodeRuleUtil.generateCode(RuleCodeType.USER, "");
|
||||
// List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(generateCode));
|
||||
// if (CollectionUtils.isNotEmpty(list)) {
|
||||
// generateCode = autoCreateWorkCode();
|
||||
// }
|
||||
// return generateCode;
|
||||
//}
|
||||
|
||||
|
||||
/**
|
||||
* 构建查询条件Item
|
||||
*
|
||||
* @param hrmFieldSearchConditionComInfo
|
||||
* @param formFields
|
||||
* @param conditionItems
|
||||
*/
|
||||
private void createConditionItems(HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo, List<CusFormFieldPO> formFields, List<SearchConditionItem> conditionItems) {
|
||||
for (CusFormFieldPO cusFormFieldPO : formFields) {
|
||||
HrmFieldBean hrmFieldBean = new HrmFieldBean();
|
||||
hrmFieldBean.setFieldid(Util.null2String(cusFormFieldPO.getFieldId()));
|
||||
hrmFieldBean.setFieldname(cusFormFieldPO.getScopeId() + "_" + cusFormFieldPO.getTableName() + "_" + cusFormFieldPO.getFieldName());
|
||||
hrmFieldBean.setFieldlabel(cusFormFieldPO.getFieldLabel());
|
||||
hrmFieldBean.setFieldhtmltype(Util.null2String(cusFormFieldPO.getFieldHtmlType()));
|
||||
hrmFieldBean.setType(cusFormFieldPO.getType());
|
||||
hrmFieldBean.setIsQuickSearch(false);
|
||||
hrmFieldBean.setIsScope(false);
|
||||
hrmFieldBean.setDmlurl(cusFormFieldPO.getDmlUrl());
|
||||
conditionItems.add(hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建穿梭框字段
|
||||
*
|
||||
* @param formFields
|
||||
* @param dataParamList
|
||||
* @param title
|
||||
*/
|
||||
private void createTransferData(List<CusFormFieldPO> formFields, List<TransferDataParam> dataParamList, String title) {
|
||||
for (CusFormFieldPO cusFormFieldPO : formFields) {
|
||||
String id = cusFormFieldPO.getTableName() + "_" + cusFormFieldPO.getScopeId() + "_" + cusFormFieldPO.getFieldId();
|
||||
String label = Util.toScreen(SystemEnv.getHtmlLabelName(Integer.parseInt(cusFormFieldPO.getFieldLabel()), user.getLanguage()), user.getLanguage());
|
||||
dataParamList.add(TransferDataParam.builder().id(id).label(label).title(title).build());
|
||||
}
|
||||
}
|
||||
|
||||
private void getTemplateItems(HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo, List<SearchConditionGroup> addGroups, String title, Integer scopeid, String[] fieldNames) {
|
||||
try {
|
||||
|
||||
HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", scopeid);
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
for (String fieldName : fieldNames) {
|
||||
JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName);
|
||||
if (null == hrmFieldConf) {
|
||||
continue;
|
||||
}
|
||||
boolean baseField = hfm.isBaseField(fieldName);
|
||||
HrmFieldBean hrmFieldBean = new HrmFieldBean();
|
||||
hrmFieldBean.setFieldid(Util.null2String(hrmFieldConf.getString("id")));
|
||||
hrmFieldBean.setFieldname(scopeid + "_" + (baseField ? "hrm" : "cus") + "_" + fieldName);
|
||||
hrmFieldBean.setFieldlabel(hrmFieldConf.getString("fieldlabel"));
|
||||
hrmFieldBean.setFieldhtmltype(hrmFieldConf.getString("fieldhtmltype"));
|
||||
hrmFieldBean.setType(hrmFieldConf.getString("type"));
|
||||
hrmFieldBean.setDmlurl(hrmFieldConf.getString("dmlurl"));
|
||||
hrmFieldBean.setIsQuickSearch(false);
|
||||
hrmFieldBean.setIsScope(false);
|
||||
conditionItems.add(hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user));
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(conditionItems)) {
|
||||
addGroups.add(new SearchConditionGroup(title, true, conditionItems));
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return generateCode;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -581,7 +581,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
//2.数据过滤
|
||||
//3.数据插入
|
||||
resourcePOS.forEach(resourcePO -> {
|
||||
if (Objects.nonNull(resourcePO) && null != resourcePO.getJobtitle()) {
|
||||
if (Objects.nonNull(resourcePO) && null != resourcePO.getJobtitle() && 0 != resourcePO.getJobtitle()) {
|
||||
int count = getJobMapper().selectByConditions(resourcePO);
|
||||
if (count == 0) {
|
||||
JobPO jobPO = JobPO.builder()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.engine.common.util.ParamUtil;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.HrmResourceWrapper;
|
||||
|
|
@ -170,6 +171,57 @@ public class HrmResourceController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索模板
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getSearchTemplate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getSearchTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).getSearchTemplate());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有可选择的查询条件
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getAllConditions")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getAllConditions(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).getAllConditions());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/saveSearchTemplate")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveSearchTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SearchTemplateParam params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
getHrmResourceWrapper(user).saveSearchTemplate(params);
|
||||
return ReturnResult.successed();
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表页顶部按钮
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.annotation.Log;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
|
|
@ -13,6 +15,7 @@ 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;
|
||||
|
||||
/**
|
||||
|
|
@ -59,6 +62,18 @@ public class HrmResourceWrapper extends OrganizationWrapper {
|
|||
return getHrmResourceService(user).getSearchCondition(params);
|
||||
}
|
||||
|
||||
public List<SearchTemplateParam> getSearchTemplate() {
|
||||
return getHrmResourceService(user).getSearchTemplate();
|
||||
}
|
||||
|
||||
public List<SearchConditionGroup> getAllConditions() {
|
||||
return getHrmResourceService(user).getAllConditions();
|
||||
}
|
||||
|
||||
public void saveSearchTemplate(SearchTemplateParam params) {
|
||||
getHrmResourceService(user).saveSearchTemplate(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getHasRight() {
|
||||
return getHrmResourceService(user).getHasRight();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue