编制导入模板、人员卡片、组织架构图Oracle
This commit is contained in:
parent
d9bdda1fa6
commit
dca18ea5b1
|
|
@ -11,6 +11,7 @@ import java.sql.Date;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class JclOrgMap {
|
public class JclOrgMap {
|
||||||
|
Integer fId;
|
||||||
Integer id;
|
Integer id;
|
||||||
Integer fType;
|
Integer fType;
|
||||||
Integer fObjId;
|
Integer fObjId;
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||||
@Builder
|
@Builder
|
||||||
public class User {
|
public class User {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
private String ecId;
|
||||||
private String image;
|
private String image;
|
||||||
private String name;
|
private String name;
|
||||||
private String sex;
|
private String sex;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.engine.organization.mapper.jclorgmap;
|
||||||
import com.engine.organization.entity.map.JclOrgMap;
|
import com.engine.organization.entity.map.JclOrgMap;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.sql.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:dxfeng
|
* @author:dxfeng
|
||||||
|
|
@ -13,17 +13,17 @@ import java.util.List;
|
||||||
public interface JclOrgMapper {
|
public interface JclOrgMapper {
|
||||||
int insertMap(JclOrgMap jclOrgMap);
|
int insertMap(JclOrgMap jclOrgMap);
|
||||||
|
|
||||||
JclOrgMap getJclOrgMapByObjID(@Param("currentDate") String currentDate, @Param("fType") String fType, @Param("objId") String objId);
|
JclOrgMap getJclOrgMapByObjID(@Param("currentDate") Date currentDate, @Param("fType") String fType, @Param("objId") String objId);
|
||||||
|
|
||||||
int deleteMap(@Param("ftype") String ftype, @Param("fobjid") String fobjid, @Param("currentDate") String currentDate);
|
int deleteMap(@Param("ftype") String ftype, @Param("fobjid") String fobjid, @Param("currentDate") Date currentDate);
|
||||||
|
|
||||||
int updateMap(@Param("ftype") String ftype, @Param("fobjid") String fobjid, @Param("currentDate") String currentDate, @Param("yesterday") String yesterday);
|
int updateMap(@Param("ftype") String ftype, @Param("fobjid") String fobjid, @Param("currentDate") Date currentDate, @Param("yesterday") Date yesterday);
|
||||||
|
|
||||||
JclOrgMap getJclOrgMapByFParentId(@Param("currentDate") String currentDate, @Param("fparentid") String fparentid);
|
JclOrgMap getJclOrgMapByFParentId(@Param("currentDate") Date currentDate, @Param("fparentid") String fparentid);
|
||||||
|
|
||||||
JclOrgMap getJclOrgMapById(@Param("currentDate") String currentDate, @Param("id") String id);
|
JclOrgMap getJclOrgMapById(@Param("currentDate") Date currentDate, @Param("id") String id);
|
||||||
|
|
||||||
JclOrgMap getSumPlanAndJobByFParentId(@Param("currentDate") String currentDate, @Param("fparentid") String fparentid);
|
JclOrgMap getSumPlanAndJobByFParentId(@Param("currentDate") Date currentDate, @Param("fparentid") String fparentid);
|
||||||
|
|
||||||
int updateMapById(@Param("id") Integer id,@Param("fplan") Integer fplan,@Param("fonjob") Integer fonjob,@Param("currentDate") String currentDate);
|
int updateMapById(@Param("id") Integer id,@Param("fplan") Integer fplan,@Param("fonjob") Integer fonjob,@Param("currentDate") Date currentDate);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.engine.organization.mapper.trigger;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author:dxfeng
|
* @author:dxfeng
|
||||||
* @createTime: 2022/09/21
|
* @createTime: 2022/09/21
|
||||||
|
|
@ -18,17 +20,17 @@ public interface StaffTriggerMapper {
|
||||||
|
|
||||||
//Integer countAllUsers();
|
//Integer countAllUsers();
|
||||||
|
|
||||||
Integer countCompanyStaffNum(@Param("currentDate") String currentDate, @Param("companyId") String companyId);
|
Integer countCompanyStaffNum(@Param("currentDate") Date currentDate, @Param("companyId") String companyId);
|
||||||
|
|
||||||
Integer countDepartmentStaffNum(@Param("currentDate") String currentDate, @Param("departmentId") String departmentId);
|
Integer countDepartmentStaffNum(@Param("currentDate") Date currentDate, @Param("departmentId") String departmentId);
|
||||||
|
|
||||||
Integer countJobStaffNum(@Param("currentDate") String currentDate, @Param("jobId") String jobId);
|
Integer countJobStaffNum(@Param("currentDate") Date currentDate, @Param("jobId") String jobId);
|
||||||
|
|
||||||
Integer updateOrgStaffs(@Param("currentDate") String currentDate, @Param("fType") String fType, @Param("fObjId") String fObjId, @Param("fPlan") Integer fPlan, @Param("fOnJob") Integer fOnJob);
|
Integer updateOrgStaffs(@Param("currentDate") Date currentDate, @Param("fType") String fType, @Param("fObjId") String fObjId, @Param("fPlan") Integer fPlan, @Param("fOnJob") Integer fOnJob);
|
||||||
|
|
||||||
String getIdByObjIdAndType(@Param("currentDate") String currentDate, @Param("fObjId") String fObjId, @Param("fType") String fType);
|
String getIdByObjIdAndType(@Param("currentDate") Date currentDate, @Param("fObjId") String fObjId, @Param("fType") String fType);
|
||||||
|
|
||||||
Integer sumPlanByParentId(@Param("currentDate") String currentDate, @Param("parentId") String parentId);
|
Integer sumPlanByParentId(@Param("currentDate") Date currentDate, @Param("parentId") String parentId);
|
||||||
|
|
||||||
Integer sumOnJobByParentId(@Param("currentDate") String currentDate, @Param("parentId") String parentId);
|
Integer sumOnJobByParentId(@Param("currentDate") Date currentDate, @Param("parentId") String parentId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -602,10 +602,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
||||||
Long oldParamDepartment = mergeParam.getId();
|
Long oldParamDepartment = mergeParam.getId();
|
||||||
DepartmentPO oldDepartment = EcHrmRelationUtil.getJclDepartmentId(Util.null2String(oldParamDepartment));
|
DepartmentPO oldDepartment = EcHrmRelationUtil.getJclDepartmentId(Util.null2String(oldParamDepartment));
|
||||||
Integer oldFParentId = null;
|
Integer oldFParentId = null;
|
||||||
if(null != oldDepartment){
|
if (null != oldDepartment) {
|
||||||
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
java.sql.Date currentDate = new java.sql.Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new Date())).getTime());
|
||||||
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, ModuleTypeEnum.departmentfielddefined.getValue().toString(), oldDepartment.getId().toString());
|
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, ModuleTypeEnum.departmentfielddefined.getValue().toString(), oldDepartment.getId().toString());
|
||||||
if(null != jclOrgMap){
|
if (null != jclOrgMap) {
|
||||||
oldFParentId = jclOrgMap.getFParentId();
|
oldFParentId = jclOrgMap.getFParentId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,13 +77,15 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
|
||||||
if (null == uId) {
|
if (null == uId) {
|
||||||
uId = getHrmResourceMapper().getJclResourceId(Util.null2String(user.getUID()));
|
uId = getHrmResourceMapper().getJclResourceId(Util.null2String(user.getUID()));
|
||||||
}
|
}
|
||||||
|
String ecResourceId = getHrmResourceMapper().getEcResourceId(uId.toString());
|
||||||
userInfo = getPersonnelCardMapper().getUserById(uId);
|
userInfo = getPersonnelCardMapper().getUserById(uId);
|
||||||
|
userInfo.setEcId(ecResourceId);
|
||||||
|
|
||||||
OrganizationAssert.notNull(uId, "未找到对应数据");
|
OrganizationAssert.notNull(uId, "未找到对应数据");
|
||||||
// 人员基本信息
|
// 人员基本信息
|
||||||
|
|
||||||
// 统计报表
|
// 统计报表
|
||||||
Statistical statistical = getStatistical(uId.toString());
|
Statistical statistical = getStatistical(ecResourceId);
|
||||||
List<ExtendGroupPO> extendGroupList = getExtendGroupMapper().listByType(4, IS_SHOW);
|
List<ExtendGroupPO> extendGroupList = getExtendGroupMapper().listByType(4, IS_SHOW);
|
||||||
// 获取前三个模块的信息
|
// 获取前三个模块的信息
|
||||||
List<FormItem> formItemList = new ArrayList<>();
|
List<FormItem> formItemList = new ArrayList<>();
|
||||||
|
|
@ -128,13 +130,12 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel
|
||||||
/**
|
/**
|
||||||
* 获取报表统计数据
|
* 获取报表统计数据
|
||||||
*
|
*
|
||||||
* @param resourceId
|
* @param ecResourceId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Statistical getStatistical(String resourceId) {
|
private Statistical getStatistical(String ecResourceId) {
|
||||||
try {
|
try {
|
||||||
// 获取Ec用户ID
|
// 获取Ec用户ID
|
||||||
String ecResourceId = getHrmResourceMapper().getEcResourceId(resourceId);
|
|
||||||
Statistical statistical = new Statistical();
|
Statistical statistical = new Statistical();
|
||||||
if (SysModuleInfoBiz.checkModuleStatus(ModuleConstants.Workflow)) {
|
if (SysModuleInfoBiz.checkModuleStatus(ModuleConstants.Workflow)) {
|
||||||
statistical.setWorkflowCount(new WorkflowRequestUtil().getRequestCount(user, ecResourceId));
|
statistical.setWorkflowCount(new WorkflowRequestUtil().getRequestCount(user, ecResourceId));
|
||||||
|
|
|
||||||
|
|
@ -1201,8 +1201,6 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
||||||
}
|
}
|
||||||
|
|
||||||
private Long hrmResourceImport(String operateType, String excelFile, String keyField) {
|
private Long hrmResourceImport(String operateType, String excelFile, String keyField) {
|
||||||
// TODO
|
|
||||||
keyField = "last_name";
|
|
||||||
Long importHistoryId = saveImportLog("resource", operateType);
|
Long importHistoryId = saveImportLog("resource", operateType);
|
||||||
JclImportHistoryDetailPO historyDetailPO;
|
JclImportHistoryDetailPO historyDetailPO;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,19 @@ 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.excel.ExcelUtil;
|
||||||
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.BaseBean;
|
||||||
|
import weaver.general.GCONST;
|
||||||
import weaver.general.StringUtil;
|
import weaver.general.StringUtil;
|
||||||
import weaver.general.Util;
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -68,6 +75,40 @@ public class StaffServiceImpl extends Service implements StaffService {
|
||||||
return MapperProxyFactory.getProxy(JobMapper.class);
|
return MapperProxyFactory.getProxy(JobMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 判断编制导入模板是否存在,不存在则创建该文件
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
String outPutPath = GCONST.getRootPath() + "/hrm/import/template/staff.xls";
|
||||||
|
File excelPathFile = new File(outPutPath);
|
||||||
|
if (!excelPathFile.exists()) {
|
||||||
|
String columns = "方案编号,方案名称,分部,部门,岗位,编制数";
|
||||||
|
String[] split = columns.split(",");
|
||||||
|
List<Object> columnList = new ArrayList<>(Arrays.asList(split));
|
||||||
|
// 创建导入模板
|
||||||
|
List<List<Object>> excelSheetData = new ArrayList<>();
|
||||||
|
excelSheetData.add(columnList);
|
||||||
|
XSSFWorkbook sheets = ExcelUtil.genWorkbookV2(excelSheetData, "staff");
|
||||||
|
File excelFile = new File(outPutPath);
|
||||||
|
if (!excelFile.exists()) {
|
||||||
|
String substring = outPutPath.substring(0, outPutPath.lastIndexOf(File.separator));
|
||||||
|
File file = new File(substring);
|
||||||
|
if (file.mkdirs()) {
|
||||||
|
boolean newFile = excelPathFile.createNewFile();
|
||||||
|
if (!newFile) {
|
||||||
|
throw new IOException(outPutPath + "文件创建失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FileOutputStream out = new FileOutputStream(excelPathFile);
|
||||||
|
sheets.write(out);
|
||||||
|
out.flush();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
new BaseBean().writeLog(e);
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> listPage(StaffSearchParam params) {
|
public Map<String, Object> listPage(StaffSearchParam params) {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public class CompanyTriggerRunnable implements Runnable {
|
||||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||||
|
|
||||||
|
|
||||||
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), jclMap.getFObjId().toString());
|
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), jclMap.getFObjId().toString());
|
||||||
if (null != jclOrgMapByObjID) {
|
if (null != jclOrgMapByObjID) {
|
||||||
jclMap.setFPlan(jclOrgMapByObjID.getFPlan());
|
jclMap.setFPlan(jclOrgMapByObjID.getFPlan());
|
||||||
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
|
jclMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
|
||||||
|
|
@ -116,10 +116,10 @@ public class CompanyTriggerRunnable implements Runnable {
|
||||||
if (1 != newCompany.getDeleteType() && 1 != newCompany.getForbiddenTag()) {
|
if (1 != newCompany.getDeleteType() && 1 != newCompany.getForbiddenTag()) {
|
||||||
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
||||||
if(null != jclOrgMapByObjID.getFParentId()){
|
if(null != jclOrgMapByObjID.getFParentId()){
|
||||||
updateParentPlanAndJob(currentDate,jclOrgMapByObjID.getFParentId().toString());
|
updateParentPlanAndJob(jclMap.getFDateBegin(),jclOrgMapByObjID.getFParentId().toString());
|
||||||
}
|
}
|
||||||
if(null!=oldCompany){
|
if(null!=oldCompany){
|
||||||
updateParentPlanAndJob(currentDate,oldCompany.getId().toString());
|
updateParentPlanAndJob(jclMap.getFDateBegin(),oldCompany.getId().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,7 +128,7 @@ public class CompanyTriggerRunnable implements Runnable {
|
||||||
/**
|
/**
|
||||||
* 更新上级部门在编、在岗数
|
* 更新上级部门在编、在岗数
|
||||||
*/
|
*/
|
||||||
void updateParentPlanAndJob(String currentDate, String parentId) {
|
void updateParentPlanAndJob(Date currentDate, String parentId) {
|
||||||
JclOrgMap parentJclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapById(currentDate, parentId);
|
JclOrgMap parentJclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapById(currentDate, parentId);
|
||||||
if (null != parentJclOrgMap) {
|
if (null != parentJclOrgMap) {
|
||||||
// 上级部门当前在编、在岗数
|
// 上级部门当前在编、在岗数
|
||||||
|
|
@ -140,7 +140,7 @@ public class CompanyTriggerRunnable implements Runnable {
|
||||||
parentJclOrgMap.setFPlan(0);
|
parentJclOrgMap.setFPlan(0);
|
||||||
parentJclOrgMap.setFOnJob(0);
|
parentJclOrgMap.setFOnJob(0);
|
||||||
}
|
}
|
||||||
parentJclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
parentJclOrgMap.setFDateBegin(currentDate);
|
||||||
parentJclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
parentJclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||||
|
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
|
|
|
||||||
|
|
@ -115,10 +115,10 @@ public class DepartmentTriggerRunnable implements Runnable {
|
||||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||||
|
|
||||||
// 获取当前生效的本部门map记录
|
// 获取当前生效的本部门map记录
|
||||||
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, ModuleTypeEnum.departmentfielddefined.getValue().toString(), Util.null2String(jclMap.getFObjId()));
|
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclMap.getFDateBegin(), ModuleTypeEnum.departmentfielddefined.getValue().toString(), Util.null2String(jclMap.getFObjId()));
|
||||||
|
|
||||||
// 取出以该部门为上级部门的在编、在岗数,转移无需计算
|
// 取出以该部门为上级部门的在编、在岗数,转移无需计算
|
||||||
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, jclMap.getId().toString());
|
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString());
|
||||||
if (null != moveTarget) {
|
if (null != moveTarget) {
|
||||||
jclOrgMap = null;
|
jclOrgMap = null;
|
||||||
}
|
}
|
||||||
|
|
@ -146,19 +146,19 @@ public class DepartmentTriggerRunnable implements Runnable {
|
||||||
if (1 != newDepartment.getDeleteType() && 1 != newDepartment.getForbiddenTag()) {
|
if (1 != newDepartment.getDeleteType() && 1 != newDepartment.getForbiddenTag()) {
|
||||||
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
||||||
if(null != jclOrgMapByObjID) {
|
if(null != jclOrgMapByObjID) {
|
||||||
updateParentPlanAndJob(currentDate, jclOrgMapByObjID.getFParentId().toString());
|
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
|
||||||
}
|
}
|
||||||
if(null != moveTarget){
|
if(null != moveTarget){
|
||||||
updateParentPlanAndJob(currentDate, moveTarget);
|
updateParentPlanAndJob(jclMap.getFDateBegin(), moveTarget);
|
||||||
}
|
}
|
||||||
if (null != oldFparentId) {
|
if (null != oldFparentId) {
|
||||||
updateParentPlanAndJob(currentDate, oldFparentId);
|
updateParentPlanAndJob(jclMap.getFDateBegin(), oldFparentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateParentPlanAndJob(String currentDate, String parentId) {
|
private void updateParentPlanAndJob(Date currentDate, String parentId) {
|
||||||
// 获取上级部门
|
// 获取上级部门
|
||||||
JclOrgMap parentJclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapById(currentDate, parentId);
|
JclOrgMap parentJclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapById(currentDate, parentId);
|
||||||
if (null != parentJclOrgMap) {
|
if (null != parentJclOrgMap) {
|
||||||
|
|
@ -173,7 +173,7 @@ public class DepartmentTriggerRunnable implements Runnable {
|
||||||
parentJclOrgMap.setFPlan(0);
|
parentJclOrgMap.setFPlan(0);
|
||||||
parentJclOrgMap.setFOnJob(0);
|
parentJclOrgMap.setFOnJob(0);
|
||||||
}
|
}
|
||||||
parentJclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
parentJclOrgMap.setFDateBegin(currentDate);
|
||||||
parentJclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
parentJclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||||
|
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public class GroupTriggerRunnable implements Runnable {
|
||||||
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
||||||
jclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
jclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
||||||
jclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
jclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||||
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, "0", jclOrgMap.getFObjId().toString());
|
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(jclOrgMap.getFDateBegin(), "0", jclOrgMap.getFObjId().toString());
|
||||||
if (null != jclOrgMapByObjID) {
|
if (null != jclOrgMapByObjID) {
|
||||||
jclOrgMap.setFPlan(jclOrgMapByObjID.getFPlan());
|
jclOrgMap.setFPlan(jclOrgMapByObjID.getFPlan());
|
||||||
jclOrgMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
|
jclOrgMap.setFOnJob(jclOrgMapByObjID.getFOnJob());
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ public class HrmResourceTriggerRunnable implements Runnable {
|
||||||
Calendar calendar = DateUtil.addDay(cal, -1);
|
Calendar calendar = DateUtil.addDay(cal, -1);
|
||||||
Date time = new Date(calendar.getTime().getTime());
|
Date time = new Date(calendar.getTime().getTime());
|
||||||
// 更新前的数据
|
// 更新前的数据
|
||||||
JclOrgMap jclOrgMapByObjID = getJclOrgMapper().getJclOrgMapByObjID(currentDate, "4", hrmResource.getId().toString());
|
JclOrgMap jclOrgMapByObjID = getJclOrgMapper().getJclOrgMapByObjID(jclMap.getFDateBegin(), "4", hrmResource.getId().toString());
|
||||||
|
|
||||||
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
|
getCompTriggerMapper().deleteMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin());
|
||||||
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
|
getCompTriggerMapper().updateMap(jclMap.getFType(), jclMap.getFObjId(), jclMap.getFDateBegin(), time);
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ import com.engine.organization.util.OrganizationDateUtil;
|
||||||
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 weaver.common.DateUtil;
|
import weaver.common.DateUtil;
|
||||||
import weaver.general.Util;
|
|
||||||
|
|
||||||
import java.sql.Date;
|
import java.sql.Date;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
@ -87,10 +86,10 @@ public class JobTriggerRunnable implements Runnable {
|
||||||
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
||||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||||
|
|
||||||
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID(currentDate, ModuleTypeEnum.jobfielddefined.getValue().toString(), jclMap.getFObjId().toString());
|
JclOrgMap jclOrgMapByObjID = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapByObjID( jclMap.getFDateBegin(), ModuleTypeEnum.jobfielddefined.getValue().toString(), jclMap.getFObjId().toString());
|
||||||
|
|
||||||
// 该岗位有下级岗位时,查询
|
// 该岗位有下级岗位时,查询
|
||||||
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(currentDate, jclMap.getId().toString());
|
JclOrgMap jclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getSumPlanAndJobByFParentId(jclMap.getFDateBegin(), jclMap.getId().toString());
|
||||||
|
|
||||||
if (null != jclOrgMapByObjID) {
|
if (null != jclOrgMapByObjID) {
|
||||||
if (null != jclOrgMap) {
|
if (null != jclOrgMap) {
|
||||||
|
|
@ -118,12 +117,12 @@ public class JobTriggerRunnable implements Runnable {
|
||||||
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
MapperProxyFactory.getProxy(JclOrgMapper.class).insertMap(jclMap);
|
||||||
if (null != jclOrgMapByObjID) {
|
if (null != jclOrgMapByObjID) {
|
||||||
if(null != jclOrgMapByObjID.getFParentId()){
|
if(null != jclOrgMapByObjID.getFParentId()){
|
||||||
updateParentPlanAndJob(currentDate, jclOrgMapByObjID.getFParentId().toString());
|
updateParentPlanAndJob(jclMap.getFDateBegin(), jclOrgMapByObjID.getFParentId().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (null != oldJob) {
|
if (null != oldJob) {
|
||||||
if (null != oldJob.getId()){
|
if (null != oldJob.getId()){
|
||||||
updateParentPlanAndJob(currentDate, oldJob.getId().toString());
|
updateParentPlanAndJob(jclMap.getFDateBegin(), oldJob.getId().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +132,7 @@ public class JobTriggerRunnable implements Runnable {
|
||||||
/**
|
/**
|
||||||
* 更新上级部门在编、在岗数
|
* 更新上级部门在编、在岗数
|
||||||
*/
|
*/
|
||||||
void updateParentPlanAndJob(String currentDate, String parentId) {
|
void updateParentPlanAndJob(Date currentDate, String parentId) {
|
||||||
JclOrgMap parentJclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapById(currentDate, parentId);
|
JclOrgMap parentJclOrgMap = MapperProxyFactory.getProxy(JclOrgMapper.class).getJclOrgMapById(currentDate, parentId);
|
||||||
if (null != parentJclOrgMap) {
|
if (null != parentJclOrgMap) {
|
||||||
// 上级部门当前在编、在岗数
|
// 上级部门当前在编、在岗数
|
||||||
|
|
@ -146,7 +145,7 @@ public class JobTriggerRunnable implements Runnable {
|
||||||
parentJclOrgMap.setFPlan(0);
|
parentJclOrgMap.setFPlan(0);
|
||||||
parentJclOrgMap.setFOnJob(0);
|
parentJclOrgMap.setFOnJob(0);
|
||||||
}
|
}
|
||||||
parentJclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
parentJclOrgMap.setFDateBegin(currentDate);
|
||||||
parentJclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
parentJclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||||
|
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
|
|
|
||||||
|
|
@ -53,15 +53,15 @@ public class StaffTriggerRunnable implements Runnable {
|
||||||
return MapperProxyFactory.getProxy(JclOrgMapper.class);
|
return MapperProxyFactory.getProxy(JclOrgMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String currentDate;
|
private final Date currentDate;
|
||||||
private final String yesterday;
|
private final Date yesterday;
|
||||||
|
|
||||||
public StaffTriggerRunnable(StaffPO staffPO) {
|
public StaffTriggerRunnable(StaffPO staffPO) {
|
||||||
this.staffPO = staffPO;
|
this.staffPO = staffPO;
|
||||||
this.staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
this.staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
||||||
|
|
||||||
currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime());
|
||||||
yesterday = DateUtil.addDate(currentDate, -1);
|
yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
public StaffTriggerRunnable(Integer jclJobId) {
|
public StaffTriggerRunnable(Integer jclJobId) {
|
||||||
|
|
@ -72,8 +72,8 @@ public class StaffTriggerRunnable implements Runnable {
|
||||||
this.staffPlanByID = StaffPlanPO.builder().controlDimension("3").build();
|
this.staffPlanByID = StaffPlanPO.builder().controlDimension("3").build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime());
|
||||||
yesterday = DateUtil.addDate(currentDate, -1);
|
yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue