| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | BillNew.omodel.HPRDORGID= mainList[0].HPRDORGID;//组织 |
| | | BillNew.omodel.HInterID = mainList[0].HInterID;//递入type得到的单据ID |
| | | BillNew.omodel.HYear = sYear; |
| | | BillNew.omodel.HPeriod = sPeriod; |
| | |
| | | BillNew.omodel.HMaterIDD = ClsPub.isStrNull(mainList[0].HMaterIDD); |
| | | List<Model.ClsSc_ProcessExchangeBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSc_ProcessExchangeBillSub>>(msg3); |
| | | BillNew.DetailColl = new List<Model.ClsSc_ProcessExchangeBillSub>(); |
| | | if (BillNew.omodel.HICMOInterID == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请选择任务单!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | for (int i = 0; i < subList.ToArray().Length; i++) |
| | | { |
| | | if (DBUtility.ClsPub.isInt(subList[i].HProcID) != 0)//HQty |
| | | { |
| | | Model.ClsSc_ProcessExchangeBillSub oSub = new Model.ClsSc_ProcessExchangeBillSub(); |
| | | oSub.HEntryID = i; |
| | | oSub.HEntryID = i+1; |
| | | oSub.HRemark = DBUtility.ClsPub.isStrNull(subList[i].HRemark); |
| | | oSub.HSourceInterID = ClsPub.isLong(mainList[0].HICMOInterID); |
| | | oSub.HSourceEntryID = ClsPub.isLong(mainList[0].HICMOEntryID); |
| | |
| | | oSub.HFstProc = "否"; |
| | | oSub.HKeyProc = DBUtility.ClsPub.isStrNull(subList[i].HKeyProc); |
| | | oSub.HSupID = DBUtility.ClsPub.isLong(subList[i].HSupID); |
| | | oSub.HSupFlag = DBUtility.ClsPub.isBool(subList[i].HSupFlag); |
| | | oSub.HSupFlag = DBUtility.ClsPub.isBool(subList[i].isEntrust); |
| | | oSub.HBackProc = DBUtility.ClsPub.isBool(subList[i].HBackProc); |
| | | oSub.HEdit = DBUtility.ClsPub.isBool(subList[i].HEdit); |
| | | if (oSub.HCenterID == 0 && oSub.HSupFlag == false) |
| | |
| | | oSub.HTechnologyParameter = DBUtility.ClsPub.isStrNull(subList[i].HTechnologyParameter); |
| | | oSub.HPicNum = DBUtility.ClsPub.isStrNull(subList[i].HPicNum); |
| | | oSub.HProcCheckNote = DBUtility.ClsPub.isStrNull(subList[i].HProcCheckNote); |
| | | oSub.HMouldNo = ""; |
| | | oSub.HProcWorkNum = ""; |
| | | BillNew.DetailColl.Add(oSub); |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="hmainid">生产任务单ID</param> |
| | | /// <returns>object</returns> |
| | | [Route("Sc_ProcessExchangeBill/GetICMOBillDetail")] |
| | | [Route("Sc_ProcessExchangeBill/GetICMOBillList")] |
| | | [HttpGet] |
| | | public object GetICMOBillDetail(int hmainid,int OrganizationID) |
| | | public object GetICMOBillList(int hmainid,int OrganizationID) |
| | | { |
| | | try |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ICMOBillListDetail where hmainid=" + hmainid + " and HSTOCKINORGID="+ OrganizationID, "h_v_Sc_ICMOBillListDetail"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ICMOBillListDetail where hmainid=" + hmainid, "h_v_Sc_ICMOBillListDetail"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 返回生产任务单明细行 |
| | | /// </summary> |
| | | /// <param name="hmainid">生产任务单ID</param> |
| | | /// <returns>object</returns> |
| | | [Route("Sc_ProcessExchangeBill/GetICMOBillDetail")] |
| | | [HttpGet] |
| | | public object GetICMOBillDetail(int hmainid, int OrganizationID) |
| | | { |
| | | try |
| | | { |
| | | if (hmainid == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "生产任务单ID为0!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select * from h_v_S_Sc_ICMOBillList where hmainid=" + hmainid, "h_v_S_Sc_ICMOBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "此生产任务单无明细行!"; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | // |
| | | } |