Commit 3455c4459085be6db8e69d6d5e1b51a474fd9100

Authored by 赖素文
1 parent 8296ffb2

--修复工艺路线bug

sys/Hh.Mes.POJO/EnumEntitys/EnumLog.cs
... ... @@ -23,6 +23,8 @@ namespace Hh.Mes.POJO.EnumEntitys
23 23  
24 24 AOP全局错误 = 40,
25 25  
  26 + AOP脚本执行超过15秒 = 45,
  27 +
26 28 Mom获取Token = 50,
27 29  
28 30 MOM业务问题 = 80,
... ...
sys/Hh.Mes.POJO/WebEntity/base/base_process_route_detail.cs
... ... @@ -63,9 +63,9 @@ namespace Hh.Mes.POJO.Entity
63 63  
64 64  
65 65 /// <summary>
66   - /// 是否启用 1=true 启用 0=false 不启用(bit)
  66 + /// 是否启用 启用=1 不启用=0
67 67 /// </summary>
68   - public bool? isDelete { get; set; }
  68 + public int isDelete { get; set; }
69 69  
70 70 /// <summary>
71 71 /// 报检设置
... ...
sys/Hh.Mes.Service/ApiService/UpstreamDown/UpstreamSendProcessRoute.cs
... ... @@ -70,7 +70,7 @@ namespace Hh.Mes.Service.ApiService
70 70 workCenterName = item.station_name,
71 71 LineCode = item.line_code,
72 72 createBy = item.CREATEUNAME,
73   - isDelete = false,
  73 + isDelete = 1,
74 74 createTime = DateTime.Now
75 75 };
76 76 details.Add(processRouteDetail);
... ... @@ -194,7 +194,7 @@ namespace Hh.Mes.Service.ApiService
194 194 .Where(x => x.plmeid == head.plmeid && x.isDelete == AddOrUpdateFlag).AddQueue();
195 195 for (var i = 0; i < details.Count; i++)
196 196 {
197   - details[i].isDelete = false;
  197 + details[i].isDelete = 1;
198 198 details[i].updateBy = SystemVariable.DefaultCreated;
199 199 details[i].updateTime = DateTime.Now;
200 200  
... ... @@ -235,14 +235,14 @@ namespace Hh.Mes.Service.ApiService
235 235 .Where(x => x.plmeid == head.plmeid && x.isDelete == AddOrUpdateFlag).AddQueue();
236 236 for (var i = 0; i < details.Count; i++)
237 237 {
238   - details[i].isDelete = false;
  238 + details[i].isDelete = 0;
239 239 details[i].updateBy = SystemVariable.DefaultCreated;
240 240 details[i].updateTime = DateTime.Now;
241 241  
242 242 var index = i;
243 243 Context.Updateable(details[index])
244 244 .UpdateColumns(x => new { x.isDelete })
245   - .Where(x => x.plmeid == details[index].plmeid && x.isDelete.Value).AddQueue();
  245 + .Where(x => x.plmeid == details[index].plmeid && x.isDelete==1).AddQueue();
246 246 }
247 247 #endregion
248 248  
... ...
sys/Hh.Mes.Service/ApiService/UpstreamDown/UpstreamSendWorkOrder.cs
... ... @@ -252,7 +252,7 @@ namespace Hh.Mes.Service.ApiService
252 252 #endregion
253 253  
254 254 #region 生成工序任务明细 busWorkOrderDetailList
255   - ProcessBody = Context.Queryable<base_process_route_detail>().Where(x => x.headkeys == ProcessHead.keys && !x.isDelete.Value).OrderBy(t => t.oprSequence).ToList();
  255 + ProcessBody = Context.Queryable<base_process_route_detail>().Where(x => x.headkeys == ProcessHead.keys && x.isDelete==1).OrderBy(t => t.oprSequence).ToList();
256 256 foreach (var item in ProcessBody)
257 257 {
258 258 var busWorkOrderDetail = new bus_workOrder_detail
... ...
sys/Hh.Mes.Service/Repository/RepositorySqlSugar.cs
... ... @@ -13,6 +13,7 @@ using Hh.Mes.POJO.Response;
13 13 using Hh.Mes.Service.Logs;
14 14 using Microsoft.AspNetCore.Hosting;
15 15 using Microsoft.AspNetCore.Http;
  16 +using NetTaste;
16 17 using Newtonsoft.Json;
17 18 using Org.BouncyCastle.Crypto;
18 19 using SqlSugar;
... ... @@ -84,6 +85,24 @@ namespace Hh.Mes.Service.Repository
84 85 });
85 86 //OnError 写日志
86 87 base.Context.Aop.OnError = ExceptionLog;
  88 +
  89 + base.Context.Aop.OnLogExecuting = (sql, pars) => //SQL执行前
  90 + {
  91 + //获取原生SQL推荐 5.1.4.63 性能OK
  92 + //UtilMethods.GetNativeSql(sql,pars)
  93 +
  94 + //获取无参数化SQL 影响性能只适合调试
  95 + //UtilMethods.GetSqlString(DbType.SqlServer,sql,pars)
  96 + };
  97 + //SQL执行完
  98 + base.Context.Aop.OnLogExecuted = (sql, pars) =>
  99 + {
  100 + //执行完了可以输出SQL执行时间 (OnLogExecutedDelegate)
  101 + if (base.Context.Ado.SqlExecutionTime.TotalSeconds > 15)
  102 + {
  103 + QueueInterLog.GetInstance.EnqueueInterLog(null, null, EnumLog.AOP脚本执行超过15秒.ToString(), sql, 0, user: "AOP", sysTitle: EnumLog.AOP脚本执行超过15秒.ToString());
  104 + }
  105 + };
87 106 }
88 107 uploadFolder = "UploadFile";
89 108 }
... ...
sys/Hh.Mes.Service/WebService/Configure/ProcessRouteService.cs
... ... @@ -7,6 +7,7 @@ using Hh.Mes.Service.Repository;
7 7 using SqlSugar;
8 8 using System;
9 9 using System.Collections.Generic;
  10 +using System.Linq;
10 11 using System.Linq.Expressions;
11 12 using System.Text;
12 13  
... ... @@ -45,7 +46,7 @@ namespace Hh.Mes.Service.Configure
45 46 dynamic data;
46 47 if (pageReq != null)
47 48 {
48   - data = query.ToOffsetPage(pageReq.page, pageReq.limit, ref totalCount);
  49 + data = query.OrderBy(x => x.createTime, OrderByType.Desc).ToOffsetPage(pageReq.page, pageReq.limit, ref totalCount);
49 50 }
50 51 else
51 52 {
... ... @@ -67,6 +68,7 @@ namespace Hh.Mes.Service.Configure
67 68 var exp = Expressionable.Create<base_process_route_head>();
68 69 if (!string.IsNullOrWhiteSpace(model.lineCode)) exp.And(x => x.lineCode.Contains(model.lineCode));
69 70 if (!string.IsNullOrWhiteSpace(model.processCode)) exp.And(x => x.processCode.Contains(model.processCode));
  71 + if (model.keys!= Guid.Empty) exp.And(x => x.keys== model.keys);
70 72 var wheres = exp.ToExpression();//拼接表达式
71 73 return wheres;
72 74 }
... ...
sys/Hh.Mes.Service/WebService/Configure/ProductService.cs
... ... @@ -23,7 +23,7 @@ namespace Hh.Mes.Service.WebService.Configure
23 23 public Response GetProductHeaderList(PageReq pageReq, base_product_header entity)
24 24 {
25 25 var result = new Response();
26   - string orderBy = (pageReq == null || string.IsNullOrEmpty(pageReq.field)) ? " id desc" : $"{pageReq.field} {pageReq.order} ";
  26 + string orderBy = (pageReq == null || string.IsNullOrEmpty(pageReq.field)) ? " t1.createTime desc" : $"{pageReq.field} {pageReq.order} ";
27 27 string sqlWhere = SqlWhere(entity);
28 28 //工艺路线过滤已绑定的产品
29 29 //string sqlWhereProcessRoute = " ";
... ...
web/WebMvc/Areas/configure/Controllers/ProcessRouteController.cs
... ... @@ -29,7 +29,7 @@ namespace WebMvc
29 29 }
30 30  
31 31 #region 视图功能
32   - [ResponseCache(Duration = 60)]
  32 + [ResponseCache(Duration = 10)]
33 33 public ActionResult Index()
34 34 {
35 35 return View();
... ...
web/WebMvc/Areas/configure/Views/ProcessRoute/Index.cshtml
... ... @@ -22,10 +22,15 @@
22 22 <div class="layui-col-sm3">
23 23 <label class="layui-form-label">工艺编码</label>
24 24 <div class="layui-input-inline">
25   - <input name="processCode" type="text" autocomplete="off" lay-verify="required" maxlength="100" class="layui-input">
  25 + <input name="processCode" type="text" autocomplete="off" maxlength="100" class="layui-input">
  26 + </div>
  27 + </div>
  28 + <div class="layui-col-sm3">
  29 + <label class="layui-form-label">工艺编码</label>
  30 + <div class="layui-input-inline">
  31 + <input name="keys" type="text" autocomplete="off" maxlength="100" placeholder="错误的keys不会转换查询" class="layui-input">
26 32 </div>
27 33 </div>
28   -
29 34 </div>
30 35 </div>
31 36 </fieldset>
... ... @@ -83,7 +88,7 @@
83 88 <div class="layui-col-sm6">
84 89 <label class="layui-form-label layui-col-sm3">是否有效</label>
85 90 <div class="layui-input-inline layui-col-sm6">
86   - <input type="checkbox" name="isDelete" lay-skin="switch" lay-text="有效|无效" value="1">
  91 + <input type="checkbox" name="isDelete" checked lay-skin="switch" lay-text="有效|无效" value="1">
87 92 </div>
88 93 </div>
89 94 <div class="layui-col-sm6">
... ... @@ -141,17 +146,16 @@
141 146 <div class="layui-col-sm6">
142 147 <label class="layui-form-label layui-col-sm3">工序比例</label>
143 148 <div class="layui-input-inline layui-col-sm6">
144   - <input type="text" name="opeRatio" class="layui-input " lay-verify="required">
  149 + <input type="text" name="opeRatio" class="layui-input " >
145 150 </div>
146 151 </div>
147   - <div class="layui-col-sm12">
148   - <label class="layui-form-label layui-col-sm3">工序时间<label class="lable-required">*</label></label>
149   - <div class="layui-input-inline layui-col-sm9 div-flex">
150   - <input type="text" name="oprPlanStartTime" class="layui-input layui-date" typeTime="datetime" lay-verify="required">
151   - <label>-</label>
152   - <input type="text" name="oprPlanEndTime" class="layui-input layui-date" typeTime="datetime" lay-verify="required">
  152 + <div class="layui-col-sm6">
  153 + <label class="layui-form-label layui-col-sm3">工序耗时</label>
  154 + <div class="layui-input-inline layui-col-sm6">
  155 + <input name="oprsequenceTime" type="number" autocomplete="off" lay-verify="" maxlength="32" class="layui-input">
153 156 </div>
154 157 </div>
  158 +
155 159 <div class="layui-col-sm6">
156 160 <label class="layui-form-label layui-col-sm3">外部编码</label>
157 161 <div class="layui-input-inline layui-col-sm6">
... ... @@ -161,7 +165,7 @@
161 165 <div class="layui-col-sm6">
162 166 <label class="layui-form-label layui-col-sm3">是否有效</label>
163 167 <div class="layui-input-inline layui-col-sm6">
164   - <input type="checkbox" name="isDelete" lay-skin="switch" lay-text="有效|无效" value="1">
  168 + <input type="checkbox" name="isDelete" checked lay-skin="switch" lay-text="有效|无效" value="1">
165 169 </div>
166 170 </div>
167 171 <div class="layui-col-sm6">
... ...
web/WebMvc/wwwroot/js/system.js
... ... @@ -2103,11 +2103,11 @@ layui.define(importFileName, function (exports) {
2103 2103 var refreshElem = $("#" + toolbarId).next(),
2104 2104 pageArr = refreshElem.attr("lay-filter").split('-'),
2105 2105 lastPage = pageArr[pageArr.length - 1];
2106   - var pageElem = "#layui-table-page" + lastPage,
2107   - $pageElem = $(pageElem).find(".layui-icon-refresh");
2108   - if ($pageElem.length > 0) {
2109   - $pageElem.click();
2110   - }
  2106 + //var pageElem = "#layui-table-page" + lastPage,
  2107 + // $pageElem = $(pageElem).find(".layui-icon-refresh");
  2108 + //if ($pageElem.length > 0) {
  2109 + // $pageElem.click();
  2110 + //}
2111 2111 layer.close(sU.config.btnRefreshLoadIndex);
2112 2112 if (action["actionSuccess"] !== undefined) action["actionSuccess"].call(null, flag, toolbarId);
2113 2113 },
... ...
web/WebMvc/wwwroot/productjs/configure/ProcessRoute.js
... ... @@ -247,16 +247,15 @@ layui.config({
247 247 { field: 'headkeys', width: 150, hide: true, title: '用来和主表关联的guid' },
248 248 { field: 'oprSequenceCode', width: 200, title: '工序序号' },
249 249 { field: 'oprSequenceName', width: 150, title: '工序名称' },
250   - { field: 'oprSequence', width: 150, title: '工艺路线明细顺序' },
  250 + { field: 'oprSequence', width: 100, title: '顺序' },
251 251  
252   - { field: 'otherCode', width: 120, title: '外部编码' },
253 252 { field: 'workCenterCode', width: 100, title: '工作中心' },
254 253 { field: 'opeRatio', width: 100, title: '工序比例' },
255   - { field: 'oprPlanStartTime', width: 220, title: '计划开始时间'},
256   - { field: 'oprPlanEndTime', width: 220, title: '计划结束时间' },
  254 + { field: 'oprsequenceTime', width: 220, title: '工序耗时'},
257 255  
258 256 { field: 'inspectionFlag', width: 120, title: '报检设置' },
259 257 { field: 'remarks', width: 100, title: '备注' },
  258 + { field: 'otherCode', width: 120, title: '外部编码' },
260 259 { field: 'isDelete', width: 120, title: '是否有效', templet: "#isSysDeleteTemplet" },
261 260 ]],
262 261 urlTable: `/${areaName}/${tableName}/Load`,
... ...