yangle
2022-12-28 eb22fa59bce6c5e1a90f2e6613847c4b9e5e4df3
点检记录单信息维护
6个文件已修改
1个文件已添加
163 ■■■■ 已修改文件
DAL/生产管理/模具管理/ClsSc_MouldDotCheckBill.cs 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/模具管理/ClsSc_MouldDotCheckRuleBill.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/模具管理/ClsSc_MouldDotCheckBillMain.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/模具管理/ClsSc_MouldDotCheckBillSub_Item.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldDotCheckBill.cs
@@ -9,11 +9,12 @@
    {
        public Model.ClsSc_MouldDotCheckBillMain omodel = new Model.ClsSc_MouldDotCheckBillMain();
        public List<Model.ClsSc_MouldDotCheckBillSub> DetailColl = new List<Model.ClsSc_MouldDotCheckBillSub>();
        public List<Model.ClsSc_MouldDotCheckBillSub_Item> DetailCol = new List<Model.ClsSc_MouldDotCheckBillSub_Item>();
        public ClsSc_MouldDotCheckBill()
        {
            base.MvarItemKeySub = "Sc_MouldDotCheckBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub2 = "Sc_MouldDotCheckBillSub_Item";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="Sc_MouldDotCheckBillMain";
@@ -41,7 +42,6 @@
                //更新主表
                oCn.RunProc("UpDate Sc_MouldDotCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                //",HStockType='" + omodel.HStockType + "'" +
@@ -51,6 +51,7 @@
                    //========================================
                ",HPlanNo='" + omodel.HPlanNo + "'" +
                ",HPlanInterID=" + omodel.HPlanInterID.ToString() +
                ",HMouldDotCheckRuleID=" + omodel.HMouldDotCheckRuleID.ToString() +
                ",HMouldID=" + omodel.HMouldID.ToString() +
@@ -65,6 +66,7 @@
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                DeleteBillSub2(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                //插入子表
@@ -83,6 +85,22 @@
                      ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      ") ");
                }
                //配件项目
                foreach (Model.ClsSc_MouldDotCheckBillSub_Item oSub in DetailCol)
                {
                    oCn.RunProc("Insert into Sc_MouldDotCheckBillSub_Item " +
                    " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                    ",HMaterID,HUnitID" +
                    ",HQty,HQtyMust" +
                    ") values("
                    + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                    "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                    "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() +
                    "," + oSub.HQty.ToString() + "," + oSub.HQtyMust.ToString() +
                    ") ");
                }
                //
                //foreach (Model.ClsSc_MouldDotCheckBillSub oSub in DetailColl)
@@ -122,13 +140,13 @@
                ",HYear,HPeriod,HRemark" +
                ",HMouldID,HBeginDate"+
                ",HEndDate,HPlanNo,HPlanInterID" +
                ",HInnerBillNo,HExplanation" +
                ",HInnerBillNo,HExplanation,HMouldDotCheckRuleID" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
                "," + omodel.HMouldID.ToString() + ",'" + omodel.HBeginDate + "'" +
                ",'" + omodel.HEndDate + "','" + omodel.HPlanNo + "'," + omodel.HPlanInterID.ToString() +
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" +
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'," + omodel.HMouldDotCheckRuleID +
                ") ");
                //插入子表
                foreach (Model.ClsSc_MouldDotCheckBillSub oSub in DetailColl)
@@ -147,6 +165,22 @@
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      ") ");
                }
                //配件项目
                foreach (Model.ClsSc_MouldDotCheckBillSub_Item oSub in DetailCol)
                {
                    oCn.RunProc("Insert into Sc_MouldDotCheckBillSub_Item " +
                    " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                    ",HMaterID,HUnitID" +
                    ",HQty,HQtyMust" +
                    ") values("
                    + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'," + oSub.HEntryCloseDate.ToShortDateString() + "," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                    "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                    "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() +
                    "," + oSub.HQty.ToString() + "," + oSub.HQtyMust.ToString() +
                    ") ");
                }
                //
                //foreach (Model.ClsSc_MouldDotCheckBillSub oSub in DetailColl)
                //{
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldDotCheckRuleBill.cs
@@ -40,7 +40,6 @@
                //更新主表
                oCn.RunProc("UpDate Sc_MouldDotCheckRuleBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
Model/Model.csproj
@@ -518,6 +518,7 @@
    <Compile Include="生产管理\模具管理\ClsSc_MouldDotCheckBillMain.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldDotCheckBillSub.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldDotCheckPlanBillMain.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldDotCheckBillSub_Item.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldDotCheckPlanBillSub_Item.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldDotCheckPlanBillSub.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldDotCheckRuleBillMain.cs" />
Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldDotCheckBillMain.cs
@@ -13,5 +13,6 @@
        public string HEndDate;//       datetime      --点检结束日期
        public string HExplanation;//   varchar(500)     --ÕªÒª 
        public string HInnerBillNo;//   varchar(50)     --内部单据号
        public string HMouldDotCheckRuleID;//  å™¨å…·ç‚¹æ£€è§„程ID
    }
}
Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldDotCheckBillSub_Item.cs
New file
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsSc_MouldDotCheckBillSub_Item : DBUtility.ClsXt_BaseBillSub
    {
        //============
        public Int64 HMaterID;//    int       --配件ID
        public Int64 HUnitID;//     int     --计量单位
        public double HQty;//       dec(18,8)       --用量
        public double HQtyMust;//    dec(18,8)     --标准用量(暂时隐藏)
    }
}
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -336,8 +336,7 @@
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
@@ -345,15 +344,6 @@
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -3200,6 +3190,7 @@
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            string msg5 = sArray[3].ToString();
            string UserName = "";
            ListModels oListModels = new ListModels();
@@ -3223,6 +3214,7 @@
                {
                    //oItem.HMaker = "";
                    UserName = oItem.HMaker;  //制单人
                    oItem.HMaker = msg4;
                    oItem.HBillType = "3821";
                    oItem.HBillSubType = "3821";
@@ -3285,6 +3277,32 @@
                    oBill.DetailColl.Add(oItemSub);
                }
                //配件项表体数据
                //按 },{来拆分数组 //去掉【和】
                msg5 = msg5.Substring(1, msg5.Length - 2);
                msg5 = msg5.Replace("\\", "");
                msg5 = msg5.Replace("\n", "");  //\n
                                                //msg2 = msg2.Replace("'", "’");
                List<Model.ClsSc_MouldDotCheckBillSub_Item> ls1 = new List<Model.ClsSc_MouldDotCheckBillSub_Item>();
                ls1 = oListModels.getObjectByJson_Sc_MouldDotCheckBillSub_Item(msg5);
                int j = 0;
                foreach (Model.ClsSc_MouldDotCheckBillSub_Item oItemSub in ls1)
                {
                    j++;
                    oItemSub.HEntryID = j;
                    //oItemSub.HCloseMan = "";       //行关闭
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    oItemSub.HSourceInterID = 0;     // æºå•主内码
                    oItemSub.HSourceEntryID = 0;   //源单子内码
                    oItemSub.HRelationQty = 0;     //关联数量
                    oBill.DetailCol.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
                bool bResult;
@@ -3346,28 +3364,29 @@
        [HttpGet]
        public object Sc_MouldDotCheckBillListProjectDetai(string sqlWhere)
        {
            DataSet ds;
            DataSet ds, ds1;
            List<object> list = new List<object>();
            string Swhere = "";
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckBillList", "h_v_Sc_MouldDotCheckBillList");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                }
                else
                {
                    string sql1 = "select HDotCheckItemID,点检项目 HDotCheckItem,点检部位 HDotCheckPart,具体要求 HClaim,表体备注 HRemark,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sc_MouldDotCheckBillList where 1 = 1 ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldDotCheckBillList");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                }
                //获取点检项目编辑数据
                ds = oCN.RunProcReturn("select HDotCheckItem, HDotCheckPart , HClaim, a.HRemark,a.HManagerID,e.HNumber HManagerCode,e.HName HManagerName from Sc_MouldDotCheckBillSub a left join Gy_Employee e on a.HManagerID=e.HItemID where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub");
                //获取配件项目编辑数据
                ds1 = oCN.RunProcReturn(@"select b.HMaterID,  mt.Hnumber HMaterNumber ,mt.HName HMaterName, b.HUnitID
                    ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark
                    from Sc_MouldDotCheckBillSub_Item b
                    left join Gy_Material mt on b.HMaterID=mt.HItemID
                    left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID  where 1=1 " + sqlWhere, "Sc_MouldDotCheckBillSub_Item");
                list.Add(ds.Tables[0]);
                list.Add(ds1.Tables[0]);
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取信息成功!";
                objJsonResult.data = null;
                objJsonResult.list = list;
            }
            catch (Exception e)
            {
@@ -3693,7 +3712,7 @@
                    ,u2.hnumber HUnitNumber,u2.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark 
                    from Sc_MouldDotCheckPlanBillSub_Item b 
                    left join Gy_Material mt on b.HMaterID=mt.HItemID 
                    left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID  where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub");
                    left join h_v_IF_Unit u2 on b.HUnitID=u2.HItemID  where 1=1 " + sqlWhere, "Sc_MouldDotCheckPlanBillSub_Item");
                list.Add(ds.Tables[0]);
                list.Add(ds1.Tables[0]);
                objJsonResult.code = "0";
WebAPI/ListModels.cs
@@ -846,7 +846,7 @@
        }
        /// <summary>
        /// å¤„理新增模具点检记录表子表的json
        /// å¤„理新增模具点检记录表子表 ç‚¹æ£€é¡¹ç›® çš„json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
@@ -858,6 +858,18 @@
        }
        /// <summary>
        /// å¤„理新增模具点检记录表子表 é…ä»¶ä¿¡æ¯ çš„json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsSc_MouldDotCheckBillSub_Item> getObjectByJson_Sc_MouldDotCheckBillSub_Item(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsSc_MouldDotCheckBillSub_Item> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_MouldDotCheckBillSub_Item>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增模具点检计划表主表的json
        /// ClsSc_MouldDotCheckPlanBillMain
        /// </summary>