소스 검색

网点、设备修改

zuypeng 1 년 전
부모
커밋
96f378720a

+ 1 - 2
admin-web/src/App.vue

@@ -104,8 +104,7 @@ onMounted(() => {
 });
 
 const   refreshEnv = async ()=>{
-  $body("/dataDict/list", {pageSize:1024}).then((res: any) => {
-    let {list}  = res;
+  $body("/dataDict/list", {pageSize:1024}).then((list: any) => {
     var dictGroup = u.groupByKey(list,"code");
     Session.set("dicts", dictGroup);
   })

+ 1 - 1
admin-web/src/components/form/ExtDLabel.vue

@@ -170,7 +170,7 @@ const setupLabel = ()=>{
 
     if (dict) {
       state.text = dict.name||dict.label;
-      state.style = setupColorStyle(state.colorList[dict.value%8]);
+      state.style = setupColorStyle(state.colorList[dict.value.length%8]);
     }else{
       return "-"
     }

+ 2 - 1
admin-web/src/components/form/ExtUpload.vue

@@ -20,7 +20,7 @@
       </el-icon>
     </template>
     <template v-else>
-      <SvgIcon name="ele-Remove"></SvgIcon>
+      <SvgIcon name="ele-Remove" class="hc"> </SvgIcon>
       <img v-if="showImageList[0]" :src="showImageList[0]" class="avatar"/>
       <el-icon v-else class="avatar-uploader-icon">
         <Plus/>
@@ -188,5 +188,6 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
   width: 60px;
   height: 60px;
   text-align: center;
+  margin-left: -5px;
 }
 </style>

+ 2 - 2
admin-web/src/layout/navBars/breadcrumb/toolbar.vue

@@ -142,7 +142,7 @@ import other from '/@/utils/other';
 import mittBus from '/@/utils/mitt';
 import {Session, Local} from '/@/utils/storage';
 import u from "/@/utils/u";
-import {$get} from "/@/utils/request";
+import {$body} from "/@/utils/request";
 
 // 引入组件
 const Notification = defineAsyncComponent(() => import('/@/layout/navBars/breadcrumb/notification.vue'));
@@ -307,7 +307,7 @@ onMounted(() => {
 });
 
 const loadStationList = () => {
-  $get(`/station/listStation`, {pageNum: 1024}).then((res: any) => {
+  $body(`/washStation/list`, {pageNum: 1024}).then((res: any) => {
     state.stationList = res;
     if (res && res.length > 0) {
       state.currentStation = res[0];

+ 16 - 16
admin-web/src/router/route.ts

@@ -138,7 +138,7 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                         name: 'adminStationList',
                         component: () => import('/@/views/admin/station/list/index.vue'),
                         meta: {
-                            title: '站点监控',
+                            title: '网点清单',
                             isLink: '',
                             isHide: false,
                             isKeepAlive: true,
@@ -148,21 +148,21 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                             icon: 'ele-OfficeBuilding',
                         },
                     },
-                    // {
-                    //     path: '/station/endpoint/:id',
-                    //     name: 'adminStationEndpoint',
-                    //     component: () => import('/@/views/admin/station/endpoint/index.vue'),
-                    //     meta: {
-                    //         title: '电桩监控',
-                    //         isLink: '',
-                    //         isHide: false,
-                    //         isKeepAlive: true,
-                    //         isAffix: false,
-                    //         isIframe: false,
-                    //         perm:"equipment.list",
-                    //         icon: 'ele-User',
-                    //     },
-                    // },
+                    {
+                        path: '/station/device/:id',
+                        name: 'adminStationDevice',
+                        component: () => import('/@/views/admin/station/device/index.vue'),
+                        meta: {
+                            title: '洗车机',
+                            isLink: '',
+                            isHide: false,
+                            isKeepAlive: true,
+                            isAffix: false,
+                            isIframe: false,
+                            perm:"equipment.list",
+                            icon: 'ele-User',
+                        },
+                    },
                     // {
                     //     path: '/station/statMonth',
                     //     name: 'adminStationStatMonth',

+ 1 - 1
admin-web/src/views/admin/dict/index.vue

@@ -99,7 +99,7 @@
           <div v-for="(item,idx) in state.dictForm.list" :key="idx" class="mt10">
             <el-row :gutter="10">
               <el-col :span="8">
-                <el-input size="default" v-model="item.name" placeholder="字典名称"></el-input>
+                <el-input size="default" v-model="item.name" placeholder="字典名称" @change="state.saveVisible = true;"></el-input>
               </el-col>
               <el-col :span="8">
                 <el-input size="default" :readonly="item.id" v-model="item.value" placeholder="字典码值"></el-input>

+ 1 - 1
admin-web/src/views/admin/invoice/index.vue

@@ -1,4 +1,4 @@
-<style scoped lang="scss">
+ <style scoped lang="scss">
 .system-container {
 
   :deep(.el-card__body) {

+ 0 - 0
admin-web/src/views/admin/station/endpoint/index.vue → admin-web/src/views/admin/station/device/index.vue


+ 0 - 0
admin-web/src/views/admin/station/endpoint/upload.vue → admin-web/src/views/admin/station/device/upload.vue


+ 83 - 65
admin-web/src/views/admin/station/list/dialog.vue

@@ -6,7 +6,7 @@
     <el-dialog
         :title="state.dialog.title"
         v-model="state.dialog.isShowDialog"
-        width="820px"
+        width="620px"
         draggable
         destroy-on-close
         :close-on-click-modal="false"
@@ -20,68 +20,77 @@
           size="default"
           label-width="100px"
           class="mt5">
-        <el-form-item label="地址" prop="address">
+        <div class="sub-group-bottom">基本信息</div>
+        <el-form-item label="站点ID" prop="stationId" class="wd350">
           <el-input
-              v-model="state.ruleForm.address"
-              placeholder="地址"
+              v-model="state.ruleForm.stationId"
+              placeholder="站点id"
               clearable
-              class="wd350">
+              class="wd100">
           </el-input>
         </el-form-item>
-        <el-form-item label="营业时间描述" prop="businessHours">
+        <el-form-item label="工位数量" prop="parkingNum">
           <el-input
-              v-model="state.ruleForm.businessHours"
-              placeholder="营业时间描述"
+              v-model="state.ruleForm.parkingNum"
+              placeholder="工位数量"
               clearable
-              class="wd350">
+              class="wd100">
           </el-input>
         </el-form-item>
-        <el-form-item label="公司id" prop="companyId">
+        <el-form-item label="站点名称" prop="stationName" >
           <el-input
-              v-model="state.ruleForm.companyId"
-              placeholder="公司id"
+              v-model="state.ruleForm.stationName"
+              placeholder="站点名称"
               clearable
-              class="wd350">
+              class="wd200">
           </el-input>
         </el-form-item>
-        <el-form-item label="站点坐标" prop="location">
-          <el-input
-              v-model="state.ruleForm.location"
-              placeholder="站点坐标"
+        <el-form-item label="站点照片" prop="pictures">
+          <ext-upload v-model="state.ruleForm.pictures" multiple max="6"></ext-upload>
+<!--          <el-input
+              v-model="state.ruleForm.pictures"
+              placeholder="站点照片"
               clearable
               class="wd350">
-          </el-input>
+          </el-input>-->
         </el-form-item>
-        <el-form-item label="停车费描述:eg:洗车费用满10元减免1小时停车费" prop="parkingFee">
-          <el-input
-              v-model="state.ruleForm.parkingFee"
-              placeholder="停车费描述:eg:洗车费用满10元减免1小时停车费"
-              clearable
-              class="wd350">
-          </el-input>
+
+        <el-form-item class="w100"></el-form-item>
+        <el-form-item label="站点状态" prop="stationStatus">
+          <ext-d-select type="WashStation.status" class="wd200" v-model="state.ruleForm.stationStatus"></ext-d-select>
         </el-form-item>
-        <el-form-item label="工位数量" prop="parkingNum">
+
+        <el-form-item label="站点类型" prop="stationType">
+          <ext-d-select type="WashStation.type" class="wd200" v-model="state.ruleForm.stationType"></ext-d-select>
+
+        </el-form-item>
+
+        <el-form-item label="地址" prop="address" class="w100">
           <el-input
-              v-model="state.ruleForm.parkingNum"
-              placeholder="工位数量"
+              v-model="state.ruleForm.address"
+              placeholder="地址"
               clearable
-              class="wd350">
+
+              class="w100">
           </el-input>
         </el-form-item>
-        <el-form-item label="站点照片" prop="pictures">
+
+        <el-form-item label="经度坐标" prop="location">
           <el-input
-              v-model="state.ruleForm.pictures"
-              placeholder="站点照片"
+              v-model="state.location.stationLng"
+              placeholder="经度坐标"
               clearable
-              class="wd350">
+              type="number"
+              class="wd200">
           </el-input>
         </el-form-item>
-        <el-form-item label="备注" prop="remark">
+        <el-form-item label="纬度坐标" prop="location">
           <el-input
-              v-model="state.ruleForm.remark"
-              placeholder="备注"
+              v-model="state.location.stationLat"
+              placeholder="纬度坐标"
               clearable
-              class="wd350">
+              type="number"
+              class="wd200">
           </el-input>
         </el-form-item>
         <el-form-item label="服务电话" prop="serviceTel">
@@ -92,54 +101,57 @@
               class="wd350">
           </el-input>
         </el-form-item>
-        <el-form-item label="站点引导" prop="siteGuide">
-          <el-input
-              v-model="state.ruleForm.siteGuide"
-              placeholder="站点引导"
-              clearable
-              class="wd350">
-          </el-input>
-        </el-form-item>
-        <el-form-item label="站点id" prop="stationId">
+        <el-form-item label="站点电话" prop="stationTel">
           <el-input
-              v-model="state.ruleForm.stationId"
-              placeholder="站点id"
+              v-model="state.ruleForm.stationTel"
+              placeholder="站点电话"
               clearable
               class="wd350">
           </el-input>
         </el-form-item>
-        <el-form-item label="站点名称" prop="stationName">
+
+
+        <el-form-item label="营业时间描述" prop="businessHours"  class="w100">
           <el-input
-              v-model="state.ruleForm.stationName"
-              placeholder="站点名称"
+              v-model="state.ruleForm.businessHours"
+              placeholder="营业时间描述"
               clearable
-              class="wd350">
+              type="textarea"
+              class="w100">
           </el-input>
         </el-form-item>
-        <el-form-item label="站点状态:Unknown:未知,Normal:正常运营,Offline:关闭下线,Repair:维护中" prop="stationStatus">
+
+        <el-form-item label="停车费描述" prop="parkingFee" class="w100">
           <el-input
-              v-model="state.ruleForm.stationStatus"
-              placeholder="站点状态:Unknown:未知,Normal:正常运营,Offline:关闭下线,Repair:维护中"
+              v-model="state.ruleForm.parkingFee"
+              type="textarea"
+              placeholder="停车费描述:eg:洗车费用满10元减免1小时停车费"
               clearable
-              class="wd350">
+              class="w100">
           </el-input>
         </el-form-item>
-        <el-form-item label="站点电话" prop="stationTel">
+
+
+        <el-form-item label="备注" prop="remark" class="w100">
           <el-input
-              v-model="state.ruleForm.stationTel"
-              placeholder="站点电话"
+              v-model="state.ruleForm.remark"
+              placeholder="备注"
               clearable
-              class="wd350">
+              type="textarea"
+              class="w100">
           </el-input>
         </el-form-item>
-        <el-form-item label="站点类型:Public:公共站 2:Private:内部站(不对外开放)" prop="stationType">
+
+<!--        <el-form-item label="站点引导" prop="siteGuide">
           <el-input
-              v-model="state.ruleForm.stationType"
-              placeholder="站点类型:Public:公共站 2:Private:内部站(不对外开放)"
+              v-model="state.ruleForm.siteGuide"
+              placeholder="站点引导"
               clearable
               class="wd350">
           </el-input>
-        </el-form-item>
+        </el-form-item>-->
+
+
       </el-form>
 
       <template #footer>
@@ -157,6 +169,8 @@ import {defineAsyncComponent, reactive, onMounted, ref} from 'vue';
 import {Msg} from "/@/utils/message";
 import {$body, $get} from "/@/utils/request";
 import u from '/@/utils/u'
+import ExtUpload from "/@/components/form/ExtUpload.vue";
+import ExtDSelect from "/@/components/form/ExtDSelect.vue";
 
 // 引入组件
 
@@ -166,7 +180,8 @@ const formRef = ref();
 //定义初始变量,重置使用
 const initState = () => ({
   ruleForm: {
-    id: 0
+    id: 0,
+    location:{}
   },
   btnLoading: false,
   dialog: {
@@ -176,6 +191,7 @@ const initState = () => ({
     submitTxt: '',
   },
   rules: {},
+  location:{}
 })
 
 // 定义变量内容
@@ -207,6 +223,7 @@ const onSubmit = () => {
   formRef.value.validate((v: boolean) => {
     if (v) {
       state.btnLoading = true;
+      state.ruleForm.location = JSON.stringify(state.location)
       const url = state.ruleForm.id > 0 ? "washStation/modify" : "washStation/add"
       $body(url, state.ruleForm).then(() => {
         state.btnLoading = false;
@@ -230,6 +247,7 @@ const handleFormChange = (formData: any) => {
 const loadData = (id: number) => {
   $get(`washStation/detail/${id}`).then((res: any) => {
     state.ruleForm = res;
+    state.location = JSON.parse(res.location)
   })
 }
 

+ 85 - 57
admin-web/src/views/admin/station/list/index.vue

@@ -32,23 +32,77 @@
           ref="queryRef"
           v-model="state.formQuery"
           :columns="state.columns"
-          :import-config="state.importConfig"
-          :export-config="state.exportConfig"
-          @on-change="loadData(true)"
-          @imported="loadData(true)">
+          @on-change="loadData(true)">
         <!--  <template #extraQuery></template>
           <template #extraLeft></template>
-          <template #extraRight></template>-->
+         -->
+        <template #extraRight>
+          <el-button  v-auth="'washStation.add'"   size="default" plain  type="success" class="ml10" @click="handleRowClick('add',null)">
+            <SvgIcon name="ele-FolderAdd"/>
+            新增
+          </el-button></template>
       </ext-query-form>
 
-      <ext-table
-          class="page-content"
+      <el-table
+          border
+          stripe="stripe"
           :height="state.tableData.height"
-          :data-list="state.tableData.data"
-          :columns="state.columns"
-          :border="true"
-          :loading="state.tableData.loading">
-      </ext-table>
+          highlight-current-row
+          current-row-key="id"
+          row-key="id"
+          @on-row-click="handleRowClick('view',$event)"
+          :data="state.tableData.data"
+          v-loading="state.tableData.loading">
+        <template #empty>
+          <el-empty></el-empty>
+        </template>
+        <el-table-column
+            v-for="field in state.columns"
+            :key="field.prop"
+            :type="field.type"
+            :label="field.label"
+            :column-key="field.prop"
+            :width="field.width"
+            :min-width="field.minWidth"
+            :fixed="field.fixed"
+            :sortable="field.sortable"
+            :show-overflow-tooltip="!field.fixed&&field.width>150"
+        >
+          <template #default="{row}">
+            <template v-if="field.prop==='stationStatus'">
+              <ext-d-label type="WashStation.status" :model-value="row[field.prop]"></ext-d-label>
+            </template>
+            <template v-else-if="field.prop==='stationType'">
+              <ext-d-label type="WashStation.type" :model-value="row[field.prop]"></ext-d-label>
+            </template>
+            <template v-else-if="field.prop==='stationName'">
+              <div class="text-align-center">
+                {{ row.stationId }}
+                <hr>
+                {{ row.stationName }}
+              </div>
+            </template>
+            <template v-else-if="field.prop==='pictures'">
+              <ext-image :srcList="row[field.prop]"></ext-image>
+            </template>
+            <template v-else-if="field.prop==='createTime'">
+              {{ u.fmt.fmtDateTime(row[field.prop]) }}
+            </template>
+            <template v-else-if="field.prop==='updateTime'">
+              {{ u.fmt.fmtDateTime(row[field.prop]) }}
+            </template>
+            <template v-else-if="field.prop==='action'">
+              <el-button  v-auth="'washStation.modify'" size="small" plain type="warning" @click="handleRowClick('edit',row)">编辑</el-button>
+              <el-button  v-auth="'washStation.modify'" size="small" plain type="danger" @click="handleRowDelete(row)">删除</el-button>
+            </template>
+            <template v-else>
+              <div>{{ row[field.prop] }}</div>
+            </template>
+
+          </template>
+        </el-table-column>
+      </el-table>
+
 
       <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
     </el-card>
@@ -57,8 +111,8 @@
 </template>
 
 <script setup lang="ts" name="WashStationList">
-import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance,nextTick,onBeforeUnmount} from 'vue';
-import {$body,$get} from "/@/utils/request";
+import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
+import {$body, $get} from "/@/utils/request";
 import u from '/@/utils/u'
 import {Msg} from "/@/utils/message";
 import {Session} from "/@/utils/storage";
@@ -72,6 +126,8 @@ import ExtTable from "/@/components/form/ExtTable.vue";
 import mittBus from '/@/utils/mitt';
 
 import {ElButton} from 'element-plus'
+import ExtDLabel from "/@/components/form/ExtDLabel.vue";
+import ExtImage from "/@/components/form/ExtImage.vue";
 
 
 const WashStationDialog = defineAsyncComponent(() => import("/@/views/admin/station/list/dialog.vue"));
@@ -81,6 +137,7 @@ const queryRef = ref();
 const washStationDialogRef = ref();
 
 //定义变量
+
 const state = reactive({
   formQuery: {},
   pageQuery: {
@@ -89,55 +146,26 @@ const state = reactive({
     total: 0
   },
   tableData: {
-    height:500,
-    data: [] as Array < any >,
+    height: 500,
+    data: [] as Array<any>,
     loading: false
   },
   importConfig: {},
   exportConfig: {},
   columns: [
-    {type: 'selection', width: 60, align: 'center', fixed: 'left'},
+    // {type: 'selection', width: 60, align: 'center', fixed: 'left'},
+    {label: '站点名称', prop: 'stationName', query: true, type: 'text', resizable: true},
+    {label: '站点照片', prop: 'pictures', query: false, type: 'text', resizable: true},
+    {label: '站点状态', prop: 'stationStatus', query: true, type: 'dict', conf:{dict:'WashStation.status'},resizable: true},
+    {label: '站点类型', prop: 'stationType', query: true, type: 'text', resizable: true},
     {label: '地址', prop: 'address', query: true, type: 'text', resizable: true},
-    {label: '营业时间描述', prop: 'businessHours', query: true, type: 'text', resizable: true},
-    {label: '', prop: 'createTime', query: true, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
-    {label: '站点坐标', prop: 'location', query: true, type: '', resizable: true},
-    {label: '停车费描述:eg:洗车费用满10元减免1小时停车费', prop: 'parkingFee', query: true, type: 'text', resizable: true},
-    {label: '工位数量', prop: 'parkingNum', query: true, type: '', resizable: true},
-    {label: '站点照片', prop: 'pictures', query: true, type: 'text', resizable: true},
-    {label: '备注', prop: 'remark', query: true, type: 'text', resizable: true},
     {label: '服务电话', prop: 'serviceTel', query: true, type: 'text', resizable: true},
-    {label: '站点引导', prop: 'siteGuide', query: true, type: 'text', resizable: true},
-    {label: '站点id', prop: 'stationId', query: true, type: 'text', resizable: true},
-    {label: '站点名称', prop: 'stationName', query: true, type: 'text', resizable: true},
-    {label: '站点状态:Unknown:未知,Normal:正常运营,Offline:关闭下线,Repair:维护中', prop: 'stationStatus', query: true, type: 'text', resizable: true},
-    {label: '站点电话', prop: 'stationTel', query: true, type: 'text', resizable: true},
-    {label: '站点类型:Public:公共站 2:Private:内部站(不对外开放)', prop: 'stationType', query: true, type: 'text', resizable: true},
-    {label: '', prop: 'updateTime', query: true, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
-    {                label: '操作', prop: 'action', type: 'render', width: 180, align: 'center', fixed: 'right',
-      render: (h: any, row: any) => {
-        return (
-            h('div', null, [
-              proxy.$auth('washStation.modify') ?
-                  h(ElButton, {
-                    type: 'warning',
-                    text: true,
-                    size: 'small',
-                    onClick: () => {
-                      handleRowClick('edit', row)
-                    }
-                  }, () => '编辑') : '',
-              proxy.$auth('washStation.remove') ?
-                  h(ElButton, {
-                    type: 'danger',
-                    text: true,
-                    size: 'small',
-                    onClick: () => {
-                      handleRowDelete(row)
-                    }
-                  }, () => '删除') : '',
-            ])
-        )
-      }
+    {label: '营业时间描述', prop: 'businessHours', query: false, type: 'text', resizable: true},
+    {label: '工位数量', prop: 'parkingNum', query: false, type: '', resizable: true},
+    {label: '创建时间 ', prop: 'createTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
+    {label: '更新时间', prop: 'updateTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
+    {
+      label: '操作', prop: 'action', type: 'render', width: 180, align: 'center', fixed: 'right',
     }
   ],
 })
@@ -156,7 +184,7 @@ const state = reactive({
 onMounted(() => {
   loadData();
 
-  nextTick(()=>{
+  nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
     state.tableData.height = bodyHeight - queryHeight - 220

+ 0 - 37
car-wash-admin/src/main/java/com/kym/admin/config/WxKanbanConfig.java

@@ -1,37 +0,0 @@
-package com.kym.admin.config;
-
-import cn.binarywang.wx.miniapp.api.WxMaService;
-import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
-import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-
-/**
- * 微信运营看板小程序配置
- */
-@Configuration
-public class WxKanbanConfig {
-
-    @Value("${wechat.kanban.appid}")
-    private String appid;
-
-
-    @Value("${wechat.kanban.secret}")
-    private String secret;
-
-    @Value("${wechat.kanban.token}")
-    private String token;
-
-    @Bean("kanbanWxMaService")
-    public WxMaService kanbanWxMaService() {
-        WxMaServiceImpl impl = new WxMaServiceImpl();
-        WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
-        config.setAppid(appid);
-        config.setSecret(secret);
-        config.setToken(token);
-        impl.setWxMaConfig(config);
-        return impl;
-    }
-}

+ 81 - 0
car-wash-admin/src/main/java/com/kym/admin/controller/WashDeviceController.java

@@ -0,0 +1,81 @@
+package com.kym.admin.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.kym.common.R;
+import com.kym.common.annotation.SysLog;
+import com.kym.entity.miniapp.WashDevice;
+import com.kym.entity.miniapp.WashStation;
+import com.kym.entity.miniapp.queryParams.DeviceQueryParams;
+import com.kym.entity.miniapp.queryParams.StationQueryParams;
+import com.kym.service.miniapp.WashDeviceService;
+import com.kym.service.miniapp.WashStationService;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 网点设备
+ * </p>
+ *
+ * @author skyline
+ * @since 2023-08-12
+ */
+@RestController
+@RequestMapping("/washDevice")
+public class WashDeviceController {
+
+    private final WashDeviceService washDeviceService;
+
+
+    public WashDeviceController(WashDeviceService washDeviceService) {
+        this.washDeviceService = washDeviceService;
+    }
+
+
+    @SaCheckPermission("washDevice.list")
+    @SysLog("站点列表")
+    @PostMapping("list")
+    R<?> listStation(@RequestBody DeviceQueryParams params) {
+        return R.success(washDeviceService.list(params));
+    }
+
+    @SaCheckPermission("washDevice.list")
+    @SysLog("详情")
+    @GetMapping("detail/{id}")
+    R<?> detail(@PathVariable long id) {
+        return R.success(washDeviceService.detail(id));
+    }
+
+    @SaCheckPermission("washDevice.remove")
+    @SysLog("删除")
+    @GetMapping("remove/{id}")
+    R<?> remove(@PathVariable long id) {
+        washDeviceService.remove(id);
+        return R.success();
+    }
+
+    @SaCheckPermission("washDevice.modify")
+    @SysLog("修改")
+    @PostMapping("modify")
+    R<?> modify(@RequestBody WashDevice station) {
+        washDeviceService.modify(station);
+        return R.success();
+    }
+
+    @SaCheckPermission("washDevice.add")
+    @SysLog("新建")
+    @PostMapping("add")
+    R<?> add(@RequestBody WashDevice station) {
+        washDeviceService.add(station);
+        return R.success();
+    }
+
+
+}

+ 5 - 5
car-wash-admin/src/main/java/com/kym/admin/controller/WashStationController.java

@@ -38,21 +38,21 @@ public class WashStationController {
         return R.success();
     }
 
-    @SaCheckPermission("WashStation.list")
+    @SaCheckPermission("washStation.list")
     @SysLog("站点列表")
     @PostMapping("list")
     R<?> listStation(@RequestBody StationQueryParams params) {
         return R.success(washStationService.list(params));
     }
 
-    @SaCheckPermission("WashStation.list")
+    @SaCheckPermission("washStation.list")
     @SysLog("详情")
     @GetMapping("detail/{id}")
     R<?> detail(@PathVariable long id) {
         return R.success(washStationService.detail(id));
     }
 
-    @SaCheckPermission("WashStation.remove")
+    @SaCheckPermission("washStation.remove")
     @SysLog("删除")
     @GetMapping("remove/{id}")
     R<?> remove(@PathVariable long id) {
@@ -60,7 +60,7 @@ public class WashStationController {
         return R.success();
     }
 
-    @SaCheckPermission("WashStation.modify")
+    @SaCheckPermission("washStation.modify")
     @SysLog("修改")
     @PostMapping("modify")
     R<?> modify(@RequestBody WashStation station) {
@@ -68,7 +68,7 @@ public class WashStationController {
         return R.success();
     }
 
-    @SaCheckPermission("WashStation.add")
+    @SaCheckPermission("washStation.add")
     @SysLog("新建")
     @PostMapping("add")
     R<?> add(@RequestBody WashStation station) {

+ 0 - 69
car-wash-admin/src/main/java/com/kym/admin/controller/WxKanbanController.java

@@ -1,69 +0,0 @@
-package com.kym.admin.controller;
-
-import cn.binarywang.wx.miniapp.api.WxMaService;
-import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
-import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
-import com.kym.common.R;
-import com.kym.common.controller.IController;
-import com.kym.entity.admin.AdminUser;
-import com.kym.service.admin.AdminUserService;
-import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.common.error.WxErrorException;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-
-/**
- * 微信看板小程序
- * 登录控制器
- */
-@Slf4j
-@RestController
-@RequestMapping("/wx")
-public class WxKanbanController extends IController {
-
-    private final WxMaService wxMaService;
-
-    private final AdminUserService adminUserService;
-
-
-    public WxKanbanController(@Qualifier("kanbanWxMaService") WxMaService wxMaService, AdminUserService adminUserService) {
-        this.wxMaService = wxMaService;
-        this.adminUserService = adminUserService;
-    }
-
-    @RequestMapping("getUnionId")
-    public R<?> getUnionId(String code) throws WxErrorException {
-        WxMaJscode2SessionResult result = wxMaService.jsCode2SessionInfo(code);
-        return R.success(result);
-    }
-
-    /**
-     * 获取微信手机号
-     * @param code
-     * @return
-     * @throws WxErrorException
-     */
-    @RequestMapping("getPhoneNumber")
-    public R<?> getPhoneNumber(String code) throws WxErrorException {
-        WxMaPhoneNumberInfo result = wxMaService.getUserService().getPhoneNoInfo(code);
-        return R.success(result);
-    }
-
-
-    @PostMapping("login")
-    public R<?> login(@RequestBody AdminUser  user) {
-        return resp(()->adminUserService.wxLogin(user));
-    }
-
-    @PostMapping("loginByOpenId")
-    public R<?> loginByUnion(@RequestBody AdminUser  user) {
-        return resp(()->adminUserService.loginByOpenId(user));
-    }
-
-
-
-}

+ 12 - 0
car-wash-service/src/main/java/com/kym/service/miniapp/WashDeviceService.java

@@ -25,4 +25,16 @@ public interface WashDeviceService extends MyBaseService<WashDevice> {
     void stopDevice(String shortId);
 
     List<WashDeviceVo> listWashDevice(DeviceQueryParams params);
+
+    //region 管理后台
+    Object detail(long id);
+
+    void remove(long id);
+
+    void modify(WashDevice device);
+
+    void add(WashDevice device);
+
+    Object list(DeviceQueryParams query);
+    //endregion
 }

+ 56 - 1
car-wash-service/src/main/java/com/kym/service/miniapp/impl/WashDeviceServiceImpl.java

@@ -1,12 +1,15 @@
 package com.kym.service.miniapp.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.pagehelper.PageHelper;
 import com.github.yulichang.toolkit.JoinWrappers;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.kym.common.utils.CommUtil;
+import com.kym.entity.common.PageBean;
 import com.kym.entity.miniapp.OrderRechargeRights;
 import com.kym.entity.miniapp.UserRechargeRights;
 import com.kym.entity.miniapp.WashDevice;
+import com.kym.entity.miniapp.WashStation;
 import com.kym.entity.miniapp.queryParams.DeviceQueryParams;
 import com.kym.entity.miniapp.vo.UserOrderRechargeRightsVo;
 import com.kym.entity.miniapp.vo.WashDeviceVo;
@@ -39,6 +42,8 @@ public class WashDeviceServiceImpl extends MyBaseServiceImpl<WashDeviceMapper, W
     }
 
 
+    //region 小程序
+
     /**
      * 获取设备列表
      *
@@ -62,6 +67,7 @@ public class WashDeviceServiceImpl extends MyBaseServiceImpl<WashDeviceMapper, W
         return voList;
     }
 
+
     /**
      * 根据设备短id获取设备信息
      *
@@ -71,7 +77,7 @@ public class WashDeviceServiceImpl extends MyBaseServiceImpl<WashDeviceMapper, W
     @Override
     public WashDeviceVo getDevice(String shortId) {
         var productKeyAndDeviceName = KymCache.INSTANCE.getProductKeyAndDeviceNameByWashShortId(shortId);
-        var washDevice =  lambdaQuery()
+        var washDevice = lambdaQuery()
                 .eq(WashDevice::getProductKey, productKeyAndDeviceName[0])
                 .eq(WashDevice::getDeviceName, productKeyAndDeviceName[1])
                 .one();
@@ -93,4 +99,53 @@ public class WashDeviceServiceImpl extends MyBaseServiceImpl<WashDeviceMapper, W
         washOrderService.closeOrder(new DeviceQueryParams(shortId, productKeyAndDeviceName[0], productKeyAndDeviceName[1]));
     }
 
+    //endregion
+
+    //region 管理后台
+    @Override
+    public Object detail(long id) {
+        return getById(id);
+    }
+
+    @Override
+    public void remove(long id) {
+
+    }
+
+    @Override
+    public void modify(WashDevice device) {
+        CommUtil.assertsNonNulls(List.of(device.getDeviceName(), device.getStationId(), device.getProductKey(), device.getId()), "参数异常");
+        List<WashDevice> list = lambdaQuery()
+                .eq(WashDevice::getStationId, device.getStationId())
+                .eq(WashDevice::getProductKey, device.getProductKey()).list();
+        CommUtil.asserts(list.size() <= 1, "设备信息异常");
+        if (list.size() == 1) {
+            CommUtil.asserts(list.get(0).getDeviceName().equalsIgnoreCase(device.getDeviceName()), "站点已存在");
+        }
+        updateById(device);
+    }
+
+    @Override
+    public void add(WashDevice device) {
+        CommUtil.assertsNonNulls(List.of(device.getDeviceName(), device.getStationId(), device.getProductKey()), "参数异常");
+        Long count = lambdaQuery()
+                .eq(WashDevice::getStationId, device.getStationId())
+                .eq(WashDevice::getProductKey, device.getProductKey()).count();
+        CommUtil.asserts(count == 0, "设备已存在");
+        save(device);
+
+    }
+
+    @Override
+    public Object list(DeviceQueryParams query) {
+        PageHelper.startPage(query.getPageNum(), query.getPageSize());
+        List<WashDevice> list = lambdaQuery()
+                .like(CommUtil.isNotEmptyAndNull(query.getDeviceName()), WashDevice::getDeviceName, query.getDeviceName())
+                .eq(CommUtil.isNotEmptyAndNull(query.getStationId()), WashDevice::getStationId, query.getStationId())
+                .list();
+        return new PageBean<>(list);
+    }
+
+    //endregion
+
 }