| | |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using VueWebCoreApi.DLL.BLL; |
| | | using VueWebCoreApi.Models; |
| | | using VueWebCoreApi.Models.InventoryModel; |
| | | using VueWebCoreApi.Tools; |
| | | |
| | | namespace VueWebCoreApi.Controllers |
| | |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[å
¥åºè®°å½] |
| | | /// <summary> |
| | | /// å
¥åºè®°å½ |
| | | /// </summary> |
| | | /// <param name="page">页ç </param> |
| | | /// <param name="rows">æ¯é¡µæ¾ç¤ºæ¡æ°</param> |
| | | /// <param name="prop">æåºå段</param> |
| | | /// <param name="order">æåºè§å</param> |
| | | /// <param name="hbillno">å
¥åºåå·</param> |
| | | /// <param name="sono">éå®åå·</param> |
| | | /// <param name="mono">订åå·</param> |
| | | /// <param name="wocode">å·¥åå·</param> |
| | | /// <param name="partcode">产åç¼ç </param> |
| | | /// <param name="partname">产ååç§°</param> |
| | | /// <param name="stockcode">ä»åºç¼ç </param> |
| | | /// <param name="responddate">åæ®æ¥æ</param> |
| | | /// <returns></returns> |
| | | [Route(template: "StorageRecordSearch")] |
| | | [HttpGet] |
| | | public JsonResult StorageRecordSearch(int page, int rows, string prop, string order, string hbillno = null, string sono = null, string mono = null, string wocode = null, string partcode = null,string partname=null, string stockcode=null,string responddate=null) |
| | | { |
| | | string respondopendate = ""; //åæ®å¼å§æ¶é´ |
| | | string respondclosedate = ""; //åæ®ç»ææ¶é´ |
| | | if (responddate != "" && responddate != null) |
| | | { |
| | | respondopendate = responddate.Split('~')[0].ToString(); |
| | | respondclosedate = responddate.Split('~')[1].ToString(); |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //èµ·å§è®°å½rowNum |
| | | int endNum = rows * page; //ç»æè®°å½ rowNum |
| | | mes = ReportManagerBLL.StorageRecordSearch(hbillno, sono, mono, wocode, partcode, partname, stockcode, respondopendate, respondclosedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[å
¥åºè®°å½å é¤] |
| | | /// <summary> |
| | | /// å
¥åºè®°å½å é¤ |
| | | /// </summary> |
| | | /// <param name="json">æäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteStorageRecord")] |
| | | [HttpPost] |
| | | public JsonResult DeleteStorageRecord(List<StorageRecord> json) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = ReportManagerBLL.DeleteStorageRecord(json, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[å
¥åºè®°å½å¯¼åº] |
| | | /// <summary> |
| | | /// å
¥åºè®°å½å¯¼åº |
| | | /// </summary> |
| | | /// <param name="hbillno">å
¥åºåå·</param> |
| | | /// <param name="sono">éå®åå·</param> |
| | | /// <param name="mono">订åå·</param> |
| | | /// <param name="wocode">å·¥åå·</param> |
| | | /// <param name="partcode">产åç¼ç </param> |
| | | /// <param name="partname">产ååç§°</param> |
| | | /// <param name="stockcode">ä»åºç¼ç </param> |
| | | /// <param name="responddate">åæ®æ¥æ</param> |
| | | /// <returns></returns> |
| | | [Route(template: "StorageRecordExcelSearch")] |
| | | [HttpGet] |
| | | public JsonResult StorageRecordExcelSearch(string hbillno = null, string sono = null, string mono = null, string wocode = null, string partcode = null,string partname=null, string stockcode = null, string responddate = null) |
| | | { |
| | | string respondopendate = ""; //åæ®å¼å§æ¶é´ |
| | | string respondclosedate = ""; //åæ®ç»ææ¶é´ |
| | | if (responddate != "" && responddate != null) |
| | | { |
| | | respondopendate = responddate.Split('~')[0].ToString(); |
| | | respondclosedate = responddate.Split('~')[1].ToString(); |
| | | } |
| | | mes = ReportManagerBLL.StorageRecordExcelSearch(hbillno, sono, mono, wocode, partcode, partname, stockcode, respondopendate, respondclosedate); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤] |
| | | #region[ç产å
¥åºè·åé¨é¨ä¿¡æ¯] |
| | | /// <summary> |
| | | /// éæT8ç产å
¥åºæäº¤ |
| | | /// ç产å
¥åºè·åé¨é¨ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route(template: "DeptSelectData")] |
| | | [HttpGet] |
| | | public JsonResult DeptSelectData() |
| | | { |
| | | mes = WorkOrderBLL.DeptSelectData(); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤-代ç ç] |
| | | /// <summary> |
| | | /// éæT8ç产å
¥åºæäº¤-代ç ç |
| | | /// </summary> |
| | | /// <param name="data">æäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤-åå¨è¿ç¨ç(éç¨åä¸å°æå¡å¨ï¼åä¸ä¸ªæ°æ®åº)] |
| | | /// <summary> |
| | | /// éæT8ç产å
¥åºæäº¤-åå¨è¿ç¨ç(éç¨åä¸å°æå¡å¨ï¼åä¸ä¸ªæ°æ®åº) |
| | | /// </summary> |
| | | /// <param name="data">æäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | | [Route(template: "ProductInHouseOrderSpSeave")] |
| | | [HttpPost] |
| | | public JsonResult ProductInHouseOrderSpSeave(InReptModel data) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | //var token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyY29kZSI6Ijk5OTkiLCJ1c2VybmFtZSI6Iuezu-e7n-euoeeQhuWRmCIsInN0b3JnX2NvZGUiOiIiLCJzdG9yZ19uYW1lIjoiIiwiaXNfc3lzdGVtX2FkbWluIjoiWSIsInJvbGVfY29kZSI6IiIsInJvbGVfZGF0YXBlcm1pc3Npb25zIjoiIiwidXNlcnR5cGUiOiJQQyIsInJlZGlza2V5IjoiTmV3TUVTTG9naW5Vc2VySURQQzk5OTkiLCJtZXNTZXR0aW5nIjoie1wicm91dGVcIjp0cnVlLFwiaXNPcmRlclwiOnRydWUsXCJkZXZpY2VcIjp0cnVlLFwidGVjaFwiOnRydWUsXCJ3b3JrT3JkZXJcIjp0cnVlLFwiZXZlcnlcIjpmYWxzZSxcImxhc3RcIjpmYWxzZX0iLCJ0aW1lb3V0IjoiMjAyNC0xMC0yNFQxMjozNTo1MC4zNDI1NzE2KzA4OjAwIn0.Nbc-1sXd4QLLsnj8wH9XC7iWEmP0wDG82gwLxIh94e4"; |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = WorkOrderBLL.ProductInHouseOrderSpSeave(data, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using VueWebCoreApi.DLL.DAL; |
| | | using VueWebCoreApi.Models; |
| | | using VueWebCoreApi.Models.InventoryModel; |
| | | using VueWebCoreApi.Tools; |
| | | |
| | | namespace VueWebCoreApi.DLL.BLL |
| | |
| | | return ReportManagerDAL.AnDonReportSumExcelSearch(wkshopcode, eqpcode, calltypecode, callopendate, callclosedate, respondopendate, respondclosedate); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[å
¥åºè®°å½] |
| | | public static ToMessage StorageRecordSearch(string hbillno, string sono, string mono, string wocode, string partcode,string partname, string stockcode, string respondopendate, string respondclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return ReportManagerDAL.StorageRecordSearch(hbillno,sono,mono,wocode,partcode, partname,stockcode, respondopendate,respondclosedate,startNum,endNum,prop,order); |
| | | } |
| | | #endregion |
| | | |
| | | #region[å
¥åºè®°å½å é¤] |
| | | public static ToMessage DeleteStorageRecord(List<StorageRecord> json, User us) |
| | | { |
| | | return ReportManagerDAL.DeleteStorageRecord(json,us); |
| | | } |
| | | #endregion |
| | | |
| | | #region[å
¥åºè®°å½å¯¼åº] |
| | | public static ToMessage StorageRecordExcelSearch(string hbillno, string sono, string mono, string wocode, string partcode,string partname, string stockcode, string respondopendate, string respondclosedate) |
| | | { |
| | | return ReportManagerDAL.StorageRecordExcelSearch(hbillno, sono, mono, wocode, partcode, partname, stockcode, respondopendate, respondclosedate); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤] |
| | | #region[ç产å
¥åºè·åé¨é¨ä¿¡æ¯] |
| | | public static ToMessage DeptSelectData() |
| | | { |
| | | return WorkOrderDAL.DeptSelectData(); |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤-代ç ç] |
| | | public static ToMessage ProductInHouseOrderSeave(InReptModel data, User us) |
| | | { |
| | | return WorkOrderDAL.ProductInHouseOrderSeave(data, us); |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤-åå¨è¿ç¨ç(éç¨åä¸å°æå¡å¨ï¼åä¸ä¸ªæ°æ®åº)] |
| | | public static ToMessage ProductInHouseOrderSpSeave(InReptModel data, User us) |
| | | { |
| | | return WorkOrderDAL.ProductInHouseOrderSpSeave(data, us); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | using System.Data.SqlClient; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using VueWebCoreApi.Models; |
| | | using VueWebCoreApi.Models.InventoryModel; |
| | | using VueWebCoreApi.Tools; |
| | | |
| | | namespace VueWebCoreApi.DLL.DAL |
| | |
| | | |
| | | |
| | | #region[ç产è¿åº¦æ¥è¡¨] |
| | | public static ToMessage ProductionScheduleReportSearch(string wkshopcode, string status,string socode, string wocode, string partcode, string partname, string partspec, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage ProductionScheduleReportSearch(string wkshopcode, string status, string socode, string wocode, string partcode, string partname, string partspec, string opendate, string closedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | #endregion |
| | | |
| | | #region[ç产è¿åº¦æ¥è¡¨å¯¼åº] |
| | | public static ToMessage ProductionScheduleReportExcelSearch(string wkshopcode, string status,string socode, string wocode,string partcode, string partname, string partspec, string opendate, string closedate) |
| | | public static ToMessage ProductionScheduleReportExcelSearch(string wkshopcode, string status, string socode, string wocode, string partcode, string partname, string partspec, string opendate, string closedate) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | |
| | | |
| | | #region[çç»å·¥èµæ¥è¡¨è®°å½æ¥è¯¢] |
| | | public static ToMessage GroupSalaryReportSearch(string compute,string wkshopcode,string socode, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage GroupSalaryReportSearch(string compute, string wkshopcode, string socode, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | search += "and P.isend=@isend "; |
| | | dynamicParams.Add("@isend", "Y"); |
| | | } |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | { |
| | | search += "and K.wkshp_code=@wkshopcode "; |
| | | dynamicParams.Add("@wkshopcode", wkshopcode); |
| | |
| | | #endregion |
| | | |
| | | #region[çç»å·¥èµæ¥è¡¨è®°å½å¯¼åº] |
| | | public static ToMessage GroupSalaryReportExcelSearch(string compute,string wkshopcode,string socode, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate) |
| | | public static ToMessage GroupSalaryReportExcelSearch(string compute, string wkshopcode, string socode, string wocode, string partcode, string partname, string partspec, string stepname, string groupcode, string username, string operopendate, string operclosedate) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | |
| | | |
| | | #region[人åå·¥èµæç»æ¥è¡¨] |
| | | public static ToMessage PeopleSalaryReportSearch(string compute,string wkshopcode,string socode, string wocode, string partcode, string partname, string partspec,string stepcode, string stepname, string reportname, string reportopendate, string reportclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage PeopleSalaryReportSearch(string compute, string wkshopcode, string socode, string wocode, string partcode, string partname, string partspec, string stepcode, string stepname, string reportname, string reportopendate, string reportclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | #endregion |
| | | |
| | | #region[人åå·¥èµæç»æ¥è¡¨å¯¼åº] |
| | | public static ToMessage PeopleSalaryReportSearch(string compute,string wkshopcode,string socode, string wocode, string partcode, string partname, string partspec, string stepcode, string stepname, string reportname, string reportopendate, string reportclosedate) |
| | | public static ToMessage PeopleSalaryReportSearch(string compute, string wkshopcode, string socode, string wocode, string partcode, string partname, string partspec, string stepcode, string stepname, string reportname, string reportopendate, string reportclosedate) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | dynamicParams.Add("@respondopendate", respondopendate + " 00:00:00"); |
| | | dynamicParams.Add("@respondclosedate", respondclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | |
| | | dynamicParams.Add("@respondopendate", respondopendate + " 00:00:00"); |
| | | dynamicParams.Add("@respondclosedate", respondclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | |
| | | dynamicParams.Add("@respondopendate", respondopendate + " 00:00:00"); |
| | | dynamicParams.Add("@respondclosedate", respondclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | |
| | | dynamicParams.Add("@respondopendate", respondopendate + " 00:00:00"); |
| | | dynamicParams.Add("@respondclosedate", respondclosedate + " 23:59:59"); |
| | | } |
| | | |
| | | if (search == "") |
| | | { |
| | | search = "and 1=1 "; |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[å
¥åºè®°å½] |
| | | public static ToMessage StorageRecordSearch(string hbillno, string sono, string mono, string wocode, string partcode, string partname, string stockcode, string respondopendate, string respondclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (hbillno != "" && hbillno != null) |
| | | { |
| | | search += "and AA.hbillno like '%'+@hbillno+'%' "; |
| | | dynamicParams.Add("@hbillno", hbillno); |
| | | } |
| | | if (sono != "" && sono != null) |
| | | { |
| | | search += "and AA.salecode like '%'+@sono+'%' "; |
| | | dynamicParams.Add("@sono", sono); |
| | | } |
| | | if (mono != "" && mono != null) |
| | | { |
| | | search += "and AA.mo_no like '%'+@mono+'%' "; |
| | | dynamicParams.Add("@mono", mono); |
| | | } |
| | | if (wocode != "" && wocode != null) |
| | | { |
| | | search += "and AA.wocode like '%'+@wocode+'%' "; |
| | | dynamicParams.Add("@wocode", wocode); |
| | | } |
| | | if (partcode != "" && partcode != null) |
| | | { |
| | | search += "and AA.partcode like '%'+@partcode+'%' "; |
| | | dynamicParams.Add("@partcode", partcode); |
| | | } |
| | | if (partname != "" && partname != null) |
| | | { |
| | | search += "and AA.partname like '%'+@partname+'%' "; |
| | | dynamicParams.Add("@partname", partname); |
| | | } |
| | | if (stockcode != "" && stockcode != null) |
| | | { |
| | | search += "and AA.stockcode=@stockcode "; |
| | | dynamicParams.Add("@stockcode", stockcode); |
| | | } |
| | | if (respondopendate != "" && respondopendate != null) |
| | | { |
| | | search += "and AA.hbdate between @respondopendate and @respondclosedate "; |
| | | dynamicParams.Add("@respondopendate", respondopendate + " 00:00:00"); |
| | | dynamicParams.Add("@respondclosedate", respondclosedate + " 23:59:59"); |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select * from( |
| | | select A.hbillno,A.hbdate,B.salecode,B.mo_no,B.wocode,B.partcode,P.partname,P.partspec,M.wkshp_code,T.torg_name as wkshp_name,B.stockcode,S.name as stockname, |
| | | B.qty,B.inbarcode,R.step_code,E.stepname,R.style,A.create_user,A.create_date |
| | | from TK_WMS_Inwh_Main A |
| | | inner join TK_WMS_Inwh_Sub B on A.hbillno=B.hbillno |
| | | inner join TK_Wrk_Record R on B.inbarcode=R.inbarcode |
| | | left join TK_Wrk_Man M on B.wocode=M.wo_code |
| | | left join TMateriel_Info P on B.partcode=P.partcode |
| | | left join TSecStck S on B.stockcode=S.code |
| | | left join TStep E on R.step_code=E.stepcode |
| | | left join TOrganization T on M.wkshp_code=T.torg_code |
| | | union all |
| | | select A.hbillno,A.hbdate,B.salecode,B.mo_no,B.wocode,B.partcode,P.partname,P.partspec,M.wkshp_code,T.torg_name as wkshp_name,B.stockcode,S.name as stockname, |
| | | B.qty,B.inbarcode,O.step_code,E.stepname,O.style,A.create_user,A.create_date |
| | | from TK_WMS_Inwh_Main A |
| | | inner join TK_WMS_Inwh_Sub B on A.hbillno=B.hbillno |
| | | inner join TK_Wrk_OutRecord O on B.inbarcode=O.inbarcode |
| | | left join TK_Wrk_Man M on B.wocode=M.wo_code |
| | | left join TMateriel_Info P on B.partcode=P.partcode |
| | | left join TSecStck S on B.stockcode=S.code |
| | | left join TStep E on O.step_code=E.stepcode |
| | | left join TOrganization T on M.wkshp_code=T.torg_code |
| | | ) as AA where 1=1 " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.message = "æ¥è¯¢æå!"; |
| | | mes.count = total; |
| | | mes.data = data.ToList(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[å
¥åºè®°å½å é¤] |
| | | public static ToMessage DeleteStorageRecord(List<StorageRecord> json, User us) |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | // 使ç¨LINQçlambdaè¡¨è¾¾å¼æ ¹æ®hbillnoåç»å¹¶ç»è®¡æ¯ä¸ªç»çæ¡æ° |
| | | var groupedRecords = json.GroupBy(r => r.hbillno).Select(g => new{hbillno = g.Key,count = g.Count()}).ToList(); |
| | | for (int i = 0; i < groupedRecords.Count; i++) |
| | | { |
| | | //æ¥è¯¢å
¥åºååè¡¨çæ°æ®æ¡æ° |
| | | sql = @"select * from TK_WMS_Inwh_Sub where hbillno=@hbillno"; |
| | | dynamicParams.Add("@hbillno", groupedRecords[i].hbillno); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | //å表æå¯¹åºå
¥åºåå·æ°æ®ä¸æ°æ®æ¡æ°çäºæäº¤çå
¥åºæ¡æ° |
| | | if (data.Rows.Count > 0 && data.Rows.Count == groupedRecords[i].count) |
| | | { |
| | | //å é¤å
¥åºå主表 |
| | | sql = @"delete TK_WMS_Inwh_Main where hbillno=@hbillno"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | hbillno = groupedRecords[i].hbillno.ToString() |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < json.Count; i++) |
| | | { |
| | | //å é¤å
¥åºåå表 |
| | | sql = @"delete TK_WMS_Inwh_Sub where hbillno=@hbillno and inbarcode=@inbarcode"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | hbillno = json[i].hbillno.ToString(), |
| | | inbarcode = json[i].inbarcode.ToString() |
| | | } |
| | | }); |
| | | if (json[i].style == "B") |
| | | { |
| | | //èªå¶æ¥å·¥è®°å½è¡¨å
¥åºæ°é |
| | | sql = @"update TK_Wrk_Record set inhouseqty=inhouseqty-@qty where inbarcode=@inbarcode"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | qty = json[i].qty.ToString(), |
| | | inbarcode = json[i].inbarcode.ToString() |
| | | } |
| | | }); |
| | | } |
| | | if (json[i].style == "S") |
| | | { |
| | | //å¤åæ¶æè®°å½è¡¨å
¥åºæ°é |
| | | sql = @"update TK_Wrk_OutRecord set inhouseqty=inhouseqty-@qty where inbarcode=@inbarcode"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | qty = json[i].qty.ToString(), |
| | | inbarcode = json[i].inbarcode.ToString() |
| | | } |
| | | }); |
| | | } |
| | | //æ¸
é¤å·¥åºä»»å¡è¡¨ç´¯è®¡å
¥åºæ°é |
| | | sql = @"update TK_Wrk_Step set inhouseqty=inhouseqty-@qty where wo_code=@wocode and step_code=@stepcode and isend='Y'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | qty = json[i].qty.ToString(), |
| | | wocode = json[i].wocode.ToString(), |
| | | stepcode = json[i].step_code.ToString() |
| | | } |
| | | }); |
| | | } |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | LogHelper.WriteLogData(aa.ToString()); |
| | | if (aa) |
| | | { |
| | | //åå
¥æä½è®°å½è¡¨ |
| | | LogHelper.DbOperateLog(us.usercode, "å é¤", "å é¤äºå
¥åºå:"+ string.Join(",", json.Select(r => $"{r.hbillno},{r.inbarcode}")), us.usertype); |
| | | mes.code = "200"; |
| | | mes.count = 0; |
| | | mes.message = "å
¥åºåå 餿å!"; |
| | | mes.data = null; |
| | | } |
| | | else |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = "å
¥åºåå é¤å¤±è´¥!"; |
| | | mes.data = null; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[å
¥åºè®°å½å¯¼åº] |
| | | public static ToMessage StorageRecordExcelSearch(string hbillno, string sono, string mono, string wocode, string partcode, string partname, string stockcode, string respondopendate, string respondclosedate) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (hbillno != "" && hbillno != null) |
| | | { |
| | | search += "and AA.hbillno like '%'+@hbillno+'%' "; |
| | | dynamicParams.Add("@hbillno", hbillno); |
| | | } |
| | | if (sono != "" && sono != null) |
| | | { |
| | | search += "and AA.salecode like '%'+@sono+'%' "; |
| | | dynamicParams.Add("@sono", sono); |
| | | } |
| | | if (mono != "" && mono != null) |
| | | { |
| | | search += "and AA.mo_no like '%'+@mono+'%' "; |
| | | dynamicParams.Add("@mono", mono); |
| | | } |
| | | if (wocode != "" && wocode != null) |
| | | { |
| | | search += "and AA.wocode like '%'+@wocode+'%' "; |
| | | dynamicParams.Add("@wocode", wocode); |
| | | } |
| | | if (partcode != "" && partcode != null) |
| | | { |
| | | search += "and AA.partcode like '%'+@partcode+'%' "; |
| | | dynamicParams.Add("@partcode", partcode); |
| | | } |
| | | if (partname != "" && partname != null) |
| | | { |
| | | search += "and AA.partname like '%'+@partname+'%' "; |
| | | dynamicParams.Add("@partname", partname); |
| | | } |
| | | if (stockcode != "" && stockcode != null) |
| | | { |
| | | search += "and AA.stockcode=@stockcode "; |
| | | dynamicParams.Add("@stockcode", stockcode); |
| | | } |
| | | if (respondopendate != "" && respondopendate != null) |
| | | { |
| | | search += "and A.hbdate between @respondopendate and @respondclosedate "; |
| | | dynamicParams.Add("@respondopendate", respondopendate + " 00:00:00"); |
| | | dynamicParams.Add("@respondclosedate", respondclosedate + " 23:59:59"); |
| | | } |
| | | //search = search.Substring(3);//æªåç´¢å¼2åé¢çå符 |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select AA.hbillno as å
¥åºåå·,AA.hbdate as åæ®æ¥æ,AA.salecode as éå®åå·,AA.mo_no as 订åå·,AA.wocode as å·¥åå·,AA.partcode as 产åç¼ç ,AA.partname as 产ååç§°, |
| | | AA.partspec as 产åè§æ ¼,AA.wkshp_code as 车é´ç¼ç ,AA.torg_name as 车é´åç§°,AA.stockcode as ä»åºç¼ç ,AA.stockname as ä»åºåç§°, AA.qty as å
¥åºæ°é, |
| | | AA.step_code as å·¥åºç¼ç ,AA.stepname as å·¥åºåç§°,AA.create_user as å建人å,AA.create_date as å建æ¶é´ |
| | | from( |
| | | select A.hbillno,A.hbdate,B.salecode,B.mo_no,B.wocode,B.partcode,P.partname,P.partspec,M.wkshp_code,T.torg_name,B.stockcode,S.name as stockname, |
| | | B.qty,B.inbarcode,R.step_code,E.stepname,R.style,A.create_user,A.create_date |
| | | from TK_WMS_Inwh_Main A |
| | | inner join TK_WMS_Inwh_Sub B on A.hbillno=B.hbillno |
| | | inner join TK_Wrk_Record R on B.inbarcode=R.inbarcode |
| | | left join TK_Wrk_Man M on B.wocode=M.wo_code |
| | | left join TMateriel_Info P on B.partcode=P.partcode |
| | | left join TSecStck S on B.stockcode=S.code |
| | | left join TStep E on R.step_code=E.stepcode |
| | | left join TOrganization T on M.wkshp_code=T.torg_code |
| | | union all |
| | | select A.hbillno,A.hbdate,B.salecode,B.mo_no,B.wocode,B.partcode,P.partname,P.partspec,M.wkshp_code,T.torg_name as wkshp_name,B.stockcode,S.name as stockname, |
| | | B.qty,B.inbarcode,O.step_code,E.stepname,O.style,A.create_user,A.create_date |
| | | from TK_WMS_Inwh_Main A |
| | | inner join TK_WMS_Inwh_Sub B on A.hbillno=B.hbillno |
| | | inner join TK_Wrk_OutRecord O on B.inbarcode=O.inbarcode |
| | | left join TK_Wrk_Man M on B.wocode=M.wo_code |
| | | left join TMateriel_Info P on B.partcode=P.partcode |
| | | left join TSecStck S on B.stockcode=S.code |
| | | left join TStep E on O.step_code=E.stepcode |
| | | left join TOrganization T on M.wkshp_code=T.torg_code |
| | | ) as AA where 1=1 " + search; |
| | | DataTable data = DapperHelper.selectdata(sql, dynamicParams); |
| | | data.TableName = "Table"; //设置DataTableçåç§° |
| | | string msg = DownLoad.DataTableToExcel(data, "å
¥åºè®°å½æ¥è¡¨"); |
| | | mes.code = "200"; |
| | | mes.message = "æ¥è¯¢æå!"; |
| | | mes.count = total; |
| | | mes.data = msg; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | #endregion |
| | | |
| | | #region[ERP订åä¸è¾¾] |
| | | public static ToMessage MarkSaveErpOrder(string erporderid, string sbid, string erpordercode, string saleordercode, string partcode,string deptcode, string wkshopcode, string warehousecode, string erpqty, string markqty, string ordernum, string relse_qty, string saleOrderDeliveryDate, string paystartdate, string payenddate, string clerkuser, User us) |
| | | public static ToMessage MarkSaveErpOrder(string erporderid, string sbid, string erpordercode, string saleordercode, string partcode, string deptcode, string wkshopcode, string warehousecode, string erpqty, string markqty, string ordernum, string relse_qty, string saleOrderDeliveryDate, string paystartdate, string payenddate, string clerkuser, User us) |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | |
| | | wo_code = wo, |
| | | wotype = "PO", |
| | | status = "NEW", |
| | | dept_code=deptcode, |
| | | dept_code = deptcode, |
| | | wkshp_code = wkshopcode, |
| | | plan_qty = cdqty, |
| | | stck_code = warehousecode, |
| | |
| | | wo_code = wo, |
| | | wotype = "PO", |
| | | status = "NEW", |
| | | dept_code=model.deptcode, |
| | | dept_code = model.deptcode, |
| | | wkshp_code = model.wkshopcode, |
| | | plan_qty = decimal.Parse(model.erpqty), //è®¢åæ°é |
| | | stck_code = model.warehousecode, |
| | |
| | | } |
| | | //æ ¹æ®æ¡ä»¶æ¥è¯¢å·¥åå·¥åºä»»å¡(èªå¶å·¥åº) |
| | | sql = @"select A.id,A.status,B.dept_code,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,M.partcode,M.partname,M.partspec,A.seq,A.isbott,A.isend, |
| | | S.stepcode,S.stepname,S.descr,A.plan_qty,A.good_qty,A.ng_qty,A.laborbad_qty,A.materielbad_qty,B.lm_date |
| | | S.stepcode,S.stepname,S.descr,A.plan_qty,A.good_qty,A.ng_qty,A.laborbad_qty,A.materielbad_qty,B.lm_date, |
| | | E.sbid,B.m_po,E.saleOrderCode,E.saleOrderDetailId,E.unitid,E.unitcode,E.unitname,K.code as stockcode,k.name as stockname |
| | | from TK_Wrk_Step A |
| | | left join TK_Wrk_Man B on A.wo_code=B.wo_code |
| | | left join TMateriel_Info M on B.materiel_code=M.partcode |
| | | left join TStep S on A.step_code=S.stepcode |
| | | left join TOrganization T on B.wkshp_code=T.torg_code |
| | | left join TKimp_Ewo E on B.sourceid=E.id and B.m_po=E.wo |
| | | left join TSecStck K on M.idwarehouse=K.code |
| | | where A.status in('ALLO','START') and S.flwtype='Z' " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | |
| | | sql = @"select A.id,A.status,B.dept_code,B.wkshp_code,T.torg_name as wkshp_name,A.wo_code,M.partcode,M.partname,M.partspec,A.seq,A.isbott,A.isend, |
| | | S.stepcode,S.stepname,S.descr,A.plan_qty,A.good_qty,A.ng_qty, |
| | | (select isnull(sum(fqty),0) as fqty from TK_Wrk_OutRecord where wo_code=A.wo_code and step_code=A.step_code and style='F') as fqty, |
| | | A.laborbad_qty,A.materielbad_qty,A.plan_startdate,A.plan_enddate,B.lm_date |
| | | A.laborbad_qty,A.materielbad_qty,A.plan_startdate,A.plan_enddate,B.lm_date, |
| | | E.sbid,B.m_po,E.saleOrderCode,E.saleOrderDetailId,E.unitid,E.unitcode,E.unitname,K.code as stockcode,k.name as stockname |
| | | from TK_Wrk_Step A |
| | | left join TK_Wrk_Man B on A.wo_code=B.wo_code |
| | | left join TMateriel_Info M on B.materiel_code=M.partcode |
| | | left join TStep S on A.step_code=S.stepcode |
| | | left join TOrganization T on B.wkshp_code=T.torg_code |
| | | left join TKimp_Ewo E on B.sourceid=E.id and B.m_po=E.wo |
| | | left join TSecStck K on M.idwarehouse=K.code |
| | | where A.status in('ALLO','START') and S.flwtype='W' " + search; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | |
| | | else //ä¸æåºæ¶åæ |
| | | { |
| | | mes = ScanStartReport.NoWXEncodingSeach(SelectType, wocode, stepcode); |
| | | } |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else //ä¸æåº |
| | |
| | | //æ§å¶é»è¾ï¼å½åå·¥åºæ¥å·¥è°æ´-> (æ¬éå·¥åºå½åè°æ´åæ ¼æ°+æ¬éå·¥åºéå½åæ¥å·¥åæ ¼æ»æ°)<ä¸éå·¥åºæ¥å·¥æ»æ°(åæ ¼+ä¸è¯+æ¥åº) ==ä¸è½å°äºä¸éæ¥å·¥æ»æ° |
| | | list.Clear(); |
| | | //夿å½åå·¥åºæ¯èªå¶å·¥åºè¿æ¯å¤åå·¥åº |
| | | if (json[0].flw_type.ToString() == "Z") |
| | | if (json[0].flw_type.ToString() == "Z") |
| | | { |
| | | |
| | | //æ¥è¯¢å½åæ¥å·¥å·¥åºéæ¤æ¬¡æ¥å·¥ï¼æ»æ¥å·¥æ°éãæ»ä¸è¯æ°éãæ»å·¥åºæ°éãæ»æåºæ°é |
| | | |
| | | //æ¥è¯¢å½åæ¥å·¥å·¥åºéæ¤æ¬¡æ¥å·¥ï¼æ»æ¥å·¥æ°éãæ»ä¸è¯æ°éãæ»å·¥åºæ°éãæ»æåºæ°é |
| | | sql = @"select isnull(sum(good_qty),0) as good_qty,isnull(sum(ng_qty),0) as ng_qty,isnull(sum(laborbad_qty),0) as laborbad_qty,isnull(sum(materielbad_qty),0) as materielbad_qty |
| | | from TK_Wrk_Record where wo_code=@wo_code and style='B' and id<>@id and step_code=@step_code"; |
| | | dynamicParams.Add("@wo_code", json[0].wo_code); |
| | |
| | | return mes; |
| | | } |
| | | } |
| | | if (json[0].flw_type.ToString() == "W") |
| | | if (json[0].flw_type.ToString() == "W") |
| | | { |
| | | //è·åå½åå·¥åºãä¾åºå对åºçæ»åææ°é |
| | | sql = @"select isnull(sum(fqty),0) as fqty |
| | |
| | | decimal notthis_ngqty = decimal.Parse(dt.Rows[0]["ng_qty"].ToString()); //å½åæ«éå·¥åºéæ¬æ¬¡æ¥å·¥æ»æ° |
| | | decimal notthis_laborbad_qty = decimal.Parse(dt.Rows[0]["laborbad_qty"].ToString()); //å½åæ«éå·¥åºéæ¬æ¬¡æ¥å·¥å·¥åºæ»æ° |
| | | decimal notthis_materielbad_qty = decimal.Parse(dt.Rows[0]["materielbad_qty"].ToString()); //å½åæ«éå·¥åºéæ¬æ¬¡æ¥å·¥æåºæ»æ° |
| | | //è·åå½åæ«éå·¥åºæ¶ææ»æ°éï¼æ¬æ¬¡ä¿®æ¹æ¶ææ°é+æ¬æ¬¡ä¿®æ¹ä¸è¯æ°é+æ¬æ¬¡ä¿®æ¹å·¥åºæ°é+æ¬æ¬¡ä¿®æ¹æ¥å·¥æåºæ°é+å½åå·¥åºéæ¬æ¬¡æ¶ææ»æ°+å½åå·¥åºéæ¬æ¬¡ä¸è¯æ»æ°+å½åå·¥åºéæ¬æ¬¡å·¥åºæ»æ°+å½åå·¥åºéæ¬æ¬¡æåºæ»æ° |
| | | //è·åå½åæ«éå·¥åºæ¶ææ»æ°éï¼æ¬æ¬¡ä¿®æ¹æ¶ææ°é+æ¬æ¬¡ä¿®æ¹ä¸è¯æ°é+æ¬æ¬¡ä¿®æ¹å·¥åºæ°é+æ¬æ¬¡ä¿®æ¹æ¥å·¥æåºæ°é+å½åå·¥åºéæ¬æ¬¡æ¶ææ»æ°+å½åå·¥åºéæ¬æ¬¡ä¸è¯æ»æ°+å½åå·¥åºéæ¬æ¬¡å·¥åºæ»æ°+å½åå·¥åºéæ¬æ¬¡æåºæ»æ° |
| | | decimal updatereportsumqty = this_reportqty + this_ngqty + this_laborbadqty + this_materielbadqty + notthis_reportqty + notthis_ngqty + notthis_laborbad_qty + notthis_materielbad_qty; |
| | | //夿å½åå·¥åºä¾åºåæ¶ææ»æ°>å½åå·¥åºä¾åºå对åºåææ°é |
| | | if (updatereportsumqty > decimal.Parse(dt_0.Rows[0]["fqty"].ToString())) |
| | |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | step_price=decimal.Parse(json[0].unprice), |
| | | step_price = decimal.Parse(json[0].unprice), |
| | | good_qty = decimal.Parse(json[0].report_dvalue), |
| | | ng_qty = this_ng_dvalue, |
| | | laborbad_qty = this_laborbad_dvalue, |
| | |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | step_price=decimal.Parse(json[0].unprice), |
| | | step_price = decimal.Parse(json[0].unprice), |
| | | good_qty = decimal.Parse(json[0].report_dvalue), |
| | | ng_qty = this_ng_dvalue, |
| | | laborbad_qty = this_laborbad_dvalue, |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤] |
| | | #region[ç产å
¥åºè·åé¨é¨ä¿¡æ¯] |
| | | public static ToMessage DeptSelectData() |
| | | { |
| | | var sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | | try |
| | | { |
| | | sql = @"select * from h_v_TFDepent"; |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | mes.code = "200"; |
| | | mes.message = "æ¥è¯¢æå!"; |
| | | mes.data = data; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤-代ç ç] |
| | | public static ToMessage ProductInHouseOrderSeave(InReptModel data, User us) |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | list.Clear(); |
| | | //æ¥è¯¢å
¥åºåæ¯å¦å·²åå¨ |
| | | sql = @"select * from srv_lnk_TFT8.erp_t8_XKDCS.[dbo].[scm_in1] where sheet_no=@hbillno"; |
| | | dynamicParams.Add("@hbillno", data.TableData[0].Rows[0]["hbillno"].ToString()); |
| | | var data0 = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data0.Rows.Count > 0) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = "å
¥åºåå·å·²åå¨!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | //åå
¥å
¥åºå主表(MES) |
| | | sql = @"insert into TK_WMS_Inwh_Main(docu_typecode,hbillno,hbdate,deptno,storehouse_code,status,remark,create_user,create_date) |
| | | values(@docu_typecode,@hbillno,@hbdate,@deptno,@storehouse_code,@status,@remark,@create_user,@create_date)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | docu_typecode = "WI", |
| | | hbillno = data.TableData[0].Rows[0]["hbillno"].ToString(), |
| | | hbdate = data.TableData[0].Rows[0]["hbdate"].ToString(), |
| | | deptno = data.TableData[0].Rows[0]["deptno"].ToString(), |
| | | storehouse_code = data.TableData[0].Rows[0]["storehouse_code"].ToString(), |
| | | status = data.TableData[0].Rows[0]["status"].ToString(), |
| | | remark = data.TableData[0].Rows[0]["remark"].ToString(), |
| | | create_user = data.TableData[0].Rows[0]["create_user"].ToString(), |
| | | create_date = data.TableData[0].Rows[0]["create_date"].ToString() |
| | | } |
| | | }); |
| | | //åå
¥å
¥åºå主表(T8) |
| | | sql = @"insert into srv_lnk_TFT8.erp_t8_XKDCS.[dbo].[scm_in1](sheet_type,sheet_no,sheet_sta,sheet_date,dept_no,st_no,sheet_amt,check_sta,create_date,create_user,add_flag) |
| | | values(@sheet_type,@sheet_no,@sheet_sta,@sheet_date,@dept_no,@st_no,@sheet_amt,@check_sta,@create_date,@create_user,@add_flag)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | sheet_type = "WI", |
| | | sheet_no = data.TableData[0].Rows[0]["hbillno"].ToString(), |
| | | sheet_sta = data.TableData[0].Rows[0]["status"].ToString(), |
| | | sheet_date = data.TableData[0].Rows[0]["hbdate"].ToString(), |
| | | dept_no = data.TableData[0].Rows[0]["deptno"].ToString(), |
| | | st_no = data.TableData[0].Rows[0]["storehouse_code"].ToString(), |
| | | sheet_amt = "0", |
| | | check_sta = "0", |
| | | create_date = data.TableData[0].Rows[0]["create_date"].ToString(), |
| | | create_user = data.TableData[0].Rows[0]["create_user"].ToString(), |
| | | add_flag = "1" |
| | | } |
| | | }); |
| | | |
| | | for (int i = 0; i < data.TableData[1].Rows.Count; i++) |
| | | { |
| | | if (data.TableData[1].Rows[i]["style"].ToString() == "B") |
| | | { |
| | | //æ¡ä»¶æ»¡è¶³æ¶æ§è¡çæä½(ååæ¥å·¥è®°å½ä¸»è¡¨çå
¥åºæ°é) |
| | | sql = @"update TK_Wrk_Record set inhouseqty=inhouseqty+@qty where inbarcode=@inbarcode"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | qty = data.TableData[1].Rows[i]["qty"].ToString(), |
| | | inbarcode = data.TableData[1].Rows[i]["inbarcode"].ToString() |
| | | } |
| | | }); |
| | | } |
| | | if (data.TableData[1].Rows[i]["style"].ToString() == "S") |
| | | { |
| | | //æ¡ä»¶æ»¡è¶³æ¶æ§è¡çæä½(ååå¤åæ¶æè®°å½ä¸»è¡¨çå
¥åºæ°é) |
| | | sql = @"update TK_Wrk_OutRecord set inhouseqty=inhouseqty+@qty where inbarcode=@inbarcode"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | qty = data.TableData[1].Rows[i]["qty"].ToString(), |
| | | inbarcode = data.TableData[1].Rows[i]["inbarcode"].ToString() |
| | | } |
| | | }); |
| | | } |
| | | //ååå·¥åå·¥åºè¡¨æ«éå·¥åºå·²å
¥åºæ°é |
| | | sql = @"update TK_Wrk_Step set inhouseqty=inhouseqty+@qty where wo_code=@wocode and step_code=@stepcode and isend='Y'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | qty = data.TableData[1].Rows[i]["qty"].ToString(), |
| | | wocode = data.TableData[1].Rows[i]["wocode"].ToString(), |
| | | stepcode = data.TableData[1].Rows[i]["stepcode"].ToString() |
| | | } |
| | | }); |
| | | //åå
¥å
¥åºåå表(MES) |
| | | sql = @"insert into TK_WMS_Inwh_Sub (hbillno,rownumber,inbarcode,mo_id,mo_no,wocode,partcode,unitcode,unit_rate,stockcode,qty,price,saleid,salecode,status,style) |
| | | values(@hbillno,@rownumber,@inbarcode,@mo_id,@mo_no,@wocode,@partcode,@unitcode,@unit_rate,@stockcode,@qty,@price,@saleid,@salecode,@status,@style)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | hbillno = data.TableData[1].Rows[i]["hbillno"].ToString(), |
| | | rownumber = data.TableData[1].Rows[i]["rownumber"].ToString(), |
| | | inbarcode = data.TableData[1].Rows[i]["inbarcode"].ToString(), |
| | | mo_id = data.TableData[1].Rows[i]["mo_id"].ToString(), |
| | | mo_no = data.TableData[1].Rows[i]["mo_no"].ToString(), |
| | | wocode = data.TableData[1].Rows[i]["wocode"].ToString(), |
| | | partcode = data.TableData[1].Rows[i]["partcode"].ToString(), |
| | | unitcode = data.TableData[1].Rows[i]["unitcode"].ToString(), |
| | | unit_rate = data.TableData[1].Rows[i]["unit_rate"].ToString(), |
| | | stockcode = data.TableData[1].Rows[i]["stockcode"].ToString(), |
| | | qty = data.TableData[1].Rows[i]["qty"].ToString(), |
| | | price = data.TableData[1].Rows[i]["price"].ToString(), |
| | | saleid = data.TableData[1].Rows[i]["saleid"].ToString(), |
| | | salecode = data.TableData[1].Rows[i]["salecode"].ToString(), |
| | | status = data.TableData[1].Rows[i]["status"].ToString(), |
| | | style = data.TableData[1].Rows[i]["style"].ToString() |
| | | } |
| | | }); |
| | | //åå
¥å
¥åºåå表(T8) |
| | | sql = @"insert into srv_lnk_TFT8.erp_t8_XKDCS.[dbo].[scm_in2] (sheet_no,sheet_id,goods_no,unit_no,unit_rate,st_no,sheet_qty,mo_no,mo_id,sheet_pri,ord_no,ord_id,sheet_sta,add_flag) |
| | | values(@sheet_no,@sheet_id,@goods_no,@unit_no,@unit_rate,@st_no,@sheet_qty,@mo_no,@mo_id,@sheet_pri,@ord_no,@ord_id,@sheet_sta,@add_flag)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | sheet_no = data.TableData[1].Rows[i]["hbillno"].ToString(), |
| | | sheet_id = data.TableData[1].Rows[i]["rownumber"].ToString(), |
| | | goods_no = data.TableData[1].Rows[i]["partcode"].ToString(), |
| | | unit_no = data.TableData[1].Rows[i]["unitcode"].ToString(), |
| | | unit_rate = "1", |
| | | st_no = data.TableData[1].Rows[i]["stockcode"].ToString(), |
| | | sheet_qty = data.TableData[1].Rows[i]["qty"].ToString(), |
| | | mo_no = data.TableData[1].Rows[i]["mo_no"].ToString(), |
| | | mo_id = data.TableData[1].Rows[i]["mo_id"].ToString(), |
| | | sheet_pri = "1", |
| | | ord_no = data.TableData[1].Rows[i]["salecode"].ToString(), |
| | | ord_id = data.TableData[1].Rows[i]["saleid"].ToString(), |
| | | sheet_sta = data.TableData[1].Rows[i]["status"].ToString(), |
| | | add_flag = "1" |
| | | } |
| | | }); |
| | | } |
| | | //æ´æ°å
¥åºåæµæ°´å· |
| | | sql = @" update TCodeRules set value = @incbit, incbit = LEN(CAST(@incbit AS VARCHAR)) where menucode = @rightcode"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | incbit = data.incbit, |
| | | rightcode = data.rightcode |
| | | } |
| | | }); |
| | | |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | | //åå
¥æä½è®°å½è¡¨ |
| | | LogHelper.DbOperateLog(us.usercode, "å
¥åºåä¿å", "å
¥åºåå·:" + data.TableData[0].Rows[0]["hbillno"].ToString(), us.usertype); |
| | | mes.code = "200"; |
| | | mes.count = 0; |
| | | mes.message = "æä½æå!"; |
| | | mes.data = null; |
| | | } |
| | | else |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = "æä½å¤±è´¥!"; |
| | | mes.data = null; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[éæT8ç产å
¥åºæäº¤-åå¨è¿ç¨ç(éç¨åä¸å°æå¡å¨ï¼åä¸ä¸ªæ°æ®åº)] |
| | | public static ToMessage ProductInHouseOrderSpSeave(InReptModel data, User us) |
| | | { |
| | | var sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace VueWebCoreApi.Models.InventoryModel |
| | | { |
| | | public class StorageRecord |
| | | { |
| | | /// <summary> |
| | | /// å
¥åºåå· |
| | | /// </summary> |
| | | public string hbillno { get; set; } |
| | | /// <summary> |
| | | /// éå®åå· |
| | | /// </summary> |
| | | public string salecode { get; set; } |
| | | /// <summary> |
| | | /// 订åå· |
| | | /// </summary> |
| | | public string mo_no { get; set; } |
| | | /// <summary> |
| | | /// å·¥åå· |
| | | /// </summary> |
| | | public string wocode { get; set; } |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | public string partcode { get; set; } |
| | | /// <summary> |
| | | /// å
¥åºæ°é |
| | | /// </summary> |
| | | public string qty { get; set; } |
| | | /// <summary> |
| | | /// 车é´ç¼ç |
| | | /// </summary> |
| | | public string wkshop_code { get; set; } |
| | | /// <summary> |
| | | /// ä»åºç¼ç |
| | | /// </summary> |
| | | public string stockcode { get; set; } |
| | | /// <summary> |
| | | /// æ¡ç |
| | | /// </summary> |
| | | public string inbarcode { get; set; } |
| | | /// <summary> |
| | | /// å·¥åºç¼ç |
| | | /// </summary> |
| | | public string step_code { get; set; } |
| | | /// <summary> |
| | | /// æ¥å·¥ç±»å(B:èªå¶/Så¤å) |
| | | /// </summary> |
| | | public string style { get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | DataTable table = new DataTable(); |
| | | //DataTable table = new DataTable(); |
| | | //var data = conn.ExecuteReader(sql, parm); |
| | | var res = conn.ExecuteReader(sql, parm, commandType: CommandType.StoredProcedure);//sql åå¨è¿ç¨ |
| | | result = true; |
| | |
| | | using (IDbConnection conn = sqlConnection()) |
| | | { |
| | | try |
| | | { |
| | | { |
| | | tranction = conn.BeginTransaction(); |
| | | for (int i = 0; i < sqlList.Count; i++) |
| | | { |