智云SRM-WEBAPI(目前客户通用API)
王 垚
2022-07-14 3e9a709ecd0a8a739727cef65f3feb0ce8f4a090
优化
2个文件已修改
37 ■■■■■ 已修改文件
WebAPI/Controllers/BarCodeController.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/POInStockController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BarCodeController.cs
@@ -603,7 +603,7 @@
                                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;
@@ -756,14 +756,18 @@
                        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)
@@ -787,17 +791,21 @@
                        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();
            }
@@ -1561,7 +1569,6 @@
                //暂时只回填关联数量
                oCn.RunProc("exec H_p_SRM_BarCodeBill_Update_UpdateBillRelateData " + linterid.ToString());
                oCn.Commit();
            }
            catch (Exception e)
            {
@@ -1694,7 +1701,7 @@
            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];
@@ -1710,12 +1717,12 @@
                        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;
WebAPI/Controllers/POInStockController.cs
@@ -759,7 +759,7 @@
                                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")
@@ -911,7 +911,7 @@
                                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")