Merge remote-tracking branch 'origin/wuhuyancao' into wuhuyancao
| | |
| | | } from '@/api' |
| | | export default { |
| | | onLaunch: function() { |
| | | window.addEventListener("popstate", (event) => { |
| | | const path = this.$route.fullPath |
| | | // console.log('path', path); |
| | | if (path == '/pages/login/login' || path == '/') { |
| | | window.location.href = app_url |
| | | } |
| | | if (path == '/pages/wdata/home') { |
| | | window.location.href = 'https://atwl.ahzyssl.com/zhyq_h5/#/pages/wdata/home' |
| | | } |
| | | if (path == '/pages/waybill/home') { |
| | | window.location.href = 'https://atwl.ahzyssl.com/zhyq_h5/#/pages/waybill/home' |
| | | } |
| | | }) |
| | | uni.setStorageSync('transportList', []) |
| | | // window.addEventListener("popstate", (event) => { |
| | | // const path = this.$route.fullPath |
| | | // if (path == '/pages/login/login' || path == '/') { |
| | | // window.location.href = app_url |
| | | // } |
| | | // if (path == '/pages/wdata/home') { |
| | | // window.location.href = 'https://atwl.ahzyssl.com/zhyq_h5/#/pages/wdata/home' |
| | | // } |
| | | // if (path == '/pages/waybill/home') { |
| | | // window.location.href = 'https://atwl.ahzyssl.com/zhyq_h5/#/pages/waybill/home' |
| | | // } |
| | | // }) |
| | | // uni.setStorageSync('transportList', []) |
| | | console.log('onLaunch') |
| | | }, |
| | | onShow: function() { |
| | |
| | | "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz", |
| | | "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" |
| | | }, |
| | | "dingtalk-jsapi": { |
| | | "version": "3.2.0", |
| | | "resolved": "https://registry.npmmirror.com/dingtalk-jsapi/-/dingtalk-jsapi-3.2.0.tgz", |
| | | "integrity": "sha512-PZhTM1T9ERdaOzjFbyokegVmf/vUVvlg0BKcMiP1bB0e3vBflroPpbW2SjrZEKuvFxFtuFDpvYpk2EhbbKH/6Q==", |
| | | "requires": { |
| | | "promise-polyfill": "^7.1.0" |
| | | } |
| | | }, |
| | | "mutation-observer": { |
| | | "version": "1.0.3", |
| | | "resolved": "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz", |
| | | "integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==" |
| | | }, |
| | | "promise-polyfill": { |
| | | "version": "7.1.2", |
| | | "resolved": "https://registry.npmmirror.com/promise-polyfill/-/promise-polyfill-7.1.2.tgz", |
| | | "integrity": "sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ==" |
| | | }, |
| | | "regenerator-runtime": { |
| | | "version": "0.14.1", |
| | | "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", |
| | |
| | | }, |
| | | "dependencies": { |
| | | "dayjs": "^1.11.13", |
| | | "dingtalk-jsapi": "^3.2.0", |
| | | "uniapp-qrcode": "^1.0.2", |
| | | "uview-ui": "^2.0.37", |
| | | "vconsole": "^3.15.1" |
| | |
| | | { |
| | | "navigationBarTitleText" : "éæ©è¢«è®¿äºº" |
| | | } |
| | | },
|
| | | {
|
| | | "path" : "pages/appointment/appointment",
|
| | | "style" : |
| | | {
|
| | | "navigationBarTitleText" : "é¢çº¦"
|
| | | }
|
| | | },
|
| | | {
|
| | | "path" : "pages/loading/loading",
|
| | | "style" : |
| | | {
|
| | | "navigationBarTitleText" : "ææ"
|
| | | }
|
| | | }
|
| | | ],
|
| | | "subPackages": [
|
| | |
| | | }).then(res => { |
| | | this.score = 0 |
| | | uni.navigateTo({ |
| | | url: `/pages/userinfo/userinfo?answerId=${res.data}` |
| | | url: `/pages/appointment/appointment?answerId=${res.data}` |
| | | }) |
| | | }) |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="container"> |
| | | <view class="visitor-form"> |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>å§å</view> |
| | | <view class="content"> |
| | | <input class="input" @focus="showKeyboard = true" @blur="showKeyboard = false" |
| | | placeholder-style="color: #999999;" maxlength="30" v-model="visitorData.name" placeholder="请è¾å
¥æ¨ççå®å§å" /> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>ææºå·</view> |
| | | <view class="content"> |
| | | <input type="number" @focus="showKeyboard = true" @blur="showKeyboard = false" class="input" maxlength="11" |
| | | placeholder-style="color: #999999;" v-model="visitorData.phone" placeholder="请è¾å
¥æ¨çææºå·" /> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>è¯ä»¶ç±»å</view> |
| | | <view class="content" @click="show = true"> |
| | | <text |
| | | :style="{color: visitorData.idcardTypeName ? '#000000' : ''}">{{visitorData.idcardTypeName ? visitorData.idcardTypeName : 'è¯·éæ©'}}</text> |
| | | <u-icon name="arrow-right" color="#CCCCCC" size="16" class="ml6"></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title">è¯ä»¶å·ç </view> |
| | | <view class="content"> |
| | | <input class="input" maxlength="18" @focus="showKeyboard = true" @blur="showKeyboard = false" |
| | | placeholder-style="color: #999999;" v-model="visitorData.idcardNo" placeholder="请è¾å
¥æ¨çè¯ä»¶å·ç " /> |
| | | </view> |
| | | </view> |
| | | <view class="empty"></view> |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>å
¬å¸åç§°</view> |
| | | <view class="content"> |
| | | <input class="input" maxlength="50" @focus="showKeyboard = true" @blur="showKeyboard = false" |
| | | placeholder-style="color: #999999;" v-model="visitorData.companyName" placeholder="请è¾å
¥æ¨çå
¬å¸åç§°" /> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title1"> |
| | | <text class="title1_a"><b>*</b>人è¸ç
§ç</text> |
| | | <text class="title1_b">1ã请æä¾äºå®æ¸
æ°ï¼äººè¸å±
ä¸çæ£é¢äººè¸å
å ç
§çï¼</text> |
| | | <text class="title1_b">2ãç
§çæ éå
ãæ PSãæ è¿åº¦ç¾é¢å¤ç</text> |
| | | </view> |
| | | <view class="content"> |
| | | <view class="content_uplaod" @click="upload('faceImg')" v-if="!visitorData.faceImgUrl"> |
| | | <u-icon name="plus" color="rgb(153, 153, 153)" size="20"></u-icon> |
| | | </view> |
| | | <view class="content_uplaod" @click="upload('faceImg')" v-else> |
| | | <image :src="visitorData.faceImgUrl" mode="widthFix"></image> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view style="height: 20rpx; background-color: #F7F7F7;"></view> |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>被访人</view> |
| | | <view class="content" @click="selName"> |
| | | <text |
| | | :style="{ color: form1.receptMemberName ? '#000000' : '' }">{{form1.receptMemberName ? form1.receptMemberName : "è¯·éæ©"}}</text> |
| | | <u-icon name="arrow-right" color="#CCCCCC" size="16" class="ml6"></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>å
¥åæ¶é´</view> |
| | | <view class="content" @click="show4 = true"> |
| | | <text |
| | | :style="{color: form1.starttime ? '#000000' : ''}">{{form1.starttime ? form1.starttime : 'è¯·éæ©'}}</text> |
| | | <u-icon name="arrow-right" color="#CCCCCC" size="16" class="ml6"></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>ç¦»åæ¶é´</view> |
| | | <view class="content" @click="openLC"> |
| | | <text |
| | | :style="{color: form1.endtime ? '#000000' : ''}">{{form1.endtime ? form1.endtime : 'è¯·éæ©'}}</text> |
| | | <u-icon name="arrow-right" color="#CCCCCC" size="16" class="ml6"></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title"><b>*</b>æè®¿äºç±</view> |
| | | <view class="content" @click="showReason = true"> |
| | | <text |
| | | :style="{color: form1.reason ? '#000000' : ''}">{{form1.reason ? form1.reason : 'è¯·éæ©'}}</text> |
| | | <u-icon name="arrow-right" color="#CCCCCC" size="16" class="ml6"></u-icon> |
| | | </view> |
| | | </view> |
| | | <view class="cell" v-if="form1.type == 1"> |
| | | <view class="title">æ½å·¥å
容</view> |
| | | <view class="content"> |
| | | <input class="input" @focus="showKeyboard = true" @blur="showKeyboard = false" |
| | | placeholder-style="color: #999999;" maxlength="30" v-model="form1.constructionReason" placeholder="请è¾å
¥æ½å·¥å
容" /> |
| | | </view> |
| | | </view> |
| | | <view class="cell"> |
| | | <view class="title">éè¡è½¦è¾</view> |
| | | <view class="content" @click="openInput(1)"> |
| | | <text :style="{color: form1.carNos ? '#000000' : ''}">{{form1.carNos ? form1.carNos : '请è¾å
¥è½¦çå·ç '}}</text> |
| | | </view> |
| | | </view> |
| | | <!-- <view class="cell"> |
| | | <view class="title">å¥åº·è¯<b v-if="visit === '1'">*</b></view> |
| | | <view class="content"> |
| | | <view class="content_uplaod" @click="upload('imgurl')" v-if="!visitorData.imgurlUrl"> |
| | | <u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon> |
| | | </view> |
| | | <view class="content_uplaod" @click="upload('imgurl')" v-else> |
| | | <image :src="visitorData.imgurlUrl" mode="widthFix"></image> |
| | | </view> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | <view style="width: 100%; height: 110rpx;" v-if="!showKeyboard"></view> |
| | | <view v-if="!showKeyboard" class="footer-box"> |
| | | <view class="submit-button" @click="submit">ä¸ä¸æ¥</view> |
| | | </view> |
| | | <!-- <tly-picture-cut ref="tlyPictureCut" :pictureSrc="photoSrc" @createImg="uploadImg"></tly-picture-cut> --> |
| | | <u-picker :show="show" :columns="columns" keyName="name" @cancel="show = false" @confirm="confirm"></u-picker> |
| | | <qf-image-cropper ref="cropper" :width="280" :height="280" :radius="0" fileType="jpg" |
| | | @crop="uploadImg"></qf-image-cropper> |
| | | <keyboardInput ref="keyboard" @export="setPlate" @close="closeInput" /> |
| | | <!-- å
¥åæ¶é´ --> |
| | | <u-datetime-picker :show="show4" :minDate="new Date().getTime()" :formatter="formatter" mode="datetime" |
| | | @cancel="show4 = false" @confirm="setstarttime"></u-datetime-picker> |
| | | <!-- ç¦»åæ¶é´ --> |
| | | <u-datetime-picker v-if="form1.starttime" :show="show5" :formatter="formatter" |
| | | :minDate="formatTimeStamp(form1.starttime)" :maxDate="formatTimeStamp(form1.starttime.slice(0,10) + ' 23:59')" |
| | | mode="datetime" @cancel="show5 = false" @confirm="setendtime"></u-datetime-picker> |
| | | <u-picker keyName="title" :show="showReason" :columns="VisitReason" @confirm="selectedReason" |
| | | @cancel="showReason = false"></u-picker> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import tlyPictureCut from "@/components/tly-picture-cut/tlyPictureCut.vue"; |
| | | import keyboardInput from "@/components/keyboard-input/keyboard-input.vue" |
| | | import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue'; |
| | | import { |
| | | mapState |
| | | } from 'vuex' |
| | | import { |
| | | uploadAvatar |
| | | } from "@/utils/config" |
| | | import { |
| | | getSystemDictData, |
| | | visitorSub, |
| | | getVisitedVisitReason, |
| | | createFk |
| | | } from '@/api' |
| | | export default { |
| | | data() { |
| | | return { |
| | | photoSrc: "", |
| | | inputType: '', |
| | | show: false, |
| | | showKeyboard: false, |
| | | visit: '', |
| | | type: '', |
| | | show4: false, |
| | | show5: false, |
| | | showReason: false, |
| | | personnel: [], |
| | | VisitReason: [], |
| | | columns: [ |
| | | [{ |
| | | name: '身份è¯', |
| | | id: 0 |
| | | }, { |
| | | name: '港澳è¯ä»¶', |
| | | id: 1 |
| | | }, { |
| | | name: 'æ¤ç
§', |
| | | id: 2 |
| | | }] |
| | | ], |
| | | fileList: [], |
| | | visitorData: { |
| | | userAnswerId: '', |
| | | name: '', |
| | | phone: '', |
| | | idcardType: 0, |
| | | idcardTypeName: '身份è¯', |
| | | idcardNo: '', |
| | | faceImg: '', |
| | | faceImgUrl: '', |
| | | imgurl: '', |
| | | imgurlUrl: '', |
| | | companyName: '' |
| | | }, |
| | | form1: { |
| | | phone1: '', |
| | | receptMemberId: '', |
| | | receptMemberName: '', |
| | | starttime: '', |
| | | endtime: '', |
| | | doors: '', |
| | | doorSelectName: '', |
| | | reason: '', |
| | | carNos: '', |
| | | type: 0 |
| | | }, |
| | | withUserList: { |
| | | name: '', |
| | | phone: '', |
| | | idcardType: '', |
| | | idcardTypeName: '', |
| | | companyName: '', |
| | | idcardNo: '', |
| | | faceImg: '', |
| | | faceImgUrl: '', |
| | | imgurl: '', |
| | | imgurlUrl: '' |
| | | }, |
| | | } |
| | | }, |
| | | components: { |
| | | tlyPictureCut, |
| | | QfImageCropper, |
| | | keyboardInput |
| | | }, |
| | | |
| | | onLoad(option) { |
| | | this.getUser() |
| | | const visitorData = uni.getStorageSync('member') |
| | | if (visitorData.faceImg) { |
| | | visitorData.faceImgUrl = visitorData.prefixUrl + visitorData.faceImg |
| | | } |
| | | if (visitorData && visitorData.name) { |
| | | this.visitorData = visitorData |
| | | } |
| | | this.visitorData.companyName = visitorData.visitCompanyName |
| | | this.visitorData.idcardNo = visitorData.idcardDecode |
| | | if (this.visitorData.idcardType === 0) { |
| | | this.visitorData.idcardTypeName = '身份è¯' |
| | | } else if (this.visitorData.idcardType === 1) { |
| | | this.visitorData.idcardTypeName = '港澳è¯ä»¶' |
| | | } else if (this.visitorData.idcardType === 2) { |
| | | this.visitorData.idcardTypeName = 'æ¤ç
§' |
| | | } |
| | | if (this.visitorData.imgurl) { |
| | | this.visitorData.imgurlUrl = this.visitorData.prefixUrl + this.visitorData.imgurl |
| | | } |
| | | // if (this.member ) { |
| | | // this.visitorData.name = this.member.name |
| | | // this.visitorData.phone = this.member.phone |
| | | // this.visitorData.idcardNo = this.member.idcardDecode |
| | | // this.visitorData.companyName = this.member.visitCompanyName |
| | | // this.visitorData.faceImg = this.member.faceImg |
| | | // if (this.member.faceImg) { |
| | | // this.visitorData.faceImgUrl = this.member.prefixUrl + this.member.faceImg |
| | | // } |
| | | // this.visitorData.imgurl = this.member.imgurl |
| | | // if (this.member.imgurl) { |
| | | // this.visitorData.imgurlUrl = this.member.prefixUrl + this.member.imgurl |
| | | // } |
| | | // this.visitorData.idcardType = this.member.idcardType |
| | | // if (this.member.idcardType === 0) { |
| | | // this.visitorData.idcardTypeName = '身份è¯' |
| | | // } else if (this.member.idcardType === 1) { |
| | | // this.visitorData.idcardTypeName = '港澳è¯ä»¶' |
| | | // } else if (this.member.idcardType === 2) { |
| | | // this.visitorData.idcardTypeName = 'æ¤ç
§' |
| | | // } |
| | | // } |
| | | this.visitorData.userAnswerId = option.answerId || '' |
| | | // this.getVisit() |
| | | // uni.$on('update', (data) => { |
| | | // this.uploadImg(data.tempFilePath) |
| | | // }) |
| | | }, |
| | | mounted() { |
| | | this.$eventBus.$on('svisitorAppSel', (option) => { |
| | | // this.$set(this.param, 'checkUserId', option.id) |
| | | // this.$set(this.param, 'applyCheckUserId', option.id) |
| | | // this.$set(this.param, 'checkorName', option.name) |
| | | |
| | | this.form1.receptMemberName = option.name |
| | | this.form1.receptMemberId = option.id |
| | | this.form1.receptMemberDepartment = option.companyName |
| | | }) |
| | | }, |
| | | methods: { |
| | | selectedReason(e) { |
| | | this.form1.reason = e.value[0].title |
| | | this.form1.type = e.value[0].constructionType |
| | | this.showReason = false |
| | | }, |
| | | // æ¥è¯¢ç¨æ· |
| | | getUser() { |
| | | getVisitedVisitReason({}).then(res => { |
| | | this.VisitReason = [res.data || []] |
| | | }) |
| | | }, |
| | | setendtime(e) { |
| | | this.form1.endtime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM') |
| | | this.show5 = false |
| | | }, |
| | | formatTimeStamp(date) { |
| | | return Date.parse(new Date(`${date}`)) || Date.parse(new Date(`${date.replace(/-/g, '/')}`)) |
| | | }, |
| | | openLC() { |
| | | if (!this.form1.starttime) return uni.showToast({ |
| | | title: '请å
éæ©å
¥åæ¶é´', |
| | | icon: 'none' |
| | | }) |
| | | this.show5 = true |
| | | }, |
| | | setstarttime(e) { |
| | | this.form1.starttime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM') |
| | | this.maxTime = this.form1.starttime |
| | | this.show4 = false |
| | | }, |
| | | formatter(type, value) { |
| | | if (type === 'year') { |
| | | return `${value}å¹´` |
| | | } |
| | | if (type === 'month') { |
| | | return `${value}æ` |
| | | } |
| | | if (type === 'day') { |
| | | return `${value}æ¥` |
| | | } |
| | | if (type === 'hour') { |
| | | return `${value}æ¶` |
| | | } |
| | | if (type === 'minute') { |
| | | return `${value}å` |
| | | } |
| | | return value |
| | | }, |
| | | closeInput() { |
| | | this.$refs.keyboard.close() |
| | | }, |
| | | setPlate(e) { |
| | | if (this.inputType === 1) { |
| | | this.form1.carNos = e |
| | | } else if (this.inputType === 2) { |
| | | this.withUserList.carNos = e |
| | | } |
| | | this.$forceUpdate() |
| | | this.closeInput() |
| | | }, |
| | | openInput(type) { |
| | | this.inputType = type |
| | | this.$refs.keyboard.open() |
| | | }, |
| | | selName() { |
| | | uni.navigateTo({ |
| | | url: '/pages/visitorApplication/memberSel' |
| | | }) |
| | | }, |
| | | submit() { |
| | | const { |
| | | visitorData |
| | | } = this |
| | | if (!this.visitorData.name) return uni.showToast({ |
| | | title: 'å§åä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | if (!this.visitorData.phone) return uni.showToast({ |
| | | title: 'ææºå·ä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | const regExp = /^1[3456789]\d{9}$/; |
| | | if (!regExp.test(this.visitorData.phone)) return uni.showToast({ |
| | | title: 'ææºå·æ ¼å¼é误', |
| | | icon: 'none' |
| | | }) |
| | | if (!String(this.visitorData.idcardType)) return uni.showToast({ |
| | | title: 'è¯ä»¶ç±»åä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | // if (!this.visitorData.idcardNo) return uni.showToast({ |
| | | // title: 'è¯ä»¶å·ç ä¸è½ä¸ºç©º', |
| | | // icon: 'none' |
| | | // }) |
| | | if (this.visitorData.idcardType === 0 && this.visitorData.idcardNo) { |
| | | const regex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|3[0-1])\d{3}[\dxX]$/; |
| | | if (!regex.test(this.visitorData.idcardNo)) return uni.showToast({ |
| | | title: 'è¯ä»¶å·ç æ ¼å¼é误', |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | if (!this.visitorData.companyName) return uni.showToast({ |
| | | title: 'å
¬å¸ä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | if (!this.visitorData.faceImg) return uni.showToast({ |
| | | title: '人è¸ç
§çä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | // if (this.visit === '1') { |
| | | // if (!this.visitorData.imgurl) return uni.showToast({ |
| | | // title: 'å¥åº·è¯ä¸è½ä¸ºç©º', |
| | | // icon: 'none' |
| | | // }) |
| | | // } |
| | | if (!this.form1.receptMemberId) return uni.showToast({ |
| | | title: 'è¯·å¡«åææç访é®äºº', |
| | | icon: 'none' |
| | | }) |
| | | if (!this.form1.starttime) return uni.showToast({ |
| | | title: 'å
¥åæ¶é´ä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | if (!this.form1.endtime) return uni.showToast({ |
| | | title: 'ç¦»åæ¶é´ä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | if (!this.form1.doorSelectName && this.accessControl == 1) return uni.showToast({ |
| | | title: '访é®é¨ç¦ä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | if (!this.form1.reason) return uni.showToast({ |
| | | title: 'æè®¿äºç±ä¸è½ä¸ºç©º', |
| | | icon: 'none' |
| | | }) |
| | | let data = JSON.parse(JSON.stringify(this.form1)) |
| | | data.starttime = data.starttime + ':00' |
| | | data.endtime = data.endtime + ':00' |
| | | createFk({ |
| | | ...this.visitorData, |
| | | ...data, |
| | | withUserList: this.personnel |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | uni.navigateTo({ |
| | | url: `/pages/appointmentDetails/appointmentDetails?id=${res.data}` |
| | | }) |
| | | } |
| | | }) |
| | | // uni.setStorageSync('visitorData', this.visitorData) |
| | | // uni.navigateTo({ |
| | | // url: `/pages/visitorApplication/visitorApplication?data=${JSON.stringify(this.visitorData)}` |
| | | // }); |
| | | }, |
| | | getVisit() { |
| | | // æ¯å¦éè¦ å¥åº·è¯ |
| | | getSystemDictData({ |
| | | dictCode: 'SYSTEM', |
| | | label: 'HEALTH_CARD' |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | this.visit = res.data.code |
| | | } |
| | | }) |
| | | }, |
| | | uploadImg(file) { |
| | | var that = this |
| | | that.$refs.cropper.close() |
| | | uni.showLoading({ |
| | | title: 'ä¸ä¼ ä¸', |
| | | mask: true |
| | | }); |
| | | uni.uploadFile({ |
| | | url: uploadAvatar, |
| | | filePath: file.tempFilePath, |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'MEMBER_IMG', |
| | | // isFace: 0 |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | if(res.code !== 200){ |
| | | return this.showToast(res.message) |
| | | } |
| | | this.visitorData.faceImg = res.data.halfPath |
| | | this.visitorData.faceImgUrl = res.data.prefixPath + res.data.folder + res.data.halfPath |
| | | }, |
| | | fail: (err) => { |
| | | // this.showToast(err) |
| | | }, |
| | | complete() { |
| | | uni.hideLoading(); |
| | | } |
| | | }); |
| | | }, |
| | | deleUser(i) { |
| | | this.personnel.splice(i, 1) |
| | | }, |
| | | upload(type) { |
| | | var that = this |
| | | that.type = type |
| | | if (type === 'faceImg') { |
| | | that.$refs.cropper.chooseImage() |
| | | return |
| | | } |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | success: (chooseImageRes) => { |
| | | // if (type === 'faceImg') { |
| | | // that.photoSrc = chooseImageRes.tempFilePaths[0]; |
| | | // that.$refs.tlyPictureCut.showPop(); |
| | | // } |
| | | if (type === 'imgurl') { |
| | | uni.showLoading({ |
| | | title: 'ä¸ä¼ ä¸', |
| | | mask: true |
| | | }); |
| | | uni.uploadFile({ |
| | | url: uploadAvatar, |
| | | filePath: chooseImageRes.tempFilePaths[0], |
| | | name: 'file', |
| | | formData: { |
| | | folderCode: 'MEMBER_IMG' |
| | | }, |
| | | timeout: 60000, |
| | | success: (uploadFileRes) => { |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | that.visitorData.imgurl = res.data.halfPath |
| | | that.visitorData.imgurlUrl = res.data.prefixPath + res.data.folder + res.data.halfPath |
| | | }, |
| | | complete() { |
| | | uni.hideLoading(); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | fail(err) { |
| | | alert('apiæ¥é') |
| | | } |
| | | }); |
| | | }, |
| | | confirm(e) { |
| | | this.visitorData.idcardType = e.value[0].id |
| | | this.visitorData.idcardTypeName = e.value[0].name |
| | | this.show = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | page { |
| | | background-color: #F7F7F7 !important; |
| | | } |
| | | |
| | | .u-upload__button { |
| | | margin: 0 !important; |
| | | } |
| | | |
| | | .content_uplaod { |
| | | width: 120rpx; |
| | | height: 120rpx; |
| | | background: #F7F7F7; |
| | | border-radius: 8rpx; |
| | | border: 2rpx solid #E5E5E5; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .content_uplaod image { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .empty { |
| | | width: 750rpx; |
| | | height: 20rpx; |
| | | margin: 0 -30rpx; |
| | | background-color: #f7f7f7; |
| | | ; |
| | | } |
| | | |
| | | .title { |
| | | font-size: 30rpx; |
| | | font-weight: 400; |
| | | color: #222222; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .title b { |
| | | color: #E42D2D; |
| | | margin-right: 4rpx; |
| | | } |
| | | |
| | | .title1 { |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .title1_a { |
| | | font-size: 30rpx !important; |
| | | font-weight: 400; |
| | | color: #222222; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20rpx; |
| | | |
| | | b { |
| | | color: #E42D2D; |
| | | margin-right: 4rpx; |
| | | |
| | | } |
| | | } |
| | | |
| | | .title1_b { |
| | | font-size: 24rpx !important; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | } |
| | | } |
| | | |
| | | .add-other { |
| | | border: 1rpx solid #4d99a8; |
| | | color: #4d99a8; |
| | | font-size: 11rpx; |
| | | padding: 0 12rpx; |
| | | height: 32rpx; |
| | | line-height: 32rpx; |
| | | width: 120rpx; |
| | | text-align: center; |
| | | border-radius: 24rpx; |
| | | margin: 20rpx auto; |
| | | } |
| | | |
| | | .footer-box { |
| | | width: 100%; |
| | | position: fixed; |
| | | bottom: 30rpx; |
| | | height: 80rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | .submit-button { |
| | | width: calc(100% - 60rpx); |
| | | height: 88rpx; |
| | | line-height: 88rpx; |
| | | background: #4d99a8; |
| | | border-radius: 4rpx; |
| | | color: #fff; |
| | | border-radius: 44rpx; |
| | | font-size: 32rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | </style> |
| | | |
| | | <style lang="scss" scoped> |
| | | .popup-content { |
| | | padding: 20rpx; |
| | | height: 100%; |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-flow: column; |
| | | |
| | | .input { |
| | | border: 1rpx solid #ccc; |
| | | border-radius: 4rpx; |
| | | padding: 4rpx 12rpx; |
| | | font-size: 28rpx; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | } |
| | | |
| | | .respondent-item { |
| | | padding: 10rpx; |
| | | border-bottom: 1rpx solid #eee; |
| | | cursor: pointer; |
| | | |
| | | &:hover { |
| | | background-color: #eee; |
| | | } |
| | | } |
| | | |
| | | .van-list { |
| | | flex: 1; |
| | | overflow: auto; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | }, |
| | | onLoad() { |
| | | this.getInfo() |
| | | if (!this.$store.state.openId) { |
| | | // this.initToken() |
| | | } |
| | | // if (!this.$store.state.openId) { |
| | | // this.initToken() |
| | | // } |
| | | }, |
| | | methods: { |
| | | initToken() { |
| | |
| | | jump(type) {
|
| | | switch (type) {
|
| | | case 1:
|
| | | console.log('1')
|
| | | uni.navigateTo({
|
| | | url: '/pages/notice/notice'
|
| | | })
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="box"> |
| | | <!-- å è½½ä¸ --> |
| | | <view class="loading" v-if="loading === 'loading'"> |
| | | <image src="/static/loading.gif" mode="widthFix"></image> |
| | | <text>èº«ä»½æ ¡éªä¸ï¼è¯·ç¨å~</text> |
| | | </view> |
| | | <!-- 失败 --> |
| | | <view class="error" v-if="loading === 'error'"> |
| | | <image src="/static/ic_fail.png" mode="widthFix"></image> |
| | | <text class="title">ææå¤±è´¥</text> |
| | | <text class="desc">æ¨çè´¦å·ææªç»å®ç³»ç»ï¼è¯·è系管çå</text> |
| | | <button>éæ°éªè¯</button> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | loading: 'error' |
| | | }; |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .box { |
| | | width: 100%; |
| | | .error { |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | flex-direction: column; |
| | | image { |
| | | width: 180rpx; |
| | | height: 180rpx; |
| | | margin-top: 160rpx; |
| | | } |
| | | .title { |
| | | font-weight: 500; |
| | | font-size: 36rpx; |
| | | color: #333333; |
| | | margin-top: 32rpx; |
| | | } |
| | | .desc { |
| | | font-weight: 400; |
| | | font-size: 26rpx; |
| | | color: #999999; |
| | | margin-top: 20rpx; |
| | | } |
| | | button { |
| | | width: 224rpx; |
| | | height: 76rpx; |
| | | font-weight: 400; |
| | | font-size: 28rpx; |
| | | color: #279BAA; |
| | | border-radius: 38rpx; |
| | | border: 1rpx solid #279BAA; |
| | | margin-top: 68rpx; |
| | | background-color: #ffffff; |
| | | } |
| | | } |
| | | .loading { |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | flex-direction: column; |
| | | image { |
| | | width: 200rpx; |
| | | height: 200rpx; |
| | | margin-top: 202rpx; |
| | | } |
| | | text { |
| | | font-weight: 500; |
| | | font-size: 36rpx; |
| | | color: #333333; |
| | | margin-top: 40rpx; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | },
|
| | | onLoad(option) {
|
| | | console.log('onLoad');
|
| | | if (option.ywid) {
|
| | | uni.setStorageSync('ywinfo', {
|
| | | type: option.type,
|
| | | yw: option.yw,
|
| | | ywid: option.ywid
|
| | | })
|
| | | } |
| | | // if (option.ywid) {
|
| | | // uni.setStorageSync('ywinfo', {
|
| | | // type: option.type,
|
| | | // yw: option.yw,
|
| | | // ywid: option.ywid
|
| | | // })
|
| | | // } |
| | | // https://atwl.ahzyssl.com/zhyq_h5/#/pages/login/login?type=2&yw=5&ywid=b3db2072-a453-470d-8c0d-ba3b8b256530
|
| | | },
|
| | | onShow() {
|
| | | var that = this
|
| | | let url = 'https://atwl.ahzyssl.com/zhyq_h5/#/'
|
| | | let code = ''
|
| | | if (window.location.href.indexOf('code=') !== -1 || this.code) {
|
| | | // if(window.location.href.indexOf('wdata') !== -1){
|
| | | // uni.redirectTo({
|
| | | // url: '/pages/wdata/home?code=' + |
| | | // })
|
| | | // }
|
| | | const ywinfo = uni.getStorageSync('ywinfo') || {}
|
| | | if (ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)) {
|
| | | this.userAuth(ywinfo.type)
|
| | | }
|
| | | } else {
|
| | | // let url = window.location.href
|
| | | const appID = 'wx173e6caf5abc718a'
|
| | | let uri = encodeURIComponent(url)
|
| | | let authURL =
|
| | | `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appID}&redirect_uri=${uri}&response_type=code&scope=snsapi_base#wechat_redirect`
|
| | | window.location.href = authURL
|
| | | }
|
| | | // var that = this
|
| | | // let url = 'https://atwl.ahzyssl.com/zhyq_h5/#/'
|
| | | // let code = ''
|
| | | // if (window.location.href.indexOf('code=') !== -1 || this.code) {
|
| | | // // if(window.location.href.indexOf('wdata') !== -1){
|
| | | // // uni.redirectTo({
|
| | | // // url: '/pages/wdata/home?code=' + |
| | | // // })
|
| | | // // }
|
| | | // const ywinfo = uni.getStorageSync('ywinfo') || {}
|
| | | // if (ywinfo.ywid && (ywinfo.type || ywinfo.type == 0)) {
|
| | | // this.userAuth(ywinfo.type)
|
| | | // }
|
| | | // } else {
|
| | | // // let url = window.location.href
|
| | | // const appID = 'wx173e6caf5abc718a'
|
| | | // let uri = encodeURIComponent(url)
|
| | | // let authURL =
|
| | | // `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appID}&redirect_uri=${uri}&response_type=code&scope=snsapi_base#wechat_redirect`
|
| | | // window.location.href = authURL
|
| | | // }
|
| | |
|
| | | },
|
| | | methods: {
|
| | |
| | | <script> |
| | | let timer |
| | | import { getSystemDictData } from "@/api" |
| | | import { getCode } from "@/utils/getCode.js"; |
| | | export default { |
| | | name: 'Index', |
| | | data() { |
| | |
| | | }, |
| | | onLoad() { |
| | | this.getInfo() |
| | | if (!this.$store.state.openId) { |
| | | // this.initToken() |
| | | } |
| | | getCode(code => { |
| | | console.log('code', code) |
| | | }); |
| | | // if (!this.$store.state.openId) { |
| | | // this.initToken() |
| | | // } |
| | | }, |
| | | methods: { |
| | | initToken() { |
| | |
| | | |
| | | // export const baseUrl = 'zhyq_interface/' |
| | | // export const baseUrl = 'http://192.168.0.173/gateway_interface/' |
| | | export const baseUrl = 'http://192.168.1.54:10010/' |
| | | // export const baseUrl = 'http://10.50.250.253:8088/gateway_interface/' |
| | | export const baseUrl = 'https://atwl.ahzyssl.com/zhyq_interface/' |
| | | // export const baseUrl = 'https://atwl.ahzyssl.com/zhyq_interface/' |
| | | |
| | | export const app_url = 'https://atwl.ahzyssl.com/zhyq_h5/#/' |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import * as dd from 'dingtalk-jsapi'; |
| | | export function getCode(callback) { |
| | | let corpId = 'dingb14b7554444efe0a'; |
| | | console.log(dd.env.platform) |
| | | if (dd.env.platform !== "notInDingTalk") { |
| | | dd.ready(() => { |
| | | //使ç¨SDK è·åå
ç»ææç |
| | | dd.runtime.permission.requestAuthCode({ |
| | | corpId: corpId, |
| | | onSuccess: (info) => { |
| | | // æ ¹æ®ééæä¾çapi è·å¾codeå,忬¡è°ç¨è¿ä¸ªcallbackæ¹æ³ |
| | | // ç±äºæ¯ééè·åcodeæ¯å¼æ¥æä½,ä¸ç¥éä»ä¹æ¶åæ§è¡å®æ¯ |
| | | // callback 彿°ä¼ç仿§è¡å®æ¯åå¨èªå·±è°ç¨èªå·± |
| | | callback(info.code) |
| | | }, |
| | | onFail: (err) => { |
| | | alert('fail'); |
| | | alert(JSON.stringify(err)); |
| | | }, |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | |
| | | uni.$u.http.interceptors.response.use((response) => { |
| | | uni.hideLoading(); |
| | | // ç»å½è¿æ |
| | | if (response.data.code === 401) { |
| | | uni.navigateTo({ |
| | | url: '/packageA/loginAgain/loginAgain' |
| | | }); |
| | | } |
| | | // if (response.data.code === 401) { |
| | | // uni.navigateTo({ |
| | | // url: '/packageA/loginAgain/loginAgain' |
| | | // }); |
| | | // } |
| | | if (response.data.code !== 200) { |
| | | uni.showToast({ |
| | | title: response.data.message, |
| | |
| | | 'title': 'æå¡å¨å¼å¸¸',icon:'none' |
| | | }) |
| | | } |
| | | if (data.code === 5112) { |
| | | uni.clearStorageSync() |
| | | window.location.href = app_url |
| | | } |
| | | // if (data.code === 5112) { |
| | | // uni.clearStorageSync() |
| | | // window.location.href = app_url |
| | | // } |
| | | return resolve(data) |
| | | } |
| | | resolve(data) |
| | |
| | | @ApiModelProperty(value = "微信openId") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "éé unionId") |
| | | private String ddUnionId; |
| | | |
| | | @NotBlank(message = "å¯ç ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "å¯ç ") |
| | | private String password; |
| | |
| | | @ApiModelProperty(value = "微信openId") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "éé unionId") |
| | | private String ddUnionId; |
| | | |
| | | @NotBlank(message = "å¯ç ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "å¯ç ") |
| | | private String password; |
| | |
| | | private String code; |
| | | @ApiModelProperty(value = "openid") |
| | | private String openid; |
| | | @ApiModelProperty(value = "éé unionId") |
| | | private String ddUnionId; |
| | | @ApiModelProperty(value = "ç¨æ·ç±»åï¼0=叿ºï¼1=访客ï¼2=å
é¨åå·¥") |
| | | private Integer userType; |
| | | } |
| | |
| | | private String openidHkInfo; |
| | | @ApiModelProperty(value = "微信openidæ¨é海康æ¶é´", example = "1", hidden = true) |
| | | private Date openidHkDate; |
| | | @ApiModelProperty(value = "éé unionId", example = "1", hidden = true) |
| | | private String ddUnionId; |
| | | |
| | | //2024å¹´12æ6æ¥11:00:30 ç±»å 0叿ºäººå 1æ®é访客 2å
é¨äººå 3tms管æ§äººå |
| | | @ApiModelProperty(value = "ç±»å 0叿ºäººå 1æ®é访客 2å
é¨äººå 3tms管æ§äººå", example = "0") |
| | |
| | | } |
| | | } |
| | | try { |
| | | LoginUserInfo user = dealLoginByPwdNewBiz(dto.getUsername(),dto.getPassword(),null,dto.getOpenid(),request); |
| | | LoginUserInfo user = dealLoginByPwdNewBiz(dto.getUsername(),dto.getPassword(),null,dto.getOpenid(),dto.getDdUnionId(),request); |
| | | systemLoginLogService.create(loginLog); |
| | | return user; |
| | | }catch (BusinessException e){ |
| | |
| | | throw e; |
| | | } |
| | | } |
| | | LoginUserInfo user = dealLoginByPwdNewBiz(dto.getUsername(),dto.getPassword(),null,dto.getOpenid(),request); |
| | | LoginUserInfo user = dealLoginByPwdNewBiz(dto.getUsername(),dto.getPassword(),null,dto.getOpenid(),dto.getDdUnionId(),request); |
| | | systemLoginLogService.create(loginLog); |
| | | return user; |
| | | } |
| | |
| | | isCaptcheValide(dto.getPhone(),dto.getCode());//æ£æ¥éªè¯ç |
| | | SystemLoginLog loginLog = getInitLoginlog(dto.getPhone(),request); |
| | | try{ |
| | | LoginUserInfo userInfo = dealLoginByPwdNewBiz(null,null,dto.getPhone(),dto.getOpenid(), request ); |
| | | LoginUserInfo userInfo = dealLoginByPwdNewBiz(null,null,dto.getPhone(),dto.getOpenid(),dto.getDdUnionId(), request ); |
| | | systemLoginLogService.create(loginLog); |
| | | return userInfo; |
| | | }catch (BusinessException e){ |
| | |
| | | throw e; |
| | | } |
| | | } |
| | | private LoginUserInfo dealLoginByPwdNewBiz(String username,String pwd, String phone, String openid, ServerHttpRequest request) { |
| | | private LoginUserInfo dealLoginByPwdNewBiz(String username,String pwd, String phone, String openid, String ddUnionId, ServerHttpRequest request) { |
| | | // æ ¹æ®ç¨æ·åæ¥è¯¢ç¨æ·å¯¹è±¡ |
| | | SystemUser queryDto = new SystemUser(); |
| | | queryDto.setMobile(phone); |
| | |
| | | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT); |
| | | } |
| | | } |
| | | dealOpenIdBiz(user,openid); |
| | | if(StringUtils.isNotBlank(openid)){ |
| | | dealOpenIdBiz(user,openid); |
| | | } |
| | | if(StringUtils.isNotBlank(ddUnionId)){ |
| | | dealDDUnionIdBiz(user,ddUnionId); |
| | | } |
| | | Company company = new Company(); |
| | | if(Objects.nonNull(user.getCompanyId())){ |
| | | company = companyMapper.selectById(user.getCompanyId()); |
| | |
| | | .eq(SystemUser::getId,user.getId())); |
| | | } |
| | | } |
| | | |
| | | private void dealDDUnionIdBiz(SystemUser user, String ddUnionId) { |
| | | if(StringUtils.isNotBlank(ddUnionId)){ |
| | | //妿openIdä¸ä¸ºç©º,ç»å®è¯¥ç¨æ·openid |
| | | systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda() |
| | | .set(SystemUser::getDdUnionId,null) |
| | | .set(SystemUser::getOpenidHkStatus,Constants.ZERO) |
| | | .ne(SystemUser::getType,Constants.memberType.gkuser) |
| | | .eq(SystemUser::getDdUnionId,ddUnionId) |
| | | ); |
| | | systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda() |
| | | .set(SystemUser::getDdUnionId,ddUnionId) |
| | | .set(SystemUser::getOpenidHkStatus,Constants.ZERO) |
| | | .set(SystemUser::getOpenidHkDate,null) |
| | | .set(SystemUser::getOpenidHkInfo,null) |
| | | .eq(SystemUser::getId,user.getId())); |
| | | } |
| | | } |
| | | private void dealOpenIdBizForGk(SystemUser user, String openid) { |
| | | if(StringUtils.isNotBlank(openid)){ |
| | | //妿openIdä¸ä¸ºç©º,ç»å®è¯¥ç¨æ·openid |
| | |
| | | import com.doumee.service.business.ext.ERPSyncService; |
| | | import com.doumee.service.business.impl.hksync.fhk.HkSyncOrgUserFromHKServiceImpl; |
| | | import com.doumee.service.business.impl.hksync.fhk.HkSyncOrgUserFromSelfServiceImpl; |
| | | import com.taobao.api.ApiException; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("å
¨é人åä¿¡æ¯åæ¥ - éé") |
| | | @PostMapping("/syncAllDingding") |
| | | // @CloudRequiredPermission("business:company:sync") |
| | | public ApiResponse syncAllDingding() throws ApiException { |
| | | memberService.syncDDUserInfo(); |
| | | return ApiResponse.success("忥æå"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.dao.web.response.DDAuthorizeVO; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | |
| | | import com.doumee.service.business.MemberService; |
| | | import com.doumee.service.business.VisitReasonService; |
| | | import com.doumee.service.business.VisitsService; |
| | | import com.taobao.api.ApiException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | return ApiResponse.success("æ¥è¯¢æå",wxAuthorizeVO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "éé微信ææ", notes = "访客微信ææè·åopenId") |
| | | @GetMapping("/ddAuthorize") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "ææç ", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "source", value = "æ¥æº:0=叿ºï¼1=访客ï¼2=å
é¨åå·¥", required = true) |
| | | }) |
| | | public ApiResponse<DDAuthorizeVO> ddAuthorize(@RequestParam String code, @RequestParam Integer source) throws ApiException { |
| | | DDAuthorizeVO ddAuthorizeVO = memberService.ddAuthorize(code,source); |
| | | return ApiResponse.success("æ¥è¯¢æå",ddAuthorizeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢è¢«è®¿é®äººä¿¡æ¯", notes = "æ¥è¯¢è¢«è®¿é®äººä¿¡æ¯") |
| | | @PostMapping("/getVisitedMember") |
| | | public ApiResponse<List<MemberVO>> getVisitedMember(@Valid @RequestBody CheckVisitedDTO checkVisitedDTO) { |
| | |
| | | visits.setSourceType(Constants.ZERO); |
| | | return ApiResponse.success("æ¥è¯¢æå", visitsService.createFk(visits,false,Constants.ZERO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ¥è®¿äºç±", notes = "æ¥è®¿äºç±") |
| | | @PostMapping("/visitReason") |
| | | public ApiResponse<List<VisitReason>> visitReason() { |
| | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.dao.CompanyMapper; |
| | | import com.doumee.dao.business.model.CarUseBook; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.service.business.CompanyService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.taobao.api.ApiException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | public String getToken(){ |
| | | String accessToken = systemDictDataBiz.queryByCode(Constants.DD_TALK,Constants.ACCESS_TOKEN).getCode(); |
| | | return accessToken; |
| | | } |
| | | |
| | | |
| | | public OapiV2UserGetuserinfoResponse.UserGetByCodeResponse getDDUserByCode(String code) throws ApiException { |
| | | DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getuserinfo"); |
| | | OapiV2UserGetuserinfoRequest req = new OapiV2UserGetuserinfoRequest(); |
| | | req.setCode(code); |
| | | OapiV2UserGetuserinfoResponse rsp = client.execute(req, getToken()); |
| | | if(rsp.getErrcode().equals(Constants.DD_ERR_CODE)){ |
| | | return rsp.getResult(); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),rsp.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public void workInfoOANotice(Long agentId,String userIds,OapiMessageCorpconversationAsyncsendV2Request.Msg msg)throws ApiException { |
| | | DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2"); |
| | | OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request(); |
| | | request.setAgentId(agentId); |
| | | request.setUseridList(userIds); |
| | | request.setToAllUser(false); |
| | | |
| | | request.setMsg(msg); |
| | | OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, getToken()); |
| | | if(rsp.getErrcode().equals(Constants.DD_ERR_CODE)){ |
| | | |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),rsp.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 访客ç³è¯·/æ¥å¤ OA å·¥ä½éç¥ å
容 |
| | | * @param visits |
| | | * @param title |
| | | * @return |
| | | */ |
| | | public OapiMessageCorpconversationAsyncsendV2Request.Msg getVisitNoticeMsg(Visits visits,String title){ |
| | | OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); |
| | | msg.setMsgtype("oa"); |
| | | OapiMessageCorpconversationAsyncsendV2Request.OA oa = new OapiMessageCorpconversationAsyncsendV2Request.OA(); |
| | | oa.setMessageUrl(""); |
| | | OapiMessageCorpconversationAsyncsendV2Request.Head head = new OapiMessageCorpconversationAsyncsendV2Request.Head(); |
| | | head.setText(title); |
| | | head.setBgcolor("#279BAA"); |
| | | oa.setHead(head); |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Body body = new OapiMessageCorpconversationAsyncsendV2Request.Body(); |
| | | body.setTitle(!Constants.equalsInteger(visits.getType(),Constants.TWO)?visits.getName()+"ç访客ç³è¯·":"ç访客æ¥å¤"); |
| | | List<OapiMessageCorpconversationAsyncsendV2Request.Form> formList = new ArrayList<>(); |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form visitUser = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | visitUser.setKey("æ¥è®¿äºº"); |
| | | visitUser.setValue(visits.getName()); |
| | | formList.add(visitUser); |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form inDate = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | inDate.setKey("å
¥åæ¶é´"); |
| | | inDate.setValue(DateUtil.formatDate(visits.getStarttime(),"MM-dd HH:mm")); |
| | | formList.add(inDate); |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form outDate = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | outDate.setKey("ç¦»åæ¶é´"); |
| | | outDate.setValue(DateUtil.formatDate(visits.getEndtime(),"MM-dd HH:mm")); |
| | | formList.add(outDate); |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form inReason = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | inReason.setKey("æ¥è®¿äºç±"); |
| | | inReason.setValue(visits.getReason()); |
| | | formList.add(inReason); |
| | | |
| | | if(StringUtils.isNotBlank(visits.getCarNos())){ |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form carNos = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | carNos.setKey("é访车è¾"); |
| | | carNos.setValue(visits.getCarNos()); |
| | | formList.add(visitUser); |
| | | } |
| | | |
| | | body.setForm(formList); |
| | | oa.setBody(body); |
| | | msg.setOa(oa); |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | /* public OapiMessageCorpconversationAsyncsendV2Request.Msg getCarUseNoticeMsg(CarUseBook carUseBook,String title){ |
| | | OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); |
| | | msg.setMsgtype("oa"); |
| | | OapiMessageCorpconversationAsyncsendV2Request.OA oa = new OapiMessageCorpconversationAsyncsendV2Request.OA(); |
| | | oa.setMessageUrl(""); |
| | | OapiMessageCorpconversationAsyncsendV2Request.Head head = new OapiMessageCorpconversationAsyncsendV2Request.Head(); |
| | | head.setText(title); |
| | | head.setBgcolor("#279BAA"); |
| | | oa.setHead(head); |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Body body = new OapiMessageCorpconversationAsyncsendV2Request.Body(); |
| | | body.setTitle("å
¬å¡ç¨è½¦"); |
| | | List<OapiMessageCorpconversationAsyncsendV2Request.Form> formList = new ArrayList<>(); |
| | | |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form startDate = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | startDate.setKey("å¼å§æ¶é´"); |
| | | startDate.setValue(DateUtil.formatDate(carUseBook.getStartTime(),"MM-dd HH:mm")); |
| | | formList.add(startDate); |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form endDate = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | endDate.setKey("ç»ææ¶é´"); |
| | | endDate.setValue(DateUtil.formatDate(carUseBook.getEndTime(),"MM-dd HH:mm")); |
| | | formList.add(endDate); |
| | | |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form userNum = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | userNum.setKey("ä¹è½¦äººæ°"); |
| | | userNum.setValue(DateUtil.formatDate(carUseBook.getEndTime(),"MM-dd HH:mm")); |
| | | formList.add(userNum); |
| | | |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form inReason = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | inReason.setKey("æ¥è®¿äºç±"); |
| | | inReason.setValue(visits.getReason()); |
| | | formList.add(inReason); |
| | | |
| | | if(StringUtils.isNotBlank(visits.getCarNos())){ |
| | | OapiMessageCorpconversationAsyncsendV2Request.Form carNos = new OapiMessageCorpconversationAsyncsendV2Request.Form(); |
| | | carNos.setKey("é访车è¾"); |
| | | carNos.setValue(visits.getCarNos()); |
| | | formList.add(visitUser); |
| | | } |
| | | |
| | | body.setForm(formList); |
| | | oa.setBody(body); |
| | | msg.setOa(oa); |
| | | |
| | | return msg; |
| | | }*/ |
| | | |
| | | } |
| | |
| | | if(eventType.startsWith("org")){ |
| | | companyService.ddPushCompanyInfo(eventType,bizData); |
| | | }else if(eventType.startsWith("user")){ |
| | | |
| | | memberService.ddPushMemberInfo(eventType,bizData); |
| | | } |
| | | //å¤çäºä»¶ |
| | | // process(bizData); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.web.response; |
| | | |
| | | import com.doumee.dao.business.model.Member; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2023/12/7 11:19 |
| | | */ |
| | | @Data |
| | | public class DDAuthorizeVO { |
| | | |
| | | @ApiModelProperty(value = "ææ unionId ") |
| | | private String unionId; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·token") |
| | | private String token; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ä¿¡æ¯") |
| | | private Member member; |
| | | } |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.dao.web.response.DDAuthorizeVO; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | |
| | | import com.doumee.dao.web.reqeust.VisitMemberDTO; |
| | | import com.doumee.dao.web.response.MemberVO; |
| | | import com.doumee.dao.web.response.WxAuthorizeVO; |
| | | import com.taobao.api.ApiException; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | WxAuthorizeVO wxAuthorize(String code,Integer source); |
| | | |
| | | DDAuthorizeVO ddAuthorize(String code, Integer source) throws ApiException; |
| | | |
| | | |
| | | List<MemberVO> getVisitedMember(CheckVisitedDTO checkVisitedDTO); |
| | |
| | | List<Member> findDriveList(Member model); |
| | | |
| | | void initPinyinTool(); |
| | | |
| | | void syncDDUserInfo() throws ApiException; |
| | | |
| | | void ddPushMemberInfo(String eventType, shade.com.alibaba.fastjson2.JSONObject eventData) throws ApiException; |
| | | } |
| | |
| | | company.setCompanyNamePath(company.getName());//åç§°è·¯å¾ |
| | | company.setHkParentId(rootOrgId); |
| | | String idPath = ""; |
| | | if(StringUtils.isNotBlank(company.getErpParentId()) && !StringUtils.equals(company.getErpParentId(),Constants.ONE+"")){ |
| | | 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)){ |
| | |
| | | company.setHkParentId(parent.getHkId()); |
| | | company.setCompanyPath(parent.getCompanyPath()+company.getId()+"/"); |
| | | company.setCompanyNamePath(parent.getCompanyNamePath()+"/"+company.getName()); |
| | | company.setParentId(parent.getId()); |
| | | } |
| | | company.setHkCompanyPath(company.getCompanyNamePath()); |
| | | company.setCreateDate(new Date()); |
| | |
| | | public Company syncDDEditCompanyModel(OapiV2DepartmentGetResponse.DeptGetResponse deptGetResponse,Company company){ |
| | | company.setErpParentId(deptGetResponse.getParentId().toString()); |
| | | String idPath = ""; |
| | | if(StringUtils.isNotBlank(company.getErpParentId()) && !StringUtils.equals(company.getErpParentId(),Constants.ONE+"")){ |
| | | 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)){ |
| | |
| | | company.setHkParentId(parent.getHkId()); |
| | | company.setCompanyPath(parent.getCompanyPath()+company.getId()+"/"); |
| | | company.setCompanyNamePath(parent.getCompanyNamePath()+"/"+company.getName()); |
| | | company.setParentId(parent.getId()); |
| | | } |
| | | |
| | | company.setName(deptGetResponse.getName()); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dingtalk.api.response.OapiV2DepartmentGetResponse; |
| | | import com.dingtalk.api.response.OapiV2UserGetResponse; |
| | | import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.DataSyncConfig; |
| | | import com.doumee.core.annotation.excel.ExcelImporter; |
| | |
| | | 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.dao.web.response.DDAuthorizeVO; |
| | | import com.doumee.service.business.third.TmsService; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | |
| | | |
| | | private Member initAddMemberModel(Member member, LoginUserInfo loginUserInfo) { |
| | | Member insert= new Member(); |
| | | insert.setCreator(Objects.nonNull(loginUserInfo.getId())?loginUserInfo.getId():null); |
| | | insert.setCreator(Objects.nonNull(loginUserInfo)?loginUserInfo.getId():null); |
| | | insert.setCreateDate(new Date()); |
| | | insert.setEditor(Objects.nonNull(loginUserInfo.getId())?loginUserInfo.getId():null); |
| | | insert.setEditor(Objects.nonNull(loginUserInfo)?loginUserInfo.getId():null); |
| | | insert.setEditDate(new Date()); |
| | | insert.setHkOrgId(member.getHkOrgId()); |
| | | insert.setIsdeleted(Constants.ZERO); |
| | |
| | | insert.setCode(member.getCode()); |
| | | insert.setType(Constants.TWO); |
| | | insert.setHkDate(new Date()); |
| | | insert.setErpId(member.getErpId()); |
| | | insert.setWorkStatus(Constants.ZERO);//é»è®¤å¨è |
| | | insert.setCanVisit(Constants.ZERO);//é»è®¤ä¸å¯è®¿é® |
| | | insert.setAuthStatus(Constants.ZERO); |
| | |
| | | return wxAuthorizeVO; |
| | | } |
| | | |
| | | /** |
| | | * å¾®ä¿¡ææ å
é¨äººåç»å½ |
| | | * @param wxAuthorizeVO |
| | | * @param openId |
| | | * @param source |
| | | */ |
| | | private void dealSystemUserAuthBiz(WxAuthorizeVO wxAuthorizeVO, String openId, Integer source) { |
| | | SystemUser user = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getOpenid,openId) |
| | |
| | | wxAuthorizeVO.setToken(token); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ééææè·åå
é¨äººåç»å½ä¿¡æ¯ |
| | | * @param ddAuthorizeVO |
| | | * @param unionId |
| | | * @param source |
| | | */ |
| | | private void dealSystemUserAuthBizByDD(DDAuthorizeVO ddAuthorizeVO, String unionId, Integer source) { |
| | | SystemUser user = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getDdUnionId,unionId) |
| | | .in(SystemUser::getType,Constants.memberType.internal) |
| | | .eq(SystemUser::getDeleted,Constants.ZERO) |
| | | .last(" limit 1 ")); |
| | | //éè®¿å®¢ç¨æ· è¿è¡å¤ææ¯å¦åå¨ç¨æ· |
| | | if(!Objects.isNull(user)){ |
| | | Member member = memberMapper.selectById(user.getMemberId()); |
| | | if(member == null || member.getIsdeleted() == Constants.ONE){ |
| | | return; |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ç¨æ·å·²å é¤,请è系管çå"); |
| | | } |
| | | if(member.getStatus() != Constants.ZERO){ |
| | | return; |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ç¨æ·å·²ç¦ç¨,请è系管çå"); |
| | | } |
| | | if(StringUtils.isNotBlank(member.getIdcardNo())){ |
| | | member.setIdcardDecode(DESUtil.decrypt(Constants.EDS_PWD, member.getIdcardNo())); |
| | | } |
| | | String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | member.setPrefixUrl(prefixUrl); |
| | | ddAuthorizeVO.setMember(member); |
| | | //叿º ä¸ å
é¨äººå æä¾token |
| | | String token = systemLoginService.loginByUserId(user.getId()); |
| | | ddAuthorizeVO.setToken(token); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void dealDriverUserAuthBiz(WxAuthorizeVO wxAuthorizeVO, String openId, Integer source) { |
| | | SystemUser user = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getOpenid,openId) |
| | |
| | | /** |
| | | * 忥ééå
é¨åå·¥ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public void syncDDUserInfo() throws ApiException { |
| | | List<OapiV2UserGetResponse.UserGetResponse> list = dingTalk.syncAllUserInfo(); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | |
| | | |
| | | private Member syncDDAddMemberModel(OapiV2UserGetResponse.UserGetResponse deptGetResponse,Member member) { |
| | | member.setCreateDate(new Date()); |
| | | member.setErpId(deptGetResponse.getUserid()); |
| | | member.setErpId(deptGetResponse.getUnionid()); |
| | | member.setPhone(deptGetResponse.getMobile()); |
| | | member.setName(deptGetResponse.getName()); |
| | | member.setCode(deptGetResponse.getJobNumber()); |
| | |
| | | if(Objects.nonNull(deptIdList)){ |
| | | List<Company> companyList = companyMapper.selectList(new QueryWrapper<Company>().lambda().in(Company::getErpId,deptIdList) |
| | | .eq(Company::getType,Constants.ONE).eq(Company::getIsdeleted,Constants.ZERO) |
| | | .isNotNull(Company::getHkId) |
| | | // .isNotNull(Company::getHkId) ææ¶æ æ³åæ¥å¼èª å
注é |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(companyList)){ |
| | | member.setHkOrgId(companyList.get(Constants.ZERO).getHkId()); |
| | |
| | | |
| | | public Member syncDDEditMemberModel(OapiV2UserGetResponse.UserGetResponse deptGetResponse,Member updateMember) { |
| | | updateMember.setEditDate(new Date()); |
| | | updateMember.setErpId(deptGetResponse.getUserid()); |
| | | updateMember.setErpId(deptGetResponse.getUnionid()); |
| | | updateMember.setPhone(deptGetResponse.getMobile()); |
| | | updateMember.setName(deptGetResponse.getName()); |
| | | updateMember.setCode(deptGetResponse.getJobNumber()); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void ddPushMemberInfo(String eventType, shade.com.alibaba.fastjson2.JSONObject eventData) throws ApiException { |
| | | JSONArray jsonArray = eventData.getJSONArray("userId"); |
| | | if(jsonArray.isEmpty()){ |
| | |
| | | } |
| | | }else if(eventType.equals("user_add_org")||eventType.equals("user_modify_org")){ |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | OapiV2UserGetResponse.UserGetResponse userGetResponse = dingTalk.syncUserInfo(jsonArray.getString(i)); |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda() |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .eq(Member::getErpId,jsonArray.getLong(i)) |
| | | .eq(Member::getErpId,userGetResponse.getUnionid()) |
| | | .last(" limit 1") |
| | | ); |
| | | OapiV2UserGetResponse.UserGetResponse deptGetResponse = dingTalk.syncUserInfo(jsonArray.getString(i)); |
| | | if(Objects.isNull(member)){ |
| | | getAddMemberModel(deptGetResponse,member); |
| | | member = new Member(); |
| | | getAddMemberModel(userGetResponse,member); |
| | | }else{ |
| | | getUpdateMemberModel(deptGetResponse,member); |
| | | getUpdateMemberModel(userGetResponse,member); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ééææç»å½ |
| | | * @param code |
| | | * @param source |
| | | * @return |
| | | * @throws ApiException |
| | | */ |
| | | @Override |
| | | public DDAuthorizeVO ddAuthorize(String code, Integer source) throws ApiException { |
| | | if(StringUtils.isBlank(code)||Objects.isNull(source)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | OapiV2UserGetuserinfoResponse.UserGetByCodeResponse userGetByCodeResponse = dingTalk.getDDUserByCode(code); |
| | | if(Objects.isNull(userGetByCodeResponse) |
| | | || StringUtils.isBlank(userGetByCodeResponse.getUnionid())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ééææå¤±è´¥"); |
| | | } |
| | | String unionId = userGetByCodeResponse.getUnionid(); |
| | | |
| | | DDAuthorizeVO ddAuthorizeVO = new DDAuthorizeVO(); |
| | | if(StringUtils.isBlank(unionId)){ |
| | | return ddAuthorizeVO; |
| | | } |
| | | ddAuthorizeVO.setUnionId(unionId); |
| | | // if(source==1){ |
| | | // //å¤çæ®é访客人åèªå¨ææé»è¾ |
| | | // dealVisitUserAuthBiz(wxAuthorizeVO,openId,source); |
| | | // }else if(source == 3){ |
| | | // //å¤çtms管æ§äººåèªå¨ææé»è¾ |
| | | // dealGkUserAuthBiz(wxAuthorizeVO,openId,source); |
| | | // }else if(source == 0){ |
| | | // //妿æ¯å¸æºï¼åä»system_useræ¥è¯¢ |
| | | // dealDriverUserAuthBiz(wxAuthorizeVO,openId,source); |
| | | // }else{ |
| | | //妿æ¯å
é¨äººåï¼åä»system_useræ¥è¯¢ |
| | | dealSystemUserAuthBizByDD(ddAuthorizeVO,unionId,source); |
| | | // } |
| | | return ddAuthorizeVO; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | //æ£æ¥æ¯å¦å¿
é¡»çé¢ï¼å¹¶ä¸ç¬¦åçé¢è¦æ± |
| | | ProblemLog problemLog = isValidProblemLog(visits,source); |
| | | //è·åç³è¯·ç海康访é®é¨ç¦ç»ä¿¡æ¯ |
| | | getHkDeviceRoles(visits,isERP); |
| | | // getHkDeviceRoles(visits,isERP); |
| | | //æ£éªæè®¿äººæ¯å¦åæ³ |
| | | Member visitMember = isValideVisitedUser(visits.getReceptMemberId()); |
| | | if(StringUtils.isNotBlank(visits.getIdcardNo()) && Constants.equalsInteger(Constants.ZERO, visits.getIdcardType()) |
| | |
| | | //åå§åè®¿å®¢ä¿¡æ¯ |
| | | initVisitInfo(visits,date); |
| | | |
| | | // if(StringUtils.isNotBlank(visits.getFaceImg())&&(Constants.equalsInteger(visits.getType(),Constants.ZERO)|| Constants.equalsInteger(visits.getType(),Constants.TWO))){ |
| | | // //人è¸è¯å |
| | | // FacePictureCheckRequest param = new FacePictureCheckRequest(); |
| | | // String prefixUrl = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_LOCAL_RESOURCE_PATH).getCode() + |
| | | // systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode(); |
| | | // param.setFacePicUrl(prefixUrl + visits.getFaceImg()); |
| | | // BaseResponse<FacePictureCheckResponse> response = HKService.facePictureCheck(param); |
| | | // if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼äººè¸è¯åè·åæ°æ®å¤±è´¥~"); |
| | | // } |
| | | // FacePictureCheckResponse facePictureCheckResponse = response.getData(); |
| | | // if(Objects.isNull(facePictureCheckResponse) || Objects.isNull(facePictureCheckResponse.getCheckResult())){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼äººè¸è¯åè·åæ°æ®å¤±è´¥~"); |
| | | // } |
| | | // if(!facePictureCheckResponse.getCheckResult()){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), facePictureCheckResponse.getStatusMessage()); |
| | | // } |
| | | // } |
| | | visits.setSendTimeOutNotice(Constants.ZERO); |
| | | visitsMapper.insert(visits); |
| | | |
| | |
| | | List<Long> startTimeList = platformLogList.stream().filter(i->Objects.nonNull(i.getParam1())) |
| | | .filter(i->Objects.nonNull(i.getParam1())&&i.getParam1().indexOf(today)>=0) |
| | | .map(i->DateUtil.fromStringToDate("yyyy-MM-dd HH:mm:ss",i.getParam1()).getTime()).collect(Collectors.toList()); |
| | | Long startTime = Collections.min(startTimeList); |
| | | Long startTime = null ; |
| | | if(CollectionUtils.isNotEmpty(startTimeList)){ |
| | | startTime = Collections.min(startTimeList); |
| | | } |
| | | //è·åç»ææ¶é´ |
| | | List<Long> endTimeList = platformLogList.stream() |
| | | .filter(i->Objects.nonNull(i.getParam2())&&i.getParam2().indexOf(today)>=0) |
| | | .map(i->DateUtil.fromStringToDate("yyyy-MM-dd HH:mm:ss",i.getParam2()).getTime()).collect(Collectors.toList()); |
| | | Long endTime = Collections.max(endTimeList); |
| | | Long endTime = null ; |
| | | if(CollectionUtils.isNotEmpty(endTimeList)){ |
| | | endTime = Collections.max(endTimeList); |
| | | } |
| | | if(Objects.isNull(startTime) |
| | | || Objects.isNull(endTime) || (startTime>=endTime)){ |
| | | return BigDecimal.ZERO; |