| | |
| | | /// <summary> |
| | | /// 创建托盘物料绑定关系 |
| | | /// </summary> |
| | | /// <param name="loc"></param> |
| | | /// <param name="cntr"></param> |
| | | /// <param name="itemcode"></param> |
| | | /// <param name="cntr">托盘号</param> |
| | | /// <param name="itemcode">物料编码</param> |
| | | /// <param name="itemname">物料名称</param> |
| | | /// <param name="batch">批次号</param> |
| | | /// <param name="weight">重量</param> |
| | | /// <param name="qty">数量</param> |
| | | /// <returns></returns> |
| | | internal static bool CreateCntrItem(string cntr, string itemcode, string itemname, string batch, string weight) |
| | | internal static bool CreateCntrItem(string cntr, string itemcode, string itemname, string batch, string weight, int qty) |
| | | { |
| | | var res = false; |
| | | var db = new SqlHelper<object>().GetInstance(); |
| | |
| | | var cntritem = db.Queryable<CntrItemDetail>().Where(a => a.S_CNTR_CODE.Trim() == cntr).First(); |
| | | 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 }; |
| | | |
| | | 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 }; |
| | | 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; |
| | | |
| | | |
| | | if (db.Updateable<CntrItemDetail>(cntritem).ExecuteCommand() > 0) |
| | | { |
| | | LogHelper.Info($"托盘{cntr}:更新物料{itemcode}绑定关系成功"); |
| | |
| | | db.Insertable<Container>(container).ExecuteCommand(); |
| | | } |
| | | db.Ado.CommitTran(); |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |