采购流程的测试并完善功能; 采购订单-》收料通知单-》采购入库单-》应付单 (注意: 源单类型的下拉框 需要 根据数据库 表动态加载, 关联数量 要准确 , 审核 且 未关闭 未行关闭的行 才能下推 ,关联数量超额后,要 反写 关闭 源单 )
6个文件已修改
119 ■■■■ 已修改文件
DAL/采购管理/ClsCg_PayableBill.cs 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/采购管理/ClsCg_PayableBillMain.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Cg_PayableBillController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/仓存管理/验收入库/Kf_StepFoldinBillController.cs 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/²É¹º¹ÜÀí/ClsCg_PayableBill.cs
@@ -32,10 +32,35 @@
        #endregion
        #endregion
        //删除关联
        public override void DeleteRelation(ref string sReturn, Int64 lngBillKey)
        {
            //采购入库单 é‡‡è´­è®¢å• å…³è”数量
            try
            {
                if (DetailColl[0].HSourceBillType == "1201")                      //采购入库单
                {
                    oCn.RunProc("exec h_p_Cg_UpDateRelation_POStockInToPayable_Del " + lngBillKey.ToString());
                }
                else if (DetailColl[0].HSourceBillType == "1102")                    //采购订单
                {
                    oCn.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPayable_Del " + lngBillKey.ToString());
                }
                else
                {
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //新增关联
        public override void AddNewRelation(ref string sReturn, Int64 lngBillKey)
        {
            //收料通知单 é€€æ–™é€šçŸ¥å• å…³è”数量
            //采购入库单 é‡‡è´­è®¢å• å…³è”数量
            try
            {
                if (DetailColl[0].HSourceBillType == "1201")                      //采购入库单
@@ -94,7 +119,7 @@
                    ",HCurID = " + omodel.HCurID + "" +
                    ",HExRate = " + omodel.HExRate + "" +
                    ",HEmpID = " + omodel.HEmpID + "" +
                    ",HManagerID = " + omodel.HManagerID + "" +
                    ",HMangerID = " + omodel.HMangerID + "" +
                    ",HDeptID = " + omodel.HDeptID + "" +
                    ",HExplanation = '" + omodel.HExplanation + "'" +
                    ",HInnerBillNo = '" + omodel.HInnerBillNo + "'" +
@@ -225,7 +250,7 @@
                string mainSql = "insert into Cg_PayableBillMain" +
                    "(HInterID,HBillNo,HDate,HYear,HPeriod,HBillType,HBillSubType" +
                    ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
                    ",HMaker,HMakeDate,HSSID,HPSStyleID,HReceiveDate,HSupID,HCurID,HExRate,HEmpID,HManagerID,HDeptID,HExplanation,HInnerBillNo,HRemark) " +
                    ",HMaker,HMakeDate,HSSID,HPSStyleID,HReceiveDate,HSupID,HCurID,HExRate,HEmpID,HMangerID,HDeptID,HExplanation,HInnerBillNo,HRemark) " +
                    "values(" +
                    "" + omodel.HInterID + "" +
                    ",'" + omodel.HBillNo + "'" +
@@ -247,7 +272,7 @@
                    "," + omodel.HCurID + "" +
                    "," + omodel.HExRate + "" +
                    "," + omodel.HEmpID + "" +
                    "," + omodel.HManagerID + "" +
                    "," + omodel.HMangerID + "" +
                    "," + omodel.HDeptID + "" +
                    ",'" + omodel.HExplanation + "'" +
                    ",'" + omodel.HInnerBillNo + "'" +
@@ -383,7 +408,7 @@
                omodel.HCurID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCurID"]);
                omodel.HExRate = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HExRate"]);
                omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
                omodel.HManagerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HManagerID"]);
                omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]);
                omodel.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"]);
                omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]);
Model/²É¹º¹ÜÀí/ClsCg_PayableBillMain.cs
@@ -12,7 +12,7 @@
        public Int64 HCurID;            //int       --币别
        public double HExRate;          //money     --汇率
        public Int64 HDeptID;           //int       --部门
        public Int64 HManagerID;        //int       --主管
        public Int64 HMangerID;        //int       --主管
        public Int64 HEmpID;            //int       --业务员
        public string HReceiveDate;
        public string HExplanation;
WebAPI/Controllers/CGGL/Cg_POInStockBillController.cs
@@ -199,13 +199,17 @@
                oCN.BeginTran(); //开始事务
                //查询数据
                ds = oCN.RunProcReturn("select * from Cg_POInStockBillMain a inner join Cg_POInStockBillSub b on a.HInterID=b.HInterID  where a.HInterID= '" + HInterID + "'", "Kf_ICStockBillMain");
               //执行存储过程进行反写
                dss = oCN.RunProcReturn("exec h_p_Cg_POOrderBillMain_Delete " + HQty + ", '" + HSourceInterID + "', '" + HSourceEntryID + "','" + user + " '", "h_p_Cg_POInStockBillMain");
                ds = oCN.RunProcReturn("select * from Cg_POInStockBillMain a inner join Cg_POInStockBillSub b on a.HInterID=b.HInterID  where a.HInterID= '" + HInterID + "'", "Cg_POInStockBillMain");
                //收料通知单删除回填采购订单关联数量
                oCN.RunProc("exec h_p_Cg_UpDatePOOrderRelation_Del " + HInterID);
                ////执行存储过程进行反写 è¯¥è¡Œä¹Ÿæ˜¯  æ”¶æ–™é€šçŸ¥å• åå†™  é‡‡è´­è®¢å•
                // dss = oCN.RunProcReturn("exec h_p_Cg_POOrderBillMain_Delete " + HQty + ", '" + HSourceInterID + "', '" + HSourceEntryID + "','" + user + " '", "h_p_Cg_POInStockBillMain");
                var sReturn = "";
                if (DBUtility.ClsPub.isLong(dss.Tables[0].Rows[0]["HBack"]) != 0)
                if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBacker"]) != 0)
                {
                    sReturn = DBUtility.ClsPub.isStrNull(dss.Tables[0].Rows[0]["HBackRemark"]).ToString();
                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]).ToString();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = sReturn;
@@ -679,9 +683,9 @@
                    NewHEntryID = ClsPub.isLong(Cs.Tables[0].Rows[0]["HEntryID"].ToString());
                    NewHEntryID += 1;
                }
                //反写采购入库单
                //反写采购订单单   ä¸Šé¢æ–¹æ³•中也有反写  æ­¤è¡Œç»™æ³¨é”€
                string sReturn = "";
                ds = oCN.RunProcReturn("exec h_p_Cg_POOrderBillMain " + oSub.HQty + ", '" + oSub.HSourceInterID + "', '" + oSub.HSourceEntryID + "','" + user + " '", "h_p_Cg_POOrderBillMain");
                //ds = oCN.RunProcReturn("exec h_p_Cg_POOrderBillMain " + oSub.HQty + ", '" + oSub.HSourceInterID + "', '" + oSub.HSourceEntryID + "','" + user + " '", "h_p_Cg_POOrderBillMain");
                if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) != 0)
                {
                    sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]).ToString();
WebAPI/Controllers/CGGL/Cg_PayableBillController.cs
@@ -337,6 +337,12 @@
                oCN.BeginTran();
                //应付单 åˆ é™¤ æ’¤é”€ é‡‡è´­å…¥åº“单 å…³è”数量
                oCN.RunProc("exec h_p_Cg_UpDateRelation_POStockInToPayable_Del " + HInterID);
                //应付单 åˆ é™¤ æ’¤é”€ é‡‡è´­è®¢å• å…³è”数量
                oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPayable_Del " + HInterID);
                oCN.RunProc("delete from Cg_PayableBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Cg_PayableSub where HInterID= " + HInterID);
WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs
@@ -202,7 +202,7 @@
                        ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark
                        ,HInnerBillNo,HSTOCKORGID,HOWNERID,HMaker,HMakeDate,HProjectID,HInvoiceBillNo)
                        values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1201 + "','" +
                    HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress +
                    1201 + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress +
                    "'," + HSupID + "," + HCurID + "," + HWHID + "," + HEmpID + "," + HManagerID + "," + 
                    HSecManagerID + ","+ HKeeperID +"," + HDeptID + ",'" + HExplanation + "','" + HRemark
                    + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HMaker + "',getdate(),"+ HProjectID + ",'"+ HInvoiceBillNo + "')";
@@ -218,6 +218,13 @@
                                 + ",HAddress='" + HAddress + "',HInnerBillNo='" + HInnerBillNo + "',HProjectID="+ HProjectID + ",HInvoiceBillNo='"+ HInvoiceBillNo + "' where HInterID=" + HInterID;
                    oCN.RunProc(sql);
                    //采购入库单  ç¼–辑 æ’¤é”€å›žå¡«  é‡‡è´­è®¢å•  å…³è”数量
                    oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPOStockIn_Del " + HInterID);
                    //采购入库单  ç¼–辑 æ’¤é”€å›žå¡«  æ”¶æ–™é€šçŸ¥å•  å…³è”数量
                    oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Del " + HInterID);
                    //删除子表
                    oCN.RunProc("delete from Kf_ICStockBillSub where HInterID='" + HInterID + "'");
                }
@@ -229,7 +236,7 @@
                //采购入库单新增回填收料通知单关联数量
                oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Add " + HInterID);
                if (objJsonResult.code == "0")
                {
@@ -421,6 +428,13 @@
                string sReturn = "";
                oCN.BeginTran();
                //采购入库单  åˆ é™¤ æ’¤é”€å›žå¡«  é‡‡è´­è®¢å•  å…³è”数量
                oCN.RunProc("exec h_p_Cg_UpDateRelation_POOrderToPOStockIn_Del " + HInterID);
                //采购入库单  åˆ é™¤ æ’¤é”€å›žå¡«  æ”¶æ–™é€šçŸ¥å•  å…³è”数量
                oCN.RunProc("exec h_p_Cg_UpDateRelation_POInStockToPOStockIn_Del " + HInterID);
                oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID);
                oCN.Commit();
@@ -1175,7 +1189,7 @@
        #endregion
        #region é‡‡è´­å…¥åº“单 æ ¹æ®ä¸»å†…码与子内码获取采购入库单数据
        #region é‡‡è´­å…¥åº“单  æ ¹æ®ä¸»å†…码与子内码获取采购入库单数据
        [Route("Kf_POStockInBill/loadKf_POStockInBill_Push")]
        [HttpGet]
        public object loadKf_POStockInBill_Push(long HInterID, long HSubID)
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÑéÊÕÈë¿â/Kf_StepFoldinBillController.cs
@@ -842,5 +842,43 @@
            }
        }
        #endregion
        #region åˆ†æ­¥å¼è°ƒå…¥å•  æ ¹æ®ä¸»å†…码与子内码获取分布式调出单数据
        [Route("Kf_StepFoldInBill/loadKf_ICStockBillMain_Push")]
        [HttpGet]
        public object loadKf_POStockInBill_Push(long HInterID, long HSubID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_IF_StepFoldOutBillList where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_StepFoldOutBillList");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未查询到源单信息!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}