Переглянути джерело

写入rfid页面。equipmentREQUTST能删除的都删除了。增加登录的stationip。优化部分代码和页面。

jiaxiaoqiang 9 місяців тому
батько
коміт
faa958b8bb

+ 48 - 26
entry/src/main/ets/common/component/TitleStateComp.ets

@@ -8,6 +8,10 @@ import { RfidAllocation } from '../../pages/RfidAllocation'
 import NoticeInfo from '../../model/NoticeInfo'
 import UserInfo from '../../model/UserInfo'
 import UserAuthModel from '../../model/database/UserAuthModel'
+import appRecovery from '@ohos.app.ability.appRecovery';
+import AbilityStage from '@ohos.app.ability.AbilityStage';
+import wantAgent from '@ohos.app.ability.wantAgent'
+import Want from '@ohos.app.ability.Want'
 
 /*
  * 顶部状态栏
@@ -242,7 +246,7 @@ struct login {
           .backgroundColor('#0A59F7')
           .textAlign(TextAlign.Center)
           .fontColor('#ffff')
-          .onClick(async  () => {
+          .onClick(async () => {
             this.goOut()
 
 
@@ -258,8 +262,7 @@ struct login {
     .backgroundColor('#ffff')
   }
 
-
-  goOut = async  () => {
+  goOut = async () => {
     this.controller.close()
 
     let userInfo = await UserAuthModel.getLast()
@@ -272,7 +275,6 @@ struct login {
       url: 'pages/LoginPage'
     })
   }
-
 }
 
 //头像点击弹窗
@@ -310,19 +312,19 @@ struct AvatarClick {
 
   build() {
     Column() {
-      Text('个人设置')
-        .height('33%')
-        .fontSize(px2vp(32))
-        .fontWeight(FontWeight.Medium)
-        .fontColor('#e6000000')
-        .onClick(() => {
-          router.pushUrl({
-            url: 'pages/SetPage'
-          })
-        })
-      Divider()
+      // Text('个人设置')
+      //   .height('33%')
+      //   .fontSize(px2vp(32))
+      //   .fontWeight(FontWeight.Medium)
+      //   .fontColor('#e6000000')
+      //   .onClick(() => {
+      //     router.pushUrl({
+      //       url: 'pages/SetPage'
+      //     })
+      //   })
+      // Divider()
       Text('退出登录')
-        .height('33%')
+        .height('50%')
         .fontSize(px2vp(32))
         .fontWeight(FontWeight.Medium)
         .fontColor('#e6000000')
@@ -331,21 +333,23 @@ struct AvatarClick {
           this.controller.close()
         })
       Divider()
-      Text('开关/重启')
-        .height('33%')
+      Text('退出程序')
+        .height('50%')
         .fontSize(px2vp(32))
         .fontWeight(FontWeight.Medium)
         .fontColor('#e6000000')
         .onClick(() => {
-          this.controller.close()
-          this.shutdownTransparency = 1
-          this.shutdownDialogController.open()
+          // this.controller.close()
+          // this.shutdownTransparency = 1
+          // this.shutdownDialogController.open()
           this.avatarFrame = !this.avatarFrame
+          let pro = new process.ProcessManager();
+          pro.exit(0)
         })
 
     }
     .width('15%')
-    .height('25%')
+    .height('16%')
     .backgroundColor('#ffff')
     .margin({ top: '4%', right: '1%' })
     .borderRadius(21)
@@ -368,6 +372,22 @@ struct shutdown {
           .height(px2vp(107))
           .onClick(() => {
             this.shutdownTransparency = 0
+
+            appRecovery.enableAppRecovery(
+              appRecovery.RestartFlag.ALWAYS_RESTART,
+              appRecovery.SaveOccasionFlag.SAVE_WHEN_ERROR,
+              appRecovery.SaveModeFlag.SAVE_WITH_FILE
+            );
+
+            let want: Want = {
+              bundleName: 'com.example.wonderfuldemo',
+              abilityName: 'EntryAbility'
+            }
+            appRecovery.setRestartWant(want)
+
+            appRecovery.restartApp()
+
+
             this.controller.close()
           })
         Blank()
@@ -376,9 +396,8 @@ struct shutdown {
           .height(px2vp(107))
           .onClick(() => {
             let pro = new process.ProcessManager();
-            pro.exit(0);
-            this.shutdownTransparency = 0
-
+            let pres = process.pid;
+            let result = pro.kill(28, pres);
 
           })
 
@@ -394,7 +413,7 @@ struct shutdown {
           .textAlign(TextAlign.Center)
           .fontColor('#FFFFFF')
         Blank()
-        Text('关机')
+        Text('退出')
           .fontWeight(FontWeight.Medium)
           .fontSize(px2vp(27))
           .width(px2vp(107))
@@ -418,6 +437,9 @@ struct shutdown {
     .backgroundColor('#cc000000')
     .justifyContent(FlexAlign.Center)
     .alignItems(HorizontalAlign.Center)
+    .onClick(() => {
+      this.controller.close()
+    })
 
   }
 }

+ 138 - 39
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -9,57 +9,107 @@ import HashMap from '@ohos.util.HashMap'
 import DictValue from '../../model/DictValue'
 
 export default class CommonConstants {
-  static readonly RDB_NAME : string = 'Presentation.db'
-  static readonly PRE_NAME : string = 'MyPreferences'
-  static AUTH_TOKEN : string = ''
+  static readonly RDB_NAME: string = 'Presentation.db'
+  static readonly PRE_NAME: string = 'MyPreferences'
+  static AUTH_TOKEN: string = ''
   // 附件地址前缀
-  static FILE_URL_PREFIX : string = 'http://192.168.101.4:9000'
-
+  static FILE_URL_PREFIX: string = 'http://192.168.101.4:9000'
   static DICT_DATA: HashMap<string, DictValue[]> = new HashMap<string, DictValue[]>()
-
   // 当前登录用户相关信息
-  static USER_ID? : number = 1
+  static USER_ID?: number = 1
   static USER_NAME: string = ''
   static USER_AVATAR: string = ''
   static STATION_NANE: string = ''
   static STATION_ID: number
   static STATION_CODE: string = ''
-  static stationDictValue: string=''
+  static STATION_IP: string = ''
+  static stationDictValue: string = ''
   // 是否是退出登陆
   static LOGIN_OUT: boolean = false
-
-  static readonly STORAGE_TYPE: string[] =  ['电子元器件', '电路板', '结构件', '辅助材料']
-  static readonly PARK_TYPE: string[] =  ['出入库位置', '充电位置', '工作台', '其他']
-
+  static readonly STORAGE_TYPE: string[] = ['电子元器件', '电路板', '结构件', '辅助材料']
+  static readonly PARK_TYPE: string[] = ['出入库位置', '充电位置', '工作台', '其他']
   static readonly ROBOTS: RobotInfo[] = [
-    {id:1, robotCode:'JGRR1135554213', storageId:1, robotType:2, robotToward: 2, x:3, y:2, lastSelfCheck: '2024/02/16 11:11:34'}as RobotInfo,
-    {id:2, robotCode:'JGRR1123554233', storageId:1, robotType:2, robotToward: 1, x:1, y:2, lastSelfCheck: '2024/02/16 10:56:34'}as RobotInfo,
-    {id:3, robotCode:'JGRR1147006978', storageId:1, robotType:2, robotToward: 3, x:6, y:2, lastSelfCheck: '2024/02/16 14:23:34'}as RobotInfo,
+    {
+      id: 1,
+      robotCode: 'JGRR1135554213',
+      storageId: 1,
+      robotType: 2,
+      robotToward: 2,
+      x: 3,
+      y: 2,
+      lastSelfCheck: '2024/02/16 11:11:34'
+    } as RobotInfo,
+    {
+      id: 2,
+      robotCode: 'JGRR1123554233',
+      storageId: 1,
+      robotType: 2,
+      robotToward: 1,
+      x: 1,
+      y: 2,
+      lastSelfCheck: '2024/02/16 10:56:34'
+    } as RobotInfo,
+    {
+      id: 3,
+      robotCode: 'JGRR1147006978',
+      storageId: 1,
+      robotType: 2,
+      robotToward: 3,
+      x: 6,
+      y: 2,
+      lastSelfCheck: '2024/02/16 14:23:34'
+    } as RobotInfo,
   ]
-
   // 工步展示图
   static readonly STEP_IMAGES: Resource[] = [
     $r('app.media.material_collect_black'), $r('app.media.record_item_black'), $r('app.media.multimedia_collect_black'),
     $r('app.media.esop_black'), $r('app.media.spot_check_black'), $r('app.media.equip_record_black'),
     $r('app.media.fixture_black'), $r('app.media.debug_pair_black'), $r('app.media.nameplate_bind_black'),
   ]
-
   // 工步选中展示图
   static readonly STEP_SELECT_IMAGES: Resource[] = [
     $r('app.media.material_collect_white'), $r('app.media.record_item_white'), $r('app.media.multimedia_collect_white'),
     $r('app.media.esop_white'), $r('app.media.spot_check_white'), $r('app.media.equip_record_white'),
     $r('app.media.fixture_white'), $r('app.media.debug_pair_white'), $r('app.media.nameplate_bind_white'),
   ]
-
   // 物料列表
   static readonly MATERIAL_ARRAY: MaterialInfo[] = [
-    {id:1, materialNo:'111', materialName: 'PACA-ASSSD电路板', needNum: 5, storeNum: 100},
-    {id:2, batchCode:'222', materialName: '小号螺丝', needNum: 100, storeNum: 100},
-    {id:3, materialNo:'333', materialName: '中号螺丝', needNum: 5, storeNum: 100},
-    {id:4, batchCode:'444', materialName: '中号螺帽', needNum: 5, storeNum: 100},
-    {id:5, batchCode:'555', materialName: '大号螺帽', needNum: 5, storeNum: 100},
+    {
+      id: 1,
+      materialNo: '111',
+      materialName: 'PACA-ASSSD电路板',
+      needNum: 5,
+      storeNum: 100
+    },
+    {
+      id: 2,
+      batchCode: '222',
+      materialName: '小号螺丝',
+      needNum: 100,
+      storeNum: 100
+    },
+    {
+      id: 3,
+      materialNo: '333',
+      materialName: '中号螺丝',
+      needNum: 5,
+      storeNum: 100
+    },
+    {
+      id: 4,
+      batchCode: '444',
+      materialName: '中号螺帽',
+      needNum: 5,
+      storeNum: 100
+    },
+    {
+      id: 5,
+      batchCode: '555',
+      materialName: '大号螺帽',
+      needNum: 5,
+      storeNum: 100
+    },
   ]
-
   // 辅料类型
   static readonly AUX_MATERIAL_TYPES: string[] = [
     '粘胶', '药剂', '酒精', '隔热垫板', '防尘罩'
@@ -72,29 +122,78 @@ export default class CommonConstants {
     ['石棉隔热垫板', '蜂窝隔热垫板'],
     ['塑料防尘罩', '金属防尘罩'],
   ]
-
   // 加工工艺数据
   static readonly HANDLE_DATA: Array<ProcessHandleData> = [
-    {step: 1, moment: 1.1121, momentUnit: 'N.m', rotate: 3610, rotateUnit: '°', handleState: 1},
-    {step: 2, moment: 1.4547, momentUnit: 'N.m', rotate: 6194.4, rotateUnit: '°', handleState: 2},
-    {step: 3, moment: 1.2356, momentUnit: 'N.m', rotate: 2800, rotateUnit: '°', handleState: 2}
+    {
+      step: 1,
+      moment: 1.1121,
+      momentUnit: 'N.m',
+      rotate: 3610,
+      rotateUnit: '°',
+      handleState: 1
+    },
+    {
+      step: 2,
+      moment: 1.4547,
+      momentUnit: 'N.m',
+      rotate: 6194.4,
+      rotateUnit: '°',
+      handleState: 2
+    },
+    {
+      step: 3,
+      moment: 1.2356,
+      momentUnit: 'N.m',
+      rotate: 2800,
+      rotateUnit: '°',
+      handleState: 2
+    }
   ];
-
   // 标准施工工艺告警数据
   static readonly ALARM_DATA: Array<ProcessAlarmData> = [
-    {alarmType: 1, alarmTypeCode: 'NG', alarmStr: '圈数过多'},
-    {alarmType: 2, alarmTypeCode: 'NG', alarmStr: '圈数不足'},
-    {alarmType: 3, alarmTypeCode: 'NM', alarmStr: '力矩过大'},
-    {alarmType: 4, alarmTypeCode: 'NM', alarmStr: '力矩不足'},
+    {
+      alarmType: 1, alarmTypeCode: 'NG', alarmStr: '圈数过多'
+    },
+    {
+      alarmType: 2, alarmTypeCode: 'NG', alarmStr: '圈数不足'
+    },
+    {
+      alarmType: 3, alarmTypeCode: 'NM', alarmStr: '力矩过大'
+    },
+    {
+      alarmType: 4, alarmTypeCode: 'NM', alarmStr: '力矩不足'
+    },
   ];
-
   // 标准施工工艺数据
   static readonly STANDARD_DATA: Array<ProcessStandardData> = [
-    {step: 1, momentMin: 1.1, momentMax: 1.2, momentUnit: 'N.m', rotateMin: 3600, rotateMax: 3650, rotateUnit: '°'},
-    {step: 2, momentMin: 1.4, momentMax: 1.5, momentUnit: 'N.m', rotateMin: 4500, rotateMax: 5500, rotateUnit: '°'},
-    {step: 3, momentMin: 1.2, momentMax: 1.3, momentUnit: 'N.m', rotateMin: 2600, rotateMax: 3500, rotateUnit: '°'},
+    {
+      step: 1,
+      momentMin: 1.1,
+      momentMax: 1.2,
+      momentUnit: 'N.m',
+      rotateMin: 3600,
+      rotateMax: 3650,
+      rotateUnit: '°'
+    },
+    {
+      step: 2,
+      momentMin: 1.4,
+      momentMax: 1.5,
+      momentUnit: 'N.m',
+      rotateMin: 4500,
+      rotateMax: 5500,
+      rotateUnit: '°'
+    },
+    {
+      step: 3,
+      momentMin: 1.2,
+      momentMax: 1.3,
+      momentUnit: 'N.m',
+      rotateMin: 2600,
+      rotateMax: 3500,
+      rotateUnit: '°'
+    },
   ];
-
   //万能卡片
-  static readonly CARD_TYPE_DATA: number[] = [3,1,5];
+  static readonly CARD_TYPE_DATA: number[] = [3, 1, 5];
 }

+ 2 - 1
entry/src/main/ets/common/util/request/EquipmentRequest.ets

@@ -12,7 +12,7 @@ import { printError, printRequest, printResponse, handleRes } from './Helps';
 
 //const baseUrl = "http://192.168.137.5:8000/"
 // const baseUrl = "http://0.0.0.0:8000/"
-const baseUrl = "http://10.88.20.120:8000/"
+const baseUrl = CommonConstants.STATION_IP + ':8000'
 const DEBUG = true //
 
 // 创建实例
@@ -26,6 +26,7 @@ const JGRequest = axios.create(
   }
 )
 
+
 // 添加请求拦截器
 JGRequest.interceptors.request.use((config: InternalAxiosRequestConfig) => {
 

+ 3 - 3
entry/src/main/ets/common/util/request/helps.ets

@@ -2,8 +2,8 @@ import { InternalAxiosRequestConfig, AxiosResponse, AxiosError } from "@ohos/axi
 import promptAction from '@ohos.promptAction'
 
 // 是否在控制台打印某项log
-const pConfig = true
-const pHeaders = true
+const pConfig = false
+const pHeaders = false
 const pUrl = true
 const pParams = true
 const pBody = true
@@ -48,7 +48,7 @@ const printRequest = (config: InternalAxiosRequestConfig) => {
 
 const printResponse = (response: AxiosResponse) => {
   if (pResponse) {
-    console.debug('handleRes response: ', JSON.stringify(response))
+    console.debug('printResponse response: ', JSON.stringify(response))
   }
   if (pData) {
     console.debug("printResponse data", JSON.stringify(response.data))

+ 1 - 1
entry/src/main/ets/model/UserInfo.ets

@@ -18,6 +18,6 @@ export default class UserInfo {
   maintainLoginStatus?: number;
   // 更新时间戳
   updateTime?: number;
-
   stationCode?: string
+  stationIp?: string
 }

+ 2 - 0
entry/src/main/ets/pages/LoginPage.ets

@@ -114,6 +114,7 @@ struct LoginPage {
         CommonConstants.USER_AVATAR = user.avatar!
         CommonConstants.LOGIN_OUT = false
         CommonConstants.STATION_CODE = user.stationCode!
+        CommonConstants.STATION_IP = user.stationIp!
       }
       if (CommonConstants.AUTH_TOKEN && CommonConstants.AUTH_TOKEN.length > 0) {
         if (CommonConstants.stationDictValue === '5') {
@@ -394,6 +395,7 @@ struct LoginPage {
             CommonConstants.USER_NAME = userInfo.userName!
             CommonConstants.USER_AVATAR = userInfo.avatar!
             CommonConstants.STATION_CODE = userInfo.stationCode!
+            CommonConstants.STATION_IP = userInfo.stationIp!
             CommonConstants.STATION_NANE = this.workstation && this.workstation.name ? this.workstation.name : ''
             CommonConstants.STATION_ID = this.workstation && this.workstation.id ? Number.parseInt(this.workstation.id) : 0
             let user = await UserAuthModel.getByUserId(userInfo.id ? userInfo.id : 0)

+ 10 - 8
entry/src/main/ets/pages/OutboundStation.ets

@@ -18,6 +18,8 @@ struct OutboundStation {
   //仓储和其他仓储点击按钮变色
   @State warehouseButton: number = 0
   @State isHomePage: boolean = false
+  fourWidth: number = 280
+  twoWidth: number = 150
 
   build() {
     Column() {
@@ -28,7 +30,7 @@ struct OutboundStation {
             Text('智能仓储')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
-              .width(px2vp(292))
+              .width(px2vp(this.fourWidth))
               .height(px2vp(80))
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
@@ -37,7 +39,7 @@ struct OutboundStation {
               .onClick(() => {
                 this.warehouseButton = 0
               })
-            Blank()
+            // Blank()
             // Text('xxxxxxx')
             //   .textAlign(TextAlign.Center)
             //   .borderRadius(px2vp(16))
@@ -51,7 +53,7 @@ struct OutboundStation {
             //     this.warehouseButton=1
             //   })
           }
-          .width(px2vp(608))
+          .width(px2vp(this.fourWidth))
           .borderRadius(px2vp(16))
           .height(px2vp(80))
           .backgroundColor($r('app.color.black_10'))
@@ -60,7 +62,7 @@ struct OutboundStation {
             Text('齐套')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
-              .width(px2vp(292))
+              .width(px2vp(this.twoWidth))
               .height(px2vp(80))
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
@@ -72,7 +74,7 @@ struct OutboundStation {
             Text('手动出库')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
-              .width(px2vp(292))
+              .width(px2vp(this.fourWidth))
               .height(px2vp(80))
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
@@ -98,7 +100,7 @@ struct OutboundStation {
             Text('调仓')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
-              .width(px2vp(124))
+              .width(px2vp(this.twoWidth))
               .height(px2vp(80))
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
@@ -110,7 +112,7 @@ struct OutboundStation {
             Text('统计')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
-              .width(px2vp(146))
+              .width(px2vp(this.twoWidth))
               .height(px2vp(80))
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
@@ -120,7 +122,7 @@ struct OutboundStation {
                 this.inboundButton = 3
               })
 
-          }.width(px2vp(1240 - 292))
+          }.width(px2vp(this.fourWidth + this.twoWidth * 3 + 24 * 3))
           .borderRadius(px2vp(16))
           .height(px2vp(80))
           .backgroundColor($r('app.color.black_10'))

+ 19 - 37
entry/src/main/ets/pages/RfidAllocation.ets

@@ -57,21 +57,22 @@ export struct RfidAllocation {
   @State prefix: string = "XF-"
   @State suffix: string = ""
   //获取rfid
+  rfidTimer: number = -1
+  @State preRfid: string = "" //记录上一次的rfid,如果变化了 就清空回库下面的列表
   @State private recentlyRecordObject: StationInfoModel = {}
-  RfidHttp = async (): Promise<RfidClass> => {
-    //todo SGHRI3LR48500设备编号,从后端数据获取,暂时写死
-    let res: RfidClass = await EquipmentRequest.get("/api/v1/device/data/recentlyRecord/SGHRI3LR48500", {})
+  rfidInfoIntervalFun = async () => {
+    let res: StationInfoModel = await StorageRequest.post("api/v1/wms/common/queryStationInfo", {
+      stanCode: CommonConstants.STATION_CODE
+    } as RequestParamModel)
+    this.recentlyRecordObject = res
 
-    // let result: StationInfoModel = await StorageRequest.post("api/v1/wms/common/queryStationInfo", {
-    //   stanCode: CommonConstants.STATION_CODE
-    // } as RequestParamModel)
-    // this.recentlyRecordObject = result
 
-    this.httpRfid = res
-    this.RfidOnlineStatus = 1
-    console.log('textTag', 'rfid请求结果' + JSON.stringify(res)
-    );
-    return res
+    // 是否有料箱逻辑
+    this.RfidOnlineStatus = 0
+    if (this.recentlyRecordObject && this.recentlyRecordObject.rfid) {
+      this.RfidOnlineStatus = 1
+
+    }
   }
   //写入rfid
   InRfidHttp = async (): Promise<InRfidClass> => {
@@ -86,21 +87,15 @@ export struct RfidAllocation {
     );
     return res
   }
-  currentTimer: number = -1
 
   aboutToAppear(): void {
-    this.currentTimer = setInterval(async () => {
-      this.RfidHttp().then((res: RfidClass) => {
-
-        console.log('textTag', '-------rfid获取信息' + JSON.stringify(res))
-      })
-    }, 5000);
-
-
+    this.rfidTimer = setInterval(async () => {
+      this.rfidInfoIntervalFun()
+    }, 2000);
   }
 
   aboutToDisappear(): void {
-    clearInterval(this.currentTimer)
+    clearInterval(this.rfidTimer)
   }
 
   //后端料箱绑定
@@ -129,20 +124,7 @@ export struct RfidAllocation {
             .width(px2vp(56))
             .height(px2vp(56))
             .onClick(() => {
-              if (CommonConstants.stationDictValue === '5') {
-                router.pushUrl({
-                  url: 'pages/Warehousing'
-                })
-              } else if (CommonConstants.stationDictValue === '6') {
-                router.pushUrl({
-                  url: 'pages/OutboundStation',
-                })
-              }
-              else {
-                router.pushUrl({
-                  url: 'pages/process/ProcessHome',
-                })
-              }
+              router.back()
 
             })
 
@@ -478,7 +460,7 @@ export struct RfidAllocation {
                   .textAlign(TextAlign.End)
                   .width('40%')
                   .height('100%')
-                Text(this.httpRfid.data?.RFID!).width('40%')
+                Text(this.recentlyRecordObject?.rfid ?? "").width('40%')
                   .height('30%')
                   .borderRadius(px2vp(50))
                   .fontColor($r('app.color.blue_100'))

+ 108 - 103
entry/src/main/ets/pages/SmartFactory.ets

@@ -438,20 +438,21 @@ struct SmartFactory {
                   .height(px2vp(48))
                   .width(px2vp(48))
                   .onClick(async () => {
-                    let userInfo = await UserAuthModel.getLast()
-                    if (userInfo?.stationDictValue === '5') {
-                      router.pushUrl({
-                        url: 'pages/Warehousing'
-                      })
-                    } else if (userInfo?.stationDictValue === '6') {
-                      router.pushUrl({
-                        url: 'pages/OutboundStation'
-                      })
-                    } else {
-                      router.pushUrl({
-                        url: 'pages/process/ProcessHome'
-                      })
-                    }
+                    // let userInfo = await UserAuthModel.getLast()
+                    // if (userInfo?.stationDictValue === '5') {
+                    //   router.pushUrl({
+                    //     url: 'pages/Warehousing'
+                    //   })
+                    // } else if (userInfo?.stationDictValue === '6') {
+                    //   router.pushUrl({
+                    //     url: 'pages/OutboundStation'
+                    //   })
+                    // } else {
+                    //   router.pushUrl({
+                    //     url: 'pages/process/ProcessHome'
+                    //   })
+                    // }
+                    router.back()
                   })
               }.width('40%')
 
@@ -481,97 +482,101 @@ struct SmartFactory {
                   })
               }
 
-              Blank()
               Row() {
-                Row() {
-                  Image($r("app.media.gongda_white"))
-                    .height(px2vp(48))
-                    .width(px2vp(48))
-                    .onClick(() => {
-                      router.pushUrl({
-                        url: 'pages/SmartFactory'
-                      })
-                    })
-                }
-                .height('100%')
-                .width('7.2%')
-                .justifyContent(FlexAlign.Center)
-
-                Row() {
-                  Image($r('app.media.notice_white'))
-                    .height(px2vp(48))
-                    .width(px2vp(48))
-                }
-                .height('100%')
-                .width('7.2%')
-                .justifyContent(FlexAlign.Center)
-                .onClick(() => {
-                  router.pushUrl({
-                    url: "pages/OutboundStation"
-                  })
-                  this.noticeDialogController.open()
-                })
-
-                Row() {
-                  Image($r("app.media.box_edit_white"))
-                    .height(px2vp(48))
-                    .width(px2vp(48))
-                }
-                .height('100%')
-                .width('7.2%')
-                .justifyContent(FlexAlign.Center)
-                .onClick(() => {
-                  router.pushUrl({
-                    // url:'pages/Storage'
-                    // url:'pages/yyyyy'
-                    url: 'pages/RfidAllocation'
-                  })
-                })
-
-                Row({ space: 2 }) {
-                  Column() {
-                    Text(CommonConstants.USER_NAME)
-                      .fontSize($r('app.float.fontSize_20'))
-                      .fontColor($r('app.color.general_font_white_color'))
-                      .opacity($r('app.float.general_font_opacity'))
-                      .fontWeight(FontWeight.Medium)
-                      .width('95%')
-                      .maxLines(1)
-                    Progress({ value: this.completeNum!, total: this.planNum!, type: ProgressType.Linear })
-                      .width('95%')
-                      .backgroundColor($r('app.color.grey_100'))
-                      .style({ strokeWidth: 5 })
-                    Text('任务进度:' + ((this.completeNum!) / (this.planNum!)) * 100 + '%')
-                      .fontSize($r('app.float.fontSize_14'))
-                      .fontColor($r('app.color.general_font_white_color'))
-                      .opacity($r('app.float.card_font_default_opacity'))
-                      .fontWeight(FontWeight.Medium)
-                      .maxLines(1)
-                  }
-                  .justifyContent(FlexAlign.Center)
-                  .height(px2vp(105))
-                  .width('58%')
-
-                  Row() {
-                    Image(CommonConstants.USER_AVATAR && CommonConstants.USER_AVATAR.length > 0 ? CommonConstants.FILE_URL_PREFIX + CommonConstants.USER_AVATAR : $r('app.media.user_white'))
-                      .width(px2vp(48))
-                      .height(px2vp(48))
-
-                  }
-                  .layoutWeight(1)
-                }
-                .width('22%')
-                .height('90%')
-                .alignItems(VerticalAlign.Center)
-                .justifyContent(FlexAlign.SpaceEvenly)
-                .onClick(() => {
-                  this.AvatarController.open()
-                })
               }
-              .width('40%')
-              .height('90%')
-              .alignItems(VerticalAlign.Center)
-              .justifyContent(FlexAlign.End)
+
+              //
+              // Blank()
+              // Row() {
+              //   Row() {
+              //     Image($r("app.media.gongda_white"))
+              //       .height(px2vp(48))
+              //       .width(px2vp(48))
+              //       .onClick(() => {
+              //         router.pushUrl({
+              //           url: 'pages/SmartFactory'
+              //         })
+              //       })
+              //   }
+              //   .height('100%')
+              //   .width('7.2%')
+              //   .justifyContent(FlexAlign.Center)
+              //
+              //   Row() {
+              //     Image($r('app.media.notice_white'))
+              //       .height(px2vp(48))
+              //       .width(px2vp(48))
+              //   }
+              //   .height('100%')
+              //   .width('7.2%')
+              //   .justifyContent(FlexAlign.Center)
+              //   .onClick(() => {
+              //     router.pushUrl({
+              //       url: "pages/OutboundStation"
+              //     })
+              //     this.noticeDialogController.open()
+              //   })
+              //
+              //   Row() {
+              //     Image($r("app.media.box_edit_white"))
+              //       .height(px2vp(48))
+              //       .width(px2vp(48))
+              //   }
+              //   .height('100%')
+              //   .width('7.2%')
+              //   .justifyContent(FlexAlign.Center)
+              //   .onClick(() => {
+              //     router.pushUrl({
+              //       // url:'pages/Storage'
+              //       // url:'pages/yyyyy'
+              //       url: 'pages/RfidAllocation'
+              //     })
+              //   })
+              //
+              //   Row({ space: 2 }) {
+              //     Column() {
+              //       Text(CommonConstants.USER_NAME)
+              //         .fontSize($r('app.float.fontSize_20'))
+              //         .fontColor($r('app.color.general_font_white_color'))
+              //         .opacity($r('app.float.general_font_opacity'))
+              //         .fontWeight(FontWeight.Medium)
+              //         .width('95%')
+              //         .maxLines(1)
+              //       Progress({ value: this.completeNum!, total: this.planNum!, type: ProgressType.Linear })
+              //         .width('95%')
+              //         .backgroundColor($r('app.color.grey_100'))
+              //         .style({ strokeWidth: 5 })
+              //       Text('任务进度:' + ((this.completeNum!) / (this.planNum!)) * 100 + '%')
+              //         .fontSize($r('app.float.fontSize_14'))
+              //         .fontColor($r('app.color.general_font_white_color'))
+              //         .opacity($r('app.float.card_font_default_opacity'))
+              //         .fontWeight(FontWeight.Medium)
+              //         .maxLines(1)
+              //     }
+              //     .justifyContent(FlexAlign.Center)
+              //     .height(px2vp(105))
+              //     .width('58%')
+              //
+              //     Row() {
+              //       Image(CommonConstants.USER_AVATAR && CommonConstants.USER_AVATAR.length > 0 ? CommonConstants.FILE_URL_PREFIX + CommonConstants.USER_AVATAR : $r('app.media.user_white'))
+              //         .width(px2vp(48))
+              //         .height(px2vp(48))
+              //
+              //     }
+              //     .layoutWeight(1)
+              //   }
+              //   .width('22%')
+              //   .height('90%')
+              //   .alignItems(VerticalAlign.Center)
+              //   .justifyContent(FlexAlign.SpaceEvenly)
+              //   .onClick(() => {
+              //     this.AvatarController.open()
+              //   })
+              // }
+              // .width('40%')
+              // .height('90%')
+              // .alignItems(VerticalAlign.Center)
+              // .justifyContent(FlexAlign.End)
             }
             .width('100%')
             .height('100%')

+ 1 - 28
entry/src/main/ets/pages/WarehouseMap.ets

@@ -98,7 +98,7 @@ export struct WarehouseMap {
   @State storeyNumber: number = -1
   @State private storey: number[] = [6, 5, 4, 3, 2, 1]
   @State private YAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
-  @State private XAxis: number[] =  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
+  @State private XAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
   // @State private XAxis: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45]
   @State private XYxis: number[][] = [
     [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 6, 0, 6, 6],
@@ -126,33 +126,6 @@ export struct WarehouseMap {
     gridCount: 4,
     customStyle: true,
   })
-  //硬件调仓操作
-  AdjustmentHttp = async (): Promise<Adjustment[]> => {
-    let res: Adjustment[] = await EquipmentRequest.post("/api/v1/wcs/box/movMultiple",
-      //todo 坐标加1,二维数组索引从零开始
-      {
-        //目标位置
-        dest: (this.XCoordinateIn + 1) + '-' + (this.YCoordinateIn + 1),
-        //移动位置
-        src: (this.XCoordinate + 1) + '-' + (this.YCoordinate + 1),
-        //todo 数量暂时写死1
-        num: "1"
-      } as RequestParamModel)
-    //
-    console.log('textTag', 'post请求结果' + JSON.stringify(res)
-    );
-    return res
-  }
-  Adjustment = async (): Promise<Adjustment[]> => {
-    let res: Adjustment[] = await EquipmentRequest.get("/api/v1/wcs/rgvs/",
-      {
-        // destx:this.XCoordinateIn,
-        // destY:this.YCoordinateIn,
-        // rgvNo:'rgvNo1'
-      })
-
-    return res
-  }
   //请求车的位置
   CarPositionHttp = async (): Promise<carPositionClass> => {
     let res: carPositionClass = await EquipmentRequest.get("/api/v1/wcs/rgv/" + this.rgvNo, {}) as carPositionClass

+ 10 - 8
entry/src/main/ets/pages/Warehousing.ets

@@ -44,11 +44,11 @@ struct Warehousing {
     return res
   }
   //硬件stat1位置接口
-  locationRequest = async (): Promise<stat1> => {
-    let res: stat1 = await EquipmentRequest.get("api/v1/wcs/stat/stat1")
-    console.log('testTag1' + '-------------' + JSON.stringify(res))
-    return res
-  }
+  // locationRequest = async (): Promise<stat1> => {
+  //   let res: stat1 = await EquipmentRequest.get("api/v1/wcs/stat/stat1")
+  //   console.log('testTag1' + '-------------' + JSON.stringify(res))
+  //   return res
+  // }
   //todo
   //暂时扫的是库存里的料箱编码信息
   //查询取出料箱里面的物料信息
@@ -166,6 +166,8 @@ struct Warehousing {
     gridCount: 4,
     customStyle: true,
   })
+  fourWidth: number = 290
+  twoWidth: number = 150
 
   build() {
     Column() {
@@ -176,7 +178,7 @@ struct Warehousing {
             Text('智能仓储')
               .textAlign(TextAlign.Center)
               .borderRadius(px2vp(16))
-              .width('292px')
+              .width(px2vp(this.fourWidth))
               .height('80px')
               .fontWeight(FontWeight.Medium)
               .fontSize(px2vp(24))
@@ -185,7 +187,7 @@ struct Warehousing {
               .onClick(() => {
                 this.warehouseButton = 0
               })
-            Blank()
+            // Blank()
             // Text('xxxxxx')
             //   .textAlign(TextAlign.Center)
             //   .borderRadius(px2vp(16))
@@ -201,7 +203,7 @@ struct Warehousing {
 
 
           }
-          .width(px2vp(608))
+          .width(px2vp(this.fourWidth))
           .borderRadius(px2vp(15))
           .height(px2vp(80))
           .backgroundColor($r('app.color.black_10'))

+ 0 - 6
entry/src/main/ets/view/CompleteSet.ets

@@ -109,12 +109,6 @@ export struct CompleteSet {
   @State private TasklistoutboundData: Array<Tasklist> = []
   //扫码控制器
   textController: TextInputController = new TextInputController()
-  // //硬件出库位置
-  // locationRequest = async (): Promise<stat3> => {
-  //   let res: stat3 = await EquipmentRequest.get("api/v1/wcs/stat/stat3")
-  //   console.log('testTag1' + '-------------' + JSON.stringify(res))
-  //   return res
-  // }
   // 通过RFID请求读取料箱的信息
   rfidTimer: number = -1
   @State preRfid: string = "" //记录上一次的rfid,如果变化了 就清空回库下面的列表

+ 1 - 0
entry/src/main/module.json5

@@ -21,6 +21,7 @@
         "startWindowIcon": "$media:HONDAK_LOGO",
         "startWindowBackground": "$color:start_window_background",
         "exported": true,
+        "recoverable": true,
         "skills": [
           {
             "entities": [