| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | // æ¥è¯¢ |
| | | export function fetchList (data) { |
| | | return request.post('/business/refund/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | // 导åºExcel |
| | | export function exportExcel (data) { |
| | | return request.post('/business/refund/exportExcel', data, { |
| | | download: true, |
| | | trim: true |
| | | }) |
| | | } |
| | | |
| | | // å建 |
| | | export function create (data) { |
| | | return request.post('/business/refund/create', data) |
| | | } |
| | | export function updateByPayStatus (data) { |
| | | return request.post('/business/refund/updateByPayStatus', data) |
| | | } |
| | | export function cancel (id) { |
| | | return request.get(`/business/refund/cancel?id=${id}`) |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | | return request.post('/business/refund/updateById', data) |
| | | } |
| | | |
| | | // å é¤ |
| | | export function deleteById (id) { |
| | | return request.get(`/business/refund/delete/${id}`) |
| | | } |
| | | // å é¤ |
| | | export function getById (id) { |
| | | return request.get(`/business/refund/${id}`) |
| | | } |
| | | |
| | | // æ¹éå é¤ |
| | | export function deleteByIdInBatch (ids) { |
| | | return request.get('/business/refund/delete/batch', { |
| | | params: { |
| | | ids |
| | | } |
| | | }) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | width="60%" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <div class="header"> |
| | | <div class="header-b">订åä¿¡æ¯</div> |
| | | <div class="info-item" > |
| | | <div class="info-item-a">订åéé¢ï¼<span class="orange"> ï¿¥{{((form.order.money||0)/100).toFixed(2)}}å
</span></div> |
| | | <div class="info-item-a">订åç¼å·ï¼<span>{{form.order.id }}</span></div> |
| | | <div class="info-item-a">仿¬¾äººï¼<span>{{form.order.name +'-' + form.order.phone}}</span></div> |
| | | </div> |
| | | </div> |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <p class="tip-warn" ><i class="el-icon-warning"></i>说æï¼æä½å½åå¯ééé¢<span class="red">ï¿¥{{((form.balance||0)/100).toFixed(2)}}å
</span>ï¼è¯·è°¨æ
æä½ï¼</p> |
| | | <el-form-item label="鿬¾éé¢" prop="money"> |
| | | <el-input v-model="form.money" type="number" placeholder="鿬¾éé¢" v-trim><template s></template></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å¤æ³¨" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | export default { |
| | | name: 'OperaOrdersWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | id: null, |
| | | money: '', |
| | | remark: '', |
| | | orderId: '', |
| | | balance: 0, |
| | | order:{} |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | | money: [{ required: true, message: '请è¾å
¥é款éé¢' }] |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/business/refund', |
| | | 'field.id': 'id' |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .table-pagination{ |
| | | position: fixed !important; |
| | | bottom: 50px; |
| | | } |
| | | .header-b{ |
| | | display: inline-block; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | .header-red-btn{ |
| | | display: inline-block; |
| | | font-size: 12px; |
| | | background-color: red; |
| | | padding: 2px 10px 3px 10px; |
| | | margin-left: 20px; |
| | | color: white; |
| | | cursor: pointer; |
| | | border-radius: 5px ; |
| | | } |
| | | .header-blue-btn{ |
| | | display: inline-block; |
| | | font-size: 12px; |
| | | background-color: #216EEE; |
| | | padding: 2px 10px 3px 10px; |
| | | margin-left: 20px; |
| | | color: white; |
| | | cursor: pointer; |
| | | border-radius: 5px ; |
| | | } |
| | | .header-grey{ |
| | | display: inline-block; |
| | | font-size: 12px; |
| | | border: 1px solid grey; |
| | | padding: 2px 10px; |
| | | margin-left: 20px; |
| | | color: grey; |
| | | border-radius: 5px ; |
| | | } |
| | | .header-orange{ |
| | | display: inline-block; |
| | | font-size: 12px; |
| | | border: 1px solid orange; |
| | | padding: 2px 10px; |
| | | margin-left: 20px; |
| | | color: orange; |
| | | border-radius: 5px ; |
| | | } |
| | | .header-btn{ |
| | | display: inline-block; |
| | | border: none; |
| | | padding: 2px 10px; |
| | | margin-left: 20px; |
| | | } |
| | | .info-item{ |
| | | display: flex; |
| | | width: 100%; |
| | | margin: 15px; |
| | | } |
| | | .info-item-a{ |
| | | flex: 1; |
| | | font-size: 14px; |
| | | |
| | | } |
| | | .info-item-a span{ |
| | | } |
| | | .info-item-a .btn{ |
| | | font-size: 12px !important; |
| | | cursor: pointer !important; |
| | | } |
| | | </style> |
| | |
| | | <span v-if="row.type==1">å»¶ææ¬¾</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="money" label="已鿬¾éé¢ï¼å
ï¼" min-width="150px"> |
| | | <template slot-scope="{row}"> |
| | | <span class="red">{{((row.refundMoney || 0)/100).toFixed(2)}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" label="订å夿³¨" width="200px" ></el-table-column> |
| | | <el-table-column prop="userRealname" label="æ¶æ¬¾äººå§å" width="100px" ></el-table-column> |
| | | <el-table-column prop="username" label="è´è´£äººè´¦å·" width="120px" ></el-table-column> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column prop="payDate" label="仿¬¾æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column prop="cancelDate" label="åæ¶æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | min-width="100" |
| | | min-width="180" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" v-if="row.status==1&&(row.money-(row.refundMoney||0)) >1" @click="sendRefund(row)" icon="el-icon-edit" v-permissions="['business:refund:create']">鿬¾</el-button> |
| | | <el-button type="text" @click="payStatus(row)" icon="el-icon-refresh" v-permissions="['business:orders:update']">åæ¥ç¶æ</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaOrderDetailWindow ref="OperaOrderDetailWindow" @success="handlePageChange"/> |
| | | <OperaRefundWindow ref="OperaRefundWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaOrderDetailWindow from '@/components/business/OperaOrderDetailWindow' |
| | | import OperaRefundWindow from '@/components/business/OperaRefundWindow' |
| | | import { cancel } from '@/api/business/orders' |
| | | export default { |
| | | name: 'Orders', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaOrderDetailWindow }, |
| | | components: { TableLayout, Pagination, OperaOrderDetailWindow, OperaRefundWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | sendRefund (row) { |
| | | var balance = row.money - (row.refundMoney || 0) |
| | | if (balance < 1) { |
| | | this.$message.error('该订åå·²æ å¯é款ä½é¢') |
| | | return |
| | | } |
| | | this.$refs.OperaRefundWindow.open('åèµ·éæ¬¾', { orderId: row.id, balance: balance ,order:row}) |
| | | }, |
| | | payStatus (row) { |
| | | this.$dialog.actionConfirm('æ¨ç¡®è®¤ã忥ãè¯¥è®¢åææ°ç¶æåï¼', 'æä½ç¡®è®¤') |
| | | .then(() => { |
| | | this.dealing = true |
| | | this.api.updateByPayStatus({id:row.id}) |
| | | this.api.updateByPayStatus({ id: row.id }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess('æä½æå') |
| | | this.search() |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:refund:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="" prop="id"> |
| | | <el-input v-model="searchForm.id" clearable placeholder="订åå·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="memberName"> |
| | | <el-input v-model="searchForm.memberName" clearable placeholder="仿¬¾äººå§å" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="memberPhone"> |
| | | <el-input v-model="searchForm.memberPhone" clearable placeholder="仿¬¾äººææºå·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="" prop="username"> |
| | | <el-input v-model="searchForm.username" clearable placeholder="è´è´£äººè´¦å·" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="userRealname"> |
| | | <el-input v-model="searchForm.userRealname" clearable placeholder="è´è´£äººå§å" @keypress.enter.native="search"></el-input> |
| | | </el-form-item>--> |
| | | <el-form-item label="" prop="orderType"> |
| | | <el-select v-model="searchForm.orderType" @change="search" clearable placeholder="仿¬¾äºç±"> |
| | | <el-option label="车款" :value="0"></el-option> |
| | | <el-option label="å»¶ææ¬¾" :value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="status"> |
| | | <el-select v-model="searchForm.status" @change="search" clearable placeholder="ç¶æ"> |
| | | <el-option label="å¤çä¸" :value="0"></el-option> |
| | | <el-option label="æå" :value="1"></el-option> |
| | | <el-option label="失败" :value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="" prop="starttime" label-width="100px" > |
| | | <el-date-picker type="datetime" v-model="searchForm.starttime" clearable value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="å¼å§(å建)æ¶é´" /> - |
| | | </el-form-item> |
| | | <el-form-item label="" prop="endtime" label-width="0px" > |
| | | <el-date-picker type="datetime" v-model="searchForm.endtime" clearable value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="ç»æ(å建)æ¶é´" /> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | <!-- |
| | | <el-button type="primary" :loading="isWorking.export" @click="exportExcel">导åº</el-button> |
| | | --> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <!-- <ul class="toolbar" v-permissions="['business:refund:create', 'business:refund:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaOrdersWindow.open('æ°å»ºè®¢åä¿¡æ¯è®°å½')" icon="el-icon-plus" v-permissions="['business:refund:create']">æ°å»º</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:refund:delete']">å é¤</el-button></li> |
| | | </ul>--> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column prop="id" label="鿬¾åå·" width="120px" fixed="left"> |
| | | <template slot-scope="{row}"> |
| | | <span class="blue" @click="openDetail(row)">{{row.id}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="orderId" label="æ¯ä»è®¢åå·" width="100px" :show-overflow-tooltip='true'></el-table-column> |
| | | <el-table-column prop="memberName" label="仿¬¾äººå§å" width="100px" :show-overflow-tooltip='true'></el-table-column> |
| | | <el-table-column prop="memberPhone" label="仿¬¾äººææºå·" width="120px" :show-overflow-tooltip='true'></el-table-column> |
| | | <el-table-column prop="money" label="æ¯ä»éé¢ï¼å
ï¼" min-width="150px"> |
| | | <template slot-scope="{row}"> |
| | | <span class="yellowstate">{{((row.money || 0)/100).toFixed(2)}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="statusName" label="鿬¾ç¶æ" min-width="100px" > |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.status == 0" class="blue">å¤çä¸</span> |
| | | <span v-if="row.status == 1" class="green">æå</span> |
| | | <span v-if="row.status == 2" class="grey">失败</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="orderType" label="仿¬¾äºç±" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.orderType==0">车款</span> |
| | | <span v-if="row.orderType==1">å»¶ææ¬¾</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="money" label="鿬¾éé¢ï¼å
ï¼" min-width="150px"> |
| | | <template slot-scope="{row}"> |
| | | <span class="red">{{((row.money || 0)/100).toFixed(2)}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remark" label="鿬¾å¤æ³¨" width="200px" ></el-table-column> |
| | | <el-table-column prop="memberName" label="æ¶æ¬¾äººå§å" width="100px" ></el-table-column> |
| | | <el-table-column prop="memberPhone" label="è´è´£äººè´¦å·" width="120px" ></el-table-column> |
| | | <el-table-column prop="createTime" label="å建æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column prop="payDate" label="宿æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | min-width="180" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="payStatus(row)" icon="el-icon-refresh" v-permissions="['business:refund:update']">åæ¥ç¶æ</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaOrderDetailWindow ref="OperaOrderDetailWindow" @success="handlePageChange"/> |
| | | <OperaRefundWindow ref="OperaRefundWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaOrderDetailWindow from '@/components/business/OperaOrderDetailWindow' |
| | | import OperaRefundWindow from '@/components/business/OperaRefundWindow' |
| | | import { cancel } from '@/api/business/orders' |
| | | export default { |
| | | name: 'Orders', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaOrderDetailWindow, OperaRefundWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: null, |
| | | status: null, |
| | | type: null, |
| | | starttime: null, |
| | | endtime: null, |
| | | memberName: null, |
| | | memberPhone: null, |
| | | orderId: null |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '鿬¾ä¿¡æ¯è®°å½', |
| | | api: '/business/refund', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | openDetail (row) { |
| | | }, |
| | | payStatus (row) { |
| | | this.$dialog.actionConfirm('æ¨ç¡®è®¤ã忥ãè¯¥éæ¬¾ææ°ç¶æåï¼', 'æä½ç¡®è®¤') |
| | | .then(() => { |
| | | this.dealing = true |
| | | this.api.updateByPayStatus({ id: row.id }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess('æä½æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.dealing = false |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`, `MODULE`) VALUES ('business:refund:create', 'æ°å»ºè®¢å鿬¾ä¿¡æ¯è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0,'订å鿬¾ä¿¡æ¯è¡¨'); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`, `MODULE`) VALUES ('business:refund:delete', 'å é¤è®¢å鿬¾ä¿¡æ¯è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0,'订å鿬¾ä¿¡æ¯è¡¨'); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`, `MODULE`) VALUES ('business:refund:update', 'ä¿®æ¹è®¢å鿬¾ä¿¡æ¯è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0,'订å鿬¾ä¿¡æ¯è¡¨'); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`, `MODULE`) VALUES ('business:refund:query', 'æ¥è¯¢è®¢å鿬¾ä¿¡æ¯è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0,'订å鿬¾ä¿¡æ¯è¡¨'); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`, `MODULE`) VALUES ('business:refund:exportExcel', '导åºè®¢å鿬¾ä¿¡æ¯è¡¨(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0,'订å鿬¾ä¿¡æ¯è¡¨'); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.dao.business.model.Refund; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.service.business.RefundService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | /** |
| | | * 订å鿬¾ä¿¡æ¯è¡¨Controllerå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-02-06 11:35:16 |
| | | */ |
| | | @Api(tags = "refundæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/business/refund") |
| | | public class RefundController extends BaseController { |
| | | |
| | | @Autowired |
| | | private RefundService refundService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:refund:create") |
| | | public ApiResponse create(@RequestBody Refund refund) { |
| | | return ApiResponse.success(refundService.create(refund)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:refund:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | refundService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:refund:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | refundService.deleteByIdInBatch(this.getIdList(ids)); |
| | | return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢äº¤ææµæ°´ä¿¡æ¯æ´æ°ææ°äº¤æç¶æ") |
| | | @PostMapping("/updateByPayStatus") |
| | | @RequiresPermissions("business:refund:update") |
| | | public ApiResponse updateByPayStatus(@RequestBody Refund orders) { |
| | | refundService.updateByPayStatus(orders); |
| | | return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:refund:update") |
| | | public ApiResponse updateById(@RequestBody Refund refund) { |
| | | refundService.updateById(refund); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:refund:query") |
| | | public ApiResponse<PageData<Refund>> findPage (@RequestBody PageWrap<Refund> pageWrap) { |
| | | return ApiResponse.success(refundService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:refund:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Refund> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Refund.class).export(refundService.findPage(pageWrap).getRecords(), "订å鿬¾ä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:refund:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(refundService.findById(id)); |
| | | } |
| | | } |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: pro |
| | | active: dev |
| | | # JSONè¿åé
ç½® |
| | | jackson: |
| | | # é»è®¤æ¶åº |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.lib; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.allinpay.syb.model.PayOrderNotifyParam; |
| | | import com.allinpay.syb.model.PayOrderRefundResponse; |
| | | import com.allinpay.syb.model.PayPublicModel; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.dao.business.model.Refund; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | |
| | | @Slf4j |
| | | @Data |
| | | public class DoumeeTLUtil { |
| | | public static final String SUCCESS_CODE = "SUCCESS"; |
| | | public static final String FAIL_CODE = "FAIL"; |
| | | private PayPublicModel publicModel; |
| | | private String appkey; |
| | | private String pubKey; |
| | | public DoumeeTLUtil(PayPublicModel model){ |
| | | this.publicModel = model; |
| | | } |
| | | public static String REFUND_SN_PREFIX = "refund_"; |
| | | public PayOrderRefundResponse sendRefundOrder(String reqsn, String oldReqsn, String money, String remark) { |
| | | TreeMap<String, String> params = new TreeMap<String, String>(); |
| | | params.put("cusid", publicModel.getCusid()); |
| | | params.put("appid", publicModel.getAppid()); |
| | | params.put("version", publicModel.getVersion()); |
| | | params.put("trxid", ""); |
| | | params.put("randomstr", SybUtil.getValidatecode(8)); |
| | | params.put("signtype", publicModel.getSigntype()); |
| | | params.put("notify_url",publicModel.getNotifyUrl()); |
| | | params.remove("sign"); |
| | | params.put("reqsn",REFUND_SN_PREFIX+reqsn); |
| | | params.put("oldreqsn",oldReqsn); |
| | | params.put("trxamt",money); |
| | | params.put("remark",remark); |
| | | return sendRequest(params,publicModel.getUrl()+"/tranx/refund",publicModel.getAppkey(),publicModel.getAppPubkey(),new TypeReference<PayOrderRefundResponse>(){}); |
| | | } |
| | | public PayOrderNotifyParam sendQueryOrder(String reqsn ) { |
| | | TreeMap<String, String> params = new TreeMap<String, String>(); |
| | | params.put("cusid", publicModel.getCusid()); |
| | | params.put("appid", publicModel.getAppid()); |
| | | params.put("version", publicModel.getVersion()); |
| | | params.put("trxid", ""); |
| | | params.put("randomstr", SybUtil.getValidatecode(8)); |
| | | params.put("signtype", publicModel.getSigntype()); |
| | | params.remove("sign"); |
| | | params.put("reqsn",reqsn); |
| | | return sendRequest(params,publicModel.getUrl()+"/tranx/query",publicModel.getAppkey(),publicModel.getAppPubkey(),new TypeReference<PayOrderNotifyParam>(){}); |
| | | } |
| | | public static <T> T sendRequest(TreeMap<String,String> params, String url, String appkey, String pubKey, TypeReference<T> typeReference ) { |
| | | try { |
| | | params.put("sign", SybUtil.unionSign(params,appkey,params.get("signtype"))); |
| | | String data =getHttpParamsStr(params); |
| | | log.error("订åäº¤ææ°æ®è¯·æ±================{}",data); |
| | | String result = HttpsUtil.post(url,data,"application/x-www-form-urlencoded",true); |
| | | log.error("è®¢åæ¥äº¤æ®è¿å================{}",result); |
| | | T map = handleResult(result,pubKey,params.get("signtype"),typeReference); |
| | | return map; |
| | | }catch (Exception e){ |
| | | log.error("éèè®¢åæ¥è¯¢å¼å¸¸================{}",e); |
| | | } |
| | | return null; |
| | | } |
| | | public static String getHttpParamsStr(Map<String, String> params ) throws IOException { |
| | | StringBuilder outBuf = new StringBuilder(); |
| | | boolean isNotFirst = false; |
| | | for (Map.Entry<String, String> entry: params.entrySet()){ |
| | | if (isNotFirst) |
| | | outBuf.append('&'); |
| | | isNotFirst = true; |
| | | outBuf |
| | | .append(entry.getKey()) |
| | | .append('=') |
| | | .append(URLEncoder.encode(StringUtils.defaultString(entry.getValue(),""), "UTF-8")); |
| | | } |
| | | System.out.println("åæ°:"+outBuf.toString()); |
| | | return outBuf.toString(); |
| | | } |
| | | |
| | | public static <T> T handleResult(String result,String pubKey,String signType, TypeReference<T> typeReference ) throws Exception{ |
| | | log.error("è¿åæ°æ®è¿å================{}",result); |
| | | Map map = SybUtil.json2ObjMap(result); |
| | | if(map == null){ |
| | | log.error("è¿åæ°æ®è¿åé误================{}",result); |
| | | throw new Exception("è¿åæ°æ®é误"); |
| | | } |
| | | if("SUCCESS".equals(map.get("retcode"))){ |
| | | TreeMap tmap = new TreeMap(); |
| | | tmap.putAll(map); |
| | | if(SybUtil.validSign(tmap, pubKey, signType)){ |
| | | T param = JSONObject.parseObject(result,typeReference.getType()); |
| | | return param; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static TreeMap<String, String> getParams(HttpServletRequest request){ |
| | | TreeMap<String, String> map = new TreeMap<String, String>(); |
| | | Map reqMap = request.getParameterMap(); |
| | | for(Object key:reqMap.keySet()){ |
| | | String value = ((String[])reqMap.get(key))[0]; |
| | | System.out.println(key+";"+value); |
| | | map.put(key.toString(),value); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * è®¢åæ¯ä»åæ°å¼æ¥éç¥è¿å |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * è®¢åæ¯ä»åæ° |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.allinpay.syb.model; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 订å鿬¾è¿å对象 |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | | @Data |
| | | @ApiModel("订å鿬¾è¿å对象") |
| | | public class PayOrderRefundResponse { |
| | | |
| | | private String cusid ;//åæ·å· å¹³å°åé
çåæ·å· å¦ 15 |
| | | private String appid ;//åºç¨ID å¹³å°åé
çAPPID å¦ 8 |
| | | private String trxid ;//交æåå· æ¶é¶å®å¹³å°ç鿬¾äº¤ææµæ°´å· å¦ 20 |
| | | private String reqsn ;//åæ·è®¢åå· åæ·ç鿬¾äº¤æè®¢åå· å¦ 32 |
| | | private String trxstatus ;//交æç¶æ 交æçç¶æ å¦ 4 è§éå½äº¤æè¿åç 说æ |
| | | private String fintime ;//交æå®ææ¶é´ yyyyMMddHHmmss æ¯ 14 |
| | | private String errmsg;// é误åå 失败çåå è¯´æ æ¯ 100 |
| | | private String fee ;//æç»è´¹ æ¯ 15 |
| | | private String trxcode ;//交æç±»å æ¯ 8 è§éå½äº¤æç±»å说æ |
| | | private String randomstr ;//éæºå符串 éæºçæçå符串 å¦ 32 |
| | | private String chnltrxid ;//æ¸ éæµæ°´å· å¦æ¯ä»å®ï¼å¾®ä¿¡å¹³å°è®¢åå· æ¯ 64 |
| | | private String chnldata;// æ¸ éä¿¡æ¯ æ¯ - |
| | | private String bankcode;// æå±é¶è¡ æ¯ |
| | | private String sign ;//ç¾å å¦ 32 详è§å®å
¨è§è |
| | | |
| | | private String retcode;// string å¦ æ¶é¶å®APPID 8 |
| | | private String retmsg;// string å¦ æ¶é¶å®APPID 8 |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * è®¢åæ¯ä»åæ°è¿å |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å工信æ¯å¯¼å
¥è¡¨ |
| | | * éèå
Œ
±é
ç½®åæ° |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/01/16 10:03 |
| | | */ |
| | |
| | | private String appkey; |
| | | private String url; |
| | | private String appPubkey; |
| | | private String notifyUrl; |
| | | |
| | | |
| | | } |
| | |
| | | package com.doumee.biz.system; |
| | | |
| | | import com.allinpay.syb.model.PayPublicModel; |
| | | import com.doumee.dao.common.dto.UpdateSortDTO; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | |
| | |
| | | */ |
| | | void sort(UpdateSortDTO dto); |
| | | |
| | | |
| | | PayPublicModel initPayPublicModel(); |
| | | void updateByIdNew(SystemDictData systemDictData); |
| | | SystemDictData queryByCode(String dicCode, String label); |
| | | String queryCodeById(Integer id); |
| | |
| | | package com.doumee.biz.system.impl; |
| | | |
| | | import com.allinpay.syb.model.PayPublicModel; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | public void updateById(SystemDictData systemDictData) { |
| | | systemDictDataService.updateById(systemDictData); |
| | | } |
| | | @Override |
| | | public PayPublicModel initPayPublicModel() { |
| | | PayPublicModel model = new PayPublicModel(); |
| | | model.setUrl( queryByCode(Constants.SYSTEM,Constants.PAY_SYB_CUSID).getCode()); |
| | | model.setCusid( queryByCode(Constants.SYSTEM,Constants.PAY_SYB_CUSID).getCode()); |
| | | model.setAppid(queryByCode(Constants.SYSTEM,Constants.PAY_SYB_APPID).getCode()); |
| | | model.setVersion(queryByCode(Constants.SYSTEM,Constants.PAY_VERSION).getCode()); |
| | | model.setSigntype( queryByCode(Constants.SYSTEM,Constants.PAY_SIGN_TYPE).getCode()); |
| | | model.setAppkey(queryByCode(Constants.SYSTEM,Constants.PAY_APPKEY).getCode()); |
| | | model.setUrl(queryByCode(Constants.SYSTEM,Constants.PAY_SYB_APIURL).getCode()); |
| | | model.setNotifyUrl(queryByCode(Constants.SYSTEM,Constants.PAY_NOTIFY_URL).getCode()); |
| | | model.setAppPubkey( queryByCode(Constants.SYSTEM,Constants.PAY_SYB_RSATLPUBKEY).getCode()); |
| | | return model; |
| | | } |
| | | |
| | | @Override |
| | | public void sort(UpdateSortDTO dto) { |
| | |
| | | } |
| | | SystemDictData preDictData = dictDataList.remove(index - 1); |
| | | dictDataList.add(index, preDictData); |
| | | } |
| | | // ä¸ç§» |
| | | else { |
| | | }else { |
| | | if (index + 1 > dictDataList.size() - 1) { |
| | | return; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.Refund; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | /** |
| | | * 订å鿬¾ä¿¡æ¯è¡¨Mapperå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-02-06 11:35:16 |
| | | */ |
| | | public interface RefundMapper extends MPJBaseMapper<Refund> { |
| | | } |
| | |
| | | @ApiModelProperty("ç»è®¡é") |
| | | @TableField(exist = false) |
| | | private Long num; |
| | | @ApiModelProperty("已鿬¾éé¢") |
| | | @TableField(exist = false) |
| | | private BigDecimal refundMoney; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | /** |
| | | * 订å鿬¾ä¿¡æ¯è¡¨Modelå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-02-06 11:35:16 |
| | | */ |
| | | @Data |
| | | @TableName("refund") |
| | | @ApiModel(value = "Refund å®ä½ç±»") |
| | | public class Refund { |
| | | |
| | | @ApiModelProperty("æ¯ä»ç¶æ:0=æªæ¯ä»;1=å·²æ¯ä»") |
| | | @ExcelColumn(name="æ¯ä»ç¶æ:0=æªæ¯ä»;1=å·²æ¯ä»",index=1 ,width=10) |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | @ApiModelProperty("æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤") |
| | | @ExcelColumn(name="æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤",index=2 ,width=10) |
| | | private Integer deleted; |
| | | @ApiModelProperty("å建人ç¼ç ") |
| | | @ExcelColumn(name="å建人ç¼ç ",index=3 ,width=10) |
| | | private Integer createUser; |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´",index=4 ,width=10) |
| | | private Date createTime; |
| | | @ApiModelProperty("æ´æ°äººç¼ç ") |
| | | @ExcelColumn(name="æ´æ°äººç¼ç ",index=5 ,width=10) |
| | | private Integer updateUser; |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @ExcelColumn(name="æ´æ°æ¶é´",index=6 ,width=10) |
| | | private Date updateTime; |
| | | @ApiModelProperty("夿³¨") |
| | | @ExcelColumn(name="夿³¨",index=7 ,width=10) |
| | | private String remark; |
| | | @ApiModelProperty("ç¶æ:0=å¤çä¸;1=æå;2=失败") |
| | | @ExcelColumn(name="ç¶æ:0=å¤çä¸;1=æå;2=失败",index=8 ,width=10) |
| | | private Integer status; |
| | | @ApiModelProperty("说æ") |
| | | @ExcelColumn(name="说æ",index=9 ,width=10) |
| | | private String detail; |
| | | @ApiModelProperty("å表å¾") |
| | | @ExcelColumn(name="å表å¾",index=10 ,width=10) |
| | | private String imgurl; |
| | | @ApiModelProperty("æåºç ï¼ååºä½¿ç¨ï¼") |
| | | @ExcelColumn(name="æåºç ï¼ååºä½¿ç¨ï¼",index=11 ,width=10) |
| | | private Integer sortnum; |
| | | @ApiModelProperty("éé¢ï¼åï¼") |
| | | @ExcelColumn(name="éé¢ï¼åï¼",index=12 ,width=10) |
| | | private BigDecimal money; |
| | | @ApiModelProperty("å½åä½é¢(åï¼") |
| | | @ExcelColumn(name="å½åä½é¢(åï¼",index=13 ,width=10) |
| | | private BigDecimal banlance; |
| | | @ApiModelProperty("éèäº¤ææµæ°´å·") |
| | | @ExcelColumn(name="éèäº¤ææµæ°´å·",index=14 ,width=10) |
| | | private String payOrderId; |
| | | @ApiModelProperty("éèäº¤ææµæ°´(微信æ¯ä»å®çå¹³å°äº¤ææµæ°´å¥½ï¼") |
| | | @ExcelColumn(name="éèäº¤ææµæ°´(微信æ¯ä»å®çå¹³å°äº¤ææµæ°´å¥½ï¼",index=15 ,width=10) |
| | | private String payThirdOrderId; |
| | | @ApiModelProperty("æ¯ä»ç»æè¯´æ") |
| | | @ExcelColumn(name="æ¯ä»ç»æè¯´æ",index=16 ,width=10) |
| | | private String payInfo; |
| | | @ApiModelProperty("éèäº¤ææ¸ éæ°æ®") |
| | | @ExcelColumn(name="éèäº¤ææ¸ éæ°æ®",index=17 ,width=10) |
| | | private String payThirdOrderData; |
| | | @ApiModelProperty("éè交ææç»è´¹ï¼åï¼") |
| | | @ExcelColumn(name="éè交ææç»è´¹ï¼åï¼",index=18 ,width=10) |
| | | private String payFee; |
| | | @ApiModelProperty("éè交æå¹³å°ç¼å·") |
| | | @ExcelColumn(name="éè交æå¹³å°ç¼å·",index=19 ,width=10) |
| | | private String payCode; |
| | | @ApiModelProperty("订åç¼ç ï¼å
³èorders)") |
| | | @ExcelColumn(name="订åç¼ç ï¼å
³èorders)",index=20 ,width=10) |
| | | private Integer orderId; |
| | | @ApiModelProperty("宿æ¶é´") |
| | | @ExcelColumn(name="宿æ¶é´",index=20 ,width=10) |
| | | private Date payDate; |
| | | |
| | | @ApiModelProperty("å¼å§æ¶é´") |
| | | @TableField(exist = false) |
| | | private Date starttime; |
| | | @ApiModelProperty("æªæ¢æ¶é´") |
| | | @TableField(exist = false) |
| | | private Date endtime; |
| | | |
| | | @ApiModelProperty("仿¬¾äººå§å") |
| | | @TableField(exist = false) |
| | | private String memberName; |
| | | @ApiModelProperty("仿¬¾äººå§å") |
| | | @TableField(exist = false) |
| | | private String memberPhone; |
| | | @ApiModelProperty("è´è´£äººç»é") |
| | | @TableField(exist = false) |
| | | private String username; |
| | | @ApiModelProperty("è´è´£äººå§å") |
| | | @TableField(exist = false) |
| | | private String userRealname; |
| | | @ApiModelProperty("仿¬¾äºç±") |
| | | @TableField(exist = false) |
| | | private Integer orderType; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Refund; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 订å鿬¾ä¿¡æ¯è¡¨Serviceå®ä¹ |
| | | * @author doumee |
| | | * @date 2026-02-06 11:35:16 |
| | | */ |
| | | public interface RefundService { |
| | | |
| | | /** |
| | | * å建 |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return Integer |
| | | */ |
| | | Integer create(Refund model); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(Integer id); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(Refund model); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<Integer> ids); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(Refund model); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param model å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<Refund> model); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return model |
| | | */ |
| | | Refund findById(Integer id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return Refund |
| | | */ |
| | | Refund findOne(Refund model); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return List<Refund> |
| | | */ |
| | | List<Refund> findList(Refund model); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<Refund> |
| | | */ |
| | | PageData<Refund> findPage(PageWrap<Refund> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | | * |
| | | * @param model å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(Refund model); |
| | | |
| | | void updateByPayStatus(Refund orders); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.allinpay.syb.lib.DoumeeTLUtil; |
| | | import com.allinpay.syb.lib.SybConstants; |
| | | import com.allinpay.syb.lib.SybUtil; |
| | | import com.allinpay.syb.model.PayPublicModel; |
| | |
| | | import com.allinpay.syb.model.PayOrderNotifyParam; |
| | | import com.allinpay.syb.model.PayOrderParam; |
| | | import com.allinpay.syb.model.PayOrderResponse; |
| | | import com.doumee.dao.business.RefundMapper; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.OrdersMapper; |
| | | import com.doumee.dao.business.model.Refund; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.vo.IndexOrderCountVO; |
| | |
| | | |
| | | @Autowired |
| | | private OrdersMapper ordersMapper; |
| | | @Autowired |
| | | private RefundMapper refundMapper; |
| | | @Autowired |
| | | private SystemUserMapper systemUserMapper; |
| | | @Autowired |
| | |
| | | IPage<Orders> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<Orders> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Orders.class) |
| | | .select("(select sum(r.money) from refund r where r.deleted=0 and r.status in(0,1) and r.order_id=t.id)",Orders::getRefundMoney) |
| | | .selectAs(SystemUser::getRealname,Orders::getUserRealname) |
| | | .selectAs(SystemUser::getUsername,Orders::getUsername) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,Orders::getUserId); |
| | |
| | | .eq(Orders::getStatus,Constants.ZERO) |
| | | .apply("TIMESTAMPDIFF(MINUTE, create_time ,now()) > "+time)); |
| | | if(orderList !=null && orderList.size()>0){ |
| | | PayPublicModel publicModel = initPayPublicModel(); |
| | | PayPublicModel publicModel =systemDictDataBiz.initPayPublicModel(); |
| | | Date date = new Date(); |
| | | for(Orders model : orderList){ |
| | | queryPayOrderDetailBiz(model,publicModel,date,time); |
| | |
| | | } |
| | | Orders model = ordersMapper.selectById(param.getId()); |
| | | if(model !=null ){ |
| | | PayPublicModel publicModel = initPayPublicModel(); |
| | | PayPublicModel publicModel =systemDictDataBiz.initPayPublicModel(); |
| | | Date date = new Date(); |
| | | queryPayOrderDetailBiz(model,publicModel,date,time); |
| | | } |
| | | } |
| | | |
| | | private void queryPayOrderDetailBiz(Orders model, PayPublicModel publicModel, Date date,int time) { |
| | | TreeMap<String,String> params = new TreeMap<String,String>(); |
| | | params.put("cusid",publicModel.getCusid()); |
| | | params.put("appid",publicModel.getAppid()); |
| | | params.put("version",publicModel.getVersion()); |
| | | params.put("trxid", ""); |
| | | params.put("randomstr", SybUtil.getValidatecode(8)); |
| | | params.put("signtype", publicModel.getSigntype()); |
| | | String appkey = publicModel.getAppkey(); |
| | | String url = publicModel.getUrl(); |
| | | String appPubkey = publicModel.getAppPubkey(); |
| | | params.remove("sign"); |
| | | params.put("reqsn", model.getId()+""); |
| | | PayOrderNotifyParam map = query(params,url,appkey,appPubkey); |
| | | DoumeeTLUtil doumeeTLUtil = new DoumeeTLUtil(publicModel); |
| | | PayOrderNotifyParam map = doumeeTLUtil.sendQueryOrder(model.getId()+""); |
| | | int status = Constants.TWO; |
| | | if(map!=null){ |
| | | String info = SybUtil.getPayInfoByStatus(map); |
| | |
| | | status = Constants.ONE; |
| | | } else if (StringUtils.equals(map.getTrxstatus(),"2000") || StringUtils.equals(map.getTrxstatus(),"2008")) { |
| | | //å¦æäº¤ææªæ¯ä»ï¼å¹¶ä¸æªè¶
è¿åå°æ¶ï¼ä¸å¤ç |
| | | if(date.getTime() - model.getCreateTime().getTime() < 30*60*1000){ |
| | | if(date.getTime() - model.getCreateTime().getTime() < time*60*1000){ |
| | | return; |
| | | } |
| | | } |
| | |
| | | ordersMapper.updateById(model) ; |
| | | } |
| | | |
| | | private PayPublicModel initPayPublicModel() { |
| | | PayPublicModel model = new PayPublicModel(); |
| | | model.setUrl(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_SYB_CUSID).getCode()); |
| | | model.setCusid( systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_SYB_CUSID).getCode()); |
| | | model.setAppid(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_SYB_APPID).getCode()); |
| | | model.setVersion(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_VERSION).getCode()); |
| | | model.setSigntype( systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_SIGN_TYPE).getCode()); |
| | | model.setAppkey(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_APPKEY).getCode()); |
| | | model.setUrl(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_SYB_APIURL).getCode()); |
| | | model.setAppPubkey( systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_SYB_RSATLPUBKEY).getCode()); |
| | | return model; |
| | | } |
| | | |
| | | public PayOrderNotifyParam query( TreeMap<String,String> params,String url,String appkey,String pubKey ) { |
| | | try { |
| | | params.put("sign", SybUtil.unionSign(params,appkey,SybConstants.SIGN_TYPE)); |
| | | String data =getHttpParamsStr(params); |
| | | log.error("è®¢åæ¥è¯¢æ°æ®è¯·æ±================{}",data); |
| | | String result = HttpsUtil.post(url+"/tranx/query",data,"application/x-www-form-urlencoded",true); |
| | | log.error("è®¢åæ¥è¯¢æ°æ®è¿å================{}",result); |
| | | PayOrderNotifyParam map = handleResult(result,pubKey,params.get("signtype")); |
| | | return map; |
| | | }catch (Exception e){ |
| | | log.error("éèè®¢åæ¥è¯¢å¼å¸¸================{}",e); |
| | | } |
| | | return null; |
| | | } |
| | | public String getHttpParamsStr(Map<String, String> params ) throws IOException { |
| | | StringBuilder outBuf = new StringBuilder(); |
| | | boolean isNotFirst = false; |
| | | for (Map.Entry<String, String> entry: params.entrySet()){ |
| | | if (isNotFirst) |
| | | outBuf.append('&'); |
| | | isNotFirst = true; |
| | | outBuf |
| | | .append(entry.getKey()) |
| | | .append('=') |
| | | .append(URLEncoder.encode(entry.getValue(), "UTF-8")); |
| | | } |
| | | System.out.println("åæ°:"+outBuf.toString()); |
| | | return outBuf.toString(); |
| | | } |
| | | |
| | | public static PayOrderNotifyParam handleResult(String result,String pubKey,String signType) throws Exception{ |
| | | log.error("è¿åæ°æ®è¿å================{}",result); |
| | | Map map = SybUtil.json2ObjMap(result); |
| | | if(map == null){ |
| | | log.error("è¿åæ°æ®è¿åé误================{}",result); |
| | | throw new Exception("è¿åæ°æ®é误"); |
| | | } |
| | | if("SUCCESS".equals(map.get("retcode"))){ |
| | | TreeMap tmap = new TreeMap(); |
| | | tmap.putAll(map); |
| | | if(SybUtil.validSign(tmap, pubKey, signType)){ |
| | | PayOrderNotifyParam param = JSONObject.toJavaObject(JSONObject.parseObject(result),PayOrderNotifyParam.class); |
| | | return param; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | @Override |
| | | public void returnPage(PayOrderParam param, HttpServletResponse response) throws IOException { |
| | | // String url =systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_RETURN_WEB_URL).getCode(); |
| | |
| | | r ="æ¯ä»ç»æå¼å¸¸ï¼å¦æçé®è¯·è系客æäººå"; |
| | | return; |
| | | } |
| | | Orders model = ordersMapper.selectOne(new QueryWrapper<Orders>().lambda() |
| | | .eq(Orders::getId,Integer.parseInt(map.getCusorderid())) |
| | | ); |
| | | if(model ==null){ |
| | | log.error("æ¯ä»å¤ç失败======æªæ¾å°äº¤æè®¢å"+map.getCusorderid()); |
| | | r ="æ¯ä»ç»æå¼å¸¸ï¼è®¢åæ¥è¯¢å¤±è´¥ï¼å¦æçé®è¯·è系客æäººå"; |
| | | return; |
| | | } |
| | | if(Constants.equalsInteger(model.getPayStatus(),Constants.ONE)){ |
| | | log.error("æ¯ä»å¤ç======订åå·²æ¯ä»"+map.getCusorderid()); |
| | | return; |
| | | } |
| | | String info = SybUtil.getPayInfoByStatus(map); |
| | | if(StringUtils.equals(map.getTrxcode(),"VSP501") |
| | | ||StringUtils.equals(map.getTrxcode(),"VSP511") |
| | | ||StringUtils.equals(map.getTrxcode(),"VSP551")){ |
| | | //交æç±»åæ¯ å¾®ä¿¡æ¯ä» ãæ¯ä»å®æ¯ä»æè
é¶èæ«ç æ¯ä»ï¼è®°å½æ¯ä»ç¶æ |
| | | if(StringUtils.equals(map.getTrxstatus(),"0000")){ |
| | | //交ææå |
| | | model.setPayStatus(Constants.ONE); |
| | | model.setStatus(Constants.ONE); |
| | | }else{ |
| | | //交æå¤±è´¥ |
| | | model.setStatus(Constants.TWO); |
| | | } |
| | | }else{ |
| | | model.setStatus(Constants.TWO); |
| | | dealOrdersResultBiz(info,map,r); |
| | | }else if(StringUtils.equals(map.getTrxcode(),"VSP503") |
| | | ||StringUtils.equals(map.getTrxcode(),"VSP513") |
| | | ||StringUtils.equals(map.getTrxcode(),"VSP553")){ |
| | | //交æç±»åæ¯ å¾®ä¿¡t鿬¾ ãæ¯ä»å®æ¯ä»é款æè
é¶èæ«ç éè´§ï¼è®°å½æ¯ä»ç¶æ |
| | | dealRefunResultBiz(info,map,r);//å¤ç鿬¾ |
| | | }else { |
| | | //å
¶ä»ç±»åä¸éç¥ |
| | | } |
| | | model.setPayFee(map.getFee()); |
| | | model.setPayDate(DateUtil.fromStringToDate("yyyyMMddHHmmss",map.getPaytime())); |
| | | model.setPayOrderId(map.getSrctrxid());//éè订åå· |
| | | model.setPayThirdOrderId(map.getChnltrxid());//æ¯ä»å®å¾®ä¿¡è®¢åå· |
| | | model.setPayThirdOrderData(map.getChnldata());//䏿¹äº¤ææ¸ éæ°æ® |
| | | model.setPayInfo(info); |
| | | model.setPayCode(map.getTrxcode()); |
| | | ordersMapper.updateById(model); |
| | | |
| | | }else{ |
| | | log.error("æ¯ä»éªç¾å¤±è´¥======"); |
| | | r ="æ¯ä»å¤±è´¥ï¼å¦æçé®è¯·è系客æäººå"; |
| | | return; |
| | | } |
| | | //éªç¾å®æ¯è¿è¡ä¸å¡å¤ç |
| | | } catch (Exception e) {//å¤çå¼å¸¸ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public TreeMap<String, String> getParams(HttpServletRequest request){ |
| | | TreeMap<String, String> map = new TreeMap<String, String>(); |
| | | Map reqMap = request.getParameterMap(); |
| | | for(Object key:reqMap.keySet()){ |
| | | String value = ((String[])reqMap.get(key))[0]; |
| | | System.out.println(key+";"+value); |
| | | map.put(key.toString(),value); |
| | | private String dealRefunResultBiz(String info, PayOrderNotifyParam map, String r) { |
| | | Refund model = refundMapper.selectOne(new QueryWrapper<Refund>().lambda() |
| | | .eq(Refund::getId,Integer.parseInt(map.getCusorderid().replace(DoumeeTLUtil.REFUND_SN_PREFIX,""))) |
| | | ); |
| | | if(model ==null){ |
| | | log.error("æ¯ä»å¤ç失败======æªæ¾å°äº¤æè®¢å"+map.getCusorderid()); |
| | | return "æ¯ä»ç»æå¼å¸¸ï¼è®¢åæ¥è¯¢å¤±è´¥ï¼å¦æçé®è¯·è系客æäººå"; |
| | | } |
| | | return map; |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ONE)){ |
| | | log.error("æ¯ä»å¤ç======订åå·²æ¯ä»"+map.getCusorderid()); |
| | | return "订åå·²æ¯ä»"; |
| | | } |
| | | if(StringUtils.equals(map.getTrxstatus(),"0000")){ |
| | | //交ææå |
| | | model.setStatus(Constants.ONE); |
| | | }else{ |
| | | //交æå¤±è´¥ |
| | | model.setStatus(Constants.TWO); |
| | | } |
| | | model.setPayFee(map.getFee()); |
| | | model.setPayDate(DateUtil.fromStringToDate("yyyyMMddHHmmss",map.getPaytime())); |
| | | model.setPayOrderId(map.getTrxid());//éè订åå· |
| | | model.setPayThirdOrderId(map.getChnltrxid());//æ¯ä»å®å¾®ä¿¡è®¢åå· |
| | | model.setPayThirdOrderData(map.getChnldata());//䏿¹äº¤ææ¸ éæ°æ® |
| | | model.setPayInfo(info); |
| | | model.setPayCode(map.getTrxcode()); |
| | | refundMapper.updateById(model); |
| | | return r; |
| | | } |
| | | |
| | | private String dealOrdersResultBiz(String info, PayOrderNotifyParam map,String r) { |
| | | Orders model = ordersMapper.selectOne(new QueryWrapper<Orders>().lambda() |
| | | .eq(Orders::getId,Integer.parseInt(map.getCusorderid())) |
| | | ); |
| | | if(model ==null){ |
| | | log.error("æ¯ä»å¤ç失败======æªæ¾å°äº¤æè®¢å"+map.getCusorderid()); |
| | | return "æ¯ä»ç»æå¼å¸¸ï¼è®¢åæ¥è¯¢å¤±è´¥ï¼å¦æçé®è¯·è系客æäººå"; |
| | | } |
| | | if(Constants.equalsInteger(model.getPayStatus(),Constants.ONE)){ |
| | | log.error("æ¯ä»å¤ç======订åå·²æ¯ä»"+map.getCusorderid()); |
| | | return "订åå·²æ¯ä»"; |
| | | } |
| | | if(StringUtils.equals(map.getTrxstatus(),"0000")){ |
| | | //交ææå |
| | | model.setPayStatus(Constants.ONE); |
| | | model.setStatus(Constants.ONE); |
| | | }else{ |
| | | //交æå¤±è´¥ |
| | | model.setStatus(Constants.TWO); |
| | | } |
| | | model.setPayFee(map.getFee()); |
| | | model.setPayDate(DateUtil.fromStringToDate("yyyyMMddHHmmss",map.getPaytime())); |
| | | model.setPayOrderId(map.getTrxid());//éè订åå· |
| | | model.setPayThirdOrderId(map.getChnltrxid());//æ¯ä»å®å¾®ä¿¡è®¢åå· |
| | | model.setPayThirdOrderData(map.getChnldata());//䏿¹äº¤ææ¸ éæ°æ® |
| | | model.setPayInfo(info); |
| | | model.setPayCode(map.getTrxcode()); |
| | | ordersMapper.updateById(model); |
| | | return r; |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.allinpay.syb.lib.DoumeeTLUtil; |
| | | import com.allinpay.syb.lib.SybUtil; |
| | | import com.allinpay.syb.model.PayOrderNotifyParam; |
| | | import com.allinpay.syb.model.PayOrderRefundResponse; |
| | | import com.allinpay.syb.model.PayPublicModel; |
| | | 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.dao.business.OrdersMapper; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.dao.business.model.Refund; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.RefundMapper; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.RefundService; |
| | | 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.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.sql.Ref; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.TreeMap; |
| | | |
| | | /** |
| | | * 订å鿬¾ä¿¡æ¯è¡¨Serviceå®ç° |
| | | * @author doumee |
| | | * @date 2026-02-06 11:35:16 |
| | | */ |
| | | @Service |
| | | public class RefundServiceImpl implements RefundService { |
| | | |
| | | @Autowired |
| | | private RefundMapper refundMapper; |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private OrdersMapper ordersMapper; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Integer create(Refund model) { |
| | | if(model.getOrderId()==null |
| | | ||model.getMoney()==null |
| | | ||model.getMoney().compareTo(new BigDecimal("0.01")) < 0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请æç
§è¦æ±å¡«åä¿¡æ¯ï¼"); |
| | | } |
| | | |
| | | model.setMoney(model.getMoney().multiply(new BigDecimal(100)));//åä½å |
| | | Orders order = ordersMapper.selectById(model.getOrderId()); |
| | | if(order==null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"订åä¿¡æ¯ä¸åå¨ï¼"); |
| | | } |
| | | if(!Constants.equalsInteger(order.getStatus(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"è®¢åæªäº¤ææåï¼ä¸æ¯æé款æä½ï¼"); |
| | | } |
| | | if( Constants.formatBigDecimal(model.getMoney()).compareTo(Constants.formatBigDecimal(order.getMoney())) >=0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鿬¾éé¢ä¸è½è¶
è¿è®¢åéé¢ï¼"); |
| | | } |
| | | Refund sum = refundMapper.selectOne(new QueryWrapper<Refund>().select("sum(money) as money").lambda() |
| | | .eq(Refund::getDeleted,Constants.ZERO) |
| | | .eq(Refund::getOrderId,model.getOrderId()) |
| | | .in(Refund::getStatus,Constants.ZERO,Constants.ONE) |
| | | ); |
| | | if(sum!=null && Constants.formatBigDecimal(sum.getMoney()).compareTo(Constants.formatBigDecimal(order.getMoney())) >=0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"该订å鿬¾æ»é¢å·²è¾¾ä¸éï¼"); |
| | | } |
| | | Date date = new Date(); |
| | | model.setCreateTime(date); |
| | | model.setStatus(Constants.ZERO); |
| | | model.setDeleted(Constants.ZERO); |
| | | model.setBanlance(Constants.formatBigDecimal(order.getMoney()).subtract(Constants.formatBigDecimal( model.getMoney()))); |
| | | if(sum!=null){ |
| | | model.setBanlance(Constants.formatBigDecimal(model.getBanlance()).subtract(Constants.formatBigDecimal( sum.getMoney())));//å½åè¿å¯æç°ä½é¢ |
| | | } |
| | | refundMapper.insert(model); |
| | | DoumeeTLUtil doumeeTLUtil = new DoumeeTLUtil(systemDictDataBiz.initPayPublicModel()); |
| | | PayOrderRefundResponse map = doumeeTLUtil.sendRefundOrder(model.getId()+"",model.getOrderId()+"", model.getMoney().intValue()+"",model.getRemark()); |
| | | if(map ==null || !StringUtils.equals(map.getRetcode(),DoumeeTLUtil.SUCCESS_CODE) || !StringUtils.equals(map.getTrxstatus(),"0000")){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对ä¸èµ·ï¼åèµ·éæ¬¾å¤±è´¥,"+(map!=null?map.getErrmsg():"")); |
| | | } |
| | | return model.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | refundMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Refund refund) { |
| | | UpdateWrapper<Refund> deleteWrapper = new UpdateWrapper<>(refund); |
| | | refundMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<Integer> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | refundMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(Refund refund) { |
| | | refundMapper.updateById(refund); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<Refund> refunds) { |
| | | if (CollectionUtils.isEmpty(refunds)) { |
| | | return; |
| | | } |
| | | for (Refund refund: refunds) { |
| | | this.updateById(refund); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Refund findById(Integer id) { |
| | | return refundMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Refund findOne(Refund refund) { |
| | | QueryWrapper<Refund> wrapper = new QueryWrapper<>(refund).last("limit 1"); |
| | | return refundMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<Refund> findList(Refund refund) { |
| | | QueryWrapper<Refund> wrapper = new QueryWrapper<>(refund); |
| | | return refundMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByPayStatus(Refund param) { |
| | | int time = 30; |
| | | try { |
| | | time = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.PAY_VALID_TIME).getCode()); |
| | | }catch (Exception e){ |
| | | } |
| | | Refund model = refundMapper.selectById(param.getId()); |
| | | if(model !=null ){ |
| | | PayPublicModel publicModel =systemDictDataBiz.initPayPublicModel(); |
| | | Date date = new Date(); |
| | | queryPayOrderDetailBiz(model,publicModel,date,time); |
| | | } |
| | | } |
| | | |
| | | private void queryPayOrderDetailBiz(Refund model, PayPublicModel publicModel, Date date,int time) { |
| | | DoumeeTLUtil doumeeTLUtil = new DoumeeTLUtil(publicModel); |
| | | PayOrderNotifyParam map = doumeeTLUtil.sendQueryOrder(DoumeeTLUtil.REFUND_SN_PREFIX+model.getId()+""); |
| | | int status = Constants.TWO; |
| | | if(map!=null){ |
| | | String info = SybUtil.getPayInfoByStatus(map); |
| | | if(StringUtils.equals(map.getTrxcode(),"VSP503") |
| | | ||StringUtils.equals(map.getTrxcode(),"VSP513") |
| | | ||StringUtils.equals(map.getTrxcode(),"VSP553")){ |
| | | // //交æç±»åæ¯ å¾®ä¿¡t鿬¾ ãæ¯ä»å®æ¯ä»é款æè
é¶èæ«ç éè´§ï¼è®°å½æ¯ä»ç¶æ |
| | | if(StringUtils.equals(map.getTrxstatus(),"0000")){ |
| | | //交ææå |
| | | status = Constants.ONE; |
| | | } else if (StringUtils.equals(map.getTrxstatus(),"2000") || StringUtils.equals(map.getTrxstatus(),"2008")) { |
| | | //å¦æäº¤ææªæ¯ä»ï¼å¹¶ä¸æªè¶
è¿åå°æ¶ï¼ä¸å¤ç |
| | | if(date.getTime() - model.getCreateTime().getTime() < time*60*1000){ |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | model.setPayFee(map.getFee()); |
| | | model.setStatus(status); |
| | | model.setPayDate(DateUtil.fromStringToDate("yyyyMMddHHmmss",map.getPaytime())); |
| | | model.setPayOrderId(map.getSrctrxid());//éè订åå· |
| | | model.setPayThirdOrderId(map.getChnltrxid());//æ¯ä»å®å¾®ä¿¡è®¢åå· |
| | | model.setPayThirdOrderData(map.getChnldata());//䏿¹äº¤ææ¸ éæ°æ® |
| | | model.setPayInfo(info); |
| | | model.setPayCode(map.getTrxcode()); |
| | | }else{ |
| | | model.setPayInfo("è¶
æ¶æ ç»æï¼èªå¨åæ¶"); |
| | | model.setStatus(Constants.TWO); |
| | | } |
| | | model.setUpdateTime(date); |
| | | refundMapper.updateById(model) ; |
| | | } |
| | | |
| | | @Override |
| | | public PageData<Refund> findPage(PageWrap<Refund> pageWrap) { |
| | | IPage<Refund> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<Refund> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Refund.class) |
| | | .selectAs(SystemUser::getRealname,Refund::getUserRealname) |
| | | .selectAs(SystemUser::getUsername,Refund::getUsername) |
| | | .selectAs(Orders::getName,Refund::getMemberName) |
| | | .selectAs(Orders::getPhone,Refund::getMemberPhone) |
| | | .leftJoin(Orders.class,Orders::getId,Refund::getOrderId) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,Refund::getCreateUser); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | pageWrap.getModel().setDeleted(Constants.ZERO); |
| | | queryWrapper.eq(pageWrap.getModel().getId() != null,Refund::getId, pageWrap.getModel().getId()); |
| | | queryWrapper.eq(pageWrap.getModel().getDeleted() != null,Refund::getDeleted, pageWrap.getModel().getDeleted()); |
| | | queryWrapper.eq(pageWrap.getModel().getCreateUser() != null,Refund::getCreateUser, pageWrap.getModel().getCreateUser()); |
| | | queryWrapper.eq(pageWrap.getModel().getUpdateUser() != null,Refund::getUpdateUser, pageWrap.getModel().getUpdateUser()); |
| | | queryWrapper.eq(pageWrap.getModel().getRemark() != null,Refund::getRemark, pageWrap.getModel().getRemark()); |
| | | queryWrapper.eq(pageWrap.getModel().getStatus() != null,Refund::getStatus, pageWrap.getModel().getStatus()); |
| | | queryWrapper.eq(pageWrap.getModel().getDetail() != null,Refund::getDetail, pageWrap.getModel().getDetail()); |
| | | queryWrapper.eq(pageWrap.getModel().getImgurl() != null,Refund::getImgurl, pageWrap.getModel().getImgurl()); |
| | | queryWrapper.eq(pageWrap.getModel().getSortnum() != null,Refund::getSortnum, pageWrap.getModel().getSortnum()); |
| | | queryWrapper.eq(pageWrap.getModel().getMoney() != null,Refund::getMoney, pageWrap.getModel().getMoney()); |
| | | queryWrapper.eq(pageWrap.getModel().getBanlance() != null,Refund::getBanlance, pageWrap.getModel().getBanlance()); |
| | | queryWrapper.eq(pageWrap.getModel().getPayOrderId() != null,Refund::getPayOrderId, pageWrap.getModel().getPayOrderId()); |
| | | queryWrapper.eq(pageWrap.getModel().getPayThirdOrderId() != null,Refund::getPayThirdOrderId, pageWrap.getModel().getPayThirdOrderId()); |
| | | queryWrapper.eq(pageWrap.getModel().getPayInfo() != null,Refund::getPayInfo, pageWrap.getModel().getPayInfo()); |
| | | queryWrapper.eq(pageWrap.getModel().getPayThirdOrderData() != null,Refund::getPayThirdOrderData, pageWrap.getModel().getPayThirdOrderData()); |
| | | queryWrapper.eq(pageWrap.getModel().getPayFee() != null,Refund::getPayFee, pageWrap.getModel().getPayFee()); |
| | | queryWrapper.eq(pageWrap.getModel().getPayCode() != null,Refund::getPayCode, pageWrap.getModel().getPayCode()); |
| | | queryWrapper.eq(pageWrap.getModel().getOrderType() != null,Orders::getType, pageWrap.getModel().getOrderType()); |
| | | queryWrapper.eq(pageWrap.getModel().getOrderId() != null,Refund::getOrderId, pageWrap.getModel().getOrderId()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getMemberPhone() ) ,Orders::getName, pageWrap.getModel().getMemberPhone()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getMemberName() ) ,Orders::getName, pageWrap.getModel().getMemberName()); |
| | | queryWrapper.ge(pageWrap.getModel().getStarttime()!=null,Refund::getCreateTime , pageWrap.getModel().getStarttime()); |
| | | queryWrapper.le(pageWrap.getModel().getEndtime()!=null,Refund::getCreateTime , pageWrap.getModel().getEndtime()); |
| | | queryWrapper.orderByDesc(Refund::getId); |
| | | |
| | | return PageData.from(refundMapper.selectJoinPage(page,Refund.class, queryWrapper)); |
| | | } |
| | | @Override |
| | | public long count(Refund refund) { |
| | | QueryWrapper<Refund> wrapper = new QueryWrapper<>(refund); |
| | | return refundMapper.selectCount(wrapper); |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <image v-if="info.status ==1" src="/static/ic_paysuccess@2x.png" mode="widthFix" class="icon"></image> |
| | | <image v-else-if="info.status ==2" src="/static/ic_payfail.png" mode="widthFix" class="icon"></image> |
| | | <image v-else src="/static/ic_paysuccess@2x.png" mode="widthFix" class="icon"></image> |
| | | |
| | | <image v-else src="/static/ic_paysuccess@2x.png" mode="widthFix" class="icon"></image> |
| | | </template> |
| | | <view class="title" v-if="info.id">{{info.status==0?'çå¾
æ¯ä»':(info.status==1?'æ¯ä»æå':'æ¯ä»å¤±è´¥')}}</view> |
| | | <view class="title" v-if="!info.id">æ¥è¯¢ä¸</view> |