Merge pull request 'feature/dxf' (#2) from feature/dxf into develop
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization/pulls/2
This commit is contained in:
commit
02e3a40cb7
|
|
@ -162,6 +162,8 @@ public interface JobMapper {
|
|||
*/
|
||||
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Long parentCompany, @Param("parentDepartment") Long parentDepartment, @Param("parentJob") Long parentJob);
|
||||
|
||||
Long getIdByNameAndEcId(@Param("jobName") String jobName, @Param("ecCompany") String ecCompany, @Param("ecDepartment") String ecDepartment);
|
||||
|
||||
int checkRepeatNo(@Param("jobNo") String jobNo, @Param("id") Long id);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -548,6 +548,14 @@
|
|||
WHERE SCOPE = 'HrmCustomFieldByInfoType'
|
||||
AND SCOPEID = -1
|
||||
</select>
|
||||
<select id="getIdByNameAndEcId" resultType="java.lang.Long">
|
||||
select id
|
||||
from jcl_org_job
|
||||
where delete_type = 0
|
||||
and job_name = #{jobName}
|
||||
and ec_company = #{ecCompany}
|
||||
and ec_department = #{ecDepartment}
|
||||
</select>
|
||||
|
||||
<sql id="nullparentJob">
|
||||
and ifnull(parent_job,0) =
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.organization.mapper.trigger;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.cusfielddata.po.CusFieldData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import weaver.hrm.passwordprotection.domain.HrmResource;
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ public interface CompTriggerMapper {
|
|||
|
||||
String getJobTitleMarkById(@Param("id") Integer id);
|
||||
|
||||
JSONObject getCusFieldDataById(@Param("id") Integer id);
|
||||
CusFieldData getCusFieldDataById(@Param("id") Integer id);
|
||||
|
||||
Integer sumStaffNum(@Param("fdatebegin") Date fdatebegin, @Param("compId") Integer compId);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
from hrmjobtitles
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getCusFieldDataById" resultType="com.alibaba.fastjson.JSONObject">
|
||||
<select id="getCusFieldDataById" resultType="com.engine.organization.entity.cusfielddata.po.CusFieldData">
|
||||
select field100008, field100007
|
||||
from cus_fielddata
|
||||
where scope = 'HrmCustomFieldByInfoType'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.organization.mapper.trigger;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.cusfielddata.po.CusFieldData;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import weaver.hrm.passwordprotection.domain.HrmResource;
|
||||
|
||||
|
|
@ -12,6 +12,6 @@ import weaver.hrm.passwordprotection.domain.HrmResource;
|
|||
public interface HrmResourceTriggerMapper {
|
||||
HrmResource getHrmResource(@Param("id") Long id);
|
||||
|
||||
JSONObject getCusFieldDataById(@Param("fObjId") Integer fObjId);
|
||||
CusFieldData getCusFieldDataById(@Param("fObjId") Integer fObjId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
from hrmresource
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="getCusFieldDataById" resultType="com.alibaba.fastjson.JSONObject">
|
||||
<select id="getCusFieldDataById" resultType="com.engine.organization.entity.cusfielddata.po.CusFieldData">
|
||||
select field100002, field100008, field100007
|
||||
from cus_fielddata
|
||||
where scope = 'HrmCustomFieldByInfoType'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.organization.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.cusfielddata.po.CusFieldData;
|
||||
import com.engine.organization.entity.logview.bo.FieldBaseEquator;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
|
|
@ -84,12 +84,13 @@ public class CompanyTriggerRunnable implements Runnable {
|
|||
|
||||
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
|
||||
|
||||
JSONObject cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclMap.getFLeader());
|
||||
CusFieldData cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclMap.getFLeader());
|
||||
if (null != cusFieldDataById) {
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getString("field100008"));
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getString("field100007"));
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getField100008());
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getField100007());
|
||||
}
|
||||
jclMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
||||
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.organization.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.cusfielddata.po.CusFieldData;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.logview.bo.FieldBaseEquator;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
|
|
@ -90,12 +90,13 @@ public class DepartmentTriggerRunnable implements Runnable {
|
|||
|
||||
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
|
||||
|
||||
JSONObject cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclMap.getFLeader());
|
||||
CusFieldData cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclMap.getFLeader());
|
||||
if (null != cusFieldDataById) {
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getString("field100008"));
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getString("field100007"));
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getField100008());
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getField100007());
|
||||
}
|
||||
jclMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
||||
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.organization.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.cusfielddata.po.CusFieldData;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
import com.engine.organization.mapper.trigger.CompTriggerMapper;
|
||||
|
|
@ -59,14 +59,15 @@ public class GroupTriggerRunnable implements Runnable {
|
|||
jclOrgMap.setFLeaderJobId(hrmResourceById.getJobtitle());
|
||||
}
|
||||
jclOrgMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclOrgMap.getFLeaderJobId()));
|
||||
JSONObject cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclOrgMap.getFLeader());
|
||||
CusFieldData cusFieldDataById = getCompTriggerMapper().getCusFieldDataById(jclOrgMap.getFLeader());
|
||||
if (null != cusFieldDataById) {
|
||||
jclOrgMap.setFLeaderSt(cusFieldDataById.getString("field100008"));
|
||||
jclOrgMap.setFLeaderLv(cusFieldDataById.getString("field100007"));
|
||||
jclOrgMap.setFLeaderSt(cusFieldDataById.getField100008());
|
||||
jclOrgMap.setFLeaderLv(cusFieldDataById.getField100007());
|
||||
}
|
||||
jclOrgMap.setFParentId(1);
|
||||
jclOrgMap.setFObjParentId(0);
|
||||
jclOrgMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
||||
jclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
||||
jclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
jclOrgMap.setFPlan(getGroupTriggerMapper().sumStaffNum(jclOrgMap.getFDateBegin()));
|
||||
jclOrgMap.setFOnJob(getGroupTriggerMapper().countHrmResource());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.engine.organization.thread;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.organization.entity.cusfielddata.po.CusFieldData;
|
||||
import com.engine.organization.entity.map.JclOrgMap;
|
||||
import com.engine.organization.mapper.jclorgmap.JclOrgMapper;
|
||||
import com.engine.organization.mapper.trigger.CompTriggerMapper;
|
||||
|
|
@ -53,21 +53,22 @@ public class HrmResourceTriggerRunnable implements Runnable {
|
|||
jclMap.setFLeaderImg(hrmResource.getMessagerurl());
|
||||
jclMap.setFLeaderName(hrmResource.getLastname());
|
||||
jclMap.setFLeaderJobId(hrmResource.getJobtitle());
|
||||
JSONObject cusFieldDataById = getHrmResourceTriggerMapper().getCusFieldDataById(jclMap.getFObjId());
|
||||
CusFieldData cusFieldDataById = getHrmResourceTriggerMapper().getCusFieldDataById(jclMap.getFObjId());
|
||||
if (null != cusFieldDataById) {
|
||||
String field100002 = cusFieldDataById.getString("field100002");
|
||||
String field100002 = cusFieldDataById.getField100002();
|
||||
if (StringUtils.isNotBlank(field100002)) {
|
||||
int index = field100002.indexOf('_');
|
||||
jclMap.setFObjParentId(Integer.parseInt(field100002.substring(index + 1)));
|
||||
jclMap.setFParentId(jclMap.getFObjParentId() + sj);
|
||||
}
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getString("field100008"));
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getString("field100007"));
|
||||
jclMap.setFLeaderSt(cusFieldDataById.getField100008());
|
||||
jclMap.setFLeaderLv(cusFieldDataById.getField100007());
|
||||
}
|
||||
jclMap.setFClass(0);
|
||||
jclMap.setFClassName("行政维度");
|
||||
jclMap.setFLeaderJob(getCompTriggerMapper().getJobTitleMarkById(jclMap.getFLeaderJobId()));
|
||||
jclMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
||||
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
jclMap.setFIsVitual(0);
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ public class JobTriggerRunnable implements Runnable {
|
|||
jclMap.setFClass(0);
|
||||
jclMap.setFClassName("行政维度");
|
||||
|
||||
jclMap.setFDateBegin(new Date(System.currentTimeMillis()));
|
||||
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
|
||||
jclMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()));
|
||||
jclMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,12 @@ public class CusFieldDataTrigger {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
directionData.setField100002(null);
|
||||
directionData.setField100008(null);
|
||||
directionData.setField100006(null);
|
||||
directionData.setField100007(null);
|
||||
directionData.setField100005(null);
|
||||
}
|
||||
|
||||
// field100001更新,职等职级
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.engine.hrm.util.face.bean.CheckItemBean;
|
|||
import com.engine.organization.entity.jclimport.po.JclImportHistoryDetailPO;
|
||||
import com.engine.organization.mapper.jclimport.JclImportHistoryDetailMapper;
|
||||
import com.engine.organization.mapper.jclimport.JclImportHistoryMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.thread.HrmResourceTriggerRunnable;
|
||||
import com.engine.organization.trigger.cusfielddata.CusFieldDataTrigger;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
|
|
@ -780,6 +781,8 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
flag = false;
|
||||
if (updateWorkData(vo.getWorkFields(), vo.getWorkFieldsValue(), id)) //添加工作字段信息
|
||||
flag = false;
|
||||
// 更新聚才林相关字段
|
||||
CusFieldDataTrigger.run((long) id);
|
||||
}
|
||||
|
||||
/*添加人员缓存,人员默认按id显示顺序,HrmResource_Trigger_Insert 人员共享 入职维护项目状态*/
|
||||
|
|
@ -1392,6 +1395,9 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
if (updateWorkData(vo.getWorkFields().trim(), vo.getWorkFieldsValue(), keyMap.get(key)))
|
||||
flag = false;
|
||||
|
||||
// 更新聚才林相关字段
|
||||
CusFieldDataTrigger.run((long) keyMap.get(key));
|
||||
|
||||
/*update HrmResource_Trigger */
|
||||
if (flag) {
|
||||
recordSet.executeSql("select id from HrmResource_Trigger where id=" + hrmId);
|
||||
|
|
@ -1574,6 +1580,17 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
fielddbType = jsonObject.getString("fielddbtype");
|
||||
jsonObject.put("fieldvalue", baseValues[i]);
|
||||
String fieldvalue = HrmFieldManager.getReallyFieldvalue(jsonObject);
|
||||
// 处理自动获取时,或取到已删除的数据
|
||||
if ("field100002".equalsIgnoreCase(fieldname)) {
|
||||
// 根据分部、部门,获取对应的岗位ID
|
||||
recordSet.execute("select subcompanyid1,departmentid from hrmresource where id = " + id);
|
||||
while (recordSet.next()) {
|
||||
String ecCompany = recordSet.getString("subcompanyid1");
|
||||
String ecDepartment = recordSet.getString("departmentid");
|
||||
Long jobId = MapperProxyFactory.getProxy(JobMapper.class).getIdByNameAndEcId(baseValues[i], ecCompany, ecDepartment);
|
||||
fieldvalue = null == jobId ? "" : jobId.toString();
|
||||
}
|
||||
}
|
||||
|
||||
EncryptFieldEntity encryptFieldEntity = new EncryptFieldConfigComInfo().getFieldEncryptConfig("cus_fielddata", fieldname, "HrmCustomFieldByInfoType", scopeId);
|
||||
if (encryptFieldEntity != null && encryptFieldEntity.getIsEncrypt().equals("1")) {
|
||||
|
|
@ -1592,10 +1609,7 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
writeLog(e);
|
||||
}
|
||||
recordSet.setNoAutoEncrypt(true);
|
||||
boolean execute = recordSet.execute(sql);
|
||||
// 更新聚才林相关字段
|
||||
CusFieldDataTrigger.run((long) id);
|
||||
return execute;
|
||||
return recordSet.execute(sql);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1655,6 +1669,18 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
fielddbType = jsonObject.getString("fielddbtype");
|
||||
jsonObject.put("fieldvalue", baseValues[i]);
|
||||
String fieldvalue = HrmFieldManager.getReallyFieldvalue(jsonObject);
|
||||
// 处理自动获取时,或取到已删除的数据
|
||||
if ("field100002".equalsIgnoreCase(fieldname)) {
|
||||
// 根据分部、部门,获取对应的岗位ID
|
||||
recordSet.execute("select subcompanyid1,departmentid from hrmresource where id = " + id);
|
||||
while (recordSet.next()) {
|
||||
String ecCompany = recordSet.getString("subcompanyid1");
|
||||
String ecDepartment = recordSet.getString("departmentid");
|
||||
Long jobId = MapperProxyFactory.getProxy(JobMapper.class).getIdByNameAndEcId(baseValues[i], ecCompany, ecDepartment);
|
||||
fieldvalue = null == jobId ? "" : jobId.toString();
|
||||
new BaseBean().writeLog("岗位[" + baseValues[i] + "],jobId[" + Util.null2String(jobId) + "],ecCompany[" + ecCompany + "],ecDepartment[" + ecDepartment + "]");
|
||||
}
|
||||
}
|
||||
EncryptFieldEntity encryptFieldEntity = new EncryptFieldConfigComInfo().getFieldEncryptConfig("cus_fielddata", fieldname, "HrmCustomFieldByInfoType", scopeId);
|
||||
if (encryptFieldEntity != null && encryptFieldEntity.getIsEncrypt().equals("1")) {
|
||||
//是否需要加密
|
||||
|
|
@ -1662,7 +1688,7 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
}
|
||||
if (fieldvalue.startsWith(",")) fieldvalue = fieldvalue.substring(1);
|
||||
if (fieldvalue.endsWith(",")) fieldvalue = fieldvalue.substring(0, fieldvalue.length() - 1);
|
||||
if (!fieldvalue.equals("")) {
|
||||
if (!fieldvalue.equals("") || "field100002".equalsIgnoreCase(fieldname)) {
|
||||
flag = true;
|
||||
if (fielddbType.toLowerCase().startsWith("char") || fielddbType.toLowerCase().startsWith("varchar") || fielddbType.toLowerCase().startsWith("text"))
|
||||
setStr.append(",").append(baseFields[i]).append("='").append(fieldvalue).append("'");
|
||||
|
|
@ -1676,10 +1702,7 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
}
|
||||
recordSet.setNoAutoEncrypt(true);
|
||||
if (flag) {
|
||||
boolean execute = recordSet.execute(sql);
|
||||
// 更新聚才林相关字段
|
||||
CusFieldDataTrigger.run((long) id);
|
||||
return !execute;
|
||||
return !recordSet.execute(sql);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue