| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "完工单无编辑权限!"; |
| | | objJsonResult.Message = "[0000-1-065]完工单无编辑权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站单无编辑权限!"; |
| | | objJsonResult.Message = "[0000-1-065]出站单无编辑权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | double HLossQty = list[0].HLossQty;//遗失数量 |
| | | double HBackWorkByMaterQty = list[0].HBackWorkByMaterQty;//遗失数量 |
| | | int HMouldID = list[0].HMouldID;//模具id |
| | | |
| | | double HMachineWorkTimes = list[0].HMachineWorkTimes;//设备工时 |
| | | LogService.Write($"1.字段赋值,用时" + sw.Elapsed ); |
| | | |
| | | //单据完整性判断 |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "流转卡没有选择!请扫描条形码或输入条形码后回车"; |
| | | objJsonResult.Message = "[3791-2-005]流转卡没有选择!请扫描条形码或输入条形码后回车"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "流水号没有选择!请输入流水号后回车"; |
| | | objJsonResult.Message = "[0000-2-032]流水号没有选择!请输入流水号后回车"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "流水号没有选择!"; |
| | | objJsonResult.Message = "[0000-2-032]流水号没有选择!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "流转卡号没有选择!"; |
| | | objJsonResult.Message = "[0000-2-032]流转卡号没有选择!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "产品没有选择!"; |
| | | objJsonResult.Message = "[0000-2-007]产品没有选择!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "当前工序没有选择!"; |
| | | objJsonResult.Message = "[0000-2-011]当前工序没有选择!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户为乔一 |
| | | if(oSystemParameter.omodel.WMS_CampanyName == "乔一") |
| | | { |
| | | HDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | |
| | | //判断客户不为龙山汽配 |
| | | if (oSystemParameter.omodel.WMS_CampanyName != "龙山汽配" && oSystemParameter.omodel.WMS_CampanyName != "瑞与祺" && oSystemParameter.omodel.WMS_CampanyName != "添康科技") //系统参数 |
| | | { |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "生产资源没有选择!"; |
| | | objJsonResult.Message = "[0000-2-006]生产资源没有选择!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "操作员没有选择!"; |
| | | objJsonResult.Message = "[0000-2-030]操作员没有选择!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "操作员没有选择!"; |
| | | objJsonResult.Message = "[0000-2-030]操作员没有选择!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "合格数量加报废数量加不良数量不能为0!"; |
| | | objJsonResult.Message = "[3791-2-006]合格数量加报废数量加不良数量不能为0!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "当前工单不是开工状态不能汇报!"; |
| | | objJsonResult.Message = "[3791-2-007]当前工单不是开工状态不能汇报!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "合格数量加报废数量不能为0!"; |
| | | objJsonResult.Message = "[3791-2-008]合格数量加报废数量不能为0!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存前判断失败!"; |
| | | objJsonResult.Message = "[0000-2-012]保存前判断失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.Message = "[0000-1-051]保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据号重复!"; |
| | | objJsonResult.Message = "[0000-2-013]单据号重复!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" + |
| | | ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" + |
| | | ",HmaterOutqty,HProcPriceRate,HTemporaryAreaID,HWasterQty_Work,HWasterQty_Mater,HBackWorkQty,HShiftsID" + |
| | | ",HToCheckQty,HLossQty,HBackWorkByMaterQty,HMouldID" + |
| | | ",HToCheckQty,HLossQty,HBackWorkByMaterQty,HMouldID,HMachineWorkTimes " + |
| | | ") " + |
| | | " values('" + BillType + "','" + (OperationType == "5" ? "SUB" : HBillSubType) + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",'"+ HDate + "','" + HMaker + "',getdate(),'" + HMouldNum + "'" + |
| | | "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL + |
| | |
| | | "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + |
| | | "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID + |
| | | "," + HmaterOutqty + "," + HProcPriceRate + "," + HTemporaryAreaID + "," + HWasterQty_Work + "," + HWasterQty_Mater + "," + HBackWorkQty + |
| | | "," + HShiftsID + "," + HToCheckQty + "," + HLossQty + ","+ HBackWorkByMaterQty + "," + HMouldID + ") "); |
| | | "," + HShiftsID + "," + HToCheckQty + "," + HLossQty + ","+ HBackWorkByMaterQty + "," + HMouldID + ",'" + HMachineWorkTimes + "') "); |
| | | |
| | | LogService.Write($"4.新增结束,用时" + sw.Elapsed); |
| | | LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",新增工序出站单据:" + HBillNo); |
| | |
| | | ",HSourceID5=" + HSourceID5 + |
| | | ",HPayProcID=" + HPayProcID + |
| | | ",HGroupID=" + HGroupID + |
| | | ",HShiftsID=" + HShiftsID + |
| | | ",HWorkTimes=" + HWorkTimes + |
| | | ",HSaveBillFlag=0 " + |
| | | ",HBadCount=" + HBadCount + |
| | |
| | | ",HWasterQty_Work=" + HWasterQty_Work + |
| | | ",HWasterQty_Mater=" + HWasterQty_Mater + |
| | | ",HBackWorkQty=" + HBackWorkQty + |
| | | ",HShiftsID=" + HShiftsID + |
| | | ",HBackWorkByMaterQty=" + HBackWorkByMaterQty + |
| | | ",HMouldID=" + HMouldID + |
| | | ",HMachineWorkTimes=" + HMachineWorkTimes + |
| | | " where HInterID=" + HInterID); |
| | | |
| | | LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",修改工序出站单据:" + HBillNo); |
| | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "操作类型无效!"; |
| | | objJsonResult.Message = "[0000-2-014]操作类型无效!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "判断数量失败!"; |
| | | objJsonResult.Message = "[0000-2-015]判断数量失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "判断数量失败!"; |
| | | objJsonResult.Message = "[0000-2-015]判断数量失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "数量控制," + ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.Message = "[0000-2-015]数量控制," + ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存后控制判断失败!"; |
| | | objJsonResult.Message = "[0000-2-016]保存后控制判断失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.Message = "[0000-1-051]保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | if (oSystemParameter.omodel.MES_StationOutBill_AutoCheck == "Y") //系统参数 自动审核 |
| | | { |
| | | object objResult = set_CheckBill(HInterID.ToString(), user, HBillSubType); |
| | | } |
| | | if (oSystemParameter.omodel.MES_StationOutBill_SaveAutoAddnew == "Y") //系统参数 页面保存自动变成新增状态 |
| | | { |
| | | objJsonResult.Verify = "Y"; |
| | |
| | | sw.Stop();//结束计时 |
| | | LogService.Write($"11.参数查询结束,新增结束,用时" + sw.Elapsed); |
| | | LogService.Write("END--出站单据保存结束,出站单号:" + HBillNo); |
| | | |
| | | //测试语句=========================================================================================================== |
| | | string msg_str = ""; |
| | | string sql_str = "select a.HQty HQty_Main,b.HQty HQty_Sub " + |
| | | "from Sc_ProcessExchangeBillMain as a " + |
| | | "inner join Sc_ProcessExchangeBillSub as b on a.HInterID = b.HInterID " + |
| | | "where a.HInterID = " + HProcExchInterID; |
| | | DataSet ds_str = oCN.RunProcReturn(sql_str, "Sc_ProcessExchangeBillMain"); |
| | | if (ds_str.Tables[0].Rows.Count > 0) |
| | | { |
| | | msg_str = "HQty_Main:" + ds_str.Tables[0].Rows[0]["HQty_Main"].ToString() + ";HQty_Sub:"; |
| | | for (int j = 0; j < ds_str.Tables[0].Rows.Count; j++) |
| | | { |
| | | msg_str += ds_str.Tables[0].Rows[j]["HQty_Sub"].ToString() + ","; |
| | | } |
| | | } |
| | | |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "修改工序出站单据:" + HBillNo + "[工序流转卡号:" + HProcExchBillNo + "]" + msg_str + "','LMES-工序出站模块','" + DBUtility.ClsPub.IPAddress + "','新增或修改单据'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //============================================================================================================== |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "新增单据成功!"; |
| | | objJsonResult.Message = "[0000-1-050]新增单据成功!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-051]Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "完工单无查询权限!"; |
| | | objJsonResult.Message = "[0000-1-068]完工单无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站单无查询权限!"; |
| | | objJsonResult.Message = "[0000-1-068]出站单无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有查询到相关用户信息!"; |
| | | objJsonResult.Message = "[0000-1-069]没有查询到相关用户信息!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.Message = "[0000-1-037]Sucess!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-038]Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 工序出站汇报单列表 |
| | | [Route("Cj_StationOutBill/page")] |
| | | #region 返回工序出站汇报单列表-分页 |
| | | [Route("Cj_StationOutBill/get_Display_byPage")] |
| | | [HttpGet] |
| | | public json page(string sWhere, string user, int page, int size) |
| | | public object get_Display_byPage(string sWhere, string user, string Organization, int page, int size, string HBillSubType) |
| | | { |
| | | json res = new json(); |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user)) |
| | | { |
| | | res.code = "0"; |
| | | res.count = 0; |
| | | res.Message = "出站单无查询权限!"; |
| | | res.data = null; |
| | | return res; |
| | | } |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | if (HBillSubType == "SUB") |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",''", "h_p_MES_StationOutBillList"); |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-068]完工单无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_MES_StationOutBillList"); |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-068]出站单无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | //获取系统参数 |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户为龙山汽配 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配") |
| | | { |
| | | //获取需要拼接的字符串 |
| | | string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "工序汇报单列表"); |
| | | |
| | | if (sql_splice == "没有查询到相关用户信息") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-069]没有查询到相关用户信息!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | sWhere += sql_splice; |
| | | } |
| | | } |
| | | } |
| | | |
| | | //sWhere = sWhere.Replace("'", "''"); |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_MES_StationOutBillList"); |
| | | } |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_MES_StationOutBillList"); |
| | | } |
| | | |
| | | //添加列名 |
| | |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | res.code = CodeConstant.SUCCEED; |
| | | res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | res.Message = "Sucess!"; |
| | | res.list = columnNameList; |
| | | res.data = ds.Tables[0]; |
| | | return res; |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "[0000-1-037]Sucess!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | res.code = CodeConstant.FAIL; |
| | | res.count = CountConstant.FAIL; |
| | | res.Message = "Exception!" + e.ToString(); |
| | | res.data = null; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-038]Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 工序出站汇报单 子表查询 |
| | | [Route("Cj_StationOutBill/get_SubDisplay")] |
| | | [HttpGet] |
| | |
| | | case "Emp": |
| | | sql = "select * from h_v_Sc_StationOutBillSubQuery_Emp where 1 = 1 and HInterID=" + sWhere; |
| | | break; |
| | | |
| | | case "Sup": |
| | | sql = "select * from h_v_Sc_StationOutBillSubQuery_Sup where 1 = 1 and HInterID=" + sWhere; |
| | | break; |
| | | |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn(sql, TableName); |
| | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.Message = "[0000-1-037]Sucess!"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-038]Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | string HRemark = HttpContext.Current.Request.Params["HRemark"]; //备注 |
| | | string HUserName = HttpContext.Current.Request.Params["HUserName"]; //创建人 |
| | | HttpPostedFile files = HttpContext.Current.Request.Files["file"]; |
| | | string path = HttpContext.Current.Server.MapPath("~/../Files/" + HBillNo); |
| | | string path = HttpContext.Current.Server.MapPath("~/../Files/Cj_StationOutBill/" + HBillNo); |
| | | //string path = @"D:\\Files\\"+ HBillNo; |
| | | dynamic dyResult = UpLoadFile(files, path, HBillNo, HRemark, HUserName); |
| | | if (dyResult != null && dyResult.result == 1) |
| | |
| | | { |
| | | File.Delete(fileurl); //删除指定文件 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/"+ HBillNo+"/"+ filename; |
| | | string StrPath = "/files/Cj_StationOutBill/" + HBillNo+"/"+ filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //这里可以执行一些其它的操作,比如更新数据库 |
| | |
| | | { |
| | | Directory.CreateDirectory(fileSavePath); //添加文件夹 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/" + HBillNo + "/" + filename; |
| | | string StrPath = "/files/Cj_StationOutBill/" + HBillNo + "/" + filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //这里可以执行一些其它的操作,比如更新数据库 |
| | |
| | | string HRemark = HttpContext.Current.Request.Params["HRemark"]; //备注 |
| | | string HUserName = HttpContext.Current.Request.Params["HUserName"]; //创建人 |
| | | HttpPostedFile files = HttpContext.Current.Request.Files["file"]; |
| | | string path = HttpContext.Current.Server.MapPath("~/../Files/" + HBillNo); |
| | | string path = HttpContext.Current.Server.MapPath("~/../Files/Cj_StationOutBill/" + HBillNo); |
| | | //string path = @"D:\\Files\\"+ HBillNo; |
| | | dynamic dyResult = UpLoadFile1(files, path, HBillNo, HRemark, HUserName); |
| | | if (dyResult != null && dyResult.result == 1) |
| | |
| | | { |
| | | File.Delete(fileurl); //删除指定文件 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/" + HBillNo + "/" + filename; |
| | | string StrPath = "/files/Cj_StationOutBill/" + HBillNo + "/" + filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //这里可以执行一些其它的操作,比如更新数据库 |
| | |
| | | { |
| | | Directory.CreateDirectory(fileSavePath); //添加文件夹 |
| | | files.SaveAs(fileurl); |
| | | string StrPath = "/files/" + HBillNo + "/" + filename; |
| | | string StrPath = "/files/Cj_StationOutBill/" + HBillNo + "/" + filename; |
| | | if (File.Exists(fileurl)) |
| | | { |
| | | //这里可以执行一些其它的操作,比如更新数据库 |
| | |
| | | [HttpGet] |
| | | public object Filelist(string HBillNo) |
| | | { |
| | | var url = fileip + "/files/" + HBillNo+"/"; |
| | | var url = fileip + "/files/Cj_StationOutBill/" + HBillNo+"/"; |
| | | //@"C:\\files\\" |
| | | try |
| | | { |
| | |
| | | { |
| | | |
| | | oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID); |
| | | string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/" + HSourceBillNo), HFileName); |
| | | string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/Cj_StationOutBill/" + HSourceBillNo), HFileName); |
| | | File.Delete(fileurl); //删除指定文件 |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "完工单无权限!"; |
| | | objJsonResult.Message = "[0000-1-058]完工单无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站单无权限!"; |
| | | objJsonResult.Message = "[0000-1-058]出站单无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "只能删除本人的单据!"; |
| | | objJsonResult.Message = "[0000-1-011]只能删除本人的单据!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "判断关联失败!"; |
| | | objJsonResult.Message = "[0000-2-018]判断关联失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]); |
| | | objJsonResult.Message = "[0000-1-007]" + Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已经审核,不能删除!"; |
| | | objJsonResult.Message = "[0000-1-013]单据已经审核,不能删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "系统参数控制,已有下道工序,不能删除!"; |
| | | objJsonResult.Message = "[3791-1-002]系统参数控制,已有下道工序,不能删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除出站汇报单发生异常,没有任何返回记录!"; |
| | | objJsonResult.Message = "[3791-1-005]删除出站汇报单发生异常,没有任何返回记录!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = ds.Tables[0].Rows[0]["HRemarkBack"].ToString(); |
| | | objJsonResult.Message = "[0000-1-007]" + ds.Tables[0].Rows[0]["HRemarkBack"].ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.Message = "[0000-1-006]删除失败!原因:删除前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.Message = "[0000-1-007]删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.Message = "[0000-1-007]" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.Message = "[0000-1-008]删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未找到!"; |
| | | objJsonResult.Message = "[0000-1-005]单据未找到!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "异常!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-007]异常!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "完工单无权限!"; |
| | | objJsonResult.Message = "[3791-1-001]完工单无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站单无权限!"; |
| | | objJsonResult.Message = "[3791-1-001]出站单无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "只能删除本人的单据!"; |
| | | objJsonResult.Message = "[0000-1-011]只能删除本人的单据!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "判断关联失败!"; |
| | | objJsonResult.Message = "[0000-2-018]判断关联失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]); |
| | | objJsonResult.Message = "[0000-1-007]" + Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已经审核,不能删除!"; |
| | | objJsonResult.Message = "[0000-1-013]单据已经审核,不能删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "系统参数控制,已有下道工序,不能删除!"; |
| | | objJsonResult.Message = "[3791-1-002]系统参数控制,已有下道工序,不能删除!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "删除成功!"; |
| | | objJsonResult.Message = "[0000-1-008]删除成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据未找到!"; |
| | | objJsonResult.Message = "[0000-1-005]单据未找到!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "异常!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-007]异常!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "判断关联失败!"; |
| | | objJsonResult.Message = "[0000-2-018]判断关联失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]); |
| | | objJsonResult.Message = "[0000-1-038]" + Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.Message = "[0000-1-037]Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-038]Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "完工单审核失败!无权限!"; |
| | | objJsonResult.Message = "[0000-1-060]完工单审核失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站单审核失败!无权限!"; |
| | | objJsonResult.Message = "[0000-1-060]出站单审核失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第"+(i+1)+"行:单据ID为0,不能审核!"; |
| | | objJsonResult.Message = "[0000-1-009]第" + (i+1)+"行:单据ID为0,不能审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i + 1) + "行:单据已审核!不能再次审核"; |
| | | objJsonResult.Message = "[0000-1-023]第" + (i + 1) + "行:单据已审核!不能再次审核"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i + 1) + "行:单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.Message = "[0000-1-005]第" + (i + 1) + "行:单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | int j = 0; |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | //审核前控制 |
| | | //审核前控制================================================================================ |
| | | string sql = "exec h_p_Sc_StationOutBill_BeforeCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.Message = "[0000-1-024]审核失败!原因:审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.Message = "[0000-1-025]审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //================================================================================ |
| | | |
| | | //审核 |
| | | if (Cj_StationOutBillCheckBill(long.Parse(HInterIDs[i]), HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "成功:" + j + "行,第" + (i + 1) + "行:审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.Message = "[0000-1-025]成功:" + j + "行,第" + (i + 1) + "行:审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "全部执行成功!"; |
| | | objJsonResult.Message = "[0000-1-029]全部执行成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-025]审核失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | LogService.Write("出站单据审核更改流转卡数量,流转卡:" + HProcExchBillNo + ",出站单号:" + HBillNo + ",原流转卡数量:" + HProcExchQty + ",新流转卡数量:" + HQty); |
| | | } |
| | | |
| | | //审核后控制 |
| | | //审核后控制================================================================================ |
| | | string sql = "exec h_p_Sc_StationOutBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_AfterCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | |
| | | //================================================================================ |
| | | |
| | | sReturn = sReturn + " 审核功能!"; |
| | | oCN.Commit(); |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "完工单反审核失败!无权限!"; |
| | | objJsonResult.Message = "[0000-1-061]完工单反审核失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站单反审核失败!无权限!"; |
| | | objJsonResult.Message = "[0000-1-061]出站单反审核失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i + 1) + "行:单据ID为0,不能反审核!"; |
| | | objJsonResult.Message = "[0000-1-009]第" + (i + 1) + "行:单据ID为0,不能反审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i + 1) + "行:单据未审核!不需要反审核!"; |
| | | objJsonResult.Message = "[0000-1-018]第" + (i + 1) + "行:单据未审核!不需要反审核!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i + 1) + "行:审核人和反审核人不一致!"; |
| | | objJsonResult.Message = "[0000-1-062]第" + (i + 1) + "行:审核人和反审核人不一致!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "第" + (i + 1) + "行:单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.Message = "[0000-1-005]第" + (i + 1) + "行:单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | int j = 0; |
| | | for (int i = 0; i < HInterIDs.Length; i++) |
| | | { |
| | | //反审核前控制 |
| | | //反审核前控制============================================================= |
| | | string sql = "exec h_p_Sc_StationOutBill_BeforeUnCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.Message = "[0000-1-027]反审核失败!原因:反审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.Message = "[0000-1-028]反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //================================================================================ |
| | | //反审核 |
| | | if (Cj_StationOutBillAbandonCheckBill(long.Parse(HInterIDs[i]),HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "成功:" + j + "行,第" + (i + 1) + "行:反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.Message = "[0000-1-028]成功:" + j + "行,第" + (i + 1) + "行:反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "全部执行成功!"; |
| | | objJsonResult.Message = "[0000-1-019]全部执行成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反审核失败!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-028]反审核失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | return false; ; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 工序出站关闭/反关闭功能 |
| | | [Route("Cj_StationOutBill/CloseCj_StationOutBill")] |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "完工单无权限关闭!"; |
| | | objJsonResult.Message = "[0000-1-063]完工单无权限关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站单无权限关闭!"; |
| | | objJsonResult.Message = "[0000-1-063]出站单无权限关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空!"; |
| | | objJsonResult.Message = "[0000-1-009]HInterID为空!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已关闭!不需要再关闭!"; |
| | | objJsonResult.Message = "[0000-1-033]单据已关闭!不需要再关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //关闭单据 |
| | | if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | |
| | | //关闭前控制========================================= |
| | | string sql1 = "exec h_p_Sc_StationOutBill_BeforeCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationOutBill_BeforeCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "关闭失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | //关闭单据 |
| | | if (!BillOld.CloseBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationOutBill_AfterCloseCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-034]关闭失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已反关闭!不需要再反关闭!"; |
| | | objJsonResult.Message = "[0000-1-035]单据已反关闭!不需要再反关闭!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //反关闭单据 |
| | | if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | //反关闭前控制========================================= |
| | | string sql1 = "exec h_p_Sc_StationOutBill_BeforeUnCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationOutBill_BeforeUnCloseCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反关闭失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | //反关闭单据 |
| | | if (!BillOld.CancelClose(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationOutBill_AfterUnCloseCtrl", user, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-036]反关闭失败!原因:" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "执行成功!"; |
| | | objJsonResult.Message = "[0000-1-064]执行成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "执行失败!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-034]执行失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | //是否被关联 |
| | | #region //是否被关联 |
| | | public bool Cj_StationInBillisUse(Int64 lngBillKey, ref string sReturn) |
| | | { |
| | | try |
| | |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.Message = "[0000-1-037]"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | objJsonResult.Message = "[0000-1-010]"; |
| | | return objJsonResult; |
| | | } |
| | | |
| | |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.Message = "[0000-1-010]没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 下推质量汇报单时返回工序出站汇报单信息 |
| | | [Route("Cj_StationOutBill/PushDownBackInfo")] |
| | | [HttpGet] |
| | | public object PushDownBackInfo(string linterid, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_StationOutBill_PushDownBackInfo where hmainid in (" + linterid + ")", "h_v_Sc_StationOutBill_PushDownBackInfo"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0 && ds != null) |
| | | { |
| | | //添加列名 |
| | | 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.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无数据"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 编辑页面根据id获取工序出站汇报单信息 |
| | | [Route("Cj_StationOutBill/SetBillTime")] |
| | | [HttpGet] |
| | | public object SetBillTime(int HInterID,DateTime dateTime,string user) |
| | | { |
| | | try |
| | | { |
| | | //判断是否有编辑权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-065]出站单无编辑权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string sql = "select * from Sc_StationOutBillMain with(nolock) where HInterID=" + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "Sc_StationOutBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-1-003]修改失败没找到相关出站汇报单"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //修改前时间修改后时间判断有无工资计算 |
| | | string HGroupID = ds.Tables[0].Rows[0]["HGroupID"].ToString(); |
| | | string HOldDate = ds.Tables[0].Rows[0]["HDate"].ToString(); |
| | | string sql1 = "select * from Pay_SingleBalBillMain where HGroupID =" +HGroupID + " and HDate ='" + HOldDate + "'"; |
| | | string sql2 = "select * from Pay_GroupBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + HOldDate + "'"; |
| | | string sql3 = "select * from Pay_SingleBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + dateTime + "'"; |
| | | string sql4 = "select * from Pay_GroupBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + dateTime + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "Sc_StationOutBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-1-004]修改失败该时间班组已计算工资:" + HOldDate; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn(sql2, "Sc_StationOutBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-1-004]修改失败该时间班组已计算工资:" + HOldDate; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn(sql3, "Sc_StationOutBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-1-004]修改失败该时间班组已计算工资:" + dateTime; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn(sql4, "Sc_StationOutBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3791-1-004]修改失败该时间班组已计算工资:" + dateTime; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //修改时间 |
| | | sql = "update Sc_StationOutBillMain set HDate = '" + dateTime + "' where HInterID = " + HInterID; |
| | | oCN.RunProcReturn(sql, "Sc_StationOutBillMain"); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-067]Sucess!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-066]Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 出站单列表-下推PPM数据录入保存,删除 |
| | | |
| | | [Route("Cj_StationOutBill/PPMSupAddBill")] |
| | | [HttpPost] |
| | | public object PPMSupAddBill([FromBody] JObject sSubStr) |
| | | { |
| | | var _value = sSubStr["sSubStr"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | try |
| | | { |
| | | //反序列化 |
| | | string msg2 = sArray[0].ToString(); //表体 |
| | | string refSav = sArray[1].ToString();//操作类型 |
| | | string user = sArray[2].ToString(); //用户 |
| | | msg2 = msg2.Substring(1, msg2.Length - 2); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | msg2 = "[" + msg2 + "]"; |
| | | //判断是否有编辑权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无编辑权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | List<Sc_StationOutBillSub_Sup> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_StationOutBillSub_Sup>>(msg2); |
| | | |
| | | oCN.BeginTran(); |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | int HInterID = list[i].HInterID; |
| | | int HEntryID = i+1; |
| | | int HSupID = list[i].HSupID; |
| | | double HWasterQty_Mater = list[i].HWasterQty_Mater; |
| | | double HBackWorkQty = list[i].HBackWorkQty; |
| | | |
| | | oCN.RunProc("Insert Into Sc_StationOutBillSub_Sup " + |
| | | "(HInterID, HEntryID, HSupID, HWasterQty_Mater, HBackWorkQty) " + |
| | | "values ('" + HInterID + "', '" + HEntryID + "', '" + HSupID + "', '" + HWasterQty_Mater + "', '" + HBackWorkQty + "')"); |
| | | |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "新增单据成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | [Route("Cj_StationOutBill/PPMSupDelete")] |
| | | [HttpGet] |
| | | public object PPMSupDelete(int HInterID,string user) |
| | | { |
| | | try |
| | | { |
| | | //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-058]无删除权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Sc_StationOutBillSub_Sup WITH(NOLOCK) where HInterID = " + HInterID, "Sc_StationOutBillSub_Sup"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-045]查无数据!"; |
| | | objJsonResult.data = null; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | string sql = ""; |
| | | |
| | | sql = "delete from Sc_StationOutBillSub_Sup where HInterID = " + HInterID; |
| | | oCN.RunProc(sql); |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-037]Sucess!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-038]Exception!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |