yusijie
2023-11-15 c022f537f5b80dbe5294c0ea40e2d7933d4f4ce4
设备
5个文件已修改
1个文件已添加
232 ■■■■■ 已修改文件
Model/生产管理/设备管理/ClsSb_EquipRepairCheckBillMain.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipConkBookBillController.cs 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_SOPBillController.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipRepairCheckBillMain.cs
@@ -15,6 +15,7 @@
        public string HExplanation;
        public string HInnerBillNo;
        public int HMouldRepairWorkID;
        public string HRepairCheckMainContent;
        public int HRepairCheckMainID;
    }
WebAPI/Controllers/SBGL/Sb_EquipConkBookBillController.cs
New file
@@ -0,0 +1,173 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class Sb_EquipConkBookBillController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public WebServer webserver = new WebServer();
        #region è®¾å¤‡æ•…障登记单保存/编辑
        /// <summary>
        /// ä¿å­˜è®¾å¤‡æ•…障登记单
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("Sb_EquipConkBookBill/SaveSb_EquipConkBookBillList")]
        [HttpPost]
        public object SaveSb_EquipConkBookBillList([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            Int64 OperationType = Convert.ToInt64(sArray[3]);
            //string UserName = "";
            ListModels oListModels = new ListModels();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipConkBookBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DLL.ClsSb_EquipConkBookBill oBill = new DLL.ClsSb_EquipConkBookBill();
                List<Model.ClsSb_EquipConkBookBillMain> lsmain = new List<Model.ClsSb_EquipConkBookBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_EquipConkBookBillMain(msg2);
                foreach (Model.ClsSb_EquipConkBookBillMain oItem in lsmain)
                {
                    //oItem.HMaker = "";
                    //UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "3097";
                    oItem.HBillSubType = "3097";
                    //oItem.HBillNo = "";    //单据号
                    //oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --日期
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    //oItem.HEquipID = 0;    //设备ID(Gy_EquipMent)
                    //oItem.HPeriod = 0;
                    //oItem.HRepairBeginDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));  //  --维修开始日期
                    //oItem.HRepairEndDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));//  --维修结束日期
                    //oItem.HRepairContent = "";  //维修内容
                    //oItem.HCycleUnit = "";     //时间单位(小时,天)
                    //oItem.HPlanTimes = 0;       //计划维修工时
                    //oItem.HTimes = 0;          //实际维修工时
                    //oItem.HEmpID = 0;           //维修人(Gy_Employee)
                    //oItem.HManagerID = 0;      //主管(Gy_Employee)
                    //oItem.HDeptID = 0;        //维修部门(Gy_Department)
                    //oItem.HExplanation = ""; //--维修要求
                    //oItem.HInnerBillNo = "";  //  --内部单据号
                    //oItem.HMouldID = 0;      //成品模具ID
                    //oItem.HSupID = 0;       //--供应商(Gy_Supplier)
                    //oItem.HRepairType = ""; //--维修类型(内部维修,委外维修)       addnew
                    //oItem.HNewModel = "";    //维修后新规格
                    //oItem.HNewDesignLife = 0;  //新设计寿命
                    //oItem.HRepairID = 0; //维修项目(Gy_Repair)
                    //oItem.HRemark = "";   //备注
                    //oItem.HMainSourceInterID = oItem.HInterID;
                    //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo);
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有单据日期,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                //表体数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                //msg2 = msg2.Replace("'", "’");
                List<Model.ClsSb_EquipConkBookBillSub> ls = new List<Model.ClsSb_EquipConkBookBillSub>();
                ls = oListModels.getObjectByJson_Gy_EquipConkBookBillSub(msg3);
                int i = 0;
                foreach (Model.ClsSb_EquipConkBookBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    //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;   //关联金额
                    //oItemSub.HRepairID = 0;       //维修项目
                    //oItemSub.HRepairExplanation ="";   //维修要求
                    //oItemSub.HManagerID = 0;   //负责人ID
                    //oItemSub.HMoney = 0;        //维修费用
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (OperationType == 1)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/WebAPIController.cs
@@ -4209,6 +4209,12 @@
                    case "WX":
                        HView = "h_v_Sb_EquipRepairCheckBillList";
                        break;
                    case "GZ":
                        HView = "h_v_Sb_EquipConkBookBillList";
                        break;
                    case "YS":
                        HView = "h_v_Sb_EquipRepairCheckBillList";
                        break;
                    default:
                        objjson.code = "0";
                        objjson.count = 0;
@@ -4218,7 +4224,7 @@
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                string sql = string.Format(@"select * from " + HView + " where 1 = 1 ");
                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere);
                ds = oCN.RunProcReturn(sql, HView);
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -4229,9 +4235,9 @@
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败,查无数据" + DBUtility.ClsPub.sErrInfo;
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取失败,查无数据";
                    objjson.data = null;
                    objjson.list = columnNameList;
                    return objjson;
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_SOPBillController.cs
@@ -179,5 +179,42 @@
            }
        }
        /// <summary>
        /// æ ¹æ®ç‰©æ–™ï¼Œå·¥å•查找作业指导书
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Gy_SopBill/getListByMaterID")]
        [HttpGet]
        public object getListByMaterID(Int64 HMaterID, string HSourceNo)
        {
            try
            {
                var sWhere = "";
                if (Convert.ToInt32(HMaterID) != 0 && HMaterID.ToString() != "" && HSourceNo != null && HSourceNo.ToString() != "" )
                {
                    sWhere += " and HMaterID = " + HMaterID + " and HSourceNo = '" + HSourceNo + "'";
                }
                string sql1 = string.Format(@"select * from h_v_Sc_ICMOBillList_ToSop where 1 = 1 " + sWhere);
                ds = oCN.RunProcReturn(sql1, "h_v_Sc_ICMOBillList_ToSop");
                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;
            }
        }
    }
}
WebAPI/DLL/ClsSb_EquipRepairCheckBill.cs
@@ -99,12 +99,12 @@
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HEquipID,HExplanation,HInnerBillNo,HEmpID" +
                ",HManagerID,HDeptID,HCheckResult,HCheckBeginDate,HMouldRepairWorkID" +
                ",HManagerID,HDeptID,HCheckResult,HCheckBeginDate,HMouldRepairWorkID,HRepairCheckMainID,HRepairCheckMainContent" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HMaker+ "',getdate()" +
                ", " + omodel.HEquipID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HEmpID.ToString() +
                "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HCheckResult + "','" + omodel.HCheckBeginDate + "'," + omodel.HMouldRepairWorkID +
                "," + omodel.HManagerID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HCheckResult + "','" + omodel.HCheckBeginDate + "'," + omodel.HMouldRepairWorkID + "," + omodel.HRepairCheckMainID + ",'" + omodel.HRepairCheckMainContent + "'" +
                ") ");
                ////插入子表
                foreach (Model.ClsSb_EquipRepairCheckBillSub oSub in DetailColl)
WebAPI/WebAPI.csproj
@@ -414,6 +414,7 @@
    <Compile Include="Controllers\MJGL\Sc_MouldScrapRequestBillController.cs" />
    <Compile Include="Controllers\MJGL\Sc_MouldStatusChangeBillController.cs" />
    <Compile Include="Controllers\Pay_ReportController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipConkBookBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipSparepartsBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipSparepartsChangeBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipStatusChangeBillController.cs" />