1.MES工单打印接口
2.生产开报工,报工接口
3.生产报工发料接口、收料接口、不良处理提交接口
| | |
| | | [Description("ç
æ·éERPåºç¡æ°æ®åæ¥")] |
| | | ç
æ·éERPåºç¡æ°æ®åæ¥ = 12, |
| | | [Description("Excel导å
¥")] |
| | | Excel导å
¥ = 13 |
| | | Excel导å
¥ = 13, |
| | | [Description("åæ®æå°")] |
| | | åæ®æå° = 14 |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using VueWebCoreApi.DLL.BLL; |
| | | using VueWebCoreApi.Models; |
| | | using VueWebCoreApi.Tools; |
| | | |
| | | namespace VueWebCoreApi.Controllers |
| | | { |
| | | [ApiExplorerSettings(GroupName = "åæ®æå°")] |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | [ChannelActionFilter] |
| | | public class GridReportController : Controller |
| | | { |
| | | //å®ä¹å
¨å±ä¿¡æ¯è¿ååé |
| | | ToMessage mes = new ToMessage(); |
| | | RedisHelper redis = new RedisHelper(); |
| | | |
| | | #region[MESå·¥åæå°1] |
| | | /// <summary> |
| | | /// MESå·¥åæå°1 |
| | | /// </summary> |
| | | /// <param name="obj">æäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderPrintSearch")] |
| | | [HttpPost] |
| | | public JsonResult MesOrderPrintSearch([FromBody] JObject obj) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | string mesordercode = obj["mesordercode"].ToString(); //å·¥åç¶æç |
| | | mes = GridReportBLL.MesOrderPrintSearch(us, mesordercode); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[çäº§å¼æ¥å·¥,æ¥å·¥æäº¤] |
| | | /// <summary> |
| | | /// çäº§å¼æ¥å·¥,æ¥å·¥æäº¤ |
| | | /// </summary> |
| | | /// <param name="obj">æ¥å·¥æäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SavaMesOrderStepReport")] |
| | | [HttpPost] |
| | | public JsonResult SavaMesOrderStepReport([FromBody] JObject obj) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | string mesordercode = obj["mesordercode"].ToString(); //å·¥åç¼å· |
| | | string partcode = obj["partcode"].ToString(); //产åç¼ç |
| | | string stepseq = obj["stepseq"].ToString(); //å·¥åºåºå· |
| | | string stepcode = obj["stepcode"].ToString(); //å·¥åºç¼ç |
| | | string stepprice = obj["stepprice"].ToString(); //å·¥åºå·¥ä»· |
| | | string eqpcode = obj["eqpcode"].ToString(); //设å¤ç¼ç |
| | | string inbarcode = obj["inbarcode"].ToString(); //å
¥åºæ¡ç |
| | | string reckway = obj["reckway"].ToString(); //计件æ¹å¼(çç»:groupã个人:person) |
| | | string usergroupcode = obj["usergroupcode"].ToString(); //çç»ç¼ç |
| | | string reportuser = obj["reportuser"].ToString(); //æ¥å·¥äººå |
| | | string taskqty = obj["taskqty"].ToString(); //任塿°é |
| | | string startqty = obj["startqty"].ToString(); //å¼å·¥æ°é |
| | | string reportqty = obj["reportqty"].ToString(); //æ¥å·¥å·¥æ°é |
| | | string defectlist = obj["defectlist"].ToString();//ä¸è¯æ±æ» |
| | | string remarks = obj["remarks"].ToString(); //夿³¨ |
| | | List<ReportDefectList> defectobjs = JsonConvert.DeserializeObject<List<ReportDefectList>>(defectlist); |
| | | mes = WorkOrderBLL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, stepprice, eqpcode, inbarcode, reckway, usergroupcode, reportuser, taskqty, startqty, reportqty, defectobjs, remarks, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[çäº§å¼æ¥å·¥,åææäº¤] |
| | | /// <summary> |
| | | /// çäº§å¼æ¥å·¥,åææäº¤ |
| | | /// </summary> |
| | | /// <param name="obj">åææäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SavaMesOrderStepOut")] |
| | | [HttpPost] |
| | | public JsonResult SavaMesOrderStepOut([FromBody] JObject obj) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | string mesordercode = obj["mesordercode"].ToString(); //å·¥åç¼å· |
| | | string partcode = obj["partcode"].ToString(); //产åç¼ç |
| | | string stepseq = obj["stepseq"].ToString(); //å·¥åºåºå· |
| | | string stepcode = obj["stepcode"].ToString(); //å·¥åºç¼ç |
| | | string wxcode = obj["wxcode"].ToString(); //å¤åä¾åºåç¼ç |
| | | string outuser = obj["outuser"].ToString(); //åæäººå |
| | | string taskqty = obj["taskqty"].ToString(); //任塿°é |
| | | string fqty = obj["fqty"].ToString(); //åææ°é |
| | | mes = WorkOrderBLL.SavaMesOrderStepOut(mesordercode, partcode, stepseq, stepcode, wxcode, outuser, taskqty, fqty, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[çäº§å¼æ¥å·¥,æ¶ææäº¤] |
| | | /// <summary> |
| | | /// çäº§å¼æ¥å·¥,æ¶ææäº¤ |
| | | /// </summary> |
| | | /// <param name="obj">æ¶ææäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | | [Route(template: "SavaMesOrderStepIn")] |
| | | [HttpPost] |
| | | public JsonResult SavaMesOrderStepIn([FromBody] JObject obj) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | string mesordercode = obj["mesordercode"].ToString(); //å·¥åç¼å· |
| | | string partcode = obj["partcode"].ToString(); //产åç¼ç |
| | | string stepseq = obj["stepseq"].ToString(); //å·¥åºåºå· |
| | | string stepcode = obj["stepcode"].ToString(); //å·¥åºç¼ç |
| | | string wxcode = obj["wxcode"].ToString(); //å¤åä¾åºåç¼ç |
| | | string inbarcode = obj["inbarcode"].ToString(); //å
¥åºæ¡ç |
| | | string inuser = obj["inuser"].ToString(); //æ¶æäººå |
| | | string taskqty = obj["taskqty"].ToString(); //任塿°é |
| | | string sqty = obj["sqty"].ToString(); //æ¶ææ°é |
| | | string defectlist = obj["defectlist"].ToString();//ä¸è¯æ±æ» |
| | | string remarks = obj["remarks"].ToString(); //夿³¨ |
| | | List<ReportDefectList> defectobjs = JsonConvert.DeserializeObject<List<ReportDefectList>>(defectlist); |
| | | mes = WorkOrderBLL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inbarcode, inuser, taskqty, sqty, defectobjs, remarks, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[ä¸è¯å¤ç,æäº¤] |
| | | /// <summary> |
| | | /// ä¸è¯å¤ç,æäº¤ |
| | | /// </summary> |
| | | /// <param name="json">æäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | | [Route(template: "EditOrderNgStepSeave")] |
| | | [HttpPost] |
| | | public JsonResult EditOrderNgStepSeave(ReportDefectHandle json) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = WorkOrderBLL.EditOrderNgStepSeave(json, us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using VueWebCoreApi.DLL.DAL; |
| | | using VueWebCoreApi.Models; |
| | | using VueWebCoreApi.Tools; |
| | | |
| | | namespace VueWebCoreApi.DLL.BLL |
| | | { |
| | | public class GridReportBLL |
| | | { |
| | | #region[MESå·¥åæå°] |
| | | public static ToMessage MesOrderPrintSearch(User us, string mesordercode) |
| | | { |
| | | return GridReportDAL.MesOrderPrintSearch(us, mesordercode); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | return WorkOrderDAL.MesOrderStepStart(OperType, SelectType, wocode, stepcode); |
| | | } |
| | | #endregion |
| | | |
| | | #region[çäº§å¼æ¥å·¥,æ¥å·¥æäº¤] |
| | | public static ToMessage SavaMesOrderStepReport(string mesordercode, string partcode, string stepseq, string stepcode,string stepprice, string eqpcode, string inbarcode, string reckway, string usergroupcode, string reportuser, string taskqty, string startqty, string reportqty, List<ReportDefectList> defectobjs, string remarks, User us) |
| | | { |
| | | return WorkOrderDAL.SavaMesOrderStepReport(mesordercode, partcode, stepseq, stepcode, stepprice, eqpcode, inbarcode, reckway, usergroupcode, reportuser, taskqty, startqty, reportqty, defectobjs, remarks, us); |
| | | } |
| | | #endregion |
| | | |
| | | #region[çäº§å¼æ¥å·¥,åææäº¤] |
| | | public static ToMessage SavaMesOrderStepOut(string mesordercode, string partcode, string stepseq, string stepcode, string wxcode, string outuser, string taskqty, string fqty, User us) |
| | | { |
| | | return WorkOrderDAL.SavaMesOrderStepOut(mesordercode, partcode, stepseq, stepcode, wxcode, outuser, taskqty, fqty, us); |
| | | } |
| | | #endregion |
| | | |
| | | #region[çäº§å¼æ¥å·¥,æ¶ææäº¤] |
| | | public static ToMessage SavaMesOrderStepIn(string mesordercode, string partcode, string stepseq, string stepcode, string wxcode, string inbarcode, string inuser, string taskqty, string sqty, List<ReportDefectList> defectobjs, string remarks, User us) |
| | | { |
| | | return WorkOrderDAL.SavaMesOrderStepIn(mesordercode, partcode, stepseq, stepcode, wxcode, inbarcode, inuser, taskqty, sqty, defectobjs, remarks, us); |
| | | } |
| | | #endregion |
| | | |
| | | #region[ä¸è¯å¤ç,æäº¤] |
| | | public static ToMessage EditOrderNgStepSeave(ReportDefectHandle json, User us) |
| | | { |
| | | return WorkOrderDAL.EditOrderNgStepSeave(json, us); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Dapper; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using VueWebCoreApi.Models; |
| | | using VueWebCoreApi.Tools; |
| | | |
| | | namespace VueWebCoreApi.DLL.DAL |
| | | { |
| | | public class GridReportDAL |
| | | { |
| | | public static DataTable dt; //å®ä¹å
¨å±åédt |
| | | public static bool res; //å®ä¹å
¨å±åédt |
| | | public static ToMessage mes = new ToMessage(); //å®ä¹å
¨å±è¿åä¿¡æ¯å¯¹è±¡ |
| | | public static GridMessage gidmes = new GridMessage(); //å®ä¹å
¨å±è¿åä¿¡æ¯å¯¹è±¡ |
| | | public static string strProcName = ""; //å®ä¹å
¨å±sqlåé |
| | | public static List<SqlParameter> listStr = new List<SqlParameter>(); //å®ä¹å
¨å±åæ°éå |
| | | |
| | | public static SqlParameter[] parameters; //å®ä¹å
¨å±SqlParameteråæ°æ°ç» |
| | | |
| | | |
| | | #region[MESå·¥åæå°] |
| | | public static ToMessage MesOrderPrintSearch(User us, string mesordercode) |
| | | { |
| | | string sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | | |
| | | //è·å设å¤ç±»åæ°æ® |
| | | sql = @"select A.seq,A.wo_code,M.m_po,P.partcode,P.partname,P.partspec,M.plan_qty as orderqty,@username as lm_user,@createdate as lm_date, |
| | | B.stepcode,B.stepname,A.plan_qty,(case when A.good_qty=0 then '' end) as good_qty,(case when A.ng_qty=0 then '' end) as ng_qty,A.wo_code+';'+B.stepcode as stepqrcode |
| | | from TK_Wrk_Step A |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | | left join TMateriel_Info P on M.materiel_code=P.partcode |
| | | left join TStep B on A.step_code=B.stepcode |
| | | where A.wo_code=@mesordercode "; |
| | | dynamicParams.Add("@username", us.username); |
| | | dynamicParams.Add("@createdate", DateTime.Now.ToString()); |
| | | dynamicParams.Add("@mesordercode", mesordercode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | gidmes.recordset = data; |
| | | mes.code = "200"; |
| | | mes.count = 0; |
| | | mes.Message = "æ¥è¯¢æåï¼"; |
| | | mes.data = gidmes; |
| | | } |
| | | else |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "æ çäº§ä»»å¡æ°æ®ï¼"; |
| | | mes.data = null; |
| | | } |
| | | |
| | | return mes; |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | using Dapper; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select A.id, A.status,A.wotype,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.plan_qty,A.wkshp_code,C.torg_name as wkshp_name, |
| | | A.stck_code,D.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,A.saleOrderDeliveryDate,W.saleOrderCode,U.username as lm_user,A.lm_date,A.data_sources |
| | | A.stck_code,D.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,A.saleOrderDeliveryDate,W.saleOrderCode,U.username as lm_user,A.lm_date,A.data_sources,A.isstep |
| | | from TK_Wrk_Man A |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code |
| | | left join TMateriel_Info B on A.materiel_code=B.partcode |
| | |
| | | //list.Add(new { str = sql, parm = new { wocode = wocode } }); |
| | | |
| | | //å é¤å·¥å表 |
| | | sql = @"update TK_Wrk_Man set is_delete='1' where wo_code=@wocode"; |
| | | sql = @"delete TK_Wrk_Man where wo_code=@wocode"; |
| | | list.Add(new { str = sql, parm = new { wocode = wocode } }); |
| | | } |
| | | else |
| | |
| | | string search = ""; |
| | | try |
| | | { |
| | | if (mesorderstus == "å·²å
³é") |
| | | if (mesorderstus == "CLOSED") |
| | | { |
| | | search += "and A.status=@mesorderstus "; |
| | | dynamicParams.Add("@mesorderstus", "CLOSED"); |
| | | } |
| | | if (mesorderstus == "æªå
³é") |
| | | if (mesorderstus == "NOCLOSED") |
| | | { |
| | | search += "and A.status<>@mesorderstus "; |
| | | dynamicParams.Add("@mesorderstus", "CLOSED"); |
| | |
| | | // --------------æ¥è¯¢æå®æ°æ®-------------- |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select A.id, A.status,A.wotype,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.plan_qty,A.wkshp_code,C.torg_name as wkshp_name, |
| | | A.stck_code,D.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,A.saleOrderDeliveryDate,W.saleOrderCode,U.username as lm_user,A.lm_date |
| | | A.stck_code,D.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,A.saleOrderDeliveryDate,W.saleOrderCode,U.username as lm_user,A.lm_date,A.data_sources |
| | | from TK_Wrk_Man A |
| | | left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code |
| | | left join TMateriel_Info B on A.materiel_code=B.partcode |
| | |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | for (int i = 0; i < dt.Rows.Count; i++) |
| | | for (int i = 0; i < wocodelist.Length; i++) |
| | | { |
| | | //å
³éå·¥å对åºå·¥åºä»»å¡ |
| | | sql = @"update TK_Wrk_Step set status='CLOSED' where wo_code in @wocode"; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[çäº§å¼æ¥å·¥,æ¥å·¥æäº¤] |
| | | public static ToMessage SavaMesOrderStepReport(string mesordercode, string partcode, string stepseq, string stepcode,string stepprice, string eqpcode, string inbarcode, string reckway, string usergroupcode, string reportuser, string taskqty, string startqty, string reportqty, List<ReportDefectList> defectobjs, string remarks, User us) |
| | | { |
| | | var sql = ""; |
| | | decimal ngqty = 0; |
| | | string[] arra1 = new string[] { }; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | string date = DateTime.Now.ToString(); //è·åç³»ç»æ¶é´ |
| | | //è·åæ¥å·¥äººåãåé
æ¯ä¾ |
| | | JArray arra = (JArray)Newtonsoft.Json.JsonConvert.DeserializeObject(reportuser); |
| | | //夿æ¯å¦æä¸è¯æ°æ® |
| | | var groupedItems = defectobjs.GroupBy(item => item.defect_code) // æç¼ç codeåç» |
| | | .Select(group => new { defect_code = group.Key, badqty = group.Sum(item => Convert.ToDecimal(item.badqty)) }).ToList(); // æ±æ»ä¸è¯æ°é |
| | | if (groupedItems.Count <= 0) |
| | | { |
| | | ngqty = 0; |
| | | } |
| | | else |
| | | { |
| | | //æ±æ»ä¸è¯æ°é |
| | | ngqty = groupedItems.Sum(item => Convert.ToDecimal(item.badqty)); |
| | | } |
| | | list.Clear(); |
| | | //夿æ¯å¦æå¼å·¥è®°å½(æ æ°å¢) |
| | | sql = @"select * from TK_Wrk_Record where wo_code=@wo_code and step_code=@step_code and style='S' and eqp_code=@eqpcode"; |
| | | dynamicParams.Add("@wo_code", mesordercode); |
| | | dynamicParams.Add("@step_code", stepcode); |
| | | dynamicParams.Add("@eqpcode", eqpcode); |
| | | var data0 = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data0.Rows.Count <= 0) |
| | | { |
| | | //åå
¥å¼æ¥å·¥è®°å½è¡¨ |
| | | sql = @"insert into TK_Wrk_Record(wo_code,step_seq,step_code,step_price,eqp_code,materiel_code,open_person,open_time,task_qty,start_qty,style,lm_user,lm_date) |
| | | values(@mesordercode,@stepseq,@stepcode,@step_price,@eqpcode,@partcode,@username,@opentime,@taskqty,@startqty,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepseq = stepseq, stepcode = stepcode, step_price=stepprice, eqpcode = eqpcode, partcode = partcode, username = us.usercode, opentime = date, taskqty = taskqty, startqty = startqty, style = "S", lm_user = us.usercode, lm_date = date } }); |
| | | //ååå·¥åå·¥åºè¡¨ç¶æä¸ºSTART: å¼å·¥ |
| | | sql = @"update TK_Wrk_Step set status='START' where wo_code=@mesordercode and step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepcode = stepcode } }); |
| | | |
| | | //ååå·¥åå·¥åºè¡¨ç¶æä¸ºå·²å¼å·¥ |
| | | sql = @"update TK_Wrk_Step set status='START' where wo_code=@mesordercode and step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepcode = stepcode } }); |
| | | //ååå·¥åè¡¨ç¶æä¸ºï¼ å¼å·¥ï¼START |
| | | sql = @"update TK_Wrk_Man set status='START' where wo_code=@mesordercode"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode } }); |
| | | } |
| | | |
| | | //夿æ¯å¦ææ¥å·¥è®°å½(æï¼ä¿®æ¹ æ ï¼æ°å¢) |
| | | sql = @"select * from TK_Wrk_Record where wo_code=@wo_code and step_code=@step_code and style='B'"; |
| | | dynamicParams.Add("@wo_code", mesordercode); |
| | | dynamicParams.Add("@step_code", stepcode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | ////è·åå¼å·¥è®°å½çé»è®¤éä¸ç设å¤(产线)䏿¥å·¥æ¶ç设å¤äº§çº¿å对æ¯å¤æ |
| | | //sql = @"select A.eqp_code,B.name from TK_Wrk_Record A |
| | | // inner join TEqpInfo B on A.eqp_code=B.code |
| | | // where A.wo_code=@wo_code and A.step_code=@step_code and eqp_code=@eqpcode and A.style='S'"; |
| | | //dynamicParams.Add("@wo_code", mesordercode); |
| | | //dynamicParams.Add("@step_code", stepcode); |
| | | //dynamicParams.Add("@eqpcode", eqpcode); |
| | | //var da = DapperHelper.selectdata(sql, dynamicParams); |
| | | //if (da.Rows[0]["EQP_CODE"].ToString() != eqpcode) |
| | | //{ |
| | | // mes.code = "300"; |
| | | // mes.count = 0; |
| | | // mes.Message = "æä½å¤±è´¥,å½åæ¥å·¥äº§çº¿åºä¸ºï¼" + da.Rows[0]["NAME"].ToString() + "!"; |
| | | // mes.data = null; |
| | | // return mes; |
| | | //} |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | //è·å主表æå¤§ID |
| | | sql = @"select ISNULL(IDENT_CURRENT('TK_Wrk_Record')+1,1) as id"; |
| | | var dt = DapperHelper.selecttable(sql); |
| | | |
| | | //åå
¥å¼æ¥å·¥è®°å½è¡¨ |
| | | sql = @"insert into TK_Wrk_Record(wo_code,step_seq,step_code,step_price,eqp_code,materiel_code,task_qty,start_qty,good_qty,ng_qty,style,lm_user,lm_date,inbarcode) |
| | | values(@mesordercode,@stepseq,@stepcode,@step_price,@eqpcode,@partcode,@taskqty,@startqty,@reportqty,@ngqty,@style,@lm_user,@lm_date,@inbarcode)"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepseq = stepseq, stepcode = stepcode, step_price=stepprice, eqpcode = eqpcode, partcode = partcode, taskqty = taskqty, startqty = startqty, reportqty = reportqty, ngqty = ngqty, style = "B", lm_user = us.usercode, lm_date = date, inbarcode = inbarcode } }); |
| | | |
| | | //åå
¥å表 |
| | | for (int i = 0; i < arra.Count; i++) |
| | | { |
| | | sql = @"insert into TK_Wrk_RecordSub(m_id,eqp_code,report_person,report_date,report_qty,reckway,usergroup_code,ratio,ng_qty,style,lm_user,lm_date) |
| | | values(@m_id,@eqp_code,@report_person,@report_date,@report_qty,@reckway,@usergroup_code,@ratio,@ng_qty,@style,@lm_user,@lm_date)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | m_id = int.Parse(dt.Rows[0]["ID"].ToString()), |
| | | eqp_code = eqpcode, |
| | | report_person = arra[i]["usercode"].ToString(), |
| | | report_date = date, |
| | | report_qty = reportqty, |
| | | reckway = reckway, |
| | | usergroup_code = usergroupcode, |
| | | ratio = decimal.Parse(arra[i]["ratio"].ToString()), |
| | | ng_qty = ngqty, |
| | | style = "B", |
| | | lm_user = us.usercode, |
| | | lm_date = date |
| | | } |
| | | }); |
| | | |
| | | } |
| | | if (groupedItems.Count > 0) |
| | | { |
| | | //åå
¥ç¼ºé·è®°å½è¡¨ |
| | | for (int i = 0; i < groupedItems.Count; i++) |
| | | { |
| | | sql = @"insert into CSR_WorkRecord_Defect(record_id,wo_code,partnumber,step_seq,step_code,defect_qty,defect_pendqty,defect_code,remarks,style,lm_user,lm_date) |
| | | values(@record_id,@wo_code,@partcode,@stepseq,@stepcode,@ngqty,@defect_pendqty,@defect_code,@remarks,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { record_id = int.Parse(dt.Rows[0]["ID"].ToString()), wo_code = mesordercode, partcode = partcode, stepseq = stepseq, stepcode = stepcode, ngqty = groupedItems[i].badqty, defect_pendqty = groupedItems[i].badqty, defect_code = groupedItems[i].defect_code, remarks = remarks, style = "B", lm_user = us.usercode, lm_date = date } }); |
| | | |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //è·å主表æå¤§ID |
| | | sql = @"select ISNULL(IDENT_CURRENT('TK_Wrk_Record')+1,1) as id"; |
| | | var dt = DapperHelper.selecttable(sql); |
| | | //åå
¥å¼æ¥å·¥è®°å½è¡¨ |
| | | sql = @"insert into TK_Wrk_Record(wo_code,step_seq,step_code,step_price,eqp_code,materiel_code,task_qty,start_qty,good_qty,ng_qty,style,lm_user,lm_date,inbarcode) |
| | | values(@mesordercode,@stepseq,@stepcode,@step_price,@eqpcode,@partcode,@taskqty,@startqty,@reportqty,@ngqty,@style,@lm_user,@lm_date,@inbarcode)"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepseq = stepseq, stepcode = stepcode, step_price=stepprice, eqpcode = eqpcode, partcode = partcode, taskqty = taskqty, startqty = startqty, reportqty = reportqty, ngqty = ngqty, style = "B", lm_user = us.usercode, lm_date = date, inbarcode = inbarcode } }); |
| | | |
| | | //åå
¥å表 |
| | | for (int i = 0; i < arra.Count; i++) |
| | | { |
| | | sql = @"insert into TK_Wrk_RecordSub(m_id,eqp_code,report_person,report_date,report_qty,reckway,usergroup_code,ratio,ng_qty,style,lm_user,lm_date) |
| | | values(@m_id,@eqp_code,@report_person,@report_date,@report_qty,@reckway,@usergroup_code,@ratio,@ng_qty,@style,@lm_user,@lm_date)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | m_id = int.Parse(dt.Rows[0]["ID"].ToString()), |
| | | eqp_code = eqpcode, |
| | | report_person = arra[i]["usercode"].ToString(), |
| | | report_date = date, |
| | | report_qty = reportqty, |
| | | reckway = reckway, |
| | | usergroup_code = usergroupcode, |
| | | ratio = decimal.Parse(arra[i]["ratio"].ToString()), |
| | | ng_qty = ngqty, |
| | | style = "B", |
| | | lm_user = us.usercode, |
| | | lm_date = date |
| | | } |
| | | }); |
| | | |
| | | } |
| | | if (groupedItems.Count > 0) |
| | | { |
| | | //åå
¥ç¼ºé·è®°å½è¡¨ |
| | | for (int i = 0; i < groupedItems.Count; i++) |
| | | { |
| | | sql = @"insert into CSR_WorkRecord_Defect(record_id,wo_code,partnumber,step_seq,step_code,defect_qty,defect_pendqty,defect_code,remarks,style,lm_user,lm_date) |
| | | values(@record_id,@wo_code,@partcode,@stepseq,@stepcode,@ngqty,@defect_pendqty,@defect_code,@remarks,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { record_id = int.Parse(dt.Rows[0]["ID"].ToString()), wo_code = mesordercode, partcode = partcode, stepseq = stepseq, stepcode = stepcode, ngqty = groupedItems[i].badqty, defect_pendqty = groupedItems[i].badqty, defect_code = groupedItems[i].defect_code, remarks = remarks, style = "B", lm_user = us.usercode, lm_date = date } }); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //ååå·¥åå·¥åºè¡¨åæ ¼æ°éãä¸è¯æ°é |
| | | sql = @"update TK_Wrk_Step set good_qty=good_qty+@reportqty,ng_qty=ng_qty+@ngqty where wo_code=@mesordercode and step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepcode = stepcode, reportqty = reportqty, ngqty = ngqty } }); |
| | | |
| | | //ååå·¥åè¡¨åæ ¼æ°éãä¸è¯æ°é |
| | | //sql = @"update TK_Wrk_Man set good_qty=good_qty+@reportqty,ng_qty=ng_qty+@ngqty where wo_code=@mesordercode"; |
| | | //list.Add(new { str = sql, parm = new { mesordercode = mesordercode, reportqty = reportqty, ngqty = ngqty } }); |
| | | |
| | | //åå
¥ERPå
¥åºå |
| | | |
| | | //夿æ¯å¦æ«éå·¥åºå®å·¥æ¥å·¥(èªå¨å
³éå·¥ååå·¥åºä»»å¡) |
| | | //list = AutosCloseOrder.AutosColseOrderReport(list,mesordercode, partcode, stepseq,stepcode,reportqty,ngqty); |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | | 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 SavaMesOrderStepOut(string mesordercode, string partcode, string stepseq, string stepcode, string wxcode, string outuser, string taskqty, string fqty, User us) |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | string date = DateTime.Now.ToString(); //è·åç³»ç»æ¶é´ |
| | | list.Clear(); |
| | | //夿æ¯å¦æåæè®°å½(æ(åå·¥å+å·¥åº+å¤å便¹ä¿®æ¹) æ ï¼æ°å¢) |
| | | sql = @"select * from TK_Wrk_OutRecord where wo_code=@wo_code and step_code=@step_code and wx_code=@wx_code and style='F'"; |
| | | dynamicParams.Add("@wo_code", mesordercode); |
| | | dynamicParams.Add("@step_code", stepcode); |
| | | dynamicParams.Add("@wx_code", wxcode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | //ä¿®æ¹åæè®°å½ |
| | | sql = @"update TK_Wrk_OutRecord set fqty=fqty+@fqty,lm_user=@username,lm_date=@CreateDate |
| | | where wo_code=@mesordercode and step_code=@stepcode and wx_code=@wx_code and style='F'"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepcode = stepcode, wx_code = wxcode, fqty = decimal.Parse(fqty), username =us.usercode, CreateDate = date } }); |
| | | //åå
¥å表 |
| | | sql = @"insert into TK_Wrk_OutRecordSub(m_id,wx_code,out_person,out_time,fqty,style,lm_user,lm_date) |
| | | values(@m_id,@wx_code,@out_person,@out_time,@fqty,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { m_id = int.Parse(data.Rows[0]["ID"].ToString()), wx_code = wxcode, out_person = outuser, out_time = date, fqty = fqty, style = 'F', lm_user = us.usercode, lm_date = date } }); |
| | | } |
| | | else |
| | | { |
| | | //è·å主表æå¤§ID |
| | | sql = @"select ISNULL(IDENT_CURRENT('TK_Wrk_OutRecord')+1,1) as id"; |
| | | var dt = DapperHelper.selecttable(sql); |
| | | //åå
¥å¤åè®°å½ä¸»è¡¨ |
| | | sql = @"insert into TK_Wrk_OutRecord(wo_code,step_seq,step_code,wx_code,materiel_code,style,fqty,lm_user,lm_date) |
| | | values(@mesordercode,@stepseq,@stepcode,@wx_code,@partcode,@style,@fqty,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepseq = stepseq, stepcode = stepcode, wx_code = wxcode, partcode = partcode, style = 'F', fqty = fqty, lm_user = us.usercode, lm_date = date } }); |
| | | |
| | | //åå
¥å表 |
| | | sql = @"insert into TK_Wrk_OutRecordSub(m_id,wx_code,out_person,out_time,fqty,style,lm_user,lm_date) |
| | | values(@m_id,@wx_code,@out_person,@out_time,@fqty,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { m_id = int.Parse(dt.Rows[0]["ID"].ToString()), wx_code = wxcode, out_person = outuser, out_time = date, fqty = fqty, style = 'F', lm_user = us.usercode, lm_date = date } }); |
| | | } |
| | | //ååå·¥åå·¥åºè¡¨ç¶æä¸ºSTART: å¼å·¥ |
| | | sql = @"update TK_Wrk_Step set status='START' where wo_code=@mesordercode and step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepcode = stepcode } }); |
| | | |
| | | |
| | | //ååå·¥åè¡¨ç¶æä¸ºï¼ å¼å·¥ï¼START |
| | | sql = @"update TK_Wrk_Man set status='START' where wo_code=@mesordercode"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode } }); |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | | 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 SavaMesOrderStepIn(string mesordercode, string partcode, string stepseq, string stepcode, string wxcode, string inbarcode, string inuser, string taskqty, string sqty, List<ReportDefectList> defectobjs, string remarks, User us) |
| | | { |
| | | var sql = ""; |
| | | string[] arra1 = new string[] { }; |
| | | decimal ngqty = 0; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | string date = DateTime.Now.ToString(); //è·åç³»ç»æ¶é´ |
| | | //夿æ¯å¦æä¸è¯æ°æ® |
| | | var groupedItems = defectobjs.GroupBy(item => item.defect_code) // æç¼ç codeåç» |
| | | .Select(group => new { defect_code = group.Key, badqty = group.Sum(item => Convert.ToDecimal(item.badqty)) }).ToList(); // æ±æ»æ°éqty |
| | | if (groupedItems.Count <= 0) |
| | | { |
| | | ngqty = 0; |
| | | } |
| | | else |
| | | { |
| | | //æ±æ»ä¸è¯æ°é |
| | | ngqty = groupedItems.Sum(item => Convert.ToDecimal(item.badqty)); |
| | | } |
| | | |
| | | list.Clear(); |
| | | //夿æ¯å¦ææ¶æè®°å½(æï¼ï¼åå·¥å+å·¥åº+å¤å便¹ä¿®æ¹ï¼ æ ï¼æ°å¢) |
| | | sql = @"select * from TK_Wrk_OutRecord where wo_code=@wo_code and step_code=@step_code and wx_code=@wx_code and style='S'"; |
| | | dynamicParams.Add("@wo_code", mesordercode); |
| | | dynamicParams.Add("@step_code", stepcode); |
| | | dynamicParams.Add("@wx_code", wxcode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | //è·ååæè®°å½çé»è®¤éä¸çå¤åä¾åºå䏿¶ææ¶çå¤åä¾åºåå对æ¯å¤æ |
| | | sql = @"select A.wx_code,B.name,A.fqty from TK_Wrk_OutRecord A |
| | | inner join TCustomer B on A.wx_code=B.code |
| | | where A.wo_code=@wo_code and A.step_code=@step_code and wx_code=@wx_code and A.style='F' "; |
| | | dynamicParams.Add("@wo_code", mesordercode); |
| | | dynamicParams.Add("@step_code", stepcode); |
| | | dynamicParams.Add("@wx_code", wxcode); |
| | | var da = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (da.Rows.Count <= 0) |
| | | { |
| | | sql = @"select A.wx_code,B.name,A.fqty from TK_Wrk_OutRecord A |
| | | inner join TCustomer B on A.wx_code=B.code |
| | | where A.wo_code=@wo_code and A.step_code=@step_code and A.style='F' "; |
| | | dynamicParams.Add("@wo_code", mesordercode); |
| | | dynamicParams.Add("@step_code", stepcode); |
| | | var da1 = DapperHelper.selectdata(sql, dynamicParams); |
| | | var dr = da1.AsEnumerable().ToList().Select(x => x.Field<string>("NAME")).ToList(); |
| | | string wxstring = (string.Join(",", dr.Select(x => x.ToString()).ToArray())); |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "æä½å¤±è´¥,å½åæ¶æå¤å便¹ä¸åæå¤åä¾åºåä¸å¹é
,åºä¸ºï¼ã" + wxstring + "ã!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | if ((decimal.Parse(sqty) + ngqty) > decimal.Parse(da.Rows[0]["FQTY"].ToString())) //æ¶ææ°é+ä¸è¯æ°é>åææ°é |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "æä½å¤±è´¥,å½åæ¶ææ°é+ä¸è¯æ°é,ä¸è½å¤§äºåææ°é:" + da.Rows[0]["FQTY"].ToString() + "!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | //if (da.Rows[0]["WX_CODE"].ToString() != wxcode) |
| | | //{ |
| | | // mes.code = "300"; |
| | | // mes.count = 0; |
| | | // mes.Message = "æä½å¤±è´¥,å½åæ¶æå¤å便¹åºä¸ºï¼" + da.Rows[0]["NAME"].ToString() + "!"; |
| | | // mes.data = null; |
| | | // return mes; |
| | | //} |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | decimal sum_sqty = data.AsEnumerable().Select(d => d.Field<decimal>("SQTY")).Sum(); //è·åååå·,åå·¥åº,åå¤åä¾åºåæ¶ææ»æ°é |
| | | decimal sum_fqty = da.AsEnumerable().Select(d => d.Field<decimal>("FQTY")).Sum(); //è·åååå·,åå·¥åº,åå¤åä¾åºååææ»æ°é |
| | | if ((sum_sqty + decimal.Parse(sqty) + ngqty) > sum_fqty) //å·²æ¶ææ»æ°+å½åæ¶ææ°é+ä¸è¯æ°é>æ»åææ°é |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.Message = "æä½å¤±è´¥,å½åæ¶ææ°é+ä¸è¯æ°é,ä¸è½å¤§äºå¾
æ¶æ°é:" + (sum_fqty - sum_sqty) + "!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | |
| | | |
| | | //è·å主表æå¤§ID |
| | | sql = @"select ISNULL(IDENT_CURRENT('TK_Wrk_OutRecord')+1,1) as id"; |
| | | var dt = DapperHelper.selecttable(sql); |
| | | //åå
¥å¤åè®°å½ä¸»è¡¨ |
| | | sql = @"insert into TK_Wrk_OutRecord(wo_code,step_seq,step_code,wx_code,materiel_code,style,sqty,ng_qty,lm_user,lm_date,inbarcode) |
| | | values(@mesordercode,@stepseq,@stepcode,@wx_code,@partcode,@style,@sqty,@ngqty,@lm_user,@lm_date,@inbarcode)"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepseq = stepseq, stepcode = stepcode, wx_code = wxcode, partcode = partcode, style = 'S', sqty = sqty, ngqty = ngqty, lm_user = us.usercode, lm_date = date, inbarcode = inbarcode } }); |
| | | |
| | | //åå
¥å¤åè®°å½å表 |
| | | sql = @"insert into TK_Wrk_OutRecordSub(m_id,wx_code,in_person,in_time,sqty,ng_qty,style,lm_user,lm_date) |
| | | values(@m_id,@wxcode,@in_person,@in_time,@sqty,@ng_qty,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { m_id = int.Parse(dt.Rows[0]["ID"].ToString()), wxcode = wxcode, in_person = inuser, in_time = date, sqty = sqty, ng_qty = ngqty, style = "S", lm_user = us.usercode, lm_date = date } }); |
| | | |
| | | if (groupedItems.Count > 0) |
| | | { |
| | | //åå
¥ç¼ºé·è®°å½è¡¨ |
| | | for (int i = 0; i < groupedItems.Count; i++) |
| | | { |
| | | sql = @"insert into CSR_WorkRecord_Defect(record_id,wo_code,partnumber,step_seq,step_code,defect_qty,defect_pendqty,defect_code,remarks,style,lm_user,lm_date) |
| | | values(@record_id,@wo_code,@partcode,@stepseq,@stepcode,@ngqty,@defect_pendqty,@defect_code,@remarks,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { record_id = int.Parse(dt.Rows[0]["ID"].ToString()), wo_code = mesordercode, partcode = partcode, stepseq = stepseq, stepcode = stepcode, ngqty = groupedItems[i].badqty, defect_pendqty = groupedItems[i].badqty, defect_code = groupedItems[i].defect_code, remarks = remarks, style = "S", lm_user = us.usercode, lm_date = date } }); |
| | | |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //è·å主表æå¤§ID |
| | | sql = @"select ISNULL(IDENT_CURRENT('TK_Wrk_OutRecord')+1,1) as id"; |
| | | var dt = DapperHelper.selecttable(sql); |
| | | //åå
¥å¤åè®°å½ä¸»è¡¨ |
| | | sql = @"insert into TK_Wrk_OutRecord(wo_code,step_seq,step_code,wx_code,materiel_code,style,sqty,ng_qty,lm_user,lm_date,inbarcode) |
| | | values(@mesordercode,@stepseq,@stepcode,@wx_code,@partcode,@style,@sqty,@ngqty,@lm_user,@lm_date,@inbarcode)"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepseq = stepseq, stepcode = stepcode, wx_code = wxcode, partcode = partcode, style = 'S', sqty = sqty, ngqty = ngqty, lm_user = us.usercode, lm_date = date, inbarcode = inbarcode } }); |
| | | |
| | | //åå
¥å¤åè®°å½å表 |
| | | sql = @"insert into TK_Wrk_OutRecordSub(m_id,wx_code,in_person,in_time,sqty,ng_qty,style,lm_user,lm_date) |
| | | values(@m_id,@wxcode,@in_person,@in_time,@sqty,@ng_qty,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { m_id = int.Parse(dt.Rows[0]["ID"].ToString()), wxcode = wxcode, in_person = inuser, in_time = date, sqty = sqty, ng_qty = ngqty, style = "S", lm_user = us.usercode, lm_date = date } }); |
| | | |
| | | if (groupedItems.Count > 0) |
| | | { |
| | | //åå
¥ç¼ºé·è®°å½è¡¨ |
| | | for (int i = 0; i < groupedItems.Count; i++) |
| | | { |
| | | sql = @"insert into CSR_WorkRecord_Defect(record_id,wo_code,partnumber,step_seq,step_code,defect_qty,defect_pendqty,defect_code,remarks,style,lm_user,lm_date) |
| | | values(@record_id,@wo_code,@partcode,@stepseq,@stepcode,@ngqty,@defect_pendqty,@defect_code,@remarks,@style,@lm_user,@lm_date)"; |
| | | list.Add(new { str = sql, parm = new { record_id = int.Parse(dt.Rows[0]["ID"].ToString()), wo_code = mesordercode, partcode = partcode, stepseq = stepseq, stepcode = stepcode, ngqty = groupedItems[i].badqty, defect_pendqty = groupedItems[i].badqty, defect_code = groupedItems[i].defect_code, remarks = remarks, style = "S", lm_user = us.usercode, lm_date = date } }); |
| | | |
| | | } |
| | | } |
| | | } |
| | | //ååå·¥åå·¥åºè¡¨åæ ¼æ°éãä¸è¯æ°é |
| | | sql = @"update TK_Wrk_Step set good_qty=good_qty+@sqty,ng_qty=ng_qty+@ngqty where wo_code=@mesordercode and step_code=@stepcode"; |
| | | list.Add(new { str = sql, parm = new { mesordercode = mesordercode, stepcode = stepcode, sqty = sqty, ngqty = ngqty } }); |
| | | |
| | | //ååå·¥åè¡¨åæ ¼æ°éãä¸è¯æ°é |
| | | //sql = @"update TK_Wrk_Man set good_qty=good_qty+@sqty,ng_qty=ng_qty+@ngqty where wo_code=@mesordercode"; |
| | | //list.Add(new { str = sql, parm = new { mesordercode = mesordercode, sqty = sqty, ngqty = ngqty } }); |
| | | |
| | | ////åå
¥ERPå
¥åºå |
| | | |
| | | //夿æ¯å¦æ«éå·¥åºå®å·¥æ¥å·¥(èªå¨å
³éå·¥ååå·¥åºä»»å¡) |
| | | //list = AutosCloseOrder.AutosColseOrderReport(list, mesordercode, partcode, stepseq, stepcode, sqty, ngqty); |
| | | |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | | 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 EditOrderNgStepSeave(ReportDefectHandle json, User us) |
| | | { |
| | | var sql = ""; |
| | | string[] arra1 = new string[] { }; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | decimal sumrepair_qty = 0, sumlaborbad_qty = 0,summaterielbad_qty=0; //累计维修æ°éãç´¯è®¡å·¥åºæ°éã累计æåºæ°é |
| | | try |
| | | { |
| | | string date = DateTime.Now.ToString(); //è·åç³»ç»æ¶é´ |
| | | list.Clear(); |
| | | |
| | | |
| | | //循ç¯jsonæ°æ® |
| | | for (int i = 0; i < json.Data.Rows.Count; i++) |
| | | { |
| | | //èªå¶å·¥åº |
| | | if (json.Data.Rows[i]["STYLE"].ToString() == "Z") |
| | | { |
| | | //åå对åºçæ¥å·¥è®°å½åè¡¨åæ ¼æ°éãä¸è¯æ°éãå·¥åºæ°éãæåºæ°é |
| | | sql = @"update TK_Wrk_RecordSub set report_qty=report_qty+@repair_qty,ng_qty=ng_qty-@repair_qty-@laborbad_qty-@materielbad_qty,laborbad_qty=laborbad_qty+@laborbad_qty,materielbad_qty=materielbad_qty+@materielbad_qty |
| | | where m_id=@m_id and style='B'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | m_id = int.Parse(json.Data.Rows[i]["M_ID"].ToString()), |
| | | repair_qty = decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()), |
| | | laborbad_qty = decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()), |
| | | materielbad_qty = decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()) |
| | | } |
| | | }); |
| | | //åå对åºçæ¥å·¥è®°å½ä¸»è¡¨åæ ¼æ°éãä¸è¯æ°éãæ¥åºæ°é |
| | | sql = @"update TK_Wrk_Record set good_qty=good_qty+@repair_qty,ng_qty=ng_qty-@repair_qty-@laborbad_qty-@materielbad_qty,laborbad_qty=laborbad_qty+@laborbad_qty,materielbad_qty=materielbad_qty+@materielbad_qty |
| | | where wo_code=@wo_code and step_code=@step_code and id=@id and style='B'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | repair_qty = decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()), |
| | | laborbad_qty = decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()), |
| | | materielbad_qty = decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()), |
| | | wo_code = json.Data.Rows[i]["WO_CODE"].ToString(), |
| | | step_code = json.Data.Rows[i]["STEP_CODE"].ToString(), |
| | | id = int.Parse(json.Data.Rows[i]["M_ID"].ToString()) |
| | | } |
| | | }); |
| | | //åå缺é·è®°å½è¡¨çå¾
å¤çæ°é |
| | | sql = @"update CSR_WorkRecord_Defect set defect_pendqty=defect_pendqty-@repair_qty-@laborbad_qty-@materielbad_qty,laborbad_qty=laborbad_qty+@laborbad_qty,materielbad_qty=materielbad_qty+@materielbad_qty |
| | | where wo_code=@wo_code and step_code=@step_code and id=@id and style='B'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | repair_qty = decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()), |
| | | laborbad_qty = decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()), |
| | | materielbad_qty = decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()), |
| | | wo_code = json.Data.Rows[i]["WO_CODE"].ToString(), |
| | | step_code = json.Data.Rows[i]["STEP_CODE"].ToString(), |
| | | id = int.Parse(json.Data.Rows[i]["ID"].ToString()) |
| | | } |
| | | }); |
| | | //åå
¥æ¥å·¥ç¼ºé·å¤çè®°å½è¡¨ |
| | | sql = @"insert into CSR_WorkRecord_DefectHandle(defect_id,wo_code,partnumber,step_seq,step_code,repair_qty,laborbad_qty,materielbad_qty,defect_code,style,lm_user,lm_date) |
| | | values(@defect_id,@wo_code,@partcode,@stepseq,@stepcode,@repair_qty,@laborbad_qty,@materielbad_qty,@defect_code,@style,@lm_user,@lm_date)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | defect_id = int.Parse(json.Data.Rows[i]["ID"].ToString()), |
| | | wo_code = json.Data.Rows[i]["WO_CODE"].ToString(), |
| | | partcode = json.Data.Rows[i]["MATERIEL_CODE"].ToString(), |
| | | stepseq = json.Data.Rows[i]["SEQ"].ToString(), |
| | | stepcode = json.Data.Rows[i]["STEP_CODE"].ToString(), |
| | | repair_qty = decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()), |
| | | laborbad_qty = decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()), |
| | | materielbad_qty = decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()), |
| | | defect_code = json.Data.Rows[i]["DEFECT_CODE"].ToString(), |
| | | style = "B", |
| | | lm_user = us.usercode, |
| | | lm_date = date |
| | | } |
| | | }); |
| | | |
| | | sumrepair_qty = sumrepair_qty + decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()); |
| | | sumlaborbad_qty = sumlaborbad_qty + decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()); |
| | | summaterielbad_qty = summaterielbad_qty + decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()); |
| | | } |
| | | //å¤åå·¥åº |
| | | if (json.Data.Rows[i]["STYLE"].ToString() == "S") |
| | | { |
| | | //åå对åºçæ¶æè®°å½åè¡¨æ¶ææ°éãä¸è¯æ°éãæ¥åºæ°é |
| | | sql = @"update TK_Wrk_OutRecordSub set sqty=sqty+@repair_qty,ng_qty=ng_qty-@repair_qty-@laborbad_qty-@materielbad_qty,laborbad_qty=laborbad_qty+@laborbad_qty,materielbad_qty=materielbad_qty+@materielbad_qty |
| | | where m_id=@m_id and style='S'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | m_id = int.Parse(json.Data.Rows[i]["M_ID"].ToString()), |
| | | repair_qty = decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()), |
| | | laborbad_qty = decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()), |
| | | materielbad_qty = decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()) |
| | | } |
| | | }); |
| | | //åå对åºçæ¶æè®°å½ä¸»è¡¨åæ ¼æ°éãä¸è¯æ°éãæ¥åºæ°é |
| | | sql = @"update TK_Wrk_OutRecord set sqty=sqty+@repair_qty,ng_qty=ng_qty-@repair_qty-@laborbad_qty-@materielbad_qty,laborbad_qty=laborbad_qty+@laborbad_qty,materielbad_qty=materielbad_qty+@materielbad_qty |
| | | where wo_code=@wo_code and step_code=@step_code and id=@id and style='S'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | repair_qty = decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()), |
| | | laborbad_qty = decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()), |
| | | materielbad_qty = decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()), |
| | | wo_code = json.Data.Rows[i]["WO_CODE"].ToString(), |
| | | step_code = json.Data.Rows[i]["STEP_CODE"].ToString(), |
| | | id = int.Parse(json.Data.Rows[i]["M_ID"].ToString()) |
| | | } |
| | | }); |
| | | //åå缺é·è®°å½è¡¨çå¾
å¤çæ°é |
| | | sql = @"update CSR_WorkRecord_Defect set defect_pendqty=defect_pendqty-@repair_qty-@laborbad_qty-@materielbad_qty,laborbad_qty=laborbad_qty+@laborbad_qty,materielbad_qty=materielbad_qty+@materielbad_qty |
| | | where wo_code=@wo_code and step_code=@step_code and id=@id and style='S'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | repair_qty = decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()), |
| | | laborbad_qty = decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()), |
| | | materielbad_qty = decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()), |
| | | wo_code = json.Data.Rows[i]["WO_CODE"].ToString(), |
| | | step_code = json.Data.Rows[i]["STEP_CODE"].ToString(), |
| | | id = int.Parse(json.Data.Rows[i]["ID"].ToString()) |
| | | } |
| | | }); |
| | | //åå
¥æ¥å·¥ç¼ºé·å¤çè®°å½è¡¨ |
| | | sql = @"insert into CSR_WorkRecord_DefectHandle(defect_id,wo_code,partnumber,step_seq,step_code,repair_qty,laborbad_qty,materielbad_qty,defect_code,style,lm_user,lm_date) |
| | | values(@defect_id,@wo_code,@partcode,@stepseq,@stepcode,@repair_qty,@laborbad_qty,@materielbad_qty,@defect_code,@style,@lm_user,@lm_date)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | defect_id = int.Parse(json.Data.Rows[i]["ID"].ToString()), |
| | | wo_code = json.Data.Rows[i]["WO_CODE"].ToString(), |
| | | partcode = json.Data.Rows[i]["MATERIEL_CODE"].ToString(), |
| | | stepseq = json.Data.Rows[i]["SEQ"].ToString(), |
| | | stepcode = json.Data.Rows[i]["STEP_CODE"].ToString(), |
| | | repair_qty = decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()), |
| | | laborbad_qty = decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()), |
| | | materielbad_qty = decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()), |
| | | defect_code = json.Data.Rows[i]["DEFECT_CODE"].ToString(), |
| | | style = "S", |
| | | lm_user = us.usercode, |
| | | lm_date = date |
| | | } |
| | | }); |
| | | sumrepair_qty = sumrepair_qty + decimal.Parse(json.Data.Rows[i]["REPAIR_QTY"].ToString()); |
| | | sumlaborbad_qty = sumlaborbad_qty + decimal.Parse(json.Data.Rows[i]["LABORBAD_QTY"].ToString()); |
| | | summaterielbad_qty = summaterielbad_qty + decimal.Parse(json.Data.Rows[i]["MATERIELBAD_QTY"].ToString()); |
| | | } |
| | | } |
| | | |
| | | //ååå·¥åå·¥åºè¡¨åæ ¼æ°éãä¸è¯æ°é |
| | | sql = @"update TK_Wrk_Step set good_qty=good_qty+@sumrepair_qty,ng_qty=ng_qty-@sumrepair_qty-@sumlaborbad_qty-@summaterielbad_qty,laborbad_qty=laborbad_qty+@sumlaborbad_qty,materielbad_qty=materielbad_qty+@summaterielbad_qty |
| | | where wo_code=@wo_code and step_code=@stepcode"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | wo_code = json.Data.Rows[0]["WO_CODE"].ToString(), |
| | | stepcode = json.Data.Rows[0]["STEP_CODE"].ToString(), |
| | | sumrepair_qty = sumrepair_qty, |
| | | sumlaborbad_qty = sumlaborbad_qty, |
| | | summaterielbad_qty= summaterielbad_qty |
| | | } |
| | | }); |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | | 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 |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace VueWebCoreApi.Models |
| | | { |
| | | public class ReportDefectList |
| | | { |
| | | public string badqty { get; set; } |
| | | public string defect_code { get; set; } |
| | | } |
| | | } |
| | |
| | | public string seq { get; set; } //å½åå·¥åºåºå· |
| | | public string stepcode { get; set; } //å½åå·¥åºç¼ç |
| | | public string stepname { get; set; } //å½åå·¥åº |
| | | public string stepprice { get; set; } //å½åå·¥åºå·¥ä»· |
| | | public string nextstepcode { get; set; } //ä¸éå·¥åºç¼ç |
| | | public string nextstepname { get; set; } //ä¸éå·¥åº |
| | | public string nextstepprice { get; set; } //ä¸éå·¥åºå·¥ä»· |
| | | public string stepdesc { get; set; } //å·¥åºæè¿° |
| | | public decimal planqty { get; set; } //任塿°é |
| | | public decimal startqty { get; set; } //å¼å·¥æ°é |
| | |
| | | public string seq { get; set; } //å½åå·¥åºåºå· |
| | | public string stepcode { get; set; } //å½åå·¥åºç¼ç |
| | | public string stepname { get; set; } //å½åå·¥åº |
| | | public string stepprice { get; set; } //å½åå·¥åºå·¥ä»· |
| | | public string nextstepcode { get; set; } //ä¸éå·¥åºç¼ç |
| | | public string nextstepname { get; set; } //ä¸éå·¥åº |
| | | public string nextstepprice { get; set; } //ä¸éå·¥åºå·¥ä»· |
| | | public string stepdesc { get; set; } //å·¥åºæè¿° |
| | | public string wkshopcode { get; set; } //车é´ç¼ç |
| | | public string wkshopname { get; set; } //车é´åç§° |
| | |
| | | //new ScoreReport("12","å·¥è£
æ¸
å"), |
| | | //new ScoreReport("13","å·¥è£
ç¹æ£"), |
| | | //new ScoreReport("14","å·¥è£
ä¿å
»"), |
| | | new ScoreReport("15","å·¥åºå®ä¹"), |
| | | new ScoreReport("15","å·¥åºè®¾ç½®"), |
| | | //new ScoreReport("16","å·¥èºè·¯çº¿"), |
| | | //new ScoreReport("24","èæå·¥ä»·"), |
| | | new ScoreReport("17","è´¨æ£æ å"), |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace VueWebCoreApi.Tools |
| | | { |
| | | public class GridMessage |
| | | { |
| | | public object recordset { get; set; } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //1.æ ¹æ®å·¥å+å·¥åºæ¥æ¾å½åå·¥åºæ¯å¦é¦éå·¥åº |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.status,A.plan_qty,A.isbott,A.isend,L.org_code,L.org_name |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.stepprice,A.seq,T.flwtype,T.descr,A.status,A.plan_qty,A.isbott,A.isend,L.org_code,L.org_name |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | |
| | | rt.stepcode = data.Rows[0]["STEPCODE"].ToString(); //å·¥åºç¼ç |
| | | rt.stepname = data.Rows[0]["STEPNAME"].ToString(); //å·¥åºåç§° |
| | | rt.stepdesc = data.Rows[0]["DESCR"].ToString(); //å·¥åºæè¿° |
| | | rt.stepprice= data.Rows[0]["STEPPRICE"].ToString(); //å·¥åºå·¥ä»· |
| | | rt.planqty = decimal.Parse(data.Rows[0]["PLAN_QTY"].ToString()); //任塿°é |
| | | |
| | | flwtype = data.Rows[0]["FLWTYPE"].ToString();//è·åå·¥åºå±æ§ |
| | |
| | | rt.seq = data.Rows[0]["SEQ"].ToString();//å·¥åºåºå· |
| | | |
| | | //è·åå½åå·¥åºä¸éå·¥åº |
| | | sql = @"select A.isbott,A.isend,T.stepcode,T.stepname from TK_Wrk_Step A |
| | | sql = @"select A.isbott,A.isend,T.stepcode,T.stepname,A.stepprice from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | where A.wo_code=@ordercode and A.seq=@seq+1 "; |
| | | dynamicParams.Add("@ordercode", ordercode); |
| | |
| | | { |
| | | rt.nextstepcode = dt.Rows[0]["STEPCODE"].ToString();//ä¸éå·¥åºç¼ç |
| | | rt.nextstepname = dt.Rows[0]["STEPNAME"].ToString();//ä¸éå·¥åºåç§° |
| | | rt.nextstepprice = data.Rows[0]["NEXTSTEPPRICE"].ToString(); //ä¸éå·¥åºå·¥ä»· |
| | | } |
| | | if (isend == "Y") //å½åå·¥åºæ¯æ«éå·¥åº |
| | | { |
| | | rt.nextstepcode = "";//data.Rows[0]["STEPCODE"].ToString();//å½åå·¥åºç¼ç |
| | | rt.nextstepname = "";// data.Rows[0]["STEPNAME"].ToString();//å½åå·¥åºåç§° |
| | | rt.nextstepprice = "";// data.Rows[0]["STEPPRICE"].ToString();//å½åå·¥åºå·¥ä»· |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | |
| | | //1.æ ¹æ®å·¥å+å·¥åºæ¥æ¾å½åå·¥åºæ¯å¦é¦éå·¥åº |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.status,A.plan_qty,A.isbott,A.isend,L.org_code,L.org_name |
| | | sql = @"select A.wo_code,P.partcode,P.partname,P.partspec, T.stepcode,T.stepname,A.seq,T.flwtype,T.descr,A.stepprice,A.status,A.plan_qty,A.isbott,A.isend,L.org_code,L.org_name |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | left join TK_Wrk_Man M on A.wo_code=M.wo_code |
| | |
| | | rt.stepname = data.Rows[0]["STEPNAME"].ToString(); //å·¥åºåç§° |
| | | rt.stepdesc = data.Rows[0]["DESCR"].ToString(); //å·¥åºæè¿° |
| | | rt.planqty = decimal.Parse(data.Rows[0]["PLAN_QTY"].ToString()); //任塿°é |
| | | |
| | | rt.stepprice = data.Rows[0]["STEPPRICE"].ToString(); //å·¥åºå·¥ä»· |
| | | flwtype = data.Rows[0]["FLWTYPE"].ToString();//è·åå·¥åºå±æ§ |
| | | isbott = data.Rows[0]["ISBOTT"].ToString();//é¦éå·¥åº |
| | | isend = data.Rows[0]["ISEND"].ToString();//æ«éå·¥åº |
| | | rt.seq = data.Rows[0]["SEQ"].ToString();//å·¥åºåºå· |
| | | |
| | | //è·åå½åå·¥åºä¸éå·¥åº |
| | | sql = @"select A.isbott,A.isend,T.stepcode,T.stepname from TK_Wrk_Step A |
| | | sql = @"select A.isbott,A.isend,T.stepcode,T.stepname,A.stepprice from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | where A.wo_code=@ordercode and A.seq=@seq+1 "; |
| | | dynamicParams.Add("@ordercode", ordercode); |
| | |
| | | { |
| | | rt.nextstepcode = dt.Rows[0]["STEPCODE"].ToString();//ä¸éå·¥åºç¼ç |
| | | rt.nextstepname = dt.Rows[0]["STEPNAME"].ToString();//ä¸éå·¥åºåç§° |
| | | rt.nextstepprice = data.Rows[0]["NEXTSTEPPRICE"].ToString(); //ä¸éå·¥åºå·¥ä»· |
| | | } |
| | | if (isend == "Y") //å½åå·¥åºæ¯æ«éå·¥åº |
| | | { |
| | | rt.nextstepcode = "";// data.Rows[0]["STEPCODE"].ToString();//å½åå·¥åºç¼ç |
| | | rt.nextstepname = "";// data.Rows[0]["STEPNAME"].ToString();//å½åå·¥åºåç§° |
| | | rt.nextstepprice = ""; //data.Rows[0]["NEXTSTEPPRICE"].ToString();//ä¸éå·¥åºå·¥ä»· |
| | | } |
| | | } |
| | | else |