| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #region 末道工序汇报入库 |
| | | /// <summary> |
| | | /// 末道工序汇报入库列表 |
| | | /// </summary> |
| | | /// <param name="sWhere"></param> |
| | | /// <param name="user"></param> |
| | | /// <returns></returns> |
| | | [Route("Sc_ProcessMangement/Sc_ProcessReportList_Last")] |
| | | [HttpGet] |
| | | public object Sc_ProcessReportList_Last(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | string sql1 = "select * from h_v_Sc_ProcessReportList_Last where 1 = 1 and HLastProc='是'"; |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessReportList_Last"); |
| | | |
| | | 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> |
| | | /// 获取工序汇报入库单列表 |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc order by hmainid desc", "h_v_MES_StationOutBillList_LastProc"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_MES_StationOutBillList_LastProc where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_MES_StationOutBillList_LastProc"); |
| | | } |
| | | |
| | | string sql1 = "select * from h_v_Sc_ProcessReportList_Last where 1 = 1 and HFstProc='是' "; |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessReportList_Last"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo+"'"); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "0"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo + "'"); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update sc_stationoutbillmain set HBFFlag =1 where HProcExchBillNo = '" + BillNo + "'"); |
| | | oCN.RunProc("update Sc_StationOutBillMain set HRelationQty=1 where HBillNo='" + BillNo + "'"); |
| | | |
| | | oCN.Commit(); |
| | | oCN.RunProc("update sc_stationoutbillmain set HBFFlag =1 where HProcExchBillNo = '" + BillNo + "'"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "保存成功!"; |
| | |
| | | ") values(" |
| | | + HInterID.ToString() + ",1,'',''" + |
| | | ",''," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo.ToString() + "','" + HSourceBillType.ToString() + "'" + |
| | | ",0,0,0,0,''"+ |
| | | ",0,0,0,0,''" + |
| | | ",'" + HCheckResult.ToString() + "','" + HCheckResult.ToString() + "','" + HKeeperID.ToString() + "',getdate()" + |
| | | ") "); |
| | | //同步金蝶 |
| | |
| | | FentityModel.Add("FUnitID", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//计量单位内码 |
| | | FentityModel.Add("FInspectQty", HCheckQty.ToString());// 检验数量 |
| | | FentityModel.Add("FQualifiedQty", HRightQty.ToString());// 合格数量 |
| | | FentityModel.Add("FUnqualifiedQty", HBadQty.ToString());// 不合格数量 |
| | | FentityModel.Add("FInspectResult", HCheckResult.ToString());// 检验结果 |
| | | FentityModel.Add("FQCStatus", "1");// 质检状态 |
| | | FentityModel.Add("FIsRelated", false);// 不良品关联标志 |
| | |
| | | FentityModel.Add("FBaseUnitId", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//基本单位 |
| | | FentityModel.Add("FBaseInspectQty", HCheckQty.ToString());//基本单位检验数量 |
| | | FentityModel.Add("FSupplierId", new JObject() { ["Fnumber"] = HSupNumber.ToString() }); // 供应商 |
| | | FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // 仓库 |
| | | //FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // 仓库 |
| | | FentityModel.Add("FInspectTimes","1"); // 检验次数 |
| | | FentityModel.Add("FTimeUnit","24");//时间单位 |
| | | FentityModel.Add("FSAMPLEDAMAGEBEARER","2");//样本破坏承担方 |
| | | FentityModel.Add("FISFIRSTINSPECT", false);//首检 |
| | | FentityModel.Add("FBaseQualifiedQty", HRightQty.ToString());//基本单位合格数 |
| | | FentityModel.Add("FCurrency", new JObject() { ["Fnumber"] = "PRE001" });//币别 |
| | | FentityModel.Add("FBaseAcceptQty", HRightQty.ToString());//基本单位接收数 |
| | | FentityModel.Add("FCurrency", new JObject() { ["Fnumber"] = "PRE001" });//币别 |
| | | FentityModel.Add("FIsSplitRow ", false);// 是否拆分行 |
| | | |
| | | JArray Fentity2 = new JArray(); |
| | |
| | | FentityModel2.Add("FIsDefectProcess", false); //不良处理 |
| | | FentityModel2.Add("FCanSale", false); //可销售 |
| | | FentityModel2.Add("FIsMRBReview", false); //MRP评审 |
| | | FentityModel2.Add("FIsReturn", false); //判退 |
| | | FentityModel2.Add("FIsReturn", true); //判退 |
| | | FentityModel2.Add("FIsRelatedDefect", false); //不良品关联标志 |
| | | Fentity2.Add(FentityModel2); |
| | | FentityModel.Add("FPolicyDetail", Fentity2); |
| | |
| | | FentityModel4.Add("FEntity_Link_FSTableName", "T_PUR_RECEIVEENTRY"); //收料通知单子表 |
| | | FentityModel4.Add("FEntity_Link_FSBillId", HSLInterID.ToString()); //收料通知单主内码 |
| | | FentityModel4.Add("FEntity_Link_FSId", HSLEntryID.ToString()); //收料通知单子内码 |
| | | FentityModel4.Add("FEntity_Link_FBaseAcceptQty", HRightQty.ToString()); // |
| | | FentityModel4.Add("FEntity_Link_FBaseAcceptQtyOld", HRightQty.ToString()); // |
| | | FentityModel4.Add("FEntity_Link_FBaseInspectQtyOld", HRightQty.ToString()); // |
| | | FentityModel4.Add("FEntity_Link_FInspectQtyOld", HRightQty.ToString()); // |
| | |
| | | FentityModel.Add("FUnitID", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//计量单位内码 |
| | | FentityModel.Add("FInspectQty", HCheckQty.ToString());// 检验数量 |
| | | FentityModel.Add("FQualifiedQty", HRightQty.ToString());// 合格数量 |
| | | FentityModel.Add("FUnqualifiedQty", HBadQty.ToString());// 不合格数量 |
| | | FentityModel.Add("FInspectResult", HCheckResult.ToString());// 检验结果 |
| | | FentityModel.Add("FQCStatus", "1");// 质检状态 |
| | | FentityModel.Add("FIsRelated", false);// 不良品关联标志 |
| | |
| | | FentityModel.Add("FBaseUnitId", new JObject() { ["Fnumber"] = HUnitNumber.ToString() });//基本单位 |
| | | FentityModel.Add("FBaseInspectQty", HCheckQty.ToString());//基本单位检验数量 |
| | | //FentityModel.Add("FSupplierId", new JObject() { ["Fnumber"] = HSupNumber.ToString() }); // 供应商 |
| | | FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // 仓库 |
| | | //FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHNumber.ToString() }); // 仓库 |
| | | FentityModel.Add("FInspectTimes", "1"); // 检验次数 |
| | | FentityModel.Add("FTimeUnit", "24");//时间单位 |
| | | FentityModel.Add("FSAMPLEDAMAGEBEARER", "2");//样本破坏承担方 |
| | |
| | | FentityModel2.Add("FIsDefectProcess", false); //不良处理 |
| | | FentityModel2.Add("FCanSale", false); //可销售 |
| | | FentityModel2.Add("FIsMRBReview", false); //MRP评审 |
| | | FentityModel2.Add("FIsReturn", false); //判退 |
| | | FentityModel2.Add("FIsReturn", true); //判退 |
| | | FentityModel2.Add("FIsRelatedDefect", false); //不良品关联标志 |
| | | Fentity2.Add(FentityModel2); |
| | | FentityModel.Add("FPolicyDetail", Fentity2); |
| | | |
| | | |
| | | |
| | | JArray Fentity3 = new JArray(); |
| | | JObject FentityModel3 = new JObject(); |
| | | FentityModel3.Add("FDetailID", "0");// |
| | | FentityModel3.Add("FSrcBillType", "SFC_OperationReport"); //源单类型 |
| | | FentityModel3.Add("FSrcBillNo", HSLBillNo.ToString()); //工序汇报单单号 |
| | | FentityModel3.Add("FSrcInterId", HSLInterID.ToString()); //工序汇报单主ID |
| | | FentityModel3.Add("FSrcEntryId", HSLEntryID.ToString()); //工序汇报单子ID |
| | | FentityModel3.Add("FSrcEntrySeq", HSLSeQ.ToString()); //工序汇报单行号 |
| | | FentityModel3.Add("FOrderType", new JObject() { ["FID"] = "PRD_MO" }); // 生产订单类型 |
| | | FentityModel3.Add("FOrderBillNo", HSourceBillNo.ToString()); //生产订单单号 |
| | | FentityModel3.Add("FOrderId", HSourceInterID.ToString()); //生产订单主ID |
| | | FentityModel3.Add("FOrderEntryId", HSourceEntryID.ToString()); //生产订单子ID |
| | | FentityModel3.Add("FOrderEntrySeq", HSeQ.ToString()); //生产订单行号 |
| | | Fentity3.Add(FentityModel3); |
| | | FentityModel.Add("FReferDetail", Fentity3); |
| | | |
| | | |
| | | JArray Fentity4 = new JArray(); |
| | | JObject FentityModel4 = new JObject(); |
| | | FentityModel4.Add("FEntity_Link_FRuleId", "QM_OperRpt2Inspect"); //单据转换规则 |
| | | FentityModel4.Add("FEntity_Link_FSTableName", "T_SFC_OPTRPTENTRY"); //工序汇报单子表 |
| | | FentityModel4.Add("FEntity_Link_FSBillId", HSLInterID.ToString()); //工序汇报单主ID |
| | | FentityModel4.Add("FEntity_Link_FSId", HSLEntryID.ToString()); //工序汇报单子ID |
| | | FentityModel4.Add("FEntity_Link_FBaseAcceptQty", HRightQty.ToString()); // |
| | | FentityModel4.Add("FEntity_Link_FBaseAcceptQtyOld", HRightQty.ToString()); // |
| | | FentityModel4.Add("FEntity_Link_FBaseInspectQtyOld", HRightQty.ToString()); // |
| | | FentityModel4.Add("FEntity_Link_FInspectQtyOld", HRightQty.ToString()); // |
| | | Fentity4.Add(FentityModel4); |
| | | FentityModel.Add("FEntity_Link", Fentity4); |
| | | |
| | | |
| | | //JArray Fentity3 = new JArray(); |
| | | //JObject FentityModel3 = new JObject(); |
| | | //FentityModel3.Add("FSrcBillType", "SFC_OperationReport"); //源单类型 |