| | |
| | | string HVerNum = mainList[0].HVerNum;//版本 |
| | | int IsProNo = mainList[0].IsProNo;//是否转工序 |
| | | HName_LongShan = mainList[0].HName;//工艺路线名称 |
| | | string HProcPriceType = mainList[0].HProcPriceType;//定额类型(临时定额,永久定额) |
| | | |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特") |
| | |
| | | ",HRoutingGroupID,HUnitID,HMaterNumber,HUnitNumber,HStandard" + |
| | | ",HMainGroupID,HMainProcID,HMainCenterID,HMainTimeUnit,HMainUnitTime,HMainWorkQty" + |
| | | ",HMainPrice,HStdSourceQty,HAddSourceRate,HPRDORGID,HDelSourceRate" + |
| | | ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HOrgID) " + |
| | | ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HOrgID,HProcPriceType) " + |
| | | " values('" + BillType + "','"+ HBillSubType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()," + HMaterID + ",'" + HName + "'," + HMaterTypeID + |
| | | "," + HRoutingGroupID + "," + HUnitID + ",'" + HMaterNumber + "','" + HUnitNumber + "'," + Convert.ToString(HStandard ? 1 : 0) + |
| | | "," + HMainGroupID + "," + HMainProcID + "," + HMainCenterID + ",'" + HMainTimeUnit + "'," + HMainUnitTime + "," + HMainWorkQty + |
| | | "," + HMainPrice + "," + HStdSourceQty + "," + HAddSourceRate + "," + HPRDORGID + "," + HDelSourceRate + |
| | | ",'" + HPicNumVer + "','" + HPicNumAssemble + "','" + HMaterTexture + "','" + HProductNum + "','" + HVerNum + "'," + HOrgID + ") "); |
| | | ",'" + HPicNumVer + "','" + HPicNumAssemble + "','" + HMaterTexture + "','" + HProductNum + "','" + HVerNum + "'," + HOrgID + ",'"+ HProcPriceType + "') "); |
| | | |
| | | LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",新增工艺路线单据:" + HBillNo); |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "新增工艺路线单据:" + HBillNo + "','LMES-工艺路线模块','" + DBUtility.ClsPub.IPAddress + "','新增单据'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | "',HMainTimeUnit='" + HMainTimeUnit + "',HMainUnitTime='" + HMainUnitTime + "',HMainWorkQty='" + HMainWorkQty + "',HMainPrice='" + HMainPrice + |
| | | "',HStdSourceQty='" + HStdSourceQty + "',HAddSourceRate='" + HAddSourceRate + "',HDelSourceRate='" + HDelSourceRate + |
| | | "',HPicNumVer='" + HPicNumVer + "',HPicNumAssemble='" + HPicNumAssemble + "',HMaterTexture='" + HMaterTexture + "'" + |
| | | ",HProductNum='" + HProductNum + "',HVerNum='" + HVerNum + "' where HInterID='" + HInterID + "'"); |
| | | ",HProductNum='" + HProductNum + "',HVerNum='" + HVerNum + "',HProcPriceType = '" + HProcPriceType + "' where HInterID='" + HInterID + "'"); |
| | | |
| | | //删除子表 |
| | | oCN.RunProc("delete from Gy_RoutingBillSub where HInterID='" + HInterID + "'"); |
| | |
| | | ",HTechnologyParameter,HPicNum,HProcCheckNote" + |
| | | ",HOverRate,HProcWorkNum,HBadWHID,HWasterWHID, HWHID,HEstimate,HIsTime" + |
| | | ",HQCSchemeID_Fst,HQCSchemeID_Proc,HQCSchemeID_Patrol" + |
| | | ",HWorkTimes_S,HSortProcFlag,HSNCtrl " + |
| | | ",HWorkTimes_S,HSortProcFlag,HSNCtrl,HQCFst,HQCProc,HQCPatrol,HMaterToSourceCtrl " + |
| | | ") values(" |
| | | + HInterID + "," + i + "," + oSub.HProcID.ToString() + ",'" + oSub.HProcNo + "'," + oSub.HSupID.ToString() + "," + Convert.ToString(oSub.HSupFlag ? 1 : 0) + "" + |
| | | "," + oSub.HWorkQty.ToString() + "," + oSub.HCenterID.ToString() + ",'" + oSub.HTimeUnit.ToString() + "'," + oSub.HUnitTime.ToString() + |
| | |
| | | ",'" + oSub.HTechnologyParameter.ToString() + "','" + oSub.HPicNum.ToString() + "','" + oSub.HProcCheckNote.ToString() + |
| | | "', " + oSub.HOverRate.ToString() + ",'" + oSub.HProcWorkNum.ToString() + "'," + oSub.HBadWHID.ToString() + "," + oSub.HWasterWHID.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HEstimate.ToString() + "," + Convert.ToString(oSub.HIsTime ? 1 : 0) + "," + oSub.HQCSchemeID_Fst + "," + |
| | | oSub.HQCSchemeID_Proc + "," + oSub.HQCSchemeID_Patrol + |
| | | ", " + oSub.HWorkTimes_S.ToString() + "," + Convert.ToString(oSub.HSortProcFlag ? 1 : 0) + "," + Convert.ToString(oSub.HSNCtrl ? 1 : 0) + |
| | | ", " + oSub.HWorkTimes_S.ToString() + "," + Convert.ToString(oSub.HSortProcFlag ? 1 : 0) + "," + Convert.ToString(oSub.HSNCtrl ? 1 : 0) + "," + Convert.ToString(oSub.HQCFst ? 1 : 0) + "," + Convert.ToString(oSub.HQCProc ? 1 : 0) + "," + Convert.ToString(oSub.HQCPatrol ? 1 : 0) + "," + Convert.ToString(oSub.HMaterToSourceCtrl ? 1 : 0) + |
| | | ") "); |
| | | //计价方式不为计时,则把计时暂估字段更新为空 |
| | | if (oSub.HIsTime == false) |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 临时定额报表 |
| | | /// <summary> |
| | | /// 返回工艺路线列表 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("Gy_RoutingBill/getProcPriceTypeChangeReport")] |
| | | [HttpGet] |
| | | public object getProcPriceTypeChangeReport(string sWhere, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "临时定额报表无权限查询!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn("select * from h_v_Pay_ProcPriceTypeChangeReport where 1 = 1" + sWhere + " order by hmainid desc", "h_v_Pay_ProcPriceTypeChangeReport"); |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | return GetObjectJson(ds); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 临时定额报表 永久定额 |
| | | /// <summary> |
| | | /// 返回工艺路线列表 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("Gy_RoutingBill/updateProcPriceType")] |
| | | [HttpGet] |
| | | public object updateProcPriceType(string HInterID, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "临时定额报表无编辑权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn("Update Gy_RoutingBillMain set HProcPriceType = '永久定额' where HInterID = " + HInterID , "Gy_RoutingBillMain"); |
| | | objJsonResult.code = "1"; |
| | | 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("Gy_RoutingBill/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select a.*,m.HProcPriceType,m.HBeginDate,m.HEndDate,s.HQCProc,s.HQCFst,s.HQCPatrol,s.HMaterToSourceCtrl from h_v_Gy_RoutingBillList as a,Gy_RoutingBillMain as m,Gy_RoutingBillSub as s where m.HInterID = hmainid and s.HInterID = hmainid and s.HEntryID = hsubid and hmainid =" + HInterID, "h_v_Gy_RoutingBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "false!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 工艺路线列表 查询系统参数 |
| | | /// <summary> |
| | | /// 返回工艺路线列表 |