zrg
2024-05-13 ef10f06e96034f6ab3db93ea103f2a4d78fcb2b9
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
26个文件已修改
453 ■■■■ 已修改文件
DAL/生产管理/模具管理/ClsSc_MouldMaintainBill.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/模具管理/ClsSc_MouldMaintainPlanBill.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/模具管理/ClsSc_MouldMaintainRuleBill.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/设备管理/ClsSb_EquipMaintainBill.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/设备管理/ClsSb_EquipMaintainPlanBill.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/模具管理/ClsSc_MouldMaintainBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/模具管理/ClsSc_MouldMaintainPlanBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/模具管理/ClsSc_MouldMaintainRuleBillMain.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/设备管理/ClsSb_EquipMaintainBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/设备管理/ClsSb_EquipMaintainPlanBillMain.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipBeginBillController.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_Cg_PODemandPlanBillController.cs 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_ProcessMangementController.cs 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsSb_EquipMaintainRuleBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainBill.cs
@@ -57,7 +57,8 @@
                ",HEndDate='" + omodel.HEndDate + "'" +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HMouldMaintainRuleInterID="+omodel.HMouldMaintainRuleInterID.ToString()+
                ",HMouldMaintainRuleInterID=" + omodel.HMouldMaintainRuleInterID.ToString() +
                ",HMaintainLevID=" + omodel.HMaintainLevID +
                //",HDeptID=" + omodel.HDeptID.ToString() +
                //",HDeptNumber='" + omodel.HDeptNumber +"'"+
                //",HEmpID=" + omodel.HEmpID.ToString() +
@@ -146,13 +147,13 @@
                ",HYear,HPeriod,HRemark" +
                ",HPlanNo,HPlanInterID,HMouldID,HBeginDate"+
                ",HEndDate"+
                ",HInnerBillNo,HExplanation,HMouldMaintainRuleInterID" +
                ",HInnerBillNo,HExplanation,HMouldMaintainRuleInterID,HMaintainLevID" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                ",'" + omodel.HPlanNo + "'," + omodel.HPlanInterID.ToString() + "," + omodel.HMouldID.ToString() + ",'" + omodel.HBeginDate + "'" +
                ",'" + omodel.HEndDate + "'"+
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'," +omodel.HMouldMaintainRuleInterID.ToString()+
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'," +omodel.HMouldMaintainRuleInterID.ToString() + "," + omodel.HMaintainLevID +
                ") ");
                if (DetailCol.Count > 0)
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainPlanBill.cs
@@ -64,7 +64,7 @@
                ",HEndDate='" + omodel.HEndDate + "'" +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HMaintainLevID=" + omodel.HMaintainLevID +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
@@ -143,12 +143,12 @@
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + 
                ",HYear,HPeriod,HRemark" +
                ",HCycleUnit,HCheckCycle,HBeginDate,HEndDate"+
                ",HInnerBillNo,HExplanation,HMouldMaintainRuleID" +
                ",HInnerBillNo,HExplanation,HMouldMaintainRuleID,HMaintainLevID" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "'" +
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation + "'" + "','" + omodel.HMouldMaintainRuleID + "'" +
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation  + "','" + omodel.HMouldMaintainRuleID + "'," + omodel.HMaintainLevID +
                ") ");
                //插入子表配件信息
                foreach (Model.ClsSc_MouldMaintainPlanBillSub oSub in DetailColl)
@@ -180,7 +180,7 @@
                          ",'" + Item.HMaintainPart.ToString() + "','" + Item.HClaim.ToString() + "'" +
                          "," + Item.HManagerID.ToString() +
                          ",'" + Item.HCloseMan + "'," + Convert.ToString(Item.HCloseType ? 1 : 0) + ",'" + Item.HRemark + "'" +
                          "," + Item.HSourceInterID.ToString() + "," + Item.HSourceEntryID.ToString() + ",'" + Item.HSourceBillNo + "','" + Item.HSourceBillType + "'," + Item.HRelationQty.ToString() + "," + Item.HRelationMoney.ToString()  +"," + Item.HMaintainItem.ToString() +
                          "," + Item.HSourceInterID.ToString() + "," + Item.HSourceEntryID.ToString() + ",'" + Item.HSourceBillNo + "','" + Item.HSourceBillType + "'," + Item.HRelationQty.ToString() + "," + Item.HRelationMoney.ToString()  +",'" + Item.HMaintainItem.ToString() + "'" +
                          ") ");
                }
                //
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainRuleBill.cs
@@ -56,6 +56,7 @@
                ",HCheckCycle=" + omodel.HCheckCycle.ToString() +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HMaintainLevID=" + omodel.HMaintainLevID +
                " where HInterID=" + lngBillKey.ToString());                
                //删除关联
                //DeleteRelation(ref sReturn, lngBillKey);
@@ -116,11 +117,11 @@
                oCn.RunProc("Insert Into Sc_MouldMaintainRuleBillMain" +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
                ",HCycleUnit,HCheckCycle,HExplanation,HInnerBillNo" +
                ",HCycleUnit,HCheckCycle,HExplanation,HInnerBillNo,HMaintainLevID" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'" +
                ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HMaintainLevID +
                ") ");
                ////插入子表
                foreach (Model.ClsSc_MouldMaintainRuleBillSub oSub in DetailColl_Mater)
DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipMaintainBill.cs
@@ -69,7 +69,8 @@
                ",HPlanNo='" + omodel.HPlanNo + "'" +
                ",HExplanation='" + omodel.HExplanation+"'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo+"'" +
                ",HEquipMaintainRuleInterID="+omodel.HEquipMaintainRuleInterID.ToString()+
                ",HEquipMaintainRuleInterID=" + omodel.HEquipMaintainRuleInterID.ToString()+
                ",HMaintainLevID=" + omodel.HMaintainLevID +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
@@ -173,11 +174,11 @@
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
                ",HYear,HPeriod,HRemark,HEquipID" +
                ",HBeginDate,HEndDate,HPlanNo,HExplanation,HInnerBillNo,HEquipMaintainRuleInterID" +
                ",HDeptID" +
                ",HDeptID,HMaintainLevID" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
                ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," +omodel.HEquipMaintainRuleInterID.ToString() + "," + omodel.HDeptID +
                ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "','" + omodel.HPlanNo + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," +omodel.HEquipMaintainRuleInterID.ToString() + "," + omodel.HDeptID + "," + omodel.HMaintainLevID +
                ") ");
                //插入配件子表
                foreach (Model.ClsSb_EquipMaintainBillSub oSub in DetailColl)
DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipMaintainPlanBill.cs
@@ -55,6 +55,7 @@
                ",HCheckCycle=" + omodel.HCheckCycle.ToString() +
                ",HExplanation='" + omodel.HExplanation+"'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo+"'" +
                ",HMaintainLevID=" + omodel.HMaintainLevID +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
@@ -121,11 +122,11 @@
                oCn.RunProc("Insert Into Sb_EquipMaintainPlanBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
                ",HYear,HPeriod,HRemark,HEquipID" +
                ",HBeginDate,HEndDate,HCheckCycle,HCycleUnit,HExplanation,HInnerBillNo,HMouldMaintainRuleID" +
                ",HBeginDate,HEndDate,HCheckCycle,HCycleUnit,HExplanation,HInnerBillNo,HMouldMaintainRuleID,HMaintainLevID" +
                ") "+
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
                ",'" + omodel.HBeginDate +"','" +omodel.HEndDate + "'," + omodel.HCheckCycle.ToString() +",'"+ omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo +"','" + omodel.HMouldMaintainRuleID + "'" +
                ",'" + omodel.HBeginDate +"','" +omodel.HEndDate + "'," + omodel.HCheckCycle.ToString() +",'"+ omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo +"','" + omodel.HMouldMaintainRuleID + "'," + omodel.HMaintainLevID +
                ") ");
                if (DetailColl != null)
                {
Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainBillMain.cs
@@ -15,5 +15,7 @@
        public string HExplanation;//       --ÕªÒª
        public string HInnerBillNo;//       --内部单据号
        public int HMouldMaintainRuleInterID;
        public Int64 HMaintainLevID; //保养级别(gy_HMaintainLev)
    }
}
Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainPlanBillMain.cs
@@ -15,5 +15,7 @@
        public string HExplanation;//    varchar(500)   --ÕªÒª
        public string HInnerBillNo;//    varchar(50)       --内部单据号
        public int HMouldMaintainRuleID; //器具保养规程id
        public Int64 HMaintainLevID; //保养级别(gy_HMaintainLev)
    }
}
Model/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainRuleBillMain.cs
@@ -10,7 +10,7 @@
        public Int64 HCheckCycle;//  int        --保养周期 
        public string HExplanation;//    varchar(500)   --ÕªÒª
        public string HInnerBillNo;//    varchar(50)       --内部单据号
        public Int64 HMaintainLevID; //保养级别(gy_HMaintainLev)
    }
}
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipMaintainBillMain.cs
@@ -17,5 +17,7 @@
        public int HEquipMaintainPlanInterID; //设备保养计划单(Sb_EquipMaintainPlanBillSub_Plan)主内码
        public int HEquipMaintainPlanEntryID; //设备保养计划单(Sb_EquipMaintainPlanBillSub_Plan)子内码
        public Int64 HMaintainLevID; //保养级别(gy_HMaintainLev)
    }
}
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipMaintainPlanBillMain.cs
@@ -14,7 +14,7 @@
        public string HExplanation;
        public string HInnerBillNo;
        public int HMouldMaintainRuleID; //保养规程id
        public Int64 HMaintainLevID; //保养级别(gy_HMaintainLev)
    }
}
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -685,6 +685,21 @@
                //反写工序出站单的合格数量
                oCN.RunProc("update Sc_StationOutBillMain set HQty+=1  where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HInterID=" + HInterID);
                ds = oCN.RunProcReturn($@"select (b.HQty -sum(isnull(ou.HQty,0))-sum(isnull(ou.HBadCount,0))) HQty from Sc_ProcessExchangeBillSub b WITH(NOLOCK)
left join Sc_StationOutBillMain ou WITH(NOLOCK) on b.HInterID=ou.HProcExchInterID and b.HEntryID=ou.HProcExchEntryID
where b.HInterID={HProcExchInterID} and b.HEntryID={HProcExchEntryID}
group by b.HInterID,b.HEntryID,b.HQty", "Sc_ProcessExchangeBill_Out");
                if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "出站数量超过流转卡数量!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();
                objJsonResult.code = "1";
@@ -1502,9 +1517,28 @@
//                        }
                        oCN.RunProc("update Gy_BarCodeBill set HStatus='' where HBarCode='" + model.HBarCode + "'");
                        DataSet dataSet = oCN.RunProcReturn($"select top 1 HInterID  from Sc_StationOutBillMain where HProcExchInterID={subLsit[0].HProcExchInterID} and HProcExchEntryID={subLsit[0].HProcExchEntryID} and HBadCount>0", "Sc_StationOutBillMain");
                        if (dataSet.Tables[0].Rows.Count > 0)
                        {
                            string HOutInterID = dataSet.Tables[0].Rows[0][0].ToString();
                            oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1 where HInterID='" + HOutInterID + "'");
                        }
                        else
                        {
                            oCN.RollBack();
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败,当前流转卡当前工序的出站单没有不良数量!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else {
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败,无结果!";
WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs
@@ -214,7 +214,7 @@
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from Sc_MouldMaintainRuleBillMain  where HInterID= " + HID + " ", "Sc_MouldMaintainRuleBillMain");
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sc_MouldMaintainRuleBill_Edit  where HInterID= " + HID + " ", "h_v_Sc_MouldMaintainRuleBill_Edit");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在器具保养规程记录" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
@@ -49,22 +49,12 @@
                    ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipFileMainList");
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception e)
            {
@@ -104,8 +94,18 @@
                return objJsonResult;
            }
            DLL.ClsGy_EquipFileMain oBill = new DLL.ClsGy_EquipFileMain();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            ds = oCN.RunProcReturn("select * from Gy_EquipFileBillMain where HInterID=" + HItemID, "Gy_EquipFileBillMain");
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据当前处于不能删除状态!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.RunProc("Delete From Gy_EquipFileBillMain  where HInterID=" + lngBillKey);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs
@@ -37,24 +37,14 @@
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_EquipFileType where 1=1 " + sWhere+ " order by HItemID ", "Gy_EquipFileType");
                ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag,HMakeEmp,HMakeTime,HCheckEmp,HCheckTime,HModifyEmp,HModifyTime,HCloseEmp,HCloseTime from Gy_EquipFileType where 1=1 " + sWhere+ " order by HItemID ", "Gy_EquipFileType");
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -94,8 +84,18 @@
                return objJsonResult;
            }
            DLL.ClsGy_EquipTypeBill oBill = new DLL.ClsGy_EquipTypeBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            ds = oCN.RunProcReturn("select * from Gy_EquipFileType where HItemID=" + HItemID, "Gy_EquipFileType");
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["HCloseEmp"].ToString() != "" || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据当前处于不能删除状态!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.RunProc("Delete From Gy_EquipFileType  where HItemID=" + lngBillKey);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -174,9 +174,9 @@
                //主表
                oCN.RunProc("Insert into Gy_EquipFileType " +
                   " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                   ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime) " +
                   ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HMakeEmp) " +
                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID +
                   "," + HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo);
                   "," + HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate(),'" + msg4 + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCN.RunProc("Update Gy_EquipFileType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCN.Commit();
@@ -269,6 +269,8 @@
                    ",HShortNumber='" + HShortNumber + "'" +
                    ",HHelpCode='" + HHelpCode + "'" +
                    ",HParentID=" + HParentID +
                    ",HModifyTime=getdate()" +
                    ",HModifyEmp='" + msg4 + "'" +
                    ",HStopflag='" + HStopflag + "'" +
                    ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
WebAPI/Controllers/SBGL/Sb_EquipBeginBillController.cs
@@ -738,7 +738,62 @@
        }
        #endregion
        #region è®¾å¤‡å¼€æœºå•列表PDA æŸ¥è¯¢
        [Route("Sb_EquipBeginBill/Sb_EquipBeginBillList_PDA")]
        [HttpGet]
        public object Sb_EquipBeginBillList_PDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipBeginBillMain_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查询失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipBeginBillList_PDA order by å•据号 desc", "h_v_Sb_EquipBeginBillList_PDA");
                }
                else
                {
                    string sql1 = "select * from  h_v_Sb_EquipBeginBillList_PDA  where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipBeginBillList_PDA");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/SBGL/Sb_EquipDotCheckRuleBillController.cs
@@ -110,9 +110,10 @@
                return objJsonResult;
            }
            DLL.ClsSb_EquipDotCheckRuleBill oBill = new DLL.ClsSb_EquipDotCheckRuleBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            ds = oCN.RunProcReturn("select * from Sb_EquipDotCheckRuleBillMain where HInterID=" + HInterID, "Sb_EquipDotCheckRuleBillMain");
            if (ds.Tables[0].Rows.Count>0)
            {
                if (oBill.omodel.HBillStatus > 1)
                if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString())  > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
WebAPI/Controllers/SBGL/Sb_EquipMaintainPlanBillController.cs
@@ -1,4 +1,5 @@
using DBUtility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -26,6 +27,7 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipMaintainPlanBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -46,11 +48,19 @@
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_EquipMaintainPlan");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
@@ -99,9 +99,10 @@
                return objJsonResult;
            }
            DLL.ClsSb_EquipMaintainRuleBill oBill = new DLL.ClsSb_EquipMaintainRuleBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            ds = oCN.RunProcReturn("select * from Sb_EquipMaintainRuleBillMain where HItemID=" + HInterID, "Sb_EquipMaintainRuleBillMain");
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (oBill.omodel.HBillStatus > 1)
                if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -109,7 +110,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.omodel.HChecker != ""&& oBill.omodel.HChecker != null)
                if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -200,9 +201,9 @@
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from Sb_EquipMaintainRuleBillMain  where HInterID= " + HID + " ", "Sb_EquipMaintainRuleBillMain");
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipMaintainRuleBillList  where HInterID= " + HID + " ", "h_v_Sb_EquipMaintainRuleBillList");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在点检计划表" };
                return new ApiResult<DataSet> { code = -1, msg = "不存在保养规程表" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        #endregion
WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs
@@ -738,7 +738,62 @@
        }
        #endregion
        #region è®¾å¤‡åœæœºå•列表PDA æŸ¥è¯¢
        [Route("Sb_EquipStopBill/Sb_EquipStopBillList_PDA")]
        [HttpGet]
        public object Sb_EquipStopBillList_PDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipStopBillMain_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查询失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sb_EquipStopBillList_PDA order by å•据号 desc", "h_v_Sb_EquipStopBillList_PDA");
                }
                else
                {
                    string sql1 = "select * from  h_v_Sb_EquipStopBillList_PDA  where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by å•据号 desc";
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipStopBillList_PDA");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_Cg_PODemandPlanBillController.cs
@@ -7,6 +7,7 @@
using System.Web.Http;
using WebAPI.Models;
using Newtonsoft.Json;
using DBUtility;
namespace WebAPI.Controllers.SCGL
{
@@ -18,6 +19,7 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        JIT_Cg_PODemandPlanBillMain omdelMian = new JIT_Cg_PODemandPlanBillMain();
        List<JIT_Cg_PODemandPlanBillSub> omodelsub = new List<JIT_Cg_PODemandPlanBillSub>();
        public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill();
        #region ææ–™è®¡åˆ’单 åˆ—表
        [Route("JIT_Cg_PODemandPlanBill/JIT_Cg_PODemandPlanBillList")]
@@ -260,6 +262,117 @@
        }
        #endregion
        #region ææ–™è®¡åˆ’单 å®¡æ ¸/反审核功能
        [Route("JIT_Cg_PODemandPlanBill/CheckPODemandPlanBillList")]
        [HttpGet]
        public object CheckPODemandPlanBillList(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "提料计划单无权限审核!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (string.IsNullOrWhiteSpace(HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "JIT_Cg_PODemandPlanBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    //判断单据是否已经审核
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不需要再审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    //审核单据
                    if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                else
                {
                    //判断单据是否已经反审核
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已反审核!不需要再反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    //反审核单据
                    if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    {
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ææ–™è®¡åˆ’单 å…³é—­
        [Route("JIT_Cg_PODemandPlanBill/ClosePODemandPlanBillList")]
        [HttpGet]
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -425,6 +425,7 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainPlanBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -436,12 +437,21 @@
                ds = Sc_MouldMaintainPlanBillList_s(sWhere);
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
                //else
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -482,6 +482,8 @@
        {
            try
            {
                LogService.Write("生产汇报单进入同步方法,汇报单号:" + BillNo);
                string sErr = "";
                oSystemParameter.ShowBill(ref sErr);
@@ -495,6 +497,7 @@
                DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc");
                if (ds.Tables[0].Rows.Count <= 0)
                {
                    LogService.Write("生产汇报单回滚,汇报单号:" + BillNo + "   åŽŸå› ï¼šç”Ÿæˆç”Ÿäº§æ±‡æŠ¥å•è¿‡ç¨‹ä¸­æ²¡æœ‰æŸ¥è¯¢åˆ°å‡ºç«™å•");
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "生成生产汇报单过程中没有查询到出站单";
@@ -505,9 +508,10 @@
                //保存
                oCN.BeginTran();
                DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain where HBillNo='{HBillNo}'", "Sc_ICMOReportBillMain");
                DataSet DsTable = oCN.RunProcReturn($"select * from Sc_ICMOReportBillMain with(nolock) where HBillNo='{HBillNo}'", "Sc_ICMOReportBillMain");
                if (DsTable.Tables[0].Rows.Count > 0)
                {
                    LogService.Write("生产汇报单回滚,汇报单号:" + BillNo + "   åŽŸå› ï¼šå·²å…¥åº“,请不要重复入库");
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "已入库,请不要重复入库";
@@ -550,6 +554,7 @@
                var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                if (isSuccess == 0)
                {
                    LogService.Write("生产汇报单回滚,汇报单号:" + BillNo + "   åŽŸå› ï¼šæ“ä½œå¤±è´¥,金蝶账号登录异常");
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "操作失败,金蝶账号登录异常。" + loginRet;
@@ -643,6 +648,7 @@
                if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                {
                    LogService.Write("工序汇报单入库错误jsonRoot:" + jsonRoot);
                    LogService.Write("生产汇报单保存失败,汇报单号:" + BillNo + "   åŽŸå› ï¼š" + result);
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -663,10 +669,11 @@
                result2 = InvokeHelper.Audit("PRD_MORPT", JsonConvert.SerializeObject(json));//提交
                if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                {
                    LogService.Write("生产汇报单提交失败,汇报单号:" + BillNo + "   åŽŸå› ï¼š" + result1);
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = $"生产汇报单单号:{fBillNo},提交失败" + result;
                    objJsonResult.Message = $"生产汇报单单号:{fBillNo},提交失败" + result1;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
@@ -674,6 +681,9 @@
                oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where  HBillNo='" + BillNo + "'");
                oCN.Commit();
                LogService.Write("生产汇报单保存成功,汇报单号:" + BillNo );
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
@@ -682,6 +692,7 @@
            }
            catch (Exception e)
            {
                LogService.Write("生产汇报单同步发生异常,汇报单号:" + BillNo + "    " + e.ToString());
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
@@ -768,6 +779,7 @@
        {
            try
            {
                LogService.Write("生产入库单进入同步方法:" + "  å…¥åº“单号:" + BillNo);
                //获取生产汇报单最大InterID和单据号
                Int64 HInterID = DBUtility.ClsPub.CreateBillID("1202", ref DBUtility.ClsPub.sExeReturnInfo);
                string HBillNo = DBUtility.ClsPub.CreateBillCode("1202", ref DBUtility.ClsPub.sExeReturnInfo, true);
@@ -778,10 +790,11 @@
                //DataRow dr = ds.Tables[0].Rows[0];
                //判断入库的合格数量是否为0
                var DTable = oCN.RunProcReturn("select * from  Sc_StationOutBillMain where HBillNo='" + BillNo + "' ", "Sc_StationOutBillMain").Tables[0];
                var DTable = oCN.RunProcReturn("select * from Sc_StationOutBillMain with(nolock) where HBillNo='" + BillNo + "' ", "Sc_StationOutBillMain").Tables[0];
                if (double.Parse(DTable.Rows[0]["HQty"].ToString()) == 0)
                {
                    LogService.Write("同步金蝶生产生产入库单回滚--出站单号:" + BillNo + "  å›žæ»šåŽŸå› ï¼šåˆæ ¼æ•°é‡ä¸º0,不需要入库!");
                    objJsonResult.code = "1";
                    objJsonResult.count = 2;
                    objJsonResult.Message = "合格数量为0,不需要入库!";
@@ -827,6 +840,7 @@
                var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
                if (isSuccess == 0)
                {
                    LogService.Write("同步金蝶生产入库单回滚--出站单号:" + BillNo + "  å›žæ»šåŽŸå› ï¼šæ“ä½œå¤±è´¥,金蝶账号登录异常");
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "操作失败,金蝶账号登录异常。" + loginRet;
@@ -839,6 +853,7 @@
                if (ds1 == null || ds1.Tables[0].Rows.Count == 0)
                {
                    LogService.Write("同步金蝶生产入库单回滚--出站单号:" + BillNo + "  å›žæ»šåŽŸå› ï¼šæœªæ‰¾åˆ°å¯¹åº”çš„æœ¬åœ°æˆ–é‡‘è¶äº‘ç”Ÿäº§æ±‡æŠ¥å•è®°å½•;1.未查询到对应的生产汇报单;2.请确保当前工序是末道工序3.汇报单对应的入库数量已满 è¯·åœ¨é‡‘蝶云查看入库记录!");
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未找到对应的本地或金蝶云生产汇报单记录;1.未查询到对应的生产汇报单;2.请确保当前工序是末道工序3.汇报单对应的入库数量已满 è¯·åœ¨é‡‘蝶云查看入库记录!";
@@ -849,6 +864,7 @@
                DataRow dr1 = ds1.Tables[0].Rows[0];
                if (double.Parse(dr1[0].ToString()) <= 0)
                {
                    LogService.Write("同步金蝶生产入库单回滚--出站单号:" + BillNo + "  å›žæ»šåŽŸå› ï¼šæœªæ‰¾åˆ°å¯¹åº”çš„ç”Ÿäº§æ±‡æŠ¥å•è®°å½•;1.未查询到对应的生产汇报单;2.请确保当前工序是末道工序3.汇报单对应的入库数量已满 è¯·åœ¨é‡‘蝶云查看入库记录!");
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "未找到对应的生产汇报单记录;1.未查询到对应的生产汇报单;2.请确保当前工序是末道工序3.汇报单对应的入库数量已满 è¯·åœ¨é‡‘蝶云查看入库记录!";
@@ -868,6 +884,7 @@
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            LogService.Write("同步金蝶生产入库单回滚--出站单号:" + BillNo + "  å›žæ»šåŽŸå› ï¼šå½“å‰å‡ºç«™å•å·å·²å…¥åº“,请不要重新入库!");
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "当前出站单号已入库,请不要重新入库!";
@@ -876,7 +893,7 @@
                        }
                        //判断金蝶云生产汇报单 æ•°é‡ æ˜¯å¦ å¤§äºŽ æœ«é“出站数量
                        ds = oCN.RunProcReturn($@"select sum(FFinishQty)-sum(FSTOCKINQUASELQTY)-(select HQty from Sc_StationOutBillMain where HBillNo='{BillNo}')
                        ds = oCN.RunProcReturn($@"select sum(FFinishQty)-sum(FSTOCKINQUASELQTY)-(select HQty from Sc_StationOutBillMain with(nolock) where HBillNo='{BillNo}')
                        from  AIS20220308151944..T_PRD_MORPT rpt3 
                        left join AIS20220308151944..T_PRD_MORPTENTRY  rpt2 on rpt3.FID = rpt2.FID
                        left join AIS20220308151944..T_PRD_MORPTENTRY_A  rpt1 on rpt2.FID = rpt1.FID
@@ -884,6 +901,7 @@
                        if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0)
                        {
                            LogService.Write("同步金蝶生产入库单回滚--出站单号:" + BillNo + "  å›žæ»šåŽŸå› ï¼šé‡‘è¶äº‘æ±‡æŠ¥æ•°é‡å°äºŽæœ¬åœ°å‡ºç«™æ•°é‡!");
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "金蝶云汇报数量小于本地出站数量!";
@@ -896,6 +914,7 @@
                        {
                            if (item["HWYID"].ToString() == null || item["HWYID"].ToString() == "" || item["HWYID"].ToString() == "undefined")
                            {
                                LogService.Write("同步金蝶生产入库单回滚--出站单号:" + BillNo + "  å›žæ»šåŽŸå› ï¼šå”¯ä¸€ID为空,请重新手动入库或联系管理员!");
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "唯一ID为空,请重新手动入库或联系管理员!";
@@ -1045,8 +1064,8 @@
                string result = InvokeHelper.Save("PRD_INSTOCK", JsonConvert.SerializeObject(jsonRoot));//保存
                //判断保存是否成功
                if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                {
                    LogService.Write("生产入库错误jsonRoot:" + jsonRoot);
                {
                    LogService.Write("生产入库保存错误jsonRoot:" + jsonRoot + "  å…¥åº“单号:" + BillNo);
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -1067,6 +1086,7 @@
                //result2 = InvokeHelper.Audit("PRD_INSTOCK", JsonConvert.SerializeObject(json));//提交
                if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
                {
                    LogService.Write("生产入库提交错误jsonRoot:" + jsonRoot + "  å…¥åº“单号:" + BillNo);
                    oCN.RollBack();
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -1076,7 +1096,7 @@
                }
                oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where  HBillNo='" + BillNo + "'");
                LogService.Write("生产入库同步成功:" + "  å…¥åº“单号:" + BillNo);
                oCN.Commit();
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -1086,6 +1106,7 @@
            }
            catch (Exception e)
            {
                LogService.Write("生产入库同步发生异常:" + "  å…¥åº“单号:" + BillNo + "    " + e.ToString());
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
WebAPI/Controllers/WebAPIController.cs
@@ -12757,7 +12757,7 @@
                ds = oCn.RunProcReturn(sql, "Gy_MenuDefineSet");        //查询当前用户的自定义菜单数据
                if (ds.Tables[0]==null || ds.Tables[0].Rows.Count == 0) //判断当前用户是否有设置过自定义信息,若记录数为0,则没有设置过,加载所有的菜单信息
                {
                    sql = "Select * from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition ";
                    sql = "Select * from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition,len(HitemID),HitemID  ";
                    ds = oCn.RunProcReturn(sql, "Gy_Menu");
                }
WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -327,12 +327,12 @@
                //主表
                oCN.RunProc(@"Insert Into Sc_ICMOBillMain   
                        (HBillType,HInterID,HBillNo,HDate,HPRDORGID
                        ,HYear,HPeriod,HRemark,HMaker,HMakeDate
                        ,HYear,HPeriod,HRemark,HMaker,HMakeDate,HChecker,HCheckDate
                        ,HSeOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HEmpID,HCusID
                        ,HCenterID,HPlanQty,HDeptID,HMaterID,HUnitID,HBomID,HPlanBeginDate,HPlanEndDate,HBillStatus
                        ,HOWNERID,HOWNERTYPEID)
                        values('3710'," + mainList[0].HInterID + ",'" + mainList[0].HBillNo + "','" + mainList[0].HDate + "'," + mainList[0].HPRDORGID +
                "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + mainList[0].HRemark + "','" + mainList[0].HMaker + "',getdate()" +
                "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + mainList[0].HRemark + "','" + mainList[0].HMaker + "',getdate(),'" + mainList[0].HMaker + "',getdate()" +
                ",'" + mainList[0].HSeOrderBillNo + "'," + mainList[0].HSeOrderInterID + "," + mainList[0].HSeOrderEntryID + "," + mainList[0].HEmpID + "," + mainList[0].HCusID +
                "," + mainList[0].HCenterID + "," + mainList[0].HPlanQty + ",0,0,0,0,'','',2" +
                ","+ mainList[0].HOWNERID + ",'"+ mainList[0].HOWNERTYPEID + "') ");
WebAPI/DLL/ClsSb_EquipMaintainRuleBill.cs
@@ -55,6 +55,7 @@
                ",HCheckCycle=" + omodel.HCheckCycle.ToString() +
                ",HExplanation='" + omodel.HExplanation + "'" +
                ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                ",HMaintainLevID=" + omodel.HMaintainLevID +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
@@ -120,12 +121,12 @@
                oCn.RunProc("Insert Into Sb_EquipMaintainRuleBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
                ",HYear,HPeriod,HRemark" +
                ",HCheckCycle,HCycleUnit,HExplanation,HInnerBillNo" +
                ",HCheckCycle,HCycleUnit,HExplanation,HInnerBillNo,HMaintainLevID" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + 
                "',"+ omodel.HCheckCycle.ToString() + ",'" + omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo +
                "') ");
                "',"+ omodel.HCheckCycle.ToString() + ",'" + omodel.HCycleUnit + "','" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + omodel.HMaintainLevID +
                ") ");
                //插入保养项子表
                foreach (Models.ClsSb_EquipMaintainRuleBillSub_Item Item in DetailColl_Pay)
WebAPI/Models/ClsSb_EquipMaintainRuleBillMain.cs
@@ -11,5 +11,7 @@
        public int HCheckCycle;     //--保养周期
        public string HExplanation;   // varchar(500)   --摘要
        public string HInnerBillNo;   //varchar(50)     --内部单据号
        public Int64 HMaintainLevID; //保养级别(gy_HMaintainLev)
    }
}