Compare commits

...

7 Commits

@ -4,11 +4,10 @@ import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.apache.commons.collections.CollectionUtils;
import weaver.general.StringUtil; import weaver.general.StringUtil;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -28,7 +27,12 @@ public class DeleteParam {
if (StringUtil.isEmpty(ids)) { if (StringUtil.isEmpty(ids)) {
return new ArrayList<>(); return new ArrayList<>();
} }
return Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList()); ArrayList<Long> list = new ArrayList<>();
Set<Long> collect = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(collect)) {
list.addAll(collect);
}
return list;
} }
} }

@ -107,8 +107,8 @@
<include refid="baseColumns"/> <include refid="baseColumns"/>
from hrmsubcompany t from hrmsubcompany t
WHERE id IN WHERE id IN
<foreach collection="ids" open="(" item="id" separator="," close=")"> <foreach collection="ids" index="index" open="(" item="id" separator="," close=")">
#{id} <if test="(index % 999) == 998"> NULL) OR id IN(</if>#{id}
</foreach> </foreach>
</select> </select>

@ -1,9 +1,9 @@
package com.engine.organization.mapper.resource; package com.engine.organization.mapper.resource;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
import com.engine.organization.entity.hrmresource.po.ResourceChartPO; import com.engine.organization.entity.hrmresource.po.ResourceChartPO;
import com.engine.organization.entity.hrmresource.po.ResourcePO; import com.engine.organization.entity.hrmresource.po.ResourcePO;
import com.engine.organization.entity.hrmresource.param.SearchTemplateParam;
import com.engine.organization.entity.hrmresource.po.SearchTemplatePO; import com.engine.organization.entity.hrmresource.po.SearchTemplatePO;
import com.engine.organization.entity.resume.po.HrmFamilyInfoPO; import com.engine.organization.entity.resume.po.HrmFamilyInfoPO;
import com.engine.organization.entity.resume.po.PersonnelResumePO; import com.engine.organization.entity.resume.po.PersonnelResumePO;

@ -197,6 +197,8 @@ public class ChartServiceImpl extends Service implements ChartService {
chartPO.setExpand("0"); chartPO.setExpand("0");
chartPO.setFisvitual(rs.getString("isvitual")); chartPO.setFisvitual(rs.getString("isvitual"));
chartPO.setHasChildren(getHasChildren(chartPO.getFtype(), chartPO.getFobjid()).toString()); chartPO.setHasChildren(getHasChildren(chartPO.getFtype(), chartPO.getFobjid()).toString());
chartPO.setOnJobNum(isRealTime ? Util.getIntValue(rs.getString("on_job_num"),0) : Util.getIntValue(rs.getString("job_num"),0));
chartPO.setStaffNum(Util.getIntValue(rs.getString("staff_num"),0));
filterAndAddData(dataList, chartPO, hideDepartment); filterAndAddData(dataList, chartPO, hideDepartment);
//dataList.add(chartPO); //dataList.add(chartPO);

@ -296,14 +296,11 @@ public class ExtServiceImpl extends Service implements ExtService {
List<Long> groupIds = dtInfoPOList.stream().map(ExtendInfoPO::getExtendGroupId).distinct().collect(Collectors.toList()); List<Long> groupIds = dtInfoPOList.stream().map(ExtendInfoPO::getExtendGroupId).distinct().collect(Collectors.toList());
Map<Long, List<ExtendInfoPO>> poMaps = dtInfoPOList.stream().collect(Collectors.groupingBy(ExtendInfoPO::getExtendGroupId)); Map<Long, List<ExtendInfoPO>> poMaps = dtInfoPOList.stream().collect(Collectors.groupingBy(ExtendInfoPO::getExtendGroupId));
boolean deleteFlag = true;
for (Long groupId : groupIds) { for (Long groupId : groupIds) {
int rowNum = Util.getIntValue((String) params.get("rownum" + groupId)); int rowNum = Util.getIntValue((String) params.get("rownum" + groupId));
if (deleteFlag && rowNum > 0) {
// 删除原有明细表数据 // 删除原有明细表数据
getExtDTMapper().deleteByMainID(tableName, id, groupId); getExtDTMapper().deleteByMainID(tableName, id, groupId);
deleteFlag = false;
}
List<ExtendInfoPO> filterS = poMaps.get(groupId); List<ExtendInfoPO> filterS = poMaps.get(groupId);
for (int i = 0; i < rowNum; i++) { for (int i = 0; i < rowNum; i++) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
@ -319,6 +316,9 @@ public class ExtServiceImpl extends Service implements ExtService {
map.put("delete_type", 0); map.put("delete_type", 0);
map.put("create_time", new Date()); map.put("create_time", new Date());
map.put("update_time", new Date()); map.put("update_time", new Date());
// 去除value为null的元素
map.entrySet().removeIf(entry -> entry.getValue() == null);
getExtDTMapper().insertCompExtDT(tableName, map); getExtDTMapper().insertCompExtDT(tableName, map);
} }
} }

@ -98,15 +98,19 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
// 是否展示当前数据 // 是否展示当前数据
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);
String ids = detachUtil.getJclRoleLevels(); String ids = detachUtil.getJclRoleLevels();
if ("0".equals(subcompany)) {
sql = sql + " and id in ("+ids+")"; sql = sql + " and id in ("+ids+")";
} }
}
if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) { if (StringUtils.isNotBlank(fclass) && !"0".equals(fclass)) {
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.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? and companyid = '" + fclass + "'"; 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.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? and companyid = '" + fclass + "'";
} }
@ -117,10 +121,11 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
} }
// 添加时间轴条件 // 添加时间轴条件
sql += " and versionid = " + id; sql += " and versionid = " + id;
judgeTreeLeafSql = sql;
} }
rs.executeQuery(sql,subcompany); rs.executeQuery(sql,subcompany);
while (rs.next()) { 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(sql, rs.getString("id"))).build()); 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); result.put("companyTree", companyTree);
return result; return result;

@ -33,11 +33,13 @@ import com.engine.organization.util.tree.SearchTreeUtil;
import com.engine.organization.util.word.CustomXWPFDocument; import com.engine.organization.util.word.CustomXWPFDocument;
import com.engine.organization.util.word.WordUtil; import com.engine.organization.util.word.WordUtil;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.Document; import org.apache.poi.xwpf.usermodel.Document;
import org.apache.poi.xwpf.usermodel.XWPFParagraph; import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFPictureData; import org.apache.poi.xwpf.usermodel.XWPFPictureData;
import org.apache.xmlbeans.XmlOptions; import org.apache.xmlbeans.XmlOptions;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBody; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBody;
import weaver.conn.RecordSet;
import weaver.general.GCONST; import weaver.general.GCONST;
import weaver.general.StringUtil; import weaver.general.StringUtil;
import weaver.general.Util; import weaver.general.Util;
@ -587,7 +589,10 @@ public class PersonnelResumeServiceImpl extends Service implements PersonnelResu
// 补充人员所有岗位,关联人员及聚才林岗位 // 补充人员所有岗位,关联人员及聚才林岗位
for (ResourcePO resource : resourcePOS) { for (ResourcePO resource : resourcePOS) {
JobPO jobByResource = getJobMapper().getJobByResource(resource); if (null == resource) {
continue;
}
JobPO jobByResource = getJobByResource(resource);
if (null != jobByResource) { if (null != jobByResource) {
resource.setJobId(jobByResource.getId()); resource.setJobId(jobByResource.getId());
builderJobs.add(jobByResource); builderJobs.add(jobByResource);
@ -676,7 +681,10 @@ public class PersonnelResumeServiceImpl extends Service implements PersonnelResu
// 补充人员所有岗位,关联人员及聚才林岗位 // 补充人员所有岗位,关联人员及聚才林岗位
for (ResourcePO resource : resourcePOS) { for (ResourcePO resource : resourcePOS) {
JobPO jobByResource = getJobMapper().getJobByResource(resource); if (null == resource) {
continue;
}
JobPO jobByResource = getJobByResource(resource);
if (null != jobByResource) { if (null != jobByResource) {
resource.setJobId(jobByResource.getId()); resource.setJobId(jobByResource.getId());
builderJobs.add(jobByResource); builderJobs.add(jobByResource);
@ -760,4 +768,87 @@ public class PersonnelResumeServiceImpl extends Service implements PersonnelResu
buildParentComps(parentComp, builderComps, allMaps); buildParentComps(parentComp, builderComps, allMaps);
} }
} }
private JobPO getJobByResource(ResourcePO resourcePO) {
RecordSet rs = new RecordSet();
String sql = "select\n" +
" t.id,\n" +
" t.job_no,\n" +
" h.jobtitlename,\n" +
" t.ec_jobTitle,\n" +
" t.ec_company,\n" +
" t.ec_department,\n" +
" t.sequence_id,\n" +
" t.scheme_id,\n" +
" t.parent_job,\n" +
" t.is_key,\n" +
" t.workplace,\n" +
" t.description,\n" +
" t.work_duty,\n" +
" t.work_authority,\n" +
" t.show_order,\n" +
" t.forbidden_tag,\n" +
" t.grade_id,\n" +
" t.level_id\n" +
" from jcl_org_job t\n" +
" left join hrmjobtitles h on t.ec_jobTitle = h.id\n" +
" where t.delete_type = 0 ";
if (null != resourcePO.getSubcompanyid1()) {
sql += " and t.ec_company = '" + resourcePO.getSubcompanyid1() + "'";
}
if (null == resourcePO.getSubcompanyid1()) {
sql += " and t.ec_company is null";
}
if (null != resourcePO.getDepartmentid()) {
sql += " and t.ec_department = '" + resourcePO.getDepartmentid() + "'";
}
if (null != resourcePO.getDepartmentid()) {
sql += " and t.ec_department is null";
}
if (null != resourcePO.getJobtitle()) {
sql += " and t.ec_jobTitle = '" + resourcePO.getJobtitle() + "'";
}
rs.executeQuery(sql);
if (rs.next()) {
String id = rs.getString("id");
String job_no = rs.getString("job_no");
String jobtitlename = rs.getString("jobtitlename");
String ec_jobTitle = rs.getString("ec_jobTitle");
String ec_company = rs.getString("ec_company");
String ec_department = rs.getString("ec_department");
String sequence_id = rs.getString("sequence_id");
String scheme_id = rs.getString("scheme_id");
String parent_job = rs.getString("parent_job");
String is_key = rs.getString("is_key");
String workplace = rs.getString("workplace");
String description = rs.getString("description");
String work_duty = rs.getString("work_duty");
String work_authority = rs.getString("work_authority");
String show_order = rs.getString("show_order");
String forbidden_tag = rs.getString("forbidden_tag");
String grade_id = rs.getString("grade_id");
String level_id = rs.getString("level_id");
JobPO jobPO = new JobPO();
jobPO.setId(StringUtils.isBlank(id) ? null : Long.parseLong(id));
jobPO.setJobNo(job_no);
jobPO.setJobTitleName(jobtitlename);
jobPO.setEcJobTitle(StringUtils.isBlank(ec_jobTitle) ? null : Integer.parseInt(ec_jobTitle));
jobPO.setEcCompany(StringUtils.isBlank(ec_company) ? null : Integer.parseInt(ec_company));
jobPO.setEcDepartment(StringUtils.isBlank(ec_department) ? null : Integer.parseInt(ec_department));
jobPO.setSequenceId(StringUtils.isBlank(sequence_id) ? null : Long.parseLong(sequence_id));
jobPO.setSchemeId(StringUtils.isBlank(scheme_id) ? null : Long.parseLong(scheme_id));
jobPO.setParentJob(StringUtils.isBlank(parent_job) ? null : Long.parseLong(parent_job));
jobPO.setIsKey(StringUtils.isBlank(is_key) ? null : Integer.parseInt(is_key));
jobPO.setWorkplace(workplace);
jobPO.setDescription(description);
jobPO.setWorkDuty(work_duty);
jobPO.setWorkAuthority(work_authority);
jobPO.setShowOrder(StringUtils.isBlank(show_order) ? null : Integer.parseInt(show_order));
jobPO.setForbiddenTag(StringUtils.isBlank(forbidden_tag) ? null : Integer.parseInt(forbidden_tag));
jobPO.setGradeId(grade_id);
jobPO.setLevelId(level_id);
return jobPO;
}
return null;
}
} }

@ -198,7 +198,7 @@ public class CompanyImport {
} else if (StringUtils.isBlank(cellValue)) { } else if (StringUtils.isBlank(cellValue)) {
reallyValue = ""; reallyValue = "";
} else { } else {
reallyValue = HrmFieldManagerForService.getReallyFieldvalue(infoPO.getJsonObject(cellValue), null != infoPO.getIsSystem() && 1 == infoPO.getIsSystem()); reallyValue = HrmFieldManagerForService.getReallyFieldvalue(infoPO.getJsonObject(cellValue), true);
} }
} catch (Exception e) { } catch (Exception e) {
historyDetailPO.setOperateDetail(cellValue + "转换失败"); historyDetailPO.setOperateDetail(cellValue + "转换失败");

@ -209,7 +209,7 @@ public class DepartmentImport {
} else if (StringUtils.isBlank(cellValue)) { } else if (StringUtils.isBlank(cellValue)) {
reallyValue = ""; reallyValue = "";
} else { } else {
reallyValue = HrmFieldManagerForService.getReallyFieldvalue(infoPO.getJsonObject(cellValue), null != infoPO.getIsSystem() && 1 == infoPO.getIsSystem()); reallyValue = HrmFieldManagerForService.getReallyFieldvalue(infoPO.getJsonObject(cellValue), true);
} }
} catch (Exception e) { } catch (Exception e) {
historyDetailPO.setOperateDetail(cellValue + "转换失败"); historyDetailPO.setOperateDetail(cellValue + "转换失败");

@ -18,6 +18,7 @@ import java.util.List;
/** /**
* *
*/ */
@Deprecated
public class JobAndPlanCron extends BaseCronJob { public class JobAndPlanCron extends BaseCronJob {
private static final Logger LOGGER = LoggerFactory.getLogger("chartDataLog"); private static final Logger LOGGER = LoggerFactory.getLogger("chartDataLog");

Loading…
Cancel
Save