更新配置和代码逻辑,优化查询及日志
- 更新 `.gitignore`,添加 CopilotIndices 和 SemanticSymbols 数据库文件路径。
- 在 `RouterService.cs` 中,增加对 `startPosi` 的检查,优化查询逻辑。
- 修改 `http.js` 中生产环境的 `axios` 基础 URL。
- 在 `Login.vue` 中,调整用户信息的默认值为空字符串。
- 更新 `Sys_Role.vue` 中表格的 `key` 属性为 `roleId`。
- 在 `UnitOfWorkManage.cs` 中,改用 `GetDbClient()` 处理事务。
- 在 `Dt_TaskService.cs` 中,移除缓存锁定机制的注释,更新库存查询失败的日志信息。
- 在 `appsettings.json` 中,将 Redis 使用设置为 `true`,并更新连接信息。
- 移除出库编码的注释,并添加新的出库物料编码信息。
| | |
| | | /3F/Code Management/WCS/WIDESEAWCS_Server/.vs/ProjectEvaluation/wideseawcs_server.projects.v7.bin |
| | | /3F/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/DesignTimeBuild/.dtbcache.v2 |
| | | /3F/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/.suo |
| | | /Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/CodeChunks.db |
| | | /Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/CodeChunks.db-shm |
| | | /Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/CodeChunks.db-wal |
| | | /Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/SemanticSymbols.db |
| | | /Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/SemanticSymbols.db-shm |
| | | /Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.13.439.2385/SemanticSymbols.db-wal |
| | | /Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.13.439.2385/CodeChunks.db |
| | | /Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.13.439.2385/SemanticSymbols.db |
| | |
| | | using SqlSugar; |
| | | using Masuit.Tools; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | } |
| | | visitedRoutes.Add(routeKey); |
| | | |
| | | List<Dt_Router> dt_Routers = BaseDal.QueryData(x => x.NextPosi == endPosi || x.ChildPosi == endPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } }); |
| | | List<Dt_Router> dt_Routers = BaseDal.QueryData(x => (x.NextPosi == endPosi || x.ChildPosi == endPosi) && x.StartPosi == startPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } }); |
| | | if (dt_Routers.IsNullOrEmpty()) |
| | | { |
| | | dt_Routers = BaseDal.QueryData(x => x.NextPosi == endPosi || x.ChildPosi == endPosi, new Dictionary<string, OrderByType> { { nameof(Dt_Router.IsEnd), OrderByType.Desc } }); |
| | | } |
| | | if (dt_Routers.Count > 0) |
| | | { |
| | | foreach (var item in dt_Routers) |
| | |
| | | { |
| | | if (routerType == (int)RouterInOutType.Out) |
| | | router.ChildPosi = routersAddDTOs[i + 1].ChildPositionCode; |
| | | router.IsEnd = true; |
| | | router.IsEnd = true; |
| | | } |
| | | routers.Add(router); |
| | | } |
| | |
| | | } |
| | | else if (process.env.NODE_ENV == 'production') { |
| | | // axios.defaults.baseURL = 'http://127.0.0.1:5000/'; |
| | | axios.defaults.baseURL = 'http://192.168.20.251:5000/'; |
| | | axios.defaults.baseURL = 'http://192.168.5.251:5000/'; |
| | | } |
| | | |
| | | //axios.defaults.baseURL = 'http://api.volcore.xyz/'; |
| | |
| | | const loading = ref(false); |
| | | const codeImgSrc = ref(''); |
| | | const userInfo = reactive({ |
| | | userName: 'admin', |
| | | password: '123456', |
| | | userName: '', |
| | | password: '', |
| | | verificationCode: '1234', |
| | | UUID: undefined |
| | | }); |
| | |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: 'Role_Id', |
| | | key: 'roleId', |
| | | footer: "Foots", |
| | | cnName: '角色管理', |
| | | name: 'Sys_Role', |
| | |
| | | public async Task UseTranAsync(Func<Task> action) |
| | | { |
| | | // 开始事务 |
| | | _sqlSugarClient.Ado.BeginTran(); |
| | | await GetDbClient().BeginTranAsync(); |
| | | |
| | | try |
| | | { |
| | |
| | | await action(); |
| | | |
| | | // 提交事务 |
| | | await _sqlSugarClient.Ado.CommitTranAsync(); |
| | | await GetDbClient().CommitTranAsync(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // 回滚事务 |
| | | await _sqlSugarClient.Ado.RollbackTranAsync(); |
| | | await GetDbClient().RollbackTranAsync(); |
| | | throw new Exception (ex.Message); // 重新抛出异常,以便调用方可以处理 |
| | | } |
| | | } |
| | |
| | | }); |
| | | try |
| | | { |
| | | //using (_simpleCacheService.AcquireLock(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, 2000)) |
| | | //{ |
| | | _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { stock.PalletCode }); |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogFactory.GetLog("删除缓存失败").Error(true, $"{stock.PalletCode}_删除缓存失败,异常信息:{ex.Message}"); |
| | | //using (_simpleCacheService.AcquireLock(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, 2000)) |
| | | //{ |
| | | //} |
| | | } |
| | | |
| | | return content.OK("任务完成成功", task.Remark); |
| | |
| | | List<DtStockInfo> stockInfoList = stockInfos.Values.ToList(); |
| | | var result = new DtStockInfo(); |
| | | |
| | | //if (stockInfoList.IsNullOrEmpty()) |
| | | //{ |
| | | // stockInfoList = await _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | // .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock).IncludesAllFirstLayer().ToListAsync(); |
| | | //} |
| | | if (areaCode == "CH001") |
| | | { |
| | | LogFactory.GetLog("CH001").Info(true, JsonConvert.SerializeObject(stockInfoList[0], Formatting.Indented)); |
| | | } |
| | | |
| | | result = stockInfoList.Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull) |
| | | .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine) |
| | |
| | | .OrderBy(x => x.OutboundTime) |
| | | .FirstOrDefault(); |
| | | |
| | | |
| | | if (result != null) |
| | | _simpleCacheService.HashDel<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo, new string[] { result.PalletCode }); |
| | | else |
| | | ConsoleHelper.WriteErrorLine("QueryStockInfoForRealTrayAsync查询实盘库存信息失败:未找到符合条件的数据"); |
| | | ConsoleHelper.WriteErrorLine($"{areaCode}-{productionLine}查询实盘库存信息失败:未找到符合条件的数据"); |
| | | |
| | | return result; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ConsoleHelper.WriteErrorLine("QueryStockInfoForRealTrayAsync查询实盘库存信息失败:" + ex.Message + "\r\n" + ex.StackTrace); |
| | | ConsoleHelper.WriteErrorLine("查询实盘库存信息失败:" + ex.Message + "\r\n" + ex.StackTrace); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | else |
| | | { |
| | | locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Distribute && x.RoadwayNo == requestTask.Roadways && x.EnalbeStatus == 1 && x.LocationType == 1); |
| | | if (locations == null) |
| | | if (locations.IsNullOrEmpty()) |
| | | { |
| | | locations = await _locationRepository.QueryDataAsync(x => x.LocationStatus == (int)LocationEnum.Free && x.RoadwayNo == requestTask.Roadways && x.EnalbeStatus == 1 && x.LocationType == 1); |
| | | } |
| | |
| | | |
| | | //缓存设置 |
| | | "CacheSettings": { |
| | | "UseRedis": false, //启用redis |
| | | "UseRedis": true, //启用redis |
| | | "RedisSettings": { |
| | | "Address": "127.0.0.1:6379", //地址 |
| | | "Password": "123456", //Redis服务密码 |
| | |
| | | |
| | | // 允许出库的编码 |
| | | "OutBoundMateriel": [ |
| | | //{ |
| | | // "MaterielCode": "CC01050001348", |
| | | // "ProductionLine": "ZJ-8", |
| | | // "ProcessCode": "CH001" |
| | | //} |
| | | { |
| | | "MaterielCode": "CC01050001523", |
| | | "ProductionLine": "ZJ-7", |
| | | "ProcessCode": "CH001" |
| | | } |
| | | ] |
| | | } |