| | |
| | | { |
| | | if (!input.Code.IsNullOrEmpty()) |
| | | { |
| | | Biz.Db.Deleteable<WMS_ITEM_POOL>().Where(q => CurPoolList.Select(q => q.SN).Contains(q.SN)).ExecuteCommand(); |
| | | Biz.Db.Deleteable<WMS_ITEM_POOL>().Where(q => q.TRANS_CODE == req.BILLCODE).ExecuteCommand(); |
| | | //如果上一次推荐有数据,则先灭掉亮的灯 |
| | | if (Suggests.Any()) |
| | | { |
| | |
| | | Suggests.RemoveAll(q => q.poolItem.IsNullOrEmpty()); |
| | | |
| | | //保存物料池到数据库 |
| | | var db = Biz.Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Deleteable<WMS_ITEM_POOL>().Where(q => q.TRANS_CODE == req.BILLCODE).ExecuteCommand(); |
| | | db.Insertable(CurPoolList).ExecuteCommand(); |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | | throw dbTran.ErrorException; |
| | | } |
| | | Biz.Db.Insertable(CurPoolList).ExecuteCommand(); |
| | | action = await LightAll(new() { AuthOption = input.AuthOption, ReqType = ReqType.IsWhole, Color = LedColor.Blue,ItemCode = input.Code }); |
| | | } |
| | | } |
| | |
| | | //} |
| | | var MaxDC = CurPoolList.Any(x => x.ITEM_CODE == CurInv.ItemInfo.ITEM_CODE) ? CurPoolList.Where(x => x.ITEM_CODE == CurInv.ItemInfo.ITEM_CODE).Max(t => t.PROD_DATE) : DateTime.MinValue; |
| | | //判断系统参数是否设置先进先出 |
| | | if (Biz.SysParam["YesOrNo"].PARAM_VALUE == "Y") |
| | | if (Cache.SysParam["YesOrNo"].PARAM_VALUE == "Y") |
| | | { |
| | | if (CurInv.Items.Max(x => x.PROD_DATE).Date > MaxDC.Date) |
| | | { |
| | |
| | | } |
| | | |
| | | //发送到MES |
| | | var isSend = Biz.SysParam["IsSend", "SendToMES"].PARAM_VALUE.ToString() == "Y"; |
| | | var isSend = Cache.SysParam["IsSend", "SendToMES"].PARAM_VALUE.ToString() == "Y"; |
| | | if (isSend && !isCutting) |
| | | { |
| | | var mesApi = _factory != null ? _factory.MES_API : Biz.SysParam["apiUrl", "SendToMES"].PARAM_VALUE.ToString(); |
| | | var mesApi = _factory != null ? _factory.MES_API : Cache.SysParam["apiUrl", "SendToMES"].PARAM_VALUE.ToString(); |
| | | var response = HttpHelper.PostAsync(mesApi, JsonConvert.SerializeObject(toMes)).Result; |
| | | var _action = JsonConvert.DeserializeObject<ApiAction>(response.Message); |
| | | Logger.Interface.Info($"工单领料 =>发料完成,单号[{req.BILLCODE}],条码[{CurInv.SN}],状态[{req.STATUS.GetEnumDesc<BIZ_ERP_PROD_OUT.STATUSs>()}],MES返回:{response.Message}"); |