1.报工调整增加工序查询条件
2.报工调整增加批量改价
3.生产订单、生产工单车间查询条件改为多选
| | |
| | | [ApiExplorerSettings(GroupName = "å·¥å管ç")] |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | //[ChannelActionFilter] |
| | | [ChannelActionFilter] |
| | | public class WorkOrderController : Controller |
| | | { |
| | | //å®ä¹å
¨å±ä¿¡æ¯è¿ååé |
| | |
| | | /// <param name="partnumber">产åç¼ç </param> |
| | | /// <param name="partname">产ååç§°</param> |
| | | /// <param name="partspec">产åè§æ ¼</param> |
| | | /// <param name="stepcode">å·¥åºç¼ç </param> |
| | | /// <param name="reportuser">æ¥å·¥äººå</param> |
| | | /// <param name="reportdate">æ¥å·¥æ¶é´</param> |
| | | /// <param name="page">页ç </param> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepVerifySearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderStepVerifySearch(string wkshopcode=null, string wo_code = null, string partnumber = null, string partname = null, string partspec = null, string reportuser = null, string reportdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | public JsonResult MesOrderStepVerifySearch(string wkshopcode=null, string wo_code = null, string partnumber = null, string partname = null, string partspec = null,string stepcode=null, string reportuser = null, string reportdate = null, int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | string reportdateopendate = ""; //æ¥å·¥å¼å§æ¶é´ |
| | | string reportdateclosedate = ""; //æ¥å·¥ç»ææ¶é´ |
| | |
| | | } |
| | | int startNum = rows * (page - 1) + 1; //èµ·å§è®°å½rowNum |
| | | int endNum = rows * page; //ç»æè®°å½ rowNum |
| | | mes = WorkOrderBLL.MesOrderStepVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | mes = WorkOrderBLL.MesOrderStepVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, stepcode, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[ç产æ§è¡,æ¥å·¥è°æ´æ¹éæ¹ä»·æ°æ®æäº¤] |
| | | /// <summary> |
| | | /// ç产æ§è¡,æ¥å·¥è°æ´æ¹éæ¹ä»·æ°æ®æäº¤ |
| | | /// </summary> |
| | | /// <param name="json">æäº¤æ°æ®</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderStepPriceBatchUpdateSeave")] |
| | | [HttpPost] |
| | | public JsonResult MesOrderStepPriceBatchUpdateSeave(List<BatchPrice> json) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = WorkOrderBLL.MesOrderStepPriceBatchUpdateSeave(us, json); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[ç产æ§è¡,æ¥å·¥å®¡æ ¸åè¡¨æ°æ®æ¥è¯¢æ¥å£] |
| | |
| | | |
| | | |
| | | #region[ç产æ§è¡,æ¥å·¥è°æ´æ°æ®æ¥è¯¢æ¥å£] |
| | | public static ToMessage MesOrderStepVerifySearch(string wkshopcode,string wo_code, string partnumber, string partname, string partspec, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderStepVerifySearch(string wkshopcode,string wo_code, string partnumber, string partname, string partspec,string stepcode, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return WorkOrderDAL.MesOrderStepVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | return WorkOrderDAL.MesOrderStepVerifySearch(wkshopcode,wo_code, partnumber, partname, partspec, stepcode, reportuser, reportdateopendate, reportdateclosedate, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[ç产æ§è¡,æ¥å·¥è°æ´æ¹éæ¹ä»·æ°æ®æäº¤] |
| | | public static ToMessage MesOrderStepPriceBatchUpdateSeave(User us,List<BatchPrice> json) |
| | | { |
| | | return WorkOrderDAL.MesOrderStepPriceBatchUpdateSeave(us, json); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[ç产æ§è¡,æ¥å·¥å®¡æ ¸åè¡¨æ°æ®æ¥è¯¢æ¥å£] |
| | | public static ToMessage MesOrderStepReportVerifySearch(string reviewstatus, string wkshopcode, string wo_code, string partnumber, string partname, string partspec, string stepname, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | |
| | | } |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | { |
| | | search += "and A.wkshp_code=@wkshopcode "; |
| | | dynamicParams.Add("@wkshopcode", wkshopcode); |
| | | string[] wkshoplist = Array.ConvertAll<string, string>(wkshopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //stringåå²è½¬string[] |
| | | search += "and A.wkshp_code in @wkshoplist "; |
| | | dynamicParams.Add("@wkshoplist", wkshoplist); |
| | | } |
| | | if (erpordercode != "" && erpordercode != null) |
| | | { |
| | |
| | | } |
| | | if (wkshopcode != "" && wkshopcode != null) |
| | | { |
| | | search += "and A.wkshp_code=@wkshopcode "; |
| | | dynamicParams.Add("@wkshopcode", wkshopcode); |
| | | string[] wkshoplist = Array.ConvertAll<string, string>(wkshopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //stringåå²è½¬string[] |
| | | search += "and A.wkshp_code in @wkshoplist "; |
| | | dynamicParams.Add("@wkshoplist", wkshoplist); |
| | | } |
| | | if (mesordercode != "" && mesordercode != null) |
| | | { |
| | |
| | | |
| | | |
| | | #region[ç产æ§è¡,æ¥å·¥è°æ´æ°æ®æ¥è¯¢æ¥å£] |
| | | public static ToMessage MesOrderStepVerifySearch(string wkshopcode, string wo_code, string partnumber, string partname, string partspec, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | public static ToMessage MesOrderStepVerifySearch(string wkshopcode, string wo_code, string partnumber, string partname, string partspec,string stepcode, string reportuser, string reportdateopendate, string reportdateclosedate, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | search += "and AA.partspec like '%'+@partspec+'%' "; |
| | | dynamicParams.Add("@partspec", partspec); |
| | | } |
| | | if (stepcode != "" && stepcode != null) |
| | | { |
| | | search += "and AA.step_code=@stepcode "; |
| | | dynamicParams.Add("@stepcode", stepcode); |
| | | } |
| | | if (reportuser != "" && reportuser != null) |
| | | { |
| | | search += "and AA.usercode like '%'+@reportuser+'%' "; |
| | |
| | | var total = 0; //æ»æ¡æ° |
| | | var sql = @"select * from( |
| | | select A.id,B.id as sbid,A.wo_code,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.eqp_code,E.name as eqp_name, |
| | | A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,k.isbott as first_choke,k.isend as last_choke,A.step_price,B.reckway,B.usergroup_code,G.usergroupname as usergroup_name, |
| | | A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,A.style,k.isbott as first_choke,k.isend as last_choke,A.step_price,B.reckway,B.usergroup_code,G.usergroupname as usergroup_name, |
| | | B.report_person as usercode, |
| | | STUFF((SELECT ',' + U.username |
| | | FROM TUser U |
| | |
| | | where A.style='B' and B.style='B' and M.status<>'CLOSED' and A.verify='N' |
| | | union all |
| | | select A.id,B.id as sbid,A.wo_code,A.materiel_code as partnumber,P.partname,P.partspec,K.plan_quantity,K.plan_qty as task_qty,M.wkshp_code,T.torg_name as wkshp_name,A.wx_code as eqp_code,E.name as eqp_name, |
| | | A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,k.isbott as first_choke,k.isend as last_choke,A.step_price,'person' as reckway,'' as usergroup_code,'' as usergroup_name, |
| | | A.step_seq,A.step_code,S.stepname,S.flwtype as steptype,A.style,k.isbott as first_choke,k.isend as last_choke,A.step_price,'person' as reckway,'' as usergroup_code,'' as usergroup_name, |
| | | B.in_person as usercode, |
| | | STUFF((SELECT ',' + U.username |
| | | FROM TUser U |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[ç产æ§è¡,æ¥å·¥è°æ´æ¹éæ¹ä»·æ°æ®æäº¤] |
| | | public static ToMessage MesOrderStepPriceBatchUpdateSeave(User us, List<BatchPrice> json) |
| | | { |
| | | string sql = ""; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | if (json.Count > 0) |
| | | { |
| | | // 使ç¨Lambda表达å¼å¤æç±»ååå¸:å
¨é¨æ¥å·¥æè
å
¨é¨æ¶æ |
| | | bool allB = json.All(p => p.type == "B"); |
| | | bool allS = json.All(p => p.type == "S"); |
| | | if (allB)//å
¨é¨æ¥å·¥ |
| | | { |
| | | //å°List<BatchPrice>ä¸çidåæ®µè½¬æ¢ä¸ºå符串æ°ç» |
| | | string[] idArray = json.Select(bp => bp.id).ToArray(); |
| | | //åå对åºçæ¥å·¥è®°å½ä¸»è¡¨å·¥ä»· |
| | | sql = @"update TK_Wrk_Record set step_price=@step_price where id in @idArray and style='B'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | step_price = decimal.Parse(json[0].price), |
| | | idArray = idArray |
| | | } |
| | | }); |
| | | } |
| | | else if (allS)//å
¨é¨æ¶æ |
| | | { |
| | | //å°List<BatchPrice>ä¸çidåæ®µè½¬æ¢ä¸ºå符串æ°ç» |
| | | string[] idArray = json.Select(bp => bp.id).ToArray(); |
| | | //åå对åºçæ¥å·¥è®°å½ä¸»è¡¨å·¥ä»· |
| | | sql = @"update TK_Wrk_OutRecord set step_price=@step_price where id in @idArray and style='S'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | step_price = decimal.Parse(json[0].price), |
| | | idArray = idArray |
| | | } |
| | | }); |
| | | } |
| | | else // æ··åæ
åµ |
| | | { |
| | | //å°List<BatchPrice>ä¸ä¸ºæ¥å·¥çidåæ®µè½¬æ¢ä¸ºå符串æ°ç» |
| | | var bList = json.Where(p => p.type == "B").ToList(); |
| | | string[] idBArray = bList.Select(bp => bp.id).ToArray(); |
| | | //åå对åºçæ¥å·¥è®°å½ä¸»è¡¨å·¥ä»· |
| | | sql = @"update TK_Wrk_Record set step_price=@step_price where id in @idBArray and style='B'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | step_price = decimal.Parse(json[0].price), |
| | | idBArray = idBArray |
| | | } |
| | | }); |
| | | //å°List<BatchPrice>ä¸ä¸ºæ¶æçidåæ®µè½¬æ¢ä¸ºå符串æ°ç» |
| | | var sList = json.Where(p => p.type == "S").ToList(); |
| | | string[] idSArray = sList.Select(bp => bp.id).ToArray(); |
| | | //åå对åºçæ¥å·¥è®°å½ä¸»è¡¨å·¥ä»· |
| | | sql = @"update TK_Wrk_OutRecord set step_price=@step_price where id in @idSArray and style='S'"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | step_price = decimal.Parse(json[0].price), |
| | | idSArray = idSArray |
| | | } |
| | | }); |
| | | } |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | | //åå
¥æä½è®°å½è¡¨ |
| | | LogHelper.DbOperateLog(us.usercode, "æ¹éä¿®æ¹å·¥ä»·", "æ¥å·¥ID:" + string.Join(",",json.Select(bp => bp.id).ToArray())+",æä½ç±»å:"+ string.Join(",", json.Select(bp => bp.type).ToArray()), 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; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = "è¯·éæ©éè¦æ¹éè°æ´å·¥ä»·çæ¥å·¥è®°å½!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | return mes; |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[ç产æ§è¡,æ¥å·¥å®¡æ ¸åè¡¨æ°æ®æ¥è¯¢æ¥å£] |
| | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[ç产å
¥åºæ¡ç è¡¥æ] |
| | | public static ToMessage ProductInHouseLabCode(string ordercode) |
| | | { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace VueWebCoreApi.Models |
| | | { |
| | | public class BatchPrice |
| | | { |
| | | /// <summary> |
| | | /// æ¥å·¥è®°å½ä¸»è¡¨id |
| | | /// </summary> |
| | | public string id { get; set; } |
| | | /// <summary> |
| | | /// 工价 |
| | | /// </summary> |
| | | public string price { get; set; } |
| | | /// <summary> |
| | | /// æ¥å·¥ç±»å:B(æ¥å·¥)/S(æ¶æ) |
| | | /// </summary> |
| | | public string type { get; set; } |
| | | } |
| | | } |
| | |
| | | new ScoreReport("14","模å
·ä¿å
»é¡¹ç®"), |
| | | new ScoreReport("14_1","模å
·ä¿å
»æ å"), |
| | | new ScoreReport("15","å·¥åºè®¾ç½®"), |
| | | new ScoreReport("16","å·¥èºè·¯çº¿"), |
| | | //new ScoreReport("16","å·¥èºè·¯çº¿"), |
| | | //new ScoreReport("24","èæå·¥ä»·"), |
| | | new ScoreReport("17","è´¨æ£æ å"), |
| | | new ScoreReport("18","缺é·å®ä¹"), |