| | |
| | | public class Sc_QualityReportBillController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | private json objJsonResult = new json(); |
| | | private json objJsonResultReturn = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | DataSet ds; |
| | | |
| | | #region è¿åçäº§è´¨éæ±æ¥åå表 |
| | |
| | | #endregion |
| | | |
| | | #region å®¡æ ¸ |
| | | public bool set_CheckBill(long HInterID, ref string sReturn) |
| | | public object set_CheckBill(long HInterID,string HChecker, ref string sReturn) |
| | | { |
| | | SQLHelper.ClsCN oCN1 = new SQLHelper.ClsCN(); |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | ds = oCN.RunProcReturn("exec Sc_ICMOBillQualityStatus_AutoCheck", "Sc_ICMOBillQualityStatus_AutoCheck"); |
| | | if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") |
| | | oCN1.BeginTran(); |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Check", 1, true, HChecker)) |
| | | { |
| | | sReturn = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); |
| | | oCN.RollBack(); |
| | | return false; |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¨æ²¡ææé,请ä¸ç®¡çåèç³»ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | sReturn = "å®¡æ ¸æåï¼"; |
| | | oCN.Commit(); |
| | | // |
| | | if (HInterID == 0) |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ID为0ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsSc_QualityReportBill oBill = new DAL.ClsSc_QualityReportBill(); |
| | | //æ¥çæ¯å¦å·²å®¡æ ¸,å
³é,ä½åº |
| | | if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | if (oBill.omodel.HChecker.Trim() != "") |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸ï¼ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³éï¼ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åºï¼ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å®¡æ ¸ |
| | | if (CheckBill(HInterID, HChecker, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | oCN1.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN1.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼åå :" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //å®¡æ ¸SQL |
| | | public bool CheckBill(Int64 HInterID,string HChecker, ref string sReturn) |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCN.RunProc(" Update Sc_QualityReportBillMain set HChecker='" + HChecker + "',HCheckDate=GETDATE() Where HInterID=" + HInterID.ToString()); |
| | | sReturn = ""; |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCN.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | |
| | | #region æäº¤ä¿åï¼å主å表åæç»è¡¨ |
| | | [Route("Sc_QualityReportBill/set_SaveBill")] |
| | | [HttpGet] |
| | | public object set_SaveBill(long HInterID) |
| | | public object set_SaveBill(long HInterID,string HChecker) |
| | | { |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | bool bResult2 = false; |
| | | oCN.BeginTran(); |
| | | //ä¿å |
| | | oCN.RunProc("exec h_p_save_Sc_QualityReportBill " + HInterID); |
| | | //夿æ¯å¦å
许ä¿å |
| | | //夿æ¯å¦å
许ä¿åï¼ä¸å
许ååæ» |
| | | ds = oCN.RunProcReturn("exec h_p_JIT_ICMOBillQualityStatus_SaveCtrl", "h_p_JIT_ICMOBillQualityStatus_SaveCtrl"); |
| | | if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") |
| | | { |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //æ¯å¦å®¡æ ¸ |
| | | bResult2 = set_CheckBill(HInterID, ref ClsPub.sExeReturnInfo); |
| | | //æ¯å¦å®¡æ ¸ |
| | | if (bResult2 == true) |
| | | oCN.Commit(); |
| | | //è·åèªå¨å®¡æ ¸åæ° |
| | | string sReturn = ""; |
| | | if (oSystemParameter.ShowBill(ref sReturn) == true) |
| | | { |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®ä¿åæå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | if (oSystemParameter.omodel.Sc_ICMOBillQualityStatus_AutoCheck == "Y") //ç³»ç»åæ° èªå¨å®¡æ ¸ |
| | | { |
| | | //å®¡æ ¸ |
| | | objJsonResultReturn = (json)set_CheckBill(HInterID, HChecker, ref ClsPub.sExeReturnInfo); |
| | | if (objJsonResultReturn.code == "1") |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼å®¡æ ¸æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼èªå¨å®¡æ ¸å¤±è´¥ï¼åå ï¼" + objJsonResultReturn.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼èªå¨å®¡æ ¸å¤±è´¥ï¼åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åæ®åç宿¯ï¼è·åèªå¨å®¡æ ¸åæ°å¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |