| | |
| | | public class StockInfoRepository : RepositoryBase<Dt_StockInfo>, IStockInfoRepository |
| | | { |
| | | private readonly ILabelMasterRepository _labelMasterRepository; |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage,ILabelMasterRepository labelMasterRepository) : base(unitOfWorkManage) |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage, ILabelMasterRepository labelMasterRepository) : base(unitOfWorkManage) |
| | | { |
| | | _labelMasterRepository = labelMasterRepository; |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="materielCode"></param> |
| | | /// <returns></returns> |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode,string batchNo) |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, string batchNo) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode&&v.BatchNo==batchNo)).ToList(); |
| | | return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode && v.BatchNo == batchNo)).ToList(); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, List<string> locationCodes) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList(); |
| | | //ä¿®æ¹åªè·å已䏿¶ç¶æçåºå |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode) && x.StockStatus == (int)StockStatusEmun.已䏿¶).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList(); |
| | | |
| | | |
| | | //ISugarQueryable<Dt_LocationInfo> sugarQueryable = Db.Queryable<Dt_LocationInfo>().Where(x => locationCodes.Contains(x.LocationCode)); |
| | |
| | | |
| | | public List<Dt_StockInfo> GetStockInfosByPalletCodes(List<string> palletCodes) |
| | | { |
| | | |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => palletCodes.Contains(x.PalletCode)).Includes(x => x.Details).ToList(); |
| | | } |
| | | |
| | |
| | | { |
| | | //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode); |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.RoadwayNo == roadwayNo && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (EnableStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First(); |
| | | |
| | | |
| | | } |
| | | public Dt_StockInfo GetPalletStockInfo(string roadwayNo,string strayType) |
| | | public Dt_StockInfo GetPalletStockInfo(string roadwayNo, string strayType) |
| | | { |
| | | //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode); |
| | | if (strayType == "1") |
| | |
| | | stockItem.LGORT = "0030";//åºä½ |
| | | if (labelMaster != null) |
| | | { |
| | | if (labelMaster.WH_NUMBER == inventoryQueryRequest.DATA[0].WH_NUMBER && labelMaster.WERKS == inventoryQueryRequest.DATA[0].WH_NUMBER) |
| | | if (labelMaster.WH_NUMBER == inventoryQueryRequest.DATA[0].WH_NUMBER && labelMaster.WERKS == inventoryQueryRequest.DATA[0].WERKS) |
| | | { |
| | | stockItem.LIFNR = labelMaster.LIFNR; |
| | | stockItem.LIKTX = labelMaster.LIKTX; |
| | |
| | | stockItem.MATNR = labelMaster.MATNR; |
| | | stockItem.MEINS = labelMaster.UNIT; |
| | | stockItem.QTY = labelMaster.BOX_QTY; |
| | | stockItem.SOBKZ = labelMaster.SOBKZ; |
| | | var sobkz = "ééå¶"; |
| | | if (labelMaster.SOBKZ == "0") |
| | | { |
| | | sobkz = "ééå¶"; |
| | | } |
| | | else if (labelMaster.SOBKZ == "1") |
| | | { |
| | | sobkz = "å»ç»"; |
| | | } |
| | | else if (labelMaster.SOBKZ == "2") |
| | | { |
| | | sobkz = "å¾
è´¨æ£"; |
| | | } |
| | | stockItem.SOBKZ = sobkz; |
| | | stockItem.TPNUM = view.PalletCode; |
| | | stockItem.WERKS = labelMaster.WERKS;//å·¥å |
| | | stockItem.WH_NUMBER = labelMaster.WH_NUMBER;//ä»åºå· |
| | |
| | | /// </summary> |
| | | /// <param name="freezeByCustomerResponse"></param> |
| | | /// <returns></returns> |
| | | public freezeByCustomerResponse freezeByCustomer(string freezeRequeststr) |
| | | public freezeByCustomerResponse freezeByCustomer(string freezeRequeststr) |
| | | { |
| | | |
| | | |
| | | freezeByCustomerResponse freezeResponse = new freezeByCustomerResponse(); |
| | | try |
| | | { |
| | | freezeByCustomerRequest freezeRequest = JsonConvert.DeserializeObject<freezeByCustomerRequest>(freezeRequeststr); |
| | | if (freezeRequest.WERKS == AppSettings.Configuration["WERKS"] && freezeRequest.WH_NUMBER == AppSettings.Configuration["SYSNO"]) |
| | | if (freezeRequest.WERKS == AppSettings.Configuration["WERKS"] && freezeRequest.WH_NUMBER == AppSettings.Configuration["WERKS"]) |
| | | { |
| | | //æ ¹æ®æ¹æ¬¡åç©æå·æ¥æ¾å¯¹åºçæçå·ï¼å»ç»åºåï¼åªæå
¥åºæåäºï¼æè½è¢«å»ç» |
| | | List<Dt_StockInfo> stockInfos = GetStockInfos(freezeRequest.MATNR, freezeRequest.BATCH); |
| | | if (freezeRequest.FREEZE_TYPE == "00")//00å»ç» |
| | | |
| | | List<Dt_LabelMaster> labelInfos = _labelMasterRepository.QueryData(x => x.MATNR == freezeRequest.MATNR && x.BATCH == freezeRequest.BATCH); |
| | | if (freezeRequest.YWLX == "00")//00å»ç» |
| | | { |
| | | foreach (var item in stockInfos) |
| | | { |
| | |
| | | UpdateData(item); |
| | | } |
| | | } |
| | | |
| | | foreach (var li in labelInfos) |
| | | { |
| | | li.SOBKZ = "1"; |
| | | } |
| | | _labelMasterRepository.UpdateData(labelInfos); |
| | | |
| | | freezeResponse.MSGTY = "S"; |
| | | freezeResponse.MSGTX = ""; |
| | | } |
| | | else if (freezeRequest.FREEZE_TYPE == "01") //01è§£å» |
| | | else if (freezeRequest.YWLX == "01") //01è§£å» |
| | | { |
| | | foreach (var item in stockInfos) |
| | | { |
| | |
| | | UpdateData(item); |
| | | } |
| | | } |
| | | |
| | | foreach (var li in labelInfos) |
| | | { |
| | | //if (li.LABEL_STATUS == "01") |
| | | //{ |
| | | // li.SOBKZ = "2"; |
| | | //} |
| | | //else |
| | | //{ |
| | | li.SOBKZ = "0"; |
| | | //} |
| | | } |
| | | _labelMasterRepository.UpdateData(labelInfos); |
| | | |
| | | freezeResponse.MSGTY = "S"; |
| | | freezeResponse.MSGTX = ""; |
| | | |