BUG修复
This commit is contained in:
parent
659261245d
commit
b9cfe839e7
|
|
@ -9,6 +9,7 @@ import com.engine.organization.mapper.job.JobMapper;
|
|||
import com.engine.organization.transmethod.JobTransMethod;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
|
||||
import java.util.*;
|
||||
|
|
@ -93,11 +94,19 @@ public class JobBO {
|
|||
//.forbiddenTag(e.getForbiddenTag())
|
||||
.isUsed(0)
|
||||
.build()).collect(Collectors.toList());
|
||||
List<String> usedIds = MapperProxyFactory.getProxy(JobMapper.class).listUsedId();
|
||||
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob));
|
||||
return dtoList.stream().peek(e -> {
|
||||
List<JobListDTO> childList = collects.get(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(childList)) {
|
||||
e.setChildren(childList);
|
||||
e.setIsUsed(1);
|
||||
}else{
|
||||
if (usedIds.contains(Util.null2String(e.getId()))) {
|
||||
e.setIsUsed(1);
|
||||
} else {
|
||||
e.setIsUsed(0);
|
||||
}
|
||||
}
|
||||
}).filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,4 +143,6 @@ public interface JobMapper {
|
|||
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
|
||||
|
||||
int selectByConditions(@Param("resourcePO") ResourcePO resourcePO);
|
||||
|
||||
List<String> listUsedId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -467,8 +467,10 @@
|
|||
|
||||
<select id="selectByConditions" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from jcl_org_job where ec_company = #{resourcePO.subcompanyid1} and ec_department = #{resourcePO.departmentid}
|
||||
and ec_jobtitle = #{resourcePO.jobtitle}
|
||||
from jcl_org_job
|
||||
where ec_company = #{resourcePO.subcompanyid1}
|
||||
and ec_department = #{resourcePO.departmentid}
|
||||
and ec_jobtitle = #{resourcePO.jobtitle}
|
||||
</select>
|
||||
|
||||
<select id="getIdByNameAndPid" resultType="java.lang.Long">
|
||||
|
|
@ -494,7 +496,12 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="listUsedId" resultType="java.lang.String">
|
||||
select t.id
|
||||
from jcl_org_job t
|
||||
inner join hrmresource h on t.ec_jobtitle = h.jobtitle and t.ec_company = h.subcompanyid1 and
|
||||
t.ec_department = h.departmentid
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateJobCompany">
|
||||
|
|
|
|||
|
|
@ -135,14 +135,16 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
public Long updateComp(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Integer ecCompanyId = Integer.parseInt(Util.null2String(params.get("id")));
|
||||
Integer supSubComId = Integer.parseInt(Util.null2String(params.get("supsubcomid")));
|
||||
Set<Integer> disableIds = new HashSet<>();
|
||||
disableIds.add(ecCompanyId);
|
||||
List<CompPO> compPOS = getCompMapper().listChild(Collections.singletonList(ecCompanyId));
|
||||
if (CollectionUtils.isNotEmpty(compPOS)) {
|
||||
addDisableIds(disableIds, compPOS);
|
||||
String supSubComId = Util.null2String(params.get("supsubcomid"));
|
||||
if (StringUtils.isNotBlank(supSubComId)) {
|
||||
Set<Integer> disableIds = new HashSet<>();
|
||||
disableIds.add(ecCompanyId);
|
||||
List<CompPO> compPOS = getCompMapper().listChild(Collections.singletonList(ecCompanyId));
|
||||
if (CollectionUtils.isNotEmpty(compPOS)) {
|
||||
addDisableIds(disableIds, compPOS);
|
||||
}
|
||||
OrganizationAssert.isFalse(disableIds.contains(Integer.parseInt(supSubComId)), "上级分部不能选择分部本身及其下级分部");
|
||||
}
|
||||
OrganizationAssert.isFalse(disableIds.contains(supSubComId), "上级分部不能选择分部本身及其下级分部");
|
||||
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
|
||||
return (long) ecCompanyId;
|
||||
|
|
|
|||
|
|
@ -194,16 +194,18 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
public Long updateForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Integer ecDepartmentId = Integer.parseInt(Util.null2String(params.get("id")));
|
||||
Integer supDepId = Integer.parseInt(Util.null2String(params.get("supdepid")));
|
||||
// 不可选择合并的数据,本身及子部门
|
||||
Set<Integer> disableIds = new HashSet<>();
|
||||
// 添加选择部门本身
|
||||
disableIds.add(ecDepartmentId);
|
||||
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(ecDepartmentId);
|
||||
if (CollectionUtils.isNotEmpty(deptListByPId)) {
|
||||
addDisableIds(disableIds, deptListByPId);
|
||||
String supDepId = Util.null2String(params.get("supdepid"));
|
||||
if (StringUtils.isNotBlank(supDepId)) {
|
||||
// 不可选择合并的数据,本身及子部门
|
||||
Set<Integer> disableIds = new HashSet<>();
|
||||
// 添加选择部门本身
|
||||
disableIds.add(ecDepartmentId);
|
||||
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(ecDepartmentId);
|
||||
if (CollectionUtils.isNotEmpty(deptListByPId)) {
|
||||
addDisableIds(disableIds, deptListByPId);
|
||||
}
|
||||
OrganizationAssert.isFalse(disableIds.contains(Integer.parseInt(supDepId)), "上级部门不能选择部门本身及其下级部门");
|
||||
}
|
||||
OrganizationAssert.isFalse(disableIds.contains(supDepId), "上级部门不能选择部门本身及其下级部门");
|
||||
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
|
||||
return (long) ecDepartmentId;
|
||||
|
|
|
|||
|
|
@ -183,6 +183,9 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
|
|||
String fieldName = hfm.getFieldname();
|
||||
JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName);
|
||||
String fieldLabel = Util.toScreen(SystemEnv.getHtmlLabelName(hrmFieldConf.getInt("fieldlabel"), user.getLanguage()), user.getLanguage());
|
||||
if ("resourceimageid".equals(fieldName) || "messagerurl".equals(fieldName) || "职等职级".equals(fieldLabel)) {
|
||||
continue;
|
||||
}
|
||||
String hrmData = "";
|
||||
if (hfm.isBaseField(fieldName)) {
|
||||
hrmData = hfm.getHrmData(fieldName);
|
||||
|
|
@ -193,7 +196,7 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
|
|||
hrmData = recordSet.getString(fieldName);
|
||||
}
|
||||
}
|
||||
String fieldValue = hfm.getFieldvalue(null, user, null, hrmFieldConf.getString("dmlurl"), hrmFieldConf.getInt("id"), hrmFieldConf.getInt("fieldhtmltype"), hrmFieldConf.getInt("type"), hrmData, 0, fieldName);
|
||||
String fieldValue = hfm.getFieldvalue(null, user, null, hrmFieldConf.getString("dmlurl"), hrmFieldConf.getInt("id"), hrmFieldConf.getInt("fieldhtmltype"), hrmFieldConf.getInt("type"), hrmData, 0, fieldName);
|
||||
itemList.add(Item.builder().fieldId(fieldLabel).fieldValue(fieldValue).build());
|
||||
}
|
||||
formItem.setItems(itemList);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import com.engine.organization.mapper.extend.ExtMapper;
|
|||
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
||||
import com.engine.organization.mapper.resource.ResourceMapper;
|
||||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.service.JobService;
|
||||
|
|
@ -130,8 +129,6 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
String keyword = params.getKeyword();
|
||||
|
|
@ -482,7 +479,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
List<JobPO> jobsByIds = getJobMapper().getJobsByIds(ids);
|
||||
for (JobPO jobsById : jobsByIds) {
|
||||
jobsById.setForbiddenTag(1);
|
||||
// jobsById.setForbiddenTag(1);
|
||||
//new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById).sync();
|
||||
// 删除拓展表、明细表
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_jobext", jobsById.getId());
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import com.engine.organization.mapper.staff.StaffMapper;
|
|||
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
||||
import com.engine.organization.mapper.staff.StaffsMapper;
|
||||
import com.engine.organization.service.StaffService;
|
||||
import com.engine.organization.thread.StaffTriggerRunnable;
|
||||
import com.engine.organization.util.*;
|
||||
import com.engine.organization.util.browser.OrganizationBrowserUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
|
|
@ -134,7 +133,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
int ignoreNull = getStaffMapper().insertIgnoreNull(staffPO);
|
||||
// 同步组织架构图编制信息
|
||||
new StaffTriggerRunnable(staffPO).run();
|
||||
//new StaffTriggerRunnable(staffPO).run();
|
||||
return ignoreNull;
|
||||
}
|
||||
|
||||
|
|
@ -166,7 +165,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
// 更新主表
|
||||
int updateStaff = getStaffMapper().updateStaff(staffPO);
|
||||
// 同步组织架构图编制信息
|
||||
new StaffTriggerRunnable(staffPO).run();
|
||||
//new StaffTriggerRunnable(staffPO).run();
|
||||
return updateStaff;
|
||||
}
|
||||
|
||||
|
|
@ -177,9 +176,9 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
List<StaffPO> staffsByIds = getStaffMapper().getStaffsByIds(ids);
|
||||
int deleteByIds = getStaffMapper().deleteByIds(ids);
|
||||
for (StaffPO staffsById : staffsByIds) {
|
||||
new StaffTriggerRunnable(staffsById).run();
|
||||
}
|
||||
//for (StaffPO staffsById : staffsByIds) {
|
||||
// new StaffTriggerRunnable(staffsById).run();
|
||||
//}
|
||||
return deleteByIds;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,188 +1,188 @@
|
|||
package com.engine.organization.thread;
|
||||
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.entity.staff.po.StaffPO;
|
||||
import com.engine.organization.entity.staff.po.StaffPlanPO;
|
||||
import com.engine.organization.enums.ModuleTypeEnum;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
||||
import com.engine.organization.mapper.trigger.StaffTriggerMapper;
|
||||
import com.engine.organization.util.OrganizationDateUtil;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StaffTriggerRunnable implements Runnable {
|
||||
StaffPO staffPO;
|
||||
StaffPlanPO staffPlanByID;
|
||||
|
||||
private StaffPlanMapper getStaffPlanMapper() {
|
||||
return MapperProxyFactory.getProxy(StaffPlanMapper.class);
|
||||
}
|
||||
|
||||
private StaffTriggerMapper getStaffTriggerMapper() {
|
||||
return MapperProxyFactory.getProxy(StaffTriggerMapper.class);
|
||||
}
|
||||
|
||||
private CompMapper getCompMapper() {
|
||||
return MapperProxyFactory.getProxy(CompMapper.class);
|
||||
}
|
||||
|
||||
private DepartmentMapper getDepartmentMapper() {
|
||||
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
||||
}
|
||||
|
||||
private JobMapper getJobMapper() {
|
||||
return MapperProxyFactory.getProxy(JobMapper.class);
|
||||
}
|
||||
|
||||
private JclOrgMapper getJclOrgMapper() {
|
||||
return MapperProxyFactory.getProxy(JclOrgMapper.class);
|
||||
}
|
||||
|
||||
private final Date currentDate;
|
||||
private final Date yesterday;
|
||||
|
||||
public StaffTriggerRunnable(StaffPO staffPO) {
|
||||
this.staffPO = staffPO;
|
||||
this.staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
||||
|
||||
currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime());
|
||||
yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime());
|
||||
}
|
||||
|
||||
public StaffTriggerRunnable(Integer jclJobId) {
|
||||
if (null != jclJobId) {
|
||||
JobPO jobById = getJobMapper().getJobById((long) jclJobId);
|
||||
if (null != jobById) {
|
||||
this.staffPO = StaffPO.builder().compId(jobById.getEcCompany()).deptId(jobById.getEcDepartment()).jobId(jobById.getId()).build();
|
||||
this.staffPlanByID = StaffPlanPO.builder().controlDimension("3").build();
|
||||
}
|
||||
}
|
||||
currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime());
|
||||
yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (null != staffPO) {
|
||||
if (null != staffPlanByID && StringUtils.isNotBlank(staffPlanByID.getControlDimension())) {
|
||||
String fType = staffPlanByID.getControlDimension();
|
||||
switch (fType) {
|
||||
case "1":
|
||||
// 更新分部编制
|
||||
refreshCompanyStaff(staffPO.getCompId().intValue());
|
||||
break;
|
||||
case "2":
|
||||
// 更新部门编制
|
||||
refreshDepartmentStaff(staffPO.getDeptId());
|
||||
refreshCompanyStaff(staffPO.getCompId().intValue());
|
||||
break;
|
||||
case "3":
|
||||
// 更新岗位编制
|
||||
refreshJobStaff(staffPO.getJobId());
|
||||
refreshDepartmentStaff(staffPO.getDeptId());
|
||||
refreshCompanyStaff(staffPO.getCompId().intValue());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshCompanyStaff(Integer companyId) {
|
||||
if (null == companyId) {
|
||||
return;
|
||||
}
|
||||
CompPO compPO = getCompMapper().listById(companyId);
|
||||
if (null != compPO) {
|
||||
updateOrgMap(ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), companyId.toString());
|
||||
if (null != compPO.getSupSubComId() && 0 != compPO.getSupSubComId()) {
|
||||
refreshCompanyStaff(compPO.getSupSubComId());
|
||||
} else {
|
||||
// 刷新集团数据
|
||||
refreshGroupStaff();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshDepartmentStaff(Integer departmentId) {
|
||||
if (null == departmentId) {
|
||||
return;
|
||||
}
|
||||
DepartmentPO deptById = getDepartmentMapper().getDeptById(departmentId);
|
||||
if (null != deptById) {
|
||||
updateOrgMap(ModuleTypeEnum.departmentfielddefined.getValue().toString(), departmentId.toString());
|
||||
if (null != deptById.getSupDepId() && 0 != deptById.getSupDepId()) {
|
||||
refreshDepartmentStaff(deptById.getSupDepId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshJobStaff(Long jobId) {
|
||||
if (null == jobId) {
|
||||
return;
|
||||
}
|
||||
JobPO jobById = getJobMapper().getJobById(jobId);
|
||||
if (null != jobById) {
|
||||
updateOrgMap(ModuleTypeEnum.jobfielddefined.getValue().toString(), jobId.toString());
|
||||
if (null != jobById.getParentJob() && 0 != jobById.getParentJob()) {
|
||||
refreshJobStaff(jobById.getParentJob());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshGroupStaff() {
|
||||
updateOrgMap("0", "0");
|
||||
}
|
||||
|
||||
|
||||
private void updateOrgMap(String type, String objId) {
|
||||
Integer planSum = 0;
|
||||
Integer onJobSum = 0;
|
||||
switch (type) {
|
||||
case "1":
|
||||
planSum = getStaffTriggerMapper().countCompanyStaffNum(currentDate, objId);
|
||||
break;
|
||||
case "2":
|
||||
planSum = getStaffTriggerMapper().countDepartmentStaffNum(currentDate, objId);
|
||||
break;
|
||||
case "3":
|
||||
planSum = getStaffTriggerMapper().countJobStaffNum(currentDate, objId);
|
||||
onJobSum = getStaffTriggerMapper().countOnJobByJObId(objId);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
JclOrgMap jclOrgMapByObjID = getJclOrgMapper().getJclOrgMapByObjID(currentDate, type, objId);
|
||||
String mapInfoId = getStaffTriggerMapper().getIdByObjIdAndType(currentDate, objId, type);
|
||||
Integer childPlanSum = getStaffTriggerMapper().sumPlanByParentId(currentDate, mapInfoId);
|
||||
Integer childOnJobSum = getStaffTriggerMapper().sumOnJobByParentId(currentDate, mapInfoId);
|
||||
getJclOrgMapper().deleteMap(type, objId, currentDate);
|
||||
getJclOrgMapper().updateMap(type, objId, currentDate, yesterday);
|
||||
jclOrgMapByObjID.setFPlan(addInteger(planSum, childPlanSum));
|
||||
jclOrgMapByObjID.setFOnJob(addInteger(onJobSum, childOnJobSum));
|
||||
jclOrgMapByObjID.setFDateBegin(currentDate);
|
||||
getJclOrgMapper().insertMap(jclOrgMapByObjID);
|
||||
}
|
||||
|
||||
private Integer addInteger(Integer num1, Integer num2) {
|
||||
num1 = num1 == null ? 0 : num1;
|
||||
num2 = num2 == null ? 0 : num2;
|
||||
return num1 + num2;
|
||||
}
|
||||
}
|
||||
//package com.engine.organization.thread;
|
||||
//
|
||||
//import com.engine.organization.entity.company.po.CompPO;
|
||||
//import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
//import com.engine.organization.entity.job.po.JobPO;
|
||||
//import com.engine.organization.entity.map.JclOrgMap;
|
||||
//import com.engine.organization.entity.staff.po.StaffPO;
|
||||
//import com.engine.organization.entity.staff.po.StaffPlanPO;
|
||||
//import com.engine.organization.enums.ModuleTypeEnum;
|
||||
//import com.engine.organization.mapper.comp.CompMapper;
|
||||
//import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
//import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
//import com.engine.organization.mapper.job.JobMapper;
|
||||
//import com.engine.organization.mapper.staff.StaffPlanMapper;
|
||||
//import com.engine.organization.mapper.trigger.StaffTriggerMapper;
|
||||
//import com.engine.organization.util.OrganizationDateUtil;
|
||||
//import com.engine.organization.util.db.MapperProxyFactory;
|
||||
//import org.apache.commons.lang3.StringUtils;
|
||||
//import weaver.common.DateUtil;
|
||||
//
|
||||
//import java.sql.Date;
|
||||
//
|
||||
///**
|
||||
// * @author:dxfeng
|
||||
// * @createTime: 2022/09/21
|
||||
// * @version: 1.0
|
||||
// */
|
||||
//public class StaffTriggerRunnable implements Runnable {
|
||||
// StaffPO staffPO;
|
||||
// StaffPlanPO staffPlanByID;
|
||||
//
|
||||
// private StaffPlanMapper getStaffPlanMapper() {
|
||||
// return MapperProxyFactory.getProxy(StaffPlanMapper.class);
|
||||
// }
|
||||
//
|
||||
// private StaffTriggerMapper getStaffTriggerMapper() {
|
||||
// return MapperProxyFactory.getProxy(StaffTriggerMapper.class);
|
||||
// }
|
||||
//
|
||||
// private CompMapper getCompMapper() {
|
||||
// return MapperProxyFactory.getProxy(CompMapper.class);
|
||||
// }
|
||||
//
|
||||
// private DepartmentMapper getDepartmentMapper() {
|
||||
// return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
||||
// }
|
||||
//
|
||||
// private JobMapper getJobMapper() {
|
||||
// return MapperProxyFactory.getProxy(JobMapper.class);
|
||||
// }
|
||||
//
|
||||
// private JclOrgMapper getJclOrgMapper() {
|
||||
// return MapperProxyFactory.getProxy(JclOrgMapper.class);
|
||||
// }
|
||||
//
|
||||
// private final Date currentDate;
|
||||
// private final Date yesterday;
|
||||
//
|
||||
// public StaffTriggerRunnable(StaffPO staffPO) {
|
||||
// this.staffPO = staffPO;
|
||||
// this.staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
||||
//
|
||||
// currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime());
|
||||
// yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime());
|
||||
// }
|
||||
//
|
||||
// public StaffTriggerRunnable(Integer jclJobId) {
|
||||
// if (null != jclJobId) {
|
||||
// JobPO jobById = getJobMapper().getJobById((long) jclJobId);
|
||||
// if (null != jobById) {
|
||||
// this.staffPO = StaffPO.builder().compId(jobById.getEcCompany()).deptId(jobById.getEcDepartment()).jobId(jobById.getId()).build();
|
||||
// this.staffPlanByID = StaffPlanPO.builder().controlDimension("3").build();
|
||||
// }
|
||||
// }
|
||||
// currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime());
|
||||
// yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime());
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void run() {
|
||||
// if (null != staffPO) {
|
||||
// if (null != staffPlanByID && StringUtils.isNotBlank(staffPlanByID.getControlDimension())) {
|
||||
// String fType = staffPlanByID.getControlDimension();
|
||||
// switch (fType) {
|
||||
// case "1":
|
||||
// // 更新分部编制
|
||||
// refreshCompanyStaff(staffPO.getCompId().intValue());
|
||||
// break;
|
||||
// case "2":
|
||||
// // 更新部门编制
|
||||
// refreshDepartmentStaff(staffPO.getDeptId());
|
||||
// refreshCompanyStaff(staffPO.getCompId().intValue());
|
||||
// break;
|
||||
// case "3":
|
||||
// // 更新岗位编制
|
||||
// refreshJobStaff(staffPO.getJobId());
|
||||
// refreshDepartmentStaff(staffPO.getDeptId());
|
||||
// refreshCompanyStaff(staffPO.getCompId().intValue());
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void refreshCompanyStaff(Integer companyId) {
|
||||
// if (null == companyId) {
|
||||
// return;
|
||||
// }
|
||||
// CompPO compPO = getCompMapper().listById(companyId);
|
||||
// if (null != compPO) {
|
||||
// updateOrgMap(ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), companyId.toString());
|
||||
// if (null != compPO.getSupSubComId() && 0 != compPO.getSupSubComId()) {
|
||||
// refreshCompanyStaff(compPO.getSupSubComId());
|
||||
// } else {
|
||||
// // 刷新集团数据
|
||||
// refreshGroupStaff();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void refreshDepartmentStaff(Integer departmentId) {
|
||||
// if (null == departmentId) {
|
||||
// return;
|
||||
// }
|
||||
// DepartmentPO deptById = getDepartmentMapper().getDeptById(departmentId);
|
||||
// if (null != deptById) {
|
||||
// updateOrgMap(ModuleTypeEnum.departmentfielddefined.getValue().toString(), departmentId.toString());
|
||||
// if (null != deptById.getSupDepId() && 0 != deptById.getSupDepId()) {
|
||||
// refreshDepartmentStaff(deptById.getSupDepId());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void refreshJobStaff(Long jobId) {
|
||||
// if (null == jobId) {
|
||||
// return;
|
||||
// }
|
||||
// JobPO jobById = getJobMapper().getJobById(jobId);
|
||||
// if (null != jobById) {
|
||||
// updateOrgMap(ModuleTypeEnum.jobfielddefined.getValue().toString(), jobId.toString());
|
||||
// if (null != jobById.getParentJob() && 0 != jobById.getParentJob()) {
|
||||
// refreshJobStaff(jobById.getParentJob());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private void refreshGroupStaff() {
|
||||
// updateOrgMap("0", "0");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// private void updateOrgMap(String type, String objId) {
|
||||
// Integer planSum = 0;
|
||||
// Integer onJobSum = 0;
|
||||
// switch (type) {
|
||||
// case "1":
|
||||
// planSum = getStaffTriggerMapper().countCompanyStaffNum(currentDate, objId);
|
||||
// break;
|
||||
// case "2":
|
||||
// planSum = getStaffTriggerMapper().countDepartmentStaffNum(currentDate, objId);
|
||||
// break;
|
||||
// case "3":
|
||||
// planSum = getStaffTriggerMapper().countJobStaffNum(currentDate, objId);
|
||||
// onJobSum = getStaffTriggerMapper().countOnJobByJObId(objId);
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// JclOrgMap jclOrgMapByObjID = getJclOrgMapper().getJclOrgMapByObjID(currentDate, type, objId);
|
||||
// String mapInfoId = getStaffTriggerMapper().getIdByObjIdAndType(currentDate, objId, type);
|
||||
// Integer childPlanSum = getStaffTriggerMapper().sumPlanByParentId(currentDate, mapInfoId);
|
||||
// Integer childOnJobSum = getStaffTriggerMapper().sumOnJobByParentId(currentDate, mapInfoId);
|
||||
// getJclOrgMapper().deleteMap(type, objId, currentDate);
|
||||
// getJclOrgMapper().updateMap(type, objId, currentDate, yesterday);
|
||||
// jclOrgMapByObjID.setFPlan(addInteger(planSum, childPlanSum));
|
||||
// jclOrgMapByObjID.setFOnJob(addInteger(onJobSum, childOnJobSum));
|
||||
// jclOrgMapByObjID.setFDateBegin(currentDate);
|
||||
// getJclOrgMapper().insertMap(jclOrgMapByObjID);
|
||||
// }
|
||||
//
|
||||
// private Integer addInteger(Integer num1, Integer num2) {
|
||||
// num1 = num1 == null ? 0 : num1;
|
||||
// num2 = num2 == null ? 0 : num2;
|
||||
// return num1 + num2;
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -108,11 +108,11 @@ public class ResourceImport {
|
|||
|
||||
//重复验证字段
|
||||
List<SearchConditionOption> statusOptions = new ArrayList<>();
|
||||
statusOptions.add(new SearchConditionOption("last_name", SystemEnv.getHtmlLabelName(413, user.getLanguage())));
|
||||
statusOptions.add(new SearchConditionOption("work_code", SystemEnv.getHtmlLabelName(714, user.getLanguage()), true));
|
||||
//statusOptions.add(new SearchConditionOption("loginid", SystemEnv.getHtmlLabelName(412, user.getLanguage())));
|
||||
statusOptions.add(new SearchConditionOption("lastname", SystemEnv.getHtmlLabelName(413, user.getLanguage())));
|
||||
statusOptions.add(new SearchConditionOption("workcode", SystemEnv.getHtmlLabelName(714, user.getLanguage()), true));
|
||||
statusOptions.add(new SearchConditionOption("loginid", SystemEnv.getHtmlLabelName(412, user.getLanguage())));
|
||||
searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, 24638, "keyField", statusOptions);
|
||||
searchConditionItem.setValue("last_name");
|
||||
searchConditionItem.setValue("lastname");
|
||||
itemList.add(searchConditionItem);
|
||||
|
||||
//导入类型
|
||||
|
|
|
|||
Loading…
Reference in New Issue