12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using SqlSugar;
- using WMS.Util;
- using WMS.Info;
- namespace WMS.Core
- {
- public class WareaOffGetBLL : IBLL
- {
- public string InJsonData { get; set; }
- public object OutObjData { get; set; }
- public string SuccessMsg { get; set; } = "获取离线未锁定区域成功。";
- public LoginUserInfo LoginUser { get; set; }
- public string BLLDesc { get; private set; } = "获取离线未锁定区域";
- public void Exec()
- {
- try
- {
- var Ctx = SysDbCore.GetDbCtx();
- var wwlist = Ctx.Queryable<BASE_WAREHOUSE, BASE_WAREA>((w, wa) => new object[] { JoinType.Left, w.F_NO == wa.F_WAREHOUSENO })
- .Where((w, wa) => w.F_TYPENUM == (int)EWarehouseType.OfflineRFWarehouse && w.F_ISSTOP <= 0 && w.F_ISDELETE <= 0 && wa.F_ISSTOP <= 0 && wa.F_ISDELETE <= 0)
- .Select((w, wa) => new WareaOffInfo
- {
- WareaName = wa.F_NAME,
- WareaNo = wa.F_NO,
- WarehouseName = w.F_NAME,
- WarehouseNo = w.F_NO,
- WarehouseTypeNum = w.F_TYPENUM
- }).ToList();
- var waslist = Ctx.Queryable<ACL_USERTOKEN>().Where(it => it.F_APPTYPENUM == (int)EAppType.OffLineRF).ToList();
- if (waslist != null && waslist.Count > 0)
- {
- foreach (var w in waslist)
- {
- if (string.IsNullOrWhiteSpace(w.F_WAREANOLIST))
- continue;
- List<string> wlist = w.F_WAREANOLIST.ToObject<List<string>>();
- wwlist.RemoveAll(a => wlist.Contains(a.WareaNo));
- }
- }
- OutObjData = wwlist;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- }
- }
|