chenhaozhe
5 天以前 9ff424751d75ebba92f8317bd2d6aa57094baca4
WebAPI/Controllers/MJGL/Sc_MouldProdOutBillController.cs
@@ -29,7 +29,8 @@
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        public DAL.ClsSc_MouldProdOutBill oBill = new DAL.ClsSc_MouldProdOutBill();
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        #region 器具领用出库单分页列表
        [Route("Sc_MouldProdOutBillController/page")]
@@ -339,6 +340,7 @@
        #region 器具领用出库单 - 托数变更功能
        [Route("Sc_MouldProdOutBill/UpdatePallet")]
        [HttpPost]
        public object UpdatePallet([FromBody] JObject data)
        {
            try
@@ -353,24 +355,9 @@
                if (newPallet <= 0)
                    return new { code = "0", count = 0, Message = "托数必须大于0!" };
                // 检查是否已审核
                string checkAuditSql = $@"
                    SELECT COUNT(*) as HasAudit
                    FROM Sc_MouldStockBillMain
                    WHERE HInterID = {hmainid}
                    AND HChecker IS NOT NULL
                    AND HCheckDate IS NOT NULL";
                DataSet dsAudit = oCn.RunProcReturn(checkAuditSql, "CheckAudit");
                if (dsAudit != null && dsAudit.Tables[0].Rows.Count > 0)
                {
                    int hasAudit = Convert.ToInt32(dsAudit.Tables[0].Rows[0]["HasAudit"]);
                    if (hasAudit > 0)
                    {
                        return new { code = "0", count = 0, Message = "单据已审核,不能修改托数!" };
                    }
                }
                // 直接更新托数
                string updateSql = $@"
                    UPDATE Sc_MouldStockBillMain 
@@ -827,6 +814,26 @@
                if (bResult)
                {
                    string sReturn = "";
                    // 华舟 保存成功后下推工作联系单
                    if (oSystemParameter.ShowBill(ref sReturn) == true)
                    {
                        if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                        {
                            //自动生成工作联系单
                            var ds2 = oCn.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + oBill.omodel.HInterID + "," + 3802, "h_p_OA_WorkLinkBill_Create");
                            if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
                            {
                                int HInterID = int.Parse(ds2.Tables[0].Rows[0]["NewHInterID"].ToString());
                                LogService.Write("执行消息推送..." + HInterID);
                                // 触发消息推送
                                Service.GeTuiService.PubishSingle(HInterID);
                            }
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;  //成功!