已添加33个文件
已删除2个文件
已修改39个文件
| | |
| | | VUE_APP_API_PREFIX = '/system_gateway' |
| | | |
| | | # 项ç®åç§° |
| | | VUE_APP_TITLE = 'èæ¹çèæºæ
§å®æ¶å®å
¨é²èç³»ç»' |
| | | VUE_APP_TITLE = '马éå±±çèæºæ
§å®æ¶å®å
¨é²èç³»ç»' |
| | |
| | | |
| | | # VUE_APP_API_URL = 'http://192.168.1.45:10010' |
| | | |
| | | VUE_APP_API_URL = 'http://192.168.0.212/system_gateway' |
| | | VUE_APP_API_URL = 'http://127.0.0.1:10010' |
| | | |
| | | # VUE_APP_API_URL = 'http://localhost:10010' |
| | | |
| | |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| | | <meta name="viewport" content="width=device-width,initial-scale=1.0"> |
| | | <link rel="icon" href="<%= BASE_URL %>favicon.ico"> |
| | | <title>èæ¹çèæºæ
§å®æ¶å®å
¨é²èç³»ç»</title> |
| | | <title>马éå±±çèæºæ
§å®æ¶å®å
¨é²èç³»ç»</title> |
| | | </head> |
| | | <body> |
| | | <noscript> |
| | | <strong>We're sorry but èæ¹çèæºæ
§å®æ¶å®å
¨é²èç³»ç» doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
| | | <strong>We're sorry but 马éå±±çèæºæ
§å®æ¶å®å
¨é²èç³»ç» doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
| | | </noscript> |
| | | <div id="app"></div> |
| | | <!-- built files will be auto injected --> |
| | |
| | | export function companySyncDingding (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/company/syncAllDingding', data) |
| | | } |
| | | export function companySyncJdy (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/company/syncAllJdy', data) |
| | | } |
| | | // å页æ¥è¯¢ |
| | | export function companyGetList (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/company/page', data) |
| | |
| | | export function memberSyncDingding (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/member/syncAllDingding', data) |
| | | } |
| | | export function memberSyncJdy (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/member/syncAllJdy', data) |
| | | } |
| | | export function delHkForce (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/member/delHkForce', data) |
| | | } |
| | |
| | | @click="synchronous()">忥</el-button></li> |
| | | <li><el-button type="primary" v-permissions="['business:company:create']" :loading="loading" |
| | | @click="synchronousDingding()">忥éé</el-button></li> |
| | | <!-- <li><el-button type="primary" v-permissions="['business:company:create']" :loading="loading" |
| | | @click="synchronousJdy()">忥ç®éäº</el-button></li>--> |
| | | </ul> |
| | | <el-table :max-height="tableHeight" v-loading="isWorking.search" :data="list" stripe |
| | | :tree-props="{ children: 'childList', hasChildren: 'hasChildren' }" row-key="id" |
| | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import { companySync,companySyncDingding, sort } from '@/api/business/company' |
| | | import { companySync,companySyncDingding, companySyncJdy,sort } from '@/api/business/company' |
| | | import OperaInternalCompanyWindow from '@/components/business/OperaInternalCompanyWindow' |
| | | export default { |
| | | name: 'internalCompany', |
| | |
| | | }) |
| | | .catch(() => { }) |
| | | }, |
| | | async synchronousJdy() { |
| | | this.$dialog.actionConfirm('该æä½å°ç³»ç»æ¸
空已æå
é¨ç»ç»ä¿¡æ¯ï¼æ¨ç¡®è®¤åæ¥å
¨é¨ä¿¡æ¯åï¼', 'æä½ç¡®è®¤æé') |
| | | .then(() => { |
| | | this.loading = true |
| | | companySyncJdy({}) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '忥æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }) |
| | | .catch(() => { }) |
| | | }, |
| | | // æåº |
| | | sort(direction) { |
| | | if (this.sorting) { |
| | |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:member:delete', 'business:member:create,business:empower:create']"> |
| | | <li><el-button type="primary" v-permissions="['business:member:sync']" :loading="loading" |
| | | @click="synchronous()">忥</el-button></li> |
| | | @click="synchronous()">忥å®é²å¹³å°</el-button></li> |
| | | <!-- <li><el-button type="primary" v-permissions="['business:member:create']" :loading="loading" |
| | | @click="synchronousJdy()">忥ç®éäº</el-button></li>--> |
| | | <li><el-button type="primary" v-permissions="['business:member:create']" :loading="loading" |
| | | @click="synchronousDingding()">忥éé</el-button></li> |
| | | <li><el-button type="primary" |
| | |
| | | import OperaMemberImportWindow from '@/components/business/OperaMemberImportWindow' |
| | | import { fetchList } from '@/api/business/company' |
| | | import { allList } from '@/api/business/position' |
| | | import { memberSync,memberSyncDingding, roleAuth, updateCanVisit, updateHead, updateWorkStatus } from '@/api/business/member' |
| | | import { memberSync,memberSyncDingding, memberSyncJdy,roleAuth, updateCanVisit, updateHead, updateWorkStatus } from '@/api/business/member' |
| | | export default { |
| | | name: 'internalMember', |
| | | extends: BaseTable, |
| | |
| | | }) |
| | | .catch(() => { }) |
| | | }, |
| | | async synchronousJdy() { |
| | | this.$dialog.actionConfirm('该æä½é触åå
¨åä¿¡æ¯æ´æ°åéæ°ä¸åï¼è¯·è°¨æ
æä½', 'æ¨ç¡®è®¤å
¨é忥å
é¨äººåä¿¡æ¯åï¼') |
| | | .then(() => { |
| | | this.loading = true |
| | | memberSyncJdy({}) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '忥æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }) |
| | | .catch(() => { }) |
| | | }, |
| | | async updateHead(row, type) { |
| | | this.$dialog.actionConfirm('æ¨ç¡®è®¤è¿è¡å½åæä½åï¼', 'é¨é¨ä¸»ç®¡è®¾ç½®æä½æç¤º') |
| | | .then(() => { |
| | |
| | | <img src="@/assets/images/bg@2x.png" class="main_bg" alt=""> |
| | | <div class="login_wrap"> |
| | | <div class="login_img"> |
| | | <div class="h2">èæ¹çèæºæ
§å®æ¶å®å
¨é²èç³»ç»</div> |
| | | <div class="h2">马éå±±çèæºæ
§å®æ¶å®å
¨é²èç³»ç»</div> |
| | | <div class="h3">æºæ
§ç©æµååºå®æ¶ä¸ä½åç³»ç»</div> |
| | | </div> |
| | | <div class="form_wrap"> |
| | |
| | | align-items: center; |
| | | justify-content: center; |
| | | border-radius: 4px; |
| | | width: 208px; |
| | | width: 248px; |
| | | display: flex; |
| | | margin-bottom: 12px; |
| | | } |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://10.50.250.178:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://10.50.250.178:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Atwl@2024 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | |
| | | /usr/local/nacos/nacos/bin/startup.sh -m standalone |
| | | |
| | | nohup java -jar /usr/local/jars/wuhuyancao/system_gateway.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/wuhuyancao/admin_timer.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/wuhuyancao/system_timer.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/wuhuyancao/admin_interface.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/wuhuyancao/meeting_admin.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/maanshanyancao/system_gateway.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/maanshanyancao/admin_timer.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/maanshanyancao/system_timer.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/maanshanyancao/admin_interface.jar > /dev/null 2>&1 & |
| | | nohup java -jar /usr/local/jars/maanshanyancao/meeting_admin.jar > /dev/null 2>&1 & |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | tail -f /usr/local/jars/logs/visitsAdmin/info.2025-10-31.0.log |
| | | tail -f /usr/local/jars/logs/visitsAdmin/error.2025-11-05.0.log |
| | |
| | | private final RouteLocator routeLocator; |
| | | private final GatewayProperties gatewayProperties; |
| | | |
| | | |
| | | @Override |
| | | public List<SwaggerResource> get() { |
| | | List<SwaggerResource> resources = new ArrayList<>(); |
| | |
| | | }); |
| | | return resources; |
| | | } |
| | | |
| | | private SwaggerResource swaggerResource(String name, String location) { |
| | | log.info("name:{},location:{}",name,location); |
| | | SwaggerResource swaggerResource = new SwaggerResource(); |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://localhost:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://localhost:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Whyc@2025 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | discovery: |
| | | server-addr: http://192.168.0.7:8848 #é
ç½®Nacoså°å |
| | | # namespace: dmvisit |
| | | namespace: wuhu_visit_dev1 |
| | | namespace: wuhu_visit_dev |
| | | username: nacos |
| | | password: nacos |
| | | gateway: |
| | |
| | | password: nacos |
| | | discovery: |
| | | server-addr: http://localhost:8848 #é
ç½®Nacoså°å |
| | | namespace: wuhuyancao |
| | | namespace: maanshanyancao |
| | | # namespace: dev_renkang |
| | | username: nacos |
| | | password: nacos |
| | |
| | | int erp = 1; |
| | | int hk = 2; |
| | | int self = 0; |
| | | int jdy = 3; |
| | | int dingding = 4; |
| | | } |
| | | private Integer orgUserDataOrigin; |
| | | private Integer visitorDataOrigin; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.arch; |
| | | |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.CORP_COOP_BASE_PATH; |
| | | |
| | | /** |
| | | * ä¼ä¸äºèç¸å
³æ¥å£ |
| | | */ |
| | | public class CorpCoopApiClient extends ApiClient { |
| | | |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Collections.singletonList("v5"); |
| | | |
| | | |
| | | public CorpCoopApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + CORP_COOP_BASE_PATH + path; |
| | | } |
| | | |
| | | /** |
| | | * ååºæè¿æ¥çä¼ä¸ |
| | | * |
| | | * @param deptNo - é¨é¨ç¼å· å¯ä¸ºnull |
| | | * @return æè¿æ¥çä¼ä¸ |
| | | */ |
| | | public Map<String, Object> corpCoopDepartList(Integer deptNo, String version) throws Exception { |
| | | String path = this.generatePath(version, "department/list"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("dept_no", deptNo); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * ååºæè¿æ¥çä¼ä¸å¯¹æ¥äºº |
| | | * |
| | | * @param deptNo - é¨é¨ç¼å· å¯ä¸ºnull |
| | | * @return æè¿æ¥çä¼ä¸å¯¹æ¥äºº |
| | | */ |
| | | public Map<String, Object> corpCoopMemberList(Integer deptNo, String version) throws Exception { |
| | | String path = this.generatePath(version, "user/list"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("dept_no", deptNo); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * ååºæè¿æ¥çä¼ä¸å¯¹æ¥äººè¯¦ç»ä¿¡æ¯ |
| | | * |
| | | * @param userName - ç¨æ·å |
| | | */ |
| | | public Map<String, Object> corpCoopUserInfo(String userName, String version) throws Exception { |
| | | if (StringUtils.isBlank(userName)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "user/get"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("username", userName); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.arch; |
| | | |
| | | import com.doumee.core.jiandaoyun.model.dept.DeptCreateParam; |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.DEPT_BASE_PATH; |
| | | |
| | | /** |
| | | * é¨é¨ç¸å
³æ¥å£ |
| | | */ |
| | | public class DeptApiClient extends ApiClient { |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Collections.singletonList("v5"); |
| | | |
| | | public DeptApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + DEPT_BASE_PATH + path; |
| | | } |
| | | |
| | | /** |
| | | * è·åé¨é¨ç¼å·å¯¹åºé¨é¨å表 ï¼éå½ï¼ |
| | | * |
| | | * @param deptNo - é¨é¨ç¼å· |
| | | * @return é¨é¨ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> deptList(Integer deptNo, Boolean hasChild, String version) throws Exception { |
| | | if (deptNo == null) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "list"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("has_child", hasChild); |
| | | data.put("dept_no", deptNo); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * å建é¨é¨ |
| | | * |
| | | * @param param - é¨é¨åç§° |
| | | * @return é¨é¨ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> deptCreate(DeptCreateParam param, String version) throws Exception { |
| | | if (param == null || !param.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "create"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("name", param.getName()); |
| | | data.put("dept_no", param.getDept_no()); |
| | | data.put("parent_no", param.getParent_no()); |
| | | HttpRequestParam httpRequestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(httpRequestParam); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®é¨é¨ç¼å· æ´æ°é¨é¨åç§° |
| | | * |
| | | * @param deptNo - é¨é¨ç¼å· |
| | | * @param name - åç§° |
| | | * @return æ´æ°åçé¨é¨ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> deptUpdate(Integer deptNo, String name, String version) throws Exception { |
| | | if (deptNo == null || StringUtils.isBlank(name)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "update"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("name", name); |
| | | data.put("dept_no", deptNo); |
| | | HttpRequestParam httpRequestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(httpRequestParam); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é¨é¨ç¼å· å é¤é¨é¨ |
| | | * |
| | | * @param deptNo - é¨é¨ç¼å· |
| | | * @return status |
| | | */ |
| | | public Map<String, Object> deptDelete(Integer deptNo, String version) throws Exception { |
| | | if (deptNo == null) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "delete"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("dept_no", deptNo); |
| | | HttpRequestParam httpRequestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(httpRequestParam); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®éææ¨¡å¼é讯å½çé¨é¨IDè·åé¨é¨ç¼å· |
| | | * |
| | | * @param integrateId - ç¬¬ä¸æ¹å¹³å°çé讯å½é¨é¨çID |
| | | * @return é¨é¨ç¼å· |
| | | */ |
| | | public Map<String, Object> deptByIntegrateId(String integrateId, String version) throws Exception { |
| | | if (StringUtils.isBlank(integrateId)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "dept_no/get"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("integrate_id", integrateId); |
| | | HttpRequestParam httpRequestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(httpRequestParam); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå建é¨é¨ |
| | | * |
| | | * @param paramList - é¨é¨åæ°å表 |
| | | * @return status |
| | | */ |
| | | public Map<String, Object> departmentImport(List<DeptCreateParam> paramList, String version) throws Exception { |
| | | if (CollectionUtils.isEmpty(paramList)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "import"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("departments", paramList); |
| | | HttpRequestParam httpRequestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(httpRequestParam); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è·åé¨é¨æåï¼éå½ï¼ |
| | | * |
| | | * @param deptNo - é¨é¨ç¼å· |
| | | * @param hasChild - æ¯å¦æ¥åé¨é¨ |
| | | * @return é¨é¨æåä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> deptMemberList(Integer deptNo, Boolean hasChild, String version) throws Exception { |
| | | if (deptNo == null || hasChild == null) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "user/list"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("has_child", hasChild); |
| | | data.put("dept_no", deptNo); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.arch; |
| | | |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | import com.doumee.core.jiandaoyun.model.user.UserCreateParam; |
| | | import com.doumee.core.jiandaoyun.model.user.UserUpdateParam; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.MEMBER_BASE_PATH; |
| | | |
| | | /** |
| | | * æåç¸å
³æ¥å£ |
| | | */ |
| | | public class MemberApiClient extends ApiClient { |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Arrays.asList("v5"); |
| | | |
| | | public MemberApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + MEMBER_BASE_PATH + path; |
| | | } |
| | | |
| | | /** |
| | | * å建æå |
| | | * |
| | | * @param param - æåä¿¡æ¯ |
| | | * @return æåä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> userCreate(UserCreateParam param, String version) throws Exception { |
| | | if (param == null || !param.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "create"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("name", param.getName()); |
| | | data.put("username", param.getUsername()); |
| | | data.put("departments", param.getDepartments()); |
| | | HttpRequestParam requestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(requestParam); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æååç§° è·åæå |
| | | * |
| | | * @param userName - æååç§° |
| | | * @return æåä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> userInfo(String userName, String version) throws Exception { |
| | | if (StringUtils.isBlank(userName)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "get"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("username", userName); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æå |
| | | * |
| | | * @param updateParam - æ´æ°çæåä¿¡æ¯ |
| | | * @return æ´æ°åçæåä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> userUpdate(UserUpdateParam updateParam, String version) throws Exception { |
| | | if (updateParam == null || !updateParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "update"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("name", updateParam.getName()); |
| | | data.put("username", updateParam.getUserName()); |
| | | data.put("departments", updateParam.getDepartmentList()); |
| | | HttpRequestParam requestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(requestParam); |
| | | } |
| | | |
| | | /** |
| | | * æåå é¤ |
| | | * |
| | | * @param userName - æååç§° |
| | | * @return status |
| | | */ |
| | | public Map<String, Object> userDelete(String userName, String version) throws Exception { |
| | | if (StringUtils.isBlank(userName)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "delete"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("username", userName); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¹éå 餿å |
| | | * |
| | | * @param userNameList - å¾
å é¤çç¨æ·åç§°å表 |
| | | * @return status |
| | | */ |
| | | public Map<String, Object> userBatchDelete(List<String> userNameList, String version) throws Exception { |
| | | if (CollectionUtils.isEmpty(userNameList)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "batch_delete"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("usernames", userNameList); |
| | | HttpRequestParam requestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(requestParam); |
| | | } |
| | | |
| | | /** |
| | | * æ¹é导å
¥æå |
| | | * |
| | | * @param userNameList - 导å
¥çæåå表 |
| | | * @return status |
| | | */ |
| | | public Map<String, Object> userImport(List<UserCreateParam> userNameList, String version) throws Exception { |
| | | if (CollectionUtils.isEmpty(userNameList)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "import"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("users", userNameList); |
| | | HttpRequestParam requestParam = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(requestParam); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.arch; |
| | | |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | import com.doumee.core.jiandaoyun.model.role.RoleListQueryParam; |
| | | import com.doumee.core.jiandaoyun.model.role.RoleMemberQueryParam; |
| | | import com.doumee.core.jiandaoyun.model.role.RoleUpdateParam; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.ROLE_BASE_PATH; |
| | | |
| | | /** |
| | | * è§è²ç¸å
³æ¥å£ |
| | | */ |
| | | public class RoleApiClient extends ApiClient { |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Collections.singletonList("v5"); |
| | | |
| | | public RoleApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + ROLE_BASE_PATH + path; |
| | | } |
| | | |
| | | /** |
| | | * ååºè§è² |
| | | * |
| | | * @param queryParam - æ¥è¯¢åæ° |
| | | * @return è§è²ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> roleList(RoleListQueryParam queryParam, String version) throws Exception { |
| | | if (queryParam == null || !queryParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "list"); |
| | | // 请æ±åæ° å° queryParam éé¢ç屿§è½¬æ¢æmap |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(queryParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * å建è§è² |
| | | * |
| | | * @param name - è§è²åç§° |
| | | * @param groupNo - è§è²ç»ç¼å· |
| | | * @return è§è²ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> roleCreate(String name, Integer groupNo, String version) throws Exception { |
| | | if (StringUtils.isBlank(name) || groupNo == null) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"create"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("group_no", groupNo); |
| | | data.put("name", name); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°è§è² |
| | | * |
| | | * @param updateParam - è§è²æ´æ°ä¿¡æ¯ |
| | | * @return æ´æ°åçè§è²ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> roleUpdate(RoleUpdateParam updateParam, String version) throws Exception { |
| | | if (updateParam == null || !updateParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"update"); |
| | | // 请æ±åæ° å° queryParam éé¢ç屿§è½¬æ¢æmap |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(updateParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è§è² |
| | | * |
| | | * @param roleNo - è§è²ç¼å· |
| | | * @return æ |
| | | */ |
| | | public Map<String, Object> roleDelete(Integer roleNo, String version) throws Exception { |
| | | if (roleNo == null) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"delete"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("role_no", roleNo); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * ååºè§è²ä¸çæææå |
| | | * |
| | | * @param queryParam - äº§çº¿åæ° |
| | | * @return æåä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> roleMemberList(RoleMemberQueryParam queryParam, String version) throws Exception { |
| | | if (queryParam == null || !queryParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"user/list"); |
| | | // 请æ±åæ° å° queryParam éé¢ç屿§è½¬æ¢æmap |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(queryParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éç»å·²æçæå设置èªå»ºè§è² |
| | | * |
| | | * @param roleNo - è§è²ç¼å· |
| | | * @param userNameList - æååç§°å表 |
| | | * @return success |
| | | */ |
| | | public Map<String, Object> roleAddMembers(Integer roleNo, List<String> userNameList, String version) |
| | | throws Exception { |
| | | if (roleNo == null || CollectionUtils.isEmpty(userNameList)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"add_members"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("role_no", roleNo); |
| | | data.put("usernames", userNameList); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * 为èªå»ºè§è²æ¹éç§»é¤æå |
| | | * |
| | | * @param roleNo - è§è²ç¼å· |
| | | * @param userNameList - ç¨æ·åç§°å表 |
| | | * @return status |
| | | */ |
| | | public Map<String, Object> roleRemoveMembers(Integer roleNo, List<String> userNameList, String version) |
| | | throws Exception { |
| | | if (roleNo == null || CollectionUtils.isEmpty(userNameList)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"remove_members"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("role_no", roleNo); |
| | | data.put("usernames", userNameList); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.arch; |
| | | |
| | | |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | import com.doumee.core.jiandaoyun.model.role.RoleGroupListQueryParam; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.ROLE_GROUP_BASE_PATH; |
| | | |
| | | /** |
| | | * è§è²ç»ç¸å
³æ¥å£ |
| | | */ |
| | | public class RoleGroupApiClient extends ApiClient { |
| | | |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Collections.singletonList("v5"); |
| | | |
| | | public RoleGroupApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + ROLE_GROUP_BASE_PATH + path; |
| | | } |
| | | |
| | | /** |
| | | * ååºè§è²ç» |
| | | * |
| | | * @param queryParam - æ¥è¯¢åæ° |
| | | * @return è§è²ç»ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> roleGroupList(RoleGroupListQueryParam queryParam, String version) throws Exception { |
| | | if (queryParam == null || !queryParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"list"); |
| | | // 请æ±åæ° å° queryParam éé¢ç屿§è½¬æ¢æmap |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(queryParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * å建è§è²ç» |
| | | * |
| | | * @param name - è§è²ç»åç§° |
| | | * @return è§è²ç»ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> roleGroupCreate(String name, String version) throws Exception { |
| | | if (StringUtils.isBlank(name)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"create"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("name", name); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°è§è²ç» |
| | | * |
| | | * @param name - è§è²ç»åç§° |
| | | * @param roleGroupNo - è§è²ç»ç¼å· |
| | | * @return æ´æ°åçè§è²ç»ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> roleGroupUpdate(String name, Integer roleGroupNo, String version) throws Exception { |
| | | if (StringUtils.isBlank(name) || roleGroupNo == null) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version,"update"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("name", name); |
| | | data.put("role_group_no", roleGroupNo); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è§è²ç» |
| | | * |
| | | * @param roleGroupNo - è§è²ç»ç¼å· |
| | | * @return status |
| | | */ |
| | | public Map<String, Object> roleGroupDelete(Integer roleGroupNo, String version) throws Exception { |
| | | if (roleGroupNo == null) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "delete"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("role_group_no", roleGroupNo); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.jdy; |
| | | |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.doumee.core.jiandaoyun.model.base.PageBaseParam; |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.APP_BASE_PATH; |
| | | |
| | | |
| | | /** |
| | | * åºç¨ç¸å
³æ¥å£ |
| | | */ |
| | | public class AppApiClient extends ApiClient { |
| | | |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Collections.singletonList("v5"); |
| | | |
| | | public AppApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + APP_BASE_PATH + path; |
| | | } |
| | | |
| | | /** |
| | | * åºç¨å页å表 |
| | | * |
| | | * @param queryParam - æ¥è¯¢åæ° |
| | | * @return åºç¨ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> appList(PageBaseParam queryParam, String version) throws Exception { |
| | | if (queryParam == null || !queryParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "list"); |
| | | // 请æ±åæ° å° queryParam éé¢ç屿§è½¬æ¢æmap |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(queryParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.jdy; |
| | | |
| | | import com.doumee.core.jiandaoyun.model.file.UploadTokenParam; |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.io.File; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.FORM_BASE_PATH; |
| | | |
| | | /** |
| | | * æä»¶ç¸å
³æ¥å£ |
| | | */ |
| | | public class FileApiClient extends ApiClient { |
| | | |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Collections.singletonList("v5"); |
| | | |
| | | public FileApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + FORM_BASE_PATH + path; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶ä¸ä¼ åè¯åä¸ä¼ å°åæ¥å£ |
| | | * |
| | | * @param uploadTokenParam - æä»¶å¯¹åºçä¿¡æ¯ |
| | | * @return tokenåurlä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> uploadToken(UploadTokenParam uploadTokenParam, String version) throws Exception { |
| | | if (uploadTokenParam == null || !uploadTokenParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "file/get_upload_token"); |
| | | // 请æ±åæ° |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("transaction_id", uploadTokenParam.getTransactionId()); |
| | | data.put("app_id", uploadTokenParam.getAppId()); |
| | | data.put("entry_id", uploadTokenParam.getEntryId()); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | public Map<String, Object> uploadFile(String url, String token, File file) throws Exception { |
| | | if (StringUtils.isBlank(url) || StringUtils.isBlank(token) || file == null) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | return this.httpPostFile(url, token, file); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.jdy; |
| | | |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.doumee.core.jiandaoyun.model.form.FormQueryParam; |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.FORM_BASE_PATH; |
| | | |
| | | /** |
| | | * 表åç¸å
³æ¥å£ |
| | | */ |
| | | public class FormApiClient extends ApiClient { |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Arrays.asList("v5"); |
| | | |
| | | public FormApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + FORM_BASE_PATH + path; |
| | | } |
| | | |
| | | /** |
| | | * 表ååæ®µæ¥è¯¢æ¥å£ |
| | | * |
| | | * @param appId - åºç¨ Id |
| | | * @param entryId - 表å Id |
| | | */ |
| | | public Map<String, Object> formWidgets(String appId, String entryId, String version) throws Exception { |
| | | if (StringUtils.isBlank(appId) || StringUtils.isBlank(entryId)) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "widget/list"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("app_id", appId); |
| | | data.put("entry_id", entryId); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * è¡¨åæ¥è¯¢æ¥å£ å页 |
| | | * |
| | | * @param queryParam - æ¥è¯¢åæ° |
| | | * @return 表åä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> entryList(FormQueryParam queryParam, String version) throws Exception { |
| | | if (queryParam == null || !queryParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "list"); |
| | | // 请æ±åæ° å° queryParam éé¢ç屿§è½¬æ¢æmap |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(queryParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.api.jdy; |
| | | |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.doumee.core.jiandaoyun.model.form.FormDataBatchCreateParam; |
| | | import com.doumee.core.jiandaoyun.model.form.FormDataBatchRemoveParam; |
| | | import com.doumee.core.jiandaoyun.model.form.FormDataBatchUpdateParam; |
| | | import com.doumee.core.jiandaoyun.model.form.FormDataCreateParam; |
| | | import com.doumee.core.jiandaoyun.model.form.FormDataDeleteParam; |
| | | import com.doumee.core.jiandaoyun.model.form.FormDataQueryParam; |
| | | import com.doumee.core.jiandaoyun.model.form.FormDataUpdateParam; |
| | | import com.doumee.core.jiandaoyun.model.http.ApiClient; |
| | | import com.doumee.core.jiandaoyun.model.http.HttpRequestParam; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.doumee.core.jiandaoyun.constants.HttpConstant.FORM_DATA_BASE_PATH; |
| | | |
| | | /** |
| | | * è¡¨åæ°æ®ç¸å
³æ¥å£ |
| | | */ |
| | | public class FormDataApiClient extends ApiClient { |
| | | |
| | | private static final String DEFAULT_VERSION = "v5"; |
| | | private static final List<String> VALID_VERSION_LIST = Collections.singletonList("v5"); |
| | | |
| | | public FormDataApiClient(String apiKey, String host) { |
| | | super(apiKey, host); |
| | | this.setDefaultVersion(DEFAULT_VERSION); |
| | | this.setValidVersionList(VALID_VERSION_LIST); |
| | | } |
| | | |
| | | @Override |
| | | public String generatePath(String version, String path) { |
| | | return super.getValidVersion(version) + FORM_DATA_BASE_PATH + path; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å»ºåæ¡æ°æ®æ¥å£ |
| | | * |
| | | * @param createParam - è¡¨åæ°æ®ä¿¡æ¯ |
| | | * @return æ°å¢çæ°æ®ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> singleDataCreate(FormDataCreateParam createParam, String version) throws Exception { |
| | | if (createParam == null || !createParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "create"); |
| | | // 请æ±åæ° å° queryParam éé¢ç屿§è½¬æ¢æmap |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(createParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ¡æ°æ®æ¥å£ |
| | | * |
| | | * @param queryParam - æ¥è¯¢åæ° |
| | | * @return æ°æ®ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> singleDataQuery(FormDataQueryParam queryParam, String version) throws Exception { |
| | | if (queryParam == null || !queryParam.isSingleQueryValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "get"); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("data_id", queryParam.getData_id()); |
| | | data.put("app_id", queryParam.getApp_id()); |
| | | data.put("entry_id", queryParam.getEntry_id()); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åæ¡æ°æ®æ¥å£ |
| | | * |
| | | * @param updateParam - æ´æ°æ°æ®ä¿¡æ¯ |
| | | * @return æ´æ°åçæ°æ®ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> singleDataUpdate(FormDataUpdateParam updateParam, String version) throws Exception { |
| | | if (updateParam == null || !updateParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "update"); |
| | | // 请æ±åæ° å° queryParam éé¢ç屿§è½¬æ¢æmap |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(updateParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åªé¤åæ¡æ°æ®æ¥å£ |
| | | * |
| | | * @param deleteParam - å é¤çæ°æ®ä¿¡æ¯ |
| | | * @param version - çæ¬ |
| | | * @return status |
| | | */ |
| | | public Map<String, Object> singleDataRemove(FormDataDeleteParam deleteParam, String version) throws Exception { |
| | | if (deleteParam == null || !deleteParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "delete"); |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(deleteParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * æ°å»ºå¤æ¡æ°æ®æ¥å£ |
| | | * |
| | | * @param createParam - æ°å»ºçæ°æ®ä¿¡æ¯ |
| | | * @param version - çæ¬ |
| | | * @return success_count |
| | | */ |
| | | public Map<String, Object> batchDataCreate(FormDataBatchCreateParam createParam, String version) throws Exception { |
| | | if (createParam == null || !createParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "batch_create"); |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(createParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å¤æ¡æ°æ®æ¥å£ |
| | | * |
| | | * @param queryParam - æ¥è¯¢åæ° |
| | | * @param version - çæ¬ |
| | | * @return æ°æ®ä¿¡æ¯ |
| | | */ |
| | | public Map<String, Object> batchDataQuery(FormDataQueryParam queryParam, String version) throws Exception { |
| | | if (queryParam == null || !queryParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "list"); |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(queryParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å¤æ¡æ°æ®æ¥å£ |
| | | * |
| | | * @param removeParam - å é¤åæ° |
| | | * @param version - çæ¬ |
| | | * @return status å success_count |
| | | */ |
| | | public Map<String, Object> batchDataRemove(FormDataBatchRemoveParam removeParam, String version) throws Exception { |
| | | if (removeParam == null || !removeParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "batch_delete"); |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(removeParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å¤æ¡æ°æ®æ¥å£ |
| | | * |
| | | * @param updateParam - æ´æ°æ°æ®çä¿¡æ¯ |
| | | * @param version - çæ¬ |
| | | * @return status å success_count |
| | | */ |
| | | public Map<String, Object> batchDataUpdate(FormDataBatchUpdateParam updateParam, String version) throws Exception { |
| | | if (updateParam == null || !updateParam.isValid()) { |
| | | throw new RuntimeException("param lack!"); |
| | | } |
| | | String path = this.generatePath(version, "batch_update"); |
| | | Map<String, Object> data = |
| | | new ObjectMapper().convertValue(updateParam, new TypeReference<Map<String, Object>>() { |
| | | }); |
| | | HttpRequestParam param = new HttpRequestParam(path, data); |
| | | return this.sendPostRequest(param); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.constants; |
| | | |
| | | /** |
| | | * http ç¸å
³ç常é |
| | | */ |
| | | public class HttpConstant { |
| | | public static final String HOST = "https://api.jiandaoyun.com/api/"; |
| | | |
| | | /** |
| | | * é¨é¨ç¸å
³çæ¥å£åç¼ |
| | | */ |
| | | public static final String DEPT_BASE_PATH = "/corp/department/"; |
| | | |
| | | /** |
| | | * æåç¸å
³çæ¥å£åç¼ |
| | | */ |
| | | public static final String MEMBER_BASE_PATH = "/corp/user/"; |
| | | |
| | | /** |
| | | * åºç¨ç¸å
³çæ¥å£åç¼ |
| | | */ |
| | | public static final String APP_BASE_PATH = "/app/"; |
| | | |
| | | |
| | | /** |
| | | * ä¼ä¸äºèçæ¥å£åç¼ |
| | | */ |
| | | public static final String CORP_COOP_BASE_PATH = "/corp/guest/"; |
| | | |
| | | /** |
| | | * è§è²ç¸å
³çæ¥å£åç¼ |
| | | */ |
| | | public static final String ROLE_BASE_PATH = "/corp/role/"; |
| | | |
| | | /** |
| | | * è§è²ç»ç¸å
³çæ¥å£åç¼ |
| | | */ |
| | | public static final String ROLE_GROUP_BASE_PATH = "/corp/role_group/"; |
| | | |
| | | /** |
| | | * 表åç¸å
³çæ¥å£åç¼ |
| | | */ |
| | | public static final String FORM_BASE_PATH = "/app/entry/"; |
| | | |
| | | /** |
| | | * 表åç¸å
³çæ¥å£åç¼ |
| | | */ |
| | | public static final String FORM_DATA_BASE_PATH = "/app/entry/data/"; |
| | | |
| | | /** |
| | | * API_KEY |
| | | */ |
| | | public static final String API_KEY = "JsmYomhn3dissp9ZJ6QeTpnH2xKoKZgw"; |
| | | |
| | | public static final String APP_ID = "APP_ID"; |
| | | |
| | | public static final String ENTRY_ID = "ENTRY_ID"; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.base; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢åºå |
| | | */ |
| | | public class PageBaseParam { |
| | | /** |
| | | * è·³è¿æ°é |
| | | */ |
| | | private Integer skip; |
| | | /** |
| | | * æ¥è¯¢æ°é |
| | | */ |
| | | private Integer limit; |
| | | |
| | | public Integer getSkip() { |
| | | return skip; |
| | | } |
| | | |
| | | public void setSkip(Integer skip) { |
| | | this.skip = skip; |
| | | } |
| | | |
| | | public Integer getLimit() { |
| | | return limit; |
| | | } |
| | | |
| | | public void setLimit(Integer limit) { |
| | | this.limit = limit; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return this.getLimit() != null && this.getSkip() != null; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "PageBaseParam{" + |
| | | "skip=" + skip + |
| | | ", limit=" + limit + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.dept; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * å建é¨é¨çåæ° |
| | | */ |
| | | public class DeptCreateParam { |
| | | |
| | | /** |
| | | * é¨é¨åç§° å¿
å¡« |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * ç¶çº§é¨é¨ç¼å· éå¡« |
| | | */ |
| | | private Integer parent_no; |
| | | |
| | | /** |
| | | * é¨é¨ç¼å· éå¡« |
| | | */ |
| | | private Integer dept_no; |
| | | |
| | | public DeptCreateParam(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public DeptCreateParam() { |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getParent_no() { |
| | | return parent_no; |
| | | } |
| | | |
| | | public void setParent_no(Integer parent_no) { |
| | | this.parent_no = parent_no; |
| | | } |
| | | |
| | | public Integer getDept_no() { |
| | | return dept_no; |
| | | } |
| | | |
| | | public void setDept_no(Integer dept_no) { |
| | | this.dept_no = dept_no; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getName()); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "DeptCreateParam{" + |
| | | "name='" + name + '\'' + |
| | | ", parent_no=" + parent_no + |
| | | ", dept_no=" + dept_no + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.dept; |
| | | |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * é¨é¨å®ä½åæ° |
| | | */ |
| | | |
| | | @Data |
| | | public class DeptEntityModel { |
| | | |
| | | private Integer dept_no;// Number é¨é¨ç¼å·ï¼ä¼ä¸å
å¯ä¸ ä¸åä¼ä¸ä¹é´å¯è½åå¨éå¤ |
| | | |
| | | private String name ;//String é¨é¨åç§° |
| | | private Integer parent_no;// Number ç¶é¨é¨ç¼å· å¨ä¼ä¸äºèæ¥å£ä¸(å¤é¨é¨é¨)ä¸åå¨ |
| | | |
| | | private Integer type ;//Number é¨é¨ç±»å 0: 常è§é¨ 2: ä¼ä¸äºèå¤é¨é¨é¨ |
| | | private Integer status;// Number é¨é¨ç¶æ 1: 使ç¨ä¸çé¨é¨ -1: éææ¨¡å¼ä¸åæ¥åå é¤çé¨é¨ |
| | | private String integrate_id;// String éææ¨¡å¼åæ¥é¨é¨å
³è ID ä»
å¨éææ¨¡å¼ä¸è¿åï¼ä¸å¨ä¼ä¸äºèæ¥å£(å¤é¨é¨é¨)ä¸è¿å |
| | | private Integer seq ;//number é¨é¨æåº é¨é¨å¨ç¶é¨é¨å
çåºå·ï¼ä»å°å°å¤§æå |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.file; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | public class UploadTokenParam { |
| | | private String appId; |
| | | private String entryId; |
| | | private String transactionId; |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getEntryId() { |
| | | return entryId; |
| | | } |
| | | |
| | | public void setEntryId(String entryId) { |
| | | this.entryId = entryId; |
| | | } |
| | | |
| | | public String getTransactionId() { |
| | | return transactionId; |
| | | } |
| | | |
| | | public void setTransactionId(String transactionId) { |
| | | this.transactionId = transactionId; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getAppId()) && StringUtils.isNotBlank(this.getEntryId()) |
| | | && StringUtils.isNotBlank(this.getTransactionId()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UploadTokenParam{" + |
| | | "appId='" + appId + '\'' + |
| | | ", entryId='" + entryId + '\'' + |
| | | ", transactionId='" + transactionId + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.form; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class FormDataBatchCreateParam { |
| | | /** |
| | | * åºç¨id |
| | | */ |
| | | private String app_id; |
| | | |
| | | /** |
| | | * 表åid |
| | | */ |
| | | private String entry_id; |
| | | |
| | | /** |
| | | * æ°æ® |
| | | */ |
| | | private List<Map<String, Object>> data_list; |
| | | |
| | | private Boolean is_start_workflow; |
| | | |
| | | |
| | | private String transaction_id; |
| | | |
| | | public FormDataBatchCreateParam() { |
| | | } |
| | | |
| | | public FormDataBatchCreateParam(String app_id, String entry_id, List<Map<String, Object>> data_list) { |
| | | this.app_id = app_id; |
| | | this.entry_id = entry_id; |
| | | this.data_list = data_list; |
| | | } |
| | | |
| | | public String getApp_id() { |
| | | return app_id; |
| | | } |
| | | |
| | | public void setApp_id(String app_id) { |
| | | this.app_id = app_id; |
| | | } |
| | | |
| | | public String getEntry_id() { |
| | | return entry_id; |
| | | } |
| | | |
| | | public void setEntry_id(String entry_id) { |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public List<Map<String, Object>> getData_list() { |
| | | return data_list; |
| | | } |
| | | |
| | | public void setData_list(List<Map<String, Object>> data_list) { |
| | | this.data_list = data_list; |
| | | } |
| | | |
| | | public Boolean getIs_start_workflow() { |
| | | return is_start_workflow; |
| | | } |
| | | |
| | | public void setIs_start_workflow(Boolean is_start_workflow) { |
| | | this.is_start_workflow = is_start_workflow; |
| | | } |
| | | |
| | | public String getTransaction_id() { |
| | | return transaction_id; |
| | | } |
| | | |
| | | public void setTransaction_id(String transaction_id) { |
| | | this.transaction_id = transaction_id; |
| | | } |
| | | |
| | | |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getApp_id()) && StringUtils.isNotBlank(this.getEntry_id()); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FormDataBatchCreateParam{" + |
| | | "app_id='" + app_id + '\'' + |
| | | ", entry_id='" + entry_id + '\'' + |
| | | ", data_list=" + data_list + |
| | | ", is_start_workflow=" + is_start_workflow + |
| | | ", transaction_id='" + transaction_id + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.form; |
| | | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class FormDataBatchRemoveParam { |
| | | |
| | | private List<String> data_ids; |
| | | |
| | | private String app_id; |
| | | |
| | | private String entry_id; |
| | | |
| | | public FormDataBatchRemoveParam(String app_id, String entry_id, List<String> data_ids) { |
| | | this.data_ids = data_ids; |
| | | this.app_id = app_id; |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public List<String> getData_ids() { |
| | | return data_ids; |
| | | } |
| | | |
| | | public void setData_ids(List<String> data_ids) { |
| | | this.data_ids = data_ids; |
| | | } |
| | | |
| | | public String getApp_id() { |
| | | return app_id; |
| | | } |
| | | |
| | | public void setApp_id(String app_id) { |
| | | this.app_id = app_id; |
| | | } |
| | | |
| | | public String getEntry_id() { |
| | | return entry_id; |
| | | } |
| | | |
| | | public void setEntry_id(String entry_id) { |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getApp_id()) && StringUtils.isNotBlank(this.getEntry_id()) && CollectionUtils.isNotEmpty(data_ids); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FormDataBatchRemoveParam{" + |
| | | "data_ids=" + data_ids + |
| | | ", app_id='" + app_id + '\'' + |
| | | ", entry_id='" + entry_id + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.form; |
| | | |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class FormDataBatchUpdateParam { |
| | | /** |
| | | * åºç¨id |
| | | */ |
| | | private String app_id; |
| | | |
| | | /** |
| | | * 表åid |
| | | */ |
| | | private String entry_id; |
| | | |
| | | private List<String> data_ids; |
| | | |
| | | /** |
| | | * æ°æ® |
| | | */ |
| | | private Map<String, Object> data; |
| | | |
| | | |
| | | private String transaction_id; |
| | | |
| | | public FormDataBatchUpdateParam() { |
| | | } |
| | | |
| | | public FormDataBatchUpdateParam(String app_id, String entry_id) { |
| | | this.app_id = app_id; |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | |
| | | public String getTransaction_id() { |
| | | return transaction_id; |
| | | } |
| | | |
| | | public void setTransaction_id(String transaction_id) { |
| | | this.transaction_id = transaction_id; |
| | | } |
| | | |
| | | public String getApp_id() { |
| | | return app_id; |
| | | } |
| | | |
| | | public void setApp_id(String app_id) { |
| | | this.app_id = app_id; |
| | | } |
| | | |
| | | public String getEntry_id() { |
| | | return entry_id; |
| | | } |
| | | |
| | | public void setEntry_id(String entry_id) { |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public List<String> getData_ids() { |
| | | return data_ids; |
| | | } |
| | | |
| | | public void setData_ids(List<String> data_ids) { |
| | | this.data_ids = data_ids; |
| | | } |
| | | |
| | | public Map<String, Object> getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(Map<String, Object> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getApp_id()) && StringUtils.isNotBlank(this.getEntry_id()) |
| | | && CollectionUtils.isNotEmpty(this.getData_ids()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FormDataBatchUpdateParam{" + |
| | | "app_id='" + app_id + '\'' + |
| | | ", entry_id='" + entry_id + '\'' + |
| | | ", data_ids=" + data_ids + |
| | | ", data=" + data + |
| | | ", transaction_id='" + transaction_id + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.form; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public class FormDataCreateParam { |
| | | /** |
| | | * åºç¨id |
| | | */ |
| | | private String app_id; |
| | | |
| | | /** |
| | | * 表åid |
| | | */ |
| | | private String entry_id; |
| | | |
| | | /** |
| | | * æ°æ® |
| | | */ |
| | | private Map<String, Object> data; |
| | | |
| | | private Boolean is_start_workflow; |
| | | |
| | | private Boolean is_start_trigger; |
| | | |
| | | private String transaction_id; |
| | | |
| | | public FormDataCreateParam() { |
| | | } |
| | | |
| | | public FormDataCreateParam(String app_id, String entry_id, Map<String, Object> data) { |
| | | this.app_id = app_id; |
| | | this.entry_id = entry_id; |
| | | this.data = data; |
| | | } |
| | | |
| | | public String getApp_id() { |
| | | return app_id; |
| | | } |
| | | |
| | | public void setApp_id(String app_id) { |
| | | this.app_id = app_id; |
| | | } |
| | | |
| | | public String getEntry_id() { |
| | | return entry_id; |
| | | } |
| | | |
| | | public void setEntry_id(String entry_id) { |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public Map<String, Object> getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(Map<String, Object> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public Boolean getIs_start_workflow() { |
| | | return is_start_workflow; |
| | | } |
| | | |
| | | public void setIs_start_workflow(Boolean is_start_workflow) { |
| | | this.is_start_workflow = is_start_workflow; |
| | | } |
| | | |
| | | public Boolean getIs_start_trigger() { |
| | | return is_start_trigger; |
| | | } |
| | | |
| | | public void setIs_start_trigger(Boolean is_start_trigger) { |
| | | this.is_start_trigger = is_start_trigger; |
| | | } |
| | | |
| | | public String getTransaction_id() { |
| | | return transaction_id; |
| | | } |
| | | |
| | | public void setTransaction_id(String transaction_id) { |
| | | this.transaction_id = transaction_id; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getApp_id()) && StringUtils.isNotBlank(this.getEntry_id()); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FormDataCreateParam{" + |
| | | "app_id='" + app_id + '\'' + |
| | | ", entry_id='" + entry_id + '\'' + |
| | | ", data=" + data + |
| | | ", is_start_workflow=" + is_start_workflow + |
| | | ", is_start_trigger=" + is_start_trigger + |
| | | ", transaction_id='" + transaction_id + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.form; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | public class FormDataDeleteParam { |
| | | /** |
| | | * åºç¨id |
| | | */ |
| | | private String app_id; |
| | | |
| | | /** |
| | | * 表åid |
| | | */ |
| | | private String entry_id; |
| | | |
| | | private String data_id; |
| | | |
| | | private Boolean is_start_trigger; |
| | | |
| | | |
| | | public FormDataDeleteParam() { |
| | | } |
| | | |
| | | public FormDataDeleteParam(String app_id, String entry_id, String data_id) { |
| | | this.app_id = app_id; |
| | | this.entry_id = entry_id; |
| | | this.data_id = data_id; |
| | | } |
| | | |
| | | public String getApp_id() { |
| | | return app_id; |
| | | } |
| | | |
| | | public void setApp_id(String app_id) { |
| | | this.app_id = app_id; |
| | | } |
| | | |
| | | public String getEntry_id() { |
| | | return entry_id; |
| | | } |
| | | |
| | | public void setEntry_id(String entry_id) { |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public String getData_id() { |
| | | return data_id; |
| | | } |
| | | |
| | | public void setData_id(String data_id) { |
| | | this.data_id = data_id; |
| | | } |
| | | |
| | | public Boolean getIs_start_trigger() { |
| | | return is_start_trigger; |
| | | } |
| | | |
| | | public void setIs_start_trigger(Boolean is_start_trigger) { |
| | | this.is_start_trigger = is_start_trigger; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getApp_id()) && StringUtils.isNotBlank(this.getEntry_id()) |
| | | && StringUtils.isNotBlank(this.getData_id()); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FormDataDeleteParam{" + |
| | | "app_id='" + app_id + '\'' + |
| | | ", entry_id='" + entry_id + '\'' + |
| | | ", data_id='" + data_id + '\'' + |
| | | ", is_start_trigger=" + is_start_trigger + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.form; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class FormDataQueryParam { |
| | | /** |
| | | * åºç¨id |
| | | */ |
| | | private String app_id; |
| | | |
| | | /** |
| | | * 表åid |
| | | */ |
| | | private String entry_id; |
| | | |
| | | /** |
| | | * æ°æ®ID |
| | | */ |
| | | private String data_id; |
| | | |
| | | /** |
| | | * ä» æ°æ®ID å¼å§è¿å limit æ¡æ°æ® |
| | | */ |
| | | private Integer limit; |
| | | |
| | | /** |
| | | * æ¥è¯¢çåæ®µ |
| | | */ |
| | | private List<String> fields; |
| | | |
| | | /** |
| | | * è¿æ»¤æ¡ä»¶ |
| | | */ |
| | | private Map<String, Object> filter; |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getApp_id()) && StringUtils.isNotBlank(this.getEntry_id()); |
| | | } |
| | | |
| | | public boolean isSingleQueryValid() { |
| | | return this.isValid() && StringUtils.isNotBlank(this.getData_id()); |
| | | } |
| | | |
| | | public FormDataQueryParam() { |
| | | } |
| | | |
| | | public FormDataQueryParam(String app_id, String entry_id) { |
| | | this.app_id = app_id; |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public String getApp_id() { |
| | | return app_id; |
| | | } |
| | | |
| | | public void setApp_id(String app_id) { |
| | | this.app_id = app_id; |
| | | } |
| | | |
| | | public String getEntry_id() { |
| | | return entry_id; |
| | | } |
| | | |
| | | public void setEntry_id(String entry_id) { |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public String getData_id() { |
| | | return data_id; |
| | | } |
| | | |
| | | public void setData_id(String data_id) { |
| | | this.data_id = data_id; |
| | | } |
| | | |
| | | public Integer getLimit() { |
| | | return limit; |
| | | } |
| | | |
| | | public void setLimit(Integer limit) { |
| | | this.limit = limit; |
| | | } |
| | | |
| | | public List<String> getFields() { |
| | | return fields; |
| | | } |
| | | |
| | | public void setFields(List<String> fields) { |
| | | this.fields = fields; |
| | | } |
| | | |
| | | public Map<String, Object> getFilter() { |
| | | return filter; |
| | | } |
| | | |
| | | public void setFilter(Map<String, Object> filter) { |
| | | this.filter = filter; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FormDataQueryParam{" + |
| | | "app_id='" + app_id + '\'' + |
| | | ", entry_id='" + entry_id + '\'' + |
| | | ", data_id='" + data_id + '\'' + |
| | | ", limit=" + limit + |
| | | ", fields=" + fields + |
| | | ", filter=" + filter + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.form; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public class FormDataUpdateParam { |
| | | /** |
| | | * åºç¨id |
| | | */ |
| | | private String app_id; |
| | | |
| | | /** |
| | | * 表åid |
| | | */ |
| | | private String entry_id; |
| | | |
| | | private String data_id; |
| | | |
| | | /** |
| | | * æ°æ® |
| | | */ |
| | | private Map<String, Object> data; |
| | | |
| | | |
| | | private Boolean is_start_trigger; |
| | | |
| | | private String transaction_id; |
| | | |
| | | public FormDataUpdateParam() { |
| | | } |
| | | |
| | | public FormDataUpdateParam(String app_id, String entry_id, Map<String, Object> data) { |
| | | this.app_id = app_id; |
| | | this.entry_id = entry_id; |
| | | this.data = data; |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(Map<String, Object> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | |
| | | public Boolean getIs_start_trigger() { |
| | | return is_start_trigger; |
| | | } |
| | | |
| | | public void setIs_start_trigger(Boolean is_start_trigger) { |
| | | this.is_start_trigger = is_start_trigger; |
| | | } |
| | | |
| | | public String getTransaction_id() { |
| | | return transaction_id; |
| | | } |
| | | |
| | | public void setTransaction_id(String transaction_id) { |
| | | this.transaction_id = transaction_id; |
| | | } |
| | | |
| | | public String getApp_id() { |
| | | return app_id; |
| | | } |
| | | |
| | | public void setApp_id(String app_id) { |
| | | this.app_id = app_id; |
| | | } |
| | | |
| | | public String getEntry_id() { |
| | | return entry_id; |
| | | } |
| | | |
| | | public void setEntry_id(String entry_id) { |
| | | this.entry_id = entry_id; |
| | | } |
| | | |
| | | public String getData_id() { |
| | | return data_id; |
| | | } |
| | | |
| | | public void setData_id(String data_id) { |
| | | this.data_id = data_id; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getApp_id()) && StringUtils.isNotBlank(this.getEntry_id()) |
| | | && StringUtils.isNotBlank(this.getData_id()); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FormDataUpdateParam{" + |
| | | "app_id='" + app_id + '\'' + |
| | | ", entry_id='" + entry_id + '\'' + |
| | | ", data_id='" + data_id + '\'' + |
| | | ", data=" + data + |
| | | ", is_start_trigger=" + is_start_trigger + |
| | | ", transaction_id='" + transaction_id + '\'' + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.form; |
| | | |
| | | import com.doumee.core.jiandaoyun.model.base.PageBaseParam; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | public class FormQueryParam extends PageBaseParam { |
| | | |
| | | private String app_id; |
| | | |
| | | public String getApp_id() { |
| | | return app_id; |
| | | } |
| | | |
| | | public void setApp_id(String app_id) { |
| | | this.app_id = app_id; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getApp_id()) && super.isValid(); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "FormQueryParam{" + |
| | | "skip=" + super.getSkip() + |
| | | ", limit=" + super.getLimit() + |
| | | ", app_id=" + app_id + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.http; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.Charsets; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.http.Header; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.client.HttpClient; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.client.methods.HttpRequestBase; |
| | | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.entity.mime.MultipartEntityBuilder; |
| | | import org.apache.http.entity.mime.content.StringBody; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.impl.io.EmptyInputStream; |
| | | import org.apache.http.message.BasicHeader; |
| | | import org.apache.http.ssl.SSLContextBuilder; |
| | | import com.doumee.core.jiandaoyun.util.LimitUtil; |
| | | |
| | | import javax.net.ssl.SSLContext; |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | public abstract class ApiClient { |
| | | |
| | | /** |
| | | * apiKey |
| | | */ |
| | | private String apiKey; |
| | | |
| | | /** |
| | | * å°å |
| | | */ |
| | | private String host; |
| | | |
| | | /** |
| | | * é»è®¤çæ¬ |
| | | */ |
| | | private String defaultVersion; |
| | | |
| | | /** |
| | | * åæ³çæ¬ |
| | | */ |
| | | private List<String> validVersionList; |
| | | |
| | | public ApiClient(String apiKey, String host) { |
| | | this.apiKey = apiKey; |
| | | this.host = host; |
| | | } |
| | | |
| | | public String getApiKey() { |
| | | return apiKey; |
| | | } |
| | | |
| | | public void setApiKey(String apiKey) { |
| | | this.apiKey = apiKey; |
| | | } |
| | | |
| | | public String getHost() { |
| | | return host; |
| | | } |
| | | |
| | | public void setHost(String host) { |
| | | this.host = host; |
| | | } |
| | | |
| | | public String getDefaultVersion() { |
| | | return defaultVersion; |
| | | } |
| | | |
| | | public void setDefaultVersion(String defaultVersion) { |
| | | this.defaultVersion = defaultVersion; |
| | | } |
| | | |
| | | public List<String> getValidVersionList() { |
| | | return validVersionList; |
| | | } |
| | | |
| | | public void setValidVersionList(List<String> validVersionList) { |
| | | this.validVersionList = validVersionList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * çæ path |
| | | * |
| | | * @param version - çæ¬å· |
| | | * @param path - è·¯å¾ |
| | | * @return æ¥å£çè·¯å¾ |
| | | */ |
| | | public abstract String generatePath(String version, String path); |
| | | |
| | | /** |
| | | * è·å¾åæ³ççæ¬å· |
| | | * |
| | | * @param version - çæ¬å· |
| | | * @return åæ³ççæ¬å· |
| | | */ |
| | | public String getValidVersion(String version) { |
| | | if (this.getValidVersionList() != null && this.getValidVersionList().contains(version)) { |
| | | return version; |
| | | } |
| | | return this.getDefaultVersion(); |
| | | } |
| | | |
| | | /** |
| | | * åéPOSTè¯·æ± |
| | | * |
| | | * @param param - 请æ±åæ° |
| | | * @return æ¥å£è¿ååæ° |
| | | */ |
| | | public Map<String, Object> sendPostRequest(HttpRequestParam param) throws Exception { |
| | | if (param == null || StringUtils.isBlank(param.getPath())) { |
| | | throw new RuntimeException("ç¼ºå¤±åæ°ï¼"); |
| | | } |
| | | HttpClient client = getSSLHttpClient(); |
| | | Header[] headers = getHttpHeaders(this.getApiKey()); |
| | | String url = this.host + param.getPath(); |
| | | HttpRequestBase request = new HttpPost(url); |
| | | |
| | | // 请æ±åæ° |
| | | if (param.getData() != null) { |
| | | ObjectMapper queryMap = new ObjectMapper(); |
| | | HttpEntity entity = new StringEntity(queryMap.writeValueAsString(param.getData()), Charsets.UTF_8); |
| | | ((HttpPost) request).setEntity(entity); |
| | | } |
| | | // 设置请æ±å¤´ |
| | | request.setHeaders(headers); |
| | | // éæµé»å¡ |
| | | LimitUtil.tryBeforeRun(); |
| | | // åé请æ±å¹¶è·åè¿åç»æ |
| | | HttpResponse response = client.execute(request); |
| | | // è¿åç¶æç |
| | | int statusCode = response.getStatusLine().getStatusCode(); |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | // æé¨åæ¥å£ç´æ¥è¿å æ²¡ææ°æ® |
| | | // fixï¼ä¸è½ç¨content-length大äº0夿ï¼response header为gzipç¼ç æ¹å¼çæ
åµä¸ä¸º-1 |
| | | if (!(response.getEntity().getContent() instanceof EmptyInputStream)) { |
| | | result = (Map<String, Object>) mapper.readValue(response.getEntity().getContent(), Object.class); |
| | | } |
| | | if (statusCode >= 400) { |
| | | throw new RuntimeException("请æ±é误ï¼statusCode:" + statusCode + ",Error Code: " + result.get("code") + ", Error Msg: " + result.get("msg")); |
| | | } else { |
| | | // å¤çè¿åç»æ |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | private static HttpClient getSSLHttpClient() throws Exception { |
| | | //ä¿¡ä»»ææ |
| | | SSLContext sslContext = |
| | | new SSLContextBuilder().loadTrustMaterial(null, (chain, authType) -> true).build(); |
| | | SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | /** |
| | | * è·å请æ±å¤´ä¿¡æ¯ |
| | | * |
| | | * @return 请æ±å¤´ä¿¡æ¯ |
| | | */ |
| | | private Header[] getHttpHeaders(String apiKey) { |
| | | List<Header> headerList = new ArrayList<>(); |
| | | headerList.add(new BasicHeader("Authorization", "Bearer " + apiKey)); |
| | | headerList.add(new BasicHeader("Content-Type", "application/json;charset=utf-8")); |
| | | return headerList.toArray(new Header[headerList.size()]); |
| | | } |
| | | |
| | | public Map<String, Object> httpPostFile(String url, String token, File file) throws Exception { |
| | | HttpClient client = getSSLHttpClient(); |
| | | HttpPost httpPost = new HttpPost(url); |
| | | MultipartEntityBuilder builder = MultipartEntityBuilder.create(); |
| | | httpPost.addHeader("token", token); |
| | | builder.addBinaryBody("file", file, ContentType.MULTIPART_FORM_DATA, file.getName()); |
| | | // ä¼ é token |
| | | builder.addTextBody("token", token); |
| | | StringBody tokenBody = new StringBody(token, ContentType.MULTIPART_FORM_DATA); |
| | | builder.addPart("token", tokenBody); |
| | | HttpEntity entity = builder.build(); |
| | | httpPost.setEntity(entity); |
| | | // éæµé»å¡ |
| | | LimitUtil.tryBeforeRun(); |
| | | // åé请æ±å¹¶è·åè¿åç»æ |
| | | HttpResponse response = client.execute(httpPost); |
| | | // è¿åç¶æç |
| | | int statusCode = response.getStatusLine().getStatusCode(); |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | // æé¨åæ¥å£ç´æ¥è¿å æ²¡ææ°æ® |
| | | // fixï¼ä¸è½ç¨content-length大äº0夿ï¼response header为gzipç¼ç æ¹å¼çæ
åµä¸ä¸º-1 |
| | | if (!(response.getEntity().getContent() instanceof EmptyInputStream)) { |
| | | result = (Map<String, Object>) mapper.readValue(response.getEntity().getContent(), Object.class); |
| | | } |
| | | if (statusCode >= 400) { |
| | | throw new RuntimeException("请æ±é误ï¼statusCode:" + statusCode + ",Error Code: " + result.get("code") + ", Error Msg: " + result.get("msg")); |
| | | } else { |
| | | // å¤çè¿åç»æ |
| | | return result; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.http; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public class HttpRequestParam { |
| | | |
| | | /** |
| | | * 请æ±è·¯å¾ |
| | | */ |
| | | private String path; |
| | | |
| | | /** |
| | | * 请æ±åæ° |
| | | */ |
| | | private Map<String, Object> data; |
| | | |
| | | public HttpRequestParam() { |
| | | } |
| | | |
| | | public HttpRequestParam(String path, Map<String, Object> data) { |
| | | this.path = path; |
| | | this.data = data; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public Map<String, Object> getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(Map<String, Object> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "HttpRequestParam{" + |
| | | "path='" + path + '\'' + |
| | | ", data=" + data + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.role; |
| | | |
| | | |
| | | import com.doumee.core.jiandaoyun.model.base.PageBaseParam; |
| | | |
| | | public class RoleGroupListQueryParam extends PageBaseParam { |
| | | private boolean has_internal; |
| | | private boolean has_sync; |
| | | |
| | | public boolean isHas_internal() { |
| | | return has_internal; |
| | | } |
| | | |
| | | public void setHas_internal(boolean has_internal) { |
| | | this.has_internal = has_internal; |
| | | } |
| | | |
| | | public boolean isHas_sync() { |
| | | return has_sync; |
| | | } |
| | | |
| | | public void setHas_sync(boolean has_sync) { |
| | | this.has_sync = has_sync; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "RoleGroupListQueryParam{" + |
| | | "skip=" + super.getSkip() + |
| | | ", limit=" + super.getLimit() + |
| | | ", has_internal=" + has_internal + |
| | | ", has_sync=" + has_sync + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.role; |
| | | |
| | | |
| | | import com.doumee.core.jiandaoyun.model.base.PageBaseParam; |
| | | |
| | | public class RoleListQueryParam extends PageBaseParam { |
| | | |
| | | private boolean has_internal; |
| | | private boolean has_sync; |
| | | |
| | | public boolean isHas_internal() { |
| | | return has_internal; |
| | | } |
| | | |
| | | public void setHas_internal(boolean has_internal) { |
| | | this.has_internal = has_internal; |
| | | } |
| | | |
| | | public boolean isHas_sync() { |
| | | return has_sync; |
| | | } |
| | | |
| | | public void setHas_sync(boolean has_sync) { |
| | | this.has_sync = has_sync; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return super.isValid(); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "RoleListQueryParam{" + |
| | | "skip=" + super.getSkip() + |
| | | ", limit=" + super.getLimit() + |
| | | ", has_internal=" + has_internal + |
| | | ", has_sync=" + has_sync + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.role; |
| | | |
| | | import com.doumee.core.jiandaoyun.model.base.PageBaseParam; |
| | | |
| | | public class RoleMemberQueryParam extends PageBaseParam { |
| | | private Integer role_no; |
| | | |
| | | public Integer getRole_no() { |
| | | return role_no; |
| | | } |
| | | |
| | | public void setRole_no(Integer role_no) { |
| | | this.role_no = role_no; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return this.getRole_no() != null && super.isValid(); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "RoleMemberQueryParam{" + |
| | | "skip=" + super.getSkip() + |
| | | ", limit=" + super.getLimit() + |
| | | ", role_no=" + role_no + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.role; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | public class RoleUpdateParam { |
| | | |
| | | private String name; |
| | | private Integer group_no; |
| | | private Integer role_no; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getGroup_no() { |
| | | return group_no; |
| | | } |
| | | |
| | | public void setGroup_no(Integer group_no) { |
| | | this.group_no = group_no; |
| | | } |
| | | |
| | | public Integer getRole_no() { |
| | | return role_no; |
| | | } |
| | | |
| | | public void setRole_no(Integer role_no) { |
| | | this.role_no = role_no; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getName()) && this.getRole_no() != null && this.getGroup_no() != null; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "RoleUpdateParam{" + |
| | | "name='" + name + '\'' + |
| | | ", group_no=" + group_no + |
| | | ", role_no=" + role_no + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.user; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class UserCreateParam { |
| | | |
| | | private String name; |
| | | |
| | | /** |
| | | * ç¨æ·å ç±æ°å忝åä¸åçº¿ç»æ |
| | | */ |
| | | private String username; |
| | | |
| | | /** |
| | | * éå¿
å¡« |
| | | */ |
| | | private List<Integer> departments; |
| | | |
| | | public UserCreateParam() { |
| | | } |
| | | |
| | | public UserCreateParam(String name, String userName) { |
| | | this.name = name; |
| | | this.username = userName; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getUsername() { |
| | | return username; |
| | | } |
| | | |
| | | public void setUsername(String username) { |
| | | this.username = username; |
| | | } |
| | | |
| | | public List<Integer> getDepartments() { |
| | | return departments; |
| | | } |
| | | |
| | | public void setDepartments(List<Integer> departments) { |
| | | this.departments = departments; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getName()) && StringUtils.isNotBlank(this.getUsername()); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UserCreateParam{" + |
| | | "name='" + name + '\'' + |
| | | ", username='" + username + '\'' + |
| | | ", departments=" + departments + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.user; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 人åå®ä½åæ° |
| | | */ |
| | | |
| | | @Data |
| | | public class UserEntityModel { |
| | | |
| | | private Integer dept_no;// Number é¨é¨ç¼å·ï¼ä¼ä¸å
å¯ä¸ ä¸åä¼ä¸ä¹é´å¯è½åå¨éå¤ |
| | | |
| | | private String username;// String æåçç¼å·ï¼ä¼ä¸å
å¯ä¸ ä¸åä¼ä¸ä¹é´å¯è½åå¨éå¤ |
| | | |
| | | private String name;// String æµç§° |
| | | |
| | | private List<Long> departments;//Number[] æåæå¨é¨é¨ç¼å·å表 |
| | | |
| | | private Integer type;//Numberæåç±» 0: å¸¸è§æå2: ä¼ä¸äºèå¤é¨å¯¹æ¥äºº |
| | | |
| | | private Integer status;// Number æåç¶æ 0: æªç¡®è®¤çæå 1: å·²å å
¥ |
| | | |
| | | private String integrate_id;// String éææ¨¡å¼åæ¥æåå
³è ID ä»
å¨éææ¨¡å¼ä¸è¿åï¼ä¸å¨ä¼ä¸äºèæ¥å£(å¤é¨å¯¹æ¥äºº)ä¸è¿å |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.model.user; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class UserUpdateParam { |
| | | |
| | | private String name; |
| | | |
| | | private String userName; |
| | | |
| | | /** |
| | | * éå¿
å¡« |
| | | */ |
| | | private List<Integer> departmentList; |
| | | |
| | | public UserUpdateParam() { |
| | | } |
| | | |
| | | public UserUpdateParam(String name, String userName) { |
| | | this.name = name; |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public List<Integer> getDepartmentList() { |
| | | return departmentList; |
| | | } |
| | | |
| | | public void setDepartmentList(List<Integer> departmentList) { |
| | | this.departmentList = departmentList; |
| | | } |
| | | |
| | | public boolean isValid() { |
| | | return StringUtils.isNotBlank(this.getName()) && StringUtils.isNotBlank(this.getUserName()); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UserCreateParam{" + |
| | | "name='" + name + '\'' + |
| | | ", userName='" + userName + '\'' + |
| | | ", departmentList=" + departmentList + |
| | | '}'; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.jiandaoyun.util; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | public class LimitUtil { |
| | | private static volatile int seq = 0; |
| | | |
| | | private static final int bucket = 1000; |
| | | |
| | | private static volatile List<Long> requestTimeList = Arrays.asList(0L, 0L, 0L, 0L, 0L); |
| | | |
| | | private LimitUtil() { |
| | | } |
| | | |
| | | /** |
| | | * éæµå®ç° ç¨ static synchronized 修饰 表示 对类ä¸é |
| | | * |
| | | * @throws InterruptedException |
| | | */ |
| | | public static synchronized void tryBeforeRun() throws InterruptedException { |
| | | long now = System.currentTimeMillis(); |
| | | // å½åæ¶é´ ä¸ ålimit个请æ±çæ¶é´ 使¯è¾ |
| | | long interval = now - requestTimeList.get(seq); |
| | | if (interval < 0) { |
| | | // æ§è¡æ¶é´: t[seq]+bucket=now-interval+bucket |
| | | // çå¾
æ¶é´: bucket-interval |
| | | Thread.sleep(bucket - interval); |
| | | // éæ°çå¾
|
| | | tryBeforeRun(); |
| | | } |
| | | if (interval < bucket) { |
| | | requestTimeList.set(seq, requestTimeList.get(seq) + bucket); |
| | | Thread.sleep(bucket - interval); |
| | | } else { |
| | | requestTimeList.set(seq, now); |
| | | } |
| | | seq = (seq + 1) % requestTimeList.size(); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "æ¯å¦æ¥è¯¢é¥åææ ¡éªäººåï¼0=å¦ï¼1=æ¯" ) |
| | | @TableField(exist = false) |
| | | private Integer queryAuth; |
| | | @ApiModelProperty(value = "é¨é¨ç¼ç éå" ) |
| | | @TableField(exist = false) |
| | | private List<Long> companyIdList; |
| | | |
| | | } |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://localhost:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://localhost:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Whyc@2025 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | # data-id: com.doumee.meeting.admin |
| | | discovery: |
| | | server-addr: http://localhost:8848 #é
ç½®Nacoså°å |
| | | namespace: wuhuyancao |
| | | namespace: maanshanyancao |
| | | username: nacos |
| | | password: nacos |
| | |
| | | # data-id: com.doumee.meeting.admin |
| | | discovery: |
| | | server-addr: http://localhost:8848 #é
ç½®Nacoså°å |
| | | namespace: wuhuyancao |
| | | namespace: maanshanyancao |
| | | username: nacos |
| | | password: nacos |
| | | |
| | |
| | | @ApiOperation("å
¨éé¨é¨ä¿¡æ¯åæ¥ - éé") |
| | | @PostMapping("/syncAllDingding") |
| | | // @CloudRequiredPermission("business:company:sync") |
| | | public ApiResponse syncAllDingding() throws ApiException { |
| | | public ApiResponse syncAllDingding() { |
| | | companyService.syncDDCompany(); |
| | | return ApiResponse.success("忥æå"); |
| | | } |
| | | @ApiOperation("å
¨éé¨é¨ä¿¡æ¯åæ¥ - éé") |
| | | @PostMapping("/syncAllJdy") |
| | | // @CloudRequiredPermission("business:company:sync") |
| | | public ApiResponse syncAllJyd() throws ApiException { |
| | | companyService.syncJdyCompany(); |
| | | return ApiResponse.success("忥æå"); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | }else if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.self){ |
| | | hkSyncOrgUserFromSelfService.syncUserData(this.getLoginUser(token)); |
| | | return ApiResponse.success("忥æå"); |
| | | }else if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.jdy){ |
| | | memberService.syncJdyUserInfo(); |
| | | return ApiResponse.success("忥æå"); |
| | | }else if(Constants.formatIntegerNum(dataSyncConfig.getOrgUserDataOrigin()) == DataSyncConfig.origin.dingding){ |
| | | memberService.syncDDUserInfo(); |
| | | return ApiResponse.success("忥æå"); |
| | | } |
| | | return ApiResponse.success("忥æå"); |
| | | } |
| | |
| | | return ApiResponse.success("忥æå"); |
| | | } |
| | | |
| | | @ApiOperation("å
¨é人åä¿¡æ¯åæ¥ - ç®éäº") |
| | | @PostMapping("/syncAllJdy") |
| | | // @CloudRequiredPermission("business:company:sync") |
| | | public ApiResponse syncAllJdy() throws ApiException { |
| | | memberService.syncJdyUserInfo(); |
| | | return ApiResponse.success("忥æå"); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.cloud.web; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.FacePictureCheckRequest; |
| | | import com.doumee.core.haikang.model.param.respose.FacePictureCheckResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.FtpUtil; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.core.utils.aliyun.ALiYunUtil; |
| | | import com.doumee.dao.business.model.Cars; |
| | | import com.doumee.dao.business.model.JkCabinetLog; |
| | | import com.doumee.dao.web.reqeust.VisitRecordDTO; |
| | | import com.doumee.dao.web.response.VisitRecordVO; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.sun.net.httpserver.HttpExchange; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartResolver; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.imageio.stream.ImageOutputStream; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.*; |
| | | import java.net.URI; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author Eva.Caesar Liu |
| | | * @date 2023/02/14 11:14 |
| | | */ |
| | | @Api(tags = "ãç®éäºãä¸å¡æ¥å£") |
| | | @Trace(exclude = true) |
| | | @RestController |
| | | @LoginNoRequired |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/jiandaoyun") |
| | | @Slf4j |
| | | public class JiandaoyunCloudController extends BaseController { |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @ApiOperation("ç®éäºæ¨éç¨è½¦ç³è¯·") |
| | | @PostMapping("/pushCarApply") |
| | | public void pushCarApply (HttpServletRequest request, HttpServletResponse response) { |
| | | log.error("ç®éäº=========getRequestURIï¼"+request.getRequestURI()); |
| | | log.error("ç®éäº=========getRequestURLï¼"+request.getRequestURL()); |
| | | try { |
| | | String jdy = request.getHeader("x-jdy-signature"); |
| | | StringBuilder json = new StringBuilder(); |
| | | String line; |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream())); |
| | | while ((line = reader.readLine()) != null) { |
| | | json.append(line); |
| | | } |
| | | // String payload = IOUtils.toString(request.getInputStream(), "utf-8"); |
| | | String payload = json.toString(); |
| | | String uri = request.getRequestURI(); |
| | | Map<String, String> parameterMap = parseParameter(request.getQueryString()); |
| | | String nonce = parameterMap.get("nonce"); |
| | | String timestamp = parameterMap.get("timestamp"); |
| | | String signature = getSignature(nonce, payload, SECRET, timestamp); |
| | | log.error("ç®éäº=========nonceï¼"+nonce); |
| | | log.error("ç®éäº=========timestampï¼"+timestamp); |
| | | log.error("ç®éäº=========payloadï¼"+payload); |
| | | log.error("ç®éäº=========ç¾åï¼"+jdy); |
| | | log.error("ç®éäº=========ç¾å(æ£ç¡®ï¼ï¼"+signature); |
| | | if (!signature.equals(jdy)) { |
| | | response.setStatus(401); |
| | | response.getWriter().write("fail"); |
| | | response.getWriter().close();; |
| | | return ; |
| | | } |
| | | response.setStatus(200); |
| | | response.getWriter().write("success"); |
| | | response.getWriter().close(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.error("ç®éäº=========å¼å¸¸ï¼"+e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | @ApiOperation("ç®éäºæäº¤é¥ååè¿ä¿¡æ¯") |
| | | @PostMapping("/submitKeyRecord") |
| | | public ApiResponse<JkCabinetLog> submitKeyRecord (HttpServletRequest request, HttpServletResponse response) { |
| | | JkCabinetLog log = new JkCabinetLog(); |
| | | log.setKeyId(1); |
| | | log.setCreateDate(new Date()); |
| | | log.setMemberName("å¼ ä¸"); |
| | | return ApiResponse.success(log); |
| | | } |
| | | |
| | | public static final String SECRET ="yKSKuO0LoFf06jWGrwwuGudK"; |
| | | private static String getSignature(String nonce, String payload, String secret, String timestamp) { |
| | | return DigestUtils.sha1Hex(nonce + ":" + payload + ":" + secret + ":" + timestamp); |
| | | } |
| | | |
| | | private static Map<String, String> parseParameter(String query) { |
| | | Map<String, String> paramMap = new HashMap<String, String>(); |
| | | String[] params = query.split("&"); |
| | | for (String param : params) { |
| | | String[] keyValue = param.split("="); |
| | | paramMap.put(keyValue[0], keyValue[1]); |
| | | } |
| | | return paramMap; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String url = "https://api.jiandaoyun.com/api/v1/automation/tenant/6909b792324dc197821895d1/hooks/6909d0fbdb93690b128a0d56b068192dc4a9c9722dbac428"; |
| | | // String url = "https://api.jiandaoyun.com/api/v1/automation/tenant/6909b792324dc197821895d1/hooks/6909d0fbdb93690af97e41d1b068192dc4a9705aca3321e2"; |
| | | JSONObject object = new JSONObject(); |
| | | object.put("create_date","20251104160000"); |
| | | object.put("start_date",System.currentTimeMillis() ); |
| | | object.put("end_date", System.currentTimeMillis() + 24*3600*1000); |
| | | object.put("id","10000020251105"); |
| | | object.put("type",1); |
| | | String result = HttpsUtil.postJson(url,JSONObject.toJSONString(object)); |
| | | System.out.println(result); |
| | | } |
| | | } |
| | |
| | | discovery: |
| | | server-addr: http://192.168.0.7:8848 #é
ç½®Nacoså°å |
| | | # namespace: dmvisit |
| | | namespace: wuhu_visit_dev1 |
| | | namespace: wuhu_visit_dev |
| | | username: nacos |
| | | password: nacos |
| | | knife4j: |
| | |
| | | # data-id: com.doumee.meeting.admin |
| | | discovery: |
| | | server-addr: http://localhost:8848 #é
ç½®Nacoså°å |
| | | namespace: wuhuyancao |
| | | namespace: maanshanyancao |
| | | username: nacos |
| | | password: nacos |
| | | |
| | |
| | | spring: |
| | | profiles: |
| | | active: test |
| | | active: dev |
| | | application: |
| | | name: visitsAdmin |
| | | # å®å
¨é
ç½® |
| | |
| | | |
| | | void ddPushCompanyInfo(String eventType, JSONObject eventData) throws ApiException; |
| | | |
| | | String syncDDCompany()throws ApiException; |
| | | String syncDDCompany() ; |
| | | |
| | | String syncJdyCompany(); |
| | | } |
| | |
| | | |
| | | void initPinyinTool(); |
| | | |
| | | void syncDDUserInfo() throws ApiException; |
| | | String syncJdyUserInfo(); |
| | | void syncDDUserInfo() ; |
| | | |
| | | void ddPushMemberInfo(String eventType, shade.com.alibaba.fastjson2.JSONObject eventData) throws ApiException; |
| | | } |
| | |
| | | if(Objects.isNull(approveParam) |
| | | ||Objects.isNull(approveParam.getType()) |
| | | ||Objects.isNull(approveParam.getMemberType()) |
| | | ||Objects.isNull(approveParam.getLevel()) |
| | | ){ |
| | | ||Objects.isNull(approveParam.getLevel())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(approveParam.getType().equals(Constants.ZERO)){ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import com.doumee.core.haikang.model.param.respose.OrgOrUserAddResponse; |
| | | import com.doumee.core.haikang.model.param.respose.OrgUpdateFailureResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.jiandaoyun.api.arch.DeptApiClient; |
| | | import com.doumee.core.jiandaoyun.constants.HttpConstant; |
| | | import com.doumee.core.jiandaoyun.model.dept.DeptEntityModel; |
| | | import com.doumee.core.wms.model.response.WmsBaseDataResponse; |
| | | import com.doumee.core.wms.model.response.WmsBaseResponse; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | |
| | | .eq(Company::getErpId,jsonArray.getLong(i)) |
| | | ); |
| | | OapiV2DepartmentGetResponse.DeptGetResponse deptGetResponse = dingTalk.syncDepartmentInfo(jsonArray.getLong(i)); |
| | | Company param = new Company(); |
| | | param.setName(deptGetResponse.getName()); |
| | | param.setErpId(deptGetResponse.getDeptId().toString()); |
| | | param.setErpParentId(deptGetResponse.getParentId().toString()); |
| | | if(Objects.isNull(company)){ |
| | | getAddCompanyModel(deptGetResponse,company); |
| | | param.setSortnum(deptGetResponse.getOrder().intValue());//é»è®¤æä¸é¢ |
| | | getAddCompanyModel(param); |
| | | }else{ |
| | | getUpdateCompanyModel(deptGetResponse,company); |
| | | getUpdateCompanyModel(param,company); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String syncDDCompany() throws ApiException { |
| | | public String syncDDCompany() { |
| | | try { |
| | | List<OapiV2DepartmentGetResponse.DeptGetResponse> list = dingTalk.syncAllDDDepartmentList(); |
| | | if(list !=null && list.size()>0){ |
| | | List<Company> addList = new ArrayList<>(); |
| | |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "忥ééæ°æ®ä¸ºç©ºï¼"); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "忥ééæ°æ®å¼å¸¸ï¼"); |
| | | } |
| | | } |
| | | @Override |
| | | public String syncJdyCompany() { |
| | | //{ |
| | | // "dept_no": 1,//æ°å 1 ä¸ºæ ¹é¨é¨ç¼å·ã |
| | | // "has_child": true |
| | | //} |
| | | DeptApiClient deptApiClient = new DeptApiClient(HttpConstant.API_KEY, HttpConstant.HOST); |
| | | try { |
| | | Map<String, Object> result = deptApiClient.deptList(1,true,deptApiClient.getDefaultVersion()); |
| | | if(result!=null && result.get("departments")!=null ){ |
| | | TypeReference<List<DeptEntityModel>> typeReference = new TypeReference<List<DeptEntityModel>>(){}; |
| | | Object obj = result.get("departments"); |
| | | List<DeptEntityModel> list = com.alibaba.fastjson.JSONObject.parseObject(JSON.toJSONString(obj), typeReference.getType()); |
| | | if(list !=null && list.size()>0){ |
| | | List<Company> addList = new ArrayList<>(); |
| | | List<Company> updateList = new ArrayList<>(); |
| | | List<Long> delIds = new ArrayList<>();//ä¿®æ¹ä¸ºä½¿ç¨ééid erpId |
| | | List<Company> allList = companyMapper.selectList(new QueryWrapper<Company>().lambda() |
| | | .eq(Company::getIsdeleted,Constants.ZERO).eq(Company::getType,Constants.ONE)); |
| | | dealCompanyChangeListJdy(list,addList,updateList,delIds,allList); |
| | | if(delIds.size()>0){ |
| | | syncDelCompany(delIds); |
| | | } |
| | | return "åæ¥æ°æ®ï¼æ°å¢ã"+addList.size()+"ãæ¡ï¼æ´æ°ã"+updateList.size()+"ãæ¡ï¼å é¤ã"+delIds.size()+"ãæ¡"; |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "忥ééæ°æ®ä¸ºç©ºï¼"); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "åæ¥æ°æ®å¼å¸¸ï¼"); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private void dealCompanyChangeListJdy(List<DeptEntityModel> list, List<Company> addList, List<Company> updateList, List<Long> delIds, List<Company> allList) { |
| | | Date date = new Date(); |
| | | for(DeptEntityModel respone : list){ |
| | | Company param = new Company(); |
| | | param.setName(respone.getName()); |
| | | param.setErpId(respone.getDept_no().toString()); |
| | | param.setErpParentId(respone.getParent_no() !=null?respone.getParent_no() .toString():null); |
| | | param.setSortnum(respone.getSeq()!=null?respone.getSeq().intValue():null);//é»è®¤æä¸é¢ |
| | | //æ ¹æ®erpidæ¥è¯¢ä¼ä¸ä¿¡æ¯ï¼å¤ææ¯æ°å¢è¿æ¯æ´æ° |
| | | Company company = findCompanyByERPId(allList,respone.getDept_no().toString()); |
| | | if(company == null){ |
| | | //å¦ææ¯æ°å¢ |
| | | //å°è£
æ°å¢ç»ç»å¯¹è±¡æ°æ® |
| | | addList.add(getAddCompanyModel(param)); |
| | | }else{ |
| | | updateList.add(getUpdateCompanyModel(param,company)); |
| | | } |
| | | } |
| | | if(allList!=null && allList.size()>0){ |
| | | for(Company c : allList){ |
| | | if(!isCompanyDeletedJdy(c,list)){ |
| | | delIds.add(Long.valueOf(c.getErpId())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | private void dealCompanyChangeList(List<OapiV2DepartmentGetResponse.DeptGetResponse> list, List<Company> addList, List<Company> updateList, List<Long> delIds, List<Company> allList) { |
| | | Date date = new Date(); |
| | | for(OapiV2DepartmentGetResponse.DeptGetResponse respone : list){ |
| | | Company param = new Company(); |
| | | param.setName(respone.getName()); |
| | | param.setErpId(respone.getDeptId().toString()); |
| | | param.setErpParentId(respone.getParentId().toString()); |
| | | param.setSortnum(respone.getOrder().intValue());//é»è®¤æä¸é¢ |
| | | //æ ¹æ®erpidæ¥è¯¢ä¼ä¸ä¿¡æ¯ï¼å¤ææ¯æ°å¢è¿æ¯æ´æ° |
| | | Company company = findCompanyByERPId(allList,respone.getDeptId().toString()); |
| | | if(company == null){ |
| | | //å¦ææ¯æ°å¢ |
| | | //å°è£
æ°å¢ç»ç»å¯¹è±¡æ°æ® |
| | | addList.add(getAddCompanyModel(respone,new Company())); |
| | | addList.add(getAddCompanyModel(param)); |
| | | }else{ |
| | | updateList.add(getUpdateCompanyModel(respone,company)); |
| | | updateList.add(getUpdateCompanyModel(param,company)); |
| | | } |
| | | } |
| | | if(allList!=null && allList.size()>0){ |
| | |
| | | |
| | | /** |
| | | * æ´çéé忥 æ°å¢ç»ç»å¯¹è±¡ |
| | | * @param deptGetResponse |
| | | * @return |
| | | */ |
| | | private Company getAddCompanyModel(OapiV2DepartmentGetResponse.DeptGetResponse deptGetResponse,Company company) { |
| | | return syncDDAddCompanyModel(deptGetResponse,company); |
| | | private Company getAddCompanyModel(Company param ) { |
| | | return syncDDAddCompanyModel(param); |
| | | } |
| | | |
| | | /** |
| | | * æ´çéé忥 æ°å¢ éè¦ä¿®æ¹çç»ç»å¯¹è±¡ |
| | | * @param deptGetResponse |
| | | * @param param |
| | | * @param company |
| | | * @return |
| | | */ |
| | | private Company getUpdateCompanyModel(OapiV2DepartmentGetResponse.DeptGetResponse deptGetResponse, Company company) { |
| | | return syncDDEditCompanyModel(deptGetResponse,company); |
| | | private Company getUpdateCompanyModel(Company param, Company company) { |
| | | return syncDDEditCompanyModel(param,company); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | return false; |
| | | } |
| | | private boolean isCompanyDeletedJdy(Company c, List<DeptEntityModel> list) { |
| | | for(DeptEntityModel m : list){ |
| | | if(StringUtils.equals(c.getErpId(),m.getDept_no().toString())){ |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ´ç éé忥ç ç»ç»ä¿¡æ¯ |
| | | * @param deptGetResponse |
| | | * @param company |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public Company syncDDAddCompanyModel(OapiV2DepartmentGetResponse.DeptGetResponse deptGetResponse,Company company){ |
| | | company = new Company(); |
| | | public Company syncDDAddCompanyModel(Company param ){ |
| | | Company company = new Company(); |
| | | company.setCreateDate(new Date()); |
| | | company.setIsdeleted(Constants.ZERO); |
| | | company.setStatus(Constants.ZERO); |
| | | |
| | | company.setName(deptGetResponse.getName()); |
| | | company.setErpId(deptGetResponse.getDeptId().toString()); |
| | | company.setErpParentId(deptGetResponse.getParentId().toString()); |
| | | company.setSortnum(deptGetResponse.getOrder().intValue());//é»è®¤æä¸é¢ |
| | | // company.setName(deptGetResponse.getName()); |
| | | // company.setErpId(deptGetResponse.getDeptId().toString()); |
| | | // company.setErpParentId(deptGetResponse.getParentId().toString()); |
| | | // company.setSortnum(deptGetResponse.getOrder().intValue());//é»è®¤æä¸é¢ |
| | | company.setName(param.getName()); |
| | | company.setErpId(param.getErpId() ); |
| | | company.setErpParentId(param.getErpParentId()); |
| | | company.setSortnum(param.getSortnum());//é»è®¤æä¸é¢ |
| | | |
| | | company.setType(Constants.ONE); |
| | | String rootOrgId = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_ROOTORG_CODE).getCode(); |
| | |
| | | } |
| | | |
| | | |
| | | public Company syncDDEditCompanyModel(OapiV2DepartmentGetResponse.DeptGetResponse deptGetResponse,Company company){ |
| | | company.setErpParentId(deptGetResponse.getParentId().toString()); |
| | | public Company syncDDEditCompanyModel(Company param,Company company){ |
| | | company.setErpParentId(param.getErpParentId().toString()); |
| | | String idPath = ""; |
| | | if(StringUtils.isNotBlank(company.getErpParentId())){ |
| | | Company parent = companyMapper.selectOne(new QueryWrapper<Company>().lambda().eq(Company::getErpId,company.getErpParentId()) |
| | |
| | | company.setParentId(parent.getId()); |
| | | } |
| | | |
| | | company.setName(deptGetResponse.getName()); |
| | | company.setErpId(deptGetResponse.getDeptId().toString()); |
| | | company.setErpParentId(deptGetResponse.getParentId().toString()); |
| | | company.setSortnum(deptGetResponse.getOrder().intValue());//é»è®¤æä¸é¢ |
| | | company.setName(param.getName()); |
| | | company.setErpId(param.getErpId()); |
| | | company.setSortnum(param.getSortnum());//é»è®¤æä¸é¢ |
| | | company.setEditDate(new Date()); |
| | | company.setHkCompanyPath(company.getCompanyNamePath()); |
| | | company.setHkStatus(Constants.ZERO); |
| | | company.setStatus(Constants.ZERO); |
| | | company.setSortnum(deptGetResponse.getOrder().intValue()); |
| | | company.setHkDate(company.getCreateDate()); |
| | | company.setEditDate(company.getCreateDate()); |
| | | company.setEditor(company.getCreator()); |
| | |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import cn.hutool.core.util.PhoneUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.doumee.core.haikang.model.param.respose.UserAddResponse; |
| | | import com.doumee.core.haikang.model.param.respose.UserDelResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.jiandaoyun.api.arch.DeptApiClient; |
| | | import com.doumee.core.jiandaoyun.constants.HttpConstant; |
| | | import com.doumee.core.jiandaoyun.model.dept.DeptEntityModel; |
| | | import com.doumee.core.jiandaoyun.model.user.UserEntityModel; |
| | | import com.doumee.dao.web.response.DDAuthorizeVO; |
| | | import com.doumee.service.business.third.TmsService; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | |
| | | Member member=new Member(); |
| | | member.setId(id); |
| | | member.setIsdeleted(Constants.ONE); |
| | | member.setEditor(loginUserInfo.getId()); |
| | | member.setEditor(loginUserInfo!=null?loginUserInfo.getId():null); |
| | | member.setEditDate(date); |
| | | member.setHkStatus(Constants.ZERO); |
| | | member.setRemark("人åå·²å é¤ï¼çå¾
å é¤é¨ç¦æé"); |
| | |
| | | * 忥ééå
é¨åå·¥ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public void syncDDUserInfo() throws ApiException { |
| | | public void syncDDUserInfo(){ |
| | | try { |
| | | List<OapiV2UserGetResponse.UserGetResponse> list = dingTalk.syncAllUserInfo(); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return; |
| | |
| | | if(delIds.size()>0){ |
| | | syncDelMember(delIds); |
| | | } |
| | | }catch (Exception e){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"忥éé人åä¿¡æ¯å¼å¸¸ï¼"); |
| | | } |
| | | |
| | | |
| | | } |
| | | @Override |
| | | public String syncJdyUserInfo() { |
| | | DeptApiClient deptApiClient = new DeptApiClient(HttpConstant.API_KEY, HttpConstant.HOST); |
| | | try { |
| | | Map<String, Object> result = deptApiClient.deptMemberList(1,true,deptApiClient.getDefaultVersion()); |
| | | if(result!=null && result.get("users")!=null ){ |
| | | TypeReference<List<UserEntityModel>> typeReference = new TypeReference<List<UserEntityModel>>(){}; |
| | | Object obj = result.get("users"); |
| | | List<UserEntityModel> list = com.alibaba.fastjson.JSONObject.parseObject(JSON.toJSONString(obj), typeReference.getType()); |
| | | if(list !=null && list.size()>0){ |
| | | List<Member> addList = new ArrayList<>(); |
| | | List<Member> updateList = new ArrayList<>(); |
| | | List<String> delIds = new ArrayList<>();//ä¿®æ¹ä¸ºä½¿ç¨ééid erpId |
| | | List<Member> allList = memberMapper.selectList(new QueryWrapper<Member>().lambda() |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .eq(Member::getType,Constants.TWO)); |
| | | dealMemberChangeListJdy(list,addList,updateList,delIds,allList); |
| | | if(delIds.size()>0){ |
| | | syncDelMember(delIds); |
| | | } |
| | | return "åæ¥æ°æ®ï¼æ°å¢ã"+addList.size()+"ãæ¡ï¼æ´æ°ã"+updateList.size()+"ãæ¡ï¼å é¤ã"+delIds.size()+"ãæ¡"; |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "忥ééæ°æ®ä¸ºç©ºï¼"); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "åæ¥æ°æ®å¼å¸¸ï¼"); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private void syncDelMember(List<String> delIds) { |
| | |
| | | } |
| | | } |
| | | } |
| | | private void dealMemberChangeListJdy(List<UserEntityModel> list, List<Member> addList, List<Member> updateList, List<String> delIds, List<Member> allList) { |
| | | Date date = new Date(); |
| | | for(UserEntityModel respone : list){ |
| | | //æ ¹æ®erpidæ¥è¯¢ä¼ä¸ä¿¡æ¯ï¼å¤ææ¯æ°å¢è¿æ¯æ´æ° |
| | | Member param = new Member(); |
| | | param.setErpId(respone.getUsername()); |
| | | param.setName(respone.getName()); |
| | | param.setDdId(respone.getIntegrate_id()); |
| | | param.setCompanyIdList(respone.getDepartments()); |
| | | Member member = findMemberByERPId(allList,respone.getUsername()); |
| | | if(member == null){ |
| | | //å¦ææ¯æ°å¢ |
| | | //å°è£
æ°å¢ç»ç»å¯¹è±¡æ°æ® |
| | | addList.add(syncDDAddMemberModel(param,new Member())); |
| | | }else{ |
| | | updateList.add(syncDDEditMemberModel(param,member)); |
| | | } |
| | | } |
| | | if(allList!=null && allList.size()>0){ |
| | | for(Member m : allList){ |
| | | if(!isMemberDeletedJdy(m,list)){ |
| | | delIds.add(m.getErpId()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private Member getAddMemberModel(OapiV2UserGetResponse.UserGetResponse deptGetResponse,Member member) { |
| | | return syncDDAddMemberModel(deptGetResponse,member); |
| | | Member param = new Member(); |
| | | param.setErpId(deptGetResponse.getUnionid()); |
| | | param.setPhone(deptGetResponse.getMobile()); |
| | | param.setName(deptGetResponse.getName()); |
| | | param.setCode(deptGetResponse.getJobNumber()); |
| | | param.setDdId(deptGetResponse.getUserid()); |
| | | param.setCompanyIdList(deptGetResponse.getDeptIdList()); |
| | | return syncDDAddMemberModel(param,member); |
| | | } |
| | | |
| | | |
| | | private Member getUpdateMemberModel(OapiV2UserGetResponse.UserGetResponse deptGetResponse,Member member) { |
| | | return syncDDEditMemberModel(deptGetResponse,member); |
| | | Member param = new Member(); |
| | | param.setErpId(deptGetResponse.getUnionid()); |
| | | param.setPhone(deptGetResponse.getMobile()); |
| | | param.setName(deptGetResponse.getName()); |
| | | param.setCode(deptGetResponse.getJobNumber()); |
| | | param.setDdId(deptGetResponse.getUserid()); |
| | | param.setCompanyIdList(deptGetResponse.getDeptIdList()); |
| | | return syncDDEditMemberModel(param,member); |
| | | } |
| | | |
| | | |
| | | private Member syncDDAddMemberModel(OapiV2UserGetResponse.UserGetResponse deptGetResponse,Member member) { |
| | | private Member syncDDAddMemberModel(Member deptGetResponse,Member member) { |
| | | member.setCreateDate(new Date()); |
| | | member.setErpId(deptGetResponse.getUnionid()); |
| | | member.setPhone(deptGetResponse.getMobile()); |
| | | member.setErpId(deptGetResponse.getErpId()); |
| | | member.setPhone(deptGetResponse.getPhone()); |
| | | member.setName(deptGetResponse.getName()); |
| | | member.setCode(deptGetResponse.getJobNumber()); |
| | | member.setDdId(deptGetResponse.getUserid()); |
| | | isMemberParamValidDetail(member,deptGetResponse.getDeptIdList()); |
| | | member.setCode(deptGetResponse.getCode()); |
| | | member.setDdId(deptGetResponse.getDdId()); |
| | | isMemberParamValidDetail(member,deptGetResponse.getCompanyIdList()); |
| | | //è·ååºçæ¥æ |
| | | //è±ææä½ |
| | | Member insert = initAddMemberModel(member,null); |
| | |
| | | } |
| | | member.setCompanyType(Constants.ONE); |
| | | SystemUser queryUserDto = new SystemUser(); |
| | | queryUserDto.setUsername(member.getPhone()); |
| | | queryUserDto.setUsername(StringUtils.defaultString(member.getPhone(),member.getErpId())); |
| | | queryUserDto.setDeleted(Boolean.FALSE); |
| | | SystemUser user = systemUserMapper.selectOne(new QueryWrapper<>(queryUserDto).last("limit 1")); |
| | | if (user != null) { |
| | |
| | | } |
| | | } |
| | | |
| | | public Member syncDDEditMemberModel(OapiV2UserGetResponse.UserGetResponse deptGetResponse,Member updateMember) { |
| | | public Member syncDDEditMemberModel(Member deptGetResponse1,Member updateMember) { |
| | | updateMember.setEditDate(new Date()); |
| | | updateMember.setErpId(deptGetResponse.getUnionid()); |
| | | updateMember.setPhone(deptGetResponse.getMobile()); |
| | | updateMember.setName(deptGetResponse.getName()); |
| | | updateMember.setCode(deptGetResponse.getJobNumber()); |
| | | updateMember.setDdId(deptGetResponse.getUserid()); |
| | | // updateMember.setErpId(deptGetResponse.getErpId()); |
| | | // updateMember.setPhone(deptGetResponse.getPhone()); |
| | | // updateMember.setName(deptGetResponse.getName()); |
| | | // updateMember.setCode(deptGetResponse.getCode()); |
| | | // updateMember.setDdId(deptGetResponse.getDdId()); |
| | | updateMember.setHkId(null); |
| | | updateMember.setAuthStatus(Constants.ZERO); |
| | | Boolean hkFlag = dealHkUserForUpdateBiz(updateMember); |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean isMemberDeletedJdy(Member member, List<UserEntityModel> list) { |
| | | for(UserEntityModel m : list){ |
| | | if(StringUtils.equals(m.getUsername(),member.getErpId())){ |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public void ddPushMemberInfo(String eventType, shade.com.alibaba.fastjson2.JSONObject eventData) throws ApiException { |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://localhost:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://localhost:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Whyc@2025 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | spring: |
| | | # æ°æ®æºé
ç½® |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/wuhuyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://192.168.0.211:3306/maanshanyancao?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | # application: |
| | | # name: doumeevisit |
| | | profiles: |
| | | active: proHS |
| | | active: test |
| | | |
| | | # JSONè¿åé
ç½® |
| | | jackson: |