Commit 4479574c authored by 鲁鑫's avatar 鲁鑫

初始化同步人员到SAP

parent 8ab0566a
...@@ -123,6 +123,7 @@ $(function () { ...@@ -123,6 +123,7 @@ $(function () {
{ id: 'initPassword', text:'初始化密码', click: initPassword, img: "fa-wrench"}, { id: 'initPassword', text:'初始化密码', click: initPassword, img: "fa-wrench"},
{ id: "changePersonMainOrg", text: "设置主岗位", img: "fa-address-book" }, { id: "changePersonMainOrg", text: "设置主岗位", img: "fa-address-book" },
{ id: "quoteAuthorizationAndBizManagement", text: "引用权限", click: quoteAuthorizationAndBizManagement, img: "fa-gavel"}, { id: "quoteAuthorizationAndBizManagement", text: "引用权限", click: quoteAuthorizationAndBizManagement, img: "fa-gavel"},
{ id: "initPersonToSap", text: "初始化SAP员工客户", click: initPersonToSap, img: "fa-gavel"},
] ]
}; };
...@@ -157,7 +158,7 @@ $(function () { ...@@ -157,7 +158,7 @@ $(function () {
} }
}, },
{ display: "消息类型", name: "typeTextView", width: 100, minWidth: 60, type: "string", align: "left" }, { display: "消息类型", name: "typeTextView", width: 100, minWidth: 60, type: "string", align: "left" },
{ display: "消息文本", name: "message", width: 200, minWidth: 60, type: "string", align: "left" }, { display: "消息文本", name: "message", width: 300, minWidth: 60, type: "string", align: "left" },
], ],
dataAction: "server", dataAction: "server",
url: web_app.name + "/org/slicedQueryOrgs.ajax", url: web_app.name + "/org/slicedQueryOrgs.ajax",
...@@ -622,6 +623,12 @@ function doSavePerson() { ...@@ -622,6 +623,12 @@ function doSavePerson() {
}); });
} }
function initPersonToSap() {
Public.ajax(web_app.name + "/syncOrg/initAllPersonToSap.ajax",{},function () {
reloadGrid();
})
}
function onDialogCloseHandler() { function onDialogCloseHandler() {
propteryGridManager = null; propteryGridManager = null;
if (refreshFlag) { if (refreshFlag) {
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<x:inputC name="name" id="name" required="true" label="姓名" maxlength="30" labelCol="2" fieldCol="4" /> <x:inputC name="name" id="name" required="true" label="姓名" maxlength="30" labelCol="2" fieldCol="4" />
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="loginName" id="loginName" label="登录名" labelCol="2" fieldCol="4" maxlength="16"/> <x:inputC name="loginName" id="loginName" required="true" label="登录名" labelCol="2" fieldCol="4" maxlength="16"/>
<x:inputC name="englishName" id="englishName" label="英文名称" labelCol="2" fieldCol="4" maxlength="60"/> <x:inputC name="englishName" id="englishName" label="英文名称" labelCol="2" fieldCol="4" maxlength="60"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
......
...@@ -70,4 +70,6 @@ public interface OrgSyncApplication { ...@@ -70,4 +70,6 @@ public interface OrgSyncApplication {
List<SapPersonVo> querySapPersonVoByFullId(String fullId); List<SapPersonVo> querySapPersonVoByFullId(String fullId);
void syncAllPersonToSap();
} }
...@@ -183,10 +183,10 @@ public class OrgSyncApplicationImpl extends BaseApplication implements OrgSyncAp ...@@ -183,10 +183,10 @@ public class OrgSyncApplicationImpl extends BaseApplication implements OrgSyncAp
//银行账户 //银行账户
if (sapPersonVo.getBankAccountNumber().length() > 18){ if (sapPersonVo.getBankAccountNumber().length() > 18){
String bankn = sapPersonVo.getBankAccountNumber(); String bankn = sapPersonVo.getBankAccountNumber();
// bankVo.setBankn(bankn.substring(0,18)); bankVo.setBankn(bankn.substring(0,18));
bankVo.setBankn(bankn); //bankVo.setBankn(bankn);
//账户明细放18位后的值 //账户明细放18位后的值
// bankVo.setBkref(bankn.substring(18,bankn.length())); bankVo.setBkref(bankn.substring(18,bankn.length()));
}else { }else {
bankVo.setBankn(sapPersonVo.getBankAccountNumber()); bankVo.setBankn(sapPersonVo.getBankAccountNumber());
} }
...@@ -275,6 +275,13 @@ public class OrgSyncApplicationImpl extends BaseApplication implements OrgSyncAp ...@@ -275,6 +275,13 @@ public class OrgSyncApplicationImpl extends BaseApplication implements OrgSyncAp
return this.sqlExecutorDao.queryToList(queryDescriptor.getSql(),SapPersonVo.class, append.toString()); return this.sqlExecutorDao.queryToList(queryDescriptor.getSql(),SapPersonVo.class, append.toString());
} }
@Override
public void syncAllPersonToSap() {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedAllSapPersonVo");
List<SapPersonVo> sapPersonVos = this.sqlExecutorDao.queryToList(queryDescriptor.getSql(), SapPersonVo.class);
this.buildSapPerson("I",sapPersonVos);
}
/** /**
* 字符串转hashcode * 字符串转hashcode
* @param value * @param value
......
...@@ -53,6 +53,12 @@ public class SyncOrgController extends CommonController { ...@@ -53,6 +53,12 @@ public class SyncOrgController extends CommonController {
return success(); return success();
} }
public String initAllPersonToSap(){
SDO sdo = this.getSDO();
orgSyncApplication.syncAllPersonToSap();
return success();
}
public String enableOrDisablePerson(){ public String enableOrDisablePerson(){
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
String id = sdo.getId(); String id = sdo.getId();
......
...@@ -64,6 +64,36 @@ ...@@ -64,6 +64,36 @@
</sql-query> </sql-query>
</query> </query>
<query name="slicedAllSapPersonVo" label="构建SAP人员结构">
<sql-query>
SELECT
o.FULL_NAME AS PARENT_FULL_NAME,
p.CODE,
p.ID,
p.NAME,
p.EMAIL,
p.ENGLISH_NAME,
p.sex,
p.OFFICE_PHONE,
p.MOBILE_PHONE,
p.ZIP,
p.FAMILY_ADDRESS,
p.COUNTRY,
p.BANK_COUNTRY,
p.BANK_CODE,
p.BANK_ACCOUNT_NUMBER,
p.COMPANY_CODE,
p.REGION,
p.LANGU,
op.PROPERTY_VALUE AS KOSTL,
'I' AS flag
FROM sa_opperson p
LEFT JOIN sa_oporg o ON p.MAIN_ORG_ID = o.id
LEFT JOIN sa_oporgproperty op ON o.DEPT_ID = op.ORG_ID
where (p.type = '' or p.type is null) and p.is_sap_person = '1'
</sql-query>
</query>
<query name="queryCodeByFullId" label="查询组织下人员"> <query name="queryCodeByFullId" label="查询组织下人员">
<sql-query> <sql-query>
SELECT p.* FROM SELECT p.* FROM
......
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