已添加23个文件
已删除382个文件
已修改34个文件
已重命名1个文件
| | |
| | | VUE_APP_ROUTER_MODE = 'hash' |
| | | |
| | | # 项ç®ä¸ä¸æè·¯å¾ |
| | | VUE_APP_CONTEXT_PATH = './' |
| | | VUE_APP_CONTEXT_PATH = '/' |
| | | |
| | | # æ¥å£åç¼ |
| | | VUE_APP_API_PREFIX = '/nyx_admin' |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <html> |
| | | <title> é«éç«è¡æå¯å管çç³»ç» </title> |
| | | <body> |
| | | <div id="content">ss</div> |
| | | </body> |
| | | </html> |
| | | <script type="text/javascript"> |
| | | var ifr = document.createElement('iframe'); |
| | | ifr.style.display = 'none'; |
| | | var flag = getPlatform(); |
| | | if (flag == 1) { |
| | | android_download(); |
| | | } |
| | | if (flag == 2) { |
| | | ios_download(); |
| | | } |
| | | |
| | | |
| | | function getPlatform() { |
| | | var result = 0; |
| | | var url = window.location.search; |
| | | if (url.indexOf("?") != -1) { |
| | | result = url.substr(url.indexOf("=") + 1); |
| | | } |
| | | document.getElementById("content").innerHTML=result |
| | | return result; |
| | | } |
| | | |
| | | /*var ua = navigator.userAgent.split("(")[1].split(")")[0]; |
| | | document.getElementById("content").innerHTML=ua |
| | | var brand = ""; |
| | | var phone = [/IPHONE/gi, /huawei/gi, /mi/gi, /v1/gi, /OPPO/gi, /vivo/gi, /pcg/gi, /vivo/gi,]; |
| | | if (phone[0].test(ua)) { |
| | | brand = "iPhone"; |
| | | window.location.href = "https://apps.apple.com/cn/app/xxxxxxxxxx"; |
| | | } else if (phone[1].test(ua)) { |
| | | brand = "HUAWEI"; |
| | | ifr.src = 'appmarket://details?id=ä½ çåºç¨å
å'; |
| | | } else if (phone[2].test(ua)) { |
| | | brand = "å°ç±³"; |
| | | ifr.src = 'mimarket://details?id=ä½ çåºç¨å
å'; |
| | | } else if (phone[3].test(ua) || phone[5].test(ua) || phone[7].test(ua)) { |
| | | brand = "vivo"; |
| | | ifr.src = 'vivomarket://details?id=ä½ çåºç¨å
å'; |
| | | } else if (phone[4].test(ua) || phone[6].test(ua)) { |
| | | brand = "OPPO"; |
| | | ifr.src = 'oppomarket://details?packagename=ä½ çåºç¨å
å'; |
| | | } else { |
| | | brand = "Android"; |
| | | ifr.src = ''; |
| | | }*/ |
| | | function ios_download() { |
| | | window.location.href = "https://apps.apple.com/cn/app/xxxxxxx"; |
| | | } |
| | | function is_weixin() { |
| | | var ua = navigator.userAgent.toLowerCase(); |
| | | if (ua.match(/MicroMessenger/i) == "micromessenger") { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | function android_download() { |
| | | if (is_weixin()) { |
| | | ICEICE(".weixin_notice").style.display = "block"; |
| | | var url = window.location.href; |
| | | if (url.indexOf("source") <= 0) { |
| | | history.pushState("", "", url + "?source=1"); |
| | | } |
| | | } else { |
| | | if (ifr.src.indexOf('hgxx') > -1) { |
| | | document.body.appendChild(ifr); |
| | | |
| | | |
| | | setTimeout(function() { |
| | | if(ifr.src.indexOf('appmarket') > -1){ |
| | | window.location.href = "https://appstore.huawei.com/app/xxxxxxx"; |
| | | } else if(ifr.src.indexOf('mimarket') > -1){ |
| | | window.location.href = "http://app.mi.com/details?id=ä½ çåºç¨å
å&ref=search"; |
| | | }else { |
| | | window.location.href = "https://a.app.qq.com/o/simple.jsp?pkgname=ä½ çåºç¨å
å"; |
| | | } |
| | | },1000); |
| | | } else { |
| | | window.location.href = "https://a.app.qq.com/o/simple.jsp?pkgname=ä½ çåºç¨å
å"; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="çæ¬åç§°" prop="versionNum"> |
| | | <el-input v-model="form.title" placeholder="请è¾å
¥çæ¬åç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="çæ¬å·" prop="versionNum"> |
| | | <el-input v-model="form.versionNum" type="number" placeholder="请è¾å
¥çæ¬å·" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="çæ¬åç§°" prop="versionInfo"> |
| | | <el-input v-model="form.versionInfo" placeholder="请è¾å
¥çæ¬å·" v-trim/> |
| | | <el-form-item label="çæ¬å·æ¾ç¤ºåç§°" prop="versionInfo"> |
| | | <el-input v-model="form.versionInfo" placeholder="çæ¬å·æ¾ç¤ºåç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="å®è£
å
" prop="fileUrl"> |
| | | <div style="width: 100%; height: 1px;"></div> |
| | |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | export default { |
| | | name: 'OperaJkVersionWindow', |
| | | name: 'OperaAppversionWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/upload', |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/business/appVersion/uploadFile', |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | id: null, |
| | | title: '', |
| | | versionInfo: '', |
| | | fileUrl: '', |
| | | content: '', |
| | |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | | title: [ |
| | | { required: true, message: '请è¾å
¥çæ¬åç§°', trigger: 'blur' } |
| | | ], |
| | | versionNum: [ |
| | | { required: true, message: '请è¾å
¥çæ¬å·', trigger: 'blur' } |
| | | ], |
| | | versionInfo: [ |
| | | { required: true, message: '请è¾å
¥çæ¬åç§°', trigger: 'blur' } |
| | | { required: true, message: '请è¾å
¥çæ¬å·æ¾ç¤ºåç§°', trigger: 'blur' } |
| | | ], |
| | | fileUrl: [ |
| | | { required: true, message: '请ä¸ä¼ å®è£
å
', trigger: 'blur' } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | width="900px" |
| | | :withFooter="false" |
| | | > |
| | | <div class="driver-approval"> |
| | | <div class="section"> |
| | | <div class="section-header"> |
| | | <span class="section-title">叿ºä¿¡æ¯</span> |
| | | <div class="approval-status"> |
| | | <el-tag v-if="detailInfo.auditStatus === 0" type="warning" class="status-tag">å¾
å®¡æ ¸</el-tag> |
| | | </div> |
| | | </div> |
| | | <div class="info-grid"> |
| | | <div class="info-item"> |
| | | <span class="label">叿ºå§åï¼</span> |
| | | <span class="value">{{ detailInfo.name || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">ææææºå·ï¼</span> |
| | | <span class="value">{{ detailInfo.telephone || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">身份è¯å·ï¼</span> |
| | | <span class="value">{{ detailInfo.idcard || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">å©å§»æ
åµï¼</span> |
| | | <span class="value" v-if="detailInfo.maritalStatus === 3">丧å¶</span> |
| | | <span class="value" v-else-if="detailInfo.maritalStatus === 2">离å¼</span> |
| | | <span class="value" v-else-if="detailInfo.maritalStatus === 1">å·²å©</span> |
| | | <span class="value" v-else-if="detailInfo.maritalStatus === 0">æªå©</span> |
| | | <span class="value" v-else>-</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">æ§å«ï¼</span> |
| | | <span class="value">{{ detailInfo.gender === 1 ? 'ç·' : detailInfo.gender === 2 ? '女' : '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">ç°å±
ä½å°åï¼</span> |
| | | <span class="value">{{ detailInfo.livePlace || '-' }}</span> |
| | | </div> |
| | | <div class="info-item" v-if="detailInfo.auditStatus === 3 || detailInfo.auditStatus === 1" > |
| | | <span class="label">è¯çº§ï¼</span> |
| | | <span class="value" v-if="detailInfo.driverLevel ==5">S</span> |
| | | <span class="value" v-else-if="detailInfo.driverLevel ==4">A</span> |
| | | <span class="value" v-else-if="detailInfo.driverLevel ==3">B</span> |
| | | <span class="value" v-else-if="detailInfo.driverLevel ==2">C</span> |
| | | <span class="value" v-else-if="detailInfo.driverLevel ==1">D</span> |
| | | <span class="value" v-else>-</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">ç¶æï¼</span> |
| | | <span class="value">{{ detailInfo.status === 0 ? 'å¯ç¨' : 'ç¦ç¨' }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="section"> |
| | | <div class="section-header"> |
| | | <span class="section-title">车è¾ä¿¡æ¯</span> |
| | | </div> |
| | | <div class="info-grid"> |
| | | <div class="info-item"> |
| | | <span class="label">车çå·ï¼</span> |
| | | <span class="value">{{ detailInfo.carCode || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">车è¾ç±»åï¼</span> |
| | | <span class="value">{{ detailInfo.carTypeName || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">车è¾é¢è²ï¼</span> |
| | | <span class="value">{{ detailInfo.carColor || '-' }}</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">é©¾é©¶è¯æææï¼</span> |
| | | <span class="value">{{ detailInfo.cardStartDate || '-' }} è³ {{ detailInfo.cardEndDate || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="section"> |
| | | <div class="section-header"> |
| | | <span class="section-title">éä»¶ææ</span> |
| | | </div> |
| | | <div class="info-grid"> |
| | | <div class="info-item"> |
| | | <span class="label">èº«ä»½è¯æ£é¢ï¼</span> |
| | | <el-image |
| | | v-if="detailInfo.idcardImg" |
| | | style="width: 80px; height: 80px" |
| | | :src="detailInfo.imgPrefix + detailInfo.idcardImg" |
| | | :preview-src-list="[detailInfo.imgPrefix + detailInfo.idcardImg]" |
| | | fit="cover" |
| | | ></el-image> |
| | | <span v-else>-</span> |
| | | </div> |
| | | <div class="info-item"> |
| | | <span class="label">身份è¯åé¢ï¼</span> |
| | | <el-image |
| | | v-if="detailInfo.idcardImgBack" |
| | | style="width: 80px; height: 80px" |
| | | :src="detailInfo.imgPrefix + detailInfo.idcardImgBack" |
| | | :preview-src-list="[detailInfo.imgPrefix + detailInfo.idcardImgBack]" |
| | | fit="cover" |
| | | ></el-image> |
| | | <span v-else>-</span> |
| | | </div> |
| | | <div class="info-item full-width"> |
| | | <span class="label">车è¾ç
§çï¼</span> |
| | | <span v-if="!detailInfo.carImgList">-</span> |
| | | <div v-else class="image-list"> |
| | | <el-image |
| | | v-for="(img, index) in detailInfo.carImgList" |
| | | :key="index" |
| | | style="width: 80px; height: 80px; margin-right: 10px" |
| | | :src="img.fileurlFull" |
| | | :preview-src-list="detailInfo.carImgList.map(item => item.fileurlFull)" |
| | | fit="cover" |
| | | ></el-image> |
| | | </div> |
| | | </div> |
| | | <div class="info-item full-width"> |
| | | <span class="label">驾驶è¯ç
§çï¼</span> |
| | | <span v-if="!detailInfo.licenseImgList">-</span> |
| | | <div v-else class="image-list"> |
| | | <el-image |
| | | v-for="(img, index) in detailInfo.licenseImgList" |
| | | :key="index" |
| | | style="width: 80px; height: 80px; margin-right: 10px" |
| | | :src="img.fileurlFull" |
| | | :preview-src-list="detailInfo.licenseImgList.map(item => item.fileurlFull)" |
| | | fit="cover" |
| | | ></el-image> |
| | | </div> |
| | | </div> |
| | | <div class="info-item full-width"> |
| | | <span class="label">å
¶å®ææï¼</span> |
| | | <span v-if="!detailInfo.otherImgList">-</span> |
| | | <div v-else class="image-list"> |
| | | <el-image |
| | | v-for="(img, index) in detailInfo.otherImgList" |
| | | :key="index" |
| | | style="width: 80px; height: 80px; margin-right: 10px" |
| | | :src="img.fileurlFull" |
| | | :preview-src-list="detailInfo.otherImgList.map(item => item.fileurlFull)" |
| | | fit="cover" |
| | | ></el-image> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="approval-form" v-if="detailInfo.auditStatus === 0" > |
| | | <el-form ref="approvalForm" :model="approvalForm" :rules="approvalForm.auditStatus ===0?approvalRules:approvalRules1"> |
| | | <el-form-item label="审æ¹ç»æ" prop="auditStatus"> |
| | | <el-radio-group v-model="approvalForm.auditStatus" @change="changeRadio"> |
| | | <el-radio :label="0">éè¿</el-radio> |
| | | <el-radio :label="1">æç»</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="叿ºè¯çº§" prop="driverLevel" v-if="approvalForm.auditStatus ===0"> |
| | | <el-select v-model="approvalForm.driverLevel" placeholder="è¯·éæ©å¸æºè¯çº§" style="width: 300px"> |
| | | <el-option label="S" :value="5"></el-option> |
| | | <el-option label="A" :value="4"></el-option> |
| | | <el-option label="B" :value="3"></el-option> |
| | | <el-option label="C" :value="2"></el-option> |
| | | <el-option label="D" :value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å®¡æ¹æè§" prop="auditRemark" > |
| | | <el-input |
| | | type="textarea" |
| | | v-model="approvalForm.auditRemark" |
| | | placeholder="请è¾å
¥å®¡æ¹æè§" |
| | | :rows="3" |
| | | style="width: 400px" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="approval-buttons"> |
| | | <el-button @click="close">åæ¶</el-button> |
| | | <el-button type="primary" @click="handleConfirm" :loading="isWorking">ç¡®å®</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { getById, audit } from '@/api/business/driver' |
| | | export default { |
| | | name: 'OperaDriverApproval', |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | title: '叿ºå®¡æ ¸', |
| | | visible: false, |
| | | isWorking: false, |
| | | detailInfo: {}, |
| | | approvalForm: { |
| | | id: null, |
| | | auditStatus: 0, |
| | | driverLevel: '', |
| | | auditRemark: '' |
| | | }, |
| | | approvalRules: { |
| | | auditStatus: [{ required: true, message: 'è¯·éæ©å®¡æ¹ç»æ', trigger: 'change' }], |
| | | driverLevel: [{ required: true, message: 'è¯·éæ©å¸æºè¯çº§', trigger: 'change' }] |
| | | }, |
| | | approvalRules1: { |
| | | auditStatus: [{ required: true, message: 'è¯·éæ©å®¡æ¹ç»æ', trigger: 'change' }], |
| | | auditRemark: [{ required: true, message: '请è¾å
¥å®¡æ¹æè§', trigger: 'blur' }] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | changeRadio(){ |
| | | this.$refs.approvalForm.clearValidate() |
| | | }, |
| | | open (title, row) { |
| | | this.title = title |
| | | this.approvalForm = { |
| | | id: row.id, |
| | | auditStatus: 0, |
| | | driverLevel: '', |
| | | auditRemark: '' |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.approvalForm && this.$refs.approvalForm.clearValidate() |
| | | }) |
| | | getById(row.id).then(res => { |
| | | this.detailInfo = res |
| | | this.visible = true |
| | | }).catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | }, |
| | | close () { |
| | | this.visible = false |
| | | }, |
| | | handleConfirm () { |
| | | this.$refs.approvalForm.validate(valid => { |
| | | if (!valid) return |
| | | if (this.approvalForm.status === 2 && !this.approvalForm.remark) { |
| | | this.$message.warning('请è¾å
¥å®¡æ¹æè§') |
| | | return |
| | | } |
| | | this.isWorking = true |
| | | audit({ |
| | | id: this.approvalForm.id, |
| | | auditStatus: this.approvalForm.auditStatus, |
| | | driverLevel: this.approvalForm.driverLevel, |
| | | auditRemark: this.approvalForm.auditRemark |
| | | }).then(res => { |
| | | this.$tip.apiSuccess(res || 'å®¡æ ¸æå') |
| | | this.$emit('success', this.approvalForm) |
| | | this.visible = false |
| | | }).catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }).finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .driver-approval { |
| | | |
| | | } |
| | | .section { |
| | | margin-bottom: 25px; |
| | | } |
| | | .checkinfo { |
| | | align-items:start !important; |
| | | display: flex !important; |
| | | flex-direction: column !important; |
| | | background-color: rgb(254 242 242); |
| | | min-height: 100px; |
| | | margin-bottom: 30px; |
| | | padding: 20px; |
| | | } |
| | | .section-header { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 10px; |
| | | margin-bottom: 15px; |
| | | flex-wrap: wrap; |
| | | } |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | color: #303133; |
| | | padding-left: 10px; |
| | | border-left: 4px solid #2E68EC; |
| | | } |
| | | .approval-status { |
| | | margin-left: auto; |
| | | } |
| | | .status-tag { |
| | | font-size: 14px; |
| | | padding: 4px 12px; |
| | | } |
| | | .info-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(2, 1fr); |
| | | gap: 15px; |
| | | padding: 0 10px; |
| | | } |
| | | .info-item { |
| | | display: flex; |
| | | font-size: 14px; |
| | | } |
| | | .info-item.full-width { |
| | | grid-column: span 2; |
| | | } |
| | | .info-item .label { |
| | | color: #909399; |
| | | min-width: 110px; |
| | | } |
| | | .info-item .value { |
| | | color: #606266; |
| | | word-break: break-all; |
| | | } |
| | | .image-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | } |
| | | .approval-form { |
| | | padding: 20px; |
| | | background: #f5f7fa; |
| | | border-top: 1px solid #eee; |
| | | } |
| | | .approval-form /deep/ .el-form-item { |
| | | margin-bottom: 15px; |
| | | } |
| | | .approval-form /deep/ .el-form-item:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .approval-buttons { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | gap: 10px; |
| | | margin-top: 15px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:appversion:query']"> |
| | | <TableLayout :permissions="['business:appVersion:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="çæ¬å·" prop="versionInfo"> |
| | |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:appversion:create', 'business:appversion:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaAppversionWindow.open('æ°å»ºçæ¬')" icon="el-icon-plus" v-permissions="['business:appversion:create']">æ°å»º</el-button></li> |
| | | <ul class="toolbar" v-permissions="['business:appVersion:create', 'business:appVersion:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaAppversionWindow.open('æ°å»ºçæ¬')" icon="el-icon-plus" v-permissions="['business:appVersion:create']">æ°å»º</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column prop="title" label="çæ¬åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="versionNum" label="çæ¬å·" min-width="100px"></el-table-column> |
| | | <el-table-column prop="versionInfo" label="çæ¬åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="versionInfo" label="çæ¬å·æ¾ç¤ºåç§°" min-width="100px"></el-table-column> |
| | | <el-table-column label="å¹³å°ç±»å" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.type === 0">Android</span> |
| | |
| | | <span v-if="row.isForce === 1">æ¯</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createUserName" label="å建è
" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createDate" label="å建æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateTime" label="æè¿æ´æ°æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:appversion:update', 'business:appversion:delete'])" |
| | | v-if="containPermissions(['business:appVersion:update', 'business:appVersion:delete'])" |
| | | label="æä½" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaAppversionWindow.open('ç¼è¾çæ¬', row)" icon="el-icon-edit" v-permissions="['business:appversion:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:appversion:delete']">å é¤</el-button> |
| | | <el-button type="text" @click="$refs.operaAppversionWindow.open('ç¼è¾çæ¬', row)" icon="el-icon-edit" v-permissions="['business:appVersion:update']">ç¼è¾</el-button> |
| | | <el-button type="text" style="color: red" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:appVersion:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaAppversionWindow from '@/components/business/OperaAppversionWindow' |
| | | export default { |
| | | name: 'JkVersion', |
| | | name: 'appversion', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaAppversionWindow }, |
| | | data () { |
| | |
| | | </el-table-column> |
| | | <el-table-column label="æä½" min-width="100" fixed="right"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="handleDetail(row)">详æ
</el-button> |
| | | <el-button type="text" @click="handleEdit(row)">ç¼è¾</el-button> |
| | | <el-button type="text" @click="handleDetail(row)">叿ºè¯¦æ
</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | ></pagination> |
| | | </template> |
| | | <OperaDriverDetail ref="operaDriverDetail" /> |
| | | <OperaDriverEditWindow ref="operaDriverEditWindow" @success="handlePageChange" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaDriverDetail from '@/components/business/OperaDriverDetail' |
| | | import OperaDriverEditWindow from '@/components/business/OperaDriverEditWindow' |
| | | import { updateStatus, exportExcel } from '@/api/business/driver' |
| | | |
| | | export default { |
| | | name: 'DriverList', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaDriverDetail }, |
| | | components: { TableLayout, Pagination, OperaDriverDetail, OperaDriverEditWindow }, |
| | | data () { |
| | | return { |
| | | searchForm: { |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | handleEdit (row) { |
| | | this.$refs.operaDriverEditWindow.open('ç¼è¾é¨åº', row) |
| | | }, |
| | | handleDateChange (val) { |
| | | this.searchForm.startTime = val ? val[0] : '' |
| | | this.searchForm.endTime = val ? val[1] : '' |
| | |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartResolver; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.io.PrintWriter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * APPçæ¬ç®¡ç |
| | |
| | | return ApiResponse.success(appVersionService.findById(id)); |
| | | } |
| | | |
| | | @ApiOperation("ä¸ä¼ APPæä»¶") |
| | | @PostMapping(value = "/uploadFile", headers = "content-type=multipart/form-data") |
| | | public void uploadFile(HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | Map<String, Object> context = new HashMap<>(); |
| | | try { |
| | | CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(); |
| | | if (multipartResolver.isMultipart(request)) { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | Iterator<String> it = multipartRequest.getFileNames(); |
| | | while (it.hasNext()) { |
| | | MultipartFile file = multipartRequest.getFile(it.next()); |
| | | if (file != null && !file.isEmpty()) { |
| | | Map<String, Object> data = appVersionService.uploadFile(file); |
| | | context.put("success", true); |
| | | context.put("code", 200); |
| | | context.put("errno", 0); |
| | | context.put("data", data); |
| | | context.put("message", "è¯·æ±æå"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("application/json"); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print(com.alibaba.fastjson.JSONObject.toJSONString(context)); |
| | | out.flush(); |
| | | out.close(); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | context.put("code", 0); |
| | | context.put("message", "ä¸ä¼ 失败"); |
| | | } |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("application/json"); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print(com.alibaba.fastjson.JSONObject.toJSONString(context)); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.doumee.dao.business.model.DriverInfo; |
| | | import com.doumee.dao.dto.AuditDTO; |
| | | import com.doumee.dao.dto.ChangeStatusDTO; |
| | | import com.doumee.dao.dto.DriverVerifyRequest; |
| | | import com.doumee.service.business.DriverInfoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | return ApiResponse.success(driverInfoService.getDetail(id)); |
| | | } |
| | | |
| | | @ApiOperation("ä¿®æ¹å¸æºæ³¨åä¿¡æ¯") |
| | | @PostMapping("/updateDriverInfo") |
| | | @RequiresPermissions("business:driverInfo:update") |
| | | public ApiResponse updateDriverInfo(@RequestBody DriverVerifyRequest request) { |
| | | return ApiResponse.success(driverInfoService.updateDriverInfo(request)); |
| | | } |
| | | |
| | | @ApiOperation("审æ¹å¸æºå®å认è¯") |
| | | @PostMapping("/audit") |
| | | @RequiresPermissions("business:driverInfo:update") |
| | |
| | | import com.doumee.dao.business.model.ShopInfo; |
| | | import com.doumee.dao.dto.AuditDTO; |
| | | import com.doumee.dao.dto.ChangeStatusDTO; |
| | | import com.doumee.dao.dto.PrinterBindDTO; |
| | | import com.doumee.dao.dto.ResetPasswordDTO; |
| | | import com.doumee.dao.dto.ShopPrinterDTO; |
| | | import com.doumee.dao.dto.ShopUpdateDTO; |
| | | import com.doumee.dao.vo.ShopDetailVO; |
| | | import com.doumee.service.business.ShopInfoService; |
| | |
| | | return ApiResponse.success("ä¿®æ¹æå"); |
| | | } |
| | | |
| | | @ApiOperation("ç»å®æå°æº") |
| | | @PostMapping("/bindPrinter") |
| | | @ApiOperation("ç»´æ¤é¨åºæå°æºSN") |
| | | @PostMapping("/maintainPrinter") |
| | | @RequiresPermissions("business:shopInfo:update") |
| | | public ApiResponse bindPrinter(@RequestBody @javax.validation.Valid PrinterBindDTO dto) { |
| | | shopInfoService.bindPrinter(dto); |
| | | return ApiResponse.success("ç»å®æå"); |
| | | } |
| | | |
| | | @ApiOperation("è§£ç»æå°æº") |
| | | @PostMapping("/unbindPrinter/{shopId}") |
| | | @RequiresPermissions("business:shopInfo:update") |
| | | public ApiResponse unbindPrinter(@PathVariable Integer shopId) { |
| | | shopInfoService.unbindPrinter(shopId); |
| | | return ApiResponse.success("è§£ç»æå"); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æå°æºç¶æ") |
| | | @GetMapping("/printerStatus/{shopId}") |
| | | @RequiresPermissions("business:shopInfo:query") |
| | | public ApiResponse queryPrinterStatus(@PathVariable Integer shopId) { |
| | | return ApiResponse.success(shopInfoService.queryPrinterStatus(shopId)); |
| | | public ApiResponse maintainPrinter(@RequestBody ShopPrinterDTO dto) { |
| | | shopInfoService.maintainPrinterSn(dto); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | -- ============================================================ |
| | | -- 2026/04/28 APPçæ¬æä»¶è·¯å¾åå
¸ |
| | | -- 2026/04/30 APPçæ¬æä»¶ä¸ä¼ åå
¸é
ç½® |
| | | -- ============================================================ |
| | | INSERT INTO `system_dict_data` (`DICT_ID`, `CODE`, `LABEL`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `DELETED`) VALUES ((SELECT `id` FROM `system_dict` WHERE `code` = 'OSS'), '', 'APP_FILES', 'APPçæ¬æä»¶è·¯å¾', 0, 0, 1, NOW(), 0); |
| | | INSERT INTO `system_dict_data` (`DICT_ID`, `CODE`, `LABEL`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `DELETED`) VALUES ((SELECT `id` FROM `system_dict` WHERE `code` = 'OSS'), '', 'APP_FILES', 'APPçæ¬æä»¶åå¨è·¯å¾', 0, 0, 1, NOW(), 0); |
| | | INSERT INTO `system_dict_data` (`DICT_ID`, `CODE`, `LABEL`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `DELETED`) VALUES ((SELECT `id` FROM `system_dict` WHERE `code` = 'OSS'), '', 'APP_FILES_URL', 'APPçæ¬æä»¶è®¿é®è·¯å¾åç¼', 0, 0, 1, NOW(), 0); |
| | | |
| | | |
| | | -- ============================================================ |
| | |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `MODULE`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:printerInfo:query', 'æ¥è¯¢æå°æº', 'æå°æºä¿¡æ¯', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | |
| | | |
| | | |
| | | -- ============================================================ |
| | | -- 2026/04/28 è¯ç¨äºæå°æºéæï¼é¨åºè¡¨å¢å æå°æºSNåæ®µ |
| | | -- 2026/04/29 叿ºè¡¨å¢å æå
æ¨éå«ååæ®µ |
| | | -- ============================================================ |
| | | ALTER TABLE `shop_info` ADD COLUMN `PRINTER_SN` VARCHAR(64) DEFAULT NULL COMMENT 'è¯ç¨äºæå°æºSNç¼å·' AFTER `BUSINESS_TYPE`; |
| | | ALTER TABLE `driver_info` ADD COLUMN `JPUSH_ALIAS` VARCHAR(64) DEFAULT NULL COMMENT 'æå
æ¨éå«å' AFTER `AUDIT_REMARK`; |
| | | |
| | | |
| | | -- ============================================================ |
| | | -- 2026/04/28 è¯ç¨äºæå°æºé
ç½®åå
¸ï¼è´¦å·ä¿¡æ¯åç»æå¨ç»´æ¤CODEå¼ï¼ |
| | | -- 2026/04/28 è¯ç¨äºæå°æºé
ç½®åå
¸ |
| | | -- ============================================================ |
| | | INSERT INTO `system_dict` (`id`, `code`, `name`, `disabled`, `deleted`) VALUES (106, 'XPYUN_CONFIG', 'è¯ç¨äºé
ç½®', 0, 0); |
| | | INSERT INTO `system_dict_data` (`DICT_ID`, `CODE`, `LABEL`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `DELETED`) VALUES (106, '', 'XPYUN_USER', 'è¯ç¨äºå¼åè
ID', 0, 0, 1, NOW(), 0); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.Formatter; |
| | | |
| | | /** |
| | | * åç¨ç¾åå·¥å
·ç±» |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 9, 2019 |
| | | */ |
| | | public class HashSignUtil { |
| | | |
| | | /** |
| | | * åç¨ç¾å |
| | | * @param signSource - æºå符串 |
| | | * @return |
| | | */ |
| | | public static String sign(String signSource) { |
| | | String signature = ""; |
| | | try { |
| | | MessageDigest crypt = MessageDigest.getInstance("SHA-1"); |
| | | crypt.reset(); |
| | | crypt.update(signSource.getBytes("UTF-8")); |
| | | signature = byteToHex(crypt.digest()); |
| | | } |
| | | catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return signature; |
| | | } |
| | | |
| | | private static String byteToHex(final byte[] hash) { |
| | | Formatter formatter = new Formatter(); |
| | | for (byte b : hash) |
| | | { |
| | | formatter.format("%02x", b); |
| | | } |
| | | String result = formatter.toString(); |
| | | formatter.close(); |
| | | return result; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy; |
| | | |
| | | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.xyy.dto.RestRequest; |
| | | import com.doumee.core.constants.Constants; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * è¯ç¨äºå
Œ
±é
置类 |
| | | */ |
| | | @Component |
| | | public class XyyConfig { |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | /** |
| | | * çæéç¨ç请æ±å¤´ |
| | | */ |
| | | public void createRequestHeader(RestRequest request) { |
| | | String user = systemDictDataBiz.queryByCode(Constants.XPYUN_CONFIG, Constants.XPYUN_USER).getCode(); |
| | | String userKey = systemDictDataBiz.queryByCode(Constants.XPYUN_CONFIG, Constants.XPYUN_USER_KEY).getCode(); |
| | | request.setUser(user); |
| | | request.setTimestamp(System.currentTimeMillis() + ""); |
| | | request.setSign(HashSignUtil.sign(request.getUser() + userKey + request.getTimestamp())); |
| | | request.setDebug("0"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æ·»å æå°æºè¯·æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | @Data |
| | | public class AddPrinterRequest extends RestRequest { |
| | | |
| | | /** |
| | | * 请æ±é¡¹éå |
| | | */ |
| | | private AddPrinterRequestItem[] items; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æ·»å æå°æºè¯·æ±é¡¹ |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | @Data |
| | | public class AddPrinterRequestItem { |
| | | |
| | | /** |
| | | * æå°æºç¼å· |
| | | */ |
| | | private String sn; |
| | | /** |
| | | * æå°æºåç§° |
| | | */ |
| | | private String name; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å 餿尿ºè¯·æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | @Data |
| | | public class DelPrinterRequest extends RestRequest { |
| | | |
| | | /** |
| | | * æå°æºç¼å·éå |
| | | */ |
| | | private String[] snlist; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | /** |
| | | * 订åç¶æ |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 8, 2019 |
| | | */ |
| | | public enum OrderStatusType { |
| | | |
| | | /** |
| | | * å¤çä¸ |
| | | */ |
| | | Processing(0), |
| | | /** |
| | | * 宿 |
| | | */ |
| | | Completed(1), |
| | | /** |
| | | * 失败 |
| | | */ |
| | | Failed(2); |
| | | |
| | | private final int val; |
| | | |
| | | public int getVal() { |
| | | return val; |
| | | } |
| | | |
| | | OrderStatusType(int num) { |
| | | this.val = num; |
| | | } |
| | | |
| | | public static OrderStatusType getOrderStatusType(int val) { |
| | | for (OrderStatusType type : OrderStatusType.values()) { |
| | | if (type.getVal() == val) { |
| | | return type; |
| | | } |
| | | } |
| | | return Processing; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æå°æºæå°è¯·æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | @Data |
| | | public class PrintRequest extends RestRequest { |
| | | |
| | | /** |
| | | * æå°æºç¼å· |
| | | */ |
| | | private String sn; |
| | | |
| | | /** |
| | | * æå°å
容,ä¸è½è¶
è¿5000åè |
| | | */ |
| | | private String content; |
| | | |
| | | /** |
| | | * æå°ä»½æ°ï¼é»è®¤ä¸º1 |
| | | */ |
| | | private int copies = 1; |
| | | |
| | | /** |
| | | * æå°æ¨¡å¼ï¼é»è®¤ä¸º0 |
| | | */ |
| | | private int mode = 0; |
| | | |
| | | /** |
| | | * æ¯ä»æ¹å¼41~55ï¼æ¯ä»å® 微信 ... |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * æ¯ä»ä¸å¦59~61ï¼é款 å°è´¦ æ¶è´¹ |
| | | */ |
| | | private Integer payMode; |
| | | /** |
| | | * æ¯ä»éé¢ |
| | | */ |
| | | private Double money; |
| | | /** |
| | | * å£°é³ææ¾æ¨¡å¼ï¼0 ä¸ºåæ¶è®¢åæ¨¡å¼ï¼1 为é鳿¨¡å¼ï¼2 为æ¥åææ¾æ¨¡å¼ï¼é»è®¤ä¸º 2 æ¥åææ¾æ¨¡å¼ |
| | | */ |
| | | private Integer voice; |
| | | |
| | | /** |
| | | * æå°æ¥å£åè°å°åå¯¹åºæ è¯(åå¼èå´ [ 1 - 5 ] çæ´æ°)ï¼å¯¹äºweb管çåå° âåè½è®¾ç½®â èå设置çé¢çæå°æ¥å£åè°æ è¯ã |
| | | */ |
| | | private Integer backurlFlag; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | /** |
| | | * æå°æºè¯·æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | public class PrinterRequest extends RestRequest { |
| | | |
| | | /** |
| | | * æå°æºç¼å· |
| | | */ |
| | | private String sn; |
| | | |
| | | public String getSn() { |
| | | return sn; |
| | | } |
| | | |
| | | public void setSn(String sn) { |
| | | this.sn = sn; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | /** |
| | | * æå°æºç¶æ |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 8, 2019 |
| | | */ |
| | | public enum PrinterStatusType { |
| | | |
| | | /** |
| | | * 离线 |
| | | */ |
| | | Offline(0), |
| | | /** |
| | | * å¨çº¿æ£å¸¸ |
| | | */ |
| | | OnlinNormal(1), |
| | | /** |
| | | * å¨çº¿ç¼ºçº¸ |
| | | */ |
| | | OnlineMissingPaper(2); |
| | | |
| | | private final int val; |
| | | |
| | | public int getVal() { |
| | | return val; |
| | | } |
| | | |
| | | private PrinterStatusType(int num) { |
| | | this.val = num; |
| | | } |
| | | |
| | | public static PrinterStatusType getPrinterStatusType(int val) { |
| | | for (PrinterStatusType type : PrinterStatusType.values()) { |
| | | if (type.getVal() == val) { |
| | | return type; |
| | | } |
| | | } |
| | | return Offline; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author LylJavas |
| | | * @create 2021/4/14 18:01 |
| | | * @description æ¹éæå°æºè¯·æ±åæ° |
| | | */ |
| | | public class PrintersRequest extends RestRequest { |
| | | |
| | | /** |
| | | * æå°æºç¼å·å表 |
| | | */ |
| | | private List<String> snlist; |
| | | |
| | | public List<String> getSnlist() { |
| | | return snlist; |
| | | } |
| | | |
| | | public void setSnlist(List<String> snlist) { |
| | | this.snlist = snlist; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¢åç¶æè¯·æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | public class QueryOrderStateRequest extends RestRequest { |
| | | |
| | | /** |
| | | * 订åç¼å· |
| | | */ |
| | | private String orderId; |
| | | |
| | | public String getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¢åç»è®¡è¯·æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | public class QueryOrderStatisRequest extends RestRequest { |
| | | |
| | | /** |
| | | * æå°æºç¼å· |
| | | */ |
| | | private String sn; |
| | | /** |
| | | * æ¥è¯¢æ¥æï¼æ ¼å¼YY-MM-DDï¼å¦ï¼2016-09-20 |
| | | */ |
| | | private String date; |
| | | |
| | | public String getSn() { |
| | | return sn; |
| | | } |
| | | |
| | | public void setSn(String sn) { |
| | | this.sn = sn; |
| | | } |
| | | |
| | | public String getDate() { |
| | | return date; |
| | | } |
| | | |
| | | public void setDate(String date) { |
| | | this.date = date; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | /** |
| | | * 请æ±å
Œ
±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | public class RestRequest { |
| | | |
| | | /** |
| | | * è¯ç¨äºåå°æ³¨åç¨æ·å |
| | | */ |
| | | private String user; |
| | | /** |
| | | * å½åUNIXæ¶é´æ³ï¼10ä½ï¼ç²¾ç¡®å°ç§ |
| | | */ |
| | | private String timestamp; |
| | | /** |
| | | * 坹忰 user + UKEY + timestamp æ¼æ¥åï¼+å·è¡¨ç¤ºè¿æ¥ç¬¦ï¼è¿è¡SHA1å å¯å¾å°ç¾åï¼å¼ä¸º40ä½å°åå符串 |
| | | */ |
| | | private String sign; |
| | | /** |
| | | * debug=1è¿åéjsonæ ¼å¼çæ°æ®ãä»
æµè¯æ¶åä½¿ç¨ |
| | | */ |
| | | private String debug; |
| | | |
| | | public String getUser() { |
| | | return user; |
| | | } |
| | | |
| | | public void setUser(String user) { |
| | | this.user = user; |
| | | } |
| | | |
| | | public String getTimestamp() { |
| | | return timestamp; |
| | | } |
| | | |
| | | public void setTimestamp(String timestamp) { |
| | | this.timestamp = timestamp; |
| | | } |
| | | |
| | | public String getSign() { |
| | | return sign; |
| | | } |
| | | |
| | | public void setSign(String sign) { |
| | | this.sign = sign; |
| | | } |
| | | |
| | | public String getDebug() { |
| | | return debug; |
| | | } |
| | | |
| | | public void setDebug(String debug) { |
| | | this.debug = debug; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | |
| | | /** |
| | | * 设置æå°æºè¯é³ç±»å请æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | public class SetVoiceTypeRequest extends RestRequest { |
| | | |
| | | /** |
| | | * æå°æºç¼å· |
| | | */ |
| | | private String sn; |
| | | |
| | | /** |
| | | * 声é³ç±»åï¼ 0ç人è¯é³ï¼å¤§ï¼ 1ç人è¯é³ï¼ä¸ï¼ 2ç人è¯é³ï¼å°ï¼ 3 åå声 4 éé³ |
| | | */ |
| | | private Integer voiceType; |
| | | |
| | | public String getSn() { |
| | | return sn; |
| | | } |
| | | |
| | | public void setSn(String sn) { |
| | | this.sn = sn; |
| | | } |
| | | |
| | | public Integer getVoiceType() { |
| | | return voiceType; |
| | | } |
| | | |
| | | public void setVoiceType(Integer voiceType) { |
| | | this.voiceType = voiceType; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | |
| | | /** |
| | | * ä¿®æ¹æå°æºè¯·æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | public class UpdPrinterRequest extends RestRequest { |
| | | |
| | | /** |
| | | * æå°æºç¼å· |
| | | */ |
| | | private String sn; |
| | | /** |
| | | * æå°æºåç§° |
| | | */ |
| | | private String name; |
| | | /** |
| | | * æå°æºè¯å«ç |
| | | */ |
| | | private String idcode; |
| | | /** |
| | | * æµéå¡å·ç |
| | | */ |
| | | private String cardno; |
| | | |
| | | public String getSn() { |
| | | return sn; |
| | | } |
| | | |
| | | public void setSn(String sn) { |
| | | this.sn = sn; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getIdcode() { |
| | | return idcode; |
| | | } |
| | | |
| | | public void setIdcode(String idcode) { |
| | | this.idcode = idcode; |
| | | } |
| | | |
| | | public String getCardno() { |
| | | return cardno; |
| | | } |
| | | |
| | | public void setCardno(String cardno) { |
| | | this.cardno = cardno; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.dto; |
| | | |
| | | |
| | | /** |
| | | * äºååææ¾è¯é³è¯·æ±åæ° |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 5, 2020 |
| | | */ |
| | | public class VoiceRequest extends RestRequest { |
| | | |
| | | /** |
| | | * æå°æºç¼å· |
| | | */ |
| | | private String sn; |
| | | |
| | | /** |
| | | * æ¯ä»æ¹å¼41~55ï¼æ¯ä»å® 微信 ... |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * æ¯ä»ä¸å¦59~61ï¼é款 å°è´¦ æ¶è´¹ |
| | | */ |
| | | private Integer payMode; |
| | | /** |
| | | * æ¯ä»éé¢ |
| | | */ |
| | | private Double money; |
| | | |
| | | public String getSn() { |
| | | return sn; |
| | | } |
| | | |
| | | public void setSn(String sn) { |
| | | this.sn = sn; |
| | | } |
| | | |
| | | public Integer getPayType() { |
| | | return payType; |
| | | } |
| | | |
| | | public void setPayType(Integer payType) { |
| | | this.payType = payType; |
| | | } |
| | | |
| | | public Integer getPayMode() { |
| | | return payMode; |
| | | } |
| | | |
| | | public void setPayMode(Integer payMode) { |
| | | this.payMode = payMode; |
| | | } |
| | | |
| | | public Double getMoney() { |
| | | return money; |
| | | } |
| | | |
| | | public void setMoney(Double money) { |
| | | this.money = money; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * è¿åå
Œ
±åæ° |
| | | * |
| | | * @param <T> |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | @Data |
| | | public class ObjectRestResponse<T> { |
| | | |
| | | public static final String REST_RESPONSE_OK = "ok"; |
| | | |
| | | /** |
| | | * è¿åç ï¼æ£ç¡®è¿å0ï¼ã注æï¼ç»ææ£ç¡®ä¸å¦çå¤æè¯·ç¨æ¤è¿ååæ°ãï¼é误è¿åéé¶ |
| | | */ |
| | | private int code; |
| | | /** |
| | | * ç»ææç¤ºä¿¡æ¯ï¼æ£ç¡®è¿åâokâï¼å¦ææé误ï¼è¿åéè¯¯ä¿¡æ¯ |
| | | */ |
| | | private String msg; |
| | | /** |
| | | * æ°æ®ç±»ååå
容详çç§æè¿ååæ°dataï¼å¦ææé误ï¼è¿ånull |
| | | */ |
| | | private T data; |
| | | /** |
| | | * æå¡å¨ç¨åºæ§è¡æ¶é´ï¼åä½ï¼æ¯«ç§ |
| | | */ |
| | | private long serverExecutedTime; |
| | | |
| | | public ObjectRestResponse() { |
| | | this.setCode(0); |
| | | this.setMsg(REST_RESPONSE_OK); |
| | | } |
| | | |
| | | public ObjectRestResponse code(int code) { |
| | | this.setCode(code); |
| | | return this; |
| | | } |
| | | |
| | | public ObjectRestResponse data(T data) { |
| | | this.setData(data); |
| | | return this; |
| | | } |
| | | |
| | | public ObjectRestResponse msg(String msg) { |
| | | this.setMsg(msg); |
| | | return this; |
| | | } |
| | | |
| | | public ObjectRestResponse setResult(int code, T data) { |
| | | this.setCode(code); |
| | | this.setData(data); |
| | | return this; |
| | | } |
| | | |
| | | public ObjectRestResponse setResult(int code, T data, String msg) { |
| | | this.setCode(code); |
| | | this.setData(data); |
| | | this.setMsg(msg); |
| | | return this; |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.vo; |
| | | |
| | | |
| | | /** |
| | | * 订åç»è®¡ç»æ |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | public class OrderStatisResult { |
| | | |
| | | /** |
| | | * å·²æå°è®¢åæ° |
| | | */ |
| | | private int printed; |
| | | /** |
| | | * çå¾
æå°è®¢åæ° |
| | | */ |
| | | private int waiting; |
| | | |
| | | public int getPrinted() { |
| | | return printed; |
| | | } |
| | | |
| | | public void setPrinted(int printed) { |
| | | this.printed = printed; |
| | | } |
| | | |
| | | public int getWaiting() { |
| | | return waiting; |
| | | } |
| | | |
| | | public void setWaiting(int waiting) { |
| | | this.waiting = waiting; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.config.xyy.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¹éæ·»å æå 餿尿ºç»æ |
| | | * |
| | | * @author RabyGao |
| | | * @date Aug 7, 2019 |
| | | */ |
| | | @Data |
| | | public class PrinterResult { |
| | | |
| | | public PrinterResult() { |
| | | success = new ArrayList<>(); |
| | | fail = new ArrayList<>(); |
| | | failMsg=new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | | * æåçæå°æºç¼å·éå |
| | | */ |
| | | private List<String> success; |
| | | |
| | | /** |
| | | * 失败çæå°æºç¼å·éå |
| | | */ |
| | | private List<String> fail; |
| | | /** |
| | | * 失败åå éå 设å¤ç¼å·ï¼å¤±è´¥åå |
| | | */ |
| | | private List<String> failMsg ; |
| | | |
| | | } |
| | |
| | | public static final String BANNER_FILES = "BANNER_FILES"; |
| | | public static final String ORDERS_FILES = "ORDERS_FILES"; |
| | | public static final String APP_FILES = "APP_FILES"; |
| | | public static final String APP_FILES_URL = "APP_FILES_URL"; |
| | | |
| | | // è¿è¥é
ç½® |
| | | public static final String OPERATION_CONFIG = "OPERATION_CONFIG"; |
| | |
| | | @TableField(exist = false) |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty(value = "APPæä»¶å
¨è·¯å¾") |
| | | @TableField(exist = false) |
| | | private String fileFullUrl; |
| | | |
| | | } |
| | |
| | | private Long memberAmount; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "驾驶车è¾ç±»åï¼ æºå¨è½¦ = driving éæºå¨è½¦ = bicycling") |
| | | private String driverType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å¾çåç¼å°å") |
| | | private String imgPrefix; |
| | | |
| | |
| | | @ApiModelProperty(value = "审æ¹äººåç§°") |
| | | private String auditUserName; |
| | | |
| | | @ApiModelProperty(value = "æå
æ¨éå«å") |
| | | private String jpushAlias; |
| | | |
| | | } |
| | |
| | | @ApiModel("叿ºå®å认è¯è¯·æ±ç±»") |
| | | public class DriverVerifyRequest implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "叿ºä¸»é®ï¼ç®¡çç«¯ä¿®æ¹æ¶å¿
ä¼ ï¼") |
| | | private Integer id; |
| | | |
| | | @NotEmpty(message = "å§åä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "å§å", required = true) |
| | | private String name; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("é¨åºæå°æºç»´æ¤è¯·æ±") |
| | | public class ShopPrinterDTO { |
| | | |
| | | @ApiModelProperty(value = "é¨åºä¸»é®", required = true) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "æå°æºSNç¼å·ï¼ä¸ä¼ å为å é¤ï¼") |
| | | private String printerSn; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "叿ºå®çº§ï¼5=S 4=A 3=B 2=C 1=D") |
| | | private Integer driverLevel; |
| | | |
| | | @ApiModelProperty(value = "驾驶车è¾ç±»åï¼ æºå¨è½¦ = driving éæºå¨è½¦ = bicycling") |
| | | private String driverType; |
| | | |
| | | |
| | | @ApiModelProperty(value = "叿ºå®çº§åç§°ï¼S/A/B/C/D") |
| | | private String driverLevelName; |
| | | |
| | |
| | | @ApiModelProperty(value = "叿ºå®æå¾ç") |
| | | private List<String> driverDoneImages; |
| | | |
| | | @ApiModelProperty(value = "é¨åºå
¥åºå¾ç") |
| | | @ApiModelProperty(value = "åä»¶é¨åºå
¥åºå¾ç") |
| | | private List<String> storeInImages; |
| | | |
| | | @ApiModelProperty(value = "é¨åºåºåºå¾ç") |
| | |
| | | |
| | | @ApiModelProperty(value = "é¨åºç»åº¦") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty(value = "é¨åºèç³»çµè¯") |
| | | private String linkPhone; |
| | | } |
| | |
| | | import com.doumee.dao.business.model.AppVersion; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * APPçæ¬Serviceå®ä¹ |
| | |
| | | */ |
| | | AppVersion getLatestVersion(Integer type); |
| | | |
| | | /** |
| | | * ä¸ä¼ æä»¶å°æå¡å¨æ¬å°ç®å½ |
| | | * |
| | | * @param file æä»¶ |
| | | * @param folder æä»¶å¤¹å |
| | | * @return æä»¶ä¿¡æ¯ |
| | | */ |
| | | Map<String, Object> uploadFile(org.springframework.web.multipart.MultipartFile file) throws Exception; |
| | | |
| | | } |
| | |
| | | */ |
| | | Areas getOpenedCityByName(String cityName); |
| | | |
| | | Areas getOpenedCityByCode(String code); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¶æ |
| | | * |
| | |
| | | DriverInfo getDetail(Integer id); |
| | | |
| | | /** |
| | | * 管ç端修æ¹å¸æºæ³¨åä¿¡æ¯ï¼å«éä»¶ï¼ |
| | | * |
| | | * @param id 叿ºä¸»é® |
| | | * @param request ä¿®æ¹è¯·æ± |
| | | * @return æ´æ°åç叿ºè¯¦æ
ï¼å«éä»¶ï¼ |
| | | */ |
| | | DriverInfo updateDriverInfo(DriverVerifyRequest request); |
| | | |
| | | /** |
| | | * ä¿®æ¹å¸æºç¶æï¼å¯ç¨/ç¦ç¨ï¼ |
| | | * |
| | | * @param dto ä¿®æ¹ç¶æè¯·æ± |
| | |
| | | */ |
| | | boolean checkDriverToken(String token); |
| | | |
| | | /** |
| | | * 注åæå
æ¨éå«å |
| | | */ |
| | | void registerJpushAlias(Integer driverId, String jpushAlias); |
| | | |
| | | } |
| | |
| | | */ |
| | | int autoCompleteOrders(); |
| | | |
| | | /** |
| | | * æå°è®¢åæ ç¾ |
| | | */ |
| | | void printOrderLabel(Integer orderId, Integer shopId); |
| | | |
| | | } |
| | |
| | | void changePassword(Integer shopId, String oldPassword, String newPassword, String token); |
| | | |
| | | /** |
| | | * ç»å®æå°æº |
| | | * ç»´æ¤é¨åºæå°æºSN |
| | | * @param dto é¨åºæå°æºç»´æ¤è¯·æ± |
| | | */ |
| | | void bindPrinter(com.doumee.dao.dto.PrinterBindDTO dto); |
| | | |
| | | /** |
| | | * è§£ç»æå°æº |
| | | */ |
| | | void unbindPrinter(Integer shopId); |
| | | |
| | | /** |
| | | * æ¥è¯¢æå°æºç¶æ |
| | | */ |
| | | Object queryPrinterStatus(Integer shopId); |
| | | void maintainPrinterSn(ShopPrinterDTO dto); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.AppVersionMapper; |
| | | import com.doumee.dao.business.model.AppVersion; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.io.File; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * APPçæ¬Serviceå®ç° |
| | |
| | | @Autowired |
| | | private AppVersionMapper appVersionMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Override |
| | | public Integer create(AppVersion appVersion) { |
| | | if (StringUtils.isBlank(appVersion.getVersionInfo()) |
| | | || StringUtils.isBlank(appVersion.getFileUrl()) |
| | | || StringUtils.isBlank(appVersion.getName()) |
| | | || StringUtils.isBlank(appVersion.getContent()) |
| | | || StringUtils.isBlank(appVersion.getTitle()) |
| | | || Objects.isNull(appVersion.getIsForce()) |
| | | || Objects.isNull(appVersion.getType()) |
| | | || Objects.isNull(appVersion.getFileSize()) |
| | |
| | | wrapper.eq(AppVersion::getType, model.getType()); |
| | | } |
| | | wrapper.orderByDesc(AppVersion::getId); |
| | | return PageData.from(appVersionMapper.selectJoinPage(page, AppVersion.class, wrapper)); |
| | | PageData<AppVersion> pageData = PageData.from(appVersionMapper.selectJoinPage(page, AppVersion.class, wrapper)); |
| | | String urlPrefix = systemDictDataBiz.queryByCode(Constants.OSS, Constants.APP_FILES_URL).getCode(); |
| | | for (AppVersion vo : pageData.getRecords()) { |
| | | if (StringUtils.isNotBlank(vo.getFileUrl())) { |
| | | vo.setFileFullUrl(urlPrefix + vo.getFileUrl()); |
| | | } |
| | | } |
| | | return pageData; |
| | | } |
| | | |
| | | @Override |
| | |
| | | return appVersionMapper.selectOne(qw); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> uploadFile(MultipartFile file) throws Exception { |
| | | if (file == null || file.isEmpty()) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "ä¸ä¼ æä»¶ä¸è½ä¸ºç©º"); |
| | | } |
| | | String rootPath = systemDictDataBiz.queryByCode(Constants.OSS, Constants.APP_FILES).getCode(); |
| | | String urlPrefix = systemDictDataBiz.queryByCode(Constants.OSS, Constants.APP_FILES_URL).getCode(); |
| | | String originName = file.getOriginalFilename(); |
| | | String ext = ".apk"; |
| | | if (originName != null && originName.indexOf(".") > 0) { |
| | | ext = originName.substring(originName.lastIndexOf(".")); |
| | | } |
| | | String fileName = UUID.randomUUID() + ext; |
| | | File dest = new File(rootPath + fileName); |
| | | if (!dest.getParentFile().exists()) { |
| | | dest.getParentFile().mkdirs(); |
| | | } |
| | | try { |
| | | file.transferTo(dest); |
| | | } catch (Exception e) { |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "æä»¶ä¸ä¼ 失败: " + e.getMessage()); |
| | | } |
| | | Map<String, Object> data = new HashMap<>(); |
| | | data.put("url", urlPrefix + fileName); |
| | | data.put("imgaddr", fileName); |
| | | data.put("imgname", fileName); |
| | | data.put("originname", originName); |
| | | return data; |
| | | } |
| | | |
| | | } |
| | |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Areas getOpenedCityByName(String cityName) { |
| | | if (StringUtils.isBlank(cityName)) { |
| | |
| | | return areasMapper.selectOne(qw); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Areas getOpenedCityByCode(String code) { |
| | | if (StringUtils.isBlank(code)) { |
| | | return null; |
| | | } |
| | | Areas areas = areasMapper.selectById(code); |
| | | if(Objects.isNull(areas)||Objects.isNull(areas.getParentId())){ |
| | | return null; |
| | | } |
| | | Areas city = areasMapper.selectById(areas.getParentId()); |
| | | if(Objects.isNull(city)||Constants.equalsInteger(city.getIsdeleted(),Constants.ONE)|| |
| | | Constants.equalsInteger(city.getStatus(),Constants.ZERO)){ |
| | | return null; |
| | | } |
| | | return city; |
| | | } |
| | | |
| | | @Override |
| | | public void updateStatus(Areas areas) { |
| | | if (areas == null || areas.getId() == null) { |
| | |
| | | driverInfo.setMemberId(member.getId()); |
| | | driverInfo.setStatus(Constants.ZERO); |
| | | driverInfo.setAuditStatus(99); |
| | | driverInfo.setJpushAlias(org.springframework.util.DigestUtils.md5DigestAsHex(telephone.getBytes())); |
| | | driverInfoMapper.insert(driverInfo); |
| | | } |
| | | |
| | |
| | | if (Objects.nonNull(category)) { |
| | | driverInfo.setCarTypeName(category.getName()); |
| | | driverInfo.setNeedLicense(Constants.equalsInteger(Integer.valueOf(category.getOtherField()), Constants.ONE) ? Constants.ONE : Constants.ZERO); |
| | | driverInfo.setDriverType(category.getDetail()); |
| | | } |
| | | } |
| | | // æ¥è¯¢çå¸åºä¿¡æ¯ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DriverInfo updateDriverInfo(DriverVerifyRequest request) { |
| | | Integer id = request.getId(); |
| | | if (id == null) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "叿ºä¸»é®ä¸è½ä¸ºç©º"); |
| | | } |
| | | DriverInfo driverInfo = driverInfoMapper.selectById(id); |
| | | if (Objects.isNull(driverInfo) || Constants.equalsInteger(driverInfo.getDeleted(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Date now = new Date(); |
| | | driverInfoMapper.update(new UpdateWrapper<DriverInfo>().lambda() |
| | | .set(DriverInfo::getName, request.getName()) |
| | | .set(DriverInfo::getIdcard, request.getIdcard()) |
| | | .set(DriverInfo::getMaritalStatus, request.getMaritalStatus()) |
| | | .set(DriverInfo::getAreaId, request.getAreaId()) |
| | | .set(DriverInfo::getLivePlace, request.getLivePlace()) |
| | | .set(DriverInfo::getCarCode, request.getCarCode()) |
| | | .set(DriverInfo::getCarType, request.getCarType()) |
| | | .set(DriverInfo::getCarColor, request.getCarColor()) |
| | | .set(DriverInfo::getCardStartDate, request.getCardStartDate()) |
| | | .set(DriverInfo::getCardEndDate, request.getCardEndDate()) |
| | | .set(DriverInfo::getIdcardImg, request.getIdcardImg()) |
| | | .set(DriverInfo::getIdcardImgBack, request.getIdcardImgBack()) |
| | | .set(DriverInfo::getAliAccount, request.getAliAccount()) |
| | | .set(DriverInfo::getAliName, request.getAliName()) |
| | | .set(DriverInfo::getUpdateTime, now) |
| | | .eq(DriverInfo::getId, id)); |
| | | |
| | | // å 餿§çç
§çè®°å½å¹¶ä¿åæ°ç |
| | | multifileMapper.delete(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId, id) |
| | | .in(Multifile::getObjType, |
| | | Constants.FileType.DRIVER_CAR.getKey(), |
| | | Constants.FileType.DRIVER_LICENSE.getKey(), |
| | | Constants.FileType.DRIVER_OTHER.getKey())); |
| | | if (!CollectionUtils.isEmpty(request.getCarImgUrls())) { |
| | | saveMultifileList(id, Constants.FileType.DRIVER_CAR.getKey(), request.getCarImgUrls(), now); |
| | | } |
| | | if (!CollectionUtils.isEmpty(request.getLicenseImgUrls())) { |
| | | saveMultifileList(id, Constants.FileType.DRIVER_LICENSE.getKey(), request.getLicenseImgUrls(), now); |
| | | } |
| | | if (!CollectionUtils.isEmpty(request.getOtherImgUrls())) { |
| | | saveMultifileList(id, Constants.FileType.DRIVER_OTHER.getKey(), request.getOtherImgUrls(), now); |
| | | } |
| | | |
| | | return getDetail(id); |
| | | } |
| | | |
| | | @Override |
| | | public void changeStatus(ChangeStatusDTO dto) { |
| | | if (dto.getId() == null) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "主é®ä¸è½ä¸ºç©º"); |
| | |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.MEMBER_FILES).getCode(); |
| | | vo.setFullImgUrl(imgPrefix + driver.getImgurl()); |
| | | } |
| | | |
| | | Category category = categoryMapper.selectById(driver.getCarType()); |
| | | if(Objects.nonNull(category)&&StringUtils.isNotBlank(category.getDetail())){ |
| | | vo.setDriverType(category.getDetail()); |
| | | } |
| | | // 仿¥é¢è®¡ä½£éï¼ä»æ¥æ¥åç叿ºä½£é + å¹³å°å¥å±é |
| | | Date now = new Date(); |
| | | Calendar cal = Calendar.getInstance(); |
| | |
| | | .select("s1.address", Orders::getDepositShopAddress) |
| | | .select("s2.name", Orders::getTakeShopName) |
| | | .select("s2.address", Orders::getTakeShopAddress) |
| | | .select("s1.link_phone", Orders::getDepositShopLinkPhone) |
| | | .select("s2.link_phone as takeShopLinkPhone") |
| | | .select("c2.other_field as c2OtherField") |
| | | .select("c2.name as goodLevelName") |
| | | .select("IF(EXISTS(SELECT 1 FROM orders_detail od JOIN category c3 ON c3.id = od.LUGGAGE_ID AND c3.TYPE = 4 AND c3.OTHER_FIELD = '1' WHERE od.ORDER_ID = t.ID AND od.DELETED = 0), 1, 0) as hasOversized") |
| | | .leftJoin("shop_info s1 on s1.id = t.DEPOSIT_SHOP_ID and s1.DELETED = 0") |
| | | .leftJoin("shop_info s2 on s2.id = t.TAKE_SHOP_ID and s2.DELETED = 0") |
| | | .leftJoin("category c1 on c1.id = t.GOOD_TYPE and c1.DELETED = 0") |
| | | .leftJoin("category c2 on c2.id = c1.RELATION_ID and c2.DELETED = 0 and c2.TYPE = 3") |
| | | .leftJoin("shop_info s1 on s1.id = t.DEPOSIT_SHOP_ID ") |
| | | .leftJoin("shop_info s2 on s2.id = t.TAKE_SHOP_ID ") |
| | | .leftJoin("category c1 on c1.id = t.GOOD_TYPE ") |
| | | .leftJoin("category c2 on c2.id = c1.RELATION_ID and c2.TYPE = 3") |
| | | .eq(Orders::getAcceptDriver, driver.getId()) |
| | | .eq(Orders::getType, Constants.ONE) |
| | | .eq(Objects.nonNull(dto.getStatus()),Orders::getStatus, dto.getStatus()) |
| | |
| | | wrapper.selectAll(Orders.class) |
| | | .select("s1.name", Orders::getDepositShopName) |
| | | .select("s1.address", Orders::getDepositShopAddress) |
| | | .select("s1.telephone", Orders::getDepositShopLinkPhone) |
| | | .select("s1.link_phone", Orders::getDepositShopLinkPhone) |
| | | .select("s2.name", Orders::getTakeShopName) |
| | | .select("s2.address", Orders::getTakeShopAddress) |
| | | .select("s2.telephone", Orders::getTakeShopLinkPhone) |
| | | .select("c2.other_field as c2OtherField") |
| | | .select("s2.link_phone", Orders::getTakeShopLinkPhone) |
| | | .select("c1.other_field as c2OtherField") |
| | | .select("c1.name as goodTypeName") |
| | | .select("IF(EXISTS(SELECT 1 FROM orders_detail od JOIN category c3 ON c3.id = od.LUGGAGE_ID AND c3.TYPE = 4 AND c3.OTHER_FIELD = '1' WHERE od.ORDER_ID = t.ID AND od.DELETED = 0), 1, 0) as hasOversized") |
| | | .leftJoin("shop_info s1 on s1.id = t.DEPOSIT_SHOP_ID and s1.DELETED = 0") |
| | |
| | | vo.setDepositDistance(formatDistance(distKm)); |
| | | } |
| | | |
| | | // åä»¶ä¿¡æ¯ + èç³»çµè¯ï¼ä½¿ç¨Ordersèªå¸¦åæ ï¼ |
| | | // åä»¶ä¿¡æ¯ï¼ä½¿ç¨Ordersèªå¸¦åæ ï¼ |
| | | boolean hasTakeShop = order.getTakeShopId() != null && StringUtils.isNotBlank(order.getTakeShopName()); |
| | | if (hasTakeShop) { |
| | | vo.setTakeName(order.getTakeShopName()); |
| | | vo.setTakeAddress(order.getTakeShopAddress()); |
| | | vo.setTakeShopId(order.getTakeShopId()); |
| | | vo.setContactPhone(order.getTakeShopLinkPhone()); |
| | | } else { |
| | | vo.setTakeName(order.getTakeLocation()); |
| | | vo.setTakeAddress(order.getTakeLocationRemark()); |
| | | vo.setContactPhone(order.getTakePhone()); |
| | | } |
| | | vo.setTakeLng(order.getTakeLgt() != null ? order.getTakeLgt().doubleValue() : null); |
| | | vo.setTakeLat(order.getTakeLat() != null ? order.getTakeLat().doubleValue() : null); |
| | |
| | | vo.setStatus(order.getStatus()); |
| | | vo.setStatusDesc(getStatusDesc(order.getStatus())); |
| | | vo.setCreateTime(order.getCreateTime()); |
| | | |
| | | // èç³»çµè¯ï¼æè®¢åç¶æï¼ |
| | | if (Constants.equalsInteger(order.getStatus(), Constants.THREE)) { |
| | | vo.setContactPhone(order.getDepositShopLinkPhone()); |
| | | } else if (Constants.equalsInteger(order.getStatus(), Constants.FOUR)) { |
| | | if (hasTakeShop) { |
| | | vo.setContactPhone(order.getTakeShopLinkPhone()); |
| | | } else { |
| | | vo.setContactPhone(order.getTakePhone()); |
| | | } |
| | | } else if (Constants.equalsInteger(order.getStatus(), Constants.FIVE)) { |
| | | vo.setContactPhone(order.getTakePhone()); |
| | | } |
| | | |
| | | // ç©åæç» |
| | | List<OrdersDetail> details = detailMap.getOrDefault(order.getId(), Collections.emptyList()); |
| | |
| | | .select("s1.name", Orders::getDepositShopName) |
| | | .select("s1.address", Orders::getDepositShopAddress) |
| | | .select("s2.name", Orders::getTakeShopName) |
| | | .select("s2.address", Orders::getTakeShopAddress) |
| | | .select("s2.address", Orders::getDepositShopAddress) |
| | | .select("s1.link_phone as takeShopLinkPhone") |
| | | .select("s2.link_phone as takeShopLinkPhone") |
| | | .select("c2.other_field as c2OtherField") |
| | | .select("c2.name as goodLevelName") |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void registerJpushAlias(Integer driverId, String jpushAlias) { |
| | | DriverInfo update = new DriverInfo(); |
| | | update.setId(driverId); |
| | | update.setJpushAlias(jpushAlias); |
| | | driverInfoMapper.updateById(update); |
| | | } |
| | | |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //å¤ææ°ææºå·æ¯å¦å·²è¢«ä½¿ç¨ |
| | | if(memberMapper.selectCount(new QueryWrapper<Member>().lambda().eq(Member::getTelephone,request.getPhone()))>Constants.ZERO){ |
| | | if(memberMapper.selectCount(new QueryWrapper<Member>().lambda() |
| | | .eq(Member::getDeleted,Constants.ZERO) |
| | | .eq(Member::getUserType,Constants.ZERO) |
| | | .eq(Member::getTelephone,request.getPhone()))>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·,æ°ææºå·å·²è¢«ç»å®,æ æ³è¿è¡æ¢ç»ï¼"); |
| | | } |
| | | Member member = memberMapper.selectById(request.getMemberId()); |
| | |
| | | .select("o.total_amount as totalAmount") |
| | | .select("o.pay_amount as payAmount") |
| | | .select("c2.name as goodLevelName") |
| | | .leftJoin("orders o on o.id = t.ORDER_ID and o.DELETED = 0") |
| | | .innerJoin("orders o on o.id = t.ORDER_ID ") |
| | | .leftJoin("category c1 on c1.id = o.GOOD_TYPE and c1.DELETED = 0") |
| | | .leftJoin("category c2 on c2.id = c1.RELATION_ID and c2.DELETED = 0 and c2.TYPE = 3") |
| | | .eq(OrdersRefund::getDeleted, 0); |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.biz.system.AreasBiz; |
| | | import com.doumee.config.xyy.XyyConfig; |
| | | import com.doumee.config.xyy.dto.PrintRequest; |
| | | import com.doumee.biz.system.OperationConfigBiz; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.wx.WxMiniConfig; |
| | | import com.doumee.config.wx.WxPayProperties; |
| | | import com.doumee.config.wx.WxPayV3Service; |
| | | import com.doumee.core.utils.jpush.JPushUtil; |
| | | import com.wechat.pay.java.service.refund.model.Refund; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | |
| | | private AreasService areasService; |
| | | |
| | | @Autowired |
| | | private AreasMapper aareasMapper; |
| | | |
| | | @Autowired |
| | | private NoticeService noticeService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private WxPayProperties wxPayProperties; |
| | | |
| | | @Autowired |
| | | private XyyConfig xyyConfig; |
| | | |
| | | @Autowired |
| | | private PrintService printService; |
| | | |
| | | @Override |
| | | public Integer create(Orders orders) { |
| | |
| | | .leftJoin("shop_info s2 on s2.id = t.TAKE_SHOP_ID"); |
| | | ; |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | pageWrap.getModel().setDeleted(Constants.ZERO); |
| | | queryWrapper.eq(pageWrap.getModel().getDeleted() != null, Orders::getDeleted, pageWrap.getModel().getDeleted()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getCode()), Orders::getCode, pageWrap.getModel().getCode()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getDepositShopName()), "s1.name", pageWrap.getModel().getDepositShopName()); |
| | |
| | | queryWrapper.eq(pageWrap.getModel().getAcceptDriver() != null, Orders::getAcceptDriver, pageWrap.getModel().getAcceptDriver()); |
| | | queryWrapper.and(pageWrap.getModel().getShopId() != null, i -> i.eq(Orders::getDepositShopId, pageWrap.getModel().getShopId()) |
| | | .or().eq(Orders::getTakeShopId, pageWrap.getModel().getShopId())); |
| | | for (PageWrap.SortData sortData : pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | queryWrapper.orderByDesc(Orders::getId); |
| | | PageData<Orders> pageData = PageData.from(ordersMapper.selectJoinPage(page, Orders.class, queryWrapper)); |
| | | for (Orders o : pageData.getRecords()) { |
| | | if (o.getStatus() != null) { |
| | |
| | | for (Category c : categories) { |
| | | categoryNameMap.put(c.getId(), c.getName()); |
| | | categoryDetailMap.put(c.getId(), c.getDetail()); |
| | | categoryOtherFieldMap.put(c.getId(),c.getOtherField()); |
| | | categoryOtherFieldMap.put(c.getId(),c.getRemark()); |
| | | } |
| | | |
| | | // è®¡ç®æ¯é¡¹ç©åè´¹ç¨ï¼å°è®¡ = åä»· à æ°é Ã å¤©æ° |
| | |
| | | for (Category c : categories) { |
| | | categoryNameMap.put(c.getId(), c.getName()); |
| | | categoryDetailMap.put(c.getId(), c.getDetail()); |
| | | categoryOtherFieldMap.put(c.getId(),c.getOtherField()); |
| | | categoryOtherFieldMap.put(c.getId(),c.getRemark()); |
| | | } |
| | | |
| | | // 3. é项计ç®è¿è´¹ï¼èµ·æ¥ä»· + è¶
åºé¨åé¶æ¢¯ä»· |
| | |
| | | // é¨åºå¾
å¤ç订åï¼æä¸å¡ç¯èåºåé¨åºè§è² |
| | | if (combinedStatus != null && Constants.equalsInteger(combinedStatus, Constants.SEVEN)) { |
| | | wrapper.and(w -> w |
| | | .and(w1 -> w1.eq(Orders::getDepositShopId, shopId) |
| | | .and(w1 -> w1.eq(Orders::getType, Constants.ZERO).eq(Orders::getDepositShopId, shopId) |
| | | .in(Orders::getStatus, Constants.OrderStatus.waitDeposit.getStatus(), |
| | | Constants.OrderStatus.deposited.getStatus())) |
| | | .or(w2 -> w2.eq(Orders::getTakeShopId, shopId) |
| | | .in(Orders::getStatus, Constants.OrderStatus.delivering.getStatus(), |
| | | Constants.OrderStatus.arrived.getStatus())) |
| | | Constants.OrderStatus.arrived.getStatus()) |
| | | .or(w3-> w3.eq(Orders::getType, Constants.ONE).eq(Orders::getDepositShopId, shopId) |
| | | .eq(Orders::getStatus, Constants.OrderStatus.waitDeposit.getStatus())) |
| | | .or(w2 -> w2.eq(Orders::getType, Constants.ONE).eq(Orders::getTakeShopId, shopId) |
| | | .eq(Orders::getStatus, Constants.OrderStatus.arrived.getStatus()))) |
| | | ); |
| | | } else { |
| | | wrapper.and(w -> w.eq(Orders::getDepositShopId, shopId).or().eq(Orders::getTakeShopId, shopId)); |
| | |
| | | |
| | | // 6. æ¼éæ¯ä»å®æåï¼è¥å叿ªå¼éåèªå¨å¼é |
| | | if (shopInfo.getAreaId() != null) { |
| | | Areas shopArea = areasService.getById(shopInfo.getAreaId()); |
| | | Areas shopArea = aareasMapper.selectById(shopInfo.getAreaId()); |
| | | if (shopArea != null && shopArea.getParentId() != null) { |
| | | Areas cityArea = areasService.getById(shopArea.getParentId()); |
| | | Areas cityArea = aareasMapper.selectById(shopArea.getParentId()); |
| | | if (cityArea != null && !Constants.equalsInteger(cityArea.getStatus(), Constants.ONE)) { |
| | | cityArea.setStatus(Constants.ONE); |
| | | cityArea.setEditDate(now); |
| | | areasService.updateById(cityArea); |
| | | aareasMapper.updateById(cityArea); |
| | | areasService.cacheData(); |
| | | } |
| | | } |
| | |
| | | // å¼å°å¯å â å¾
æ¢å |
| | | sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_GRAB, order.getId(), |
| | | "orderNo", order.getCode()); |
| | | // æ¨ééç¥å¸æº |
| | | pushDriverNewOrder(order); |
| | | } else { |
| | | // å°±å°å¯å â å¾
åä»¶æé |
| | | sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_PICKUP_REMIND, order.getId(), |
| | |
| | | // å¼å°å¯å â å¾
æ¢å |
| | | sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_GRAB, order.getId(), |
| | | "orderNo", order.getCode()); |
| | | // æ¨ééç¥å¸æº |
| | | pushDriverNewOrder(order); |
| | | } else { |
| | | // å°±å°å¯å â å¾
åä»¶æé |
| | | sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_PICKUP_REMIND, order.getId(), |
| | |
| | | * ä¾å页çå·²æ¥è¯¢æç»çä¸å¡åºæ¯å¤ç¨ï¼é¿å
é夿¥è¯¢ |
| | | */ |
| | | private OverdueFeeVO calculateOverdueFeeInternal(Orders order, List<OrdersDetail> details) { |
| | | if (CollectionUtils.isEmpty(details)) { |
| | | if (CollectionUtils.isEmpty(details)|| |
| | | Constants.equalsInteger(order.getStatus(),Constants.ZERO) |
| | | || Constants.equalsInteger(order.getStatus(),Constants.ONE) |
| | | ) { |
| | | OverdueFeeVO vo = new OverdueFeeVO(); |
| | | vo.setOverdue(false); |
| | | vo.setOverdueDays(0); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void printOrderLabel(Integer orderId, Integer shopId) { |
| | | Orders orders = ordersMapper.selectById(orderId); |
| | | if (orders == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "订åä¸åå¨"); |
| | | } |
| | | if (!Constants.equalsInteger(orders.getDepositShopId(), shopId)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å½åé¨åºä¸æ¯è¯¥è®¢åçåä»¶é¨åº"); |
| | | } |
| | | if (orders.getStatus() < 2 || orders.getStatus() > 5) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å½å订åç¶æä¸å
许æå°"); |
| | | } |
| | | ShopInfo shop = shopInfoMapper.selectById(shopId); |
| | | if (shop == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "åä»¶é¨åºä¸åå¨"); |
| | | } |
| | | if (StringUtils.isBlank(shop.getPrinterSn())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "åä»¶é¨åºæªç»å®æå°æº"); |
| | | } |
| | | List<OrdersDetail> detailList = ordersDetailMapper.selectList( |
| | | new QueryWrapper<OrdersDetail>().lambda().eq(OrdersDetail::getOrderId, orderId)); |
| | | // æ¼æ¥å®¢æ·ä¿¡æ¯ |
| | | String userInfo = ""; |
| | | if (StringUtils.isNotBlank(orders.getTakeUser())) { |
| | | String phone = orders.getTakePhone(); |
| | | userInfo = orders.getTakeUser(); |
| | | if (StringUtils.isNotBlank(phone) && phone.length() >= 4) { |
| | | userInfo += "ï¼" + phone.substring(phone.length() - 4) + "ï¼"; |
| | | } |
| | | } |
| | | String content = printService.getPrintContent(shop.getName(), detailList, userInfo, orders.getCode(), orders.getRemark(), |
| | | orders.getTakeLocationRemark(), |
| | | orders.getPayTime() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm").format(orders.getPayTime()) : "", |
| | | orders.getExpectedTakeTime() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm").format(orders.getExpectedTakeTime()) : ""); |
| | | if (StringUtils.isBlank(content)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æå°å
容为空"); |
| | | } |
| | | PrintRequest request = new PrintRequest(); |
| | | xyyConfig.createRequestHeader(request); |
| | | request.setSn(shop.getPrinterSn()); |
| | | request.setContent(content); |
| | | request.setCopies(1); |
| | | request.setVoice(2); |
| | | request.setMode(0); |
| | | com.doumee.config.xyy.vo.ObjectRestResponse<String> resp = printService.printLabel(request); |
| | | if (resp.getCode() != 0) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æå°å¤±è´¥ï¼" + resp.getMsg()); |
| | | } |
| | | log.info("è®¢åæ ç¾æå°æå: orderId={}, orderIndex={}", orderId, resp.getData()); |
| | | } |
| | | |
| | | /** |
| | | * å¼å°è®¢åå¯åæå忍ééç¥ç»å¸æº |
| | | * 1ãæªå æ¥ï¼æ¨éååä¸é¨åºé
éèå´å
æ¥åä¸ç叿º |
| | | * 2ãå æ¥ï¼æ¨éååæææ¥åä¸ç叿º |
| | | * åå¸å¹é
ï¼å¸æºAREA_IDå
³èareas表ï¼é级parent_idæ¾å°åå¸çº§ï¼ä¸è®¢åcityIdå¹é
|
| | | */ |
| | | private void pushDriverNewOrder(Orders order) { |
| | | ShopInfo shop = shopInfoMapper.selectById(order.getDepositShopId()); |
| | | if (shop == null || shop.getLongitude() == null || shop.getLatitude() == null) { |
| | | return; |
| | | } |
| | | String orderCityId = order.getCityId(); |
| | | if (StringUtils.isBlank(orderCityId)) { |
| | | return; |
| | | } |
| | | String distSql = "(ST_Distance_Sphere(POINT(t.LONGITUDE, t.LATITUDE), POINT(" + shop.getLongitude() + ", " + shop.getLatitude() + ")) / 1000)"; |
| | | // MPJå
³èæ¥è¯¢ï¼å¸æº â areas(åºå¿) â areas_city(åå¸)ï¼å¹é
订åcityId |
| | | MPJLambdaWrapper<DriverInfo> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(DriverInfo.class) |
| | | .leftJoin(Areas.class,Areas::getId,DriverInfo::getAreaId) |
| | | .eq(DriverInfo::getAcceptingStatus, Constants.ONE) |
| | | .eq(DriverInfo::getStatus, Constants.ZERO) |
| | | .eq(DriverInfo::getDeleted, Constants.ZERO) |
| | | .eq(DriverInfo::getAuditStatus, Constants.THREE) |
| | | .eq(Areas::getParentId, orderCityId); |
| | | if (!Constants.equalsInteger(order.getIsUrgent(), Constants.ONE)) { |
| | | // æªå æ¥ï¼é¨åºé
éèå´å
|
| | | double rangeKm = shop.getDeliveryArea() != null ? shop.getDeliveryArea().doubleValue() : 5.0; |
| | | wrapper.apply(distSql + " <= {0}", rangeKm); |
| | | } |
| | | List<DriverInfo> drivers = driverInfoMapper.selectJoinList(DriverInfo.class, wrapper); |
| | | if (drivers.isEmpty()) { |
| | | return; |
| | | } |
| | | List<String> aliases = new ArrayList<>(); |
| | | for (DriverInfo d : drivers) { |
| | | aliases.add(org.springframework.util.DigestUtils.md5DigestAsHex(d.getTelephone().getBytes())); |
| | | } |
| | | String title = Constants.equalsInteger(order.getIsUrgent(), Constants.ONE) ? "æ°å æ¥è®¢å" : "æ°è®¢å"; |
| | | String content = "订åå·ï¼" + order.getCode(); |
| | | java.util.Map<String, String> extras = new java.util.HashMap<>(); |
| | | extras.put("orderId", String.valueOf(order.getId())); |
| | | extras.put("orderCode", order.getCode()); |
| | | extras.put("type", "new_order"); |
| | | JPushUtil.sendByAliases(aliases, title, content, extras); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import cn.binarywang.wx.miniapp.bean.intractiy.WxMaStoreBalance; |
| | | import com.alibaba.druid.sql.visitor.functions.Concat; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.alipay.v3.model.GoodsDetail; |
| | | import com.doumee.config.xyy.dto.*; |
| | | import com.doumee.config.xyy.vo.ObjectRestResponse; |
| | | import com.doumee.config.xyy.vo.OrderStatisResult; |
| | | import com.doumee.config.xyy.vo.PrinterResult; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.dao.business.model.OrdersDetail; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * äºæå°ç¸å
³æ¥å£å°è£
ç±» |
| | | * @author JavaLyl |
| | | */ |
| | | @Service |
| | | public class PrintService { |
| | | |
| | | private static String BASE_URL = "https://open.xpyun.net/api/openapi"; |
| | | |
| | | |
| | | public String getPrintContent(String shopName, List<OrdersDetail> detailList, String userInfo, String orderCode, String remark, String takeLocationRemark, String payTime, String expectedTakeTime){ |
| | | StringBuilder printContent = new StringBuilder(); |
| | | if(CollectionUtils.isNotEmpty(detailList)){ |
| | | Integer num = detailList.stream().map(i->i.getNum()).reduce(Constants.ZERO, Integer::sum); |
| | | Integer index = 1; |
| | | for (OrdersDetail detail:detailList) { |
| | | for (int i = 1; i <= detail.getNum(); i++) { |
| | | int y = 160; |
| | | StringBuilder page = new StringBuilder(); |
| | | page.append("<PAGE>").append("<SIZE>60,60</SIZE>"); |
| | | page.append("<TEXT x=\"30\" y=\"10\" w=\"1\" h=\"1\" r=\"0\">") |
| | | .append(detail.getLuggageName()).append("(").append(i).append("/").append(detail.getNum()).append(")") |
| | | .append("</TEXT>"); |
| | | page.append("<BC128 x=\"50\" y=\"60\" h=\"64\" s=\"1\" n=\"2\" w=\"2\" r=\"0\">") |
| | | .append(orderCode) |
| | | .append("</BC128>"); |
| | | // 客æ·ä¿¡æ¯ |
| | | page.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"1\" h=\"1\" r=\"0\">") |
| | | .append("客æ·ä¿¡æ¯ï¼").append(userInfo).append(StringUtils.repeat(" ", 4)) |
| | | .append("</TEXT>"); |
| | | y += 40; |
| | | // ä¸åæ¶é´ï¼æ¯ä»æ¶é´ï¼ |
| | | page.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"1\" h=\"1\" r=\"0\">") |
| | | .append("ä¸åæ¶é´ï¼").append(payTime) |
| | | .append("</TEXT>"); |
| | | y += 40; |
| | | // åä»¶å°åï¼æå¤2è¡ï¼ |
| | | y = appendMultiLine(page, "åä»¶å°åï¼", takeLocationRemark, y, 2); |
| | | y += 10; |
| | | // éè¾¾æ¶é´ |
| | | page.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"1\" h=\"1\" r=\"0\">") |
| | | .append("客æ·é¢è®¡åä»¶æ¶é´ï¼").append(expectedTakeTime) |
| | | .append("</TEXT>"); |
| | | y += 40; |
| | | // 订å夿³¨ï¼æå¤2è¡ï¼ |
| | | y = appendMultiLine(page, "订å夿³¨ï¼", remark, y, 2); |
| | | // é¨åºå + åºå·ï¼åºå®å¨åºé¨ï¼ |
| | | page.append("<TEXT x=\"30\" y=\"440\" w=\"1\" h=\"1\" r=\"0\">") |
| | | .append(shopName).append(StringUtils.repeat(" ", 18)) |
| | | .append(index).append("/").append(num) |
| | | .append("</TEXT>"); |
| | | page.append("</PAGE>"); |
| | | printContent.append(page); |
| | | index = index+1; |
| | | } |
| | | } |
| | | } |
| | | return printContent.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 追å å¯è½æ¢è¡çææ¬ï¼æ é¢+å
容ï¼ï¼è¶
è¿maxChars个å符æ¢è¡ï¼æå¤maxLinesè¡ |
| | | * @return æ¶èçyåç§»åçä¸ä¸ä¸ªyåæ |
| | | */ |
| | | private int appendMultiLine(StringBuilder sb, String title, String content, int startY, int maxLines) { |
| | | String fullText = title + (StringUtils.isNotBlank(content) ? content : ""); |
| | | int maxChars = 18; |
| | | int line = 0; |
| | | int pos = 0; |
| | | int y = startY; |
| | | while (pos < fullText.length() && line < maxLines) { |
| | | String lineText; |
| | | int end = Math.min(pos + maxChars, fullText.length()); |
| | | lineText = fullText.substring(pos, end); |
| | | pos = end; |
| | | line++; |
| | | sb.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"1\" h=\"1\" r=\"0\">") |
| | | .append(lineText).append(StringUtils.repeat(" ", 4)) |
| | | .append("</TEXT>"); |
| | | y += 35; |
| | | } |
| | | return y; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 1.æ¹éæ·»å æå°æº |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<PrinterResult> addPrinters(AddPrinterRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/addPrinters"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<PrinterResult> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<PrinterResult>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 2.设置æå°æºè¯é³ç±»å |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<Boolean> setPrinterVoiceType(SetVoiceTypeRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/setVoiceType"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<Boolean> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Boolean>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 3.æå°å°ç¥¨è®¢å |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<String> print(PrintRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/print"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 4.æå°æ ç¾è®¢å |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<String> printLabel(PrintRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/printLabel"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 5.æ¹éå 餿尿º |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<PrinterResult> delPrinters(DelPrinterRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/delPrinters"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<PrinterResult> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<PrinterResult>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 6.ä¿®æ¹æå°æºä¿¡æ¯ |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<Boolean> updPrinter(UpdPrinterRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/updPrinter"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<Boolean> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Boolean>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 7.æ¸
空å¾
æå°éå |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<Boolean> delPrinterQueue(PrinterRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/delPrinterQueue"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<Boolean> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Boolean>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 8.æ¥è¯¢è®¢åæ¯å¦æå°æå |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<Boolean> queryOrderState(QueryOrderStateRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/queryOrderState"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<Boolean> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Boolean>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 9.æ¥è¯¢æå°æºæå¤©ç订åç»è®¡æ° |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<OrderStatisResult> queryOrderStatis(QueryOrderStatisRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/queryOrderStatis"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<OrderStatisResult> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<OrderStatisResult>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 10.æ¥è¯¢æå°æºç¶æ |
| | | * |
| | | * 0ã离线 1ãå¨çº¿æ£å¸¸ 2ãå¨çº¿ä¸æ£å¸¸ |
| | | * 夿³¨ï¼å¼å¸¸ä¸è¬æ¯æ 纸ï¼ç¦»çº¿çå¤ææ¯æå°æºä¸æå¡å¨å¤±å»èç³»è¶
è¿30ç§ |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<Integer> queryPrinterStatus(PrinterRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/queryPrinterStatus"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<Integer> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Integer>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 10.æ¹éæ¥è¯¢æå°æºç¶æ |
| | | * |
| | | * 0ã离线 1ãå¨çº¿æ£å¸¸ 2ãå¨çº¿ä¸æ£å¸¸ |
| | | * 夿³¨ï¼å¼å¸¸ä¸è¬æ¯æ 纸ï¼ç¦»çº¿çå¤ææ¯æå°æºä¸æå¡å¨å¤±å»èç³»è¶
è¿30ç§ |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<List<Integer>> queryPrintersStatus(PrintersRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/queryPrintersStatus"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<List<Integer>> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<List<Integer>>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 11.äºååææ¾è¯é³ |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<String> playVoice(VoiceRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/playVoice"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 12.POSæä»¤ |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<String> pos(PrintRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/pos"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){}); |
| | | return result; |
| | | } |
| | | /** |
| | | * 13.é±ç®±æ§å¶ |
| | | * @param restRequest |
| | | * @return |
| | | */ |
| | | public ObjectRestResponse<String> controlBox(PrintRequest restRequest) { |
| | | String url = BASE_URL + "/xprinter/controlBox"; |
| | | String jsonRequest = JSON.toJSONString(restRequest); |
| | | String resp = HttpsUtil.postJson(url, jsonRequest); |
| | | ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){}); |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.xpyun.XpyunPrintService; |
| | | import com.doumee.core.utils.xpyun.XpyunResponse; |
| | | import com.doumee.dao.business.PrinterInfoMapper; |
| | | import com.doumee.dao.business.model.PrinterInfo; |
| | | import com.doumee.service.business.PrinterInfoService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @Autowired |
| | | private PrinterInfoMapper printerInfoMapper; |
| | | |
| | | @Autowired |
| | | private XpyunPrintService xpyunPrintService; |
| | | |
| | | @Override |
| | | public Integer create(PrinterInfo printerInfo) { |
| | | if (StringUtils.isBlank(printerInfo.getSn())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æå°æºSNä¸è½ä¸ºç©º"); |
| | | } |
| | | if (StringUtils.isBlank(printerInfo.getName())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æå°æºåç§°ä¸è½ä¸ºç©º"); |
| | | } |
| | | XpyunResponse response = xpyunPrintService.addPrinter(printerInfo.getSn(), printerInfo.getName()); |
| | | if (response.getCode() != 0) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "è¯ç¨äºæ·»å æå°æºå¤±è´¥ï¼" + response.getMsg()); |
| | | } |
| | | printerInfoMapper.insert(printerInfo); |
| | | return printerInfo.getId(); |
| | | } |
| | |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.dao.business.model.PricingRule; |
| | | import com.doumee.dao.business.model.ShopInfo; |
| | | import com.doumee.config.xyy.XyyConfig; |
| | | import com.doumee.config.xyy.dto.AddPrinterRequest; |
| | | import com.doumee.config.xyy.dto.AddPrinterRequestItem; |
| | | import com.doumee.config.xyy.dto.DelPrinterRequest; |
| | | import com.doumee.config.xyy.vo.ObjectRestResponse; |
| | | import com.doumee.config.xyy.vo.PrinterResult; |
| | | import com.doumee.dao.dto.*; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | |
| | | |
| | | @Autowired |
| | | private SmsrecordMapper smsrecordMapper; |
| | | |
| | | @Autowired |
| | | private PrintService printService; |
| | | |
| | | @Autowired |
| | | private XyyConfig xyyConfig; |
| | | @Override |
| | | public Integer create(ShopInfo shopInfo) { |
| | | shopInfoMapper.insert(shopInfo); |
| | |
| | | vo.setFeeStandard(shop.getFeeStandard()); |
| | | vo.setLatitude(shop.getLatitude()); |
| | | vo.setLongitude(shop.getLongitude()); |
| | | vo.setLinkPhone(shop.getLinkPhone()); |
| | | |
| | | // é¨å¤´ç
§ + å
é¨ç
§ å
¨è·¯å¾éå |
| | | String imgPrefix = getShopPrefix(); |
| | |
| | | // åä»¶é¨åº |
| | | List<Orders> depositSalesOrders = ordersMapper.selectList(new QueryWrapper<Orders>().lambda() |
| | | .eq(Orders::getDeleted, Constants.ZERO) |
| | | .notIn(Orders::getStatus,Constants.OrderStatus.cancelled.getStatus(),Constants.OrderStatus.waitPay.getStatus()) |
| | | .ge(Orders::getCreateTime, startTime) |
| | | .lt(Orders::getCreateTime, endTime) |
| | | .eq(Orders::getDepositShopId, shopId)); |
| | |
| | | List<Orders> takeSalesOrders = ordersMapper.selectList(new QueryWrapper<Orders>().lambda() |
| | | .eq(Orders::getDeleted, Constants.ZERO) |
| | | .eq(Orders::getType,Constants.ONE) |
| | | .notIn(Orders::getStatus,Constants.OrderStatus.cancelled.getStatus(),Constants.OrderStatus.waitPay.getStatus()) |
| | | .ge(Orders::getCreateTime, startTime) |
| | | .lt(Orders::getCreateTime, endTime) |
| | | .eq(Orders::getTakeShopId, shopId)); |
| | |
| | | .last("limit 1") |
| | | ); |
| | | if(shop==null){ |
| | | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"è¯·æ ¸å¯¹ç»å½ææºå·æ¯å¦æ£ç¡®"); |
| | | } |
| | | if(Constants.equalsInteger(shop.getStatus(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"é¨åºå·²ç¦ç¨ï¼è¯·è系管çå"); |
| | | } |
| | | if(!Constants.equalsInteger(shop.getAuditStatus(),Constants.THREE)){ |
| | | if(Constants.equalsInteger(shop.getAuditStatus(),Constants.ONE)){ |
| | |
| | | .last("limit 1")); |
| | | if (shop == null) { |
| | | return null; |
| | | } |
| | | if(Constants.equalsInteger(shop.getStatus(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"é¨åºå·²ç¦ç¨ï¼è¯·è系管çå"); |
| | | } |
| | | // å建tokenï¼generateTokenForRedis å·²èªå¨æ¸
é¤è¯¥ç¨æ·æ§tokenï¼ä¿è¯å¯ä¸ææï¼ |
| | | String token = JwtTokenUtil.generateTokenForRedis(shop.getId(), Constants.TWO, JSONObject.toJSONString(shop), redisTemplate); |
| | |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private com.doumee.core.utils.xpyun.XpyunPrintService xpyunPrintService; |
| | | |
| | | @Override |
| | | public void bindPrinter(com.doumee.dao.dto.PrinterBindDTO dto) { |
| | | ShopInfo shop = shopInfoMapper.selectById(dto.getShopId()); |
| | | public void maintainPrinterSn(ShopPrinterDTO dto) { |
| | | ShopInfo shop = shopInfoMapper.selectById(dto.getId()); |
| | | if (shop == null || Constants.equalsInteger(shop.getDeleted(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | // è°ç¨è¯ç¨äºæ³¨åæå°æº |
| | | com.doumee.core.utils.xpyun.XpyunResponse resp = xpyunPrintService.addPrinter( |
| | | dto.getPrinterSn(), shop.getName()); |
| | | if (resp.getCode() != null && resp.getCode() == 0) { |
| | | log.info("è¯ç¨äºæå°æºæ³¨åæå: sn={}", dto.getPrinterSn()); |
| | | } else { |
| | | log.warn("è¯ç¨äºæå°æºæ³¨åè¿åé0: sn={}, code={}, msg={}", |
| | | dto.getPrinterSn(), resp.getCode(), resp.getMsg()); |
| | | String oldSn = shop.getPrinterSn(); |
| | | String newSn = dto.getPrinterSn(); |
| | | boolean hasNewSn = StringUtils.isNotBlank(newSn); |
| | | boolean hasOldSn = StringUtils.isNotBlank(oldSn); |
| | | |
| | | if (!hasNewSn) { |
| | | // æªä¼ æå°æºSN â å é¤é»è¾ |
| | | if (hasOldSn) { |
| | | delPrinterFromXyy(oldSn); |
| | | shop.setPrinterSn(null); |
| | | shopInfoMapper.updateById(shop); |
| | | } |
| | | return; |
| | | } |
| | | // æ 论äºç«¯æ¯å¦æåï¼é½ç»å®å°é¨åºï¼å¯åç»éè¯äºç«¯æ³¨åï¼ |
| | | ShopInfo update = new ShopInfo(); |
| | | update.setId(dto.getShopId()); |
| | | update.setPrinterSn(dto.getPrinterSn()); |
| | | shopInfoMapper.updateById(update); |
| | | |
| | | // ä¼ äºæå°æºSN â 妿æ§ç»å®åå¨ï¼å
å é¤ |
| | | if (hasOldSn) { |
| | | delPrinterFromXyy(oldSn); |
| | | } |
| | | |
| | | // ç»å®æ°æå°æº |
| | | AddPrinterRequest addReq = new AddPrinterRequest(); |
| | | xyyConfig.createRequestHeader(addReq); |
| | | addReq.setItems(new AddPrinterRequestItem[]{new AddPrinterRequestItem() {{ |
| | | setSn(newSn); |
| | | setName(shop.getName()); |
| | | }}}); |
| | | ObjectRestResponse<PrinterResult> addResp = printService.addPrinters(addReq); |
| | | if (addResp.getCode() != 0) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "ç»å®æå°æºå¤±è´¥ï¼" + addResp.getMsg()); |
| | | } |
| | | log.info("ç»å®æåï¼{}", newSn); |
| | | shop.setPrinterSn(newSn); |
| | | shopInfoMapper.updateById(shop); |
| | | } |
| | | |
| | | @Override |
| | | public void unbindPrinter(Integer shopId) { |
| | | ShopInfo shop = shopInfoMapper.selectById(shopId); |
| | | if (shop == null || Constants.equalsInteger(shop.getDeleted(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | private void delPrinterFromXyy(String sn) { |
| | | DelPrinterRequest delReq = new DelPrinterRequest(); |
| | | xyyConfig.createRequestHeader(delReq); |
| | | delReq.setSnlist(new String[]{sn}); |
| | | ObjectRestResponse<PrinterResult> delResp = printService.delPrinters(delReq); |
| | | if (delResp.getCode() != 0) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "è§£ç»æå°æºå¤±è´¥ï¼" + delResp.getMsg()); |
| | | } |
| | | if (StringUtils.isNotBlank(shop.getPrinterSn())) { |
| | | xpyunPrintService.deletePrinter(shop.getPrinterSn()); |
| | | } |
| | | ShopInfo update = new ShopInfo(); |
| | | update.setId(shopId); |
| | | update.setPrinterSn(null); |
| | | shopInfoMapper.updateById(update); |
| | | } |
| | | |
| | | @Override |
| | | public Object queryPrinterStatus(Integer shopId) { |
| | | ShopInfo shop = shopInfoMapper.selectById(shopId); |
| | | if (shop == null || Constants.equalsInteger(shop.getDeleted(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if (StringUtils.isBlank(shop.getPrinterSn())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "该é¨åºæªç»å®æå°æº"); |
| | | } |
| | | return xpyunPrintService.queryPrinterStatus(shop.getPrinterSn()); |
| | | log.info("è§£ç»æåï¼{}", sn); |
| | | } |
| | | |
| | | } |
| | |
| | | des_pwd: 123456SDFKDJF |
| | | |
| | | jpush: |
| | | appKey: |
| | | masterSecret: |
| | | appKey: bb8fd4bd06c8dcb004f4ee1e |
| | | masterSecret: 569a75763aa5a59377c46fbb |
| | | apnsProduction: false |
| | | |
| | | knife4j: |
| | |
| | | ssl: |
| | | enable: true |
| | | debug_model: false |
| | | ########################æå
æ¨éé
ç½®######################## |
| | | jpush: |
| | | appKey: bb8fd4bd06c8dcb004f4ee1e |
| | | masterSecret: 569a75763aa5a59377c46fbb |
| | | apnsProduction: false |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | |
| | | return ApiResponse.success("æ¥è¯¢æå", areasService.getOpenedCityByName(cityName)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®åå¸ç¼ç æ¥è¯¢åå¸ä¿¡æ¯", notes = "ä»
è¿åå·²å¼éçåå¸ï¼æªå¼éè¿å空") |
| | | @GetMapping("/getCityByCode") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "åå¸ç¼ç ", required = true) |
| | | }) |
| | | public ApiResponse<Areas> getCityByCode(@RequestParam String code) { |
| | | return ApiResponse.success("æ¥è¯¢æå", areasService.getOpenedCityByCode(code)); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "ä¼åéç¥æ¶æ¯å页", notes = "æªè¯»ä¼å
ï¼æ¶é´ååº") |
| | | @PostMapping("/memberNoticePage") |
| | |
| | | import com.doumee.dao.vo.DriverCenterVO; |
| | | import com.doumee.dao.vo.DriverGrabOrderVO; |
| | | import com.doumee.dao.vo.DriverOrderDetailVO; |
| | | import com.doumee.core.utils.jpush.JPushUtil; |
| | | import com.doumee.service.business.DriverInfoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | return ApiResponse.success(driverInfoService.checkDriverToken(token)); |
| | | } |
| | | |
| | | @LoginDriverRequired |
| | | @ApiOperation("注åæå
æ¨éå«å") |
| | | @PostMapping("/registerJpushAlias") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "叿ºtokenå¼", required = true) |
| | | }) |
| | | public ApiResponse registerJpushAlias(@RequestParam String jpushAlias) { |
| | | driverInfoService.registerJpushAlias(this.getDriverId(), jpushAlias); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @ApiOperation("æå
æ¨éæµè¯") |
| | | @GetMapping("/testJpush") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "title", value = "éç¥æ é¢", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "content", value = "éç¥å
容", required = true) |
| | | }) |
| | | public ApiResponse<Boolean> testJpush(@RequestParam String telephone, @RequestParam String title, @RequestParam String content) { |
| | | boolean result = JPushUtil.sendByAlias(org.springframework.util.DigestUtils.md5DigestAsHex(telephone.getBytes()), title, content, null); |
| | | return ApiResponse.success("æ¨é" + (result ? "æå" : "失败"), result); |
| | | } |
| | | |
| | | } |
| | |
| | | return ApiResponse.success("å¯ç ä¿®æ¹æåï¼è¯·éæ°ç»å½"); |
| | | } |
| | | |
| | | @LoginShopRequired |
| | | @ApiOperation("é¨åºæå°è®¢åæ ç¾") |
| | | @GetMapping("/printOrderLabel/{orderId}") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "é¨åºtokenå¼", required = true), |
| | | @ApiImplicitParam(paramType = "path", dataType = "Integer", name = "orderId", value = "订å主é®", required = true) |
| | | }) |
| | | public ApiResponse printOrderLabel(@PathVariable Integer orderId) { |
| | | ordersService.printOrderLabel(orderId, this.getShopId()); |
| | | return ApiResponse.success("æå°æå"); |
| | | } |
| | | |
| | | } |
| | |
| | | name: é«éè¡æå¯å |
| | | version: 1.0.0 |
| | | # ç¯å¢ï¼ç产ç¯å¢productionï¼å¼åç¯å¢development |
| | | env: development |
| | | env: production |
| | | # 模å¼ï¼testingæµè¯æ¨¡å¼ |
| | | mode: testing |
| | | |