| | |
| | | BILLLINE = item.sfdcseq, |
| | | UNITCODE = item.sfdc006, |
| | | ITEM_CODE = item.sfdc004, |
| | | PRQTY = Convert.ToDecimal(item.sfdc007), |
| | | PRQTY = Convert.ToDouble(item.sfdc007), |
| | | DELIVERYDATE = Convert.ToDateTime(item.sfdareqdt), |
| | | WAREHOUSECODE = item.sfdc012, |
| | | SOURCETYPE = Convert.ToInt32(item.sfdc003), |
| | |
| | | prd_d = prd_d ?? new BIZ_ERP_PROD_OUT_DTL() |
| | | { |
| | | LINESTATUS = BIZ_ERP_PROD_OUT.STATUSs.INIT.GetValue(), |
| | | QTY = Convert.ToDecimal(0), |
| | | QTY = Convert.ToDouble(0), |
| | | }; |
| | | prd_d.BILLCODE = item_d.BILLCODE; |
| | | prd_d.BILLLINE = item_d.BILLLINE; |
| | | prd_d.UNITCODE = item_d.UNITCODE; |
| | | prd_d.ITEM_CODE = item_d.ITEM_CODE; |
| | | prd_d.PRQTY = Convert.ToDecimal(item_d.PRQTY); |
| | | prd_d.PRQTY = Convert.ToDouble(item_d.PRQTY); |
| | | prd_d.DELIVERYDATE = Convert.ToDateTime(item_d.DELIVERYDATE); |
| | | prd_d.WAREHOUSECODE = item_d.WAREHOUSECODE; |
| | | prd_d.LINESTATUS = prd_d.PRQTY == prd_d.QTY ? BIZ_ERP_PROD_OUT.STATUSs.COMPLETE.GetValue() : Convert.ToDecimal(item_d.PRQTY) == 0 ? BIZ_ERP_PROD_OUT.STATUSs.COMPLETE.GetValue() : prd_d.LINESTATUS == BIZ_ERP_PROD_OUT.STATUSs.DELETE.GetValue() ? BIZ_ERP_PROD_OUT.STATUSs.INIT.GetValue() : prd_d.LINESTATUS; |
| | |
| | | entity_h.Add(prd_h); |
| | | list_dOld.AddRange(list_d); |
| | | //检查有没有调拨单,有就更新状态为完成 |
| | | var transferList = db.Queryable<BIZ_WMS_TRANSFER>().Where(s => s.SOURCECODE == prd_h.BILLCODE).ToList(); |
| | | var transferList = db.Queryable<BIZ_WMS_TRANSFER>().Where(s => s.SOURCE_ORDER == prd_h.BILLCODE).ToList(); |
| | | if (transferList.Any()) |
| | | { |
| | | foreach (var item in transferList) |
| | | { |
| | | item.STATUS = BIZ_WMS_TRANSFER.STATUSs.FINISHED.GetValue(); |
| | | item.SOURCECODE = prd_h.BILLCODE; |
| | | item.STATUS = BIZ_WMS_TRANSFER.STATUSs.Finished.GetValue(); |
| | | item.SOURCE_ORDER = prd_h.BILLCODE; |
| | | transferH.Add(item); |
| | | action.Message += $",领料单[{prd_h.BILLCODE}]对应调拨单[{item.BILLCODE}]完成"; |
| | | action.Message += $",领料单[{prd_h.BILLCODE}]对应调拨单[{item.ORDER_NO}]完成"; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | var action = new ApiAction<PageAble<BIZ_WMS_TRANSFER>>(); |
| | | var query = Biz.Db.Queryable<BIZ_WMS_TRANSFER>().Where(x => |
| | | (x.STATUS == BIZ_WMS_TRANSFER.STATUSs.INIT.GetValue() |
| | | || x.STATUS == BIZ_WMS_TRANSFER.STATUSs.MANUAL.GetValue() |
| | | || x.STATUS == BIZ_WMS_TRANSFER.STATUSs.WORKING.GetValue()) |
| | | (x.STATUS == BIZ_WMS_TRANSFER.STATUSs.Init.GetValue() |
| | | || x.STATUS == BIZ_WMS_TRANSFER.STATUSs.Imported.GetValue() |
| | | || x.STATUS == BIZ_WMS_TRANSFER.STATUSs.Storing.GetValue()) |
| | | && x.AUTH_ORG == orgcode) |
| | | .WhereIF(!billcode.IsNullOrEmpty(), x => x.BILLCODE.Contains(billcode)) |
| | | .WhereIF(!billcode.IsNullOrEmpty(), x => x.ORDER_NO.Contains(billcode)) |
| | | .OrderByDescending(x => x.UPDATE_TIME.ToString("yyyy-MM-dd")) |
| | | //.OrderBy(x => x.REMARK == "L40774" ? 0 : 1) |
| | | //.OrderBy(x => x.SOURCECODE == null ? 1 : 0) |
| | | .OrderByDescending(x => x.BILLDATE) |
| | | .OrderBy(x => new { x.CREATE_TIME, x.BILLCODE}) |
| | | .OrderByDescending(x => x.ORDER_DATE) |
| | | .OrderBy(x => new { x.CREATE_TIME, x.ORDER_NO}) |
| | | |
| | | //.OrderBy(x => x.CREATE_TIME) |
| | | .ToPage(pageIndex, pageSize); |