已删除10个文件
已修改37个文件
已添加6个文件
| | |
| | | /// <summary> |
| | | /// æ´æ°ä»»å¡ä¿¡æ¯åæ·»å 任塿ç»è®°å½ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <param name="deviceCode"></param> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="targetAddress"></param> |
| | | /// <param name="currentAddress"></param> |
| | | /// <param name="nextAddress"></param> |
| | | /// <param name="taskStatus"></param> |
| | | /// <param name="task">ä»»å¡å对象å®ä¾(æªä¿®æ¹çæ°æ®å¯¹è±¡)</param> |
| | | /// <param name="taskStatus">ä¿®æ¹åçä»»å¡ç¶æ</param> |
| | | /// <param name="deviceCode">ä¿®æ¹åç设å¤ç¼å·</param> |
| | | /// <param name="sourceAddress">ä¿®æ¹åçèµ·å§å°å</param> |
| | | /// <param name="targetAddress">ä¿®æ¹åçç®æ å°å</param> |
| | | /// <param name="currentAddress">ä¿®æ¹åçå½åå°å</param> |
| | | /// <param name="nextAddress">ä¿®æ¹åçä¸ä¸å°å</param> |
| | | void UpdateTask(Dt_Task task, TaskStatusEnum taskStatus, string deviceCode = "", string sourceAddress = "", string targetAddress = "", string currentAddress = "", string nextAddress = ""); |
| | | |
| | | /// <summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <!-- |
| | | https://go.microsoft.com/fwlink/?LinkID=208121. |
| | | --> |
| | | <Project> |
| | | <PropertyGroup> |
| | | <DeleteExistingFiles>false</DeleteExistingFiles> |
| | | <ExcludeApp_Data>false</ExcludeApp_Data> |
| | | <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> |
| | | <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
| | | <LastUsedPlatform>Any CPU</LastUsedPlatform> |
| | | <PublishProvider>FileSystem</PublishProvider> |
| | | <PublishUrl>bin\Release\net6.0\publish\</PublishUrl> |
| | | <WebPublishMethod>FileSystem</WebPublishMethod> |
| | | <_TargetId>Folder</_TargetId> |
| | | </PropertyGroup> |
| | | </Project> |
| | |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | //"ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=TestWCS_TC;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "WMSConnectionStrings": "Data Source=.;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
置信æ¯"); |
| | | } |
| | | |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi || item.RoadWay == x.ChildPosiDeviceCode || item.RoadWay == x.ChildPosi)); |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && (item.SourceAddress == x.StartPosi || item.RoadWay == x.StartPosi /*|| item.RoadWay == x.ChildPosiDeviceCode || item.RoadWay == x.ChildPosi*/)); |
| | | router = routers.FirstOrDefault(); |
| | | if (router == null) |
| | | { |
| | |
| | | { |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | /// <summary> |
| | | /// æ´æ°ä»»å¡ä¿¡æ¯åæ·»å 任塿ç»è®°å½ |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å对象å®ä¾(æªä¿®æ¹çæ°æ®å¯¹è±¡)</param> |
| | | /// <param name="taskStatus">ä¿®æ¹åçä»»å¡ç¶æ</param> |
| | | /// <param name="deviceCode">ä¿®æ¹åç设å¤ç¼å·</param> |
| | | /// <param name="sourceAddress">ä¿®æ¹åçèµ·å§å°å</param> |
| | | /// <param name="targetAddress">ä¿®æ¹åçç®æ å°å</param> |
| | | /// <param name="currentAddress">ä¿®æ¹åçå½åå°å</param> |
| | | /// <param name="nextAddress">ä¿®æ¹åçä¸ä¸å°å</param> |
| | | public void UpdateTask(Dt_Task task, TaskStatusEnum taskStatus, string deviceCode = "", string sourceAddress = "", string targetAddress = "", string currentAddress = "", string nextAddress = "") |
| | | { |
| | | StringBuilder stringBuilder = new StringBuilder(App.User?.UserId == 0 ? $"ç³»ç»èªå¨æµç¨" : "人工æå¨æµç¨"); |
| | |
| | | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, stringBuilder.ToString()); |
| | | |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (!string.IsNullOrEmpty(address)) |
| | | { |
| | | HttpHelper.Post($"{address}/api/Task/UpdateTaskInfo", task.Serialize()); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode); |
| | | if (task != null) |
| | | { |
| | | task.CurrentAddress = item.StackerCraneStationCode; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | task.DeviceCode = item.StackerCraneCode; |
| | | _taskRepository.UpdateData(task); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode); |
| | | } |
| | | |
| | | device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode); |
| | |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); |
| | | if (stationManger == null) |
| | | { |
| | | WriteInfo(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | WriteError(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, stationManger.StackerCraneCode); |
| | | if (string.IsNullOrEmpty(locationCode)) |
| | | { |
| | | WriteInfo(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | WriteError(item.StationName, $"请æ±åé
è´§ä½è¿åä¿¡æ¯é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode); |
| | |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); |
| | | if (stationManger == null) |
| | | { |
| | | WriteInfo(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | WriteError(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | |
| | | Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && (task.CurrentAddress == x.StartPosi)); |
| | | if (router == null) |
| | | { |
| | | WriteInfo(item.StationName, $"æªæ¾å°è·¯ç±é
置信æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | WriteError(item.StationName, $"æªæ¾å°è·¯ç±é
置信æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | |
| | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | |
| | | device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode); |
| | | } |
| | | else |
| | | { |
| | | task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && string.IsNullOrEmpty(x.DeviceCode) && x.TaskState == TaskStatusEnum.New.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.CurrentAddress); |
| | | if (stationManger != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: stationManger.StackerCraneCode, currentAddress: stationManger.StackerCraneStationCode, nextAddress: task.TargetAddress); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.STB && !conveyorLineSignalWrite.ACK) |
| | |
| | | } |
| | | else |
| | | { |
| | | WriteInfo(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | WriteError(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | } |
| | | } |
| | |
| | | Dt_StationManger? stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.StationCode); |
| | | if (stationManger == null) |
| | | { |
| | | WriteInfo(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | WriteError(item.StationName, $"æªæ¾å°å¯¹åºç«å°ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && (task.Roadway == x.ChildPosiDeviceCode || task.Roadway == x.ChildPosi)); |
| | |
| | | using WIDESEAWCS_Core.Caches; |
| | | using Newtonsoft.Json; |
| | | using WIDESEAWCS_TaskInfoService; |
| | | using WIDESEAWCS_Tasks.ConveyorLineJob; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IRouterService _routerService; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | private readonly IRouterRepository _routerRepository; |
| | | private List<Dt_ApiInfo> apiInfos; |
| | | |
| | | public StackerCraneJob_BC(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository) |
| | | public StackerCraneJob_BC(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IRouterRepository routerRepository) |
| | | { |
| | | _taskService = taskService; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | |
| | | _routerService = routerService; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _cacheService = cacheService; |
| | | _routerRepository = routerRepository; |
| | | |
| | | string? apiInfoStr = _cacheService.Get("apiInfos"); |
| | | if (!string.IsNullOrEmpty(apiInfoStr)) |
| | |
| | | _taskService.UpdateTaskExceptionMessage(taskNum, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | return WebResponseContent.Instance.Error($"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | } |
| | | Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && x.StartPosi == stationManger.StationCode); |
| | | if (router == null) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | _taskService.UpdateTaskExceptionMessage(taskNum, $"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | } |
| | | |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: task.TargetAddress); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | |
| | | if (device != null) |
| | | { |
| | | OtherDevice client = (OtherDevice)device; |
| | | if (client.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode))//åºåºç«å°æªè¢«å ç¨ |
| | | if (!client.GetValue<R_ConveyorLineDB, bool>(R_ConveyorLineDB.Goods, stationManger.StationCode))//åºåºç«å°æªè¢«å ç¨ |
| | | { |
| | | task.NextAddress = stationManger.StackerCraneStationCode; |
| | | _taskRepository.UpdateData(task); |
| | | client.SetValue(GroundStationDBName.R_IsCanPut, true, stationManger.StationCode); |
| | | return task; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="600px" |
| | | :padding="15" |
| | | title="æå°" |
| | | > |
| | | <div> |
| | | <el-form> |
| | | <el-form-item required label="è¯·éæ©ä»åºï¼"> |
| | | <el-select |
| | | v-model="warehouseId" |
| | | filterable |
| | | placeholder="è¯·éæ©" |
| | | @change="getPalletType" |
| | | > |
| | | <el-option |
| | | v-for="item in warehouses" |
| | | :key="item.key" |
| | | :label="item.value" |
| | | :value="item.key" |
| | | > |
| | | <span style="float: left">{{ item.value }}</span> |
| | | <span style="float: right; color: #8492a6; font-size: 13px">{{ |
| | | item.key |
| | | }}</span> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item required label="请è¾å
¥æ°éï¼" |
| | | ><el-input-number |
| | | v-model="num" |
| | | :min="1" |
| | | :max="100" |
| | | label="请è¾å
¥æ°é" |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item |
| | | required |
| | | label="è¯·éæ©æçç±»åï¼" |
| | | v-show="warehouseId != ''" |
| | | > |
| | | <el-radio-group v-model="palletType"> |
| | | <el-radio |
| | | v-for="item in palletTypes" |
| | | :key="item.key" |
| | | :label="item" |
| | | >{{ item.value }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | | <el-button type="primary" size="small" @click="submit">确认</el-button> |
| | | <el-button type="danger" size="small" @click="close">å
³é</el-button> |
| | | </template> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | export default { |
| | | components: { VolBox }, |
| | | data() { |
| | | return { |
| | | showDetialBox: false, |
| | | warehouses: [], |
| | | warehouseId: "", |
| | | palletType: "", |
| | | palletTypes: [], |
| | | num: 1, |
| | | }; |
| | | }, |
| | | methods: { |
| | | open() { |
| | | if (this.warehouses.length == 0) { |
| | | this.getWarehouseInfos(); |
| | | } |
| | | if (this.warehouses.length == 1) { |
| | | this.warehouseId = this.warehouses[0].key; |
| | | } |
| | | this.showDetialBox = true; |
| | | }, |
| | | getWarehouseInfos() { |
| | | this.http |
| | | .post("api/Warehouse/GetWarehouseDicByUser", null, "æ°æ®å¤çä¸") |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.warehouses = x.data; |
| | | if (this.warehouses.length == 1) { |
| | | this.warehouseId = this.warehouses[0].key; |
| | | } |
| | | }); |
| | | }, |
| | | getPalletType() { |
| | | this.palletTypes = this.warehouses.find( |
| | | (x) => x.key == this.warehouseId |
| | | ).extra; |
| | | }, |
| | | close() { |
| | | this.showDetialBox = false; |
| | | if (this.warehouses.length > 1) { |
| | | this.warehouseId = ""; |
| | | } |
| | | this.palletType = ""; |
| | | }, |
| | | submit() { |
| | | this.http |
| | | .post( |
| | | `api/PalletCodeInfo/AddPalletCodeData?count=${this.num}&warehouseId=${this.warehouseId}&palletTypeId=${this.palletType.key}`, |
| | | null, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return this.$message.error(x.message); |
| | | this.$message.success("æä½æå"); |
| | | this.$parent.refresh(); |
| | | this.close(); |
| | | }); |
| | | }, |
| | | }, |
| | | created() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .el-col { |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .grid-content { |
| | | border-radius: 4px; |
| | | min-height: 36px; |
| | | } |
| | | |
| | | .content-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .right-text { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | </style> |
| | | <style> |
| | | .el-table .warning-row { |
| | | background: #e6a23c; |
| | | } |
| | | |
| | | .el-table .success-row { |
| | | background: #f0f9eb; |
| | | } |
| | | |
| | | .el-table .error-row { |
| | | background: #f56c6c; |
| | | } |
| | | |
| | | canvas { |
| | | display: block; |
| | | margin: auto; |
| | | } |
| | | </style> |
| | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridBody from './extend/printView.vue' |
| | | import gridHeader from './extend/palletCodeAdd.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridHeader: gridHeader, |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | onInit() { |
| | | let addBtn = this.buttons.find(x => x.value == 'Add'); |
| | | if (addBtn) { |
| | | addBtn.onClick = function () { |
| | | this.$refs.gridHeader.open(); |
| | | } |
| | | } |
| | | //æ¡æ¶åå§åé
ç½®åï¼ |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | |
| | | <img class="user-header" :src="userImg" :onerror="errorImg" /> |
| | | </div> |
| | | <div class="user"> |
| | | <span>{{ userName }}</span> |
| | | <span>{{ userTrueName }}</span> |
| | | <span id="index-date"></span> |
| | | </div> |
| | | <div class="settings"> |
| | |
| | | //2022.05.29å¢å tabé项ä¸èåèå¨åè½ |
| | | const currentMenuId = ref(0); |
| | | const userName = ref("--"); |
| | | const userTrueName = ref("--"); |
| | | const userInfo = ref({}); |
| | | const visibleItem = reactive({ |
| | | left: false, |
| | |
| | | |
| | | let _userInfo = store.getters.getUserInfo(); |
| | | if (_userInfo) { |
| | | console.log(_userInfo); |
| | | userName.value = _userInfo.trueNmae; |
| | | userName.value = _userInfo.userName; |
| | | userTrueName.value = _userInfo.userTrueName; |
| | | if (_userInfo.img) { |
| | | userImg.value = _config.base.getImgSrc(_userInfo.img, http.ipAddress); |
| | | } |
| | |
| | | errorImg, |
| | | userInfo, |
| | | userName, |
| | | userTrueName, |
| | | userImg, |
| | | selectId, |
| | | selectMenuIndex, |
| | |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "user_Id", |
| | | key: "userId", |
| | | footer: "Foots", |
| | | cnName: "ç¨æ·ç®¡ç", |
| | | name: "Sys_User", |
| | | url: "/User/", |
| | | sortName: "user_Id", |
| | | sortName: "userId", |
| | | }); |
| | | const editFormFields = ref({ |
| | | systemType: "0", |
| | | userName: "", |
| | | userTrueName: "", |
| | | roleId: [], |
| | | roleId: "", |
| | | deptIds: "", |
| | | enable: "", |
| | | gender: "", |
| | |
| | | title: "è§è²", |
| | | required: true, |
| | | field: "roleId", |
| | | type: "cascader", |
| | | type: "select", |
| | | }, |
| | | ], |
| | | // [ |
| | |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Core.Caches; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public partial class WarehouseService : ServiceBase<Dt_Warehouse, IWarehouseRepository>, IWarehouseService |
| | | { |
| | | public WarehouseService(IWarehouseRepository BaseDal) : base(BaseDal) |
| | | private readonly ICacheService _cacheService; |
| | | private readonly IPalletTypeInfoRepository _palletTypeInfoRepository; |
| | | |
| | | public WarehouseService(IWarehouseRepository BaseDal,ICacheService cacheService, IPalletTypeInfoRepository palletTypeInfoRepository) : base(BaseDal) |
| | | { |
| | | _cacheService = cacheService; |
| | | _palletTypeInfoRepository = palletTypeInfoRepository; |
| | | } |
| | | |
| | | public IWarehouseRepository Repository => BaseDal; |
| | |
| | | { |
| | | return WarehouseDisableStatus(new int[] { key }); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | public class PalletCodeInfoService : ServiceBase<Dt_PalletCodeInfo, IPalletCodeInfoRepository>, IPalletCodeInfoService |
| | | { |
| | | private readonly IWarehouseRepository _warehouseRepository; |
| | | public PalletCodeInfoService(IPalletCodeInfoRepository BaseDal, IWarehouseRepository warehouseRepository) : base(BaseDal) |
| | | private readonly IPalletTypeInfoRepository _palletTypeInfoRepository; |
| | | |
| | | public PalletCodeInfoService(IPalletCodeInfoRepository BaseDal, IWarehouseRepository warehouseRepository, IPalletTypeInfoRepository palletTypeInfoRepository) : base(BaseDal) |
| | | { |
| | | _warehouseRepository = warehouseRepository; |
| | | _palletTypeInfoRepository = palletTypeInfoRepository; |
| | | } |
| | | |
| | | static object locker = new object(); |
| | |
| | | { |
| | | serialNo = 1; |
| | | } |
| | | Dt_Warehouse _Warehouse = _warehouseRepository.QueryFirst(x=>x.WarehouseId== warehouseId); |
| | | |
| | | string uplen = _Warehouse.WarehouseCode switch |
| | | Dt_Warehouse _Warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId); |
| | | string uplen = ""; |
| | | switch (_Warehouse.WarehouseCode) |
| | | { |
| | | "HA57" => "B", |
| | | "HA58" => "P", |
| | |
| | | }; |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | |
| | | |
| | | palletCodeInfos.Add(new Dt_PalletCodeInfo |
| | | { |
| | | SerialNo = serialNo, |
| | | PalletCode = uplen+now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), |
| | | PalletCode = uplen + now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), |
| | | PalletType = 1, |
| | | PalletTypeId = 0, |
| | | WarehouseId = warehouseId, |
| | |
| | | return base.AddData(palletCodeInfos); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent AddData(int warehouseId, int count, int palletTypeId) |
| | | { |
| | | try |
| | | { |
| | | Dt_PalletTypeInfo palletTypeInfo = _palletTypeInfoRepository.QueryFirst(x => x.Id == palletTypeId && x.WarehouseId == warehouseId); |
| | | if (palletTypeInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°æçç±»åé
置信æ¯"); |
| | | } |
| | | lock (locker) |
| | | { |
| | | List<Dt_PalletCodeInfo> palletCodeInfos = new List<Dt_PalletCodeInfo>(); |
| | | int serialNo = 0; |
| | | DateTime now = DateTime.Now; |
| | | Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.WarehouseId == warehouseId, new Dictionary<string, OrderByType> { { nameof(Dt_PalletCodeInfo.SerialNo), OrderByType.Desc } }); |
| | | if (palletCodeInfo != null && palletCodeInfo.CreateDate.Year == now.Year && palletCodeInfo.CreateDate.Month == now.Month && palletCodeInfo.CreateDate.Day == now.Day) |
| | | { |
| | | serialNo = palletCodeInfo.SerialNo + 1; |
| | | |
| | | } |
| | | else |
| | | { |
| | | serialNo = 1; |
| | | } |
| | | |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | |
| | | palletCodeInfos.Add(new Dt_PalletCodeInfo |
| | | { |
| | | SerialNo = serialNo, |
| | | PalletCode = palletTypeInfo.CodeStartStr + now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), |
| | | PalletType = 1, |
| | | PalletTypeId = 0, |
| | | WarehouseId = warehouseId, |
| | | Status = 0, |
| | | Size = 0 |
| | | }); |
| | | |
| | | serialNo = serialNo + 1; |
| | | } |
| | | BaseDal.AddData(palletCodeInfos); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent PrintStatusUp(string printCode) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x=>x.PalletCode==printCode); |
| | | if (palletCodeInfo==null) |
| | | Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.PalletCode == printCode); |
| | | if (palletCodeInfo == null) |
| | | { |
| | | return content.Error("æå°çæçç ä¸åå¨"); |
| | | } |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error("é误:"+ex.Message); |
| | | content.Error("é误:" + ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.HostedService; |
| | | using WIDESEA_DTO.System; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public partial class WarehouseService : ServiceBase<Dt_Warehouse, IWarehouseRepository>, IWarehouseService |
| | | public partial class WarehouseService |
| | | { |
| | | public WebResponseContent GetWarehouseDicByUser() |
| | | { |
| | | try |
| | | { |
| | | List<int> warehouseIds = Db.Queryable<Sys_RoleDataPermission>().Where(x => x.RoleId == App.User.RoleId).Select(x => x.WarehouseId).ToList(); |
| | | List<DictionaryDTO> dic = Repository.QueryData(x => new DictionaryDTO { Key = x.WarehouseId, Value = x.WarehouseName + $"({x.WarehouseCode})" }, x => warehouseIds.Contains(x.WarehouseId)).ToList(); |
| | | List<Dt_PalletTypeInfo> palletTypeInfos = _palletTypeInfoRepository.QueryData();//x => x.TypeName + $"({x.CodeStartStr})", x => true |
| | | dic.ForEach(x => |
| | | { |
| | | x.Extra = palletTypeInfos.Where(v => v.WarehouseId == x.Key.ObjToInt()).Select(x => new DictionaryDTO { Key = x.Id, Value = x.TypeName + $"({x.CodeStartStr})" }).ToList(); |
| | | }); |
| | | |
| | | return WebResponseContent.Instance.OK(data: dic); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | _db.InsertableByObject(obj).AS(type.Name + "_Hty").ExecuteCommand(); |
| | | if (obj != null) |
| | | _db.InsertableByObject(obj).AS(type.Name + "_Hty").ExecuteCommand(); |
| | | } |
| | | } |
| | | return DeleteData(entity); |
| | |
| | | list.Add(obj); |
| | | } |
| | | } |
| | | _db.InsertableByObject(list).AS(type.Name + "_Hty").ExecuteCommand(); |
| | | if (list.Count > 0) |
| | | _db.InsertableByObject(list).AS(type.Name + "_Hty").ExecuteCommand(); |
| | | |
| | | } |
| | | } |
| | |
| | | return pageGridData; |
| | | } |
| | | |
| | | void ValidatePageOptions(PageDataOptions options, PropertyInfo[] entityProperties, ref ISugarQueryable<TEntity> sugarQueryable) |
| | | protected void ValidatePageOptions(PageDataOptions options, PropertyInfo[] entityProperties, ref ISugarQueryable<TEntity> sugarQueryable) |
| | | { |
| | | string where = string.Empty; |
| | | List<SearchParameters> searchParametersList = new List<SearchParameters>(); |
| | |
| | | |
| | | public bool IsSuperAdmin => IsRoleIdSuperAdmin(RoleId); |
| | | |
| | | public bool IsHighestRole => UserId == 1; |
| | | |
| | | public List<string> GetUserInfoFromToken(string ClaimType) |
| | | { |
| | | var jwtHandler = new JwtSecurityTokenHandler(); |
| | |
| | | /// </summary> |
| | | long TenantId { get; } |
| | | |
| | | int RoleId { get;} |
| | | int RoleId { get; } |
| | | |
| | | string Token { get; } |
| | | |
| | | int MenuType { get; } |
| | | int MenuType { get; } |
| | | |
| | | void UpdateToke(string token); |
| | | |
| | |
| | | |
| | | List<string> GetUserInfoFromToken(string ClaimType); |
| | | |
| | | bool IsSuperAdmin { get; } |
| | | bool IsSuperAdmin { get; } |
| | | |
| | | bool IsHighestRole { get; } |
| | | |
| | | bool IsRoleIdSuperAdmin(int roleId); |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.Extensions.Logging; |
| | | using Newtonsoft.Json; |
| | | using Org.BouncyCastle.Asn1.Ocsp; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | private string RequestDataLog(HttpContext context) |
| | | { |
| | | var request = context.Request; |
| | | var sr = new StreamReader(request.Body); |
| | | |
| | | object obj = new |
| | | if (request.ContentType?.ToLower() != "multipart/form-data" && request.ContentLength <= 100000) |
| | | { |
| | | QueryString = request.QueryString.ToString(), |
| | | BodyData = sr.ReadToEndAsync().Result |
| | | }; |
| | | var sr = new StreamReader(request.Body); |
| | | |
| | | string data = JsonConvert.SerializeObject(obj); |
| | | object obj = new |
| | | { |
| | | QueryString = request.QueryString.ToString(), |
| | | BodyData = sr.ReadToEndAsync().Result |
| | | }; |
| | | |
| | | request.Body.Position = 0; |
| | | string data = JsonConvert.SerializeObject(obj); |
| | | |
| | | return data; |
| | | request.Body.Position = 0; |
| | | |
| | | return data; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | private string ResponseDataLog(HttpResponse response) |
| | | { |
| | | response.Body.Position = 0; |
| | | using StreamReader stream = new StreamReader(response.Body, leaveOpen: true); |
| | | string body = stream.ReadToEnd(); |
| | | response.Body.Position = 0; |
| | | return body; |
| | | if (response.ContentType?.ToLower() != "multipart/form-data" && response.ContentLength <= 100000) |
| | | { |
| | | response.Body.Position = 0; |
| | | using StreamReader stream = new StreamReader(response.Body, leaveOpen: true); |
| | | string body = stream.ReadToEnd(); |
| | | response.Body.Position = 0; |
| | | return body; |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.System |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class DictionaryDTO |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public object Key { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public object Value { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public object Extra { get; set; } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | /// </summary> |
| | | public class WCSTaskDTO |
| | | { |
| | | // public int Task |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | public int TaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | public int TaskNum { get; set; } |
| | | /// <summary> |
| | | /// AGVä»»å¡å· |
| | | /// </summary> |
| | | public string AgvTaskNum { get; set; } |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç±»å |
| | | /// </summary> |
| | | public int PalletType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 设å¤ç¼å· |
| | | /// </summary> |
| | | public string DeviceCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | /// </summary> |
| | | public string Roadway { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public int TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int TaskState { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§å°å |
| | | /// </summary> |
| | | public string SourceAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ å°å |
| | | /// </summary> |
| | | public string TargetAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å½åä½ç½® |
| | | /// </summary> |
| | | public string CurrentAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸å°å |
| | | /// </summary> |
| | | public string NextAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸ä¿¡æ¯ |
| | | /// </summary> |
| | | public string? ExceptionMessage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¼å
级 |
| | | /// </summary> |
| | | public int Grade { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WMSä»»å¡ä¸»é® |
| | | /// </summary> |
| | | public int WMSId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ä¸åæ¶é´ |
| | | /// </summary> |
| | | public DateTime? Dispatchertime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | public interface IPalletCodeInfoService : IService<Dt_PalletCodeInfo> |
| | | { |
| | | //æ´æ°æå°ç¶æ |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="warehouseId"></param> |
| | | /// <param name="count"></param> |
| | | /// <param name="palletTypeId"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AddData(int warehouseId, int count, int palletTypeId); |
| | | |
| | | /// <summary> |
| | | /// æ´æ°æå°ç¶æ |
| | | /// </summary> |
| | | /// <param name="printCode"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent PrintStatusUp(string printCode); |
| | | } |
| | | } |
| | |
| | | /// <param name="key">ä»åºä¸»é®</param> |
| | | /// <returns></returns> |
| | | WebResponseContent WarehouseDisableStatus(int key); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent GetWarehouseDicByUser(); |
| | | } |
| | | } |
| | |
| | | |
| | | void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> stockInfoDetails, float beforeQuantity, float totalQuantity, StockChangeTypeEnum changeType, int? taskNum = null); |
| | | |
| | | void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> updateDetails, List<Dt_StockInfoDetail> deleteDetails, StockChangeTypeEnum changeType, int? taskNum = null); |
| | | void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> residueDetailList, List<Dt_StockInfoDetail> updateDetails, List<Dt_StockInfoDetail> deleteDetails, StockChangeTypeEnum changeType, int? taskNum = null); |
| | | } |
| | | } |
| | |
| | | { |
| | | ISys_RoleRepository Repository { get; } |
| | | |
| | | List<int> GetAllChildrenRoleId(int roleId); |
| | | |
| | | List<RoleNodes> GetAllChildren(int roleId); |
| | | |
| | | WebResponseContent GetCurrentTreePermission(); |
| | |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_DTO.MES; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_ITaskInfoRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | /// <returns></returns> |
| | | MesResponseContent SubstrateBack(SubstrateBackModel model); |
| | | |
| | | /// <summary> |
| | | /// åé
å··é |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <param name="roadwayNos"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos); |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»»å¡ç¶æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent UpdateTaskInfo(WCSTaskDTO task); |
| | | } |
| | | } |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçè¿æªåºåºå®æ"); |
| | | } |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = Repository.QueryData(x => x.PalletCode == palletCode); |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = Repository.QueryData(x => x.PalletCode == palletCode && x.Status == OutLockStockStatusEnum.åºåºå®æ.ObjToInt()); |
| | | if (outStockLockInfos == null || outStockLockInfos.Count == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error("该æçå·²å
¨é¨åæ£å®æ"); |
| | | } |
| | | for (int i = 0; i < outStockLockInfos.Count; i++) |
| | | { |
| | | outStockLockInfos[i].Status = OutLockStockStatusEnum.æ£é宿.ObjToInt(); |
| | |
| | | List<Dt_StockInfoDetail> beforeDetaile = stockInfo.Details.GroupBy(x => x.MaterielCode).Select(x => new Dt_StockInfoDetail { MaterielCode = x.Key, StockQuantity = x.Sum(v => v.StockQuantity) }).ToList(); |
| | | List<Dt_StockInfoDetail> updateDetailList = new List<Dt_StockInfoDetail>(); |
| | | List<Dt_StockInfoDetail> deleteDetailList = new List<Dt_StockInfoDetail>(); |
| | | List<Dt_StockInfoDetail> residueDetailList = new List<Dt_StockInfoDetail>(); |
| | | for (int i = 0; i < stockInfo.Details.Count; i++) |
| | | { |
| | | if (stockInfo.Details[i].OutboundQuantity > 0) |
| | |
| | | deleteDetailList.Add(stockInfo.Details[i]); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | residueDetailList.Add(stockInfo.Details[i]); |
| | | } |
| | | } |
| | | |
| | | List<string> mCodes = stockInfo.Details.GroupBy(x => x.MaterielCode).Select(x => x.Key).ToList(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | foreach (string code in mCodes) |
| | | { |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, updateDetailList, deleteDetailList, StockChangeTypeEnum.Outbound); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, residueDetailList, updateDetailList, deleteDetailList, StockChangeTypeEnum.Outbound); |
| | | } |
| | | updateDetailList.ForEach(x => |
| | | { |
| | | x.OutboundQuantity = 0; |
| | | }); |
| | | stockInfo.StockStatus = StockStatusEmun.æå¨ç»çå
¥åºç¡®è®¤.ObjToInt(); |
| | | //_stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(deleteDetailList, OperateTypeEnum.èªå¨å®æ); |
| | | if (stockInfo.Details.Sum(x=>x.StockQuantity)== stockInfo.Details.Sum(x => x.OutboundQuantity)) |
| | | { |
| | | _stockService.StockInfoService.Repository.DeleteData(stockInfo); |
| | | } |
| | | else |
| | | { |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | } |
| | | |
| | | _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(deleteDetailList, OperateTypeEnum.èªå¨å®æ); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(updateDetailList); |
| | | _stockService.StockInfoDetailService.Repository.DeleteData(deleteDetailList); |
| | | //_stockService.StockInfoDetailService.Repository.DeleteData(deleteDetailList); |
| | | BaseDal.UpdateData(outStockLockInfos); |
| | | _unitOfWorkManage.BeginTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | |
| | | } |
| | | } |
| | | |
| | | public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> updateDetails, List<Dt_StockInfoDetail> deleteDetails, StockChangeTypeEnum changeType, int? taskNum = null) |
| | | public void AddStockChangeRecord(Dt_StockInfo stockInfo, List<Dt_StockInfoDetail> residueDetailList, List<Dt_StockInfoDetail> updateDetails, List<Dt_StockInfoDetail> deleteDetails, StockChangeTypeEnum changeType, int? taskNum = null) |
| | | { |
| | | try |
| | | { |
| | |
| | | |
| | | int index1 = 0; |
| | | List<Dt_StockQuantityChangeRecord> records1 = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(updateDetails); |
| | | float beforeQuantity = updateDetails.Sum(x => x.OutboundQuantity + x.StockQuantity) + deleteDetails.Sum(x => x.StockQuantity) + residueDetailList.Sum(x => x.StockQuantity); |
| | | |
| | | records1.ForEach(x => |
| | | { |
| | | x.PalleCode = stockInfo.PalletCode; |
| | | x.BeforeQuantity = deleteDetails[index1].StockQuantity + deleteDetails[index1].OutboundQuantity; |
| | | x.ChangeQuantity = -deleteDetails[index1].OutboundQuantity; |
| | | x.AfterQuantity = deleteDetails[index1].StockQuantity; |
| | | x.BeforeQuantity = beforeQuantity; |
| | | x.ChangeQuantity = -updateDetails[index1].OutboundQuantity; |
| | | x.AfterQuantity = beforeQuantity + x.ChangeQuantity; |
| | | beforeQuantity -= updateDetails[index1].OutboundQuantity; |
| | | index1++; |
| | | }); |
| | | stockQuantityChangeRecords.AddRange(records1); |
| | |
| | | records2.ForEach(x => |
| | | { |
| | | x.PalleCode = stockInfo.PalletCode; |
| | | x.BeforeQuantity = deleteDetails[index2].StockQuantity; |
| | | x.BeforeQuantity = beforeQuantity; |
| | | x.ChangeQuantity = -deleteDetails[index2].StockQuantity; |
| | | x.AfterQuantity = 0; |
| | | x.AfterQuantity = beforeQuantity + x.ChangeQuantity; |
| | | beforeQuantity -= deleteDetails[index2].StockQuantity; |
| | | index2++; |
| | | }); |
| | | stockQuantityChangeRecords.AddRange(records2); |
| | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public List<int> GetAllChildrenRoleId(int roleId) |
| | | { |
| | | return GetAllChildren(roleId).Select(x => x.Id).ToList(); |
| | | } |
| | | |
| | | public List<RoleNodes> GetAllChildren(int roleId) |
| | | { |
| | | if (roleId <= 0) return new List<RoleNodes>() { }; |
| | |
| | | using SqlSugar; |
| | | using ICacheService = WIDESEA_Core.Caches.ICacheService; |
| | | using HslCommunication.WebSocket; |
| | | using System.Drawing.Drawing2D; |
| | | using System.Linq; |
| | | using MailKit.Search; |
| | | using OrderByType = SqlSugar.OrderByType; |
| | | using System.Drawing.Printing; |
| | | |
| | | namespace WIDESEA_SystemService |
| | | { |
| | |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ISys_MenuService _menuService; |
| | | private readonly ISys_RoleService _roleService; |
| | | |
| | | public ISys_UserRepository Repository => BaseDal; |
| | | |
| | | public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService) : base(repository) |
| | | public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService, ISys_RoleService roleService) : base(repository) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _cacheService = cacheService; |
| | | _menuService = menuService; |
| | | _roleService = roleService; |
| | | } |
| | | |
| | | public WebResponseContent Login(LoginInfo loginInfo) |
| | |
| | | |
| | | _cacheService.AddOrUpdate(user.UserId.ToString(), token); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: new { token, userName = user.UserName, img = user.HeadImageUrl,trueNmae=user.UserTrueName }); |
| | | content = WebResponseContent.Instance.OK(data: new { token, userName = user.UserName, img = user.HeadImageUrl, user.UserTrueName }); |
| | | } |
| | | else |
| | | { |
| | |
| | | return base.UpdateData(saveModel); |
| | | } |
| | | |
| | | public override PageGridData<Sys_User> GetPageData(PageDataOptions options) |
| | | { |
| | | int roleId = -1; |
| | | //æ å½¢èåä¼ æ¥è¯¢è§è²ä¸ææç¨æ· |
| | | if (options.Value != null) |
| | | { |
| | | roleId = options.Value.ObjToInt(); |
| | | } |
| | | |
| | | if (roleId <= 0) |
| | | { |
| | | if (App.User.IsHighestRole) return base.GetPageData(options); |
| | | roleId = App.User.RoleId; |
| | | } |
| | | int totalCount = 0; |
| | | List<int> roleIds = _roleService.GetAllChildrenRoleId(roleId).Where(x => x != roleId).ToList(); |
| | | ISugarQueryable<Sys_User> sugarQueryable = Db.Queryable<Sys_User>(); |
| | | ValidatePageOptions(options, TProperties, ref sugarQueryable); |
| | | |
| | | Dictionary<string, OrderByType> orderbyDic = options.GetPageDataSort(TProperties); |
| | | List<OrderByModel> orderByModels = new List<OrderByModel>(); |
| | | foreach (var item in orderbyDic) |
| | | { |
| | | OrderByModel orderByModel = new OrderByModel() |
| | | { |
| | | FieldName = item.Key, |
| | | OrderByType = item.Value |
| | | }; |
| | | orderByModels.Add(orderByModel); |
| | | } |
| | | List<Sys_User> users = sugarQueryable.Where(x => roleIds.Contains(x.RoleId) || x.UserId == App.User.UserId).OrderBy(orderByModels).ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<Sys_User> { Rows = users, Total = totalCount }; |
| | | } |
| | | |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |
| | | string pwd = "123456"; |
| | |
| | | /// å
¥åºä»»å¡ç³è¯·åé
è´§ä½ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <param name="roadwayNo">å··éå·</param> |
| | | /// <param name="roadwayNos">å··éå·</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos) |
| | | { |
| | |
| | | { |
| | | if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) |
| | | { |
| | | Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.Id == item.OrderDetailId); |
| | | Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.TaskNo == item.OrderNo); |
| | | if (mesOutboundOrder != null) |
| | | { |
| | | mesOutboundOrder.OverOutQuantity = item.AssignQuantity; |
| | |
| | | { |
| | | x.AGVArea = agvDescription; |
| | | }); |
| | | string response = HttpHelper.Post("http://127.0.0.1:9281/api/Task/ReceiveTask", taskDTOs.Serialize()); |
| | | |
| | | string url = AppSettings.Get("WCS"); |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | throw new Exception($"æªæ¾å°WCSAApiå°å,è¯·æ£æ¥é
ç½®æä»¶"); |
| | | } |
| | | string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize()); |
| | | |
| | | return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("è¿åé误"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //public WebResponseContent UpdateTaskInfo(WCSTaskDTO taskDTO) |
| | | //{ |
| | | |
| | | //} |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»»å¡ç¶æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent UpdateTaskInfo(WCSTaskDTO task) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task wmsTask = BaseDal.QueryFirst(x=>x.TaskNum == task.TaskNum); |
| | | if (wmsTask != null) |
| | | { |
| | | wmsTask.TaskStatus = task.TaskState; |
| | | wmsTask.CurrentAddress = task.CurrentAddress; |
| | | wmsTask.NextAddress = task.NextAddress; |
| | | wmsTask.Dispatchertime = task.Dispatchertime; |
| | | BaseDal.UpdateData(wmsTask); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public PalletCodeInfoController(IPalletCodeInfoService service) : base(service) |
| | | { |
| | | } |
| | | [HttpPost,Route("PrintStatusUp")] |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="warehouseId"></param> |
| | | /// <param name="count"></param> |
| | | /// <param name="palletTypeId"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AddPalletCodeData")] |
| | | public WebResponseContent AddData(int warehouseId, int count, int palletTypeId) |
| | | { |
| | | return Service.AddData(warehouseId, count, palletTypeId); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="printCode"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("PrintStatusUp")] |
| | | public WebResponseContent PrintStatusUp(string printCode) |
| | | { |
| | | return Service.PrintStatusUp(printCode); |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public WarehouseController(IWarehouseService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ç¨æ·è·åä»åºåå
¸ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("GetWarehouseDicByUser")] |
| | | public WebResponseContent GetWarehouseDicByUser() |
| | | { |
| | | return Service.GetWarehouseDicByUser(); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="palletCode"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("MaterialPick"), AllowAnonymous] |
| | | [HttpPost, HttpGet, Route("MaterialPick")] |
| | | public WebResponseContent MaterialPick(string palletCode) |
| | | { |
| | | return Service.MaterialPick(palletCode); |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | /// <param name="roadwayNos"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("AssignRoadway"), AllowAnonymous] |
| | | public WebResponseContent AssignRoadway(int taskNum, [FromBody]List<string> roadwayNos) |
| | | public WebResponseContent AssignRoadway(int taskNum, [FromBody] List<string> roadwayNos) |
| | | { |
| | | return Service.AssignRoadway(taskNum, roadwayNos); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ä»»å¡ç¶æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("UpdateTaskInfo"), AllowAnonymous] |
| | | public WebResponseContent UpdateTaskInfo([FromBody] WCSTaskDTO task) |
| | | { |
| | | return Service.UpdateTaskInfo(task); |
| | | } |
| | | } |
| | | } |
| | |
| | | builder.Services.AddWebSocketSetup(); |
| | | builder.Services.AddSqlsugarSetup();//SqlSugar å¯å¨æå¡ |
| | | builder.Services.AddDbSetup();//Db å¯å¨æå¡ |
| | | builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | //builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | builder.Services.AddHostedService<PermissionDataHostService>();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |