器具维修记录单 源单类型 (手工录入 维修派工单 故障登记单 ) 根据类型去选择相对应的单据 带出数据
器具维修记录单 子表两个 页签 (维修信息 配件信息)--参考设备维修记录单
4个文件已修改
1个文件已添加
155 ■■■■ 已修改文件
DAL/生产管理/模具管理/ClsSb_MouldRepairWorkBill.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/模具管理/ClsSb_MouldRepairWorkBillSub_Item.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSb_MouldRepairWorkBill.cs
@@ -9,6 +9,7 @@
    {
        public Model.ClsSb_MouldRepairWorkBillMain omodel = new Model.ClsSb_MouldRepairWorkBillMain();
        public List<Model.ClsSb_MouldRepairWorkBillSub> DetailColl = new List<Model.ClsSb_MouldRepairWorkBillSub>();
        public List<Model.ClsSb_MouldRepairWorkBillSub_Item> DetailCol = new List<Model.ClsSb_MouldRepairWorkBillSub_Item>();
        public ClsSb_MouldRepairWorkBill()
        {
@@ -17,7 +18,7 @@
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="Sc_MouldRepairWorkBillMain";
            base.MvarReportTitle = "模具维修工单";
            base.MvarReportTitle = "模具维修记录工单";
            base.BillType = "3807";
            base.HBillSubType = "3807";
@@ -72,6 +73,7 @@
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                oCn.RunProc("delete from Sc_MouldRepairWorkBillSub_Item where HInterID=" + lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
@@ -86,6 +88,21 @@
                      + 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.HRepairID.ToString() + ",'" + oSub.HRepairExplanation + "'," + oSub.HManagerID.ToString() + "," + oSub.HMoney.ToString() + 
                      ") ");
                }
                //插入子表配件信息
                foreach (Model.ClsSb_MouldRepairWorkBillSub_Item oSub in DetailCol)
                {
                    oCn.RunProc("Insert into Sc_MouldRepairWorkBillSub_Item " +
                      " (HInterID,HEntryID,HMaterID" +
                      ",HQty,HUnitID,HQtyMust" +
                      ",HCloseMan,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() +
                      "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
                      ",'" + 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() +
                      ") ");
                }
                //
@@ -149,6 +166,21 @@
                       "," + oSub.HRepairID.ToString() + ",'" + oSub.HRepairExplanation + "'," + oSub.HManagerID.ToString() + "," + oSub.HMoney.ToString() +
                       ") ");
                }
                //插入子表配件信息
                foreach (Model.ClsSb_MouldRepairWorkBillSub_Item oSub in DetailCol)
                {
                    oCn.RunProc("Insert into Sc_MouldRepairWorkBillSub_Item " +
                      " (HInterID,HEntryID,HMaterID" +
                      ",HQty,HUnitID,HQtyMust" +
                      ",HCloseMan,HCloseType,HRemark" +
                      ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ") values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() +
                      "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
                      ",'" + 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.ClsSb_MouldRepairWorkBillSub oSub in DetailColl)
                //{
Model/Model.csproj
@@ -498,6 +498,7 @@
    <Compile Include="生产管理\模具管理\ClsGy_MouldRoutingBillMain.cs" />
    <Compile Include="生产管理\模具管理\ClsGy_MouldRoutingBillSub.cs" />
    <Compile Include="生产管理\模具管理\ClsSb_MouldRepairWorkBillMain.cs" />
    <Compile Include="生产管理\模具管理\ClsSb_MouldRepairWorkBillSub_Item.cs" />
    <Compile Include="生产管理\模具管理\ClsSb_MouldRepairWorkBillSub.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldBorrowInBillMain.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldBorrowInBillSub.cs" />
Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSb_MouldRepairWorkBillSub_Item.cs
New file
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsSb_MouldRepairWorkBillSub_Item : DBUtility.ClsXt_BaseBillSub
    {
        public long HMaterID;//    int       --配件ID
        public long HUnitID;//     int     --计量单位
        public double HQty;//       dec(18,8)       --用量
        public double HQtyMust;//    dec(18,8)     --标准用量(暂时隐藏)
    }
}
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -1485,7 +1485,7 @@
        #endregion
        #region æ¨¡å…·ç»´ä¿®å•保存/编辑
        #region æ¨¡å…·ç»´ä¿®è®°å½•单保存/编辑
        /// <summary>
        /// ä¿å­˜æ¨¡å…·ç»´ä¿®å•
        /// </summary>
@@ -1501,6 +1501,7 @@
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            string msg5 = sArray[3].ToString();
            string UserName = "";
@@ -1573,24 +1574,62 @@
                List<Model.ClsSb_MouldRepairWorkBillSub> ls = new List<Model.ClsSb_MouldRepairWorkBillSub>();
                ls = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub(msg3);
                int i = 0;
                foreach (Model.ClsSb_MouldRepairWorkBillSub oItemSub in ls)
                foreach (Model.ClsSb_MouldRepairWorkBillSub oItem in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    oItem.HEntryID = i;
                    //oItemSub.HCloseMan = "";       //行关闭
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    oItem.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItem.HCloseType = false;   //关闭类型
                    //oItemSub.HRemark = "";         //备注
                    oItemSub.HRelationQty = 0;     //关联数量
                    oItem.HRelationQty = 0;     //关联数量
                    //oItemSub.HRelationMoney = 0;   //关联金额
                    //oItemSub.HRepairID = 0;       //维修项目
                    //oItemSub.HRepairExplanation ="";   //维修要求
                    //oItemSub.HManagerID = 0;   //负责人ID
                    //oItemSub.HMoney = 0;        //维修费用
                    oBill.DetailColl.Add(oItemSub);
                    oBill.DetailColl.Add(oItem);
                }
                //配件数据
                //按 },{来拆分数组 //去掉【和】
                msg5 = msg5.Substring(1, msg5.Length - 2);
                msg5 = msg5.Replace("\\", "");
                msg5 = msg5.Replace("\n", "");  //\n
                //msg2 = msg2.Replace("'", "’");
                List<Model.ClsSb_MouldRepairWorkBillSub_Item> ls1 = new List<Model.ClsSb_MouldRepairWorkBillSub_Item>();
                ls1 = oListModels.getObjectByJson_Gy_MouldRepairWorkBillSub_Item(msg5);
                int j = 0;
                foreach (Model.ClsSb_MouldRepairWorkBillSub_Item oItemSub in ls1)
                {
                    j++;
                    oItemSub.HEntryID = j;
                    //oItemSub.HCloseMan = "";       //行关闭
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    //oItemSub.HRemark = "";         //备注
                    oItemSub.HSourceInterID = 0;     // æºå•主内码
                    oItemSub.HSourceEntryID = 0;   //源单子内码
                    //oItemSub.HSourceBillNo = "";  //源单单号
                    //oItemSub.HSourceBillType = ""; //源单类型
                    oItemSub.HRelationQty = 0;     //关联数量
                    //oItemSub.HRelationMoney = 0;   //关联金额
                    //HMaterID = "";//配件代码
                    //HUnitID = "";//单位代码
                    //HQty = "";//实际用量
                    //HQtyMust = "";//单位用量
                    //HRemark = "";//备注
                    //oItemSub.HRepairID = 0;       //维修项目
                    //oItemSub.HRepairExplanation ="";   //维修要求
                    //oItemSub.HManagerID = 0;   //负责人ID
                    //oItemSub.HMoney = 0;        //维修费用
                    oBill.DetailCol.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
                bool bResult;
@@ -1652,30 +1691,27 @@
        [HttpGet]
        public object Sb_MouldRepairWorkBillListProjectDetai(string sqlWhere)
        {
            DataSet ds;
            DataSet ds, ds1;
            List<object> list = new List<object>();
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    //ds = oCN.RunProcReturn("select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark   from Sc_MouldRepairWorkBillSub", "Sc_MouldRepairWorkBillSub");
                    ds = oCN.RunProcReturn("select HRepairID, å­ç»´ä¿®é¡¹ç›®ä»£ç  HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit", "h_v_Sc_MouldRepairWorkBillList_Edit");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                }
                else
                {
                    //string sql1 = "select HRepairID,HRepairExplanation,HManagerID,HMoney,HRemark  from Sc_MouldRepairWorkBillSub where 1 = 1 ";
                    string sql1 = "select HRepairID,子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit");
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "获取信息成功!";
                    objJsonResult.data = ds.Tables[0];
                }
                string sql = "select HRepairID,子维修项目代码 HRepairCode,子维修项目 HRepairName,子维修要求 HRepairExplanation,HManagerSonID HManagerID,子负责人代码 HManagerCode,子负责人 HManagerName,维修费用 HMoney,表体备注 HRemark,源单主内码 HSourceInterID,源单子内码 HSourceEntryID,源单单号 HSourceBillNo,源单类型 HSourceBillType   from h_v_Sc_MouldRepairWorkBillList_Edit where 1 = 1 "+ sqlWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldRepairWorkBillList_Edit");
                string sql1 = "select é…ä»¶ID HMaterID, é…ä»¶ä»£ç  HMaterNumber,配件名称 HMaterName,规格型号 HMaterSpec,单位ID HUnitID,计量单位代码 HUnitNumber,计量单位名称 HUnitName,用量 HQty,标准用量 HQtyMust,子备注1 HRemark,规格型号 HMaterSpec  from h_v_Sc_MouldRepairWorkBillSub_Item  where 1 = 1 " + sqlWhere ;
                ds1 = oCN.RunProcReturn(sql1, "h_v_Sc_MouldRepairWorkBillSub_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)
            {
WebAPI/ListModels.cs
@@ -482,7 +482,7 @@
        /// <summary>
        /// å¤„理新增模具维修子表的json
        /// å¤„理新增模具维修子表保养信息的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
@@ -494,6 +494,18 @@
        }
        /// <summary>
        /// å¤„理新增模具维修子表配件信息的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsSb_MouldRepairWorkBillSub_Item> getObjectByJson_Gy_MouldRepairWorkBillSub_Item(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsSb_MouldRepairWorkBillSub_Item> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_MouldRepairWorkBillSub_Item>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增模具维修验收单主表的json
        /// </summary>
        /// <param name="jsonString"></param>