| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | width="85%" |
| | | width="100%" |
| | | :visible.sync="visible" |
| | | > |
| | | <TableLayout > |
| | |
| | | <div style="display: flex;margin-top: 20px;"> |
| | | <div style="flex: 1"><span class="label">MQTT IP:</span>{{model.doorNameObj.mqttIp ||''}}</div> |
| | | <div style="flex: 1"><span class="label">MQTT端口:</span>{{model.doorNameObj.mqttPort||''}}</div> |
| | | <div style="flex: 3"> <span class="label">最近控制操作:</span>{{model.remark||''}}</div> |
| | | <div style="flex: 3"> |
| | | <span class="label">最近控制操作:</span> |
| | | <span class="orange" >{{model.remark||''}}</span> |
| | | </div> |
| | | </div> |
| | | <el-form-item label="开关序号" prop="val1"> |
| | | </div> |
| | | <div class="platgroup_tabs"> |
| | | <div class="tab" :class="{ active: activeGroup === item.id }" @click="groupClick(item)" |
| | | v-for="(item, i) in groupList" :key="i"> |
| | | {{ item.name }} |
| | | </div> |
| | | </div> |
| | | <el-form-item label="开关序号" v-if="activeGroup==0" prop="val1"> |
| | | <el-input v-model="searchForm.val1" placeholder="请输入开关序号" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <section> |
| | | <section v-if="activeGroup==0"> |
| | | <el-button type="primary" @click="search">搜索</el-button> |
| | | <el-button @click="reset">重置</el-button> |
| | | </section> |
| | |
| | | <!-- 表格和分页 --> |
| | | <template v-slot:table-wrap> |
| | | <el-table |
| | | v-if="activeGroup===0" |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | |
| | | <el-table-column prop="val3" label="电圧(V)" min-width="120px"></el-table-column> |
| | | <el-table-column prop="val4" label="温度(℃)" min-width="180px" ></el-table-column> |
| | | <el-table-column prop="val5" label="有功功率值(kW)" min-width="120px"></el-table-column> |
| | | </el-table> |
| | | <el-table |
| | | v-if="activeGroup===1" |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe> |
| | | <el-table-column prop="createDate" label="操作时间" min-width="150px"></el-table-column> |
| | | <el-table-column prop="val4" label="操作人" min-width="100px" ></el-table-column> |
| | | <el-table-column prop="val3" label="操作内容" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if=" row.val3 === '【合闸】'" class="green">{{row.val3||''}}</span> |
| | | <span v-else-if=" row.val3 === '【分闸】'" class="red">{{row.val3||''}}</span> |
| | | <span v-else>{{row.val3||''}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="val5" label="开关序号" min-width="120px"></el-table-column> |
| | | <el-table-column prop="val2" label="内容" min-width="300px" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | |
| | | // 表单数据 |
| | | visible: false, |
| | | title: '', |
| | | activeGroup:0, |
| | | model:{}, |
| | | groupList: [{ id: 0, name: '数据上报记录', type: 0 }, { id: 1, name: '远程控制记录', type: 1 }], |
| | | searchForm: { |
| | | deviceId: null, |
| | | val1:'' |
| | | val1: '', |
| | | dataType:0 |
| | | } |
| | | } |
| | | }, |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | groupClick (item) { |
| | | this.activeGroup = item.id |
| | | this.searchForm.val1 = '' |
| | | this.searchForm.dataType = item.type |
| | | this.search() |
| | | }, |
| | | open (title, row) { |
| | | this.title = title +' 【'+ (row.name)+'】' |
| | | this.searchForm.deviceId = row.id |
| | |
| | | total: 0 |
| | | } |
| | | } |
| | | this.search() |
| | | this.groupClick(this.groupList[0]) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | .platgroup_tabs { |
| | | flex: 1; |
| | | display: flex; |
| | | border-bottom: 1px solid #dfe2e8; |
| | | margin-bottom:30px; |
| | | |
| | | .tab { |
| | | color: #666666; |
| | | margin-right: 40px; |
| | | cursor: pointer; |
| | | padding-bottom: 18px; |
| | | border-bottom: 2px solid #fff; |
| | | } |
| | | |
| | | .active { |
| | | font-weight: 500; |
| | | font-size: 15px; |
| | | color: #2080f7; |
| | | border-bottom: 2px solid $primary-color; |
| | | } |
| | | } |
| | | .label{ |
| | | /* width: 80px; |
| | | text-align: right;*/ |
| | |
| | | 1.全部开关序号:参考设备实际配置,多个用英文逗号隔开,如 1,2,3;<br> |
| | | 2.控制开关序号:系统根据配置规则,判断开关当前空闲中进行【自动分闸】,多个用英文逗号隔开,如 1,2;<br> |
| | | 3.自动分闸规则:针对控制开关序号的配置,定时检测【空闲时长】内满足开关电流值都在【空闲电流阈值】范围内,则进行自动分闸控制;<br> |
| | | 4.空闲时长: 请设置至少空闲时长大于等于300秒(5分钟)。 |
| | | 4.空闲时长: 请设置至少空闲时长大于等于300秒(5分钟)。<br> |
| | | 5.如需远程控制开关,请正确填写下述全部参数信息。 |
| | | </p> |
| | | <div style="display: flex"> |
| | |
| | | return { |
| | | // 搜索 |
| | | searchForm: { |
| | | doorName: '', |
| | | doorNo: '', |
| | | no: '', |
| | | regionPathName: '', |
| | | name: '', |
| | | type: 5 |
| | | }, |
| | | isWorkSending: false, |
| | |
| | | :tree-props="{ children: 'childList', hasChildren: 'hasChildren' }" row-key="id" |
| | | @selection-change="handleSelectionChange" default-expand-all> |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="name" label="组织名称" min-width="200px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="name" label="组织名称" min-width="200px"></el-table-column> |
| | | <el-table-column prop="name" label="组织类型" min-width="80px"> |
| | | <template scope="{row}"> |
| | | <span v-if="row.type == 0">相关方组织</span> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="sortnum" align="center" label="排序码" min-width="80px"></el-table-column> |
| | | <el-table-column prop="companyNamePath" label="组织路径" min-width="200px" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="companyNamePath" label="组织路径" min-width="200px"></el-table-column> |
| | | <el-table-column prop="editorName" label="操作人" width="100px"></el-table-column> |
| | | <el-table-column prop="editDate" label="最后更新时间" min-width="150px"></el-table-column> |
| | | <el-table-column label="操作" width="230" fixed="right"> |
| | |
| | | }, |
| | | // 同步信息 |
| | | async synchronous () { |
| | | var msg = '该操作将系统清空已有组织信息' |
| | | this.sysConfig = this.sysConfig || {} |
| | | if (this.sysConfig.orgUserDataOrigin === 0) { |
| | | msg = '本系统当前组织由系统自建模式,该功能将初始化同步海康安防平台组织信息,该操作结果可能会清空或删除系统已有组织数据,' |
| | | }else if (this.sysConfig.orgUserDataOrigin === 1) { |
| | | msg = '本系统当前组织来源于三方ERP平台,该该操作结果可能会清空或删除系统已有组织数据,' |
| | | }else if (this.sysConfig.orgUserDataOrigin === 2) { |
| | | msg = '本系统当前组织来源于海康安防平台平台,该该操作结果可能会清空或删除系统已有组织数据,' |
| | | }else if (this.sysConfig.orgUserDataOrigin === 3) { |
| | | msg = '本系统当前组织来源于简道云平台,该该操作结果可能会清空或删除系统已有组织数据,' |
| | | }else if (this.sysConfig.orgUserDataOrigin === 4) { |
| | | msg = '本系统当前组织来源于钉钉平台,该该操作结果可能会清空或删除系统已有组织数据,' |
| | | } |
| | | this.$dialog.actionConfirm(msg + ',您确认同步全部信息吗?', '操作确认提醒') |
| | | this.$dialog.actionConfirm('该操作将系统清空已有组织信息,您确认同步全部信息吗?', '操作确认提醒') |
| | | .then(() => { |
| | | this.loading = true |
| | | companySync({}) |
| | |
| | | * http 相关的常量 |
| | | */ |
| | | public class HttpConstant { |
| | | // public static final String HOST = "https://api.jiandaoyun.com/api/"; |
| | | // public static final String HOST = "https://lcdp.ahyc.com.cn:30443/api/"; |
| | | public static final String HOST = "https://api.jiandaoyun.com/api/"; |
| | | |
| | | /** |
| | | * 部门相关的接口前缀 |
| | |
| | | /** |
| | | * API_KEY |
| | | */ |
| | | // public static final String API_KEY = "JsmYomhn3dissp9ZJ6QeTpnH2xKoKZgw"; |
| | | public static final String API_KEY = "JsmYomhn3dissp9ZJ6QeTpnH2xKoKZgw"; |
| | | |
| | | public static final String APP_ID = "APP_ID"; |
| | | |
| | |
| | | package com.doumee.core.jiandaoyun.model.http; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.jiandaoyun.util.LimitUtil; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | */ |
| | | public Map<String, Object> sendPostRequest(HttpRequestParam param) throws Exception { |
| | | if (param == null || StringUtils.isBlank(param.getPath())) { |
| | | throw new Exception("缺失参数!"); |
| | | throw new RuntimeException("缺失参数!"); |
| | | } |
| | | HttpClient client = getSSLHttpClient(); |
| | | Header[] headers = getHttpHeaders(this.getApiKey()); |
| | | String url = this.host + param.getPath(); |
| | | log.error("===简道云接口url:"+url); |
| | | HttpRequestBase request = new HttpPost(url); |
| | | |
| | | // 请求参数 |
| | |
| | | result = (Map<String, Object>) mapper.readValue(response.getEntity().getContent(), Object.class); |
| | | } |
| | | if (statusCode >= 400) { |
| | | log.error("===简道云接口:请求错误,statusCode:" + statusCode + ",Error Code: " + result.get("code") + ", Error Msg: " + result.get("msg")); |
| | | throw new Exception("请求错误,statusCode:" + statusCode + ",Error Code: " + result.get("code") + ", Error Msg: " + result.get("msg")); |
| | | throw new RuntimeException("请求错误,statusCode:" + statusCode + ",Error Code: " + result.get("code") + ", Error Msg: " + result.get("msg")); |
| | | } else { |
| | | // 处理返回结果 |
| | | log.error("===简道云接口:请求成功result:" + JSONObject.toJSONString(result)); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | private String sex; |
| | | private String job_date; |
| | | private String can_visit;//可拜访 不可拜访 |
| | | private String master;//是 否 |
| | | private String phone; |
| | | private String name; |
| | | private String idcardno; |
| | |
| | | <module>system_gateway</module> |
| | | <module>emaysms</module> |
| | | <module>visits/device_service</module> |
| | | <module>jiandaoyun_service</module> |
| | | <module>base_serivce</module> |
| | | </modules> |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | int jdy = 3; |
| | | int dingding = 4; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | 内部组织人员数据 0自建 2以海康安防平台为主 1华晟ERP系统 3简道云 4钉钉 |
| | | 内部组织人员数据 0自建 2以海康为主 1华晟ERP系统 3简道云 4钉钉 |
| | | */ |
| | | private Integer orgUserDataOrigin; |
| | | /** |
| | | * 访客来源:0自建 2以海康安防平台为主 1华晟ERP系统 3简道云 |
| | | * 访客来源:0自建 2以海康为主 1华晟ERP系统 2简道云 |
| | | */ |
| | | private Integer visitorDataOrigin; |
| | | |
| | |
| | | public static final String JK_PLAN_MAX_CLUSTER ="JK_PLAN_MAX_CLUSTER" ; |
| | | public static final String JK_PLAN_DISTANCE_CLUSTER ="JK_PLAN_DISTANCE_CLUSTER" ; |
| | | public static final String HK_PUSH_THIRD_URL ="HK_PUSH_THIRD_URL" ; |
| | | public static final String JDY_CAR_SECRET = " JDY_CAR_SECRET"; |
| | | public static final String JDY_SECRET ="JDY_SECRET"; |
| | | public static final String JDY_MEMBER_PUSH_STATUS_URL ="JDY_MEMBER_PUSH_STATUS_URL"; |
| | | |
| | | /** |
| | | * 操作类型,用于做接口验证分组 |
| | |
| | | Date nowAsISO = null; |
| | | try { |
| | | nowAsISO = df.parse(date); |
| | | } catch (ParseException e) { |
| | | } catch (Exception e) { |
| | | } |
| | | return nowAsISO; |
| | | } |
| | | |
| | | public static Date getISO8601DateByStr2(String date) { |
| | | TimeZone tz = TimeZone.getTimeZone("Asia/Shanghai"); |
| | | if(date!=null ){ |
| | |
| | | Date nowAsISO = null; |
| | | try { |
| | | nowAsISO = df.parse(date); |
| | | } catch (ParseException e) { |
| | | } catch (Exception e) { |
| | | } |
| | | return nowAsISO; |
| | | } |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | |
| | | LocalDate today = LocalDate.now(); |
| | | |
| | | // 获取当前日期是星期几 |
| | | DayOfWeek dayOfWeek = today.getDayOfWeek(); |
| | | |
| | | // 计算周一和周五的日期 |
| | | LocalDate monday = today.with(DayOfWeek.MONDAY); |
| | | LocalDate friday = today.with(DayOfWeek.FRIDAY); |
| | | |
| | | // 输出周一和周五的日期 |
| | | System.out.println("Monday: " + monday.toString()); |
| | | System.out.println("Friday: " + friday.toString()); |
| | | |
| | | // Date date = getISO8601DateByStr("2024-04-15T07:46:36.014+08:00"); |
| | | // Date date1 = getISO8601DateByStr("2024-06-14T08:46:36.014+08:00"); |
| | | // System.out.println(DateUtil.afterMinutesDate(-5)); |
| | | |
| | | // System.out.println(DateUtil.getWeekZhouOfDate(getDateFromString2("2025-11-06 00:00:00"))); |
| | | |
| | | // System.out.println(getPlusTime2(DateUtil.addMonthToDate(new Date(),-1))); |
| | | // System.out.println(DateUtil.getBeforMonthStr(new Date(),12)); |
| | | |
| | | // List<Date> list =getThisMonthDateList(); |
| | | // for(Date d :list){ |
| | | // System.out.println(getPlusTime2(d)); |
| | | // } |
| | | // List<Date> list1 =getThisYearMonthList(); |
| | | // for(Date d :list1){ |
| | | // System.out.println(getPlusTime2(d)); |
| | | // } |
| | | |
| | | // Date startTime = DateUtil.StringToDate("2024-05-01 08:00:00" ,"yyyy-MM-dd HH:mm:ss"); |
| | | // Date endTime = DateUtil.StringToDate("2024-05-01 17:00:00" ,"yyyy-MM-dd HH:mm:ss"); |
| | | // Long intervalTime = 35L; |
| | | // |
| | | // |
| | | // DateUtil.checkDateInterval( startTime.toInstant() |
| | | // .atZone(ZoneId.systemDefault()) |
| | | // .toLocalDateTime(), endTime.toInstant() |
| | | // .atZone(ZoneId.systemDefault()) |
| | | // .toLocalDateTime(),intervalTime); |
| | | |
| | | System.out.println(getISO8601DateByStr("2025-12-26T03:08:39.123Z")); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | |
| | | private String companyPath; |
| | | @ApiModelProperty(value = "组织信息") |
| | | @TableField(exist = false) |
| | | private Company companyModel; |
| | | private Company company; |
| | | @ApiModelProperty(value = "负责人编码(关联member)") |
| | | @TableField(exist = false) |
| | | private Integer headId; |
| | |
| | | Map<String, String> parameterMap = parseParameter(request.getQueryString()); |
| | | String nonce = parameterMap.get("nonce"); |
| | | String timestamp = parameterMap.get("timestamp"); |
| | | String signature = getSignature(nonce, payload, |
| | | systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.JDY_SECRET).getCode(), timestamp); |
| | | String signature = getSignature(nonce, payload, systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.JDY_SECRET).getCode(), timestamp); |
| | | log.error("【简道云】数据推送 =========getRequestURI:{}\n,queryParam:{}\n,payload:{}\n,签名:{}\n,正确签名:{}\n",request.getRequestURI(),request.getQueryString(),payload,jdy,signature); |
| | | if (!signature.equals(jdy)) { |
| | | return null; |
| | |
| | | public static void main(String[] args) { |
| | | /* |
| | | */ |
| | | String url = "https://lcdp.ahyc.com.cn:30443/api/v1/automation/tenant/61b6fb6080e9de2aa1df94d7/hooks/6954aca3cdf86954d2657433fb470ca1aabd108246925eca"; |
| | | String url = "https://api.jiandaoyun.com/api/v1/automation/tenant/6909b792324dc197821895d1/hooks/6909d0fbdb93695219faa27eb068192dc4a9532972993159"; |
| | | JSONObject object = new JSONObject(); |
| | | object.put("status",0); |
| | | object.put("username","15345690849" ); |
| | | object.put("info", "这是备注111"); |
| | | object.put("username","20251104160000" ); |
| | | object.put("info", "这是备注"); |
| | | String result = HttpsUtil.postJson(url,JSONObject.toJSONString(object)); |
| | | System.out.println(result); |
| | | } |
| | |
| | | enable: true |
| | | username: admin |
| | | password: 111111 |
| | | |
| | |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.doumee</groupId> |
| | | <artifactId>jiandaoyun_service</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.doumee</groupId> |
| | | <artifactId>device_service</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | </dependency> |
| | |
| | | import com.doumee.core.dingTalk.DingTalk; |
| | | import com.doumee.core.erp.ErpConstants; |
| | | import com.doumee.core.erp.model.openapi.request.erp.OrgListRequest; |
| | | import com.doumee.core.erp.model.openapi.response.erp.ERPApiResponse; |
| | | import com.doumee.core.erp.model.openapi.response.erp.ErpOrgListResponse; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | private OrgAddRequest getOrgAddModel(Company c ) { |
| | | OrgAddRequest model = new OrgAddRequest(); |
| | |
| | | deptIdList.add(deptId); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(deptIdList)){ |
| | | syncDelCompany( companyMapper.selectList(new QueryWrapper<Company>() |
| | | .lambda() |
| | | .eq(Company::getIsdeleted,Constants.ZERO) |
| | | .in(Company::getErpId,deptIdList) |
| | | )); |
| | | syncDelCompany(deptIdList); |
| | | } |
| | | }else if(eventType.equals("org_dept_create")||eventType.equals("org_dept_modify")){ |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | |
| | | .in(Company::getId, delIds) |
| | | .notIn(fIds.size()>0,Company::getHkId, fIds)); |
| | | companyMapper.update(null,new UpdateWrapper<Company>().lambda() |
| | | .set(Company::getHkStatus,Constants.ZERO) |
| | | .set(Company::getHkStatus,Constants.TWO) |
| | | .set(Company::getHkDate,date) |
| | | .in(Company::getId, delIds) |
| | | .in(fIds.size()>0,Company::getHkId, fIds)); |
| | |
| | | if(list !=null && list.size()>0){ |
| | | List<Company> addList = new ArrayList<>(); |
| | | List<Company> updateList = new ArrayList<>(); |
| | | List<Company> delIds = new ArrayList<>();//修改为使用钉钉id erpId |
| | | 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)); |
| | | dealCompanyChangeList(list,addList,updateList,delIds,allList); |
| | |
| | | @Override |
| | | public String syncJdyCompany() { |
| | | //{ |
| | | // "dept_no": 1,//数字 1 为根部门编号。483636217:芜湖市公司 |
| | | // "dept_no": 1,//数字 1 为根部门编号。 |
| | | // "has_child": true |
| | | //} |
| | | DeptApiClient deptApiClient = new DeptApiClient(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_API_KEY).getCode() |
| | | ,systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_API_HOST).getCode()); |
| | | DeptApiClient deptApiClient = new DeptApiClient(HttpConstant.API_KEY, HttpConstant.HOST); |
| | | try { |
| | | int root = 1; |
| | | try { |
| | | root = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_COMPANY_ROOT_NO).getCode()); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | Map<String, Object> result = deptApiClient.deptList(root,true,deptApiClient.getDefaultVersion()); |
| | | 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()); |
| | | list = sortJdyListBYParent(list,root); |
| | | if(list !=null && list.size()>0){ |
| | | List<Company> addList = new ArrayList<>(); |
| | | List<Company> updateList = new ArrayList<>(); |
| | | List<Company> delIds = new ArrayList<>();//修改为使用钉钉id erpId |
| | | 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); |
| | |
| | | } |
| | | return "同步数据:新增【"+addList.size()+"】条,更新【"+updateList.size()+"】条,删除【"+delIds.size()+"】条"; |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "同步简单云数据为空!"); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "同步钉钉数据为空!"); |
| | | } |
| | | } |
| | | }catch (BusinessException e){ |
| | | throw e; |
| | | }catch (Exception e){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "同步数据异常!"+e.getMessage()); |
| | | e.printStackTrace(); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "同步数据异常!"); |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private List<DeptEntityModel> sortJdyListBYParent(List<DeptEntityModel> list, int root) { |
| | | List<DeptEntityModel> all = new ArrayList<>(); |
| | | for(DeptEntityModel t : list){ |
| | | if(Constants.equalsInteger( t.getParent_no(),root)){ |
| | | all.add(t); |
| | | if(hasChildCompany(list,t.getDept_no())){ |
| | | all.addAll(sortJdyListBYParent(list,t.getDept_no())); |
| | | } |
| | | } |
| | | } |
| | | return all; |
| | | } |
| | | |
| | | |
| | | private boolean hasChildCompany(List<DeptEntityModel> list, Integer deptNo) { |
| | | for(DeptEntityModel t : list){ |
| | | if(Constants.equalsInteger( t.getParent_no(),deptNo)){ |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String temp = " [{" + |
| | | "\"dept_no\": 567064650," + |
| | | "\"name\": \"审计派驻办\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567064650\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567086523," + |
| | | "\"name\": \"江北分局\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567086523\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567354485," + |
| | | "\"name\": \"离岗退养人员\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567354485\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567303494," + |
| | | "\"name\": \"纪检监察室(巡察领导小组办公室)\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567303494\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566874731," + |
| | | "\"name\": \"无为市局离退休办\"," + |
| | | "\"parent_no\": 566426902," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566874731\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566426902," + |
| | | "\"name\": \"离退休人员室\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566426902\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566981590," + |
| | | "\"name\": \"物流中心\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566981590\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566499662," + |
| | | "\"name\": \"无为市局(营销部)\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566499662\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567258434," + |
| | | "\"name\": \"湾沚区局(营销部)\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567258434\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567458554," + |
| | | "\"name\": \"专卖监督管理科(内部专卖管理监督科、稽查支队)\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567458554\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567139640," + |
| | | "\"name\": \"湾沚区局离退休办\"," + |
| | | "\"parent_no\": 566426902," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567139640\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566379775," + |
| | | "\"name\": \"信息中心\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566379775\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567298538," + |
| | | "\"name\": \"企业管理科\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567298538\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567073617," + |
| | | "\"name\": \"办公室\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567073617\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566496812," + |
| | | "\"name\": \"繁昌区局离退休办\"," + |
| | | "\"parent_no\": 566426902," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566496812\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566643894," + |
| | | "\"name\": \"南陵县局离退休办\"," + |
| | | "\"parent_no\": 566426902," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566643894\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566699927," + |
| | | "\"name\": \"法规科(规范管理办公室)\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566699927\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567034633," + |
| | | "\"name\": \"党建群团科(工会办公室)\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567034633\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567095650," + |
| | | "\"name\": \"市局(公司)领导\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567095650\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566464722," + |
| | | "\"name\": \"财务管理科\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566464722\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567249497," + |
| | | "\"name\": \"芜湖市局直属分局\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567249497\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567266572," + |
| | | "\"name\": \"南陵县局(营销部)\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567266572\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567394584," + |
| | | "\"name\": \"离退休人员室\"," + |
| | | "\"parent_no\": 566426902," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567394584\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566952603," + |
| | | "\"name\": \"安全管理科\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566952603\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567418536," + |
| | | "\"name\": \"繁昌区局(营销部)\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567418536\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567080624," + |
| | | "\"name\": \"营销中心\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567080624\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567395495," + |
| | | "\"name\": \"人力资源科\"," + |
| | | "\"parent_no\": 483636217," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567395495\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566852695," + |
| | | "\"name\": \"无为市局(营销部)办公室\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566852695\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566597911," + |
| | | "\"name\": \"无为市局(营销部)襄安烟草专卖管理所(服务站、稽查中队)\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566597911\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567383562," + |
| | | "\"name\": \"无为市局(营销部)客户服务部\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567383562\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566596757," + |
| | | "\"name\": \"领导班子\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566596757\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567126588," + |
| | | "\"name\": \"无为市局(营销部)城区烟草专卖管理所(服务站、稽查中队)\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567126588\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567423457," + |
| | | "\"name\": \"无为市局(营销部)监察法规办\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567423457\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567444447," + |
| | | "\"name\": \"无为市局(营销部)高沟烟草专卖管理所(服务站、稽查中队)\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567444447\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566688696," + |
| | | "\"name\": \"无为市局(营销部)专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566688696\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567308492," + |
| | | "\"name\": \"南陵县局(营销部)专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)行动组\"," + |
| | | "\"parent_no\": 567266572," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567308492\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567311569," + |
| | | "\"name\": \"专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)行动组\"," + |
| | | "\"parent_no\": 566499662," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567311569\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566586834," + |
| | | "\"name\": \"物流中心储配部\"," + |
| | | "\"parent_no\": 566981590," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566586834\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567052635," + |
| | | "\"name\": \"稽查队\"," + |
| | | "\"parent_no\": 566930600," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567052635\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567250603," + |
| | | "\"name\": \"专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)行动组\"," + |
| | | "\"parent_no\": 567418536," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567250603\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566714645," + |
| | | "\"name\": \"物流中心送货部\"," + |
| | | "\"parent_no\": 566981590," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566714645\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567400554," + |
| | | "\"name\": \"物流中心综合部\"," + |
| | | "\"parent_no\": 566981590," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567400554\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 901575528," + |
| | | "\"name\": \"物流中心技术部\"," + |
| | | "\"parent_no\": 566981590," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"901575528\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567406402," + |
| | | "\"name\": \"物流中心安保部\"," + |
| | | "\"parent_no\": 566981590," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567406402\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 667523393," + |
| | | "\"name\": \"物流中心领导\"," + |
| | | "\"parent_no\": 566981590," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"667523393\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567052636," + |
| | | "\"name\": \"专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)行动组\"," + |
| | | "\"parent_no\": 567249497," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567052636\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567351557," + |
| | | "\"name\": \"物流中心中转站\"," + |
| | | "\"parent_no\": 566981590," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567351557\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567052634," + |
| | | "\"name\": \"江北分局办公室\"," + |
| | | "\"parent_no\": 567086523," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567052634\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567359469," + |
| | | "\"name\": \"品牌部\"," + |
| | | "\"parent_no\": 567080624," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567359469\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 821923828," + |
| | | "\"name\": \"综合部\"," + |
| | | "\"parent_no\": 567080624," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"821923828\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567151607," + |
| | | "\"name\": \"江北分局专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)\"," + |
| | | "\"parent_no\": 567086523," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567151607\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567297546," + |
| | | "\"name\": \"市场部\"," + |
| | | "\"parent_no\": 567080624," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567297546\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566867618," + |
| | | "\"name\": \"终端部\"," + |
| | | "\"parent_no\": 567080624," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566867618\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567314532," + |
| | | "\"name\": \"订单部\"," + |
| | | "\"parent_no\": 567080624," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567314532\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566848639," + |
| | | "\"name\": \"江北分局监察法规办\"," + |
| | | "\"parent_no\": 567086523," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566848639\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567272560," + |
| | | "\"name\": \"专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)寄递组\"," + |
| | | "\"parent_no\": 567258434," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567272560\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566564826," + |
| | | "\"name\": \"专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)行动组\"," + |
| | | "\"parent_no\": 567258434," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566564826\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567471441," + |
| | | "\"name\": \"江北分局客户服务部\"," + |
| | | "\"parent_no\": 567086523," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567471441\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 711701716," + |
| | | "\"name\": \"江北分局城北烟草专卖管理所(服务站)\"," + |
| | | "\"parent_no\": 567086523," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"711701716\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567103611," + |
| | | "\"name\": \"领导班子\"," + |
| | | "\"parent_no\": 567086523," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567103611\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 664801291," + |
| | | "\"name\": \"江北分局二坝烟草专卖管理所(服务站)\"," + |
| | | "\"parent_no\": 567086523," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"664801291\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566323801," + |
| | | "\"name\": \"湾沚区局(营销部)办公室\"," + |
| | | "\"parent_no\": 567258434," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566323801\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567343637," + |
| | | "\"name\": \"湾沚区局(营销部)城区烟草专卖管理所(服务站、稽查中队)\"," + |
| | | "\"parent_no\": 567258434," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567343637\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567087584," + |
| | | "\"name\": \"湾沚区局(营销部)监察法规办\"," + |
| | | "\"parent_no\": 567258434," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567087584\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567058556," + |
| | | "\"name\": \"客户服务部\"," + |
| | | "\"parent_no\": 567249497," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567058556\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566930600," + |
| | | "\"name\": \"专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)\"," + |
| | | "\"parent_no\": 567249497," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566930600\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566592977," + |
| | | "\"name\": \"专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)行动组\"," + |
| | | "\"parent_no\": 567086523," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566592977\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567283502," + |
| | | "\"name\": \"领导班子\"," + |
| | | "\"parent_no\": 567249497," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567283502\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567571030," + |
| | | "\"name\": \"监察法规办\"," + |
| | | "\"parent_no\": 567249497," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567571030\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566605742," + |
| | | "\"name\": \"湾沚区局(营销部)客户服务部\"," + |
| | | "\"parent_no\": 567258434," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566605742\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567044634," + |
| | | "\"name\": \"领导班子\"," + |
| | | "\"parent_no\": 567258434," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567044634\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566835635," + |
| | | "\"name\": \"办公室\"," + |
| | | "\"parent_no\": 567249497," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566835635\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566844724," + |
| | | "\"name\": \"城南烟草专卖管理所(服务站、稽查中队)\"," + |
| | | "\"parent_no\": 567249497," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566844724\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566633782," + |
| | | "\"name\": \"领导班子\"," + |
| | | "\"parent_no\": 567266572," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566633782\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566884644," + |
| | | "\"name\": \"南陵县局(营销部)客户服务部\"," + |
| | | "\"parent_no\": 567266572," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566884644\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566656760," + |
| | | "\"name\": \"南陵县局(营销部)专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)\"," + |
| | | "\"parent_no\": 567266572," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566656760\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567127606," + |
| | | "\"name\": \"湾沚区局(营销部)专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)\"," + |
| | | "\"parent_no\": 567258434," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567127606\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566965621," + |
| | | "\"name\": \"南陵县局(营销部)监察法规办\"," + |
| | | "\"parent_no\": 567266572," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566965621\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566889723," + |
| | | "\"name\": \"南陵县局(营销部)城区烟草专卖管理所(服务站、稽查中队)\"," + |
| | | "\"parent_no\": 567266572," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566889723\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 573565486," + |
| | | "\"name\": \"南陵县局(营销部)办公室\"," + |
| | | "\"parent_no\": 567266572," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"573565486\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566880674," + |
| | | "\"name\": \"南陵县局离岗退养人员\"," + |
| | | "\"parent_no\": 567354485," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566880674\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567176623," + |
| | | "\"name\": \"繁昌县局离岗退养人员\"," + |
| | | "\"parent_no\": 567354485," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567176623\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567314533," + |
| | | "\"name\": \"芜湖市局离岗退养人员\"," + |
| | | "\"parent_no\": 567354485," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567314533\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567340287," + |
| | | "\"name\": \"无为县局离岗退养人员\"," + |
| | | "\"parent_no\": 567354485," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567340287\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566636715," + |
| | | "\"name\": \"芜湖县局离岗退养人员\"," + |
| | | "\"parent_no\": 567354485," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566636715\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567368506," + |
| | | "\"name\": \"繁昌区局(营销部)监察法规办\"," + |
| | | "\"parent_no\": 567418536," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567368506\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567354486," + |
| | | "\"name\": \"繁昌区局(营销部)办公室\"," + |
| | | "\"parent_no\": 567418536," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567354486\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566960827," + |
| | | "\"name\": \"繁昌区局(营销部)专卖监督管理办公室(内部专卖管理监督办公室、稽查大队)\"," + |
| | | "\"parent_no\": 567418536," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566960827\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566649730," + |
| | | "\"name\": \"繁昌区局(营销部)城区烟草专卖管理所(服务站、稽查中队)\"," + |
| | | "\"parent_no\": 567418536," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566649730\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566455834," + |
| | | "\"name\": \"繁昌区局(营销部)客户服务部\"," + |
| | | "\"parent_no\": 567418536," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566455834\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 566975648," + |
| | | "\"name\": \"领导班子\"," + |
| | | "\"parent_no\": 567418536," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"566975648\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 822153494," + |
| | | "\"name\": \"区域分中心\"," + |
| | | "\"parent_no\": 567458554," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"822153494\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567328559," + |
| | | "\"name\": \"专卖监督管理科(内部专卖管理监督科、稽查支队)行动组\"," + |
| | | "\"parent_no\": 567458554," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567328559\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 567476616," + |
| | | "\"name\": \"专卖监督管理科(内部专卖管理监督科、稽查支队)数据分析组\"," + |
| | | "\"parent_no\": 567458554," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"567476616\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 821950791," + |
| | | "\"name\": \"现场检查组\"," + |
| | | "\"parent_no\": 822153494," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"821950791\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 922652428," + |
| | | "\"name\": \"综合管理组\"," + |
| | | "\"parent_no\": 822153494," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"922652428\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 822188538," + |
| | | "\"name\": \"数据分析组\"," + |
| | | "\"parent_no\": 822153494," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"822188538\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 981649568," + |
| | | "\"name\": \"部门领导\"," + |
| | | "\"parent_no\": 567080624," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"981649568\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 982346282," + |
| | | "\"name\": \"部门领导\"," + |
| | | "\"parent_no\": 567458554," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"982346282\"" + |
| | | "}, {" + |
| | | "\"dept_no\": 998004621," + |
| | | "\"name\": \"部门领导\"," + |
| | | "\"parent_no\": 822153494," + |
| | | "\"type\": 0," + |
| | | "\"status\": 1," + |
| | | "\"integrate_id\": \"998004621\"" + |
| | | "}]" ; |
| | | TypeReference typeReference = |
| | | new TypeReference< List<DeptEntityModel> >() { |
| | | }; |
| | | List<DeptEntityModel> list = com.alibaba.fastjson.JSONObject.parseObject(temp, typeReference.getType()); |
| | | CompanyServiceImpl obj = new CompanyServiceImpl(); |
| | | list = obj.sortJdyListBYParent(list,483636217); |
| | | list.size(); |
| | | |
| | | } |
| | | |
| | | private void dealCompanyChangeListJdy(List<DeptEntityModel> list, List<Company> addList, List<Company> updateList, |
| | | List<Company> delIds, List<Company> allList) { |
| | | 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(); |
| | |
| | | //根据erpid查询企业信息,判断是新增还是更新 |
| | | Company company = findCompanyByERPId(allList,respone.getDept_no().toString()); |
| | | if(company == null){ |
| | | //如果是新增 |
| | | //封装新增组织对象数据 |
| | | addList.add(getAddCompanyModel(param)); |
| | | }else{ |
| | |
| | | if(allList!=null && allList.size()>0){ |
| | | for(Company c : allList){ |
| | | if(!isCompanyDeletedJdy(c,list)){ |
| | | delIds.add(c); |
| | | delIds.add(Long.valueOf(c.getErpId())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | private void dealCompanyChangeList(List<OapiV2DepartmentGetResponse.DeptGetResponse> list, List<Company> addList, |
| | | List<Company> updateList, List<Company> delIds, List<Company> allList) { |
| | | 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(); |
| | |
| | | if(allList!=null && allList.size()>0){ |
| | | for(Company c : allList){ |
| | | if(!isCompanyDeleted(c,list)){ |
| | | delIds.add(c); |
| | | delIds.add(Long.valueOf(c.getErpId())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 整理钉钉同步 新增组织对象 |
| | |
| | | private Company getUpdateCompanyModel(Company param, Company company) { |
| | | return syncDDEditCompanyModel(param,company); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据ERPID 判断数据是否已在集合里存在 |
| | |
| | | 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(param.getName()); |
| | | company.setErpId(param.getErpId() ); |
| | | company.setErpParentId(param.getErpParentId()); |
| | |
| | | |
| | | company.setType(Constants.ONE); |
| | | String rootOrgId = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_ROOTORG_CODE).getCode(); |
| | | String jdyRootId = systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.JDY_COMPANY_ROOT_NO).getCode(); |
| | | Company root =getRootCompanyModel(rootOrgId,jdyRootId); |
| | | company.setHkParentId(rootOrgId); |
| | | Company root =getRootCompanyModel(rootOrgId); |
| | | company.setCompanyPath(company.getId()+"/");//名称路径 |
| | | company.setCompanyNamePath(company.getName());//名称路径 |
| | | company.setHkParentId(rootOrgId); |
| | | String idPath = ""; |
| | | if(StringUtils.isNotBlank(param.getErpParentId())){ |
| | | Company parent = companyMapper.selectOne(new QueryWrapper<Company>().lambda().eq(Company::getErpId,param.getErpParentId()) |
| | | if(StringUtils.isNotBlank(company.getErpParentId())){ |
| | | Company parent = companyMapper.selectOne(new QueryWrapper<Company>().lambda().eq(Company::getErpId,company.getErpParentId()) |
| | | .eq(Company::getIsdeleted,Constants.ZERO).last(" limit 1 ")); |
| | | if(parent == null || Constants.equalsInteger(parent.getIsdeleted(),Constants.ONE)){ |
| | | //父级不存在的,直接挂在根组织下 |
| | | parent = root; |
| | | // throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,父级组织信息不存在~"); |
| | | } |
| | | // if(StringUtils.isBlank(parent.getHkId())){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "对不起,父级组织信息尚未同步下发成功~"); |
| | | // } |
| | | if(Objects.nonNull(parent.getType())&&!Constants.equalsInteger(parent.getType(),-1)){ |
| | | if(!Constants.equalsInteger(company.getType(),parent.getType())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,组织信息错误"); |
| | |
| | | * @param rootOrgId |
| | | * @return |
| | | */ |
| | | private Company getRootCompanyModel(String rootOrgId,String erpId) { |
| | | private Company getRootCompanyModel(String rootOrgId) { |
| | | Company root = companyMapper.selectOne(new QueryWrapper<Company>().lambda() |
| | | .eq(Company::getIsdeleted,Constants.ZERO) |
| | | .isNull(Company::getParentId) |
| | |
| | | root.setHkStatus(Constants.ONE); |
| | | root.setIsdeleted(Constants.ZERO); |
| | | root.setStatus(Constants.ZERO); |
| | | root.setErpId(erpId); |
| | | root.setHkCompanyPath(rootOrgId+"/"); |
| | | root.setCompanyNamePath(root.getName()); |
| | | root.setHkDate(new Date()); |
| | |
| | | public Company syncDDEditCompanyModel(Company param,Company company){ |
| | | company.setErpParentId(param.getErpParentId().toString()); |
| | | String rootOrgId = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_ROOTORG_CODE).getCode(); |
| | | String jdyRootId = systemDictDataBiz.queryByCode(Constants.JDY_CONFIG,Constants.JDY_COMPANY_ROOT_NO).getCode(); |
| | | Company root =getRootCompanyModel(rootOrgId,jdyRootId); |
| | | Company root =getRootCompanyModel(rootOrgId); |
| | | String idPath = ""; |
| | | if(StringUtils.isNotBlank(company.getErpParentId())){ |
| | | Company parent = companyMapper.selectOne(new QueryWrapper<Company>().lambda() |
| | |
| | | |
| | | |
| | | |
| | | public void syncDelCompany(List<Company> companyList ){ |
| | | /* List<Company> companyList = companyMapper.selectList(new QueryWrapper<Company>() |
| | | public void syncDelCompany(List<Long> deptIdList){ |
| | | List<Company> companyList = companyMapper.selectList(new QueryWrapper<Company>() |
| | | .lambda() |
| | | .eq(Company::getIsdeleted,Constants.ZERO) |
| | | .in(Company::getId,deptIdList) |
| | | );*/ |
| | | .in(Company::getErpId,deptIdList) |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(companyList)){ |
| | | List<Integer> delIds = companyList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | List<String> delHKIds = companyList.stream().filter(i->StringUtils.isNotBlank(i.getHkId())).map(i->i.getHkId()).collect(Collectors.toList()); |
| | | |
| | | //标记业务删除 |
| | | companyMapper.update(new UpdateWrapper<Company>().lambda() |
| | | .set(Company::getIsdeleted,Constants.ONE) |
| | |
| | | if (pageWrap.getModel().getName() != null) { |
| | | queryWrapper.lambda().like(Device::getName, pageWrap.getModel().getName()); |
| | | } |
| | | if (pageWrap.getModel().getDoorNo() != null) { |
| | | queryWrapper.lambda().like(Device::getDoorNo, pageWrap.getModel().getDoorNo()); |
| | | } |
| | | if (pageWrap.getModel().getNo() != null) { |
| | | queryWrapper.lambda().like(Device::getNo, pageWrap.getModel().getNo()); |
| | | } |
| | | if (pageWrap.getModel().getDoorName() != null) { |
| | | queryWrapper.lambda().like(Device::getDoorName, pageWrap.getModel().getDoorName()); |
| | | } |
| | |
| | | } |
| | | MqttClientCache.clientMapCache.put("device"+param.getId(),mqttClient); |
| | | String curremak = "【"+param.getLoginUserInfo().getRealname() |
| | | +"】于"+ DateUtil.getPlusTime2(new Date()) +"进行了"+(Constants.equalsInteger(param.getStatus(),Constants.ONE)?"【开闸】":"【关闸】")+"操作,开关【"+param.getChannelNo()+"】;"; |
| | | +"】于"+ DateUtil.getPlusTime2(new Date()) +"进行了"+(Constants.equalsInteger(param.getStatus(),Constants.ONE)?"【合闸】":"【分闸】")+"操作,开关【"+param.getChannelNo()+"】;"; |
| | | deviceMapper.update(null,new UpdateWrapper<Device>().lambda() |
| | | // .setSql("remark = concat(ifnull(remark,''),'"+curremak+"','\n')") |
| | | .set(Device::getRemark,curremak) |
| | |
| | | data.setVal1("远程控制"); |
| | | data.setVal2(curremak); |
| | | data.setHappenTime(DateUtil.getPlusTime2(data.getCreateDate())); |
| | | data.setVal3((Constants.equalsInteger(param.getStatus(),Constants.ONE)?"【开闸】":"【关闸】")); |
| | | data.setVal3((Constants.equalsInteger(param.getStatus(),Constants.ONE)?"【合闸】":"【分闸】")); |
| | | data.setVal4(param.getLoginUserInfo().getRealname()); |
| | | data.setVal5(param.getChannelNo()); |
| | | deviceDataMapper.insert(data); |
| | |
| | | Member insert = initAddMemberModel(member,loginUserInfo); |
| | | //海康人员新增业务 |
| | | try { |
| | | if(dealHkUserBiz(insert)){ |
| | | insert.setHkStatus(Constants.ONE); |
| | | // if(dealHkUserBiz(insert)){ |
| | | memberMapper.insert(insert); |
| | | //创建系统登陆账号(默认无任何角色) |
| | | // if(Constants.equalsInteger(member.getCompanyType(),Constants.ONE)){ |
| | |
| | | //处理培训有效期业务 |
| | | dealTrainTIme(member,0,loginUserInfo); |
| | | // } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,员工信息同步安防平台失败,请稍后重试!"); |
| | | } |
| | | // }else{ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,员工信息同步安防平台失败,请稍后重试!"); |
| | | // } |
| | | }catch (BusinessException e){ |
| | | //如果发生异常,删除已经创建的人员信息 |
| | | deleteHkUserBiz(new String[]{insert.getHkId()}); |
| | |
| | | insert.setCanVisit(Constants.formatIntegerNum(member.getCanVisit()));//默认不可访问 |
| | | insert.setAuthStatus(Constants.ZERO); |
| | | insert.setName(member.getName()); |
| | | // insert.setHkId(UUID.randomUUID().toString().replace("-","")); |
| | | insert.setHkId(UUID.randomUUID().toString().replace("-","")); |
| | | insert.setHkStatus(Constants.ZERO); |
| | | insert.setSex(Constants.getSexByCardNo( member.getIdcardNo()));//根据身份证号获取性别 |
| | | insert.setJobDate(member.getJobDate()); |
| | |
| | | .eq(Member::getIsdeleted,Constants.ZERO) ) >0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EXISTS.getCode(), "手机号【"+member.getPhone()+"】已被使用,不能重复"); |
| | | } |
| | | Company company = member.getCompanyModel()!=null ?member.getCompanyModel(): companyMapper.selectById(member.getCompanyId()); |
| | | Company company = member.getCompany()!=null ?member.getCompany(): companyMapper.selectById(member.getCompanyId()); |
| | | if(company == null || Constants.equalsInteger(company.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该组织信息已被删除!"); |
| | | } |
| | |
| | | } |
| | | if(member.getCompanyId()!=null && !Constants.equalsInteger(member.getCompanyId(),model.getCompanyId())){ |
| | | //如果组织发生变化 |
| | | Company company = member.getCompanyModel()!=null ?member.getCompanyModel(): companyMapper.selectById(member.getCompanyId()); |
| | | Company company = member.getCompany()!=null ?member.getCompany(): companyMapper.selectById(member.getCompanyId()); |
| | | if(company == null || Constants.equalsInteger(company.getIsdeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该组织信息已被删除,请刷新页面重试!"); |
| | | } |
| | |
| | | updateMember.setEditor(loginUserInfo!=null?loginUserInfo.getId():null); |
| | | updateMember.setEditDate(new Date()); |
| | | //海康人员新增业务 |
| | | if(dealHkUserForUpdateBiz(updateMember)){ |
| | | updateMember.setHkStatus(Constants.ONE); |
| | | // if(dealHkUserForUpdateBiz(updateMember)){ |
| | | updateMember.setHkId(null); |
| | | updateMember.setAuthStatus(Constants.ZERO); |
| | | memberMapper.update(null,new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getStartTime,null) |
| | | .set(Member::getEndTime,null) |
| | | .set(Member::getRoleId,null) |
| | | .set(StringUtils.isNotBlank(updateMember.getErpId()),Member::getErpId,updateMember.getErpId()) |
| | | .set(StringUtils.isNotBlank(updateMember.getDdId()),Member::getDdId,updateMember.getDdId()) |
| | | .set(StringUtils.isNotBlank(updateMember.getPhone()),Member::getPhone,updateMember.getPhone()) |
| | | .set(StringUtils.isNotBlank(updateMember.getName()),Member::getName,updateMember.getName()) |
| | | .set(Member::getEditDate,updateMember.getEditDate()) |
| | | .set(Member::getEditor,updateMember.getEditor()) |
| | |
| | | .set(updateMember.getSex()!=null,Member::getSex,updateMember.getSex()) |
| | | .set(updateMember.getCanVisit()!=null,Member::getCanVisit,updateMember.getCanVisit()) |
| | | .set(updateMember.getFaceStatus()!=null,Member::getFaceStatus,updateMember.getFaceStatus()) |
| | | .set(updateMember.getHkDate()!=null,Member::getHkDate,updateMember.getHkDate()) |
| | | .set(updateMember.getHkDate()!=null,Member::getHkDate,updateMember.getHkDate()) |
| | | .set(StringUtils.isNotBlank(updateMember.getRemark()),Member::getRemark,updateMember.getRemark()) |
| | | .set(StringUtils.isNotBlank(updateMember.getFaceImg()),Member::getFaceImg,updateMember.getFaceImg()) |
| | |
| | | cancelAllMemberEmpower(updateMember,memberRoleMapper,empowerMapper); |
| | | //记录操作日志 |
| | | saveUserActionBiz(updateMember,loginUserInfo,Constants.UserActionType.EDIT,userActionJoinMapper,null); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,员工信息同步安防平台失败,请稍后重试!"); |
| | | } |
| | | // }else{ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,员工信息同步安防平台失败,请稍后重试!"); |
| | | // } |
| | | } |
| | | |
| | | private void dealTrainTIme(Member updateMember, int i,LoginUserInfo loginUserInfo) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public StagingDataVO stagingHead(StagingDataVO stagingHeadVO){ |
| | | //人员信息 |
| | |
| | | */ |
| | | @Override |
| | | public void dealJdyMemberInfo(MemberPushData data){ |
| | | if(data.getDeleter()!=null){ |
| | | //如果是已经删除人员,不处理 //内部人员信息 |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda() |
| | | .eq( Member::getErpId,data.get_id() ) |
| | | .eq( Member::getIsdeleted,Constants.ZERO ) |
| | | .eq( Member::getType,Constants.TWO ) |
| | | .last("limit 1")); |
| | | if(member == null){ |
| | | //如果是已经删除人员,不处理 |
| | | return; |
| | | } |
| | | //如果是已经删除人员,删除服务中心人员 |
| | | this.deleteById(member.getId(),null); |
| | | return; |
| | | } |
| | | |
| | | if(StringUtils.isBlank(data.get_id()) |
| | | ||StringUtils.isBlank(data.getUsername()) |
| | | if(StringUtils.isBlank(data.getUsername()) |
| | | ||StringUtils.isBlank(data.getPhone()) |
| | | ||StringUtils.isBlank(data.getName())){ |
| | | throw new BusinessException(ResponseStatus.JDY_BAD_REQUEST.getCode(),"人员信息不完整!"); |
| | | } |
| | | //内部人员信息 |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda() |
| | | .eq( Member::getErpId,data.get_id() ) |
| | | .eq( Member::getErpId,data.getUsername() ) |
| | | .eq( Member::getIsdeleted,Constants.ZERO ) |
| | | .eq( Member::getType,Constants.TWO ) |
| | | .last("limit 1")); |
| | | if(member ==null){ |
| | | //如果erpid未绑定,按手机号查询用户 |
| | | member = memberMapper.selectOne(new QueryWrapper<Member>().lambda() |
| | | .eq( Member::getPhone,data.getPhone() ) |
| | | .eq( Member::getIsdeleted,Constants.ZERO ) |
| | | .eq( Member::getType,Constants.TWO ) |
| | | .last("limit 1")); |
| | | //新增人员 |
| | | if(data.getDeleter()!=null){ |
| | | //如果是已经删除人员,不处理 |
| | | return; |
| | | } |
| | | boolean addOrEdit = false; |
| | | if(member == null){ |
| | | member = getAddOrUpdateModelFromJDY(data,true); |
| | | this.create(member); |
| | | addOrEdit=true; |
| | | }else{ |
| | | //更新人员 |
| | | if(data.getDeleter()!=null){ |
| | | //如果是已经删除人员,不处理 |
| | | this.deleteById(member.getId(),null); |
| | | }else{ |
| | | //更新人员信息 |
| | | Member updateMember =getAddOrUpdateModelFromJDY(data,false); |
| | | updateMember.setId(member.getId()); |
| | | addOrEdit=true; |
| | | this.updateById(updateMember); |
| | | } |
| | | if(addOrEdit && Constants.equalsInteger(member.getHeadStatus(),Constants.ONE) && member.getCompanyModel()!=null){ |
| | | //如果是部门主管 |
| | | Company updateCom = new Company(); |
| | | updateCom.setHeadId(member.getId()); |
| | | updateCom.setId(member.getCompanyModel().getId()); |
| | | companyMapper.updateById(updateCom);//更新部门主管人员 |
| | | } |
| | | |
| | | } |
| | | |
| | | private Member getAddOrUpdateModelFromJDY(MemberPushData data, boolean add) { |
| | |
| | | if(StringUtils.isNotBlank(data.getCan_visit())){ |
| | | member.setCanVisit(StringUtils.equals(data.getCan_visit(),"可拜访")?1:0); |
| | | } |
| | | if(StringUtils.isNotBlank(data.getMaster())){ |
| | | member.setHeadStatus(StringUtils.equals(data.getMaster(),"是")?1:0); |
| | | } |
| | | member.setErpId(data.get_id()); |
| | | member.setDdId(data.getUsername()); |
| | | member.setErpId(data.getUsername()); |
| | | if(data.getDepartment()!=null){ |
| | | member.setErpOrgId(data.getDepartment().getDept_no()); |
| | | } |
| | |
| | | if(depart!=null){ |
| | | member.setCompanyId(depart.getId()); |
| | | } |
| | | member.setCompanyModel(depart); |
| | | member.setCompany(depart); |
| | | return member; |
| | | } |
| | | |
| | |
| | | selectAll(SystemUser.class ) |
| | | .leftJoin(Member.class,Member::getId,SystemUser::getMemberId) |
| | | .eq(SystemUser::getDeleted,Boolean.FALSE) |
| | | .eq(Member::getDdId,user.getUsername()) |
| | | .eq(Member::getErpId,user.getUsername()) |
| | | .last("limit 1")); |
| | | } |
| | | return null; |
| | |
| | | |
| | | @Override |
| | | public String syncJdyUserInfo() { |
| | | DeptApiClient deptApiClient = new DeptApiClient(systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_API_KEY).getCode() |
| | | ,systemDictDataBiz.queryByCode(Constants.JDY_CONFIG, Constants.JDY_API_HOST).getCode()); |
| | | 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 ){ |