| | |
| | | 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"] = HWHID.ToString() }); // 仓库 |
| | | FentityModel.Add("FInspectTimes", "1"); // 检验次数 |
| | | FentityModel.Add("FTimeUnit", "24");//时间单位 |
| | | FentityModel.Add("FSAMPLEDAMAGEBEARER", "2");//样本破坏承担方 |
| | |
| | | ") "); |
| | | //同步金蝶 |
| | | //访问金蝶 |
| | | string sErr = ""; |
| | | var loginRet = InvokeHelper.Login(); |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | | if (isSuccess == 0) |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | string sql = @"select a.FID,a.FNUMBER Employee,d.FNUMBER Dept from Gy_Employee e |
| | | if (oSystemParameter.ShowBill(ref sErr)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "锦隆") |
| | | { |
| | | string sql = @"select a.FID,a.FNUMBER Employee,d.FNUMBER Dept from Gy_Employee e |
| | | join JL20250716203240..T_HR_EMPINFO a on e.HNumber = a.FNUMBER |
| | | join JL20250716203240..T_BD_STAFFTEMP c on c.FID = a.FID |
| | | join JL20250716203240..T_BD_DEPARTMENT d on c.FDEPTID = d.FDEPTID |
| | | where e.HItemID ='" + HKeeperID + "' "; |
| | | //查询质检员对应质检部门 |
| | | ds = oCN.RunProcReturn(sql, "T_HR_EMPINFO"); |
| | | LogService.Write("sql" + sql); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "操作失败,质检员对应质检部门无数据。" + sql; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //查询质检员对应质检部门 |
| | | ds = oCN.RunProcReturn(sql, "T_HR_EMPINFO"); |
| | | // LogService.Write("sql" + sql); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "操作失败,质检员对应质检部门无数据。" + sql; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | JObject model = new JObject(); |
| | |
| | | model.Add("FDate", DateTime.Now.ToString("yyyy-MM-dd")); //单据日期 |
| | | model.Add("FInspectOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //质检组织 |
| | | model.Add("FSourceOrgId", new JObject() { ["Fnumber"] = HZJOrgNumber.ToString() }); //来源组织 |
| | | |
| | | //model.Add("FInspectDepId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Dept"].ToString() }); //质检部门 |
| | | model.Add("FInspectorId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Employee"].ToString() }); //质检员 |
| | | if (oSystemParameter.ShowBill(ref sErr)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "锦隆") |
| | | { |
| | | model.Add("FInspectorId", new JObject() { ["Fnumber"] = ds.Tables[0].Rows[0]["Employee"].ToString() }); //质检员 |
| | | } |
| | | } |
| | | model.Add("FISSYNCED", "false");// 是否已同步 |
| | | model.Add("F_PGKJ_Date", DateTime.Now.ToString("yyyy-MM-dd"));// 报检日期 |
| | | model.Add("FBillNo", HBillNo); |
| | |
| | | FentityModel.Add("FQCStatus", "1");// 质检状态 |
| | | FentityModel.Add("FIsRelated", false);// 不良品关联标志 |
| | | FentityModel.Add("FSrcBillType0", "PUR_ReceiveBill");// 源单类型 |
| | | if (oSystemParameter.ShowBill(ref sErr)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "锦隆") |
| | | { |
| | | FentityModel.Add("FSrcBillNo0", HSLBillNo.ToString()); //收料通知单单号 |
| | | FentityModel.Add("FSrcInterId0", HSLInterID.ToString()); //收料通知单主ID |
| | | FentityModel.Add("FSrcEntryId0", HSLEntryID.ToString()); |
| | | FentityModel.Add("FSrcEntrySeq0", HSLSeQ.ToString()); //源单行号 |
| | | |
| | | FentityModel.Add("F_WPVT_Text_uky", HSourceBillNo.ToString()); //采购订单行号 |
| | | FentityModel.Add("F_WPVT_Integer_fg2", HSeQ.ToString()); //订单行号 |
| | | } |
| | | } |
| | | 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() }); // 仓库 |
| | | |
| | | if (oSystemParameter.ShowBill(ref sErr)) |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "锦隆") |
| | | { |
| | | FentityModel.Add("FStockId", new JObject() { ["Fnumber"] = HWHID.ToString() }); // 仓库 |
| | | |
| | | } |
| | | } |
| | | FentityModel.Add("FInspectTimes", "1"); // 检验次数 |
| | | FentityModel.Add("FTimeUnit", "24");//时间单位 |
| | | FentityModel.Add("FSAMPLEDAMAGEBEARER", "2");//样本破坏承担方 |
| | |
| | | FentityModel2.Add("FBasePolicyQty", HRightQty.ToString() == "0" ? HBadQty.ToString() : HRightQty.ToString()); //基本单位数量 |
| | | FentityModel2.Add("FUsePolicy", HUseResult.ToString()); //使用决策 |
| | | FentityModel2.Add("FIsCheck", false); //是否抽检 |
| | | FentityModel2.Add("FIsDefectProcess", false); //不良处理 |
| | | // 锦隆启用不良处理 |
| | | if (oSystemParameter.ShowBill(ref sErr)) |
| | | { |
| | | if (string.Equals(oSystemParameter.omodel.WMS_CampanyName, "锦隆")) |
| | | { |
| | | // 判断单据是否合格 |
| | | if (HCheckResult.ToString() == "2") |
| | | { |
| | | FentityModel2.Add("FIsDefectProcess", true); //不良处理 |
| | | } |
| | | else |
| | | { |
| | | FentityModel2.Add("FIsDefectProcess", false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | FentityModel2.Add("FIsDefectProcess", false); //不良处理 |
| | | } |
| | | } |
| | | FentityModel2.Add("FCanSale", false); //可销售 |
| | | FentityModel2.Add("FIsMRBReview", false); //MRP评审 |
| | | FentityModel2.Add("FIsReturn", true); //判退 |
| | |
| | | JArray Fentity4 = new JArray(); |
| | | JObject FentityModel4 = new JObject(); |
| | | FentityModel4.Add("FEntity_Link_FRuleId", "QM_PURReceive2Inspect"); //单据转换规则 |
| | | FentityModel4.Add("FEntity_Link_FSTableName", "T_PUR_RECEIVEENTRY"); //收料通知单子表 |
| | | 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()); // |
| | |
| | | return objJsonResult; |
| | | } |
| | | //提交审核 |
| | | string result0 = string.Empty; |
| | | string result1 = string.Empty; |
| | | string result2 = string.Empty; |
| | | var fID = JObject.Parse(result)["Result"]["Id"].ToString(); |
| | |
| | | Ids = fID, |
| | | }; |
| | | |
| | | |
| | | K3CloudApiClient client = new K3CloudApiClient("http://47.96.97.237/k3cloud"); |
| | | // K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/"); |
| | | |
| | | |
| | | |
| | | if (oSystemParameter.ShowBill(ref sErr)) |
| | | { |
| | | if (string.Equals(oSystemParameter.omodel.WMS_CampanyName, "锦隆")) |
| | | { |
| | | result0 = InvokeHelper.Save("QM_InspectBill", JsonConvert.SerializeObject(json));//保存 |
| | | } |
| | | } |
| | | result1 = InvokeHelper.Submit("QM_InspectBill", JsonConvert.SerializeObject(json));//提交 |
| | | // result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//审核 |
| | | result2 = InvokeHelper.Audit("QM_InspectBill", JsonConvert.SerializeObject(json));//审核 |
| | | if (JObject.Parse(result1)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | oCN.RollBack(); |
| | |
| | | fs.Read(buffer, 0, (int)len); |
| | | //文件IO流 |
| | | string a = Convert.ToBase64String(buffer); |
| | | if (oSystemParameter.ShowBill(ref sErr)) { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "锦隆") |
| | | { |
| | | ds = oCN.RunProcReturn("select * from JL20250716203240..T_QM_INSPECTBILL where FBILLNO='" + HBillNo + "'", "T_QM_INSPECTBILL"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("select * from AIS20210811135644..T_QM_INSPECTBILL where FBILLNO='" + HBillNo + "'", "T_QM_INSPECTBILL"); |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from AIS20210811135644..T_QM_INSPECTBILL where FBILLNO='" + HBillNo + "'", "T_QM_INSPECTBILL"); |
| | | |
| | | HInterID = long.Parse(ds.Tables[0].Rows[0]["FID"].ToString()); |
| | | |
| | |
| | | string _vlog = InvokeHelper.UpLoad("QM_InspectBill", jsonStr); |
| | | LogService.Write("json:" + jsonStr); |
| | | LogService.Write("_vlog:" + _vlog); |
| | | |
| | | |
| | | if (JObject.Parse(_vlog)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | oCN.RollBack(); |