| | |
| | | |
| | | using HH.WCS.JiaTong.models.other; |
| | | using HH.WCS.JiaTong.util; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// <param name="prdData">到期时间</param> |
| | | /// <returns></returns> |
| | | internal static bool CreateCntrItem(string loc, string cntr, string itemcode, string itemname, string itemtype, string cntrtype, |
| | | string batch,string wmslot, string weight, string unit, string tyreType, string supplier, string receiveLot, string subpool, string expData = "", string prdData = "", string level = "") |
| | | string batch, string wmslot, string weight, string unit, string tyreType, string supplier, string receiveLot, string subpool, string expData = "", string prdData = "", string level = "") |
| | | { |
| | | var res = false; |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | |
| | | db.Insertable<Container>(container).ExecuteCommand(); |
| | | } |
| | | var cntritem = db.Queryable<CntrItemDetail>().Where(a => a.S_CNTR_CODE.Trim() == cntr).First(); |
| | | string[] kts = new string[] { "TP", "KT" }; |
| | | if (cntritem == null && !kts.Contains(itemcode)) |
| | | // string[] kts = new string[] { "TP", "KT" }; |
| | | if (cntritem == null) |
| | | { |
| | | var iteminfo = db.Queryable<TN_Material>().Where(a => a.S_ITEM_CODE.Trim() == itemcode && a.S_ITEM_NAME.Trim() == itemname).First(); |
| | | var cir = new CntrItemDetail |
| | |
| | | S_SUPPLIER_NO = supplier, |
| | | ReceiveLot = receiveLot, |
| | | Subpool = subpool, |
| | | D_EXP_DATE = expData, |
| | | D_PRD_DATE = prdData |
| | | D_EXP_DATE = prdData, |
| | | D_PRD_DATE = expData |
| | | }; |
| | | db.Insertable<CntrItemDetail>(cir).ExecuteCommand(); |
| | | } |
| | | var cntrloc = db.Queryable<LocCntrRel>().Where(a => a.S_CNTR_CODE.Trim() == cntr).First(); |
| | | else |
| | | { |
| | | cntritem.S_ITEM_CODE = itemcode; |
| | | cntritem.S_ITEM_NAME = itemname; |
| | | cntritem.S_ITEM_SPEC = itemtype; |
| | | cntritem.F_WEIGHT = weight; |
| | | cntritem.S_BATCH_NO = batch; |
| | | cntritem.S_WU = unit; |
| | | cntritem.F_WEIGHT = weight; |
| | | cntritem.WmsLot = wmslot; |
| | | cntritem.LEV = level; |
| | | cntritem.TyreType = tyreType; |
| | | cntritem.S_SUPPLIER_NO = supplier; |
| | | cntritem.ReceiveLot = receiveLot; |
| | | cntritem.Subpool = subpool; |
| | | cntritem.D_EXP_DATE = prdData; |
| | | cntritem.D_PRD_DATE = expData; |
| | | |
| | | if (db.Updateable<CntrItemDetail>(cntritem).ExecuteCommand() > 0) |
| | | { |
| | | LogHelper.Info($"托盘{cntr}:更新物料{itemcode}绑定关系成功"); |
| | | res = true; |
| | | } |
| | | } |
| | | var cntrloc = db.Queryable<LocCntrRel>().Where(a => a.S_CNTR_CODE.Trim() == cntr).First(); |
| | | if (cntrloc == null) |
| | | { |
| | | var loctp = new LocCntrRel { S_LOC_CODE = loc, S_CNTR_CODE = cntr }; |
| | |
| | | /// <param name="batch">批次号</param> |
| | | /// <param name="weight">重量</param> |
| | | /// <param name="qty">数量</param> |
| | | /// <param name="expData">生产时间</param> |
| | | /// <param name="prdData">到期时间</param> |
| | | /// <returns></returns> |
| | | internal static bool CreateCntrItem(string cntr, string itemcode, string itemname, string batch, string weight, int qty) |
| | | internal static bool CreateCntrItem(string cntr, string itemcode, string itemname, string batch, string weight, int qty, string expData = "", string prdData = "") |
| | | { |
| | | var res = false; |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | |
| | | if (cntritem == null) |
| | | { |
| | | |
| | | var cir = new CntrItemDetail { S_CNTR_CODE = cntr, S_ITEM_CODE = itemcode, S_ITEM_NAME = itemname, F_WEIGHT = weight, S_BATCH_NO = batch, F_QTY = qty }; |
| | | var cir = new CntrItemDetail |
| | | { |
| | | S_CNTR_CODE = cntr, |
| | | S_ITEM_CODE = itemcode, |
| | | S_ITEM_NAME = itemname, |
| | | F_WEIGHT = weight, |
| | | S_BATCH_NO = batch, |
| | | F_QTY = qty, |
| | | D_EXP_DATE = prdData, |
| | | D_PRD_DATE = expData |
| | | }; |
| | | if (db.Insertable<CntrItemDetail>(cir).ExecuteCommand() > 0) |
| | | { |
| | | LogHelper.Info($"托盘{cntr}:添加物料{itemcode}绑定关系成功"); |
| | |
| | | cntritem.S_ITEM_NAME = itemname; |
| | | cntritem.F_WEIGHT = weight; |
| | | cntritem.S_BATCH_NO = batch; |
| | | cntritem.D_EXP_DATE = prdData; |
| | | cntritem.D_PRD_DATE = expData; |
| | | |
| | | if (db.Updateable<CntrItemDetail>(cntritem).ExecuteCommand() > 0) |
| | | { |