已删除9个文件
已修改26个文件
已添加16个文件
已重命名1个文件
| | |
| | | deviceCode: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | createDate:"", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | |
| | | type: "select", |
| | | dataKey: "deviceStatus", |
| | | data: [], |
| | | },{ |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | }, |
| | | ], |
| | | ]); |
| | |
| | | public interface ISys_MenuService : IService<Sys_Menu> |
| | | { |
| | | object GetCurrentMenuActionList(); |
| | | object GetMenuActionList(int roleId); |
| | | |
| | | |
| | | List<Sys_Menu> GetUserMenuList(int roleId); |
| | | |
| | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_Core.Caches; |
| | | using WIDESEAWCS_QuartzJob.DeviceEnum; |
| | | |
| | | namespace WIDESEAWCS_WCSServer.Controllers.System |
| | | { |
| | |
| | | { |
| | | Type type = typeof(IDevice); |
| | | var basePath = AppContext.BaseDirectory; |
| | | string path = Path.Combine(basePath, Assembly.GetExecutingAssembly().GetName().Name); |
| | | Assembly assembly = Assembly.LoadFrom(path); |
| | | //string path = Path.Combine("", Assembly.GetAssembly(type).GetName()); |
| | | Assembly assembly = Assembly.GetAssembly(type); |
| | | List<Type> types = assembly.GetTypes().Where(x => type.IsAssignableFrom(x) && !x.IsAbstract && !x.IsInterface).ToList(); |
| | | List<object> data = new List<object>(); |
| | | foreach (var deviceType in types) |
| | |
| | | case "deviceStatus": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = Type.GetType("WIDESEAWCS_QuartzJob.DeviceEnum.DeviceStatusEnum"); |
| | | Type type = typeof(DeviceStatusEnum); |
| | | List<int> enums = Enum.GetValues(type).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = type.GetField((item).ToString()); |
| | | FieldInfo? fieldInfo = type.GetField(((DeviceStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | |
| | | builder.Services.AddAllOptionRegister();//读åé
ç½®æä»¶ |
| | | builder.Services.AddMemoryCacheSetup();//ç¼å |
| | | builder.Services.AddSqlsugarSetup();//SqlSugar å¯å¨æå¡ |
| | | builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | //builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | builder.Services.AddDbSetup();//Db å¯å¨æå¡ |
| | | |
| | | builder.Services.AddScoped<QuartzJobCreateDataTabel>(); |
| | |
| | | using WIDESEAWCS_ISystemRepository; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | | using System.Net; |
| | | using WIDESEAWCS_Core.Caches; |
| | | |
| | | namespace WIDESEAWCS_SystemServices |
| | | { |
| | | public class Sys_UserService : ServiceBase<Sys_User, ISys_UserRepository>, ISys_UserService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage) : base(repository) |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ISys_MenuService _menuService; |
| | | public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService) : base(repository) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _cacheService = cacheService; |
| | | _menuService = menuService; |
| | | } |
| | | |
| | | public WebResponseContent Login(LoginInfo loginInfo) |
| | |
| | | UserInfo user = BaseDal.GetUserInfo(loginInfo.UserName, loginInfo.Password); |
| | | if (user != null) |
| | | { |
| | | object obj = _menuService.GetMenuActionList(user.RoleId); |
| | | if (obj is not IEnumerable<object> list) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ ç»å½æé"); |
| | | } |
| | | if (!list.Any()) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ ç»å½æé"); |
| | | } |
| | | |
| | | string token = JwtHelper.IssueJwt(new TokenModelJwt() |
| | | { |
| | | UserId = user.UserId, |
| | |
| | | TenantId = user.TenantId, |
| | | }); |
| | | |
| | | _cacheService.AddOrUpdate(user.UserId.ToString(), token); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: new { token, userName = user.UserTrueName, img = user.HeadImageUrl }); |
| | | } |
| | | else |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | let enableBtn = this.buttons.find(x => x.value == 'Enable'); |
| | | if (enableBtn) { |
| | | enableBtn.onClick = function () { |
| | | this.$message.success('èªå®ä¹æé®ç¹å»äºä»¶'); |
| | | } |
| | | } |
| | | let disableBtn = this.buttons.find(x => x.value == 'Disable'); |
| | | if (disableBtn) { |
| | | disableBtn.onClick = function () { |
| | | this.$message.success('èªå®ä¹æé®ç¹å»äºä»¶'); |
| | | } |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | |
| | | path: '/materielInfo', |
| | | name: 'materielInfo', |
| | | component: () => import('@/views/basic/materielInfo.vue') |
| | | }, { |
| | | }, |
| | | { |
| | | path: '/cachePoint', |
| | | name: 'cachePoint', |
| | | component: () => import('@/views/basic/cachePoint.vue') |
| | | }, |
| | | { |
| | | path: '/roadwayInfo', |
| | | name: 'roadwayInfo', |
| | | component: () => import('@/views/basic/roadwayInfo.vue') |
| | |
| | | path: '/stockView', |
| | | name: 'stockView', |
| | | component: () => import('@/views/stock/stockView.vue') |
| | | },{ |
| | | path: '/StockQuantityChangeRecord', |
| | | name: 'StockQuantityChangeRecord', |
| | | component: () => import('@/views/record/stockQuantityChangeRecord.vue') |
| | | },{ |
| | | path: '/locationStatusChangeRecord', |
| | | name: 'locationStatusChangeRecord', |
| | | component: () => import('@/views/record/locationStatusChangeRecord.vue') |
| | | }] |
| | | |
| | | export default viewgird |
| | |
| | | const editFormFields = ref({ |
| | | areaCode: "", |
| | | areaName: "", |
| | | areaType: "", |
| | | areaStatus: "", |
| | | |
| | | warehouseId: "", |
| | | areaDes: "", |
| | | }); |
| | |
| | | title: "åºåæè¿°", |
| | | field: "areaDes", |
| | | type: "textarea", |
| | | },{ title: "åºåç¶æ", field: "areaStatus" ,type: "select",dataKey: "enableEnum",data: [],}, |
| | | ], |
| | | [ |
| | | { |
| | | title: "åºåç±»å", |
| | | required: true, |
| | | field: "areaType", |
| | | type: "int", |
| | | }, |
| | | ], |
| | | ]); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/basic/CachePoint.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "ç¼åç¹", |
| | | name: "CachePoint", |
| | | url: "/CachePoint/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | areaId: "", |
| | | pointCode: "", |
| | | pointStatus: "", |
| | | enableStatus: "", |
| | | pointType: "", |
| | | row: "", |
| | | column: "", |
| | | depth: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | {title: "åºå主é®",required: true,field: "areaId",type: "string",}, |
| | | {title: "ç¼åç¹ç¼å·",required: true,field: "pointCode",type: "string",}, |
| | | {title: "ç¼åç¹ç¶æ",field: "pointStatus",type: "select",dataKey: "locationStatusEnum",data: [],}, |
| | | {title: "æ¯å¦ç¦ç¨",field: "enableStatus",type: "select",dataKey: "enableEnum",data: [],}, |
| | | ],[ |
| | | { title: "è¡", field: "row", type: "string" }, |
| | | { title: "å", field: "column", type: "string" }, |
| | | { title: "深度", field: "depth", type: "string" }, |
| | | { title: "ç¼åç¹ç±»å", field: "pointType", type: "string"}, |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | areaId: "", |
| | | pointCode: "", |
| | | pointStatus: "", |
| | | enableStatus: "", |
| | | pointType: "", |
| | | row: "", |
| | | column: "", |
| | | depth: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | {title: "åºå主é®",field: "areaId",type: "string",}, |
| | | {title: "ç¼åç¹ç¼å·",field: "pointCode",type: "string",}, |
| | | {title: "ç¼åç¹ç¶æ",field: "pointStatus",type: "select",dataKey: "locationStatusEnum",data: [],}, |
| | | {title: "æ¯å¦ç¦ç¨",field: "enableStatus",type: "select",dataKey: "enableEnum",data: [],}, |
| | | ],[ |
| | | { title: "è¡", field: "row", type: "string" }, |
| | | { title: "å", field: "column", type: "string" }, |
| | | { title: "深度", field: "depth", type: "string" }, |
| | | { title: "ç¼åç¹ç±»å", field: "pointType", type: "string"}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "areaId", |
| | | title: "åºå主é®", |
| | | type: "int", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "pointCode", |
| | | title: "ç¼åç¹ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "pointStatus", |
| | | title: "ç¼åç¹ç¶æ", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "locationStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "enableStatus", |
| | | title: "æ¯å¦ç¦ç¨", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "enableEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "row", |
| | | title: "è¡", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "column", |
| | | title: "å", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "depth", |
| | | title: "深度", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "pointType", |
| | | title: "ç¼åç¹ç±»å", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "Remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | locationCode: "", |
| | | orderNo: "", |
| | | taskNum: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "设å¤ç¼å·", field: "deviceCode" }, |
| | | { title: "设å¤ç±»å", field: "deviceType" }, |
| | | { title: "设å¤ç¶æ", field: "deviceStatus" }, |
| | | { title: "è´§ä½å·", field: "locationCode" }, |
| | | { title: "åæ®ç¼å·", field: "orderNo" }, |
| | | { title: "ä»»å¡å·", field: "taskNum" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | bind: { key: "locationStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "afterStatus", |
| | |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "locationStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "changeType", |
| | | title: "åå¨ç±»å", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "stockChangeType", data: [] }, |
| | | }, |
| | | { |
| | | field: "orderId", |
| | |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceName: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | deviceIp: "", |
| | | devicePort: "", |
| | | devicePlcType: "", |
| | | deviceRemark: "", |
| | | |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "设å¤ç¼å·", |
| | | required: true, |
| | | field: "deviceCode", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤åç§°", |
| | | required: true, |
| | | field: "deviceName", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤ç±»å", |
| | | required: true, |
| | | field: "deviceType", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤ç¶æ", |
| | | required: true, |
| | | field: "deviceStatus", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "设å¤IP", required: true, field: "deviceIp", type: "string" }, |
| | | { |
| | | title: "设å¤ç«¯å£", |
| | | required: true, |
| | | field: "devicePort", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "PLCç±»å", |
| | | required: true, |
| | | field: "devicePlcType", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "夿³¨", |
| | | field: "deviceRemark", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | palleCode: "", |
| | | materielCode: "", |
| | | orderNo: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "设å¤ç¼å·", field: "deviceCode" }, |
| | | { title: "设å¤ç±»å", field: "deviceType" }, |
| | | { title: "设å¤ç¶æ", field: "deviceStatus" }, |
| | | { title: "æçå·", field: "palleCode" }, |
| | | { title: "ç©æç¼å·", field: "materielCode" }, |
| | | { title: "åæ®ç¼å·", field: "orderNo" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "stockChangeType", data: [] }, |
| | | }, |
| | | { |
| | | field: "changeQuantity", |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "设å¤ç¼å·", |
| | | title: "ç©æç¼å·", |
| | | required: true, |
| | | field: "deviceCode", |
| | | field: "materielCode", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤åç§°", |
| | | title: "åæ®ç¼å·", |
| | | required: true, |
| | | field: "deviceName", |
| | | field: "materielName", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤ç±»å", |
| | | title: "æ¹æ¬¡å·", |
| | | required: true, |
| | | field: "deviceType", |
| | | field: "orderNo", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "设å¤ç¶æ", |
| | | title: "åºåå·", |
| | | required: true, |
| | | field: "deviceStatus", |
| | | field: "serialNumber", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "设å¤IP", required: true, field: "deviceIp", type: "string" }, |
| | | { |
| | | title: "设å¤ç«¯å£", |
| | | required: true, |
| | | field: "devicePort", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "PLCç±»å", |
| | | required: true, |
| | | field: "devicePlcType", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "夿³¨", |
| | | field: "deviceRemark", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | deviceCode: "", |
| | | deviceType: "", |
| | | deviceStatus: "", |
| | | materielCode: "", |
| | | materielName: "", |
| | | orderNo: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "设å¤ç¼å·", field: "deviceCode" }, |
| | | { title: "设å¤ç±»å", field: "deviceType" }, |
| | | { title: "设å¤ç¶æ", field: "deviceStatus" }, |
| | | { title: "ç©æç¼å·", field: "materielCode" }, |
| | | { title: "ç©æåç§°", field: "materielName" }, |
| | | { title: "åæ®ç¼å·", field: "orderNo" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "outStockStatus", data: [] }, |
| | | }, |
| | | { |
| | | field: "creater", |
| | |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "operateType", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | |
| | | using SqlSugar; |
| | | using AutoMapper; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IRecordService; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | { |
| | | public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService |
| | | { |
| | | |
| | | private readonly IRecordService _recordService; |
| | | public LocationInfoService(ILocationInfoRepository BaseDal, IBasicRepository basicRepository, IRecordService recordService) : base(BaseDal) |
| | | { |
| | | _basicRepository = basicRepository; |
| | | _recordService = recordService; |
| | | } |
| | | private Dictionary<string, OrderByType> _emptyAssignOrderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | | { nameof(Dt_LocationInfo.Depth), OrderByType.Desc }, |
| | |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | public virtual Dt_LocationInfo? AssignLocation(string RoadwayNo) |
| | | { |
| | | return StoredAssignLocation(RoadwayNo); |
| | | } |
| | | |
| | | private Dt_LocationInfo EmptyAssignLocation(string roadway) |
| | |
| | | { |
| | | return BaseDal.QueryFirst(x => x.RoadwayNo == locationInfo.RoadwayNo && x.Column == locationInfo.Column && x.Layer == locationInfo.Layer && x.Depth != locationInfo.Depth && x.Row != locationInfo.Row && (SqlFunc.Abs(x.Row - locationInfo.Row) == 1)); |
| | | } |
| | | public void UpdateLocationLock(Dt_LocationInfo locationInfo, int? TaskNum) |
| | | { |
| | | try |
| | | { |
| | | if (locationInfo.Depth == 2) |
| | | { |
| | | Dt_LocationInfo dt_LocationInfo = null; |
| | | int beforeStatus = 0; |
| | | if (locationInfo.Row == 1 || locationInfo.Row == 5) |
| | | { |
| | | dt_LocationInfo = BaseDal.QueryFirst(x => x.Row == locationInfo.Row + 1 && x.Layer == locationInfo.Layer && x.Column == locationInfo.Column && x.RoadwayNo == locationInfo.RoadwayNo); |
| | | beforeStatus = dt_LocationInfo.LocationStatus; |
| | | if (dt_LocationInfo != null && dt_LocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | dt_LocationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | BaseDal.UpdateData(dt_LocationInfo); |
| | | } |
| | | } |
| | | else if (locationInfo.Row == 4 || locationInfo.Row == 8) |
| | | { |
| | | dt_LocationInfo = BaseDal.QueryFirst(x => x.Row == locationInfo.Row + 1 && x.Layer == locationInfo.Layer && x.Column == locationInfo.Column && x.RoadwayNo == locationInfo.RoadwayNo); |
| | | beforeStatus = dt_LocationInfo.LocationStatus; |
| | | if (dt_LocationInfo != null && dt_LocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | dt_LocationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | BaseDal.UpdateData(dt_LocationInfo); |
| | | } |
| | | } |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Lock.ObjToInt(), "", TaskNum); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | |
| | | } |
| | | public void UpdateLocationFree(Dt_LocationInfo locationInfo, int? TaskNum) |
| | | { |
| | | try |
| | | { |
| | | if (locationInfo.Depth == 2) |
| | | { |
| | | Dt_LocationInfo dt_LocationInfo = null; |
| | | int beforeStatus = 0; |
| | | if (locationInfo.Row == 1 || locationInfo.Row == 5) |
| | | { |
| | | dt_LocationInfo = BaseDal.QueryFirst(x => x.Row == locationInfo.Row + 1 && x.Layer == locationInfo.Layer && x.Column == locationInfo.Column && x.RoadwayNo == locationInfo.RoadwayNo); |
| | | beforeStatus = dt_LocationInfo.LocationStatus; |
| | | if (dt_LocationInfo != null && dt_LocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | dt_LocationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | BaseDal.UpdateData(dt_LocationInfo); |
| | | } |
| | | } |
| | | else if (locationInfo.Row == 4 || locationInfo.Row == 8) |
| | | { |
| | | dt_LocationInfo = BaseDal.QueryFirst(x => x.Row == locationInfo.Row + 1 && x.Layer == locationInfo.Layer && x.Column == locationInfo.Column && x.RoadwayNo == locationInfo.RoadwayNo); |
| | | beforeStatus = dt_LocationInfo.LocationStatus; |
| | | if (dt_LocationInfo != null && dt_LocationInfo.LocationStatus != LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | dt_LocationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | BaseDal.UpdateData(dt_LocationInfo); |
| | | } |
| | | } |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(dt_LocationInfo, beforeStatus, StockChangeType.Lock.ObjToInt(), "", TaskNum); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | |
| | | } |
| | | public Dt_LocationInfo isDepth(Dt_LocationInfo locationInfo) |
| | | { |
| | | if (locationInfo.Depth == 2) |
| | | { |
| | | if (locationInfo.Row == 1 || locationInfo.Row == 5) |
| | | { |
| | | Dt_LocationInfo dt_LocationInfo = BaseDal.QueryFirst(x => x.Row == locationInfo.Row + 1 && x.Layer == locationInfo.Layer && x.Column == locationInfo.Column && x.RoadwayNo == locationInfo.RoadwayNo); |
| | | if (dt_LocationInfo != null&& dt_LocationInfo.LocationStatus==LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | return dt_LocationInfo; |
| | | } |
| | | } |
| | | else if (locationInfo.Row == 4 || locationInfo.Row == 8) |
| | | { |
| | | Dt_LocationInfo dt_LocationInfo = BaseDal.QueryFirst(x => x.Row == locationInfo.Row + 1 && x.Layer == locationInfo.Layer && x.Column == locationInfo.Column && x.RoadwayNo == locationInfo.RoadwayNo); |
| | | if (dt_LocationInfo != null && dt_LocationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | return dt_LocationInfo; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public void RelocationLock(Dt_LocationInfo locationInfo, Dt_LocationInfo locationInfos,int TaskNum) |
| | | { |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | int beforeStatu = locationInfos.LocationStatus; |
| | | |
| | | locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | locationInfos.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | |
| | | BaseDal.UpdateData(locationInfo); |
| | | |
| | | BaseDal.UpdateData(locationInfos); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Relocation.ObjToInt(), "", TaskNum); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, beforeStatu, StockChangeType.Relocation.ObjToInt(), "", TaskNum); |
| | | } |
| | | public void RelocationFree(Dt_LocationInfo locationInfo, Dt_LocationInfo locationInfos, int TaskNum) |
| | | { |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | int beforeStatu = locationInfos.LocationStatus; |
| | | |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | locationInfos.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | |
| | | BaseDal.UpdateData(locationInfo); |
| | | BaseDal.UpdateData(locationInfos); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Relocation.ObjToInt(), "", TaskNum); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, beforeStatu, StockChangeType.Relocation.ObjToInt(), "", TaskNum); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" /> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | [Description("æè´§")] |
| | | InStock = 2, |
| | | |
| | | |
| | | /// <summary> |
| | | /// 空æéå® |
| | | /// </summary> |
| | | [Description("空æéå®")] |
| | | PalletLock = 98, |
| | | |
| | | /// <summary> |
| | | /// 空æç |
| | | /// </summary> |
| | | [Description("空æç")] |
| | | Pallet = 99 |
| | | } |
| | |
| | | /// <summary> |
| | | /// ç»ç |
| | | /// </summary> |
| | | [Description("")] |
| | | [Description("ç»ç")] |
| | | MaterielGroup, |
| | | |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("")] |
| | | [Description("å
¥åº")] |
| | | Inbound, |
| | | |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | [Description("")] |
| | | [Description("åºåº")] |
| | | Outbound, |
| | | /// <summary> |
| | | /// ç§»åº |
| | | /// </summary> |
| | | [Description("ç§»åº")] |
| | | Relocation, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºéå® |
| | | /// </summary> |
| | | [Description("éå®")] |
| | | Lock, |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | [Description("åºåºå®æ")] |
| | | åºåºå®æ = 8, |
| | | |
| | | [Description("ç§»åºéå®")] |
| | | ç§»åºéå® = 9, |
| | | } |
| | | |
| | | public enum OutStockStatus |
| | |
| | | InException = 299, |
| | | |
| | | /// <summary> |
| | | /// æ°å»ºç§»åºåºä»»å¡ |
| | | /// æ°å»ºç§»åºä»»å¡ |
| | | /// </summary> |
| | | [Description("æ°å»ºç§»åºåºä»»å¡")] |
| | | RelocationNew = 300 |
| | | [Description("æ°å»ºç§»åºä»»å¡")] |
| | | RelocationNew = 300, |
| | | |
| | | /// <summary> |
| | | /// ç§»åºä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("ç§»åºä»»å¡å®æ")] |
| | | RelocationFinish = 310, |
| | | } |
| | | |
| | | #endregion å
¥åºä»»å¡ç¶æ |
| | |
| | | Dt_LocationInfo AdjacentDepthLocation(string locationCode); |
| | | |
| | | Dt_LocationInfo? AssignLocation(string stationCode, int inboundType); |
| | | Dt_LocationInfo? AssignLocation(string RoadwayNo); |
| | | void UpdateLocationLock(Dt_LocationInfo locationInfo,int? taskNum); |
| | | void UpdateLocationFree(Dt_LocationInfo locationInfo, int? taskNum); |
| | | Dt_LocationInfo isDepth(Dt_LocationInfo locationInfo); |
| | | void RelocationLock(Dt_LocationInfo locationInfo, Dt_LocationInfo locationInfos,int TaskNum); |
| | | void RelocationFree(Dt_LocationInfo locationInfo, Dt_LocationInfo locationInfos, int TaskNum); |
| | | |
| | | WebResponseContent LocationEnableStatus(int[] keys); |
| | | |
| | |
| | | [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "åºåç¶æ")] |
| | | public int AreaStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "åºåæè¿°")] |
| | | [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "åºåæè¿°")] |
| | | public string AreaDes { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "夿³¨")] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_InboundOrderDetail_Hty), "å
¥åºåæç»")] |
| | | public class Dt_InboundOrderDetail_Hty : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "å
¥åºå主é®")] |
| | | public int OrderId { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "ç©æåç§°")] |
| | | public string MaterielName { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "æ¹æ¬¡å·")] |
| | | public string BatchNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "åæ®æ°é")] |
| | | public decimal OrderQuantity { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "ç»çæ°é", DefaultValue = "0")] |
| | | public decimal ReceiptQuantity { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "䏿¶æ°é", DefaultValue = "0")] |
| | | public decimal OverInQuantity { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "订åæç»ç¶æ")] |
| | | public int OrderDetailStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_InboundOrder_Hty), "å
¥åºå")] |
| | | public class Dt_InboundOrder_Hty : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [CodeRule(WIDESEA_Core.Enums.RuleCode.InboundOrderRule)] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | | public string OrderNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "䏿¸¸åæ®ç¼å·")] |
| | | public string UpperOrderNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®ç±»å")] |
| | | public int OrderType { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®ç¶æ")] |
| | | public int OrderStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "å建æ¹å¼")] |
| | | public int CreateType { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_InboundOrderDetail_Hty.OrderId), nameof(Id))] |
| | | public List<Dt_InboundOrderDetail_Hty> Details { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_OutboundOrderDetail_Hty), "åºåºåæç»")] |
| | | public class Dt_OutboundOrderDetail_Hty : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºåºå主é®")] |
| | | public int OrderId { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼å·")] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "ç©æåç§°")] |
| | | public string MaterielName { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "æ¹æ¬¡å·")] |
| | | public string BatchNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "åæ®æ°é")] |
| | | public decimal OrderQuantity { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "é宿°é", DefaultValue = "0")] |
| | | public decimal LockQuantity { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "å·²åºæ°é", DefaultValue = "0")] |
| | | public decimal OverOutQuantity { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "订åæç»ç¶æ")] |
| | | public int OrderDetailStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_OutboundOrder_Hty), "åºåºå")] |
| | | public class Dt_OutboundOrder_Hty : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [CodeRule(WIDESEA_Core.Enums.RuleCode.OutboundOrderRule)] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·", IsOnlyIgnoreUpdate = true)] |
| | | public string OrderNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "䏿¸¸åæ®ç¼å·", IsOnlyIgnoreUpdate = true)] |
| | | public string UpperOrderNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®ç±»å", IsOnlyIgnoreUpdate = true)] |
| | | public int OrderType { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åæ®ç¶æ")] |
| | | public int OrderStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "å建æ¹å¼", IsOnlyIgnoreUpdate = true)] |
| | | public int CreateType { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_OutboundOrderDetail_Hty.OrderId), nameof(Id))] |
| | | public List<Dt_OutboundOrderDetail_Hty> Details { get; set; } |
| | | } |
| | | } |
| | |
| | | public string NextAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸ä¿¡æ¯ |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "åæ®ç¼å·")] |
| | | [ExporterHeader(DisplayName = "åæ®ç¼å·")] |
| | |
| | | if (stockInfo.Id == 0) |
| | | { |
| | | BaseDal.Db.InsertNav(stockInfo).Include(x => x.Details).ExecuteCommand(); |
| | | //stockQuantityChangeRecords = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(stockInfo.Details); |
| | | //stockQuantityChangeRecords.ForEach(x => |
| | | //{ |
| | | // x.PalleCode = stockInfo.PalletCode; |
| | | // x.BeforeQuantity = 0; |
| | | // x.ChangeQuantity = x.AfterQuantity - x.BeforeQuantity; |
| | | // x.ChangeType = StockChangeType.MaterielGroup.ObjToInt(); |
| | | //}); |
| | | details = stockInfo.Details; |
| | | } |
| | | else |
| | |
| | | |
| | | } |
| | | |
| | | //stockQuantityChangeRecords = _mapper.Map<List<Dt_StockQuantityChangeRecord>>(stockInfo.Details); |
| | | //int index = 0; |
| | | //stockQuantityChangeRecords.ForEach(x => |
| | | //{ |
| | | // x.PalleCode = stockInfo.PalletCode; |
| | | // x.BeforeQuantity = 0; |
| | | // x.ChangeQuantity = x.AfterQuantity - x.BeforeQuantity; |
| | | // x.ChangeType = StockChangeType.MaterielGroup.ObjToInt(); |
| | | // x.StockDetailId = |
| | | // index++; |
| | | //}); |
| | | } |
| | | //_stockQuantityChangeRecordRepository.AddData(stockQuantityChangeRecords); |
| | | stockInfo.Details = details; |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.MaterielGroup); |
| | | } |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "stockChangeType": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(StockChangeType); |
| | | List<int> enums = Enum.GetValues(typeof(StockChangeType)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(StockChangeType).GetField(((StockChangeType)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "outStockStatus": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(OutStockStatus); |
| | | List<int> enums = Enum.GetValues(typeof(OutStockStatus)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(OutStockStatus).GetField(((OutStockStatus)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | |
| | | public int GetTaskNum(string sequenceName) |
| | | { |
| | | return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt(); |
| | | //return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt(); |
| | | return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR GetTaskNum").ObjToInt(); |
| | | } |
| | | |
| | | public override int AddData(Dt_Task entity) |
| | |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Core.Helper; |
| | | using Microsoft.Extensions.Logging; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | try |
| | | { |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType); |
| | | //Dt_LocationInfo dt_LocationInfo = null; |
| | | if (locationInfo != null) |
| | | { |
| | | Dt_Task task = new() |
| | |
| | | if (isUpdateStock) |
| | | { |
| | | locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationLock(locationInfo,task.TaskNum); |
| | | |
| | | if (stockInfo != null && stockInfo.Details != null && stockInfo.Details.Count > 0) |
| | | { |
| | | orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? ""; |
| | |
| | | } |
| | | } |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | //_basicService.LocationInfoService.Repository.UpdateData(dt_LocationInfo); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum); |
| | | |
| | | return content = WebResponseContent.Instance.OK(); |
| | |
| | | try |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | //å¤æç§»åº |
| | | /*List<Dt_Task> RelocationTasks = */ |
| | | RelocationTask(tasks); |
| | | //BaseDal.AddData(RelocationTasks); |
| | | |
| | | BaseDal.AddData(tasks); |
| | | if (stockInfos != null && outboundOrderDetails != null && outStockLockInfos != null && locationInfos != null) |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// ç§»åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RelocationTask(List<Dt_Task> task) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | for (int i = 0; i < task.Count; i++) |
| | | { |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task[i].SourceAddress && x.RoadwayNo == task[i].Roadway); |
| | | if (locationInfo != null) |
| | | { |
| | | Dt_LocationInfo location = _basicService.LocationInfoService.isDepth(locationInfo); |
| | | if (location != null) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == location.LocationCode); |
| | | if (stockInfo != null && location.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | Dt_LocationInfo? locationInfos = _basicService.LocationInfoService.AssignLocation(location.RoadwayNo); |
| | | if(locationInfos != null) |
| | | { |
| | | Dt_Task tasks = new() |
| | | { |
| | | CurrentAddress = location.LocationCode, |
| | | Grade = 0, |
| | | PalletCode = stockInfo.PalletCode, |
| | | NextAddress = locationInfos.LocationCode, |
| | | Roadway = location.RoadwayNo, |
| | | SourceAddress = location.LocationCode, |
| | | TargetAddress = locationInfos.LocationCode, |
| | | TaskStatus = InTaskStatusEnum.RelocationNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Relocation.ObjToInt(), |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)) |
| | | }; |
| | | BaseDal.AddData(tasks); |
| | | stockInfo.StockStatus = StockStatusEmun.ç§»åºéå®.ObjToInt(); |
| | | _stockService.StockInfoService.UpdateData(stockInfo); |
| | | _basicService.LocationInfoService.RelocationLock(location, locationInfos,tasks.TaskNum); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°å¯åé
è´§ä½"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°åºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error("ä»»å¡ä¿¡æ¯å¼å¸¸"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.PalletOutbound.ObjToInt(), |
| | | }; |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | BaseDal.AddData(task); |
| | | _stockService.StockInfoService.UpdateData(stockInfo); |
| | | |
| | | _basicService.LocationInfoService.UpdateLocationLock(locationInfo, task.TaskNum); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Relocation.ObjToInt(), "", task.TaskNum); |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | private readonly IRecordService _recordService; |
| | | private readonly IStockService _stockService; |
| | | private readonly ITask_HtyService _taskHtyService; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | |
| | | public ITaskRepository Repository => BaseDal; |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _recordService = recordService; |
| | | _stockService = stockService; |
| | | _taskHtyService = taskHtyService; |
| | | _locationInfoService = locationInfoService; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | public WebResponseContent InboundTaskCompleted(Dt_Task task) |
| | | { |
| | | decimal beforeQuantity = 0; |
| | | |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | beforeQuantity = stockInfo.Details.Where(x => x.Id != 0).Sum(x => x.StockQuantity); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt(); |
| | | //BaseDal.DeleteData(task); |
| | | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.Inbound); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt(); |
| | |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | task.TaskStatus = OutTaskStatusEnum.OutFinish.ObjToInt(); |
| | |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.UpdateLocationFree(locationInfo, task.TaskNum); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | task.TaskStatus = OutTaskStatusEnum.OutFinish.ObjToInt(); |
| | |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent RelocationTaskCompleted(Dt_Task task) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | |
| | | Dt_LocationInfo locationStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | Dt_LocationInfo locationEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | |
| | | CheckCompleted(stockInfo, locationStart); |
| | | |
| | | stockInfo.LocationCode = locationEnd.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | |
| | | |
| | | //locationStart.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.RelocationFree(locationStart, locationEnd, task.TaskNum); |
| | | //_basicService.LocationInfoService.Repository.UpdateData(locationStart); |
| | | |
| | | task.TaskStatus = InTaskStatusEnum.RelocationFinish.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Basic |
| | | { |
| | | [Route("api/CachePoint")] |
| | | [ApiController] |
| | | public class CachePointController : ApiBaseController<ICachePointService, Dt_CachePoint> |
| | | { |
| | | public CachePointController(ICachePointService service) : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "dics": "inOrderType,outOrderType,inboundState,createType,enableEnum,enableStatusEnum,locationStatusEnum,locationTypeEnum,taskTypeEnum,taskStatusEnum,outboundStatusEnum,orderDetailStatusEnum,stockStatusEmun", |
| | | "dics": "inOrderType,outOrderType,inboundState,createType,enableEnum,enableStatusEnum,locationStatusEnum,locationTypeEnum,taskTypeEnum,taskStatusEnum,outboundStatusEnum,orderDetailStatusEnum,stockStatusEmun,stockChangeType,outStockStatus", |
| | | "AllowedHosts": "*", |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |