Commit 1195f9ac by 宋祥

1.用工管理新增用户同步到指定组织机构下面

parent 0f07eb0f
package com.baosight.hpjx.core.constant; package com.baosight.hpjx.core.constant;
import com.baosight.hpjx.util.StringUtils;
/** /**
* @author:songx * @author:songx
* @date:2024/3/1,17:36 * @date:2024/3/1,17:36
......
...@@ -19,9 +19,12 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -19,9 +19,12 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.core.service.soa.XLocalManager;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -162,6 +165,28 @@ public class ServiceHPPZ013 extends ServiceBase { ...@@ -162,6 +165,28 @@ public class ServiceHPPZ013 extends ServiceBase {
fPz01301.setUserId(userId); fPz01301.setUserId(userId);
fPz01301.setDeleteFlag(CommonConstant.YesNo.NO_0); fPz01301.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ013.INSERT, fPz01301); DaoUtils.insert(HPPZ013.INSERT, fPz01301);
// 添加到组织机构
this.insertOrgMember(fPz01301);
}
/**
* 用户关联组织
*
* @param fPz01301
*/
private void insertOrgMember(HPPZ01301 fPz01301) {
Map inInfoRowMap = new HashMap();
inInfoRowMap.put("loginName", fPz01301.getUserId());
inInfoRowMap.put("userId", fPz01301.getUserId());
inInfoRowMap.put("orgId", fPz01301.getGroupCode());
EiInfo inInfo = new EiInfo();
inInfo.addBlock(EiConstant.resultBlock).addRow(inInfoRowMap);
inInfo.set(EiConstant.serviceName, "XSOG0801");
inInfo.set(EiConstant.methodName, "insertUserByOrgId");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
} }
/** /**
...@@ -188,6 +213,8 @@ public class ServiceHPPZ013 extends ServiceBase { ...@@ -188,6 +213,8 @@ public class ServiceHPPZ013 extends ServiceBase {
fPz013.fromMap(resultRow); fPz013.fromMap(resultRow);
fPz013.setDeleteFlag(CommonConstant.YesNo.YES_1); fPz013.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ013.DELETE, fPz013); DaoUtils.update(HPPZ013.DELETE, fPz013);
// 从组织机构删除
this.deleteOrgMember(fPz013);
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -198,4 +225,24 @@ public class ServiceHPPZ013 extends ServiceBase { ...@@ -198,4 +225,24 @@ public class ServiceHPPZ013 extends ServiceBase {
return inInfo; return inInfo;
} }
/**
* 用户删除组织
*
* @param fPz013
*/
private void deleteOrgMember(HPPZ013 fPz013) {
EiInfo inInfo = new EiInfo();
inInfo.set("inqu_status-0-parentOrgId", fPz013.getGroupCode());
inInfo.set("result-0-userId", fPz013.getUserId());
inInfo.set("result-0-loginName", fPz013.getUserId());
inInfo.set("result-0-orgId", fPz013.getGroupCode());
inInfo.set("result-0-orgEname", fPz013.getGroupCode());
// serviceName:XSOrgManage,methodName:deleteRelationBetweenUserAndOrg
inInfo.set(EiConstant.serviceName, "XSOG0801");
inInfo.set(EiConstant.methodName, "deleteUserByOrgId");
EiInfo outInfo = XLocalManager.call(inInfo);
if (outInfo.getStatus() < 0) {
throw new PlatException(outInfo.getMsg());
}
}
} }
...@@ -26,12 +26,10 @@ ...@@ -26,12 +26,10 @@
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = '0' AND DELETE_FLAG = '0'
AND COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
......
...@@ -25,12 +25,10 @@ ...@@ -25,12 +25,10 @@
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = '0' AND DELETE_FLAG = '0'
AND COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode"> <isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode# DEP_CODE = #depCode#
</isNotEmpty> </isNotEmpty>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<sql id="condition"> <sql id="condition">
AND IS_DELETED = '0' AND IS_DELETED = '0'
AND COMPANY_CODE = #companyCode#
<isNotEmpty prepend=" AND " property="orgEname"> <isNotEmpty prepend=" AND " property="orgEname">
ORG_ENAME = #orgEname# ORG_ENAME = #orgEname#
</isNotEmpty> </isNotEmpty>
...@@ -19,9 +20,6 @@ ...@@ -19,9 +20,6 @@
<isNotEmpty prepend=" AND " property="parentOrgId"> <isNotEmpty prepend=" AND " property="parentOrgId">
PARENT_ORG_ID = #parentOrgId# PARENT_ORG_ID = #parentOrgId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
</sql> </sql>
<sql id="customCondition"> <sql id="customCondition">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment