Procházet zdrojové kódy

添加用户钱包余额代码

qmj před 4 měsíci
rodič
revize
6630b3a30d
51 změnil soubory, kde provedl 1078 přidání a 319 odebrání
  1. 1 0
      foodie_admin_vue/package.json
  2. 9 0
      foodie_admin_vue/src/api/infouser/user.js
  3. 1 1
      foodie_admin_vue/src/api/language/index.js
  4. 13 0
      foodie_admin_vue/src/api/language/language.en_US.js
  5. 14 1
      foodie_admin_vue/src/api/language/language.vi.js
  6. 13 0
      foodie_admin_vue/src/api/language/language.zh_CN.js
  7. 13 0
      foodie_admin_vue/src/api/language/language.zh_TW.js
  8. 1 1
      foodie_admin_vue/src/components/Breadcrumb/index.vue
  9. 1 1
      foodie_admin_vue/src/components/TopNav/index.vue
  10. 219 0
      foodie_admin_vue/src/components/googmap.vue
  11. 5 4
      foodie_admin_vue/src/components/i18n/i18n.vue
  12. 1 1
      foodie_admin_vue/src/layout/components/Sidebar/SidebarItem.vue
  13. 1 1
      foodie_admin_vue/src/layout/components/Sidebar/index.vue
  14. 71 1
      foodie_admin_vue/src/views/infouser/user/nightMarket.vue
  15. 3 1
      foodie_admin_vue/src/views/system/appeal/order1.vue
  16. 3 1
      foodie_admin_vue/src/views/system/appeal/order2.vue
  17. 3 1
      foodie_admin_vue/src/views/system/appeal/order3.vue
  18. 3 1
      foodie_admin_vue/src/views/system/order/index.vue
  19. 20 3
      foodie_sj_vue/src/components/googmap.vue
  20. 11 4
      foodie_sj_vue/src/views/AcidrollingCapacity.vue
  21. 6 6
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PointController.java
  22. 0 48
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PointController.java~
  23. 5 11
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PosOrderController.java
  24. 4 4
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PosOrderRatingController.java
  25. 4 4
      ruoyi-admin/src/main/java/com/ruoyi/app/order/PosReviewController.java
  26. 89 21
      ruoyi-admin/src/main/java/com/ruoyi/app/order/UserOrderController.java
  27. 20 1
      ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreatItem.java
  28. 8 3
      ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreateInput.java
  29. 166 48
      ruoyi-admin/src/main/java/com/ruoyi/app/service/WalletService.java
  30. 3 0
      ruoyi-admin/src/main/java/com/ruoyi/app/user/InfoUserController.java
  31. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/app/utils/SysFileInfoController.java
  32. 8 8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PointTransactionController.java
  33. 11 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/InfoUser.java
  34. 24 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/OrderParent.java
  35. 146 56
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PosOrder.java
  36. 5 1
      ruoyi-system/src/main/java/com/ruoyi/system/domain/UserWallet.java
  37. 11 12
      ruoyi-system/src/main/java/com/ruoyi/system/domain/WalletTransaction.java
  38. 1 2
      ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/OrderDTO.java
  39. 6 6
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/WalletTransactionMapper.java
  40. 6 6
      ruoyi-system/src/main/java/com/ruoyi/system/service/IPointsTransactionService.java
  41. 8 8
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PointsTransactionServiceImpl.java
  42. 1 0
      ruoyi-system/src/main/java/com/ruoyi/system/utils/GetArea.java
  43. 18 3
      ruoyi-system/src/main/resources/mapper/infouser/InfoUserMapper.xml
  44. 16 1
      ruoyi-system/src/main/resources/mapper/system/OrderParentMapper.xml
  45. 19 1
      ruoyi-system/src/main/resources/mapper/system/PosOrderMapper.xml
  46. 6 1
      ruoyi-system/src/main/resources/mapper/system/UserWalletMapper.xml
  47. 20 20
      ruoyi-system/src/main/resources/mapper/system/WalletTransactionMapper.xml
  48. 18 3
      ruoyi-system/target/classes/mapper/infouser/InfoUserMapper.xml
  49. 16 1
      ruoyi-system/target/classes/mapper/system/OrderParentMapper.xml
  50. 6 1
      ruoyi-system/target/classes/mapper/system/UserWalletMapper.xml
  51. 20 20
      ruoyi-system/target/classes/mapper/system/WalletTransactionMapper.xml

+ 1 - 0
foodie_admin_vue/package.json

@@ -37,6 +37,7 @@
     "url": "https://gitee.com/y_project/RuoYi-Vue.git"
   },
   "dependencies": {
+    "@googlemaps/js-api-loader": "^1.16.10",
     "@riophae/vue-treeselect": "0.4.0",
     "axios": "0.24.0",
     "clipboard": "2.0.8",

+ 9 - 0
foodie_admin_vue/src/api/infouser/user.js

@@ -42,3 +42,12 @@ export function delUser(userId) {
     method: 'delete'
   })
 }
+
+// 获取地址信息
+export function getAddr(params) {
+  return request({
+    url: '/utils/getAddr',
+    method: 'get',
+    params: params
+  })
+}

+ 1 - 1
foodie_admin_vue/src/api/language/index.js

@@ -32,7 +32,7 @@ const messages = {
   }
 }
 const i18n = new VueI18n({
-  locale: localStorage.getItem('lang') || 'vi', // 通过this.$i18n.locale的值实现语言切换
+  locale: localStorage.getItem('lang') || 'zh_TW', // 通过this.$i18n.locale的值实现语言切换
   messages,
 });
 

+ 13 - 0
foodie_admin_vue/src/api/language/language.en_US.js

@@ -462,6 +462,10 @@ export default {
     "详细地址不能为空":"The detailed address cannot be empty",
     "经度不能为空":"Longitude cannot be empty",
     "纬度不能为空":"Latitude cannot be empty",
+    "SearchAddress":"Search Address",
+    "Pleasekeywords":"Please enter keywords",
+    "currentlocation":"Current location",
+    "Selectmapobtainaddress":"Please select map to get address",
     "类型不能为空":"Type cannot be empty",
     "卫生许可不能为空":"Hygiene permit cannot be empty",
     "分类不能为空":"Classification cannot be empty",
@@ -595,8 +599,17 @@ export default {
     "删除成功":"Successfully deleted",
     "夜市名称":"Night Market Name",
     "请输入夜市名称":"Please enter night market name",
+    "地址":"Address",
+    "请输入地址":"Please enter address",
+    "坐标":"Coordinates",
+    "定位获取坐标":"Get coordinates by positioning",
+    "选择地址":"Select Address",
+    "请选择地图获取地址":"Please select map to get address",
+    "地址不能为空":"Address cannot be empty",
+    "坐标不能为空":"Coordinates cannot be empty",
     "添加夜市信息":"Add Night Market Information",
     "修改夜市信息":"Modify Night Market Information",
+    "夜市审核":"Night Market Review",
     "请输入夜市负责人":"Please enter night market manager",
     "夜市类型":"Night Market Type"
   },

+ 14 - 1
foodie_admin_vue/src/api/language/language.vi.js

@@ -461,6 +461,10 @@ export default {
       "详细地址不能为空":"Địa chỉ chi tiết không được để trống",
       "经度不能为空":"Kinh độ không được để trống",
       "纬度不能为空":"Vĩ độ không được để trống",
+      "SearchAddress":"Tìm kiếm địa chỉ",
+      "Pleasekeywords":"Xin nhập từ khóa",
+      "currentlocation":"Vị trí hiện tại",
+      "Selectmapobtainaddress":"Xin chọn bản đồ để lấy địa chỉ",
       "类型不能为空":"Loại hình không được để trống",
       "卫生许可不能为空":"Mã số thuế không được để trống",
       "分类不能为空":"Phân loại không được để trống",
@@ -594,8 +598,17 @@ export default {
       "删除成功":"Xoá bỏ thành công",
       "夜市名称":"Tên chợ đêm",
       "请输入夜市名称":"Xin nhập vào tên chợ đêm",
+      "地址":"Địa chỉ",
+      "请输入地址":"Xin nhập vào địa chỉ",
+      "坐标":"Tọa độ",
+      "定位获取坐标":"Lấy tọa độ bằng định vị",
+      "选择地址":"Chọn địa chỉ",
+      "请选择地图获取地址":"Xin chọn bản đồ để lấy địa chỉ",
+      "地址不能为空":"Địa chỉ không được để trống",
+      "坐标不能为空":"Tọa độ không được để trống",
       "添加夜市信息":"Thêm thông tin chợ đêm",
-      "修改夜市信息":"Sửa đổi thông tin chợ đêm",
+      "修改夜市信息":"Sửa thông tin chợ đêm",
+      "夜市审核":"Xét duyệt chợ đêm",
       "请输入夜市负责人":"Xin nhập vào người phụ trách chợ đêm",
       "夜市类型":"Loại chợ đêm"
     },

+ 13 - 0
foodie_admin_vue/src/api/language/language.zh_CN.js

@@ -464,6 +464,10 @@ export default {
     "详细地址不能为空":"详细地址不能为空",
     "经度不能为空":"经度不能为空",
     "纬度不能为空":"纬度不能为空",
+    "SearchAddress":"搜索地址",
+    "Pleasekeywords":"请输入关键词",
+    "currentlocation":"当前位置",
+    "Selectmapobtainaddress":"请选择地图获取地址",
     "类型不能为空":"类型不能为空",
     "卫生许可不能为空":"税务号不能为空",
     "分类不能为空":"分类不能为空",
@@ -597,8 +601,17 @@ export default {
     "删除成功":"删除成功",
     "夜市名称":"夜市名称",
     "请输入夜市名称":"请输入夜市名称",
+    "地址":"地址",
+    "请输入地址":"请输入地址",
+    "坐标":"坐标",
+    "定位获取坐标":"定位获取坐标",
+    "选择地址":"选择地址",
+    "请选择地图获取地址":"请选择地图获取地址",
+    "地址不能为空":"地址不能为空",
+    "坐标不能为空":"坐标不能为空",
     "添加夜市信息":"添加夜市信息",
     "修改夜市信息":"修改夜市信息",
+    "夜市审核":"夜市审核",
     "请输入夜市负责人":"请输入夜市负责人",
     "夜市类型":"夜市类型"
   },

+ 13 - 0
foodie_admin_vue/src/api/language/language.zh_TW.js

@@ -460,6 +460,10 @@ export default {
     "详细地址不能为空":"詳細地址不能為空",
     "经度不能为空":"經度不能為空",
     "纬度不能为空":"緯度不能為空",
+    "SearchAddress":"蒐索地址",
+    "Pleasekeywords":"請輸入關鍵詞",
+    "currentlocation":"目前位置",
+    "Selectmapobtainaddress":"請選擇地圖獲取地址",
     "类型不能为空":"類型不能為空",
     "卫生许可不能为空":"稅務號不能為空",
     "分类不能为空":"分類不能為空",
@@ -593,8 +597,17 @@ export default {
     "删除成功":"删除成功",
     "夜市名称":"夜市名稱",
     "请输入夜市名称":"請輸入夜市名稱",
+    "地址":"地址",
+    "请输入地址":"請輸入地址",
+    "坐标":"座標",
+    "定位获取坐标":"定位獲取座標",
+    "选择地址":"選擇地址",
+    "请选择地图获取地址":"請選擇地圖獲取地址",
+    "地址不能为空":"地址不能為空",
+    "坐标不能为空":"座標不能為空",
     "添加夜市信息":"添加夜市資訊",
     "修改夜市信息":"修改夜市資訊",
+    "夜市审核":"夜市稽核",
     "请输入夜市负责人":"請輸入夜市負責人",
     "夜市类型":"夜市類型"
   },

+ 1 - 1
foodie_admin_vue/src/components/Breadcrumb/index.vue

@@ -17,7 +17,7 @@ export default {
   data() {
     return {
       levelList: null,
-      language: localStorage.getItem('lang') || 'vi'
+      language: localStorage.getItem('lang') || 'zh_TW'
     }
   },
   watch: {

+ 1 - 1
foodie_admin_vue/src/components/TopNav/index.vue

@@ -42,7 +42,7 @@ export default {
       visibleNumber: 5,
       // 当前激活菜单的 index
       currentIndex: undefined,
-      language: localStorage.getItem('lang') || 'vi'
+      language: localStorage.getItem('lang') || 'zh_TW'
     };
   },
   computed: {

+ 219 - 0
foodie_admin_vue/src/components/googmap.vue

@@ -0,0 +1,219 @@
+<template>
+  <div class="content">
+    <div style="display: flex;align-items: center;margin-bottom: 20px;">
+      <div>{{$t('mendian.SearchAddress')}}:</div>
+      <input
+          type="text"
+          v-model="ssneir"
+          :placeholder="$t('mendian.Pleasekeywords')"
+          @keyup.enter="selectPoint"
+      />
+      <button style="margin-left: 10px;" @click="selectPoint">{{$t('mendian.SearchAddress')}}</button>
+      <div style="margin-left: 20px;">{{$t('mendian.currentlocation')}}:{{address}}</div>
+    </div>
+    <!-- 添加地址选择提示 -->
+    <div v-if="isLoadingAddress" style="background-color: #f0f9ff; color: #1890ff; padding: 10px; margin-bottom: 10px; border-radius: 4px; display: flex; align-items: center;">
+      <i class="el-icon-loading" style="margin-right: 8px;"></i>
+      正在获取地址信息...
+    </div>
+    <div v-else-if="!address" style="background-color: #fef0f0; color: #f56c6c; padding: 10px; margin-bottom: 10px; border-radius: 4px; display: flex; align-items: center;">
+      <i class="el-icon-warning" style="margin-right: 8px;"></i>
+      {{$t('mendian.Selectmapobtainaddress')}}
+    </div>
+    <div :style="googleMapStyle" class="googleMap" :id="mapID"></div>
+  </div>
+</template>
+
+<script>
+import {getAddr} from '@/api/infouser/user';
+import { Loader } from '@googlemaps/js-api-loader' //引入
+export default {
+  name:'googmap',
+  props: {
+    //selectPoint时是地图选点
+    //POLYGON是绘制地图多边形区域
+
+    //地图id
+    mapID: {
+      type: String,
+      default: () => {
+        return 'googleMap'
+      },
+    },
+    //谷歌地图样式
+    googleMapStyle: {
+      type: Object,
+      default: () => {
+        return {
+          wdith: '100%',
+          height: '500px',
+        }
+      },
+    },
+    //谷歌地图配置
+    mapOptions: {
+      type: Object,
+      default: () => {
+        return {
+          //为了关闭默认控件集,设置地图的disableDefaultUI的属性为true
+          disableDefaultUI: false,
+          // 启用缩放和平移
+          gestureHandling: 'greedy',
+          panControl: true,
+          zoomControl: true,
+          scaleControl: true,
+          //关闭街景
+          streetViewControl: false,
+        }
+      },
+    },
+    //谷歌地图中心点
+    googleMapCenter: {
+      type: Object,
+      default: () => {
+        return {
+          lat: 21.031859020043132,
+          lng:105.82760815495604
+        }
+      },
+    },
+    //谷歌地图缩放级别
+    zoom: {
+      type: Number,
+      default() {
+        return 11
+      },
+    },
+    //谷歌地图图形path
+    mapPath: {
+      type: String,
+      default: () => {
+        return ''
+      },
+    },
+  },
+  data() {
+    return {
+      //地图选点回显值
+      longlat: 21.031859020043132 + ',' + 105.82760815495604,
+      //标记点
+      marker: [],
+      //图形实例
+      graphicalExample: null,
+      //图形路径经纬度
+      graphicalPath: [],
+      apiKey: 'AIzaSyDRpbm3HCpmUjfaPu3TgklBGwWJWrvIXDw', //旧的AIzaSyAnz_I0VUlPvt73NIocb_7tomJOW4CdwHk
+      googleMap:null,
+      address:'',
+      ssneir:'',
+      isLoadingAddress: false
+    }
+  },
+  created() {
+    this.$nextTick(() => {
+      const loader = new Loader({
+        apiKey: this.apiKey, //之前的key
+        version: 'weekly', //版本
+        libraries: ['places', 'drawing'], //插件库places为基础库 drawing为绘制工具库
+        region: 'Canada',
+        language: this.$t('loding.language'),
+      })
+      const mapOptions = {
+        center: { lat: this.googleMapCenter.lat * 1, lng: this.googleMapCenter.lng * 1 }, //中心点
+        zoom: this.zoom, //缩放级别
+        mapId:this.mapID,
+        ...this.mapOptions, //其他配置
+      }
+      loader.load().then(async (google) => {
+        this.googMap = await google.maps.importLibrary("maps");
+        this.googMarker = await google.maps.importLibrary("marker");
+        const map = new this.googMap.Map(document.getElementById(this.mapID), mapOptions);
+        this.googleMap = map;
+        this.googleApi = google;
+        this.googleMap.addListener('click', (e) => {
+          this.clickGmap(e)
+        })
+      }).catch((e) => {
+        // do something
+        // console.log(e)
+      })
+    })
+  },
+  methods:{
+    // 逆向地址
+    getdizhi(lat){
+      this.isLoadingAddress = true;
+      
+      // id参数用于语言设置,不是用户ID,可以传空字符串或任意值
+      var params={
+        latlng:lat,
+        id:''  // 空字符串即可,后端会使用默认语言
+      }
+      console.log('调用getAddr API,参数:', params);
+      getAddr(params).then(res=>{
+        console.log('地址API响应:',res)
+        this.address = res.data.address
+        this.$emit('golat',{lat:lat,address:res.data.address})
+        this.isLoadingAddress = false;
+      }).catch(error => {
+        console.error('获取地址失败:', error);
+        // 即使API失败,也要触发事件,使用默认地址
+        this.$emit('golat',{lat:lat,address:'地址获取失败'})
+        this.isLoadingAddress = false;
+      })
+    },
+    //搜索地点方法
+    selectPoint() {
+      if (!this.ssneir) {
+        this.$message.warning('请输入搜索关键词');
+        return;
+      }
+      if (!this.googleApi || !this.googleMap) return;
+      const service = new this.googleApi.maps.places.PlacesService(this.googleMap);
+      service.textSearch({ query: this.ssneir }, (results, status) => {
+        if (status === this.googleApi.maps.places.PlacesServiceStatus.OK && results.length > 0) {
+          const loc = results[0].geometry.location;
+          const lat = loc.lat();
+          const lng = loc.lng();
+          this.googleMap.setCenter({ lat, lng });
+          this.googleMap.setZoom(15);
+          if (this.marker) this.marker.map = null;
+          this.marker = new this.googMarker.AdvancedMarkerElement({
+            map: this.googleMap,
+            position: { lat, lng },
+          });
+          this.getdizhi(lat + ',' + lng);
+        } else {
+          this.$message.error('搜索失败,请重试');
+        }
+      });
+    },
+    //点击地图回调
+    clickGmap(e) {
+      console.log('点击回调',e)
+      this.longlat = e.latLng.lat() + ',' + e.latLng.lng();
+      console.log('设置坐标:', this.longlat);
+      this.marker.map = null;
+      this.marker = new this.googMarker.AdvancedMarkerElement({
+        map:this.googleMap,
+        position: { lat: e.latLng.lat(), lng: e.latLng.lng() },
+      });
+      console.log('开始调用getdizhi方法');
+      this.getdizhi(this.longlat);
+    },
+    //获取经纬度
+    // getLongLat() {
+    // 	return this.longlat
+    // },
+    //设置地图中心点位置
+    // setMapPanBy(e) {
+    // 	let latlng = new this.googleApi.maps.LatLng(e.lat,e.lng)
+    // 	this.googleMap.setCenter(latlng)
+    // 	this.marker[0].setPosition(latlng);
+    // },
+  }
+}
+</script>
+
+<style>
+</style>

+ 5 - 4
foodie_admin_vue/src/components/i18n/i18n.vue

@@ -41,11 +41,12 @@ export default {
   created() {
     let value = localStorage.getItem("lang");
     if(value){
-      this.lang=value
+      this.lang = value;
+    } else {
+      // 如果没有设置语言,使用默认的繁体中文
+      this.lang = "zh_TW";
+      localStorage.setItem("lang", "zh_TW");
     }
-    // if (isNotNull(value)){
-    //   this.lang = value;
-    // }
   },
   methods: {
     changeLanguage(value){

+ 1 - 1
foodie_admin_vue/src/layout/components/Sidebar/SidebarItem.vue

@@ -55,7 +55,7 @@ export default {
   data() {
     this.onlyOneChild = null
     return {
-      language: localStorage.getItem('lang') || 'vi'
+      language: localStorage.getItem('lang') || 'zh_TW'
     }
   },
   mounted() {

+ 1 - 1
foodie_admin_vue/src/layout/components/Sidebar/index.vue

@@ -34,7 +34,7 @@ export default {
     components: { SidebarItem, Logo },
     data() {
         return {
-            language: localStorage.getItem('lang') || 'vi'
+            language: localStorage.getItem('lang') || 'zh_TW'
         }
     },
     computed: {

+ 71 - 1
foodie_admin_vue/src/views/infouser/user/nightMarket.vue

@@ -159,6 +159,17 @@
         <el-form-item :label="$t('infoussanhuser.手机号码')" prop="telPhone">
           <el-input v-model="form.telPhone" :placeholder="$t('infoussanhuser.请输入手机号码')" />
         </el-form-item>
+        <el-form-item :label="$t('infoussanhuser.地址')" prop="address">
+          <div style="display: flex;align-items: center;">
+            <el-input v-model="form.address" :placeholder="$t('infoussanhuser.请输入地址')" />
+            <i style="color: #55aaff; margin-left: 10px;font-size: 25px;" class="el-icon-location" @click="xuanzhemap"></i>
+          </div>
+        </el-form-item>
+        <el-form-item :label="$t('infoussanhuser.坐标')" prop="longitude">
+          <div style="display: flex;align-items: center;" @click="xuanzhemap">
+            <div>{{form.longitude==null?$t('infoussanhuser.定位获取坐标'):form.longitude+','+form.latitude}}</div>
+          </div>
+        </el-form-item>
         <el-form-item :label="$t('infoussanhuser.用户邮箱')" prop="email">
           <el-input v-model="form.email" :placeholder="$t('infoussanhuser.请输入用户邮箱')" />
         </el-form-item>
@@ -210,6 +221,14 @@
         <el-button @click="cancel">{{$t('infoussanhuser.取消')}}</el-button>
       </div>
     </el-dialog>
+    <!-- 地图 -->
+    <el-dialog :title="$t('infoussanhuser.选择地址')" :visible.sync="opmap" width="1000px" append-to-body>
+      <googmap mapID="googleMap" @golat="huichuandizhi"></googmap>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dituqiueing">{{$t('infoussanhuser.确定')}}</el-button>
+        <el-button @click="guanbimay">{{$t('infoussanhuser.取消')}}</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -217,8 +236,12 @@
 import { listUser, getUser, delUser, addUser, updateUser } from "@/api/infouser/user";
 import { encrypt,decrypt } from '@/utils/jsencrypt'
 import {generateTitle} from '../../../utils/i18.js'
+import googmap from "@/components/googmap.vue";
 export default {
   name: "User",
+  components: {
+    googmap
+  },
   dicts: ['info_user_type', 'sys_job_status', 'sys_user_sex','sys_user_audit','sys_merc_type'],
   data() {
     return {
@@ -240,6 +263,10 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      // 是否显示地图弹出层
+      opmap: false,
+      // 地图地址数据
+      mapaddress: null,
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -282,6 +309,12 @@ export default {
         status: [
           { required: true, message: this.$t('infoussanhuser.帐号状态不能为空'), trigger: "change" }
         ],
+        address: [
+          { required: true, message: this.$t('infoussanhuser.地址不能为空'), trigger: "blur" }
+        ],
+        longitude: [
+          { required: true, message: this.$t('infoussanhuser.坐标不能为空'), trigger: "blur" }
+        ],
       }
     };
   },
@@ -331,7 +364,10 @@ export default {
         bankAccount:null,
         passportPhoto:null,
         bankPhoto:null,
-        merchantIntroduction:null
+        merchantIntroduction:null,
+        address: null,
+        longitude: null,
+        latitude: null
       };
       this.resetForm("form");
     },
@@ -415,6 +451,40 @@ export default {
         ...this.queryParams
       }, `user_${new Date().getTime()}.xlsx`)
     },
+    // 打开地图选择
+    xuanzhemap() {
+      this.opmap = true;
+      // 重置地图地址数据
+      this.mapaddress = null;
+    },
+    // 地图回传地址
+    huichuandizhi(res) {
+      console.log('地址回传', res);
+      console.log('回传数据类型:', typeof res);
+      console.log('回传数据内容:', JSON.stringify(res));
+      this.mapaddress = res;
+      console.log('设置后的mapaddress:', this.mapaddress);
+    },
+    // 确认地址坐标选择
+    dituqiueing() {
+      console.log('当前地图地址数据:', this.mapaddress);
+      if(this.mapaddress==null || !this.mapaddress.address || this.mapaddress.address === '地址获取失败'){
+        this.$message.error(this.$t('infoussanhuser.请选择地图获取地址'));
+        return
+      }
+      this.form.address = this.mapaddress.address;
+      console.log('mapaddress.lat:', this.mapaddress.lat);
+      var lat = this.mapaddress.lat.split(",");
+      this.form.latitude = lat[0];
+      this.form.longitude = lat[1];
+      console.log('设置坐标:', this.form.latitude, this.form.longitude);
+      this.opmap = false;
+    },
+    // 关闭地图
+    guanbimay() {
+      this.mapaddress = null;
+      this.opmap = false;
+    },
 
   }
 };

+ 3 - 1
foodie_admin_vue/src/views/system/appeal/order1.vue

@@ -348,7 +348,9 @@ export default {
         type: null,
         delryTime: null,
         kefuState:null,
-        kefuContent:null
+        kefuContent:null,
+        logo: null,
+        posName: null
       };
       this.resetForm("form");
     },

+ 3 - 1
foodie_admin_vue/src/views/system/appeal/order2.vue

@@ -348,7 +348,9 @@ export default {
         type: null,
         delryTime: null,
         kefuState:null,
-        kefuContent:null
+        kefuContent:null,
+        logo: null,
+        posName: null
       };
       this.resetForm("form");
     },

+ 3 - 1
foodie_admin_vue/src/views/system/appeal/order3.vue

@@ -348,7 +348,9 @@ export default {
         type: null,
         delryTime: null,
         kefuState:null,
-        kefuContent:null
+        kefuContent:null,
+        logo: null,
+        posName: null
       };
       this.resetForm("form");
     },

+ 3 - 1
foodie_admin_vue/src/views/system/order/index.vue

@@ -436,7 +436,9 @@ export default {
         remarks: null,
         state: null,
         type: null,
-        delryTime: null
+        delryTime: null,
+        logo: null,
+        posName: null
       };
       this.resetForm("form");
     },

+ 20 - 3
foodie_sj_vue/src/components/googmap.vue

@@ -12,7 +12,11 @@
       <div style="margin-left: 20px;">{{$t('mendian.currentlocation')}}:{{address}}</div>
     </div>
     <!-- 添加地址选择提示 -->
-    <div v-if="!address" style="background-color: #fef0f0; color: #f56c6c; padding: 10px; margin-bottom: 10px; border-radius: 4px; display: flex; align-items: center;">
+    <div v-if="isLoadingAddress" style="background-color: #f0f9ff; color: #1890ff; padding: 10px; margin-bottom: 10px; border-radius: 4px; display: flex; align-items: center;">
+      <i class="el-icon-loading" style="margin-right: 8px;"></i>
+      正在获取地址信息...
+    </div>
+    <div v-else-if="!address" style="background-color: #fef0f0; color: #f56c6c; padding: 10px; margin-bottom: 10px; border-radius: 4px; display: flex; align-items: center;">
       <i class="el-icon-warning" style="margin-right: 8px;"></i>
       {{$t('mendian.Selectmapobtainaddress')}}
     </div>
@@ -101,7 +105,8 @@ export default {
       apiKey: 'AIzaSyDRpbm3HCpmUjfaPu3TgklBGwWJWrvIXDw', //旧的AIzaSyAnz_I0VUlPvt73NIocb_7tomJOW4CdwHk
       googleMap:null,
       address:'',
-      ssneir:''
+      ssneir:'',
+      isLoadingAddress: false
     }
   },
   created() {
@@ -137,6 +142,7 @@ export default {
   methods:{
     // 逆向地址
     getdizhi(lat){
+      this.isLoadingAddress = true;
       var user = JSON.parse(localStorage.getItem('user'));
 
       var params={
@@ -147,11 +153,20 @@ export default {
         console.log('地址',res)
         this.address = res.data.address
         this.$emit('golat',{lat:lat,address:res.data.address})
+        this.isLoadingAddress = false;
+      }).catch(error => {
+        console.error('获取地址失败:', error);
+        // 即使API失败,也要触发事件,使用默认地址
+        this.$emit('golat',{lat:lat,address:'地址获取失败'})
+        this.isLoadingAddress = false;
       })
     },
     //搜索地点方法
     selectPoint() {
-      if (!this.ssneir) return;
+      if (!this.ssneir) {
+        this.$message.warning('请输入搜索关键词');
+        return;
+      }
       if (!this.googleApi || !this.googleMap) return;
       const service = new this.googleApi.maps.places.PlacesService(this.googleMap);
       service.textSearch({ query: this.ssneir }, (results, status) => {
@@ -167,6 +182,8 @@ export default {
             position: { lat, lng },
           });
           this.getdizhi(lat + ',' + lng);
+        } else {
+          this.$message.error('搜索失败,请重试');
         }
       });
     },

+ 11 - 4
foodie_sj_vue/src/views/AcidrollingCapacity.vue

@@ -397,8 +397,11 @@ import {
 			},
 			//地图回传地址
 			huichuandizhi(res){
-				// console.log('地址回传',res);
-				this.mapaddress = res
+				console.log('地址回传',res);
+				console.log('回传数据类型:', typeof res);
+				console.log('回传数据内容:', JSON.stringify(res));
+				this.mapaddress = res;
+				console.log('设置后的mapaddress:', this.mapaddress);
 			},
 			// 修改门店
 			handleClick(res){
@@ -446,11 +449,14 @@ import {
 
 			},
 			xuanzhemap(){
-				this.opmap = true
+				this.opmap = true;
+				// 重置地图地址数据
+				this.mapaddress = null;
 			},
 			// 确认地址坐标选择
 			dituqiueing(){
-				if(this.mapaddress==null){
+				console.log('当前地图地址数据:', this.mapaddress);
+				if(this.mapaddress==null || !this.mapaddress.address || this.mapaddress.address === '地址获取失败'){
 					this.$message.error(this.$t('mendian.Selectmapobtainaddress'));
 					return
 				}
@@ -458,6 +464,7 @@ import {
 				var lat = this.mapaddress.lat.split(",");
 				this.form.latitude = lat[0];
 				this.form.longitude = lat[1];
+				console.log('设置坐标:', this.form.latitude, this.form.longitude);
 				this.opmap = false;
 			},
 			guanbimay(){

+ 6 - 6
ruoyi-admin/src/main/java/com/ruoyi/app/order/PointController.java

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.domain.WalletTransaction;
 import com.ruoyi.system.service.IPointsTransactionService;
 import com.ruoyi.system.utils.Auth;
 import com.ruoyi.system.utils.JwtUtil;
@@ -35,11 +35,11 @@ public class PointController extends BaseController {
                                 @RequestParam Long size) {
         JwtUtil jwtUtil = new JwtUtil();
         Long id = Long.valueOf(jwtUtil.getusid(token));
-        IPage<PointsTransaction> pg=new Page<>(page,size);
-        LambdaQueryWrapper<PointsTransaction> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(PointsTransaction::getUserId, id);
-       queryWrapper.orderByDesc(PointsTransaction::getCreateTime);
-        IPage<PointsTransaction> data = pointsTransactionService.page(pg, queryWrapper);
+        IPage<WalletTransaction> pg=new Page<>(page,size);
+        LambdaQueryWrapper<WalletTransaction> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(WalletTransaction::getUserId, id);
+       queryWrapper.orderByDesc(WalletTransaction::getCreateTime);
+        IPage<WalletTransaction> data = pointsTransactionService.page(pg, queryWrapper);
         return success(data);
     }
 }

+ 0 - 48
ruoyi-admin/src/main/java/com/ruoyi/app/order/PointController.java~

@@ -1,48 +0,0 @@
-package com.ruoyi.app.order;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.common.annotation.Anonymous;
-import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.system.domain.PointsTransaction;
-import com.ruoyi.system.service.IPointsTransactionService;
-import com.ruoyi.system.utils.Auth;
-import com.ruoyi.system.utils.JwtUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 用户积分Controller
- *
- * @author ruoyi
- * @date 2023-05-23
- */
-@RestController
-@RequestMapping("/system/points")
-public class PointController extends BaseController {
-    @Autowired
-    private IPointsTransactionService  pointsTransactionService;
-    /**
-     * 用户积分流水分页列表
-     */
-    @Anonymous
-    @Auth
-    @RequestMapping("/getpoints")
-    public AjaxResult getpoints(@RequestHeader String token,
-                                @RequestParam Long page,
-                                @RequestParam Long size) {
-        JwtUtil jwtUtil = new JwtUtil();
-        Long id = Long.valueOf(jwtUtil.getusid(token));
-        IPage<PointsTransaction> pg=new Page<>(page,size);
-        LambdaQueryWrapper<PointsTransaction> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(PointsTransaction::getUserId, id);
-       queryWrapper.orderByDesc(PointsTransaction::getCreateTime);
-        IPage<PointsTransaction> data = pointsTransactionService.page(pg, queryWrapper);
-        return success(data);
-    }
-}

+ 5 - 11
ruoyi-admin/src/main/java/com/ruoyi/app/order/PosOrderController.java

@@ -1,6 +1,5 @@
 package com.ruoyi.app.order;
 
-import cn.hutool.core.lang.func.Func;
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -18,7 +17,6 @@ import com.ruoyi.app.order.dto.QsDto;
 import com.ruoyi.app.pay.PayController;
 import com.ruoyi.app.utils.DateUtil;
 import com.ruoyi.app.utils.PayPush;
-import com.ruoyi.app.utils.event.PushEvent;
 import com.ruoyi.app.utils.event.PushEventService;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.annotation.Log;
@@ -32,7 +30,6 @@ import com.ruoyi.common.utils.MessageUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.domain.*;
 import com.ruoyi.system.domain.vo.OrderDTO;
-import com.ruoyi.system.domain.vo.PayVN;
 import com.ruoyi.system.mapper.PosOrderMapper;
 import com.ruoyi.system.mapper.RiderPositionMapper;
 import com.ruoyi.system.mapper.UserBillingMapper;
@@ -41,16 +38,13 @@ import com.ruoyi.system.utils.Auth;
 import com.ruoyi.system.utils.GetArea;
 import com.ruoyi.system.utils.JwtUtil;
 import lombok.SneakyThrows;
-import org.checkerframework.checker.units.qual.A;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
@@ -1291,17 +1285,17 @@ public class PosOrderController extends BaseController {
      * 创建积分流水
      */
     private void createPointTransaction(Long userid, Long pointsChange, Long currentPoints, Long ddId, String type) {
-        PointsTransaction pointsTransaction = new PointsTransaction();
+        WalletTransaction pointsTransaction = new WalletTransaction();
         pointsTransaction.setUserId(userid);
         if (type.equals("1")) {
-            pointsTransaction.setPointsChange("-" + pointsChange);
+            pointsTransaction.setChange("-" + pointsChange);
             pointsTransaction.setType("1");
         }
         if (type.equals("2")) {
-            pointsTransaction.setPointsChange("+" + pointsChange);
+            pointsTransaction.setChange("+" + pointsChange);
             pointsTransaction.setType("2");
         }
-        pointsTransaction.setCurrentPoints(currentPoints.toString());
+        pointsTransaction.setCurrentBalance(currentPoints.toString());
         pointsTransaction.setDdId(ddId);
         pointsTransaction.setCreateTime(new Date());
         pointsTransactionService.save(pointsTransaction);
@@ -1563,7 +1557,7 @@ public class PosOrderController extends BaseController {
         LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
         walletQuery.eq(UserWallet::getUserId, userId);
         UserWallet userWallet = userWalletService.getOne(walletQuery);
-        PointsTransaction transaction = pointsTransactionService.getOne(new LambdaQueryWrapper<PointsTransaction>().eq(PointsTransaction::getDdId, ddId).eq(PointsTransaction::getType, "2"));
+        WalletTransaction transaction = pointsTransactionService.getOne(new LambdaQueryWrapper<WalletTransaction>().eq(WalletTransaction::getDdId, ddId).eq(WalletTransaction::getType, "2"));
         //该订单不存在退回的积分记录
         if (ObjectUtil.isNotNull(userWallet) && transaction == null) {
             walletQuery.eq(UserWallet::getVersion, userWallet.getVersion());

+ 4 - 4
ruoyi-admin/src/main/java/com/ruoyi/app/order/PosOrderRatingController.java

@@ -9,7 +9,7 @@ import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.MessageUtils;
-import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.domain.WalletTransaction;
 import com.ruoyi.system.domain.SysPointControl;
 import com.ruoyi.system.domain.UserWallet;
 import com.ruoyi.system.service.IPointsTransactionService;
@@ -114,10 +114,10 @@ public class PosOrderRatingController extends BaseController
      * 创建积分流水
      */
     private void createPointTransaction(Long userid,Long pointsChange,Long currentPoints,Long ddId){
-        PointsTransaction pointsTransaction = new PointsTransaction();
+        WalletTransaction pointsTransaction = new WalletTransaction();
         pointsTransaction.setUserId(userid);
-        pointsTransaction.setPointsChange("+"+pointsChange);
-        pointsTransaction.setCurrentPoints(currentPoints.toString());
+        pointsTransaction.setChange("+"+pointsChange);
+        pointsTransaction.setCurrentBalance(currentPoints.toString());
         pointsTransaction.setType("0");
         pointsTransaction.setDdId(ddId);
         pointsTransaction.setCreateTime(new Date());

+ 4 - 4
ruoyi-admin/src/main/java/com/ruoyi/app/order/PosReviewController.java

@@ -14,7 +14,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.exception.ServiceException;
-import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.domain.WalletTransaction;
 import com.ruoyi.system.domain.SysPointControl;
 import com.ruoyi.system.domain.UserWallet;
 import com.ruoyi.system.mapper.PosReviewMapper;
@@ -148,10 +148,10 @@ public class PosReviewController extends BaseController
      * 创建积分流水
      */
     private void createPointTransaction(Long userid,Long pointsChange,Long currentPoints,Long ddId){
-        PointsTransaction pointsTransaction = new PointsTransaction();
+        WalletTransaction pointsTransaction = new WalletTransaction();
         pointsTransaction.setUserId(userid);
-        pointsTransaction.setPointsChange("+"+pointsChange);
-        pointsTransaction.setCurrentPoints(currentPoints.toString());
+        pointsTransaction.setChange("+"+pointsChange);
+        pointsTransaction.setCurrentBalance(currentPoints.toString());
         pointsTransaction.setType("0");
         pointsTransaction.setDdId(ddId);
         pointsTransaction.setCreateTime(new Date());

+ 89 - 21
ruoyi-admin/src/main/java/com/ruoyi/app/order/UserOrderController.java

@@ -1,28 +1,24 @@
 package com.ruoyi.app.order;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ruoyi.app.order.dto.OrderCreateInput;
 import com.ruoyi.app.order.dto.OrderCreatItem;
+import com.ruoyi.app.utils.DateUtil;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.MessageUtils;
-import com.ruoyi.system.domain.OrderParent;
-import com.ruoyi.system.domain.PosOrder;
-import com.ruoyi.system.domain.PosStore;
-import com.ruoyi.system.service.IOrderParentService;
-import com.ruoyi.system.service.IPosOrderService;
-import com.ruoyi.system.service.IPosStoreService;
+import com.ruoyi.system.domain.*;
+import com.ruoyi.system.service.*;
 import com.ruoyi.system.utils.Auth;
 import com.ruoyi.system.utils.JwtUtil;
-import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 
 import java.util.Date;
 import java.util.List;
@@ -43,6 +39,10 @@ public class UserOrderController extends BaseController {
     private IPosOrderService posOrderService;
     @Autowired
     private IPosStoreService posStoreService;
+    @Autowired
+    private IInfoAddressService infoAddressService;
+    @Autowired
+    private IOperatingHoursService operatingHoursService;
 
     /**
      * 创建订单
@@ -55,27 +55,41 @@ public class UserOrderController extends BaseController {
     {
         JwtUtil jwtUtil = new JwtUtil();
         String id = jwtUtil.getusid(token);
-        createOrderParent(input,Long.valueOf(id));
-        createOrderChild(input,Long.valueOf(id));
-        return super.success();
+        String shdz=null;
+        if(input.getType()==0){
+            InfoAddress usadd = infoAddressService.getById(input.getShdzId());
+            if (usadd == null) {
+                throw new ServiceException(MessageUtils.message("no.address.not.exist"));
+            }
+            shdz= JSON.toJSONString(usadd);
+        }
+        createOrderParent(input,Long.valueOf(id),shdz);
+        createOrderChild(input,Long.valueOf(id),Long.valueOf(id),shdz);
+
+        OrderParent result = orderParentService.getOne(new LambdaQueryWrapper<OrderParent>().eq(OrderParent::getDdId, input.getDdId().toString()));
+        return super.success(result);
     }
 
     //创建父订单
-    private void createOrderParent(OrderCreateInput input,Long UserId){
+    private void createOrderParent(OrderCreateInput input,Long UserId,String shdz){
         OrderParent orderParent = new OrderParent();
         orderParent.setUserId(UserId);
         orderParent.setOrderStatus(0L);
         orderParent.setTotalAmount(input.getTotalAmount());
         orderParent.setActualPayAmount(input.getActualPayAmount());
         orderParent.setPaymentMethod(input.getPaymentMethod());
-        orderParent.setPaymentTime(new Date());
+//        orderParent.setPaymentTime(new Date());
         orderParent.setCreateTime(new Date());
-        orderParent.setUpdateTime(new Date());
+//        orderParent.setUpdateTime(new Date());
         orderParent.setDdId(input.getDdId().toString());
+        orderParent.setTableNum(input.getTableNum());
+        orderParent.setShdzId(input.getShdzId());
+        orderParent.setShAddress(shdz);
+        orderParent.setType(input.getType());
         orderParentService.save(orderParent);
     }
     //创建子订单
-    private void createOrderChild(OrderCreateInput input,Long orderParentId){
+    private void createOrderChild(OrderCreateInput input,Long orderParentId,Long userId,String shdz){
         // 检查items是否为空
         if (input.getItems() == null || input.getItems().isEmpty()) {
             throw new ServiceException(MessageUtils.message("订单商品不能为空"));
@@ -83,11 +97,18 @@ public class UserOrderController extends BaseController {
         String ddId = input.getDdId().toString();
         List<Long> mdIdList = input.getItems().stream().map(OrderCreatItem::getMdId).collect(Collectors.toList());
         List<PosStore> storeList = posStoreService.list(new LambdaQueryWrapper<PosStore>().in(PosStore::getId, mdIdList));
+        LambdaQueryWrapper<OperatingHours> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(OperatingHours::getMdId, mdIdList);
+        List<OperatingHours> hourslist = operatingHoursService.list(wrapper);
+        DateUtil dateUtil = new DateUtil();
         // 循环items,为每个item创建一条PosOrder
         for (OrderCreatItem item : input.getItems()) {
+            // 检查门店是否开放
+            checkStoreOpen(storeList,hourslist,item,dateUtil);
             int index = input.getItems().indexOf(item) + 1;
             String subddId = ddId+ index;
             PosOrder posOrder = new PosOrder();
+            posOrder.setShdzId(input.getShdzId());
             // 设置子订单的基本信息
             posOrder.setDdId(Long.parseLong(subddId));
             posOrder.setParentDdId(input.getDdId().toString()); // 设置父订单ID
@@ -97,22 +118,69 @@ public class UserOrderController extends BaseController {
             posOrder.setShId(item.getShId());
             posOrder.setMdId(item.getMdId());
             posOrder.setShdzId(input.getShdzId());
-            posOrder.setUserId(orderParentId); // 使用父订单的用户ID
+            posOrder.setUserId(userId);
             posOrder.setAmount(item.getAmount());
             posOrder.setRemarks(item.getRemarks());
             posOrder.setType(item.getType());
             posOrder.setDelryTime(item.getDelryTime());
-            posOrder.setFood(item.getFood());
+            posOrder.setFood(JSON.toJSONString(item.getFood()));
+            if("1".equals(input.getPaymentMethod())){
+                posOrder.setCollectPayment("1");
+            }
             // 设置支付相关信息(从父订单继承)
             posOrder.setPayType(input.getPaymentMethod());
+            //设置桌号(从父订单继承)
+            posOrder.setTableNum(input.getTableNum());
+            posOrder.setLogo(item.getLogo());
+            posOrder.setPosName(item.getPosName());
+            posOrder.setJvli(item.getJvli());
+            posOrder.setFreight(item.getFreight());
+            posOrder.setShdzId(input.getShdzId());
+            posOrder.setShAddress(shdz);
             //设置订单分类
-            storeList.stream().filter(store -> Long.valueOf(store.getId()).equals(item.getMdId())).findFirst().ifPresent(st -> {
+            storeList.stream().filter(s -> Long.valueOf(s.getId()).equals(item.getMdId())).findFirst().ifPresent(st -> {
                 posOrder.setOrderCategory(String.valueOf(st.getType()));
             });
             // 保存子订单
             posOrderService.save(posOrder);
         }
     }
+    /**
+     * 检查门店是否开放
+     */
+    private void checkStoreOpen( List<PosStore> storeList,List<OperatingHours> hourslist, OrderCreatItem item, DateUtil dateUtil) {
+        List<OperatingHours> storeHourslist = hourslist.stream().filter(x-> x.getMdId().equals(item.getMdId())).collect(Collectors.toList());
+        PosStore store = storeList.stream().filter(x-> Long.valueOf(x.getId()).equals(item.getMdId())).findFirst().get();
+        if (storeHourslist.isEmpty()) {
+            throw new ServiceException(store.getPosName()+MessageUtils.message("no.mendian.not.set.business.hours"));
+        }
+        if (store.getState() == 1) {
+            throw new ServiceException(store.getPosName()+MessageUtils.message("no.mendian.is.closed"));
+        }
+        Boolean dayang = false;
+        for (int i = 0; i < hourslist.size(); i++) {
+            Boolean sbsj = dateUtil.isLegalTime(hourslist.get(i).getStartTime(), hourslist.get(i).getEndTime());
+            if (sbsj == true) {
+                dayang = true;
+            }
+        }
+        if (dayang == false) {
+            throw new ServiceException(store.getPosName()+MessageUtils.message("no.mendian.is.closed"));
+        }
+    }
+
+    /**
+     * 获取父订单详情
+     */
+    @GetMapping("/getParentOrderDetail")
+    @Auth
+    @Anonymous
+    public AjaxResult getParentOrderDetail(@RequestHeader String token, @RequestParam String ddId){
+        OrderParent result = orderParentService.getOne(new LambdaQueryWrapper<OrderParent>().eq(OrderParent::getDdId,ddId));
+        List<PosOrder> posOrders = posOrderService.list(new LambdaQueryWrapper<PosOrder>().eq(PosOrder::getParentDdId,ddId).orderBy(true,true,PosOrder::getCretim));
+        result.setItems(posOrders);
+        return super.success(result);
+    }
 
 
 }

+ 20 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreatItem.java

@@ -1,7 +1,10 @@
 package com.ruoyi.app.order.dto;
 
+import com.ruoyi.common.annotation.Excel;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class OrderCreatItem {
     private static final long serialVersionUID = 1L;
@@ -32,6 +35,22 @@ public class OrderCreatItem {
 
     /** 订单商品 */
 
-    private String food;
+    private Object food;
+    /** 门店logo */
+    private String logo;
+    /** 门店名称 */
+    private String posName;
+
+    /**
+     * 距离
+     */
+
+    private Double jvli;
+
+    /**
+     * 运费
+     */
+
+    private Double freight;
 
 }

+ 8 - 3
ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreateInput.java

@@ -3,6 +3,7 @@ package com.ruoyi.app.order.dto;
 import com.ruoyi.common.annotation.Excel;
 import lombok.Data;
 
+import java.util.ArrayList;
 import java.util.List;
 
 @Data
@@ -13,11 +14,15 @@ public class OrderCreateInput {
     private Long ddId;
     /** 收货地址id */
     private Long shdzId;
-
+    /**
+     * 订单类型:0外送,1自取,2堂食
+     */
+    private Long type;
     /** 订单总金额(分) */
 
     private Long totalAmount;
 
+
     /** 总优惠金额(分) */
 
     //private Long totalDiscount;
@@ -30,8 +35,8 @@ public class OrderCreateInput {
 
     private String paymentMethod;
 
-//    /** 父订单id号 */
-//    private String parentDdId;
+    /** 桌号 */
+    private String tableNum;
 
     private List<OrderCreatItem> items;
 }

+ 166 - 48
ruoyi-admin/src/main/java/com/ruoyi/app/service/WalletService.java

@@ -1,22 +1,23 @@
 package com.ruoyi.app.service;
 
-import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.common.exception.ConcurrentUpdateException;
 import com.ruoyi.common.exception.ServiceException;
-import com.ruoyi.common.utils.MessageUtils;
-import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.domain.WalletTransaction;
 import com.ruoyi.system.domain.UserWallet;
 import com.ruoyi.system.service.IPointsTransactionService;
 import com.ruoyi.system.service.IUserWalletService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.retry.annotation.Backoff;
 import org.springframework.retry.annotation.Retryable;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
+@Slf4j
 @Component
 public class WalletService {
     @Autowired
@@ -27,71 +28,188 @@ public class WalletService {
     /**
      * 订单取消、退款成功返回积分
      *
-     * @param userId
-     * @param ddId
-     * @param points
+     * @param userId 用户ID
+     * @param ddId   订单ID
+     * @param points 积分数量
      */
-
     @Retryable(value = ConcurrentUpdateException.class, maxAttempts = 3, backoff = @Backoff(delay = 1000, multiplier = 1.5))
-    @Transactional(rollbackFor = Exception.class)  // 添加事务
+    @Transactional(rollbackFor = Exception.class)
     public void returnPoints(Long userId, Long ddId, Long points) {
+        log.info("开始处理积分退回,用户ID: {}, 订单ID: {}, 积分: {}", userId, ddId, points);
+
         // 1. 参数校验
-        if (userId == null || ddId == null || points == null || points <= 0) {
-            throw new ServiceException("参数错误");
+        validateReturnPointsParams(userId, ddId, points);
+
+        // 2. 获取用户钱包
+        UserWallet userWallet = getUserWallet(userId);
+
+        // 3. 检查是否已经退过积分(防重复)
+        checkDuplicateReturn(ddId);
+
+        // 4. 执行积分退回
+        executePointsReturn(userWallet, BigDecimal.valueOf(points), ddId);
+
+        log.info("积分退回成功,用户ID: {}, 订单ID: {}, 积分: {}", userId, ddId, points);
+    }
+
+    /**
+     * 订单取消、退款成功返回余额
+     *
+     * @param userId 用户ID
+     * @param ddId   订单ID
+     * @param amount 金额
+     */
+    @Retryable(value = ConcurrentUpdateException.class, maxAttempts = 3, backoff = @Backoff(delay = 1000, multiplier = 1.5))
+    @Transactional(rollbackFor = Exception.class)
+    public void returnBalance(Long userId, Long ddId, BigDecimal amount) {
+        log.info("开始处理余额退回,用户ID: {}, 订单ID: {}, 金额: {}", userId, ddId, amount);
+
+        // 1. 参数校验
+        validateReturnBalanceParams(userId, ddId, amount);
+
+        // 2. 获取用户钱包
+        UserWallet userWallet = getUserWallet(userId);
+
+        // 3. 检查是否已经退过余额(防重复)
+        checkDuplicateBalanceReturn(ddId);
+
+        // 4. 执行余额退回
+        executeBalanceReturn(userWallet, amount, ddId);
+
+        log.info("余额退回成功,用户ID: {}, 订单ID: {}, 金额: {}", userId, ddId, amount);
+    }
+
+    /**
+     * 校验积分退回参数
+     */
+    private void validateReturnPointsParams(Long userId, Long ddId, Long points) {
+        if (userId == null || userId <= 0) {
+            throw new ServiceException("用户ID不能为空或无效");
+        }
+        if (ddId == null || ddId <= 0) {
+            throw new ServiceException("订单ID不能为空或无效");
         }
+        if (points == null || points <= 0) {
+            throw new ServiceException("积分数量必须大于0");
+        }
+    }
+
+    /**
+     * 校验余额退回参数
+     */
+    private void validateReturnBalanceParams(Long userId, Long ddId, BigDecimal amount) {
+        if (userId == null || userId <= 0) {
+            throw new ServiceException("用户ID不能为空或无效");
+        }
+        if (ddId == null || ddId <= 0) {
+            throw new ServiceException("订单ID不能为空或无效");
+        }
+        if (amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) {
+            throw new ServiceException("金额必须大于0");
+        }
+    }
+
+    /**
+     * 获取用户钱包
+     */
+    private UserWallet getUserWallet(Long userId) {
         LambdaQueryWrapper<UserWallet> walletQuery = new LambdaQueryWrapper<>();
         walletQuery.eq(UserWallet::getUserId, userId);
         UserWallet userWallet = userWalletService.getOne(walletQuery);
         if (userWallet == null) {
-            throw new ServiceException("用户钱包不存在");
+            throw new ServiceException("用户钱包不存在,用户ID: " + userId);
         }
-        // 3. 检查是否已经退过积分(防重复)
-        PointsTransaction existingTransaction = pointsTransactionService.getOne(
-                new LambdaQueryWrapper<PointsTransaction>()
-                        .eq(PointsTransaction::getDdId, ddId)
-                        .eq(PointsTransaction::getType, "2")
+        return userWallet;
+    }
+
+    /**
+     * 检查积分退回是否重复
+     */
+    private void checkDuplicateReturn(Long ddId) {
+        WalletTransaction existingTransaction = pointsTransactionService.getOne(
+                new LambdaQueryWrapper<WalletTransaction>()
+                        .eq(WalletTransaction::getDdId, ddId)
+                        .eq(WalletTransaction::getType, "2")
         );
         if (existingTransaction != null) {
-            throw new ServiceException("该订单积分已退回,请勿重复操作");
+            throw new ServiceException("该订单积分已退回,请勿重复操作,订单ID: " + ddId);
         }
-        //该订单不存在退回的积分记录
-        if (ObjectUtil.isNotNull(userWallet)) {
-            // 4. 先创建积分流水记录(重要:先记录后更新)
-            Long newBalance = userWallet.getPointsWallet() + points;
-            createPointTransaction(userId, points, newBalance, ddId, "2");
-
-            // 5. 乐观锁更新钱包
-            LambdaQueryWrapper<UserWallet> updateQuery = new LambdaQueryWrapper<>();
-            updateQuery.eq(UserWallet::getUserId, userId)
-                    .eq(UserWallet::getVersion, userWallet.getVersion()); // 版本控制
-
-            userWallet.setPointsWallet(newBalance);
-            userWallet.setVersion(userWallet.getVersion() + 1);
-
-            boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
-            if (!updateSuccess) {
-                throw new ConcurrentUpdateException("钱包更新冲突,请重试");
-            }
-        } else {
-            throw new ServiceException(MessageUtils.message("no.points.insufficient"));
+    }
+
+    /**
+     * 检查余额退回是否重复
+     */
+    private void checkDuplicateBalanceReturn(Long ddId) {
+        WalletTransaction existingTransaction = pointsTransactionService.getOne(
+                new LambdaQueryWrapper<WalletTransaction>()
+                        .eq(WalletTransaction::getDdId, ddId)
+                        .eq(WalletTransaction::getType, "3") // 余额退回类型
+        );
+        if (existingTransaction != null) {
+            throw new ServiceException("该订单余额已退回,请勿重复操作,订单ID: " + ddId);
         }
     }
 
     /**
-     * 创建积分流水
+     * 执行积分退回
+     */
+    private void executePointsReturn(UserWallet userWallet, BigDecimal points, Long ddId) {
+        // 计算新的积分余额
+        BigDecimal newBalance = (userWallet.getPointsWallet() != null ? userWallet.getPointsWallet() : BigDecimal.ZERO).add( points);
+
+        // 先创建积分流水记录
+        createTransaction(userWallet.getUserId(), points, newBalance, String.valueOf(ddId), "2");
+
+        // 乐观锁更新钱包
+        updateWalletWithOptimisticLock(userWallet, newBalance, null);
+    }
+
+    /**
+     * 执行余额退回
+     */
+    private void executeBalanceReturn(UserWallet userWallet, BigDecimal amount, Long ddId) {
+        // 计算新的余额
+        BigDecimal currentBalance = userWallet.getBalanceWallet() != null ? userWallet.getBalanceWallet() : BigDecimal.ZERO;
+        BigDecimal newBalance = currentBalance.add(amount);
+
+        // 先创建余额流水记录
+        createTransaction(userWallet.getUserId(), amount, newBalance, ddId.toString(), "1");
+
+        // 乐观锁更新钱包
+        updateWalletWithOptimisticLock(userWallet, null, newBalance);
+    }
+
+    /**
+     * 使用乐观锁更新钱包
      */
-    private void createPointTransaction(Long userid, Long pointsChange, Long currentPoints, Long ddId, String type) {
-        PointsTransaction pointsTransaction = new PointsTransaction();
-        pointsTransaction.setUserId(userid);
-        if (type.equals("1")) {
-            pointsTransaction.setPointsChange("-" + pointsChange);
-            pointsTransaction.setType("1");
+    private void updateWalletWithOptimisticLock(UserWallet userWallet, BigDecimal newPointsBalance, BigDecimal newBalanceAmount) {
+        LambdaQueryWrapper<UserWallet> updateQuery = new LambdaQueryWrapper<>();
+        updateQuery.eq(UserWallet::getUserId, userWallet.getUserId())
+                .eq(UserWallet::getVersion, userWallet.getVersion());
+
+        if (newPointsBalance != null) {
+            userWallet.setPointsWallet(newPointsBalance);
+        }
+        if (newBalanceAmount != null) {
+            userWallet.setBalanceWallet(newBalanceAmount);
         }
-        if (type.equals("2")) {
-            pointsTransaction.setPointsChange("+" + pointsChange);
-            pointsTransaction.setType("2");
+        userWallet.setVersion(userWallet.getVersion() + 1);
+
+        boolean updateSuccess = userWalletService.update(userWallet, updateQuery);
+        if (!updateSuccess) {
+            throw new ConcurrentUpdateException("钱包更新冲突,请重试,用户ID: " + userWallet.getUserId());
         }
-        pointsTransaction.setCurrentPoints(currentPoints.toString());
+    }
+
+    /**
+     * 创建积分流水
+     */
+    private void createTransaction(Long userId, BigDecimal change, BigDecimal currentBalance, String ddId, String type) {
+        WalletTransaction pointsTransaction = new WalletTransaction();
+        pointsTransaction.setUserId(userId);
+        pointsTransaction.setChange(change.toString());
+        pointsTransaction.setType(type);
+        pointsTransaction.setCurrentBalance(currentBalance.toString());
         pointsTransaction.setDdId(ddId);
         pointsTransaction.setCreateTime(new Date());
         pointsTransactionService.save(pointsTransaction);

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/app/user/InfoUserController.java

@@ -495,6 +495,9 @@ public class InfoUserController  extends BaseController
         user.setPassportPhoto(infoUser.getPassportPhoto());
         user.setBankPhoto(infoUser.getBankPhoto());
         user.setMerchantIntroduction(infoUser.getMerchantIntroduction());
+        user.setAddress(infoUser.getAddress());
+        user.setLongitude(infoUser.getLongitude());
+        user.setLatitude(infoUser.getLatitude());
         Boolean org = infoUserService.saveOrUpdate(user);
         if(org){
             return success();

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/app/utils/SysFileInfoController.java

@@ -77,7 +77,7 @@ public class SysFileInfoController extends BaseController {
     public AjaxResult getAddr(@RequestParam String latlng,
                               @RequestParam(defaultValue = "") String id) {
         Jedis jedis = new Jedis("localhost", 6379);
-        String lang = jedis.get(id) == null ? "vi" : jedis.get(id);
+        String lang = jedis.get(id) == null ? "zh-TW" : jedis.get(id);
         GetArea area = new GetArea();
         JSONObject reg = area.getgoogleadd(latlng, lang);
         return success(reg);

+ 8 - 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PointTransactionController.java

@@ -16,7 +16,7 @@ import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.domain.WalletTransaction;
 import com.ruoyi.system.service.IPointsTransactionService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -39,10 +39,10 @@ public class PointTransactionController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:pointTransaction:list')")
     @GetMapping("/list")
-    public TableDataInfo list(PointsTransaction pointsTransaction)
+    public TableDataInfo list(WalletTransaction pointsTransaction)
     {
         startPage();
-        List<PointsTransaction> list = pointsTransactionService.selectPointsTransactionList(pointsTransaction);
+        List<WalletTransaction> list = pointsTransactionService.selectPointsTransactionList(pointsTransaction);
         return getDataTable(list);
     }
 
@@ -52,10 +52,10 @@ public class PointTransactionController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:pointTransaction:export')")
     @Log(title = "积分流水", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, PointsTransaction pointsTransaction)
+    public void export(HttpServletResponse response, WalletTransaction pointsTransaction)
     {
-        List<PointsTransaction> list = pointsTransactionService.selectPointsTransactionList(pointsTransaction);
-        ExcelUtil<PointsTransaction> util = new ExcelUtil<PointsTransaction>(PointsTransaction.class);
+        List<WalletTransaction> list = pointsTransactionService.selectPointsTransactionList(pointsTransaction);
+        ExcelUtil<WalletTransaction> util = new ExcelUtil<WalletTransaction>(WalletTransaction.class);
         util.exportExcel(response, list, "积分流水数据");
     }
 
@@ -75,7 +75,7 @@ public class PointTransactionController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:pointTransaction:add')")
     @Log(title = "积分流水", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody PointsTransaction pointsTransaction)
+    public AjaxResult add(@RequestBody WalletTransaction pointsTransaction)
     {
         return toAjax(pointsTransactionService.insertPointsTransaction(pointsTransaction));
     }
@@ -86,7 +86,7 @@ public class PointTransactionController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:pointTransaction:edit')")
     @Log(title = "积分流水", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody PointsTransaction pointsTransaction)
+    public AjaxResult edit(@RequestBody WalletTransaction pointsTransaction)
     {
         return toAjax(pointsTransactionService.updatePointsTransaction(pointsTransaction));
     }

+ 11 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/InfoUser.java

@@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 import javax.persistence.GeneratedValue;
@@ -161,6 +162,16 @@ public class InfoUser
 
     /** 离线标识 :0 在线  1 离线*/
     private String offline;
+    /** 夜市地址 */
+    private String address;
+    /** 夜市经度 */
+
+    private BigDecimal longitude;
+
+    /** 夜市纬度 */
+
+    private BigDecimal latitude;
+
 
     public void setUserId(Long userId)
     {

+ 24 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/OrderParent.java

@@ -1,6 +1,9 @@
 package com.ruoyi.system.domain;
 
 import java.util.Date;
+import java.util.List;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -66,6 +69,27 @@ public class OrderParent
     private Date updateTime;
 
     private String ddId;
+    /** 桌号 */
+    private String tableNum;
+
+    /**
+     * 收货地址id
+     */
+
+    private Long shdzId;
+
+    /**
+     * 收货地址
+     */
+
+    private String shAddress;
+
+    /**
+     * 订单类型:0外送,1自取,2堂食
+     */
+    private Long type;
+    @TableField(exist = false)
+    private List<PosOrder> items;
 
 
 }

+ 146 - 56
ruoyi-system/src/main/java/com/ruoyi/system/domain/PosOrder.java

@@ -21,8 +21,7 @@ import java.util.Date;
 @Data
 @TableName(value = "pos_order")
 @EqualsAndHashCode(callSuper = false)
-public class  PosOrder
-{
+public class PosOrder {
     private static final long serialVersionUID = 1L;
 
     @TableId(type = IdType.AUTO)
@@ -31,77 +30,112 @@ public class  PosOrder
     private Long id;
 
 
-
-    /** 订单号 */
+    /**
+     * 订单号
+     */
     private Long ddId;
 
-    /** 商家id */
+    /**
+     * 商家id
+     */
     @Excel(name = "商家id")
     private Long shId;
 
-    /** 门店id */
+    /**
+     * 门店id
+     */
     @Excel(name = "门店id")
     private Long mdId;
 
-    /** 创建时间 */
+    /**
+     * 创建时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date cretim;
 
-    /** 收货地址id */
+    /**
+     * 收货地址id
+     */
     @Excel(name = "收货地址id")
     private Long shdzId;
 
-    /** 收货地址*/
+    /**
+     * 收货地址
+     */
     @Excel(name = "收货地址")
     private String shAddress;
 
-    /** 下单用户id */
+    /**
+     * 下单用户id
+     */
     @Excel(name = "下单用户id")
     private Long userId;
 
-    /** 订单合计金额 */
+    /**
+     * 订单合计金额
+     */
     @Excel(name = "订单合计金额")
     private Integer amount;
 
-    /** 备注 */
+    /**
+     * 备注
+     */
     @Excel(name = "备注")
     private String remarks;
 
-    /** 订单状态 */
+    /**
+     * 订单状态
+     */
     @Excel(name = "订单状态")
     private Long state;
 
-    /** 订单类型:0外送,1自取,2堂食 */
+    /**
+     * 订单类型:0外送,1自取,2堂食
+     */
     @Excel(name = "订单类型")
     private Long type;
 
-    /** 配送时间 */
+    /**
+     * 配送时间
+     */
     @Excel(name = "配送时间")
     private String delryTime;
 
-    /** 订单商品 */
+    /**
+     * 订单商品
+     */
     @Excel(name = "订单商品")
     private String food;
 
 
-    /** 距离 */
+    /**
+     * 距离
+     */
     @Excel(name = "距离")
     private Double jvli;
 
-    /** 运费 */
+    /**
+     * 运费
+     */
     @Excel(name = "运费")
     private Double freight;
 
-    /** 经度 */
+    /**
+     * 经度
+     */
     @Excel(name = "经度")
     private BigDecimal longitude;
 
-    /** 纬度 */
+    /**
+     * 纬度
+     */
     @Excel(name = "纬度")
     private BigDecimal latitude;
 
-    /** 出餐状态*/
+    /**
+     * 出餐状态
+     */
     @Excel(name = "出餐状态")
     private Long diningStatus;
 
@@ -110,102 +144,158 @@ public class  PosOrder
     private Long kefuRepeat;
     private Long repeatDdId;
 
-    /** 骑手id */
+    /**
+     * 骑手id
+     */
     @Excel(name = "骑手id")
     private Long qsId;
-    /** 距离骑手 */
+    /**
+     * 距离骑手
+     */
 //    @Excel(name = "距离骑手")
     private transient Double juli;
     //骑手图片
     private String qsImg;
 
 
-    /** 支付地址 */
+    /**
+     * 支付地址
+     */
 //    @Excel(name = "支付地址")
-    private  String payUrl;
-    /** 到付 */
+    private String payUrl;
+    /**
+     * 到付
+     */
 //    @Excel(name = "到付")
-    private  String collectPayment;
-//    /** 商品價格 */
+    private String collectPayment;
+    //    /** 商品價格 */
 //    @Excel(name = "商品價格")
     private transient String priceAll;
 
-    /** 创建时间范围 **/
+    /**
+     * 创建时间范围
+     **/
     private transient String[] dateRange;
     private transient String cretimStart;
     private transient String cretimEnd;
     private transient String userType;
     private transient String appealCount;
 
-    /** 平台促销活动id */
-    private  Long activity;
-    /** 门店促销活动id */
-    private  Long mdActivity;
-    /** 使用优惠券id */
+    /**
+     * 平台促销活动id
+     */
+    private Long activity;
+    /**
+     * 门店促销活动id
+     */
+    private Long mdActivity;
+    /**
+     * 使用优惠券id
+     */
     @Excel(name = "平台优惠券")
     private Long yhId;
-    /** 平台优惠券名称 */
+    /**
+     * 平台优惠券名称
+     */
     @Excel(name = "平台优惠券名称")
     private String yhName;
-    /** 平台优惠券优惠金额 */
+    /**
+     * 平台优惠券优惠金额
+     */
     @Excel(name = "平台优惠券优惠金额")
     private Integer discountAmount;
-    /** 门店优惠券id */
+    /**
+     * 门店优惠券id
+     */
     @Excel(name = "门店优惠券")
     private Long mdYhId;
-    /** 门店优惠券名称 */
+    /**
+     * 门店优惠券名称
+     */
     @Excel(name = "门店优惠券名称")
     private String mdYhName;
 
-    /** 门店优惠券优惠金额 */
+    /**
+     * 门店优惠券优惠金额
+     */
     @Excel(name = "门店优惠券优惠金额")
     private Integer mdDiscountAmount;
-    /** 平台促銷活動名稱 */
+    /**
+     * 平台促銷活動名稱
+     */
     @Excel(name = "平台促銷活動名稱")
-    private  String salesName;
+    private String salesName;
 
-    /** 门店促銷活動名稱 */
+    /**
+     * 门店促銷活動名稱
+     */
     @Excel(name = "门店促銷活動名稱")
-    private  String mdSalesName;
+    private String mdSalesName;
 
 
-    /** 平台促销減免值 */
+    /**
+     * 平台促销減免值
+     */
     @Excel(name = "平台促销減免值")
     private Integer salesReduction;
 
-    /** 门店促销減免值 */
+    /**
+     * 门店促销減免值
+     */
     @Excel(name = "门店促销減免值")
     private Integer mdSalesReduction;
 
-    /** 积分 */
+    /**
+     * 积分
+     */
     @Excel(name = "积分")
     private Integer points;
 
-    /** 积分抵扣值 */
+    /**
+     * 积分抵扣值
+     */
     @Excel(name = "积分抵扣值")
     private Integer pointsReduction;
 
-    /** 送达时间 */
+    /**
+     * 送达时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "送达时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date sdTime;
 
-    /** 支付方式 1 到付 2 vnpay  3 zalopay 二维码支付 :4  银行卡 5 */
+    /**
+     * 支付方式 1 到付 2 vnpay  3 zalopay 二维码支付 :4  银行卡 5
+     */
     private String payType;
 
 
-
-    /** 预计送达时间 */
+    /**
+     * 预计送达时间
+     */
     private String yjsdTime;
 
-    /** 父订单号 */
+    /**
+     * 父订单号
+     */
     private String parentDdId;
 
-    /** 订单分类 */
+    /**
+     * 订单分类
+     */
     private String orderCategory;
-
-
-
+    /**
+     * 桌号
+     */
+    private String tableNum;
+    /**
+     * 店铺 logo
+     */
+    private String logo;
+    /**
+     * 店铺名称
+     */
+    private String posName;
 
 
 }

+ 5 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/UserWallet.java

@@ -12,6 +12,8 @@ import lombok.EqualsAndHashCode;
 import javax.persistence.GeneratedValue;
 import com.ruoyi.common.core.domain.BaseEntity;
 
+import java.math.BigDecimal;
+
 /**
  * 用户钱包  user_wallet
  *
@@ -35,7 +37,9 @@ public class UserWallet
 
     /** 积分钱包 */
     @Excel(name = "积分钱包")
-    private Long pointsWallet;
+    private BigDecimal pointsWallet;
+    /** 余额钱包 */
+    private BigDecimal balanceWallet;
 
     private int version;
 

+ 11 - 12
ruoyi-system/src/main/java/com/ruoyi/system/domain/PointsTransaction.java → ruoyi-system/src/main/java/com/ruoyi/system/domain/WalletTransaction.java

@@ -4,14 +4,11 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import javax.persistence.GeneratedValue;
-import com.ruoyi.common.core.domain.BaseEntity;
 
 import java.util.Date;
 
@@ -22,9 +19,9 @@ import java.util.Date;
  * @date 2025-05-30
  */
 @Data
-@TableName(value = "points_transaction")
+@TableName(value = "Wallet_transaction")
 @EqualsAndHashCode(callSuper = false)
-public class PointsTransaction
+public class WalletTransaction
 {
     private static final long serialVersionUID = 1L;
 
@@ -39,23 +36,25 @@ public class PointsTransaction
 
     /** 订单编号 */
     @Excel(name = "订单编号")
-    private Long ddId;
-    /** 积分类型  0 获得  1 抵扣  2 退回*/
+    private String ddId;
+    /** 积分类型  0 积分钱包  1余额钱包 */
 
     @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
     private String type;
 
-    /** 积分变动值(正为增加,负为减少) */
+    /** 变动值(正为增加,负为减少) */
     @Excel(name = "积分变动值", readConverterExp = "正=为增加,负为减少")
-    private String pointsChange;
+    private String change;
 
-    /** 变动后积分余额 */
-    @Excel(name = "变动后积分余额")
-    private String currentPoints;
+    /** 变动后余额 */
+    @Excel(name = "变动余额")
+    private String currentBalance;
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date  createTime;
     private Date updateTime;
 
+    private String remark;
+
 
 
 }

+ 1 - 2
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/OrderDTO.java

@@ -151,7 +151,6 @@ public class OrderDTO {
     /** 积分抵扣值 */
     private Integer pointsReduction;
 
-    /** 父订单id号 */
-    private String parentDdId;
+
 
 }

+ 6 - 6
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PointsTransactionMapper.java → ruoyi-system/src/main/java/com/ruoyi/system/mapper/WalletTransactionMapper.java

@@ -2,7 +2,7 @@ package com.ruoyi.system.mapper;
 
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.domain.WalletTransaction;
 
 /**
  * 积分流水Mapper接口
@@ -10,7 +10,7 @@ import com.ruoyi.system.domain.PointsTransaction;
  * @author ruoyi
  * @date 2025-05-30
  */
-public interface PointsTransactionMapper  extends BaseMapper<PointsTransaction>
+public interface WalletTransactionMapper extends BaseMapper<WalletTransaction>
 {
     /**
      * 查询积分流水
@@ -18,7 +18,7 @@ public interface PointsTransactionMapper  extends BaseMapper<PointsTransaction>
      * @param id 积分流水主键
      * @return 积分流水
      */
-    public PointsTransaction selectPointsTransactionById(Long id);
+    public WalletTransaction selectPointsTransactionById(Long id);
 
     /**
      * 查询积分流水列表
@@ -26,7 +26,7 @@ public interface PointsTransactionMapper  extends BaseMapper<PointsTransaction>
      * @param pointsTransaction 积分流水
      * @return 积分流水集合
      */
-    public List<PointsTransaction> selectPointsTransactionList(PointsTransaction pointsTransaction);
+    public List<WalletTransaction> selectPointsTransactionList(WalletTransaction pointsTransaction);
 
     /**
      * 新增积分流水
@@ -34,7 +34,7 @@ public interface PointsTransactionMapper  extends BaseMapper<PointsTransaction>
      * @param pointsTransaction 积分流水
      * @return 结果
      */
-    public int insertPointsTransaction(PointsTransaction pointsTransaction);
+    public int insertPointsTransaction(WalletTransaction pointsTransaction);
 
     /**
      * 修改积分流水
@@ -42,7 +42,7 @@ public interface PointsTransactionMapper  extends BaseMapper<PointsTransaction>
      * @param pointsTransaction 积分流水
      * @return 结果
      */
-    public int updatePointsTransaction(PointsTransaction pointsTransaction);
+    public int updatePointsTransaction(WalletTransaction pointsTransaction);
 
     /**
      * 删除积分流水

+ 6 - 6
ruoyi-system/src/main/java/com/ruoyi/system/service/IPointsTransactionService.java

@@ -2,7 +2,7 @@ package com.ruoyi.system.service;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.domain.WalletTransaction;
 
 /**
  * 积分流水Service接口
@@ -10,7 +10,7 @@ import com.ruoyi.system.domain.PointsTransaction;
  * @author ruoyi
  * @date 2025-05-30
  */
-public interface IPointsTransactionService extends IService<PointsTransaction>
+public interface IPointsTransactionService extends IService<WalletTransaction>
 {
     /**
      * 查询积分流水
@@ -18,7 +18,7 @@ public interface IPointsTransactionService extends IService<PointsTransaction>
      * @param id 积分流水主键
      * @return 积分流水
      */
-    public PointsTransaction selectPointsTransactionById(Long id);
+    public WalletTransaction selectPointsTransactionById(Long id);
 
     /**
      * 查询积分流水列表
@@ -26,7 +26,7 @@ public interface IPointsTransactionService extends IService<PointsTransaction>
      * @param pointsTransaction 积分流水
      * @return 积分流水集合
      */
-    public List<PointsTransaction> selectPointsTransactionList(PointsTransaction pointsTransaction);
+    public List<WalletTransaction> selectPointsTransactionList(WalletTransaction pointsTransaction);
 
     /**
      * 新增积分流水
@@ -34,7 +34,7 @@ public interface IPointsTransactionService extends IService<PointsTransaction>
      * @param pointsTransaction 积分流水
      * @return 结果
      */
-    public int insertPointsTransaction(PointsTransaction pointsTransaction);
+    public int insertPointsTransaction(WalletTransaction pointsTransaction);
 
     /**
      * 修改积分流水
@@ -42,7 +42,7 @@ public interface IPointsTransactionService extends IService<PointsTransaction>
      * @param pointsTransaction 积分流水
      * @return 结果
      */
-    public int updatePointsTransaction(PointsTransaction pointsTransaction);
+    public int updatePointsTransaction(WalletTransaction pointsTransaction);
 
     /**
      * 批量删除积分流水

+ 8 - 8
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PointsTransactionServiceImpl.java

@@ -6,8 +6,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ruoyi.system.mapper.PointsTransactionMapper;
-import com.ruoyi.system.domain.PointsTransaction;
+import com.ruoyi.system.mapper.WalletTransactionMapper;
+import com.ruoyi.system.domain.WalletTransaction;
 import com.ruoyi.system.service.IPointsTransactionService;
 
 /**
@@ -17,10 +17,10 @@ import com.ruoyi.system.service.IPointsTransactionService;
  * @date 2025-05-30
  */
 @Service
-public class PointsTransactionServiceImpl extends ServiceImpl<BaseMapper<PointsTransaction>,PointsTransaction> implements IPointsTransactionService
+public class PointsTransactionServiceImpl extends ServiceImpl<BaseMapper<WalletTransaction>, WalletTransaction> implements IPointsTransactionService
 {
     @Autowired
-    private PointsTransactionMapper pointsTransactionMapper;
+    private WalletTransactionMapper pointsTransactionMapper;
 
     /**
      * 查询积分流水
@@ -29,7 +29,7 @@ public class PointsTransactionServiceImpl extends ServiceImpl<BaseMapper<PointsT
      * @return 积分流水
      */
     @Override
-    public PointsTransaction selectPointsTransactionById(Long id)
+    public WalletTransaction selectPointsTransactionById(Long id)
     {
         return pointsTransactionMapper.selectPointsTransactionById(id);
     }
@@ -41,7 +41,7 @@ public class PointsTransactionServiceImpl extends ServiceImpl<BaseMapper<PointsT
      * @return 积分流水
      */
     @Override
-    public List<PointsTransaction> selectPointsTransactionList(PointsTransaction pointsTransaction)
+    public List<WalletTransaction> selectPointsTransactionList(WalletTransaction pointsTransaction)
     {
         return pointsTransactionMapper.selectPointsTransactionList(pointsTransaction);
     }
@@ -53,7 +53,7 @@ public class PointsTransactionServiceImpl extends ServiceImpl<BaseMapper<PointsT
      * @return 结果
      */
     @Override
-    public int insertPointsTransaction(PointsTransaction pointsTransaction)
+    public int insertPointsTransaction(WalletTransaction pointsTransaction)
     {
         pointsTransaction.setCreateTime(DateUtils.getNowDate());
         return pointsTransactionMapper.insertPointsTransaction(pointsTransaction);
@@ -66,7 +66,7 @@ public class PointsTransactionServiceImpl extends ServiceImpl<BaseMapper<PointsT
      * @return 结果
      */
     @Override
-    public int updatePointsTransaction(PointsTransaction pointsTransaction)
+    public int updatePointsTransaction(WalletTransaction pointsTransaction)
     {
         pointsTransaction.setUpdateTime(DateUtils.getNowDate());
         return pointsTransactionMapper.updatePointsTransaction(pointsTransaction);

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/utils/GetArea.java

@@ -125,6 +125,7 @@ public class GetArea {
         String res="";
         String lanss = lang=="en_US"?"Unknown address":lang=="vi"?"Địa chỉ vô danh":"无名地址";
         res = HttpUtil.get(url);
+        System.out.println("谷歌地图getgoogleadd:"+res);
         JSONObject jsonObject =  JSON.parseObject(res);
         JSONObject org = new JSONObject();
         JSONObject obj = (JSONObject) jsonObject.getJSONArray("results").get(0);

+ 18 - 3
ruoyi-system/src/main/resources/mapper/infouser/InfoUserMapper.xml

@@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="bankPhoto"    column="bank_photo"    />
         <result property="merchantIntroduction"    column="merchant_introduction"    />
         <result property="offline"    column="offline"    />
+        <result property="address"    column="address"    />
+        <result property="longitude"    column="longitude"    />
+        <result property="latitude"    column="latitude"    />
     </resultMap>
 
     <sql id="selectInfoUserVo">
@@ -59,6 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditStatus != null  and auditStatus != ''"> and audit_status = #{auditStatus}</if>
             <if test="telPhone != null  and telPhone != ''"> and tel_phone = #{telPhone}</if>
             <if test="shijStatus != null  and shijStatus != ''"> and shij_status = #{shijStatus}</if>
+            <if test="address != null  and address != ''"> and address like concat('%', #{address}, '%')</if>
+            <if test="longitude != null"> and longitude = #{longitude}</if>
+            <if test="latitude != null"> and latitude = #{latitude}</if>
         </where>
         order by user_id desc
     </select>
@@ -95,7 +101,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="passportPhoto != null">passport_photo,</if>
             <if test="bankPhoto != null">bank_photo,</if>
             <if test="merchantIntroduction != null">merchant_introduction,</if>
-            <if test="offline != null">offline</if>
+            <if test="offline != null">offline,</if>
+            <if test="address != null and address != ''">address,</if>
+            <if test="longitude != null">longitude,</if>
+            <if test="latitude != null">latitude</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userName != null and userName != ''">#{userName},</if>
@@ -122,7 +131,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="passportPhoto != null">#{passportPhoto},</if>
             <if test="bankPhoto != null">#{bankPhoto},</if>
             <if test="merchantIntroduction != null">#{merchantIntroduction},</if>
-            <if test="offline !=null">#{offline}</if>
+            <if test="offline !=null">#{offline},</if>
+            <if test="address != null and address != ''">#{address},</if>
+            <if test="longitude != null">#{longitude},</if>
+            <if test="latitude != null">#{latitude}</if>
          </trim>
     </insert>
 
@@ -153,7 +165,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="passportPhoto != null">passport_photo = #{passportPhoto},</if>
             <if test="bankPhoto != null">bank_photo = #{bankPhoto},</if>
             <if test="merchantIntroduction != null">merchant_introduction = #{merchantIntroduction},</if>
-            <if test="offline != null">offline =#{offline}</if>
+            <if test="offline != null">offline =#{offline},</if>
+            <if test="address != null and address != ''">address = #{address},</if>
+            <if test="longitude != null">longitude = #{longitude},</if>
+            <if test="latitude != null">latitude = #{latitude}</if>
         </trim>
         where user_id = #{userId}
     </update>

+ 16 - 1
ruoyi-system/src/main/resources/mapper/system/OrderParentMapper.xml

@@ -16,10 +16,13 @@
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="ddId"    column="dd_id"    />
+        <result property="tableNum"    column="table_num"    />
+        <result property="shdzId"    column="shdz_id"    />
+        <result property="shAddress"    column="sh_address"    />
     </resultMap>
 
     <sql id="selectOrderParentVo">
-        select id, user_id, order_status, total_amount, total_discount, actual_pay_amount, payment_method, payment_time, create_time, update_time, dd_id from order_parent
+        select id, user_id, order_status, total_amount, total_discount, actual_pay_amount, payment_method, payment_time, create_time, update_time, dd_id, table_num, shdz_id, sh_address from order_parent
     </sql>
 
     <select id="selectOrderParentList" parameterType="OrderParent" resultMap="OrderParentResult">
@@ -33,6 +36,9 @@
             <if test="paymentMethod != null  and paymentMethod != ''"> and payment_method = #{paymentMethod}</if>
             <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
             <if test="ddId != null  and ddId != ''"> and dd_id = #{ddId}</if>
+            <if test="tableNum != null  and tableNum != ''"> and table_num = #{tableNum}</if>
+            <if test="shdzId != null"> and shdz_id = #{shdzId}</if>
+            <if test="shAddress != null  and shAddress != ''"> and sh_address = #{shAddress}</if>
         </where>
     </select>
 
@@ -55,6 +61,9 @@
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="ddId != null">dd_id,</if>
+            <if test="tableNum != null and tableNum != ''">table_num,</if>
+            <if test="shdzId != null">shdz_id,</if>
+            <if test="shAddress != null and shAddress != ''">sh_address,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -68,6 +77,9 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="ddId != null">#{ddId},</if>
+            <if test="tableNum != null and tableNum != ''">#{tableNum},</if>
+            <if test="shdzId != null">#{shdzId},</if>
+            <if test="shAddress != null and shAddress != ''">#{shAddress},</if>
         </trim>
     </insert>
 
@@ -84,6 +96,9 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="ddId != null">dd_id = #{ddId},</if>
+            <if test="tableNum != null and tableNum != ''">table_num = #{tableNum},</if>
+            <if test="shdzId != null">shdz_id = #{shdzId},</if>
+            <if test="shAddress != null and shAddress != ''">sh_address = #{shAddress},</if>
         </trim>
         where id = #{id}
     </update>

+ 19 - 1
ruoyi-system/src/main/resources/mapper/system/PosOrderMapper.xml

@@ -46,10 +46,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="payType" column="pay_type" />
         <result property="parentDdId" column="parent_dd_id" />
         <result property="orderCategory" column="order_category" />
+        <result property="tableNum" column="table_num" />
+        <result property="logo" column="logo" />
+        <result property="posName" column="pos_name" />
     </resultMap>
 
     <sql id="selectPosOrderVo">
-        select id, dd_id, sh_id, md_id, cretim, shdz_id, user_id,sh_address, amount, remarks, state, type, delry_time,food,yh_id,yh_name,md_yh_id,md_yh_name,md_discount_amount,jvli,freight,dining_status,qs_id,pay_url,collect_payment,activity,md_activity,kefu_state,kefu_content,kefu_repeat,repeat_dd_id,sales_name,md_sales_name,sales_reduction,md_sales_reduction,points,points_reduction,sd_time,pay_type,parent_dd_id,order_category from pos_order
+        select id, dd_id, sh_id, md_id, cretim, shdz_id, user_id,sh_address, amount, remarks, state, type, delry_time,food,yh_id,yh_name,md_yh_id,md_yh_name,md_discount_amount,jvli,freight,dining_status,qs_id,pay_url,collect_payment,activity,md_activity,kefu_state,kefu_content,kefu_repeat,repeat_dd_id,sales_name,md_sales_name,sales_reduction,md_sales_reduction,points,points_reduction,sd_time,pay_type,parent_dd_id,order_category,table_num,logo,pos_name from pos_order
     </sql>
 
     <select id="selectPosOrderList" parameterType="PosOrder" resultMap="PosOrderResult">
@@ -83,6 +86,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null"> and pay_type =#{payType}</if>
             <if test="parentDdId != null and parentDdId != ''"> and parent_dd_id = #{parentDdId}</if>
             <if test="orderCategory != null and orderCategory != ''"> and order_category = #{orderCategory}</if>
+            <if test="tableNum != null and tableNum != ''"> and table_num = #{tableNum}</if>
+            <if test="logo != null and logo != ''"> and logo = #{logo}</if>
+            <if test="posName != null and posName != ''"> and pos_name = #{posName}</if>
             and not (state=0 and collect_payment=0)
         </where>
         order by id desc
@@ -119,6 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null"> and pay_type =#{payType}</if>
             <if test="parentDdId != null and parentDdId != ''"> and parent_dd_id = #{parentDdId}</if>
             <if test="orderCategory != null and orderCategory != ''"> and order_category = #{orderCategory}</if>
+            <if test="tableNum != null and tableNum != ''"> and table_num = #{tableNum}</if>
+            <if test="logo != null and logo != ''"> and logo = #{logo}</if>
+            <if test="posName != null and posName != ''"> and pos_name = #{posName}</if>
         </where>
         order by kefu_state desc,cretim desc
     </select>
@@ -158,6 +167,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null">pay_type,</if>
             <if test="parentDdId != null and parentDdId != ''">parent_dd_id,</if>
             <if test="orderCategory != null and orderCategory != ''">order_category,</if>
+            <if test="tableNum != null and tableNum != ''">table_num,</if>
+            <if test="logo != null and logo != ''">logo,</if>
+            <if test="posName != null and posName != ''">pos_name,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="ddId != null">#{ddId},</if>
@@ -187,6 +199,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null">#{payType},</if>
             <if test="parentDdId != null and parentDdId != ''">#{parentDdId},</if>
             <if test="orderCategory != null and orderCategory != ''">#{orderCategory},</if>
+            <if test="tableNum != null and tableNum != ''">#{tableNum},</if>
+            <if test="logo != null and logo != ''">#{logo},</if>
+            <if test="posName != null and posName != ''">#{posName},</if>
          </trim>
     </insert>
 
@@ -222,6 +237,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payType != null">pay_type = #{payType},</if>
             <if test="parentDdId != null and parentDdId != ''">parent_dd_id = #{parentDdId},</if>
             <if test="orderCategory != null and orderCategory != ''">order_category = #{orderCategory},</if>
+            <if test="tableNum != null and tableNum != ''">table_num = #{tableNum},</if>
+            <if test="logo != null and logo != ''">logo = #{logo},</if>
+            <if test="posName != null and posName != ''">pos_name = #{posName},</if>
         </trim>
         where id = #{id}
     </update>

+ 6 - 1
ruoyi-system/src/main/resources/mapper/system/UserWalletMapper.xml

@@ -8,17 +8,19 @@
         <result property="id"    column="id"    />
         <result property="userId"    column="userId"    />
         <result property="pointsWallet"    column="points_wallet"    />
+        <result property="balanceWallet"    column="balance_wallet"    />
         <result property="version"    column="version"   />
     </resultMap>
 
     <sql id="selectUserWalletVo">
-        select id, userId, points_wallet,version from user_wallet
+        select id, userId, points_wallet, balance_wallet, version from user_wallet
     </sql>
 
     <select id="selectUserWalletList" parameterType="UserWallet" resultMap="UserWalletResult">
         <include refid="selectUserWalletVo"/>
         <where>
             <if test="pointsWallet != null "> and points_wallet = #{pointsWallet}</if>
+            <if test="balanceWallet != null "> and balance_wallet = #{balanceWallet}</if>
         </where>
     </select>
 
@@ -32,11 +34,13 @@
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="userId != null">userId,</if>
             <if test="pointsWallet != null">points_wallet,</if>
+            <if test="balanceWallet != null">balance_wallet,</if>
             <if test="version != null">version,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
             <if test="pointsWallet != null">#{pointsWallet},</if>
+            <if test="balanceWallet != null">#{balanceWallet},</if>
             <if test="version != null">#{version},</if>
         </trim>
     </insert>
@@ -46,6 +50,7 @@
         <trim prefix="SET" suffixOverrides=",">
             <if test="userId != null">userId = #{userId},</if>
             <if test="pointsWallet != null">points_wallet = #{pointsWallet},</if>
+            <if test="balanceWallet != null">balance_wallet = #{balanceWallet},</if>
             <if test="version != null">version = #{version},</if>
         </trim>
         where id = #{id}

+ 20 - 20
ruoyi-system/target/classes/mapper/system/PointsTransactionMapper.xml → ruoyi-system/src/main/resources/mapper/system/WalletTransactionMapper.xml

@@ -2,9 +2,9 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.system.mapper.PointsTransactionMapper">
+<mapper namespace="com.ruoyi.system.mapper.WalletTransactionMapper">
 
-    <resultMap type="PointsTransaction" id="PointsTransactionResult">
+    <resultMap type="WalletTransaction" id="PointsTransactionResult">
         <result property="id"    column="id"    />
         <result property="userId"    column="user_id"    />
         <result property="ddId"    column="dd_id"    />
@@ -12,22 +12,22 @@
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remark"    column="remark"    />
-        <result property="pointsChange"    column="points_change"    />
-        <result property="currentPoints"    column="current_points"    />
+        <result property="change"    column="change"    />
+        <result property="currentBalance"    column="current_balance"    />
     </resultMap>
 
     <sql id="selectPointsTransactionVo">
-        select id, user_id, dd_id, type, create_time, update_time, remark, points_change, current_points from points_transaction
+        select id, user_id, dd_id, type, create_time, update_time, remark, change, current_balance from wallet_transaction
     </sql>
 
-    <select id="selectPointsTransactionList" parameterType="PointsTransaction" resultMap="PointsTransactionResult">
+    <select id="selectPointsTransactionList" parameterType="WalletTransaction" resultMap="PointsTransactionResult">
         <include refid="selectPointsTransactionVo"/>
         <where>
             <if test="userId != null "> and user_id = #{userId}</if>
             <if test="ddId != null "> and dd_id = #{ddId}</if>
             <if test="type != null  and type != ''"> and type = #{type}</if>
-            <if test="pointsChange != null  and pointsChange != ''"> and points_change = #{pointsChange}</if>
-            <if test="currentPoints != null  and currentPoints != ''"> and current_points = #{currentPoints}</if>
+            <if test="change != null  and change != ''"> and change = #{change}</if>
+            <if test="currentBalance != null  and currentBalance != ''"> and current_balance = #{currentBalance}</if>
         </where>
     </select>
 
@@ -36,8 +36,8 @@
         where id = #{id}
     </select>
 
-    <insert id="insertPointsTransaction" parameterType="PointsTransaction" useGeneratedKeys="true" keyProperty="id">
-        insert into points_transaction
+    <insert id="insertPointsTransaction" parameterType="WalletTransaction" useGeneratedKeys="true" keyProperty="id">
+        insert into wallet_transaction
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="userId != null">user_id,</if>
             <if test="ddId != null">dd_id,</if>
@@ -45,8 +45,8 @@
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
-            <if test="pointsChange != null and pointsChange != ''">points_change,</if>
-            <if test="currentPoints != null and currentPoints != ''">current_points,</if>
+            <if test="change != null and change != ''">change,</if>
+            <if test="currentBalance != null and currentBalance != ''">current_balance,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -55,13 +55,13 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
-            <if test="pointsChange != null and pointsChange != ''">#{pointsChange},</if>
-            <if test="currentPoints != null and currentPoints != ''">#{currentPoints},</if>
+            <if test="change != null and change != ''">#{change},</if>
+            <if test="currentBalance != null and currentBalance != ''">#{currentBalance},</if>
         </trim>
     </insert>
 
-    <update id="updatePointsTransaction" parameterType="PointsTransaction">
-        update points_transaction
+    <update id="updatePointsTransaction" parameterType="WalletTransaction">
+        update wallet_transaction
         <trim prefix="SET" suffixOverrides=",">
             <if test="userId != null">user_id = #{userId},</if>
             <if test="ddId != null">dd_id = #{ddId},</if>
@@ -69,18 +69,18 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
-            <if test="pointsChange != null and pointsChange != ''">points_change = #{pointsChange},</if>
-            <if test="currentPoints != null and currentPoints != ''">current_points = #{currentPoints},</if>
+            <if test="change != null and change != ''">change = #{change},</if>
+            <if test="currentBalance != null and currentBalance != ''">current_balance = #{currentBalance},</if>
         </trim>
         where id = #{id}
     </update>
 
     <delete id="deletePointsTransactionById" parameterType="Long">
-        delete from points_transaction where id = #{id}
+        delete from wallet_transaction where id = #{id}
     </delete>
 
     <delete id="deletePointsTransactionByIds" parameterType="String">
-        delete from points_transaction where id in
+        delete from wallet_transaction where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 18 - 3
ruoyi-system/target/classes/mapper/infouser/InfoUserMapper.xml

@@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="bankPhoto"    column="bank_photo"    />
         <result property="merchantIntroduction"    column="merchant_introduction"    />
         <result property="offline"    column="offline"    />
+        <result property="address"    column="address"    />
+        <result property="longitude"    column="longitude"    />
+        <result property="latitude"    column="latitude"    />
     </resultMap>
 
     <sql id="selectInfoUserVo">
@@ -59,6 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditStatus != null  and auditStatus != ''"> and audit_status = #{auditStatus}</if>
             <if test="telPhone != null  and telPhone != ''"> and tel_phone = #{telPhone}</if>
             <if test="shijStatus != null  and shijStatus != ''"> and shij_status = #{shijStatus}</if>
+            <if test="address != null  and address != ''"> and address like concat('%', #{address}, '%')</if>
+            <if test="longitude != null"> and longitude = #{longitude}</if>
+            <if test="latitude != null"> and latitude = #{latitude}</if>
         </where>
         order by user_id desc
     </select>
@@ -95,7 +101,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="passportPhoto != null">passport_photo,</if>
             <if test="bankPhoto != null">bank_photo,</if>
             <if test="merchantIntroduction != null">merchant_introduction,</if>
-            <if test="offline != null">offline</if>
+            <if test="offline != null">offline,</if>
+            <if test="address != null and address != ''">address,</if>
+            <if test="longitude != null">longitude,</if>
+            <if test="latitude != null">latitude</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userName != null and userName != ''">#{userName},</if>
@@ -122,7 +131,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="passportPhoto != null">#{passportPhoto},</if>
             <if test="bankPhoto != null">#{bankPhoto},</if>
             <if test="merchantIntroduction != null">#{merchantIntroduction},</if>
-            <if test="offline !=null">#{offline}</if>
+            <if test="offline !=null">#{offline},</if>
+            <if test="address != null and address != ''">#{address},</if>
+            <if test="longitude != null">#{longitude},</if>
+            <if test="latitude != null">#{latitude}</if>
          </trim>
     </insert>
 
@@ -153,7 +165,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="passportPhoto != null">passport_photo = #{passportPhoto},</if>
             <if test="bankPhoto != null">bank_photo = #{bankPhoto},</if>
             <if test="merchantIntroduction != null">merchant_introduction = #{merchantIntroduction},</if>
-            <if test="offline != null">offline =#{offline}</if>
+            <if test="offline != null">offline =#{offline},</if>
+            <if test="address != null and address != ''">address = #{address},</if>
+            <if test="longitude != null">longitude = #{longitude},</if>
+            <if test="latitude != null">latitude = #{latitude}</if>
         </trim>
         where user_id = #{userId}
     </update>

+ 16 - 1
ruoyi-system/target/classes/mapper/system/OrderParentMapper.xml

@@ -16,10 +16,13 @@
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="ddId"    column="dd_id"    />
+        <result property="tableNum"    column="table_num"    />
+        <result property="shdzId"    column="shdz_id"    />
+        <result property="shAddress"    column="sh_address"    />
     </resultMap>
 
     <sql id="selectOrderParentVo">
-        select id, user_id, order_status, total_amount, total_discount, actual_pay_amount, payment_method, payment_time, create_time, update_time, dd_id from order_parent
+        select id, user_id, order_status, total_amount, total_discount, actual_pay_amount, payment_method, payment_time, create_time, update_time, dd_id, table_num, shdz_id, sh_address from order_parent
     </sql>
 
     <select id="selectOrderParentList" parameterType="OrderParent" resultMap="OrderParentResult">
@@ -33,6 +36,9 @@
             <if test="paymentMethod != null  and paymentMethod != ''"> and payment_method = #{paymentMethod}</if>
             <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
             <if test="ddId != null  and ddId != ''"> and dd_id = #{ddId}</if>
+            <if test="tableNum != null  and tableNum != ''"> and table_num = #{tableNum}</if>
+            <if test="shdzId != null"> and shdz_id = #{shdzId}</if>
+            <if test="shAddress != null  and shAddress != ''"> and sh_address = #{shAddress}</if>
         </where>
     </select>
 
@@ -55,6 +61,9 @@
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="ddId != null">dd_id,</if>
+            <if test="tableNum != null and tableNum != ''">table_num,</if>
+            <if test="shdzId != null">shdz_id,</if>
+            <if test="shAddress != null and shAddress != ''">sh_address,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -68,6 +77,9 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="ddId != null">#{ddId},</if>
+            <if test="tableNum != null and tableNum != ''">#{tableNum},</if>
+            <if test="shdzId != null">#{shdzId},</if>
+            <if test="shAddress != null and shAddress != ''">#{shAddress},</if>
         </trim>
     </insert>
 
@@ -84,6 +96,9 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="ddId != null">dd_id = #{ddId},</if>
+            <if test="tableNum != null and tableNum != ''">table_num = #{tableNum},</if>
+            <if test="shdzId != null">shdz_id = #{shdzId},</if>
+            <if test="shAddress != null and shAddress != ''">sh_address = #{shAddress},</if>
         </trim>
         where id = #{id}
     </update>

+ 6 - 1
ruoyi-system/target/classes/mapper/system/UserWalletMapper.xml

@@ -8,17 +8,19 @@
         <result property="id"    column="id"    />
         <result property="userId"    column="userId"    />
         <result property="pointsWallet"    column="points_wallet"    />
+        <result property="balanceWallet"    column="balance_wallet"    />
         <result property="version"    column="version"   />
     </resultMap>
 
     <sql id="selectUserWalletVo">
-        select id, userId, points_wallet,version from user_wallet
+        select id, userId, points_wallet, balance_wallet, version from user_wallet
     </sql>
 
     <select id="selectUserWalletList" parameterType="UserWallet" resultMap="UserWalletResult">
         <include refid="selectUserWalletVo"/>
         <where>
             <if test="pointsWallet != null "> and points_wallet = #{pointsWallet}</if>
+            <if test="balanceWallet != null "> and balance_wallet = #{balanceWallet}</if>
         </where>
     </select>
 
@@ -32,11 +34,13 @@
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="userId != null">userId,</if>
             <if test="pointsWallet != null">points_wallet,</if>
+            <if test="balanceWallet != null">balance_wallet,</if>
             <if test="version != null">version,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
             <if test="pointsWallet != null">#{pointsWallet},</if>
+            <if test="balanceWallet != null">#{balanceWallet},</if>
             <if test="version != null">#{version},</if>
         </trim>
     </insert>
@@ -46,6 +50,7 @@
         <trim prefix="SET" suffixOverrides=",">
             <if test="userId != null">userId = #{userId},</if>
             <if test="pointsWallet != null">points_wallet = #{pointsWallet},</if>
+            <if test="balanceWallet != null">balance_wallet = #{balanceWallet},</if>
             <if test="version != null">version = #{version},</if>
         </trim>
         where id = #{id}

+ 20 - 20
ruoyi-system/src/main/resources/mapper/system/PointsTransactionMapper.xml → ruoyi-system/target/classes/mapper/system/WalletTransactionMapper.xml

@@ -2,9 +2,9 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.system.mapper.PointsTransactionMapper">
+<mapper namespace="com.ruoyi.system.mapper.WalletTransactionMapper">
 
-    <resultMap type="PointsTransaction" id="PointsTransactionResult">
+    <resultMap type="WalletTransaction" id="PointsTransactionResult">
         <result property="id"    column="id"    />
         <result property="userId"    column="user_id"    />
         <result property="ddId"    column="dd_id"    />
@@ -12,22 +12,22 @@
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remark"    column="remark"    />
-        <result property="pointsChange"    column="points_change"    />
-        <result property="currentPoints"    column="current_points"    />
+        <result property="change"    column="change"    />
+        <result property="currentBalance"    column="current_balance"    />
     </resultMap>
 
     <sql id="selectPointsTransactionVo">
-        select id, user_id, dd_id, type, create_time, update_time, remark, points_change, current_points from points_transaction
+        select id, user_id, dd_id, type, create_time, update_time, remark, change, current_balance from wallet_transaction
     </sql>
 
-    <select id="selectPointsTransactionList" parameterType="PointsTransaction" resultMap="PointsTransactionResult">
+    <select id="selectPointsTransactionList" parameterType="WalletTransaction" resultMap="PointsTransactionResult">
         <include refid="selectPointsTransactionVo"/>
         <where>
             <if test="userId != null "> and user_id = #{userId}</if>
             <if test="ddId != null "> and dd_id = #{ddId}</if>
             <if test="type != null  and type != ''"> and type = #{type}</if>
-            <if test="pointsChange != null  and pointsChange != ''"> and points_change = #{pointsChange}</if>
-            <if test="currentPoints != null  and currentPoints != ''"> and current_points = #{currentPoints}</if>
+            <if test="change != null  and change != ''"> and change = #{change}</if>
+            <if test="currentBalance != null  and currentBalance != ''"> and current_balance = #{currentBalance}</if>
         </where>
     </select>
 
@@ -36,8 +36,8 @@
         where id = #{id}
     </select>
 
-    <insert id="insertPointsTransaction" parameterType="PointsTransaction" useGeneratedKeys="true" keyProperty="id">
-        insert into points_transaction
+    <insert id="insertPointsTransaction" parameterType="WalletTransaction" useGeneratedKeys="true" keyProperty="id">
+        insert into wallet_transaction
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="userId != null">user_id,</if>
             <if test="ddId != null">dd_id,</if>
@@ -45,8 +45,8 @@
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
-            <if test="pointsChange != null and pointsChange != ''">points_change,</if>
-            <if test="currentPoints != null and currentPoints != ''">current_points,</if>
+            <if test="change != null and change != ''">change,</if>
+            <if test="currentBalance != null and currentBalance != ''">current_balance,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="userId != null">#{userId},</if>
@@ -55,13 +55,13 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
-            <if test="pointsChange != null and pointsChange != ''">#{pointsChange},</if>
-            <if test="currentPoints != null and currentPoints != ''">#{currentPoints},</if>
+            <if test="change != null and change != ''">#{change},</if>
+            <if test="currentBalance != null and currentBalance != ''">#{currentBalance},</if>
         </trim>
     </insert>
 
-    <update id="updatePointsTransaction" parameterType="PointsTransaction">
-        update points_transaction
+    <update id="updatePointsTransaction" parameterType="WalletTransaction">
+        update wallet_transaction
         <trim prefix="SET" suffixOverrides=",">
             <if test="userId != null">user_id = #{userId},</if>
             <if test="ddId != null">dd_id = #{ddId},</if>
@@ -69,18 +69,18 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
-            <if test="pointsChange != null and pointsChange != ''">points_change = #{pointsChange},</if>
-            <if test="currentPoints != null and currentPoints != ''">current_points = #{currentPoints},</if>
+            <if test="change != null and change != ''">change = #{change},</if>
+            <if test="currentBalance != null and currentBalance != ''">current_balance = #{currentBalance},</if>
         </trim>
         where id = #{id}
     </update>
 
     <delete id="deletePointsTransactionById" parameterType="Long">
-        delete from points_transaction where id = #{id}
+        delete from wallet_transaction where id = #{id}
     </delete>
 
     <delete id="deletePointsTransactionByIds" parameterType="String">
-        delete from points_transaction where id in
+        delete from wallet_transaction where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>