Merge remote-tracking branch 'origin/lixuetao' into lixuetao

# Conflicts:
#	adc-da-sys/src/main/java/com/adc/da/sys/page/OrgEOPage.java
This commit is contained in:
bupengxiang
2023-05-16 19:03:09 +08:00
89 changed files with 28 additions and 326 deletions
@@ -40,7 +40,7 @@ public class SyncIAMTimer {
* IAM的前缀地址
*/
@Value("${cmp.url}")
private String cmpUrl="https://cmp-uat.faw-vw.in/employee/v1/";
private String cmpUrl="https://cmp-uat.faw-vw.in/";
@Value("${cmp.appkey}")
private String appkey = "TI062S001Uat";
@@ -53,12 +53,12 @@ public class SyncIAMTimer {
/**
* 组织机构增量同步接口地址
*/
public static final String ORG_INCREMENT_URL = "/pageOrgs";
public static final String ORG_INCREMENT_URL = "employee/v1/pageOrgs";
/**
* 用户增量同步接口地址
*/
public static final String USER_INCREMENT_URL = "/pageEmployees";
public static final String USER_INCREMENT_URL = "employee/v1/pageEmployees";
@Resource
SyncIAMLogDao syncIAMLogDao;
@@ -81,10 +81,11 @@ public class SyncIAMTimer {
* @Param pageSize 每页条数,默认10,小于1按1处 于1000按1000处理
*/
public void syncOrgIncrData(int pageIndex, int pageSize){
String syncUrl = this.cmpUrl + ORG_INCREMENT_URL + "?pageIndex=" + pageIndex + "&pageSize=" + pageSize;
String suffixUrl = ORG_INCREMENT_URL + "?pageIndex=" + pageIndex + "&pageSize=" + pageSize;
String syncUrl = this.cmpUrl + suffixUrl;
String gmtDate = SignUtils.getGMTDate();
String sign = SignUtils.generate(HttpMethod.GET, syncUrl, this.xCustom, this.appkey, gmtDate, this.appSecret);
String sign = SignUtils.generate(HttpMethod.GET, suffixUrl, this.xCustom, this.appkey, gmtDate, this.appSecret);
String orgDataStr = HttpRequest.get(syncUrl)
.header("Content-Type", "application/json")
@@ -120,16 +121,24 @@ public class SyncIAMTimer {
* @Param syncModel 同步模式
*/
public void syncUserIncrData(int pageIndex, int pageSize, String enterTime){
String syncUrl = this.cmpUrl + USER_INCREMENT_URL + "?pageIndex=" + pageIndex + "&pageSize=" + pageSize;
String suffixUrl = USER_INCREMENT_URL + "?pageIndex=" + pageIndex + "&pageSize=" + pageSize;
if (StringUtils.isNotEmpty(enterTime)){
syncUrl += "&enterTime=" + enterTime;
suffixUrl += "&enterTime=" + enterTime;
}
String jwtToken = this.getJwtToken(appkey, appSecret);
String syncUrl = this.cmpUrl + suffixUrl;
String gmtDate = SignUtils.getGMTDate();
String sign = SignUtils.generate(HttpMethod.GET, syncUrl, this.xCustom, this.appkey, gmtDate, this.appSecret);
String userDataStr = HttpRequest.post(syncUrl)
.header("Content-Type", "application/json")
.header("Authorization", jwtToken)//头信息,多个头信息多次调用此方法即可
.header("Date", gmtDate)
.header("X-HMAC-ACCESS-KEY", this.appkey)
.header("X-HMAC-ALGORITHM", "hmac-sha256")
.header("X-HMAC-SIGNED-HEADERS", "x-custom")
.header("x-custom", this.xCustom)
.header("X-HMAC-SIGNATURE", sign)
.timeout(10 * 60 * 1000) //超时,毫秒
.execute().body();
@@ -12,7 +12,7 @@ public class OrgEOPage extends BasePage {
/**
* 部门编码
*/
private String DepartmentCode;
private String departmentCode;
/**
@@ -4,17 +4,17 @@
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
<if test="pageVO.DepartmentCode != null and pageVO.DepartmentCode !=''">
and DEPARTMENT_CODE = #{pageVO.DepartmentCode}
<if test="pageVO.departmentCode != null and pageVO.DepartmentCode !=''">
and DEPARTMENT_CODE = #{pageVO.departmentCode}
</if>
<if test="pageVO.LongName != null and pageVO.LongName != ''">
and LONG_NAME LIKE CONCAT(CONCAT('%',#{pageVO.LongName}) ,'%')
<if test="pageVO.longName != null and pageVO.longName != ''">
and LONG_NAME LIKE CONCAT(CONCAT('%',#{pageVO.longName}) ,'%')
</if>
<if test="pageVO.LEVEL != null">
and LEVEL = #{pageVO.LEVEL}
<if test="pageVO.level != null">
and LEVEL = #{pageVO.level}
</if>
<if test="pageVO.ParentID != null and pageVO.ParentID !=''">
and PARENT_ID = #{pageVO.ParentID}
<if test="pageVO.parentId != null and pageVO.parentId !=''">
and PARENT_ID = #{pageVO.parentId}
</if>
<if test="pageVO.attribution != null and pageVO.attribution != ''">
and ATTRIBUTION = #{pageVO.attribution}