Merge branches 'develop' and '大王椰组织调整工作流提醒' of http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization into 大王椰组织调整工作流提醒
# Conflicts: # src/com/engine/organization/util/response/ReturnResult.java
This commit is contained in:
commit
30da1ecc45
|
|
@ -22,6 +22,7 @@ public class CompanyTreePO {
|
||||||
private boolean isLeaf;
|
private boolean isLeaf;
|
||||||
private String key;
|
private String key;
|
||||||
private boolean disabled;
|
private boolean disabled;
|
||||||
|
private String type;
|
||||||
|
|
||||||
public boolean getIsLeaf() {
|
public boolean getIsLeaf() {
|
||||||
return isLeaf;
|
return isLeaf;
|
||||||
|
|
@ -38,4 +39,11 @@ public class CompanyTreePO {
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
if(id.startsWith("d")){
|
||||||
|
return "2";
|
||||||
|
}
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ public class ManagerDetachParam {
|
||||||
|
|
||||||
private Integer ecManager;
|
private Integer ecManager;
|
||||||
|
|
||||||
|
private Integer roleId;
|
||||||
|
|
||||||
private Integer jclManager;
|
private Integer jclManager;
|
||||||
|
|
||||||
private String ecRolelevel;
|
private String ecRolelevel;
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import lombok.NoArgsConstructor;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@OrganizationTable(pageId = "0bf9b7bc-c8b0-4225-bf28-4cd015d96e98",
|
@OrganizationTable(pageId = "0bf9b7bc-c8b0-4225-bf28-4cd015d96e98",
|
||||||
fields = "t.id," +
|
fields = "t.id," +
|
||||||
|
"t.manager_type," +
|
||||||
"t.ec_manager," +
|
"t.ec_manager," +
|
||||||
"t.ec_rolelevel," +
|
"t.ec_rolelevel," +
|
||||||
"t.manage_module," +
|
"t.manage_module," +
|
||||||
|
|
@ -45,8 +46,11 @@ public class ManagerDetachVO {
|
||||||
@OrganizationTableColumn(column = "id", display = false)
|
@OrganizationTableColumn(column = "id", display = false)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@OrganizationTableColumn(labelId = 513540, text = "管理员类型", width = "20%", column = "manager_type")
|
||||||
|
private Integer managerType;
|
||||||
|
|
||||||
@OrganizationTableColumn(labelId = 547405, text = "管理员", width = "20%", column = "ec_manager", transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getManagerName")
|
|
||||||
|
@OrganizationTableColumn(labelId = 547405, text = "管理员", width = "20%", column = "ec_manager", transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getManagerName",otherPara = "column:manager_type")
|
||||||
private Integer ecManager;
|
private Integer ecManager;
|
||||||
|
|
||||||
@OrganizationTableColumn(labelId = 547407, text = "可管理组织机构", width = "40%", column = "ec_rolelevel", transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getRoleLevel")
|
@OrganizationTableColumn(labelId = 547407, text = "可管理组织机构", width = "40%", column = "ec_rolelevel", transmethod = "com.engine.organization.transmethod.ManagerDetachTransMethod.getRoleLevel")
|
||||||
|
|
|
||||||
|
|
@ -411,6 +411,10 @@ public class ExtendInfoBO {
|
||||||
searchConditionItem = new SearchConditionItem(ConditionType.BROWSER, fieldlabel, new String[]{fieldname}, browserbean);
|
searchConditionItem = new SearchConditionItem(ConditionType.BROWSER, fieldlabel, new String[]{fieldname}, browserbean);
|
||||||
} else {
|
} else {
|
||||||
searchConditionItem = conditionFactory.createCondition(ConditionType.BROWSER, fieldlabel, fieldname, detailtype);
|
searchConditionItem = conditionFactory.createCondition(ConditionType.BROWSER, fieldlabel, fieldname, detailtype);
|
||||||
|
//隐藏虚拟组织
|
||||||
|
if(searchConditionItem != null ) {
|
||||||
|
searchConditionItem.getBrowserConditionParam().setHideVirtualOrg(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 岗位浏览按钮
|
// 岗位浏览按钮
|
||||||
if ("666".equals(detailtype)) {
|
if ("666".equals(detailtype)) {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:dxfeng
|
* @author:dxfeng
|
||||||
* @createTime: 2023/01/05
|
* @createTime: 2023/01/05
|
||||||
|
|
@ -19,4 +21,21 @@ public class SearchTemplateParam {
|
||||||
//private boolean selected;
|
//private boolean selected;
|
||||||
private String showname;
|
private String showname;
|
||||||
private String fields;
|
private String fields;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
SearchTemplateParam that = (SearchTemplateParam) o;
|
||||||
|
return key.equals(that.key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,4 +64,6 @@ public class JclOrgCustomTemplatePO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Integer overall;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -26,4 +26,5 @@ public class SearchTemplatePO {
|
||||||
private Integer creator;
|
private Integer creator;
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
private Integer overall;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import lombok.NoArgsConstructor;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@OrganizationTable(pageId = "0cdfd5bb-dc09-11ec-b69e-00ffcbed7508",
|
@OrganizationTable(pageId = "0cdfd5bb-dc09-11ec-b69e-00ffcbed7508",
|
||||||
fields = "t.id,t.is_used,s.control_dimension,t.plan_id,t.comp_id,t.dept_id,t.job_id,t.staff_num,t.permanent_num,t.freeze_num,t.lack_status,t.staff_desc",
|
fields = "t.id,t.is_used,s.control_dimension,t.plan_id,t.comp_id,t.dept_id,t.job_id,t.staff_num,t.permanent_num,t.freeze_num,t.lack_status,t.staff_desc,t.description",
|
||||||
fromSql = "FROM jcl_org_staff t inner join jcl_org_staffplan s on t.plan_id = s.id",
|
fromSql = "FROM jcl_org_staff t inner join jcl_org_staffplan s on t.plan_id = s.id",
|
||||||
orderby = "id desc",
|
orderby = "id desc",
|
||||||
primarykey = "id",
|
primarykey = "id",
|
||||||
|
|
@ -91,4 +91,11 @@ public class StaffTableVO {
|
||||||
@OrganizationTableColumn(labelId = 547349, text = "编制描述", width = "10%", column = "staff_desc")
|
@OrganizationTableColumn(labelId = 547349, text = "编制描述", width = "10%", column = "staff_desc")
|
||||||
private String staffDesc;
|
private String staffDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述说明
|
||||||
|
*/
|
||||||
|
@OrganizationTableColumn(labelId = 547142, text = "描述说明", width = "10%", column = "description")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@
|
||||||
<select id="getIdByNameAndPid" resultType="java.lang.Integer">
|
<select id="getIdByNameAndPid" resultType="java.lang.Integer">
|
||||||
select id
|
select id
|
||||||
from hrmdepartment
|
from hrmdepartment
|
||||||
where departmentName = #{departmentName}
|
where departmentmark = #{departmentName}
|
||||||
and subCompanyId1 = #{subCompanyId1}
|
and subCompanyId1 = #{subCompanyId1}
|
||||||
and supDepId = #{supDepId}
|
and supDepId = #{supDepId}
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,9 @@ public interface ManagerDetachMapper {
|
||||||
|
|
||||||
ManagerDetachPO getDetachById(@Param("id") Integer id);
|
ManagerDetachPO getDetachById(@Param("id") Integer id);
|
||||||
|
|
||||||
List<ManagerDetachPO> getDetachListById(@Param("ecManager") Integer ecManager);
|
List<ManagerDetachPO> getDetachListById(@Param("ecManager") Integer ecManager,@Param("managerType") Integer managerType);
|
||||||
|
|
||||||
|
List<ManagerDetachPO> selectDetachListByManager(@Param("ids") Collection<Integer> ids);
|
||||||
|
|
||||||
ManagerDetachPO selectManagerDetachByUid(@Param("uid") Integer uId);
|
ManagerDetachPO selectManagerDetachByUid(@Param("uid") Integer uId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,19 @@
|
||||||
from jcl_org_detach t
|
from jcl_org_detach t
|
||||||
WHERE delete_type = 0
|
WHERE delete_type = 0
|
||||||
and ec_manager = #{ecManager}
|
and ec_manager = #{ecManager}
|
||||||
|
and manager_type = #{managerType}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDetachListByManager" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
from jcl_org_detach t
|
||||||
|
WHERE delete_type = 0
|
||||||
|
and manager_type = 1
|
||||||
|
and ec_manager in
|
||||||
|
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectManagerDetachByUid" resultMap="BaseResultMap">
|
<select id="selectManagerDetachByUid" resultMap="BaseResultMap">
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@
|
||||||
FROM cus_formfield t1,
|
FROM cus_formfield t1,
|
||||||
cus_formdict t2
|
cus_formdict t2
|
||||||
WHERE t1.fieldid = t2.id
|
WHERE t1.fieldid = t2.id
|
||||||
|
AND t1.isuse = 1
|
||||||
AND t1.scope = 'HrmCustomFieldByInfoType'
|
AND t1.scope = 'HrmCustomFieldByInfoType'
|
||||||
AND t1.scopeid = #{scopeId}
|
AND t1.scopeid = #{scopeId}
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,8 @@ public interface JobMapper {
|
||||||
* @param parentJob
|
* @param parentJob
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob);
|
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob,
|
||||||
|
@Param("jobactivitymark") String jobactivitymark,@Param("jobgroupremark") String jobgroupremark);
|
||||||
|
|
||||||
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
|
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -483,13 +483,13 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getIdByNameAndPid" resultType="java.lang.Long">
|
<select id="getIdByNameAndPid" resultType="java.lang.Long">
|
||||||
select
|
select t.id from jcl_org_job t
|
||||||
t.id
|
|
||||||
from
|
|
||||||
jcl_org_job t
|
|
||||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||||
where
|
left join hrmjobactivities j on h.jobactivityid = j.id
|
||||||
delete_type = 0
|
left join hrmjobgroups f on j.jobgroupid = f.id
|
||||||
|
where delete_type = 0
|
||||||
|
and j.jobactivitymark = #{jobactivitymark}
|
||||||
|
and f.jobgroupremark = #{jobgroupremark}
|
||||||
and h.JOBTITLENAME = #{jobName}
|
and h.JOBTITLENAME = #{jobName}
|
||||||
and ec_company = #{parentCompany}
|
and ec_company = #{parentCompany}
|
||||||
<include refid="nullparentDept"/>
|
<include refid="nullparentDept"/>
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ public interface HrmResourceMapper {
|
||||||
*/
|
*/
|
||||||
List<SearchTemplateParam> getCustomTemplatesByUser(@Param("userId") Integer userId);
|
List<SearchTemplateParam> getCustomTemplatesByUser(@Param("userId") Integer userId);
|
||||||
|
|
||||||
|
List<SearchTemplateParam> getCustomOverAll();
|
||||||
|
|
||||||
SearchTemplatePO getSearchTemplateById(@Param("id") String id);
|
SearchTemplatePO getSearchTemplateById(@Param("id") String id);
|
||||||
|
|
||||||
SearchTemplatePO getSearchTemplateByName(@Param("userId") Integer userId, @Param("name") String name);
|
SearchTemplatePO getSearchTemplateByName(@Param("userId") Integer userId, @Param("name") String name);
|
||||||
|
|
@ -65,6 +67,10 @@ public interface HrmResourceMapper {
|
||||||
|
|
||||||
SearchTemplatePO getUsedCustomTemplateByUser(@Param("userId") Integer userId);
|
SearchTemplatePO getUsedCustomTemplateByUser(@Param("userId") Integer userId);
|
||||||
|
|
||||||
|
SearchTemplatePO getUsedSerarchTemplateByUser(@Param("userId") Integer userId);
|
||||||
|
|
||||||
|
SearchTemplatePO getOverallCustomTemplate();
|
||||||
|
|
||||||
Integer insertSearchTemplate(SearchTemplatePO templatePO);
|
Integer insertSearchTemplate(SearchTemplatePO templatePO);
|
||||||
|
|
||||||
Integer deleteSearchTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
|
Integer deleteSearchTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
|
||||||
|
|
@ -73,6 +79,8 @@ public interface HrmResourceMapper {
|
||||||
|
|
||||||
Integer deleteCustomTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
|
Integer deleteCustomTemplate(@Param("id") Integer Id, @Param("userId") Integer userId);
|
||||||
|
|
||||||
|
Integer updateCustomTemplateUsed(@Param("userId") Integer userId);
|
||||||
|
|
||||||
|
|
||||||
String queryLabelName(@Param("fieldName") String fieldName, @Param("scopeId") String scopeId, @Param("language") Integer language);
|
String queryLabelName(@Param("fieldName") String fieldName, @Param("scopeId") String scopeId, @Param("language") Integer language);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,9 @@
|
||||||
<result column="name" property="showname"/>
|
<result column="name" property="showname"/>
|
||||||
<!-- <result column="selected" property="selected"/>-->
|
<!-- <result column="selected" property="selected"/>-->
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<update id="updateCustomTemplateUsed">
|
||||||
|
update JCL_ORG_SEARCH_TEMPLATE set isused = null where creator = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
|
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
|
||||||
|
|
@ -147,7 +150,14 @@
|
||||||
select id,
|
select id,
|
||||||
name
|
name
|
||||||
from jcl_org_custom_template
|
from jcl_org_custom_template
|
||||||
where creator = #{userId}
|
where creator = #{userId} and overall is null
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getCustomOverAll" resultMap="SearchTemplateMap">
|
||||||
|
select id,
|
||||||
|
name
|
||||||
|
from jcl_org_custom_template
|
||||||
|
where overall = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertSearchTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
|
<insert id="insertSearchTemplate" parameterType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO"
|
||||||
|
|
@ -176,6 +186,9 @@
|
||||||
<if test="workFields != null">
|
<if test="workFields != null">
|
||||||
work_fields,
|
work_fields,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="isused != null">
|
||||||
|
isused,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
<if test="creator != null">
|
<if test="creator != null">
|
||||||
|
|
@ -199,6 +212,9 @@
|
||||||
<if test="workFields != null">
|
<if test="workFields != null">
|
||||||
#{workFields},
|
#{workFields},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="isused != null">
|
||||||
|
#{isused},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -445,9 +461,19 @@
|
||||||
select *
|
select *
|
||||||
from jcl_org_custom_template
|
from jcl_org_custom_template
|
||||||
where ISUSED = 1
|
where ISUSED = 1
|
||||||
|
and overall is null
|
||||||
and creator = #{userId}
|
and creator = #{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getOverallCustomTemplate"
|
||||||
|
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
|
||||||
|
select *
|
||||||
|
from jcl_org_custom_template
|
||||||
|
where overall = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectByDepartmentId" resultType="com.engine.organization.entity.hrmresource.po.ResourceChartPO">
|
<select id="selectByDepartmentId" resultType="com.engine.organization.entity.hrmresource.po.ResourceChartPO">
|
||||||
select id,workcode,lastname,sex,departmentid,subcompanyid1,jobtitle,status,mobile
|
select id,workcode,lastname,sex,departmentid,subcompanyid1,jobtitle,status,mobile
|
||||||
from hrmresource where departmentid = #{departmentId} and status < 4 order by id
|
from hrmresource where departmentid = #{departmentId} and status < 4 order by id
|
||||||
|
|
@ -462,5 +488,12 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
order by id
|
order by id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getUsedSerarchTemplateByUser"
|
||||||
|
resultType="com.engine.organization.entity.hrmresource.po.SearchTemplatePO">
|
||||||
|
select *
|
||||||
|
from jcl_org_search_template
|
||||||
|
where ISUSED = 1
|
||||||
|
and creator = #{userId}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -34,8 +34,10 @@ public interface JclOrgCustomTemplateMapper {
|
||||||
|
|
||||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||||
|
|
||||||
int updateUsed(@Param("isused")String isused,@Param("id") String id,@Param("creator") String creator);
|
int updateUsed(@Param("overall")Integer overall,@Param("isused")String isused,@Param("id") String id,@Param("creator") String creator);
|
||||||
|
|
||||||
JclOrgCustomTemplatePO queryIsusedTemp(@Param("isused")String isused,@Param("creator") String creator);
|
JclOrgCustomTemplatePO queryIsusedTemp(@Param("isused")String isused,@Param("creator") String creator);
|
||||||
|
|
||||||
|
JclOrgCustomTemplatePO queryOverAll();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,13 @@
|
||||||
<result property="creator" column="creator" jdbcType="INTEGER"/>
|
<result property="creator" column="creator" jdbcType="INTEGER"/>
|
||||||
<result property="createTime" column="create_time" jdbcType="DATE"/>
|
<result property="createTime" column="create_time" jdbcType="DATE"/>
|
||||||
<result property="updateTime" column="update_time" jdbcType="DATE"/>
|
<result property="updateTime" column="update_time" jdbcType="DATE"/>
|
||||||
|
<result property="overall" column="overall"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id,name,basic_fields,
|
id,name,basic_fields,
|
||||||
personal_fields,work_fields,isused,
|
personal_fields,work_fields,isused,
|
||||||
creator,create_time,update_time
|
creator,create_time,update_time,overall
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||||
|
|
@ -31,7 +32,7 @@
|
||||||
<select id="listAllByCreator" resultMap="BaseResultMap">
|
<select id="listAllByCreator" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from jcl_org_custom_template where creator = #{creator} order by id
|
from jcl_org_custom_template where creator = #{creator} order by id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||||
|
|
@ -132,8 +133,9 @@
|
||||||
<update id="updateUsed" parameterType="java.lang.String">
|
<update id="updateUsed" parameterType="java.lang.String">
|
||||||
update JCL_ORG_CUSTOM_TEMPLATE set isused = #{isused}
|
update JCL_ORG_CUSTOM_TEMPLATE set isused = #{isused}
|
||||||
<where>
|
<where>
|
||||||
|
overall is null
|
||||||
<if test="id !=null">
|
<if test="id !=null">
|
||||||
id = #{id}
|
and id = #{id}
|
||||||
</if>
|
</if>
|
||||||
<if test="creator !=null">
|
<if test="creator !=null">
|
||||||
and creator = #{creator}
|
and creator = #{creator}
|
||||||
|
|
@ -144,9 +146,17 @@
|
||||||
<select id="queryIsusedTemp" parameterType="java.lang.String" resultMap="BaseResultMap">
|
<select id="queryIsusedTemp" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
from JCL_ORG_CUSTOM_TEMPLATE t where t.isused = #{isused} and t.creator = #{creator}
|
from JCL_ORG_CUSTOM_TEMPLATE t where t.isused = #{isused} and t.creator = #{creator} and overall is null
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryOverAll" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from JCL_ORG_CUSTOM_TEMPLATE t where overall = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="listAllIdByCreator" resultType="java.lang.Long">
|
<select id="listAllIdByCreator" resultType="java.lang.Long">
|
||||||
select
|
select
|
||||||
id
|
id
|
||||||
|
|
|
||||||
|
|
@ -101,4 +101,13 @@ public interface ChartService {
|
||||||
* @return: java.util.Map<java.lang.Integer,com.engine.organization.entity.chart.HrmLabelVO>
|
* @return: java.util.Map<java.lang.Integer,com.engine.organization.entity.chart.HrmLabelVO>
|
||||||
*/
|
*/
|
||||||
Map<Integer, HrmLabelVO> selectLabel();
|
Map<Integer, HrmLabelVO> selectLabel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 历史版本删除
|
||||||
|
* @Author: liang.cheng
|
||||||
|
* @Date: 2024/8/1 4:30 PM
|
||||||
|
* @param: []
|
||||||
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> versionDelete(Integer versionId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ public interface HrmResourceService {
|
||||||
* @param params
|
* @param params
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer saveCustomTemplate(SearchTemplateParam params);
|
Map<String, Object> saveCustomTemplate(SearchTemplateParam params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量修改保存定制列模板
|
* 批量修改保存定制列模板
|
||||||
|
|
@ -179,4 +179,12 @@ public interface HrmResourceService {
|
||||||
Map<String, Object> chartResourceList(Integer departmentId,String versionId,String dimension,String statusValue);
|
Map<String, Object> chartResourceList(Integer departmentId,String versionId,String dimension,String statusValue);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 将当前模板应用到所有人
|
||||||
|
* @Author: liang.cheng
|
||||||
|
* @Date: 2024/7/23 3:02 PM
|
||||||
|
* @param: [params]
|
||||||
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> customOverall(Map<String, Object> params);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
// 根结点
|
// 根结点
|
||||||
String root = Util.null2String(params.get("root"));
|
String root = Util.null2String(params.get("root"));
|
||||||
root = StringUtils.isBlank(root) ? "0" : root;
|
root = StringUtils.isBlank(root) ? "0" : root;
|
||||||
|
boolean isDepartment = root.startsWith("d");
|
||||||
|
|
||||||
// 维度
|
// 维度
|
||||||
String dimension = Util.null2String(params.get("fclass"));
|
String dimension = Util.null2String(params.get("fclass"));
|
||||||
|
|
@ -140,6 +141,10 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
|
|
||||||
// 向下查询数据
|
// 向下查询数据
|
||||||
if (null != topChartPO) {
|
if (null != topChartPO) {
|
||||||
|
// 如果根结点是部门,顶层层级设置为1
|
||||||
|
if(topChartPO.getFtype().equals("2")){
|
||||||
|
topChartPO.setDepartmentDepth(1);
|
||||||
|
}
|
||||||
findChildData(topChartPO, dataList, Integer.parseInt(depth), id, hideDepartment);
|
findChildData(topChartPO, dataList, Integer.parseInt(depth), id, hideDepartment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -461,14 +466,31 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
" versionid = " + versionId + " and companyvirtualid = " + dimension;
|
" versionid = " + versionId + " and companyvirtualid = " + dimension;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (hasVirtualFields) {
|
String numSql = ",a.job_num,a.staff_num";
|
||||||
if (showVirtual) {
|
if (!isRealDimension) {
|
||||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root;
|
numSql = "";
|
||||||
|
}
|
||||||
|
if (root.startsWith("d")) {
|
||||||
|
root = root.replace("d", "");
|
||||||
|
if (hasVirtualFields) {
|
||||||
|
if (showVirtual) {
|
||||||
|
return "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual" + numSql + " from " + DEPARTMENT_TABLE + " a where (a.canceled is null or a.canceled != '1') and " + DEPARTMENT_ID + " = '" + root + "' and versionid = " + versionId;
|
||||||
|
} else {
|
||||||
|
return "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual" + numSql + " from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and (isvirtual is null or isvirtual != '1') and " + DEPARTMENT_ID + " = '" + root + "' and versionid = " + versionId;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root + " and (isvirtual is null or isvirtual != '1')";
|
return "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type" + numSql + " from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and " + DEPARTMENT_ID + " = '" + root + "' and versionid = " + versionId;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root;
|
if (hasVirtualFields) {
|
||||||
|
if (showVirtual) {
|
||||||
|
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual" + numSql + " from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and " + SUB_COMPANY_ID + " = " + root;
|
||||||
|
} else {
|
||||||
|
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual" + numSql + " from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and " + SUB_COMPANY_ID + " = " + root + " and (isvirtual is null or isvirtual != '1')";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type" + numSql + " from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and " + SUB_COMPANY_ID + " = " + root;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -524,6 +546,19 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
public Map<String, Object> getDepartmentTree(Map<String, Object> params) {
|
public Map<String, Object> getDepartmentTree(Map<String, Object> params) {
|
||||||
Map<String, Object> result = new HashMap<>(2);
|
Map<String, Object> result = new HashMap<>(2);
|
||||||
|
|
||||||
|
List<CompanyTreePO> departmentTree = getDepartmentTreeList(params);
|
||||||
|
result.put("departmentTree", departmentTree);
|
||||||
|
result.put("api_status", true);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门树集合
|
||||||
|
*
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<CompanyTreePO> getDepartmentTreeList(Map<String, Object> params) {
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
List<CompanyTreePO> departmentTree = new ArrayList<>();
|
List<CompanyTreePO> departmentTree = new ArrayList<>();
|
||||||
String subCompany = Util.null2String(params.get("subcompany"));
|
String subCompany = Util.null2String(params.get("subcompany"));
|
||||||
|
|
@ -535,11 +570,9 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
String sql = getDepartmentTreeSql(versionId, dimension, subCompany);
|
String sql = getDepartmentTreeSql(versionId, dimension, subCompany);
|
||||||
rs.executeQuery(sql);
|
rs.executeQuery(sql);
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
departmentTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).disabled(!rs.getString("id").startsWith("d")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(versionId, dimension, rs.getString("id"))).build());
|
departmentTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).disabled(false).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(versionId, dimension, rs.getString("id"))).build());
|
||||||
}
|
}
|
||||||
result.put("departmentTree", departmentTree);
|
return departmentTree;
|
||||||
result.put("api_status", true);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -701,6 +734,32 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
return labelData;
|
return labelData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> versionDelete(Integer versionId) {
|
||||||
|
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
//1.删除版本表
|
||||||
|
rs.executeUpdate("delete from jcl_org_chartversion where id = ?",versionId);
|
||||||
|
|
||||||
|
//2.删除历史分部表
|
||||||
|
rs.executeUpdate("delete from jcl_chart_subcompany where versionid = ?",versionId);
|
||||||
|
|
||||||
|
//3.删除历史部门表
|
||||||
|
rs.executeUpdate("delete from jcl_chart_department where versionid = ?",versionId);
|
||||||
|
|
||||||
|
//4.删除历史聚才林岗位表
|
||||||
|
rs.executeUpdate("delete from jcl_chart_job where versionid = ?",versionId);
|
||||||
|
|
||||||
|
//5.删除历史人员表
|
||||||
|
rs.executeUpdate("delete from jcl_chart_resource where versionid = ?",versionId);
|
||||||
|
|
||||||
|
data.put("versionId",versionId);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成人数
|
* 生成人数
|
||||||
* @param stp
|
* @param stp
|
||||||
|
|
@ -1339,15 +1398,28 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
return "select id,companyname as name,'0' as type from " + COMPANY_TABLE + " where id = '" + dimension + "'";
|
return "select id,companyname as name,'0' as type from " + COMPANY_TABLE + " where id = '" + dimension + "'";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (hasVirtualFields) {
|
if(root.startsWith("d")) {
|
||||||
if (showVirtual) {
|
root = root.replace("d", "");
|
||||||
return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where a.id = '" + root + "' order by showorder,id";
|
if (hasVirtualFields) {
|
||||||
|
if (showVirtual) {
|
||||||
|
return "select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (a.canceled is null or a.canceled != '1') and a.id = '" + root + "'";
|
||||||
|
} else {
|
||||||
|
return "select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (canceled is null or canceled != '1') and (b.bmlx is null or b.bmlx != '1') and a.id = '" + root + "'";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where a.id = '" + root + "' and (b.fblx is null or b.fblx!='1') order by showorder,id";
|
return "select a.id,a.departmentname as name,'2' as type,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=2 where (canceled is null or canceled != '1') and a.id = '" + root + "'";
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if (hasVirtualFields) {
|
||||||
|
if (showVirtual) {
|
||||||
|
return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where a.id = '" + root + "' order by showorder,id";
|
||||||
|
} else {
|
||||||
|
return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where a.id = '" + root + "' and (b.fblx is null or b.fblx!='1') order by showorder,id";
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return "select a.id,a.subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=1 where a.id = '" + root + "' order by a.showorder,a.id";
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return "select a.id,a.subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=1 where a.id = '" + root + "' order by a.showorder,a.id";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1654,10 +1726,10 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
* @param subCompany 上级Id
|
* @param subCompany 上级Id
|
||||||
* @return SQL
|
* @return SQL
|
||||||
*/
|
*/
|
||||||
private String getDepartmentTreeSql(String versionId, String dimension, String subCompany) {
|
private static String getDepartmentTreeSql(String versionId, String dimension, String subCompany) {
|
||||||
// 是否展示当前数据
|
// 是否展示当前数据
|
||||||
boolean isSearchCurrent = StringUtils.isBlank(versionId) || "0".equals(versionId);
|
boolean isSearchCurrent = StringUtils.isBlank(versionId) || "0".equals(versionId);
|
||||||
boolean isCurrentDimension = StringUtils.isNotBlank(dimension) && !"0".equals(dimension);
|
boolean isNotCurrentDimension = StringUtils.isNotBlank(dimension) && !"0".equals(dimension);
|
||||||
boolean isDepartment = subCompany.startsWith("d");
|
boolean isDepartment = subCompany.startsWith("d");
|
||||||
String sql;
|
String sql;
|
||||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||||
|
|
@ -1665,36 +1737,37 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
subCompany = subCompany.replace("d", "");
|
subCompany = subCompany.replace("d", "");
|
||||||
if (isSearchCurrent) {
|
if (isSearchCurrent) {
|
||||||
sql = "select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from hrmdepartment where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany;
|
sql = "select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from hrmdepartment where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany;
|
||||||
if (isCurrentDimension) {
|
sql += " order by showorder,id ";
|
||||||
|
if (isNotCurrentDimension) {
|
||||||
sql = "select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany;
|
sql = "select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany;
|
||||||
}
|
}
|
||||||
sql += " order by showorder,id ";
|
|
||||||
} else {
|
} else {
|
||||||
sql = "select " + dbType.concat("d", "departmentid") + "as id, departmentid as value, departmentname as title, " + dbType.concat("d", "supdepartmentid") + " as pId from jcl_chart_department where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepartmentid", "0") + " = " + subCompany;
|
sql = "select " + dbType.concat("d", "departmentid") + "as id, departmentid as value, departmentname as title, " + dbType.concat("d", "supdepartmentid") + " as pId from jcl_chart_department where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepartmentid", "0") + " = " + subCompany;
|
||||||
if (isCurrentDimension) {
|
if (isNotCurrentDimension) {
|
||||||
sql = "select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany;
|
sql = "select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany;
|
||||||
}
|
}
|
||||||
// 添加时间轴条件
|
// 添加时间轴条件
|
||||||
sql += " and versionid = " + versionId;
|
sql += " and versionid = " + versionId;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// TODO 分权
|
||||||
if (isSearchCurrent) {
|
if (isSearchCurrent) {
|
||||||
sql = "select " + dbType.concat("", "id") + " as id, id as value, subcompanyname as title, supsubcomid as pId, showorder from hrmsubcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcomid", "0") + " = " + subCompany +
|
sql = "select " + dbType.concat("", "id") + " as id, id as value, subcompanyname as title, supsubcomid as pId, showorder from hrmsubcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcomid", "0") + " = " + subCompany +
|
||||||
" union select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, subcompanyid1 as pId, showorder from hrmdepartment where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and " + dbType.ifNull("subcompanyid1", "0") + " = " + subCompany;
|
" union select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, subcompanyid1 as pId, showorder from hrmdepartment where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and " + dbType.ifNull("subcompanyid1", "0") + " = " + subCompany;
|
||||||
if (isCurrentDimension) {
|
sql += " order by showorder,id ";
|
||||||
|
if (isNotCurrentDimension) {
|
||||||
sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcomid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " +
|
sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcomid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " +
|
||||||
" union select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, subcompanyid1 as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid1", "0") + " = " + subCompany;
|
" union select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, subcompanyid1 as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid1", "0") + " = " + subCompany;
|
||||||
}
|
}
|
||||||
sql += " order by showorder,id ";
|
|
||||||
} else {
|
} else {
|
||||||
sql = "select " + dbType.concat("", "subcompanyid") + " as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany +
|
sql = "select " + dbType.concat("", "subcompanyid") + " as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and versionid = " + versionId +
|
||||||
" union select " + dbType.concat("d", "subcompanyid") + "as id, subcompanyid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany;
|
" union select " + dbType.concat("d", "departmentid") + "as id, departmentid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany + " and versionid = " + versionId ;
|
||||||
if (isCurrentDimension) {
|
if (isNotCurrentDimension) {
|
||||||
sql = "select " + dbType.concat("", "subcompanyvirtualid") + " as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " +
|
sql = "select " + dbType.concat("", "subcompanyvirtualid") + " as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " + " and versionid = " + versionId +
|
||||||
" union select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid", "0") + " = " + subCompany;
|
" union select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid", "0") + " = " + subCompany + " and versionid = " + versionId ;
|
||||||
}
|
}
|
||||||
// 添加时间轴条件
|
//// 添加时间轴条件
|
||||||
sql += " and versionid = " + versionId;
|
//sql += " and versionid = " + versionId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sql;
|
return sql;
|
||||||
|
|
@ -1716,7 +1789,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
||||||
* @param subCompany 上级元素ID
|
* @param subCompany 上级元素ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean judgeTreeLeaf(String versionId, String dimension, String subCompany) {
|
private static boolean judgeTreeLeaf(String versionId, String dimension, String subCompany) {
|
||||||
RecordSet recordSet = new RecordSet();
|
RecordSet recordSet = new RecordSet();
|
||||||
String sql = getDepartmentTreeSql(versionId, dimension, subCompany);
|
String sql = getDepartmentTreeSql(versionId, dimension, subCompany);
|
||||||
recordSet.executeQuery(sql);
|
recordSet.executeQuery(sql);
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,14 @@ import com.engine.organization.component.OrganizationWeaTable;
|
||||||
import com.engine.organization.entity.department.bo.DepartmentBO;
|
import com.engine.organization.entity.department.bo.DepartmentBO;
|
||||||
import com.engine.organization.entity.department.dto.DepartmentListDTO;
|
import com.engine.organization.entity.department.dto.DepartmentListDTO;
|
||||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||||
|
import com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO;
|
||||||
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
|
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
|
||||||
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
||||||
import com.engine.organization.entity.staff.po.StaffPO;
|
import com.engine.organization.entity.staff.po.StaffPO;
|
||||||
import com.engine.organization.entity.staff.vo.StaffTableVO;
|
import com.engine.organization.entity.staff.vo.StaffTableVO;
|
||||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||||
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
||||||
|
import com.engine.organization.mapper.resource.JclOrgCustomTemplateMapper;
|
||||||
import com.engine.organization.mapper.resource.ResourceMapper;
|
import com.engine.organization.mapper.resource.ResourceMapper;
|
||||||
import com.engine.organization.mapper.staff.StaffMapper;
|
import com.engine.organization.mapper.staff.StaffMapper;
|
||||||
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
||||||
|
|
@ -141,18 +143,31 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
||||||
HrmResourceServiceImpl hrmResourceService = ServiceUtil.getService(HrmResourceServiceImpl.class,user);
|
HrmResourceServiceImpl hrmResourceService = ServiceUtil.getService(HrmResourceServiceImpl.class,user);
|
||||||
List<SearchConditionGroup> allConditions = hrmResourceService.getAllConditions();
|
List<SearchConditionGroup> allConditions = hrmResourceService.getAllConditions();
|
||||||
|
|
||||||
List<String> columnList;
|
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID()));
|
||||||
|
|
||||||
// 查询当前台账定制列
|
//2.是否存在通用模板
|
||||||
SearchTemplatePO usedCustomTemplate = MapperProxyFactory.getProxy(HrmResourceMapper.class).getUsedCustomTemplateByUser(user.getUID());
|
if (null == jclOrgCustomTemplatePO) {
|
||||||
if (null == usedCustomTemplate) {
|
jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryOverAll();
|
||||||
// 默认列定制
|
|
||||||
String selectKeys = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid";
|
|
||||||
columnList = Arrays.asList(selectKeys.split(","));
|
|
||||||
} else {
|
|
||||||
columnList = hrmResourceService.getSelectKeys(usedCustomTemplate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String columns = "";
|
||||||
|
if (jclOrgCustomTemplatePO != null) {
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getBasicFields())) {
|
||||||
|
columns = jclOrgCustomTemplatePO.getBasicFields();
|
||||||
|
}
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getPersonalFields())) {
|
||||||
|
columns = columns + "," + jclOrgCustomTemplatePO.getPersonalFields();
|
||||||
|
}
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getWorkFields())) {
|
||||||
|
columns = columns + "," + jclOrgCustomTemplatePO.getWorkFields();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//初次使用,无模板初始值
|
||||||
|
columns = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_subcompanyid1,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid,-1_hrm_sporder";
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> columnList = Arrays.asList(columns.split(","));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BigDecimal decimal = new BigDecimal(100 / columnList.size());
|
BigDecimal decimal = new BigDecimal(100 / columnList.size());
|
||||||
|
|
@ -168,7 +183,8 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ
|
||||||
weaTableColumn.setText(MapperProxyFactory.getProxy(HrmResourceMapper.class).queryLabelName(fieldName, scopeId, user.getLanguage()));
|
weaTableColumn.setText(MapperProxyFactory.getProxy(HrmResourceMapper.class).queryLabelName(fieldName, scopeId, user.getLanguage()));
|
||||||
weaTableColumn.setColumn(hrmResourceService.buildTableSql(columnName).replace(".", "_"));
|
weaTableColumn.setColumn(hrmResourceService.buildTableSql(columnName).replace(".", "_"));
|
||||||
weaTableColumn.setDisplay(columnList.contains(columnName) ? WeaBoolAttr.TRUE : WeaBoolAttr.FALSE);
|
weaTableColumn.setDisplay(columnList.contains(columnName) ? WeaBoolAttr.TRUE : WeaBoolAttr.FALSE);
|
||||||
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue");
|
// 导出专用转换,去除html标签
|
||||||
|
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValueExp");
|
||||||
weaTableColumn.setOtherpara(columnName);
|
weaTableColumn.setOtherpara(columnName);
|
||||||
weaTableColumn.setWidth(decimal.setScale(2, RoundingMode.HALF_UP).doubleValue() + "%");
|
weaTableColumn.setWidth(decimal.setScale(2, RoundingMode.HALF_UP).doubleValue() + "%");
|
||||||
if (weaTableColumn.getDisplay().getBoolVal()) {
|
if (weaTableColumn.getDisplay().getBoolVal()) {
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ public class FunctionOutStaffServiceImpl {
|
||||||
|
|
||||||
private Integer frozenStaffNums(StaffOutParam param) {
|
private Integer frozenStaffNums(StaffOutParam param) {
|
||||||
StaffPO staffPO = select(param);
|
StaffPO staffPO = select(param);
|
||||||
List<Integer> numberF = Arrays.asList(staffPO.getFreezeNum(),param.getNum());
|
List<Integer> numberF = Arrays.asList(staffPO.getFreezeNum(),param.getNum(),staffPO.getPermanentNum());
|
||||||
//1.增加冻结数 (num为负数时为减少冻结数)
|
//1.增加冻结数 (num为负数时为减少冻结数)
|
||||||
Integer sum = numberF.stream()
|
Integer sum = numberF.stream()
|
||||||
.mapToInt(Integer::intValue)
|
.mapToInt(Integer::intValue)
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import com.engine.organization.entity.search.QuickSearchDetail;
|
||||||
import com.engine.organization.entity.searchtree.SearchTree;
|
import com.engine.organization.entity.searchtree.SearchTree;
|
||||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||||
import com.engine.organization.enums.HrmGroupEnum;
|
import com.engine.organization.enums.HrmGroupEnum;
|
||||||
|
import com.engine.organization.exception.OrganizationRunTimeException;
|
||||||
import com.engine.organization.mapper.comp.CompMapper;
|
import com.engine.organization.mapper.comp.CompMapper;
|
||||||
import com.engine.organization.mapper.condition.QuickSearchMapper;
|
import com.engine.organization.mapper.condition.QuickSearchMapper;
|
||||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||||
|
|
@ -149,6 +150,12 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
||||||
table.setSqlwhere(sqlWhere);
|
table.setSqlwhere(sqlWhere);
|
||||||
List<WeaTableColumn> weaTableColumnList = new ArrayList<>();
|
List<WeaTableColumn> weaTableColumnList = new ArrayList<>();
|
||||||
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID()));
|
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID()));
|
||||||
|
|
||||||
|
//2.是否存在通用模板
|
||||||
|
if (null == jclOrgCustomTemplatePO) {
|
||||||
|
jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryOverAll();
|
||||||
|
}
|
||||||
|
|
||||||
String columns = "";
|
String columns = "";
|
||||||
List<String> fields = new ArrayList<>();
|
List<String> fields = new ArrayList<>();
|
||||||
List<SearchConditionGroup> allConditions = getAllConditions();
|
List<SearchConditionGroup> allConditions = getAllConditions();
|
||||||
|
|
@ -266,6 +273,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
||||||
templatePO.setCreator(user.getUID());
|
templatePO.setCreator(user.getUID());
|
||||||
templatePO.setCreateTime(new Date());
|
templatePO.setCreateTime(new Date());
|
||||||
templatePO.setUpdateTime(new Date());
|
templatePO.setUpdateTime(new Date());
|
||||||
|
templatePO.setIsused("1");
|
||||||
|
// 将之前的模板,isused置为null
|
||||||
|
getHrmResourceMapper().updateCustomTemplateUsed(user.getUID());
|
||||||
getHrmResourceMapper().insertSearchTemplate(templatePO);
|
getHrmResourceMapper().insertSearchTemplate(templatePO);
|
||||||
return templatePO.getId();
|
return templatePO.getId();
|
||||||
}
|
}
|
||||||
|
|
@ -314,39 +324,53 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
||||||
int userUID = user.getUID();
|
int userUID = user.getUID();
|
||||||
// 根据ID查询所存储的模板
|
// 根据ID查询所存储的模板
|
||||||
List<SearchTemplateParam> templates;
|
List<SearchTemplateParam> templates;
|
||||||
|
boolean addDefault = true;
|
||||||
if ("custom".equals(type)) {
|
if ("custom".equals(type)) {
|
||||||
templates = getHrmResourceMapper().getCustomTemplatesByUser(userUID);
|
templates = getHrmResourceMapper().getCustomTemplatesByUser(userUID);
|
||||||
|
SearchTemplatePO overallCustomTemplate = getHrmResourceMapper().getOverallCustomTemplate();
|
||||||
|
if (null != overallCustomTemplate) {
|
||||||
|
if("-1".equals(id)) {
|
||||||
|
id = overallCustomTemplate.getId().toString();
|
||||||
|
}
|
||||||
|
templates.add(SearchTemplateParam.builder().key(overallCustomTemplate.getId().toString()).showname(overallCustomTemplate.getName()).build());
|
||||||
|
//}
|
||||||
|
addDefault = false;
|
||||||
|
}
|
||||||
returnMap.put("id", id);
|
returnMap.put("id", id);
|
||||||
// SearchTemplatePO usedCustomTemplate = getHrmResourceMapper().getUsedCustomTemplateByUser(user.getUID());
|
|
||||||
// if (null != usedCustomTemplate) {
|
|
||||||
// returnMap.put("templateId", usedCustomTemplate.getId().toString());
|
|
||||||
// } else {
|
|
||||||
// returnMap.put("templateId", "-1");
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
templates = getHrmResourceMapper().getSearchTemplatesByUser(userUID);
|
templates = getHrmResourceMapper().getSearchTemplatesByUser(userUID);
|
||||||
}
|
}
|
||||||
templates.add(0, SearchTemplateParam.builder().key("-1").showname("默认模板").build());
|
if (addDefault) {
|
||||||
returnMap.put("templates", templates);
|
templates.add(0, SearchTemplateParam.builder().key("-1").showname("默认模板").build());
|
||||||
|
}
|
||||||
|
|
||||||
|
LinkedHashSet<Object> objects = new LinkedHashSet<>(templates);
|
||||||
|
returnMap.put("templates", objects);
|
||||||
return returnMap;
|
return returnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer saveCustomTemplate(SearchTemplateParam params) {
|
public Map<String, Object> saveCustomTemplate(SearchTemplateParam params) {
|
||||||
// 重复名称校验
|
// 重复名称校验
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
SearchTemplatePO searchTemplateByName = getHrmResourceMapper().getCustomTemplateByName(user.getUID(), params.getShowname());
|
SearchTemplatePO searchTemplateByName = getHrmResourceMapper().getCustomTemplateByName(user.getUID(), params.getShowname());
|
||||||
OrganizationAssert.isFalse("默认模板".equals(params.getShowname()) || null != searchTemplateByName, SystemEnv.getHtmlLabelName(547439, user.getLanguage()));
|
OrganizationAssert.isFalse("默认模板".equals(params.getShowname()) || null != searchTemplateByName, SystemEnv.getHtmlLabelName(547439, user.getLanguage()));
|
||||||
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
|
SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields());
|
||||||
if (null == templatePO) {
|
OrganizationAssert.notNull(templatePO,"模板存储失败");
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
templatePO.setName(params.getShowname());
|
templatePO.setName(params.getShowname());
|
||||||
templatePO.setCreator(user.getUID());
|
templatePO.setCreator(user.getUID());
|
||||||
templatePO.setIsused("0");
|
templatePO.setIsused("0");
|
||||||
templatePO.setCreateTime(new Date());
|
templatePO.setCreateTime(new Date());
|
||||||
templatePO.setUpdateTime(new Date());
|
templatePO.setUpdateTime(new Date());
|
||||||
|
templatePO.setOverall(0);
|
||||||
getHrmResourceMapper().insertCustomTemplate(templatePO);
|
getHrmResourceMapper().insertCustomTemplate(templatePO);
|
||||||
return templatePO.getId();
|
|
||||||
|
Map<String, Object> param = new HashMap<>();
|
||||||
|
param.put("type","custom");
|
||||||
|
param.put("id",templatePO.getId());
|
||||||
|
data.put("result",getSearchTemplate(param));
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -417,20 +441,21 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
||||||
}
|
}
|
||||||
transferOptions.add(SearchTemplateParam.builder().key(Integer.toString(idx.getAndIncrement())).showname(allCondition.getTitle()).build());
|
transferOptions.add(SearchTemplateParam.builder().key(Integer.toString(idx.getAndIncrement())).showname(allCondition.getTitle()).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询当前使用的模板,没有使用的,则展示默认模板
|
||||||
if ("-1".equals(templateId)) {
|
if ("-1".equals(templateId)) {
|
||||||
// 查询当前使用的模板,没有使用的,则展示默认模板
|
String selectKeys = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid";
|
||||||
SearchTemplatePO usedCustomTemplate = getHrmResourceMapper().getUsedCustomTemplateByUser(user.getUID());
|
transferKeys = Arrays.asList(selectKeys.split(","));
|
||||||
if (null == usedCustomTemplate) {
|
SearchTemplatePO overallCustomTemplate = getHrmResourceMapper().getOverallCustomTemplate();
|
||||||
String selectKeys = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid";
|
if (null != overallCustomTemplate) {
|
||||||
transferKeys = Arrays.asList(selectKeys.split(","));
|
transferKeys = getSelectKeys(overallCustomTemplate);
|
||||||
} else {
|
|
||||||
transferKeys = getSelectKeys(usedCustomTemplate);
|
|
||||||
templateId = usedCustomTemplate.getId().toString();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SearchTemplatePO searchTemplateById = getHrmResourceMapper().getCustomTemplateById(templateId);
|
SearchTemplatePO searchTemplateById = getHrmResourceMapper().getCustomTemplateById(templateId);
|
||||||
transferKeys = getSelectKeys(searchTemplateById);
|
transferKeys = getSelectKeys(searchTemplateById);
|
||||||
}
|
}
|
||||||
|
|
||||||
transferOptions.add(0, SearchTemplateParam.builder().key("").showname("").build());
|
transferOptions.add(0, SearchTemplateParam.builder().key("").showname("").build());
|
||||||
resultMap.put("transferDatas", transferDatas);
|
resultMap.put("transferDatas", transferDatas);
|
||||||
resultMap.put("transferKeys", transferKeys);
|
resultMap.put("transferKeys", transferKeys);
|
||||||
|
|
@ -447,18 +472,22 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
||||||
SearchTemplatePO templatePO = buildSearchTemplateByFields(columns);
|
SearchTemplatePO templatePO = buildSearchTemplateByFields(columns);
|
||||||
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = new JclOrgCustomTemplatePO();
|
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = new JclOrgCustomTemplatePO();
|
||||||
if (StringUtils.isNotBlank(templateId)) {
|
if (StringUtils.isNotBlank(templateId)) {
|
||||||
if (templateId.equals("-1")) {
|
if ("-1".equals(templateId)) {
|
||||||
getJclOrgCustomTemplateMapper().updateUsed("0", null, String.valueOf(user.getUID()));
|
getJclOrgCustomTemplateMapper().updateUsed(0,"0", null, String.valueOf(user.getUID()));
|
||||||
} else {
|
} else {
|
||||||
jclOrgCustomTemplatePO = getJclOrgCustomTemplateMapper().selectByPrimaryKey(Long.parseLong(templateId));
|
jclOrgCustomTemplatePO = getJclOrgCustomTemplateMapper().selectByPrimaryKey(Long.parseLong(templateId));
|
||||||
if (jclOrgCustomTemplatePO != null) {
|
if (jclOrgCustomTemplatePO != null) {
|
||||||
|
//取消已启用模板
|
||||||
|
getJclOrgCustomTemplateMapper().updateUsed(0, "0", null, String.valueOf(user.getUID()));
|
||||||
|
if (!user.isAdmin() && jclOrgCustomTemplatePO.getOverall() != null && "1".equals(jclOrgCustomTemplatePO.getOverall().toString())) {
|
||||||
|
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547857, user.getLanguage()));
|
||||||
|
}
|
||||||
jclOrgCustomTemplatePO.setId(Integer.valueOf(templateId));
|
jclOrgCustomTemplatePO.setId(Integer.valueOf(templateId));
|
||||||
jclOrgCustomTemplatePO.setBasicFields(templatePO.getBasicFields());
|
jclOrgCustomTemplatePO.setBasicFields(templatePO.getBasicFields());
|
||||||
jclOrgCustomTemplatePO.setPersonalFields(templatePO.getPersonalFields());
|
jclOrgCustomTemplatePO.setPersonalFields(templatePO.getPersonalFields());
|
||||||
jclOrgCustomTemplatePO.setWorkFields(templatePO.getWorkFields());
|
jclOrgCustomTemplatePO.setWorkFields(templatePO.getWorkFields());
|
||||||
jclOrgCustomTemplatePO.setIsused(1);
|
jclOrgCustomTemplatePO.setIsused(1);
|
||||||
//取消已启用模板
|
|
||||||
getJclOrgCustomTemplateMapper().updateUsed("0", null, String.valueOf(user.getUID()));
|
|
||||||
//启用当前模板
|
//启用当前模板
|
||||||
getJclOrgCustomTemplateMapper().updateByPrimaryKeySelective(jclOrgCustomTemplatePO);
|
getJclOrgCustomTemplateMapper().updateByPrimaryKeySelective(jclOrgCustomTemplatePO);
|
||||||
}
|
}
|
||||||
|
|
@ -524,6 +553,19 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
||||||
return dataMap;
|
return dataMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> customOverall(Map<String, Object> params) {
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
Map<String, Object> data = new HashMap<>(2);
|
||||||
|
//1.将已有所有人的模板状态改变
|
||||||
|
rs.executeUpdate("update jcl_org_custom_template set overall = null where overall = 1");
|
||||||
|
//2.应用当前模板到所有人
|
||||||
|
String templateId = Util.null2String(params.get("templateId"));
|
||||||
|
boolean b = rs.executeUpdate("update jcl_org_custom_template set overall = 1,isused=1 where id = ?", templateId);
|
||||||
|
data.put("result", b);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
private List<ResourceListColumns> getTableColumns() {
|
private List<ResourceListColumns> getTableColumns() {
|
||||||
List<ResourceListColumns> list = new ArrayList<>();
|
List<ResourceListColumns> list = new ArrayList<>();
|
||||||
int language = user.getLanguage();
|
int language = user.getLanguage();
|
||||||
|
|
@ -589,9 +631,52 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
||||||
btnDatas.put("topMenu", topMenuList);
|
btnDatas.put("topMenu", topMenuList);
|
||||||
btnDatas.put("rightMenu", rightMenuList);
|
btnDatas.put("rightMenu", rightMenuList);
|
||||||
btnDatas.put("hasRight", true);
|
btnDatas.put("hasRight", true);
|
||||||
|
btnDatas.put("loginId", user.getUID());
|
||||||
|
//获取当前用户使用的列定制模板Id
|
||||||
|
btnDatas.put("customTemplateId", getCustomTemplateId());
|
||||||
|
btnDatas.put("searchTemplateId", getSearchTemplateId());
|
||||||
|
|
||||||
return btnDatas;
|
return btnDatas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户使用的列定制模板Id
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getCustomTemplateId() {
|
||||||
|
|
||||||
|
String customTemplateId = "-1";
|
||||||
|
SearchTemplatePO usedCustomTemplate = getHrmResourceMapper().getUsedCustomTemplateByUser(user.getUID());
|
||||||
|
if (null != usedCustomTemplate) {
|
||||||
|
customTemplateId = usedCustomTemplate.getId().toString();
|
||||||
|
} else {
|
||||||
|
//查询全局模板
|
||||||
|
SearchTemplatePO overallCustomTemplate = getHrmResourceMapper().getOverallCustomTemplate();
|
||||||
|
if (null != overallCustomTemplate) {
|
||||||
|
customTemplateId = overallCustomTemplate.getId().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return customTemplateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户使用的查询模板Id
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getSearchTemplateId() {
|
||||||
|
|
||||||
|
String searchTemplateId = "-1";
|
||||||
|
SearchTemplatePO usedCustomTemplate = getHrmResourceMapper().getUsedSerarchTemplateByUser(user.getUID());
|
||||||
|
if (null != usedCustomTemplate) {
|
||||||
|
searchTemplateId = usedCustomTemplate.getId().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchTemplateId;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getTabForm(Map<String, Object> params) {
|
public Map<String, Object> getTabForm(Map<String, Object> params) {
|
||||||
Map<String, Object> apiDatas = new HashMap<>();
|
Map<String, Object> apiDatas = new HashMap<>();
|
||||||
|
|
@ -636,11 +721,19 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
||||||
Map<String, Object> tabInfoMap = new HashMap<>();
|
Map<String, Object> tabInfoMap = new HashMap<>();
|
||||||
tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, false, true));
|
tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, false, true));
|
||||||
List<JclOrgCustomTemplatePO> jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAllByCreator(user.getUID());
|
List<JclOrgCustomTemplatePO> jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAllByCreator(user.getUID());
|
||||||
|
//获取当前使用的模板过滤掉
|
||||||
|
String customTemplateId = getCustomTemplateId();
|
||||||
|
jclOrgCustomTemplatePOS = jclOrgCustomTemplatePOS.stream()
|
||||||
|
.filter(item -> !customTemplateId.equals(String.valueOf(item.getId())))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
List<Integer> isUsed = new ArrayList<>();
|
List<Integer> isUsed = new ArrayList<>();
|
||||||
AtomicInteger index = new AtomicInteger(0);
|
AtomicInteger index = new AtomicInteger(0);
|
||||||
List<Map<String, Object>> collect = jclOrgCustomTemplatePOS.stream().map(item -> {
|
List<Map<String, Object>> collect = jclOrgCustomTemplatePOS.stream().map(item -> {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("id", item.getId());
|
resultMap.put("id", item.getId());
|
||||||
|
resultMap.put("viewAttr", 1);
|
||||||
|
resultMap.put("editTable", false);
|
||||||
resultMap.put("name", item.getName());
|
resultMap.put("name", item.getName());
|
||||||
resultMap.put("createTime", DateUtil.getDate(item.getCreateTime(), "yyyy-MM-dd"));
|
resultMap.put("createTime", DateUtil.getDate(item.getCreateTime(), "yyyy-MM-dd"));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -741,7 +741,7 @@ public class JobServiceImpl extends Service implements JobService {
|
||||||
|
|
||||||
OrganizationAssert.isEmpty(list, SystemEnv.getHtmlLabelName(547137, user.getLanguage()));
|
OrganizationAssert.isEmpty(list, SystemEnv.getHtmlLabelName(547137, user.getLanguage()));
|
||||||
} else {
|
} else {
|
||||||
OrganizationAssert.isTrue(null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable()), SystemEnv.getHtmlLabelName(547430,user.getLanguage()));
|
//OrganizationAssert.isTrue(null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable()), SystemEnv.getHtmlLabelName(547430,user.getLanguage()));
|
||||||
jobNo = autoCreateCompanyNo();
|
jobNo = autoCreateCompanyNo();
|
||||||
}
|
}
|
||||||
return jobNo;
|
return jobNo;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import com.api.browser.bean.SearchConditionGroup;
|
||||||
import com.api.browser.bean.SearchConditionItem;
|
import com.api.browser.bean.SearchConditionItem;
|
||||||
import com.api.browser.bean.SearchConditionOption;
|
import com.api.browser.bean.SearchConditionOption;
|
||||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||||
|
import com.engine.common.service.HrmCommonService;
|
||||||
|
import com.engine.common.service.impl.HrmCommonServiceImpl;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.organization.component.OrganizationWeaTable;
|
import com.engine.organization.component.OrganizationWeaTable;
|
||||||
import com.engine.organization.entity.DeleteParam;
|
import com.engine.organization.entity.DeleteParam;
|
||||||
|
|
@ -25,6 +27,9 @@ import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
import weaver.general.Util;
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.cachecenter.bean.RolemembersComInfo;
|
||||||
|
import weaver.hrm.resource.ResourceComInfo;
|
||||||
|
import weaver.hrm.roles.RolesComInfo;
|
||||||
import weaver.systeminfo.SystemEnv;
|
import weaver.systeminfo.SystemEnv;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -78,32 +83,63 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getForm(Integer id) {
|
public Map<String, Object> getForm(Integer id) {
|
||||||
Map<String, Object> apiDatas = new HashMap<>();
|
Map<String, Object> apiDatas = new HashMap<>();
|
||||||
|
RolesComInfo rolesComInfo = new RolesComInfo();
|
||||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||||
|
List<SearchConditionOption> selectOption = new ArrayList<>();
|
||||||
|
SearchConditionOption pOption = new SearchConditionOption("0", SystemEnv.getHtmlLabelName(547205,user.getLanguage()));
|
||||||
|
SearchConditionOption rOption = new SearchConditionOption("1", SystemEnv.getHtmlLabelName(547388,user.getLanguage()));
|
||||||
|
selectOption.add(pOption);
|
||||||
|
selectOption.add(rOption);
|
||||||
|
|
||||||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||||
SearchConditionOption moduleOption = new SearchConditionOption("0", SystemEnv.getHtmlLabelName(547409,user.getLanguage()), true);
|
SearchConditionOption moduleOption = new SearchConditionOption("0", SystemEnv.getHtmlLabelName(547409,user.getLanguage()), true);
|
||||||
selectOptions.add(moduleOption);
|
selectOptions.add(moduleOption);
|
||||||
|
SearchConditionItem ecManager = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, 547405, "1", "ecManager", "");
|
||||||
|
SearchConditionItem roleId = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, 547388, "267", "roleId", "");
|
||||||
|
|
||||||
SearchConditionItem ecManager = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, true, 547405, "1", "ecManager", "");
|
|
||||||
ecManager.setRules("required|string");
|
|
||||||
SearchConditionItem ecRolelevel = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, 547407, "194", "ecRolelevel", "");
|
SearchConditionItem ecRolelevel = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, 547407, "194", "ecRolelevel", "");
|
||||||
ecRolelevel.setRules("required|string");
|
ecRolelevel.setRules("required|string");
|
||||||
SearchConditionItem module = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, 547408, "module");
|
SearchConditionItem module = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, 547408, "module");
|
||||||
module.setViewAttr(1);
|
module.setViewAttr(1);
|
||||||
module.setDetailtype(2);
|
module.setDetailtype(2);
|
||||||
module.setHasBorder(true);
|
module.setHasBorder(true);
|
||||||
|
SearchConditionItem managerType = OrganizationFormItemUtil.selectItem(user, selectOption, 2, 16, 6, false, 513540, "managerType");
|
||||||
|
managerType.setViewAttr(3);
|
||||||
|
managerType.setRules("required|string");
|
||||||
|
selectItems.add(managerType);
|
||||||
|
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
ManagerDetachPO detachById = getMangeDetachMapper().getDetachById(id);
|
ManagerDetachPO detachById = getMangeDetachMapper().getDetachById(id);
|
||||||
BrowserBean manager = ecManager.getBrowserConditionParam();
|
managerType.setValue(String.valueOf(detachById.getManagerType()));
|
||||||
manager.setReplaceDatas(getEmployeeMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcManager())).build().getIds()));
|
managerType.setViewAttr(1);
|
||||||
ecManager.setBrowserConditionParam(manager);
|
if (detachById.getManagerType() == 0){
|
||||||
|
BrowserBean manager = ecManager.getBrowserConditionParam();
|
||||||
|
manager.setReplaceDatas(getEmployeeMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcManager())).build().getIds()));
|
||||||
|
ecManager.setBrowserConditionParam(manager);
|
||||||
|
selectItems.add(ecManager);
|
||||||
|
}else {
|
||||||
|
BrowserBean role = roleId.getBrowserConditionParam();
|
||||||
|
List<Map<String, Object>> rep = new ArrayList<>();
|
||||||
|
Integer rolesId = detachById.getEcManager();
|
||||||
|
String rolesname = rolesComInfo.getRolesRemark(String.valueOf(rolesId));
|
||||||
|
rep.add(new HashMap<String,Object>(2){{put("name",rolesname);}});
|
||||||
|
rep.add(new HashMap<String,Object>(2){{put("id",rolesId);}});
|
||||||
|
role.setReplaceDatas(rep);
|
||||||
|
roleId.setBrowserConditionParam(role);
|
||||||
|
selectItems.add(roleId);
|
||||||
|
}
|
||||||
BrowserBean roleLevel = ecRolelevel.getBrowserConditionParam();
|
BrowserBean roleLevel = ecRolelevel.getBrowserConditionParam();
|
||||||
roleLevel.setReplaceDatas(getSystemDataMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcRolelevel())).build().getIds()));
|
roleLevel.setReplaceDatas(getSystemDataMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcRolelevel())).build().getIds()));
|
||||||
ecRolelevel.setBrowserConditionParam(roleLevel);
|
ecRolelevel.setBrowserConditionParam(roleLevel);
|
||||||
|
}else {
|
||||||
|
selectItems.add(ecManager);
|
||||||
|
selectItems.add(roleId);
|
||||||
}
|
}
|
||||||
selectItems.add(ecManager);
|
|
||||||
selectItems.add(ecRolelevel);
|
selectItems.add(ecRolelevel);
|
||||||
selectItems.add(module);
|
selectItems.add(module);
|
||||||
|
|
||||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||||
apiDatas.put("condition", addGroups);
|
apiDatas.put("condition", addGroups);
|
||||||
return apiDatas;
|
return apiDatas;
|
||||||
|
|
@ -116,10 +152,10 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int save(ManagerDetachParam param) {
|
public int save(ManagerDetachParam param) {
|
||||||
Integer ecManager = param.getEcManager();
|
Integer ecManager = "0".equals(String.valueOf(param.getManagerType())) ? param.getEcManager() : param.getRoleId();
|
||||||
String noRepeatRoleLevel = param.getEcRolelevel();
|
String noRepeatRoleLevel = param.getEcRolelevel();
|
||||||
// 判断有无重复数据
|
// 判断有无重复数据
|
||||||
List<ManagerDetachPO> detachListById = getMangeDetachMapper().getDetachListById(ecManager);
|
List<ManagerDetachPO> detachListById = getMangeDetachMapper().getDetachListById(ecManager,param.getManagerType());
|
||||||
if (CollectionUtils.isNotEmpty(detachListById)) {
|
if (CollectionUtils.isNotEmpty(detachListById)) {
|
||||||
Set<String> noRepeatRoleLevels = getNoRepeatRoleLevels(detachListById, param.getId());
|
Set<String> noRepeatRoleLevels = getNoRepeatRoleLevels(detachListById, param.getId());
|
||||||
noRepeatRoleLevels.addAll(Arrays.asList(noRepeatRoleLevel.split(",")));
|
noRepeatRoleLevels.addAll(Arrays.asList(noRepeatRoleLevel.split(",")));
|
||||||
|
|
@ -128,7 +164,7 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
|
||||||
getMangeDetachMapper().deleteByIds(collect);
|
getMangeDetachMapper().deleteByIds(collect);
|
||||||
}
|
}
|
||||||
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
|
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
|
||||||
.managerType(0)
|
.managerType(param.getManagerType())
|
||||||
.ecManager(ecManager)
|
.ecManager(ecManager)
|
||||||
.jclManager(ecManager)
|
.jclManager(ecManager)
|
||||||
.ecRolelevel(noRepeatRoleLevel)
|
.ecRolelevel(noRepeatRoleLevel)
|
||||||
|
|
@ -145,10 +181,10 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateDetach(ManagerDetachParam param) {
|
public int updateDetach(ManagerDetachParam param) {
|
||||||
Integer ecManager = param.getEcManager();
|
Integer ecManager = "0".equals(String.valueOf(param.getManagerType())) ? param.getEcManager() : param.getRoleId();
|
||||||
String noRepeatRoleLevel = param.getEcRolelevel();
|
String noRepeatRoleLevel = param.getEcRolelevel();
|
||||||
// 判断有无重复数据
|
// 判断有无重复数据
|
||||||
List<ManagerDetachPO> detachListById = getMangeDetachMapper().getDetachListById(ecManager);
|
List<ManagerDetachPO> detachListById = getMangeDetachMapper().getDetachListById(ecManager,param.getManagerType());
|
||||||
if (CollectionUtils.isNotEmpty(detachListById)) {
|
if (CollectionUtils.isNotEmpty(detachListById)) {
|
||||||
Set<String> noRepeatRoleLevels = getNoRepeatRoleLevels(detachListById,param.getId());
|
Set<String> noRepeatRoleLevels = getNoRepeatRoleLevels(detachListById,param.getId());
|
||||||
noRepeatRoleLevels.addAll(Arrays.asList(noRepeatRoleLevel.split(",")));
|
noRepeatRoleLevels.addAll(Arrays.asList(noRepeatRoleLevel.split(",")));
|
||||||
|
|
@ -212,14 +248,24 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
|
||||||
public static List<Integer> getJclRoleLevels(Integer uId) {
|
public static List<Integer> getJclRoleLevels(Integer uId) {
|
||||||
List<Integer> ecRoleLevels = new ArrayList<>();
|
List<Integer> ecRoleLevels = new ArrayList<>();
|
||||||
ManagerDetachMapper mangeDetachMapper = MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
ManagerDetachMapper mangeDetachMapper = MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
||||||
List<ManagerDetachPO> detachListById = mangeDetachMapper.getDetachListById(uId);
|
//人员
|
||||||
|
List<ManagerDetachPO> detachListById = new ArrayList<>(mangeDetachMapper.getDetachListById(uId,0));
|
||||||
|
//角色
|
||||||
|
HrmCommonService hrmCommonService = new HrmCommonServiceImpl();
|
||||||
|
List<String> roleIds = new ArrayList<>(Arrays.asList(hrmCommonService.getRoleIds(uId).split(",")));
|
||||||
|
List<Integer> integerList = roleIds.stream()
|
||||||
|
.map(Integer::parseInt)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
detachListById.addAll(MapperProxyFactory.getProxy(ManagerDetachMapper.class).selectDetachListByManager(integerList));
|
||||||
for (ManagerDetachPO managerDetachPO : detachListById) {
|
for (ManagerDetachPO managerDetachPO : detachListById) {
|
||||||
List<Integer> ids = Stream.of(managerDetachPO.getJclRolelevel().split(",")).map(Integer::parseInt).collect(Collectors.toList());
|
List<Integer> ids = Stream.of(managerDetachPO.getJclRolelevel().split(",")).map(Integer::parseInt).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(ids)) {
|
if (CollectionUtils.isNotEmpty(ids)) {
|
||||||
ecRoleLevels.addAll(ids);
|
ecRoleLevels.addAll(ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ecRoleLevels;
|
return ecRoleLevels.stream()
|
||||||
|
.distinct() // 去除重复元素
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,54 +58,29 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
||||||
item.put("companyname", rs.getString("companyname"));
|
item.put("companyname", rs.getString("companyname"));
|
||||||
fclasslist.add(item);
|
fclasslist.add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CompanyTreePO> companyTree = new ArrayList<>();
|
|
||||||
String sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = '0'";
|
|
||||||
// 一级分部数据分权处理
|
|
||||||
String dimension = Util.null2String(request2Map.get("fclass"));
|
|
||||||
//版本id
|
|
||||||
String id = Util.null2String(request2Map.get("id"));
|
|
||||||
boolean isRealDimension = StringUtils.isBlank(dimension) || "0".equals(dimension);
|
|
||||||
boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id);
|
|
||||||
if (isRealTime && user.getUID() != 1 && isRealDimension) {
|
|
||||||
DetachUtil detachUtil = new DetachUtil(user);
|
|
||||||
if(detachUtil.isDETACH()) {
|
|
||||||
String ids = detachUtil.getJclRoleLevels();
|
|
||||||
sql = sql + " and id in (" + ids + ")";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rs.executeQuery(sql);
|
|
||||||
while (rs.next()) {
|
|
||||||
companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf("select id from hrmsubcompany where (canceled is null or canceled != '1') and supsubcomid = ?", rs.getString("id"))).build());
|
|
||||||
}
|
|
||||||
result.put("api_status", true);
|
result.put("api_status", true);
|
||||||
result.put("fclasslist", fclasslist);
|
result.put("fclasslist", fclasslist);
|
||||||
result.put("companyTree", companyTree);
|
Map<String, Object> subCompanyTree = getSubCompanyTree(request2Map);
|
||||||
|
result.putAll(subCompanyTree);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getSubCompanyTree(Map<String, Object> params) {
|
public Map<String, Object> getSubCompanyTree(Map<String, Object> params) {
|
||||||
Map<String, Object> result = new HashMap<>(2);
|
Map<String, Object> result = new HashMap<>(2);
|
||||||
|
List<CompanyTreePO> departmentTree = ChartServiceImpl.getDepartmentTreeList(params);
|
||||||
|
result.put("companyTree", departmentTree);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
RecordSet rs = new RecordSet();
|
private String getSubCompanyTreeSql(String id, String fclass, String subcompany) {
|
||||||
List<CompanyTreePO> companyTree = new ArrayList<>();
|
|
||||||
String subcompany = Util.null2String(params.get("subcompany"));
|
|
||||||
if (StringUtils.isBlank(subcompany)) {
|
|
||||||
subcompany = "0";
|
|
||||||
}
|
|
||||||
String fclass = Util.null2String(params.get("fclass"));
|
|
||||||
String id = Util.null2String(params.get("id"));
|
|
||||||
// 是否展示当前数据
|
// 是否展示当前数据
|
||||||
boolean isSearchCurrent = StringUtils.isBlank(id) || "0".equals(id);
|
boolean isSearchCurrent = StringUtils.isBlank(id) || "0".equals(id);
|
||||||
String sql;
|
String sql;
|
||||||
String judgeTreeLeafSql;
|
|
||||||
if (isSearchCurrent) {
|
if (isSearchCurrent) {
|
||||||
sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? ";
|
sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? ";
|
||||||
boolean isRealDimension = StringUtils.isBlank(fclass) || "0".equals(fclass);
|
boolean isRealDimension = StringUtils.isBlank(fclass) || "0".equals(fclass);
|
||||||
boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id);
|
boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id);
|
||||||
judgeTreeLeafSql = sql;
|
|
||||||
if (isRealTime && user.getUID() != 1 && isRealDimension) {
|
if (isRealTime && user.getUID() != 1 && isRealDimension) {
|
||||||
DetachUtil detachUtil = new DetachUtil(user);
|
DetachUtil detachUtil = new DetachUtil(user);
|
||||||
if (detachUtil.isDETACH()) {
|
if (detachUtil.isDETACH()) {
|
||||||
|
|
@ -125,14 +100,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
||||||
}
|
}
|
||||||
// 添加时间轴条件
|
// 添加时间轴条件
|
||||||
sql += " and versionid = " + id;
|
sql += " and versionid = " + id;
|
||||||
judgeTreeLeafSql = sql;
|
|
||||||
}
|
}
|
||||||
rs.executeQuery(sql, subcompany);
|
return sql;
|
||||||
while (rs.next()) {
|
|
||||||
companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(judgeTreeLeafSql, rs.getString("id"))).build());
|
|
||||||
}
|
|
||||||
result.put("companyTree", companyTree);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String companyDateWhereSql(Map<String, Object> request2Map) {
|
private String companyDateWhereSql(Map<String, Object> request2Map) {
|
||||||
|
|
@ -705,16 +674,19 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
||||||
return fieldname;
|
return fieldname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断树是否为叶子节点
|
* 判断树是否为叶子节点
|
||||||
*
|
*
|
||||||
* @param sql 查询下级元素SQL
|
* @param versionId
|
||||||
* @param treeId 当前元素ID
|
* @param dimension
|
||||||
|
* @param subCompany
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private boolean judgeTreeLeaf(String sql, String treeId) {
|
private boolean judgeTreeLeaf(String versionId, String dimension, String subCompany) {
|
||||||
RecordSet recordSet = new RecordSet();
|
RecordSet recordSet = new RecordSet();
|
||||||
recordSet.executeQuery(sql, treeId);
|
String sql = getSubCompanyTreeSql(versionId, dimension, subCompany);
|
||||||
|
recordSet.executeQuery(sql, subCompany);
|
||||||
return !recordSet.next();
|
return !recordSet.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import com.engine.organization.util.*;
|
||||||
import com.engine.organization.util.browser.OrganizationBrowserUtil;
|
import com.engine.organization.util.browser.OrganizationBrowserUtil;
|
||||||
import com.engine.organization.util.db.DBType;
|
import com.engine.organization.util.db.DBType;
|
||||||
import com.engine.organization.util.db.MapperProxyFactory;
|
import com.engine.organization.util.db.MapperProxyFactory;
|
||||||
|
import com.engine.organization.util.detach.DetachUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import weaver.common.DateUtil;
|
import weaver.common.DateUtil;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
|
|
@ -284,6 +285,12 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
||||||
if (null != forbiddenTag) {
|
if (null != forbiddenTag) {
|
||||||
sqlWhere += " AND t.forbidden_tag = '" + forbiddenTag + "'";
|
sqlWhere += " AND t.forbidden_tag = '" + forbiddenTag + "'";
|
||||||
}
|
}
|
||||||
|
// 分权
|
||||||
|
DetachUtil detachUtil = new DetachUtil(user);
|
||||||
|
if (detachUtil.isDETACH()) {
|
||||||
|
String ids = detachUtil.getJclRoleLevels();
|
||||||
|
sqlWhere += " AND t.ec_company in (" + ids + ")";
|
||||||
|
}
|
||||||
return sqlWhere;
|
return sqlWhere;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import com.engine.organization.util.*;
|
||||||
import com.engine.organization.util.browser.OrganizationBrowserUtil;
|
import com.engine.organization.util.browser.OrganizationBrowserUtil;
|
||||||
import com.engine.organization.util.db.DBType;
|
import com.engine.organization.util.db.DBType;
|
||||||
import com.engine.organization.util.db.MapperProxyFactory;
|
import com.engine.organization.util.db.MapperProxyFactory;
|
||||||
|
import com.engine.organization.util.detach.DetachUtil;
|
||||||
import com.engine.organization.util.excel.ExcelUtil;
|
import com.engine.organization.util.excel.ExcelUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
|
@ -81,7 +82,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
||||||
String outPutPath = GCONST.getRootPath() + File.separator + "hrm" + File.separator + "import" + File.separator + "template" + File.separator + "staff.xls";
|
String outPutPath = GCONST.getRootPath() + File.separator + "hrm" + File.separator + "import" + File.separator + "template" + File.separator + "staff.xls";
|
||||||
File excelPathFile = new File(outPutPath);
|
File excelPathFile = new File(outPutPath);
|
||||||
if (!excelPathFile.exists()) {
|
if (!excelPathFile.exists()) {
|
||||||
String columns = "方案编号,方案名称,分部,部门,岗位,编制数";
|
String columns = "方案编号,方案名称,分部,部门,职务类型,职务,岗位,编制数";
|
||||||
String[] split = columns.split(",");
|
String[] split = columns.split(",");
|
||||||
List<Object> columnList = new ArrayList<>(Arrays.asList(split));
|
List<Object> columnList = new ArrayList<>(Arrays.asList(split));
|
||||||
// 创建导入模板
|
// 创建导入模板
|
||||||
|
|
@ -437,6 +438,12 @@ public class StaffServiceImpl extends Service implements StaffService {
|
||||||
sqlWhere += " AND t.plan_id in ( select id from jcl_org_staffplan where plan_name " + dbType.like(staffName) + ") ";
|
sqlWhere += " AND t.plan_id in ( select id from jcl_org_staffplan where plan_name " + dbType.like(staffName) + ") ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 分权
|
||||||
|
DetachUtil detachUtil = new DetachUtil(user);
|
||||||
|
if (detachUtil.isDETACH()) {
|
||||||
|
String ids = detachUtil.getJclRoleLevels();
|
||||||
|
sqlWhere += " AND t.ec_company in (" + ids + ")";
|
||||||
|
}
|
||||||
return sqlWhere;
|
return sqlWhere;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,13 @@ import weaver.hrm.definedfield.HrmFieldManager;
|
||||||
*/
|
*/
|
||||||
public class HrmResourceTransMethod {
|
public class HrmResourceTransMethod {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段展示内容转换,列表用
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param para
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static String getFieldTrueValue(String id, String para) {
|
public static String getFieldTrueValue(String id, String para) {
|
||||||
HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", Integer.parseInt(para.split("_")[0]));
|
HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", Integer.parseInt(para.split("_")[0]));
|
||||||
String fieldName = para.substring(para.lastIndexOf("_") + 1);
|
String fieldName = para.substring(para.lastIndexOf("_") + 1);
|
||||||
|
|
@ -32,6 +39,32 @@ public class HrmResourceTransMethod {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段展示内容转换,导出用
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param para
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getFieldTrueValueExp(String id, String para) {
|
||||||
|
HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", Integer.parseInt(para.split("_")[0]));
|
||||||
|
String fieldName = para.substring(para.lastIndexOf("_") + 1);
|
||||||
|
JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName);
|
||||||
|
User user = new User();
|
||||||
|
user.setUid(1);
|
||||||
|
try {
|
||||||
|
if (hfm.isBaseField(fieldName) && "jobactivity".equals(fieldName)) {
|
||||||
|
hrmFieldConf.put("type", 282);
|
||||||
|
}
|
||||||
|
String fieldvalue = hfm.getFieldvalue(null, user, null, hrmFieldConf.getString("dmlurl"), hrmFieldConf.getInt("id"), hrmFieldConf.getInt("fieldhtmltype"), hrmFieldConf.getInt("type"), id, 0, fieldName);
|
||||||
|
// fieldvalue去除Html内容
|
||||||
|
fieldvalue = fieldvalue.replaceAll("<[^>]*>", "").replaceAll(" ", "");
|
||||||
|
return fieldvalue;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String getDepartmentName(String departmentId) {
|
public static String getDepartmentName(String departmentId) {
|
||||||
return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(Integer.parseInt(departmentId));
|
return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(Integer.parseInt(departmentId));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||||
import com.engine.organization.util.db.MapperProxyFactory;
|
import com.engine.organization.util.db.MapperProxyFactory;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import weaver.hrm.roles.RolesComInfo;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -21,7 +22,7 @@ import java.util.stream.Collectors;
|
||||||
**/
|
**/
|
||||||
public class ManagerDetachTransMethod {
|
public class ManagerDetachTransMethod {
|
||||||
|
|
||||||
public static String getManagerName(String ecManager) {
|
public static String getManagerName(String ecManager,String managerType) {
|
||||||
if (org.apache.commons.lang.StringUtils.isBlank(ecManager)) {
|
if (org.apache.commons.lang.StringUtils.isBlank(ecManager)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
@ -29,8 +30,16 @@ public class ManagerDetachTransMethod {
|
||||||
if (CollectionUtils.isEmpty(collect)) {
|
if (CollectionUtils.isEmpty(collect)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
List<String> employeeNameById = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(collect);
|
if ("0".equals(managerType)) {
|
||||||
return StringUtils.join(employeeNameById, ",");
|
List<String> employeeNameById = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(collect);
|
||||||
|
return StringUtils.join(employeeNameById, ",");
|
||||||
|
}else {
|
||||||
|
//角色
|
||||||
|
RolesComInfo rolesComInfo = new RolesComInfo();
|
||||||
|
return rolesComInfo.getRolesRemark(ecManager);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.*;
|
import java.time.*;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.format.DateTimeParseException;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
@ -470,6 +471,62 @@ public class OrganizationDateUtil {
|
||||||
|
|
||||||
return localDate;
|
return localDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一个月后的日期
|
||||||
|
* @param firstDate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getLastMonthDate(String firstDate) {
|
||||||
|
// 定义日期格式
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
String nextMonthDateString = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
LocalDate date = LocalDate.parse(firstDate, formatter);
|
||||||
|
LocalDate nextMonthDate = date.plusMonths(1);
|
||||||
|
nextMonthDateString = nextMonthDate.format(formatter);
|
||||||
|
|
||||||
|
} catch (DateTimeParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return nextMonthDateString;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一年后的日期
|
||||||
|
* @param firstDate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getLastYearDate(String firstDate) {
|
||||||
|
// 定义日期格式
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
String nextYearDateString = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
LocalDate date = LocalDate.parse(firstDate, formatter);
|
||||||
|
LocalDate nextYearDate = date.plusYears(1);
|
||||||
|
nextYearDateString = nextYearDate.format(formatter);
|
||||||
|
|
||||||
|
} catch (DateTimeParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return nextYearDateString;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化日期
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String dateExample(LocalDate date) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||||
|
return date.format(formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,8 @@ public class OrganizationFormItemUtil {
|
||||||
browser.setViewAttr(viewAttr);
|
browser.setViewAttr(viewAttr);
|
||||||
browser.setIsQuickSearch(isQuickSearch);
|
browser.setIsQuickSearch(isQuickSearch);
|
||||||
browser.setLabel(label);
|
browser.setLabel(label);
|
||||||
|
//隐藏虚拟组织
|
||||||
|
browser.getBrowserConditionParam().setHideVirtualOrg(true);
|
||||||
if ("161".equals(type) || "162".equals(type)) {
|
if ("161".equals(type) || "162".equals(type)) {
|
||||||
fieldDbType = "browser." + fieldDbType;
|
fieldDbType = "browser." + fieldDbType;
|
||||||
BrowserBean browserBean = new BrowserBean();
|
BrowserBean browserBean = new BrowserBean();
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ public class ReturnResult<T> implements Serializable {
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public static <T> ReturnResult<T> successed(T data) {
|
public static <T> ReturnResult<T> successed(T data) {
|
||||||
|
|
||||||
return new ReturnResult<>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data);
|
return new ReturnResult<>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data);
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,11 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
import weaver.file.ImageFileManager;
|
import weaver.file.ImageFileManager;
|
||||||
import weaver.general.Util;
|
import weaver.general.Util;
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
|
import weaver.hrm.job.JobGroupsComInfo;
|
||||||
import weaver.systeminfo.SystemEnv;
|
import weaver.systeminfo.SystemEnv;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -49,6 +51,8 @@ public class StaffInfoImportUtil {
|
||||||
importFieldsMap.put("方案名称", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("plan_name").fieldNameDesc("方案名称").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
importFieldsMap.put("方案名称", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("plan_name").fieldNameDesc("方案名称").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||||
importFieldsMap.put("分部", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("comp_id").fieldNameDesc("分部").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
importFieldsMap.put("分部", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("comp_id").fieldNameDesc("分部").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||||
importFieldsMap.put("部门", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("dept_id").fieldNameDesc("部门").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
importFieldsMap.put("部门", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("dept_id").fieldNameDesc("部门").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||||
|
importFieldsMap.put("职务类型", ExtendInfoPO.builder().tableName("hrmjobgroups").fieldName("jobgroupname").fieldNameDesc("职务类型").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||||
|
importFieldsMap.put("职务", ExtendInfoPO.builder().tableName("hrmjobactivities").fieldName("jobactivityname").fieldNameDesc("职务").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||||
importFieldsMap.put("岗位", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("job_id").fieldNameDesc("岗位").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
importFieldsMap.put("岗位", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("job_id").fieldNameDesc("岗位").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||||
importFieldsMap.put("编制数", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("staff_num").fieldNameDesc("编制数").isrequired(1).controlType(1).browserType("2").customValue("[\"input\",\"int\"]").build());
|
importFieldsMap.put("编制数", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("staff_num").fieldNameDesc("编制数").isrequired(1).controlType(1).browserType("2").customValue("[\"input\",\"int\"]").build());
|
||||||
|
|
||||||
|
|
@ -88,6 +92,9 @@ public class StaffInfoImportUtil {
|
||||||
Long parentJobId = null;
|
Long parentJobId = null;
|
||||||
StaffPlanPO staffPlanPO = null;
|
StaffPlanPO staffPlanPO = null;
|
||||||
|
|
||||||
|
String jobactivitymark = "";
|
||||||
|
String jobgroupremark = "";
|
||||||
|
|
||||||
historyDetailPO.setRowNums(String.valueOf(i + 1));
|
historyDetailPO.setRowNums(String.valueOf(i + 1));
|
||||||
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
|
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
|
||||||
XSSFCell cell = row.getCell((short) cellIndex);
|
XSSFCell cell = row.getCell((short) cellIndex);
|
||||||
|
|
@ -188,6 +195,16 @@ public class StaffInfoImportUtil {
|
||||||
map.put("ec_department", parentDepartmentId);
|
map.put("ec_department", parentDepartmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//职务类型
|
||||||
|
if ("jobgroupname".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||||
|
jobgroupremark = cellValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//职务
|
||||||
|
if ("jobactivityname".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||||
|
jobactivitymark = cellValue;
|
||||||
|
}
|
||||||
|
|
||||||
// 岗位
|
// 岗位
|
||||||
if ("job_id".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
if ("job_id".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||||
if (null == parentCompanyId) {
|
if (null == parentCompanyId) {
|
||||||
|
|
@ -205,7 +222,8 @@ public class StaffInfoImportUtil {
|
||||||
continue nextRow;
|
continue nextRow;
|
||||||
}
|
}
|
||||||
for (String s : split) {
|
for (String s : split) {
|
||||||
parentJobId = MapperProxyFactory.getProxy(JobMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId, parentJobId == null ? 0 : parentJobId);
|
parentJobId = MapperProxyFactory.getProxy(JobMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId, parentJobId == null ? 0 : parentJobId
|
||||||
|
,jobactivitymark,jobgroupremark);
|
||||||
if (null == parentJobId) {
|
if (null == parentJobId) {
|
||||||
historyDetailPO.setOperateDetail(s + "岗位未找到对应数据");
|
historyDetailPO.setOperateDetail(s + "岗位未找到对应数据");
|
||||||
historyDetailPO.setStatus("0");
|
historyDetailPO.setStatus("0");
|
||||||
|
|
@ -335,8 +353,14 @@ public class StaffInfoImportUtil {
|
||||||
item.put("value", value);
|
item.put("value", value);
|
||||||
itemList.add(item);
|
itemList.add(item);
|
||||||
}
|
}
|
||||||
|
Map<String, Object> other = new HashMap<>();
|
||||||
|
other.put("index", (lsPromptLabel.size() + 1));
|
||||||
|
other.put("value", "注意:岗位维度编制信息导入时引入职务类型和职务判断,导入时请先去除多语言,否则无法找到对应岗位");
|
||||||
|
itemList.add(other);
|
||||||
groupItem.put("items", itemList);
|
groupItem.put("items", itemList);
|
||||||
lsGroup.add(groupItem);
|
lsGroup.add(groupItem);
|
||||||
return lsGroup;
|
return lsGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -286,8 +286,7 @@ public class HrmResourceController {
|
||||||
public ReturnResult saveCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SearchTemplateParam params) {
|
public ReturnResult saveCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SearchTemplateParam params) {
|
||||||
try {
|
try {
|
||||||
User user = HrmUserVarify.getUser(request, response);
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
Integer templateId = getHrmResourceWrapper(user).saveCustomTemplate(params);
|
return ReturnResult.successed(user,getHrmResourceWrapper(user).saveCustomTemplate(params));
|
||||||
return ReturnResult.successed(user,Util.null2String(templateId));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return ReturnResult.exceptionHandle(e);
|
return ReturnResult.exceptionHandle(e);
|
||||||
}
|
}
|
||||||
|
|
@ -374,4 +373,18 @@ public class HrmResourceController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@POST
|
||||||
|
@Path("/customOverall")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public ReturnResult customOverall(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String,Object> map = ParamUtil.request2Map(request);
|
||||||
|
return ReturnResult.successed(user,getHrmResourceWrapper(user).customOverall(map));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ReturnResult.exceptionHandle(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,7 @@ import weaver.hrm.User;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.*;
|
||||||
import javax.ws.rs.POST;
|
|
||||||
import javax.ws.rs.Path;
|
|
||||||
import javax.ws.rs.Produces;
|
|
||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
@ -100,6 +97,24 @@ public class OrgChartController {
|
||||||
return JSONObject.toJSONString(apidatas);
|
return JSONObject.toJSONString(apidatas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/versionDelete")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public String versionDelete(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("versionId") Integer versionId) {
|
||||||
|
Map<String, Object> apidatas = new HashMap<>(4);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
apidatas = getOrgChartWrapper(user).versionDelete(versionId);
|
||||||
|
apidatas.put("api_status", true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//异常处理
|
||||||
|
e.printStackTrace();
|
||||||
|
apidatas.put("api_status", false);
|
||||||
|
apidatas.put("api_errormsg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(apidatas);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/getSubCompanyTree")
|
@Path("/getSubCompanyTree")
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ public class HrmResourceWrapper extends OrganizationWrapper {
|
||||||
return getHrmResourceService(user).getSearchTemplate(params);
|
return getHrmResourceService(user).getSearchTemplate(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer saveCustomTemplate(SearchTemplateParam params) {
|
public Map<String, Object> saveCustomTemplate(SearchTemplateParam params) {
|
||||||
return getHrmResourceService(user).saveCustomTemplate(params);
|
return getHrmResourceService(user).saveCustomTemplate(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,4 +114,8 @@ public class HrmResourceWrapper extends OrganizationWrapper {
|
||||||
public Integer saveColumnsCustomTemplate(Map<String,Object> params) {
|
public Integer saveColumnsCustomTemplate(Map<String,Object> params) {
|
||||||
return getHrmResourceService(user).saveColumnsCustomTemplate(params);
|
return getHrmResourceService(user).saveColumnsCustomTemplate(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Object customOverall(Map<String, Object> params) {
|
||||||
|
return getHrmResourceService(user).customOverall(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,4 +94,8 @@ public class OrgChartWrapper extends Service {
|
||||||
public Map<Integer, HrmLabelVO> selectLabel() {
|
public Map<Integer, HrmLabelVO> selectLabel() {
|
||||||
return getChartService(user).selectLabel();
|
return getChartService(user).selectLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> versionDelete(Integer versionId) {
|
||||||
|
return getChartService(user).versionDelete(versionId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package weaver.interfaces.organization.cronjob;
|
||||||
|
|
||||||
|
import com.engine.organization.service.impl.ChartServiceImpl;
|
||||||
|
import com.engine.organization.util.OrganizationAssert;
|
||||||
|
import com.engine.organization.util.OrganizationDateUtil;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.interfaces.schedule.BaseCronJob;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2024/8/1 3:12 PM
|
||||||
|
* @Description: 组织架构版本定时删除
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class OrgVersionDeleteCron extends BaseCronJob {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
|
||||||
|
List<Integer> idList = new ArrayList<>();
|
||||||
|
String createTime = "";
|
||||||
|
rs.executeQuery("select id,createtime from jcl_org_chartversion order by createtime asc");
|
||||||
|
if (rs.next()){
|
||||||
|
idList.add(Util.getIntValue(rs.getString("id")));
|
||||||
|
createTime = Util.null2String(rs.getString("createtime"));
|
||||||
|
}
|
||||||
|
|
||||||
|
OrganizationAssert.notEmpty(idList,"未查询到组织架构图历史版本");
|
||||||
|
|
||||||
|
//1.type=1 删除最早版本记录日期
|
||||||
|
//2.type=2 删除最早版本日期--往后一个月的数据
|
||||||
|
if("2".equals(type)){
|
||||||
|
String lastMonthDate = OrganizationDateUtil.getLastMonthDate(createTime);
|
||||||
|
rs.executeQuery("select id from jcl_org_chartversion where createtime >= ? and createtime <= ?",createTime,lastMonthDate);
|
||||||
|
while (rs.next()) {
|
||||||
|
idList.add(Util.getIntValue(rs.getString("id")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//3.type=3 删除最早版本日期--往后一年的数据
|
||||||
|
if("3".equals(type)){
|
||||||
|
String lastYearDate = OrganizationDateUtil.getLastYearDate(createTime);
|
||||||
|
rs.executeQuery("select id from jcl_org_chartversion where createtime >= ? and createtime <= ?",createTime,lastYearDate);
|
||||||
|
while (rs.next()) {
|
||||||
|
idList.add(Util.getIntValue(rs.getString("id")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除数据
|
||||||
|
ChartServiceImpl chartService = new ChartServiceImpl();
|
||||||
|
idList.forEach(chartService::versionDelete);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package weaver.interfaces.organization.cronjob;
|
||||||
|
|
||||||
|
import com.engine.organization.service.impl.ChartServiceImpl;
|
||||||
|
import com.engine.organization.util.OrganizationDateUtil;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.interfaces.schedule.BaseCronJob;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2024/8/2 9:39 AM
|
||||||
|
* @Description: 组织架构图定时版本保存
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class OrgVersionRecordCron extends BaseCronJob {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
|
||||||
|
ChartServiceImpl chartService = new ChartServiceImpl();
|
||||||
|
User user = new User();
|
||||||
|
user.setUid(1);
|
||||||
|
|
||||||
|
// 获取当前日期
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
String example = OrganizationDateUtil.dateExample(today);
|
||||||
|
String description = "版本自动记录"+example;
|
||||||
|
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>(){
|
||||||
|
{
|
||||||
|
put("description",description);
|
||||||
|
}};
|
||||||
|
|
||||||
|
chartService.versionRecord(params,user);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue