1
duhe
2024-03-11 a2cbc7e236720685b9485b494ae2a642cad81f96
1
10个文件已修改
269 ■■■■■ 已修改文件
DAL/应收管理/ClsYS_ReceiveOtherBill.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/应收管理/ClsYS_ReceiveOtherBillSub.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsPub.cs 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/XSGL/YS_ReceiveOtherBillController.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSc_ICMOReportBill.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsSc_ICMOReportBillSub.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/Ó¦ÊÕ¹ÜÀí/ClsYS_ReceiveOtherBill.cs
@@ -66,7 +66,31 @@
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsYS_ReceiveOtherBillSub oSub in DetailColl)
                {
                    string subSql = "insert into YS_ReceiveOtherBillSub" +
                         "" +
                         "" +
                         "" +
                         "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                         ",HProjectMoneyID,HTypeSub,HMoney,HTaxRate,HSumMoney) " +
                         " values(" +
                         "" + omodel.HInterID.ToString() +
                         "," + oSub.HEntryID.ToString() +
                         "," + oSub.HSourceInterID +
                         "," + oSub.HSourceEntryID +
                         ",'" + oSub.HSourceBillNo +
                         "','" + oSub.HSourceBillType +
                         "','" + oSub.HProjectMoneyID +
                         "','" + oSub.HTypeSub +
                         "','" + oSub.HMoney +
                         "','" + oSub.HTaxRate +
                         "','" + oSub.HSumMoney +
                         "')";
                    oCn.RunProc(subSql);
                }
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
@@ -99,7 +123,30 @@
                ",'" + omodel.HAccDate.ToShortDateString() + "'," + omodel.HCusID.ToString() + "," + omodel.HCurID.ToString() + "," + omodel.HExRate.ToString() +
                ", '" + omodel.HDeptID.ToString() + "','" + omodel.HEmpID.ToString() + "','" + omodel.HProjectMoneyID.ToString() + "','"  + omodel.HType+ "','"+ omodel.HMoney+ "','" + omodel.HTaxRate + "','" + omodel.HSumMoney + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "','" + omodel.HOrgID + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsYS_ReceiveOtherBillSub oSub in DetailColl)
                {
                    string subSql = "insert into YS_ReceiveOtherBillSub" +
                         "" +
                         "" +
                         "" +
                         "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
                         ",HProjectMoneyID,HTypeSub,HMoney,HTaxRate,HSumMoney) " +
                         " values(" +
                         "" + omodel.HInterID.ToString() +
                         "," + oSub.HEntryID.ToString() +
                         "," + oSub.HSourceInterID +
                         "," + oSub.HSourceEntryID +
                         ",'" + oSub.HSourceBillNo +
                         "','" + oSub.HSourceBillType +
                         "','" + oSub.HProjectMoneyID +
                         "','" + oSub.HTypeSub +
                         "','" + oSub.HMoney +
                         "','" + oSub.HTaxRate +
                         "','" + oSub.HSumMoney +
                         "')";
                    oCn.RunProc(subSql);
                }
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
Model/Model.csproj
@@ -461,6 +461,7 @@
    <Compile Include="工资管理\ClsPay_SubsidyChangeBillSub.cs" />
    <Compile Include="工资管理\ClsPay_SumBalBillMain .cs" />
    <Compile Include="工资管理\ClsPay_SumBalBillSub.cs" />
    <Compile Include="应收管理\ClsYS_ReceiveOtherBillSub.cs" />
    <Compile Include="成本管理\ClsCB_ChangeMoneyBillMain.cs" />
    <Compile Include="成本管理\ClsCB_ChangeMoneyBillSub.cs" />
    <Compile Include="成本管理\ClsCB_EntrustMoneyCost_M.cs" />
@@ -1225,7 +1226,6 @@
    <Compile Include="应收管理\ClsYS_ReceiveBillMain.cs" />
    <Compile Include="应收管理\ClsYS_ReceiveBillSub.cs" />
    <Compile Include="应收管理\ClsYS_ReceiveOtherBillMain.cs" />
    <Compile Include="应收管理\ClsYS_ReceiveOtherBillSub.cs" />
    <Compile Include="应收管理\ClsYS_ReceiveShouldBillMain.cs" />
    <Compile Include="应收管理\ClsYS_ReceiveShouldBillSub.cs" />
    <Compile Include="计划管理\ClsGy_ICBomBillMain.cs" />
Model/Ó¦ÊÕ¹ÜÀí/ClsYS_ReceiveOtherBillSub.cs
@@ -8,5 +8,10 @@
    { 
        public DateTime HEntryCloseDate;//   datetime      --行关闭 (默认为'')        new
        public string HRemark;//         varchar(200)        --备注 
        public Int64 HProjectMoneyID;//   int     //费用项目
        public string HTypeSub;//   varchar(20)     --发票类型
        public double HMoney;//  dec(18,8) //单据金额
        public double HTaxRate;//  dec(18,8) //税率
        public double HSumMoney;//  dec(18,8) //总金额
    }
}
Pub_Class/CustomerCls/ClsPub.cs
@@ -897,6 +897,76 @@
        }
        //得到最大基础资料的流水号 HNumber
        public static string CreateHNumber(string BillCode,string HName,string TableName, ref string sReturn, bool Add)
        {
            Int64 Glida;
            Int32 CodeLen;
            string sBillNumber = "";
            char c = Convert.ToChar("0");
            string sKjYear = DateTime.Today.Year.ToString();
            string sPeriod = DateTime.Today.Month.ToString();
            string sDay = DateTime.Today.Day.ToString();
            //得到单据号表 ä¿¡æ¯
            ClsSqlHelper oCn = new ClsSqlHelper();
            DataSet Ds = new DataSet();
            DataSet Dss = new DataSet();
            //第一次查询数据是否存在  ä¸å­˜åœ¨å°±æ·»åŠ 
            Ds = oCn.RunProcReturn("Select * from Gy_MaxNumber where BillName='" + HName.Trim() + "'", "Gy_MaxNumber");
            //插入新记录    è¡¨å,表名称,当前id
            if (Ds.Tables[0].Rows.Count == 0)
            {
                oCn.RunProc("insert into Gy_MaxNumber(BillType,BillName,IDNow) values('" + TableName.Trim() + "','" + HName.Trim() + "',1)");
            }
            //第二次查询 æ˜¯æŸ¥è¯¢æ’入的新数据
            Dss = oCn.RunProcReturn("Select * from Gy_MaxNumber where BillName='" + HName.Trim() + "'", "Gy_MaxNumber");
            if (Dss.Tables[0].Rows.Count != 0)
            {
                Glida = ClsPub.isLong(Dss.Tables[0].Rows[0]["Glida"].ToString());
                CodeLen = ClsPub.isInt(Dss.Tables[0].Rows[0]["CodeLen"].ToString());
            }
            else
            {
                return "";
            }
            string sStr;
            switch (Glida)
            {
                case 0://纯流水号
                    Ds = oCn.RunProcReturn("Select * from Gy_MaxNumber where BillName='" + HName.Trim() + "'", "Gy_MaxNumber");
                    if (Ds.Tables[0].Rows.Count != 0)
                    {
                        sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["IDNow"].ToString()).Length);
                        sBillNumber = BillCode.Trim() + sStr + Ds.Tables[0].Rows[0]["IDNow"].ToString().Trim();
                    }
                    if (Add == true)
                    {
                        oCn.RunProc("update Gy_MaxNumber set IDNow=IDNow+1 where BillName='" + HName.Trim() + "'");
                    }
                    return sBillNumber;
                case 1://根据 YYå¹´+MM月 æ—¥ + æµæ°´å·  ç”Ÿæˆå•据号 ï¼ˆæ—¥ é‡‡ç”¨äº† ä»“库的字段)
                    return sBillNumber;
                case 2:      //根据年+月+日  ç”Ÿæˆå•据号
                    return sBillNumber;
                case 3: //根据 ä¹”一 ï¼ˆS + å¹´ï¼ˆ23)+五位流水号)实例:S2300001
                    return sBillNumber;
                case 4: //根据 ä¹”一 å·¥åºæµè½¬å¡å·æ”¹æˆå¹´+月+四位流水号(23050001)
                    return sBillNumber;
                default:
                    return sBillNumber;
            }
            oCn.CnClose();
            oCn.CnDispose();
            oCn = null;
        }
        //判断是否存在权限,并写入日志
        public static bool Security_Log(string gnsy, int LogTF, bool Msg,string CurUserName)
        {
WebAPI/Controllers/WebAPIController.cs
@@ -143,6 +143,56 @@
            }
        }
        /// <summary>
        /// è‡ªåŠ¨èŽ·å–åŸºç¡€èµ„æ–™ æµæ°´å· å°±æ˜¯ä»£ç 
        /// </summary>
        /// <param name="HBillType"></param>
        /// <returns></returns>
        [Route("Web/GetMAXNumber")]
        [HttpGet]
        public object GetMAXNumber(string HBillType,string HName,string TableName)
        {
            try
            {
                string HNumber = "";
                HNumber = DBUtility.ClsPub.CreateHNumber(HBillType,HName, TableName, ref DBUtility.ClsPub.sExeReturnInfo, true);
                //----------创建虚表------------------------
                DataTable dt_Main = new DataTable("Json");
                dt_Main.Columns.Add("HNumber", typeof(string));
                //---------创建新行------------------------
                DataRow dr_main = dt_Main.NewRow();//创建新行
                dt_Main.Rows.Add(dr_main);//将新行加入到表中
                dr_main["HNumber"] = DBUtility.ClsPub.isStrNull(HNumber);
                if (HNumber == null)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功";
                    objjson.data = dt_Main;
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        //[Route("Web/Get_MaxBillNoAndID")]
        //[HttpGet]
WebAPI/Controllers/XSGL/YS_ReceiveOtherBillController.cs
@@ -25,6 +25,17 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        public class ClsYS_ReceiveOtherBillSubs
        {
            public Int64 HProjectMoneyIDSub;//   int     //费用项目
            public string HTypeSub;//   varchar(20)     --发票类型
            public double HMoneySub;//  dec(18,8) //单据金额
            public double HTaxRateSub;//  dec(18,8) //税率
            public double HSumMoneySub;//  dec(18,8) //总金额
        }
        #region å…¶ä»–应收单列表 æŸ¥è¯¢
        /// <summary>
        /// è¿”回项目阶段列表
@@ -93,9 +104,10 @@
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();                             //表头数据
            string refSav = sArray[1].ToString();                           //操作方式
            string msg4 = sArray[2].ToString();                             //用户
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString(); //子表
            string refSav = sArray[2].ToString();//操作方式数据类型 1添加 3修改 2 å¤åˆ¶
            string msg4 = sArray[3].ToString();//用户名
            DBUtility.ClsPub.CurUserName = msg4;
@@ -187,6 +199,26 @@
                    }
                    oBill.omodel = oItem;
                }
                // è¡¨ä½“数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                List<Model.ClsYS_ReceiveOtherBillSub> ls = new List<Model.ClsYS_ReceiveOtherBillSub>();
                ls = oListModels.getObjectByJson_YS_ReceiveOtherBillSub(msg3);
                int i = 0;
                foreach (Model.ClsYS_ReceiveOtherBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
@@ -239,7 +271,11 @@
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_YS_ReceiveOtherBillMainList where hmainid=" + HInterID, "h_v_YS_ReceiveOtherBillMainList");
                List<DataTable> tableList = new List<DataTable>();
                ds = oCN.RunProcReturn("exec h_p_YS_ReceiveOtherBillMain_Edit  " + HInterID, "h_p_YS_ReceiveOtherBillMain_Edit");
                tableList.Add(ds.Tables[0]);
                tableList.Add(ds.Tables[1]);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -253,7 +289,7 @@
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.data = tableList;
                    return objJsonResult;
                }
            }
WebAPI/DLL/ClsSc_ICMOBillWorkQtyStatus_Tmp.cs
@@ -102,14 +102,14 @@
               ",HQty,HBadQty,HWasterQty,HBarCode,HAddr,HMaker,HMakeDate" +
               ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSplitNO,HSourceBillType" +
               ",HRelationInterID,HRelationEntryID,HRelationBillNo,HReportEntryID,HBillStatus" +
               ") " +
               ",HICMOReportInterID) " +
                " values(" + omodel.HInterID.ToString() + ",'" + BillType + "'," + omodel.HSourceID.ToString() + "," + omodel.HReportType.ToString() + "," + omodel.HPieceQty.ToString() +
                "," + omodel.HMaterID.ToString() + ",'" + omodel.HGroupID + "','" + omodel.HWorkManID + "','" + omodel.HWorkReportDate + "','" + omodel.HDate + "'" +
                ",'" + omodel.HBillSubType.ToString() + "','" + omodel.HBillNo + "','" + omodel.HICMOInterID + "','" + omodel.HICMOEntryID + "','" + omodel.HICMOBillNo + "'" +
                "," + omodel.HQty.ToString() + "," + omodel.HBadQty.ToString() + "," + omodel.HWasterQty.ToString() + ",'" + omodel.HBarCode + "','" + omodel.HAddr + "','" + omodel.HMaker+ "','" + omodel.HMakeDate + "'" +
                "," + omodel.HSourceInterID.ToString() + "," + omodel.HSourceEntryID.ToString() + ",'" + omodel.HSourceBillNo + "','" + omodel.HSplitNO + "','" + omodel.HSourceBillType + "'" +
                "," + omodel.HRelationInterID.ToString() + "," + omodel.HRelationEntryID.ToString() + ",'" + omodel.HRelationBillNo + "'," + omodel.HReportEntryID.ToString() + "," + omodel.HBillStatus.ToString() +
                ") ");
                ",'"+ omodel.HSourceInterID.ToString() + "') ");
                double sumqty = omodel.HQty + omodel.HBadQty + omodel.HWasterQty;  //汇报数量+不良+报废
                //回写生产状态临时表Sc_ICMOBillStatus_Tmp拆分汇报数量 HSplitRelationQty
                oCn.RunProc("update Sc_ICMOBillStatus_Tmp set HSplitRelationQty=HSplitRelationQty+" + sumqty + "  where HICMOBillNo='" + omodel.HICMOBillNo + "'  and HSourceID='" + omodel.HSourceID + "' and  HICMOInterID='" + omodel.HICMOInterID + "' and HICMOEntryID='" + omodel.HICMOEntryID + "' and HInterID="+ omodel.HSourceInterID.ToString());
WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -262,7 +262,7 @@
                    //反写产量汇报单,质量汇报单关联字段,生产订单关联数量
                    ds = oCn.RunProcReturn("exec h_p_Sc_ICMOReportBill_ReverseWriteQty " + omodel.HInterID + "," + oSub.HEntryID + ",'" + omodel.HBillNo + "'," +
                        DetailColl[0].HICMOInterID + "," + DetailColl[0].HICMOEntryID + ",'" + DetailColl[0].HICMOBillNo + "','" + DetailColl[0].HSourceID + "','" +
                        "Add" + "'," + 0
                        "Add" + "'," + 0+","+ DetailColl[0].HICMOTempID
                        , "h_p_Sc_ICMOReportBill_ReverseWriteQty");
                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "1")
                    {
@@ -439,6 +439,7 @@
                }
                else
                {
                    oSystemParameter.ShowBill(ref sReturn);
                    JObject model = new JObject();
                    model.Add("FBillType", new JObject() { ["FNumber"] = Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) }); //单据类型
                    model.Add("FDate", Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"])); //单据日期                   
@@ -498,10 +499,10 @@
                                                                                                          //
                        if (oSystemParameter.omodel.WMS_CampanyName == "九菱") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                        {
                            FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//班组
                            FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// æ“ä½œå‘˜
                        }
                        FentityModel.Add("FShiftGroupId", new JObject() { ["FNumber"] = item["FShiftGroupId"].ToString() });//班组
                        FentityModel.Add("F_UUBK_CZG1", new JObject() { ["FSTAFFNUMBER"] = item["F_UUBK_CZG1"].ToString() });// æ“ä½œå‘˜
                        FentityModel.Add("FBOMID", new JObject() { ["FNumber"] = item["FBOMID"].ToString() });// BOM版本
@@ -581,17 +582,30 @@
                        //提交审核
                        string result1 = string.Empty;
                        string result2 = string.Empty;
                        var fID = JObject.Parse(result)["Result"]["Id"].ToString();
                        var fBillNo = JObject.Parse(result)["Result"]["Number"].ToString();
                        var json = new
                        {
                            Ids = fID,
                        };
                        if (oSystemParameter.omodel.Sc_ICMOReportBill_AutoCheck == "Y") //系统参数  è‡ªåŠ¨å®¡æ ¸ 
                        {
                            result1 = InvokeHelper.Submit("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));//提交
                            result2 = InvokeHelper.Audit("PRD_MORPT", JsonConvert.SerializeObject(jsonRoot));//审核
                            result1 = InvokeHelper.Submit("PRD_MORPT", JsonConvert.SerializeObject(json));//提交
                            result2 = InvokeHelper.Audit("PRD_MORPT", JsonConvert.SerializeObject(json));//审核
                            if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                            {
                                sReturn = "生产汇报单单号:" + HBillNo + ",提交失败" + result;
                                sReturn = "生产汇报单单号:" + HBillNo + ",提交失败" + result1;
                                oCn.RollBack();
                                return false;                              
                            }
                            if (JObject.Parse(result2)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                            {
                                sReturn = "生产汇报单单号:" + HBillNo + ",审核失败" + result2;
                                oCn.RollBack();
                                return false;
                            }
                        }                       
                    }                   
                }
WebAPI/ListModels.cs
@@ -1175,6 +1175,18 @@
        }
        /// <summary>
        /// å¤„理新增其他应收单子表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsYS_ReceiveOtherBillSub> getObjectByJson_YS_ReceiveOtherBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsYS_ReceiveOtherBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsYS_ReceiveOtherBillSub>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增其他应付单表的json
        /// </summary>
        /// <param name="jsonString"></param>
WebAPI/Models/ClsSc_ICMOReportBillSub.cs
@@ -75,5 +75,6 @@
        public Int64 HPlanMode;
        public Int64 HERPInterID;
        public Int64 HERPEntryID;
        public Int64 HICMOTempID;
    }
}