| | |
| | | HMinQty = HSumQty; |
| | | } |
| | | TM = $"{oItemSub.HMaterID}#{HMinQty}"; |
| | | |
| | | |
| | | Model.ClsGy_BarCodeBill_WMS_Model bar = new Model.ClsGy_BarCodeBill_WMS_Model(); |
| | | bar.HBarCode = TM; |
| | | bar.HMaterID = oItemSub.HMaterID; |
| | |
| | | HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo); |
| | | HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType); |
| | | HWei = ClsPub.isStrNull(oItemSub.HEndQty); |
| | | oCn.RunProc("insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + |
| | | string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " + |
| | | ") values (" |
| | | + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate |
| | | + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" |
| | | + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')"); |
| | | oCn.RunProc("exec setLSH '" + DateTime.Today + "'"); |
| | | + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')"; |
| | | oCn.RunProc(sql); |
| | | //LogService.Write(sql); |
| | | sql = "exec setLSH '" + DateTime.Today + "'"; |
| | | oCn.RunProc(sql); |
| | | //LogService.Write(sql); |
| | | } |
| | | } |
| | | foreach (Model.ClsGy_BarCodeBill_WMS_Model oItemSub in ls3) |
| | |
| | | HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo); |
| | | HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType); |
| | | HWei = ClsPub.isStrNull(oItemSub.HEndQty); |
| | | oCn.RunProc("insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + |
| | | string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " + |
| | | ") values (" |
| | | + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate |
| | | + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1" |
| | | + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')"); |
| | | + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')"; |
| | | oCn.RunProc(sql); |
| | | //LogService.Write(sql); |
| | | } |
| | | } |
| | | //暂时只回填关联数量 |
| | | oCn.RunProc("exec H_p_SRM_BarCodeBill_Update_UpdateBillRelateData " + linterid.ToString()); |
| | | string _sql = "exec H_p_SRM_BarCodeBill_Update_UpdateBillRelateData " + linterid.ToString(); |
| | | //LogService.Write(_sql); |
| | | oCn.RunProc(_sql); |
| | | oCn.Commit(); |
| | | |
| | | } |
| | |
| | | //暂时只回填关联数量 |
| | | oCn.RunProc("exec H_p_SRM_BarCodeBill_Update_UpdateBillRelateData " + linterid.ToString()); |
| | | oCn.Commit(); |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | string sql = "select HBarCode,HSourceInterID,HSourceEntryID,HQty,HBarCodeType,HSourceBillType from Gy_BarCodeBill where HItemID in(" + HInterID + ") "; |
| | | string sql = "select HItemID,HBarCode,HSourceInterID,HSourceEntryID,HQty,HBarCodeType,HSourceBillType from Gy_BarCodeBill where HItemID in(" + HInterID + ") "; |
| | | //LogService.Write("删除sql:" + sql); |
| | | oCN.BeginTran(); |
| | | DataTable dt = oCN.RunProcReturn(sql, "deleteTable").Tables[0]; |
| | |
| | | if (dr["HBarCodeType"].ToString() == "箱号内条码" && dr["HSourceBillType"].ToString() == "1601") |
| | | oCN.RunProc($"update WW_EntrustOrderBillSub set HBarcodeCount -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | //反写打印数量到送货单 (不需要反写 送货单直接是关联查询取的数量 没有在源单上做保存) |
| | | if (dr["HBarCodeType"].ToString() == "箱号内条码" && dr["HSourceBillType"].ToString() == "1103") |
| | | continue; |
| | | //oCN.RunProc($"update WW_EntrustOrderBillSub set HBarcodeCount -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | if (dr["HSourceBillType"].ToString() == "1103") |
| | | oCN.RunProc("Delete From Gy_BarCodeBill where HItemID in(" + dr["HItemID"] + ") "); |
| | | //oCN.RunProc($"update WW_EntrustOrderBillSub set HBarcodeCount -= {dr["HQty"]} where HInterID ={dr["HSourceInterID"]} and HEntryID ={dr["HSourceEntryID"]}"); |
| | | } |
| | | } |
| | | oCN.RunProc("Delete From Gy_BarCodeBill where HItemID in(" + HInterID + ") "); |
| | | //oCN.RunProc("Delete From Gy_BarCodeBill where HItemID in(" + HInterID + ") "); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | LogService.Write("jsonRoot:" + jsonRoot.ToString()); |
| | | //LogService.Write("jsonRoot:" + jsonRoot.ToString()); |
| | | var result = InvokeHelper.Save("PUR_ReceiveBill", jsonRoot.ToString()); |
| | | //LogService.Write(result); |
| | | if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() == "TRUE") |
| | |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | LogService.Write("jsonRoot:" + jsonRoot.ToString()); |
| | | //LogService.Write("jsonRoot:" + jsonRoot.ToString()); |
| | | var result = InvokeHelper.Save("PUR_ReceiveBill", jsonRoot.ToString()); |
| | | //LogService.Write(result); |
| | | if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() == "TRUE") |