| | |
| | | |
| | | #region WMS忥任å¡å®æ |
| | | var keys = new Dictionary<string, object>() |
| | | { |
| | | {"taskNum", taskNum} |
| | | }; |
| | | { |
| | | {"taskNum", taskNum} |
| | | }; |
| | | // è·åWMSipå°å |
| | | var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); |
| | | var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue; |
| | |
| | | var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode); |
| | | HandleTaskOut(conveyorLine, command, childDeviceCode, ProtocalDetailValue, task); |
| | | |
| | | if (task == null && command.Barcode != "NoRead") |
| | | if (task == null && command.Barcode != "NoRead" && !command.Barcode.IsNotEmptyOrNull()) |
| | | { |
| | | HandleNewTask(conveyorLine, command, childDeviceCode, ProtocalDetailValue); |
| | | } |
| | |
| | | *****************************************************************************************/ |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue"; |
| | | // import gridHeader from "./demo_Product/Dt_BillGroupStockDetail.vue"; |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: gridHeader, |
| | | gridHeader: "", |
| | | gridBody: "", |
| | | gridFooter: "", |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | this.boxOptions.labelWidth = 150; |
| | | |
| | | this.columns.push({ |
| | | title: "æä½", |
| | | field: "æä½", |
| | | width: 150, |
| | | align: "left", // 'center', |
| | | render: (h, { row, column, index }) => { |
| | | return ( |
| | | <div> |
| | | <el-button |
| | | onClick={($e) => { |
| | | this.$refs.gridHeader.openModel1(row); |
| | | }} |
| | | type="primary" |
| | | plain |
| | | style="height:26px; padding: 10px !important;" |
| | | > |
| | | æ¥çåºåæç» |
| | | </el-button> |
| | | </div> |
| | | ); |
| | | }, |
| | | }); |
| | | // this.columns.push({ |
| | | // title: "æä½", |
| | | // field: "æä½", |
| | | // width: 150, |
| | | // align: "left", // 'center', |
| | | // render: (h, { row, column, index }) => { |
| | | // return ( |
| | | // <div> |
| | | // <el-button |
| | | // onClick={($e) => { |
| | | // this.$refs.gridHeader.openModel1(row); |
| | | // }} |
| | | // type="primary" |
| | | // plain |
| | | // style="height:26px; padding: 10px !important;" |
| | | // > |
| | | // æ¥çåºåæç» |
| | | // </el-button> |
| | | // </div> |
| | | // ); |
| | | // }, |
| | | // }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | this.boxOptions.labelWidth = 150; |
| | | |
| | | // openModel1 = function (row) { |
| | | // palletCode.value = row.palletCode; |
| | | // searchFormFields.value.stockId = row.id; |
| | | // model1.value = true; |
| | | // this.$refs.gridHeader.openModel1(); |
| | | // } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | --> |
| | | <template> |
| | | <vol-box :lazy="true" v-model="model1" title="åºåæç»ä¿¡æ¯" :width="1820" :padding="5" :onModelClose="onModelClose"> |
| | | <view-grid ref="grid" :columns="columns" :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" :table="table" :extend="extend"> |
| | | <view-grid ref="grid" :columns="columns" :searchFormFields="searchFormFields" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormOptions="searchFormOptions" :table="table" :extend="extend"> |
| | | </view-grid> |
| | | <template #footer> |
| | | <div> |
| | |
| | | <script> |
| | | import extend from "@/extension/widesea_wms/stock/Dt_BillGroupStockDetail.js"; |
| | | import VolBox from '@/components/basic/VolBox.vue'; |
| | | import { ref, defineComponent } from "vue"; |
| | | import { ref, defineComponent, getCurrentInstance } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | |
| | | }); |
| | | const editFormFields = ref({ |
| | | "palletCode": "", |
| | | "materialNo": "" |
| | | "materialNo": "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | "palletCode": "", |
| | | "materialNo": "" |
| | | "materialNo": "", |
| | | "stockId": 0 |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | |
| | | const model1 = ref(false); |
| | | const palletCode = ref(""); |
| | | |
| | | const openModel1 = (row)=>{ |
| | | const openModel1 = (row) => { |
| | | palletCode.value = row.palletCode; |
| | | searchFormFields.value.stockId = row.id; |
| | | model1.value = true; |
| | | } |
| | | |
| | | |
| | | return { |
| | | table, |
| | |
| | | }; |
| | | }, |
| | | components: { |
| | | 'vol-box': VolBox |
| | | 'vol-box': VolBox |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | name: 'Dt_BillGroupStock', |
| | | component: () => import('@/views/widesea_wms/stock/Dt_BillGroupStock.vue'), |
| | | meta: { |
| | | keepAlive: false |
| | | keepAlive: true |
| | | } |
| | | }, |
| | | // { |
| | | // path: '/Dt_BillGroupStockDetail', |
| | | // name: 'Dt_BillGroupStockDetail', |
| | | // component: () => import('@/views/widesea_wms/stock/Dt_BillGroupStockDetail.vue') |
| | | // component: () => import('@/views/widesea_wms/stock/Dt_BillGroupStockDetail.vue'), |
| | | // meta: { |
| | | // keepAlive: true |
| | | // } |
| | | // }, |
| | | { |
| | | path: '/Dt_InboundOrder', |
| | |
| | | const userInfo = reactive({ |
| | | userName: '', |
| | | password: '', |
| | | verificationCode: '', |
| | | verificationCode: '1234', |
| | | UUID: undefined |
| | | }); |
| | | |
| | |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wms/stock/Dt_BillGroupStock.jsæ¤å¤ç¼å |
| | | --> |
| | | |
| | | <template> |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | |
| | | { "title": "ç»çç±»å", "field": "groupType", type: "select", dataKey: "GroupType", data: [] }, |
| | | ] |
| | | ]); |
| | | const columns = ref([{ field: 'id', title: 'åºåID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' }, |
| | | { field: 'locationCode', title: 'åºä½', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'palletCode', title: 'æçæ¡ç ', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'isFull', title: 'æ¯å¦æ»¡ç', type: 'bool', width: 110, align: 'left' }, |
| | | // { field: 'state', title: 'åºåç¶æ', type: 'int', width: 110, align: 'left', bind: { key: "StockState", data: [] } }, |
| | | { field: 'LinedProcessFeedbackTime', title: 'å·¥èºå¼å§æ¶é´', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'SpecialParameterDuration', title: 'å·¥èºæ¶é¿', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'OutboundTime', title: 'åºåºåºæ¶é´', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'remark', title: '夿³¨', type: 'string', width: 120, hidden: true, align: 'left' }, |
| | | { field: 'createID', title: 'å建ID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' }, |
| | | { field: 'creater', title: 'å建人', type: 'string', sort: true, width: 110, align: 'left' }, |
| | | { field: 'createDate', title: 'å建æ¶é´', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }, |
| | | { field: 'modifyID', title: 'ä¿®æ¹äººID', type: 'int', sort: true, width: 100, hidden: true, align: 'left' }, |
| | | { field: 'modifier', title: 'æåä¿®æ¹äºº', type: 'string', sort: true, width: 100, align: 'left' }, |
| | | { field: 'modifyDate', title: 'æåä¿®æ¹æ¶é´', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },]); |
| | | const columns = ref( |
| | | [{ field: 'id', title: 'åºåID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' }, |
| | | { field: 'locationCode', title: 'åºä½', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'palletCode', title: 'æçæ¡ç ', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'isFull', title: 'æ¯å¦å®ç', type: 'bool', width: 110, align: 'left' }, |
| | | { field: 'linedProcessFeedbackTime', title: 'å·¥èºå¼å§æ¶é´', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'specialParameterDuration', title: 'å·¥èºæ¶é¿', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'outboundTime', title: 'åºåºåºæ¶é´', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'productionLine', title: 'ç产产线', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'areaCode', title: 'åºåº', type: 'string', width: 110, align: 'left', sort: true }, |
| | | { field: 'remark', title: 'çµè¯æ°é', type: 'string', width: 120, align: 'left' }, |
| | | { field: 'creater', title: 'å建人', type: 'string', sort: true, width: 110, align: 'left', hidden: true }, |
| | | { field: 'createDate', title: 'å建æ¶é´', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }, |
| | | { field: 'modifier', title: 'æåä¿®æ¹äºº', type: 'string', sort: true, width: 100, hidden: true, align: 'left' }, |
| | | // { field: 'modifyDate', title: 'æåä¿®æ¹æ¶é´', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }, |
| | | ] |
| | | ); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "#detailTable", |
| | |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | taskType: 200, |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { "title": "ä»»å¡å·", "field": "taskNum", "type": "text" }, |
| | | { "title": "æçå·", "field": "palletCode", "type": "text" }, |
| | | { "title": "ä»»å¡ç±»å", "field": "taskType", "type": "select", dataKey: "TaskType", data: [], hidden: true }, |
| | | { "title": "ä»»å¡ç±»å", "field": "taskType", "type": "select", dataKey: "TaskType", data: [] }, |
| | | { "title": "ä»»å¡ç¶æ", "field": "taskState", "type": "select", dataKey: "TaskStatus", data: [] }, |
| | | |
| | | ], |
| | |
| | | public static async Task<string> GetAsync(string url, Dictionary<string, object> parameters) |
| | | { |
| | | // è®°å½è¯·æ±åæ° |
| | | LogRequestParameters(parameters); |
| | | LogRequestParameters(parameters, url); |
| | | |
| | | // å°åæ°æ¼æ¥å°URLä¸ |
| | | string queryString = string.Join("&", parameters.Select(x => $"{x.Key}={x.Value}")); |
| | |
| | | string responseBody = await response.Content.ReadAsStringAsync(); |
| | | |
| | | // è®°å½ååºåæ° |
| | | LogResponseParameters(responseBody); |
| | | LogResponseParameters(responseBody, url); |
| | | |
| | | // è¿åååºå
容 |
| | | return responseBody; |
| | |
| | | public static async Task<string> PostAsync(string url, Dictionary<string, object> parameters) |
| | | { |
| | | // è®°å½è¯·æ±åæ° |
| | | LogRequestParameters(parameters); |
| | | LogRequestParameters(parameters, url); |
| | | |
| | | // å建HttpClientå®ä¾ |
| | | using (HttpClient client = new HttpClient()) |
| | |
| | | string responseBody = await response.Content.ReadAsStringAsync(); |
| | | |
| | | // è®°å½ååºåæ° |
| | | LogResponseParameters(responseBody); |
| | | LogResponseParameters(responseBody, url); |
| | | |
| | | // è¿åååºå
容 |
| | | return responseBody; |
| | | } |
| | | } |
| | | |
| | | private static void LogRequestParameters(Dictionary<string, object> parameters) |
| | | private static void LogRequestParameters(Dictionary<string, object> parameters,string url = "") |
| | | { |
| | | LogFactory.GetLog("APIæ¥å£").Info(true, "请æ±åæ°: " + JsonConvert.SerializeObject(parameters)); |
| | | LogFactory.GetLog("APIæ¥å£").Info(true, "url:" + url + "请æ±åæ°: " + JsonConvert.SerializeObject(parameters)); |
| | | } |
| | | |
| | | private static void LogResponseParameters(string responseBody) |
| | | private static void LogResponseParameters(string responseBody, string url = "") |
| | | { |
| | | LogFactory.GetLog("APIæ¥å£").Info(true, "ååºåæ°: " + responseBody); |
| | | LogFactory.GetLog("APIæ¥å£").Info(true, "url:" + url + "ååºåæ°: " + responseBody); |
| | | } |
| | | |
| | | private static IEnumerable<KeyValuePair<string, string>> ConvertToKeyValuePairs(Dictionary<string, object> parameters) |
| | |
| | | /// </summary> |
| | | [Description("空æçå
¥åº")] |
| | | InTray = 204, |
| | | |
| | | /// <summary> |
| | | /// NGå
¥åº |
| | | /// </summary> |
| | | [Description("NGå
¥åº")] |
| | | InNG = 105, |
| | | } |
| | | |
| | | public enum TaskOutboundTypeEnum |
| | |
| | | .InterceptedBy(cacheType.ToArray()); |
| | | |
| | | |
| | | foreach (var assembly in assemblyList) |
| | | { |
| | | foreach (var type in assembly.GetTypes()) |
| | | { |
| | | if (!type.IsInterface && !type.IsAbstract && baseType.IsAssignableFrom(type)) |
| | | { |
| | | Console.WriteLine($"注åç±»å: {type.FullName}"); |
| | | } |
| | | } |
| | | } |
| | | //foreach (var assembly in assemblyList) |
| | | //{ |
| | | // foreach (var type in assembly.GetTypes()) |
| | | // { |
| | | // if (!type.IsInterface && !type.IsAbstract && baseType.IsAssignableFrom(type)) |
| | | // { |
| | | // Console.WriteLine($"注åç±»å: {type.FullName}"); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | builder.RegisterType<UnitOfWorkManage>().As<IUnitOfWorkManage>() |
| | | .AsImplementedInterfaces() |
| | |
| | | /// <summary> |
| | | /// åæ° |
| | | /// </summary> |
| | | public List<ParameterInfo> ParameterInfo { get; set; } |
| | | public List<ParameterInfoOutput> ParameterInfo { get; set; } |
| | | } |
| | | |
| | | public class ParameterInfo |
| | | public class ParameterInfoOutput |
| | | { |
| | | /// <summary> |
| | | /// åæ°ç¼ç |
| | |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | public string TrayBarcode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¼ ç±»å |
| | | /// </summary> |
| | | public string SceneType { get; set; } = "4"; |
| | | } |
| | |
| | | /// åä½ |
| | | /// </summary> |
| | | public string UomCode { get; set; } |
| | | |
| | | public List<ParameterInfo> ParameterInfos { get; set; } |
| | | } |
| | | |
| | | public class ParameterInfo |
| | | { |
| | | /// <summary> |
| | | /// åæ°ç±»å屿§ï¼å¯¹åº "ParameterType" |
| | | /// </summary> |
| | | public string ParameterType { get; set; } |
| | | /// <summary> |
| | | /// ç®æ å¼å±æ§ï¼å¯¹åº "TargetValue" |
| | | /// </summary> |
| | | public string TargetValue { get; set; } |
| | | /// <summary> |
| | | /// åä½ä»£ç 屿§ï¼å¯¹åº "UOMCode" |
| | | /// </summary> |
| | | public string UOMCode { get; set; } |
| | | /// <summary> |
| | | /// 䏿§å¶é屿§ï¼å¯¹åº "UpperControlLimit" |
| | | /// </summary> |
| | | public string UpperControlLimit { get; set; } |
| | | /// <summary> |
| | | /// 䏿§å¶é屿§ï¼å¯¹åº "LowerControlLimit" |
| | | /// </summary> |
| | | public string LowerControlLimit { get; set; } |
| | | /// <summary> |
| | | /// ä¸è§æ ¼é屿§ï¼å¯¹åº "UpperSpecificationsLimit" |
| | | /// </summary> |
| | | public string UpperSpecificationsLimit { get; set; } |
| | | /// <summary> |
| | | /// ä¸è§æ ¼é屿§ï¼å¯¹åº "LowerSpecificationsLimit" |
| | | /// </summary> |
| | | public string LowerSpecificationsLimit { get; set; } |
| | | /// <summary> |
| | | /// 设å¤å¯ç¨æ§æ å¿å±æ§ï¼å¯¹åº "EquipmentAvailabilityFlag" |
| | | /// </summary> |
| | | public bool EquipmentAvailabilityFlag { get; set; } |
| | | /// <summary> |
| | | /// æè¿°å±æ§ï¼å¯¹åº "Description" |
| | | /// </summary> |
| | | public string Description { get; set; } |
| | | /// <summary> |
| | | /// åæ°çæ¬å±æ§ï¼å¯¹åº "ParamVersion" |
| | | /// </summary> |
| | | public string ParamVersion { get; set; } |
| | | /// <summary> |
| | | /// 忰代ç 屿§ï¼å¯¹åº "ParameterCode" |
| | | /// </summary> |
| | | public string ParameterCode { get; set; } |
| | | } |
| | | } |
| | |
| | | public DateTime? OutboundTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ°ä¿¡æ¯ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åæ°ä¿¡æ¯")] |
| | | public string ParameterInfos { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "åºåç¶æ")] |
| | | public int StockStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåæç» |
| | | /// </summary> |
| | | [SugarColumn(ColumnName = "StockInfoDetails")] |
| | |
| | | namespace WIDESEA_StorageBasicService; |
| | |  |
| | | namespace WIDESEA_StorageBasicService; |
| | | |
| | | public class StockInfoService : ServiceBase<DtStockInfo, IStockInfoRepository>, IStockInfoService |
| | | { |
| | | public StockInfoService(IStockInfoRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public override PageGridData<DtStockInfo> GetPageData(PageDataOptions options) |
| | | { |
| | | var data = base.GetPageData(options); |
| | | foreach (var item in data.Rows) |
| | | { |
| | | item.Remark = item.StockInfoDetails.Count().ToString(); |
| | | } |
| | | return data; |
| | | } |
| | | } |
| | |
| | | using Mapster; |
| | | using Masuit.Tools; |
| | | using Masuit.Tools.Models; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_DTO.MOM; |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_IStorageBasicRepository; |
| | |
| | | { |
| | | throw new Exception("æªæ¾å°å¯¹åºçåºåºä¿¡æ¯"); |
| | | } |
| | | |
| | | var parameterInfo = JsonConvert.DeserializeObject<List<ParameterInfo>>(stock.ParameterInfos).FirstOrDefault(y => y.Description.Contains("æ¶é´")); |
| | | if (parameterInfo == null) throw new Exception(""); |
| | | |
| | | var outHours = (DateTime.Now - stock.OutboundTime.Value).TotalHours; |
| | | var isNG = outHours > parameterInfo.LowerSpecificationsLimit.ToDouble() && outHours < parameterInfo.UpperSpecificationsLimit.ToDouble(); |
| | | |
| | | return new AgingOutputDto |
| | | { |
| | | OpFlag = 1, |
| | |
| | | SlotNo = x.OrderNo.ToInt32(), |
| | | SerialNo = x.SerialNumber, |
| | | SerialNoResult = true, |
| | | ParameterInfo = new List<ParameterInfo> { new ParameterInfo() { Value = (DateTime.Now - stock.CreateDate).TotalMinutes.ToString() } } |
| | | //ParameterInfo = info.ParameterInfo.Select(y => new ParameterInfo() |
| | | //{ |
| | | // LowerLomit = y.LowerControlLimit, |
| | | // UpperLimit = y.UpperControlLimit, |
| | | // ParameterResult = y.EquipmentAvailabilityFlag, |
| | | // ParameterCode = y.ParameterCode, |
| | | // ParameterDesc = y.Description, |
| | | // TargetValue = y.TargetValue, |
| | | // Value = (DateTime.Parse(stock.LinedProcessFeedbackTime, null, System.Globalization.DateTimeStyles.RoundtripKind).ToLocalTime() - stock.CreateDate).TotalMinutes.ToString(), |
| | | // DefectCode = y.UOMCode |
| | | //}).ToList() |
| | | ParameterInfo = new List<ParameterInfoOutput> { |
| | | new ParameterInfoOutput() { |
| | | Value = outHours.ToString(), |
| | | ParameterCode =parameterInfo.ParameterCode, |
| | | ParameterDesc = parameterInfo.Description, |
| | | ParameterResult = isNG.ToString(), |
| | | TargetValue = parameterInfo.TargetValue, |
| | | LowerLomit = parameterInfo.LowerSpecificationsLimit, |
| | | UpperLimit = parameterInfo.UpperSpecificationsLimit, |
| | | } |
| | | } |
| | | }).ToList() |
| | | }; |
| | | } |
| | |
| | | private (DtLocationInfo, Dt_Task) UpdateStockAndTaskStatus(DtStockInfo stock, Dt_Task task) |
| | | { |
| | | var location = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | var details = _stockInfoDetailRepository.QueryData(x => x.StockId == stock.Id); |
| | | //var details = _stockInfoDetailRepository.QueryData(x => x.StockId == stock.Id); |
| | | |
| | | location.LocationStatus = (int)LocationEnum.Free; |
| | | task.TaskState = (int)TaskOutStatusEnum.OutFinish; |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.InNG) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.SC_InFinish; |
| | | // å建åå²ä»»å¡å®ä¾æ¨¡å |
| | | var taskHtyNG = CreateHistoricalTask(task); |
| | | |
| | | // æ§è¡æ°æ®åºäºå¡ |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | |
| | | // æ·»å åå²ä»»å¡ |
| | | var isTaskHtyAdd = await _task_HtyRepository.AddDataAsync(taskHtyNG) > 0; |
| | | |
| | | // å é¤ä»»å¡æ°æ® |
| | | var isTaskDelete = await Delete(task.TaskId); |
| | | if (!isTaskHtyAdd || !isTaskDelete) |
| | | throw new Exception("æ·»å 失败"); |
| | | }); |
| | | return content.OK("å
¥åºä»»å¡å®ææå"); |
| | | } |
| | | |
| | | // è·åè£
箱信æ¯åç®æ ä½ç½®ä¿¡æ¯ |
| | | var boxing = await _boxingInfoRepository.QueryFirstNavAsync(x => x.PalletCode == task.PalletCode); |
| | | var locationInf = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress); |
| | |
| | | LocationId = loation.Id, |
| | | StockInfoDetails = boxDetail, |
| | | }; |
| | | if (!task.Roadway.Contains("FR")) //éå容åºåºå䏿¥MOMåºå
¥ç« |
| | | |
| | | // å¤ç请æ±åæ° |
| | | AgingInputDto agingInputDto = new AgingInputDto() |
| | | { |
| | | // å¤ç请æ±åæ° |
| | | AgingInputDto agingInputDto = new AgingInputDto() |
| | | { |
| | | SerialNos = boxing.BoxingInfoDetails |
| | | .Select(item => new SerialNoInDto { SerialNo = item.SerialNumber, PositionNo = item.OrderNo }) |
| | | .ToList(), |
| | | TrayBarcode = task.PalletCode, |
| | | OpFlag = 1, |
| | | EquipmentCode = area.Spare2, |
| | | Software = area.Spare3 |
| | | }; |
| | | var result = _agingInOrOutInputService.GetOCVInputAsync(agingInputDto).Result; |
| | | var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.Data.ToString()); |
| | | stock.LinedProcessFeedbackTime = respone.LinedProcessFeedbackTime; |
| | | stock.SpecialParameterDuration = respone.SpecialParameterDuration; |
| | | //2024å¹´11æ16æ¥ï¼æ°å¢å段计ç®åºåºåºæ¶é´ |
| | | stock.OutboundTime = Convert.ToDateTime(respone.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(respone.SpecialParameterDuration)); |
| | | stock.ProductionLine = respone.ProductionLine; |
| | | } |
| | | SerialNos = boxing.BoxingInfoDetails |
| | | .Select(item => new SerialNoInDto { SerialNo = item.SerialNumber, PositionNo = item.OrderNo }) |
| | | .ToList(), |
| | | TrayBarcode = task.PalletCode, |
| | | OpFlag = 1, |
| | | EquipmentCode = area.Spare2, |
| | | Software = area.Spare3 |
| | | }; |
| | | var result = _agingInOrOutInputService.GetOCVInputAsync(agingInputDto).Result; |
| | | var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.Data.ToString()); |
| | | stock.LinedProcessFeedbackTime = respone.LinedProcessFeedbackTime; |
| | | stock.SpecialParameterDuration = respone.SpecialParameterDuration; |
| | | //2024å¹´11æ16æ¥ï¼æ°å¢å段计ç®åºåºåºæ¶é´ |
| | | stock.OutboundTime = Convert.ToDateTime(respone.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(respone.SpecialParameterDuration)); |
| | | stock.ProductionLine = respone.ProductionLine; |
| | | stock.ParameterInfos = respone.ParameterInfos.ToJsonString(); |
| | | stock.StockStatus = 1; |
| | | |
| | | // è®°å½æ¥å¿ |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "å
¥åºä»»å¡å®æ", $"è´§ä½å°åï¼{task.TargetAddress},ä¿®æ¹åè´§ä½æ°æ®ï¼{locationInf}"); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | var stock = await _stockInfoRepository.QueryFirstNavAsync(x => x.PalletCode == input.PalletCode && x.IsFull); |
| | | if (stock != null) |
| | | { |
| | | // TODOè´¨æ£ååº |
| | | } |
| | | |
| | | var area = await _areaInfoRepository.QueryFirstAsync(x => x.Spare1.Contains(input.Position)); |
| | | if (area == null) |
| | | return content.Error("æ¹ç¹ä½ä¸å¨åºåå表ä¸åå¨"); |
| | |
| | | // æ·»å ç»çä¿¡æ¯ |
| | | // å°content.Data转æ¢ä¸ºResultTrayCellsStatus对象 |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | if (result.SerialNos.Count <= 0) |
| | | if (!result.Success) |
| | | return content.Error(result.MOMMessage); |
| | | |
| | | // è·åå¼å¸¸çµè¯ |
| | | var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1).ToList(); |
| | | if (serialNosError.Count > 0) |
| | | { |
| | | // TODO å建任å¡éè³NGæåºå£ |
| | | List<string> NGStation = input.Position == "1088" ? new List<string>() { "1020" } : new List<string>() { "JZSC01" }; |
| | | content = await CreateNewTask(input, NGStation, 2); |
| | | return content.Error("åå¨å¼å¸¸çµè¯"); |
| | | } |
| | | |
| | | if (result.SerialNos.Count <= 0) |
| | | { |
| | | // Todo 空æçå
¥åºé»è¾ |
| | | content = await RequestTrayInTaskAsync(input); |
| | | return content; |
| | | } |
| | | |
| | | // TODO è·åæ¬å°ææ¡å±æ§ä¸æ´ççµè¯å±æ§è·åçå¼è¿è¡å¯¹æ¯ï¼å¦æä¸è´åç»§ç»ï¼å¦åè¿åéè¯¯ä¿¡æ¯ |
| | | //var productions = await _productionRepository.QueryDataAsync(x => result.TrayBarcodePropertys.Select(x => x.TrayBarcodeProperty).ToList().Contains(x.TrayBarcodeProperty)); |
| | |
| | | List<string> strings = input.Position == "1016" ? new List<string>() { "CHSC01" } : new List<string>() { "JZSC01" }; |
| | | |
| | | return await CreateNewTask(input, strings, 1); |
| | | //return await CreateNewTask(input, null, 1); |
| | | } |
| | | catch (Exception) |
| | | { |
| | |
| | | SerialNo = item.SerialNo |
| | | }).ToList() |
| | | }; |
| | | } |
| | | |
| | | // è·åå·¥èºååº |
| | | private async Task<List<Dt_EquipmentProcess>> GetProcessResponseAsync(ProcessApplyDto process, string position) |
| | | { |
| | | // 妿process为nullï¼åè¿ånull |
| | | if (process == null) return null; |
| | | |
| | | // è°ç¨_processApplyService.GetProcessApplyAsyncæ¹æ³ï¼è·åå·¥èºç³è¯· |
| | | WebResponseContent content = await _processApplyService.GetProcessApplyAsync(process); |
| | | // å¦æç¶æä¸ºfalseï¼åè¿ånull |
| | | if (!content.Status) return null; |
| | | |
| | | // å°content.Data转æ¢ä¸ºResultProcessApply对象 |
| | | var apply = JsonConvert.DeserializeObject<ResultProcessApply>(content.Data.ToString()); |
| | | // æ ¹æ®positionçå¼ï¼è¿åä¸åçDt_EquipmentProcesså表 |
| | | switch (position) |
| | | { |
| | | case "1088": |
| | | return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>() |
| | | .Where(x => x.EquipmentType == "éå" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo) |
| | | .ToList(); |
| | | |
| | | case "1339": |
| | | case "1406": |
| | | return SqlSugarHelper.Db.Queryable<Dt_EquipmentProcess>() |
| | | .Where(x => x.EquipmentType == "éç½®" && x.WipOrderNo == apply.WipOrderNo || x.ProductDesc == apply.ProductNo) |
| | | .ToList(); |
| | | |
| | | default: |
| | | return new List<Dt_EquipmentProcess>(); |
| | | } |
| | | } |
| | | |
| | | #endregion 请æ±ä»»å¡å
¥åº |
| | |
| | | if (task == null) |
| | | return content.Error("æªæ¾å°ä»»å¡"); |
| | | |
| | | if (taskState == (int)TaskOutStatusEnum.Line_OutFinish || taskState == (int)TaskOutStatusEnum.SC_OutFinish) |
| | | if (taskState == (int)TaskOutStatusEnum.Line_OutFinish || taskState == (int)TaskInStatusEnum.SC_InFinish) |
| | | { |
| | | var taskHty = CreateHistoricalTask(task); |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | |
| | | /// <param name="taskHty">åå²ä»»å¡å¯¹è±¡</param> |
| | | /// <param name="taskId">ä»»å¡ID</param> |
| | | /// <returns></returns> |
| | | private async Task<bool> ExecuteTransaction(DtStockInfo stock, Dt_Task_Hty taskHty, DtLocationInfo locationInfo, int taskId) |
| | | private async Task<bool> ExecuteTransaction(DtStockInfo stock, Dt_Task_Hty taskHty, DtLocationInfo locationInfo, int taskId, DtBoxingInfo boxingInfo = null) |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | try |
| | | { |
| | | var isUpdateStock = true; |
| | | var isDeleteBoxing = true; |
| | | if (taskHty.TaskType == (int)TaskTypeEnum.Outbound) |
| | | { |
| | | // æ´æ°åºå |
| | |
| | | { |
| | | // æ·»å åºå |
| | | isUpdateStock = await _stockInfoRepository.AddDataNavAsync(stock); |
| | | isDeleteBoxing = await _boxingInfoRepository.Db.DeleteNav<DtBoxingInfo>(x => x.Id == boxingInfo.Id) |
| | | .Include(x => x.BoxingInfoDetails) |
| | | .ExecuteCommandAsync(); |
| | | } |
| | | |
| | | |
| | |
| | | var isTaskDelete = await Delete(taskId); |
| | | |
| | | // æäº¤æåæ»äºå¡ |
| | | if (isUpdateStock && isTaskHtyAdd && isTaskDelete && isUpdateLoc) |
| | | if (isUpdateStock && isTaskHtyAdd && isTaskDelete && isUpdateLoc && isDeleteBoxing) |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "ä»»å¡å®æ", $"äºå¡å¤ç宿,æäº¤äºå¡ãæ·»å åå²ä»»å¡ï¼{isTaskHtyAdd},å é¤ä»»å¡æ°æ®ï¼{isTaskDelete},æ´æ°ææ·»å åºåï¼{isUpdateStock},ä¿®æ¹ç§»åºåè´§ä½ç¶æï¼{isUpdateLoc}"); |
| | | _unitOfWorkManage.CommitTran(); |
| | |
| | | } |
| | | catch (Exception err) |
| | | { |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, $"ç§»åºä»»å¡å®æ,ç³»ç»å¼å¸¸ï¼å¼å¸¸ä¿¡æ¯ï¼{err.Message}", "æ åæ°"); |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, $"ä»»å¡å®æ,ç³»ç»å¼å¸¸ï¼å¼å¸¸ä¿¡æ¯ï¼{err.Message}", "æ åæ°"); |
| | | _unitOfWorkManage.RollbackTran(); |
| | | throw; // æåºå¼å¸¸ä»¥ä¾¿å¤é¨æè· |
| | | } |
| | |
| | | |
| | | #region ä»»å¡è¯·æ±æ¹æ³ |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ç°æä»»å¡ |
| | | /// </summary> |
| | | /// <param name="input">è¯·æ±æ¨¡å</param> |
| | | /// <param name="areaId">åºåID</param> |
| | | /// <param name="task">ä»»å¡å®ä¾</param> |
| | | /// <param name="content">ååºå
容</param> |
| | | /// <returns></returns> |
| | | // æ´æ°ä»»å¡è´§ä½ |
| | | |
| | | private async Task<WebResponseContent> UpdateExistingTask(RequestTaskDto input, Dt_Task task) |
| | | { |
| | | // å建WebResponseContent对象 |
| | | WebResponseContent content = new WebResponseContent(); |
| | | // å®ä¹åé |
| | | string toAddress; |
| | | int taskState; |
| | | string original = task.CurrentAddress; |
| | | DtLocationInfo location = new DtLocationInfo(); |
| | | int beforeStatus = 0; |
| | | if (task == null) |
| | | { |
| | | return new WebResponseContent().Error("ä»»å¡å¯¹è±¡ä¸ºç©º"); |
| | | } |
| | | |
| | | // å¤çå
¥åºä»»å¡ |
| | | location = await GetLocationDistributeAsync(task.Roadway); |
| | | toAddress = location.LocationCode; |
| | | taskState = (int)TaskInStatusEnum.Line_InFinish; |
| | | beforeStatus = location.LocationStatus; |
| | | try |
| | | { |
| | | // å建WebResponseContent对象 |
| | | var content = new WebResponseContent(); |
| | | |
| | | // æ´æ°è´§ä½ä¿¡æ¯ |
| | | location.LocationStatus = (int)LocationEnum.Lock; |
| | | // è·åç®æ å°ååæ´æ°ä»»å¡ç¶æ |
| | | if (task.TaskType == (int)TaskInboundTypeEnum.InNG) |
| | | { |
| | | // TODO æ ¹æ®å··éæ¥æ¾å¯¹åºNGå£ï¼ç°å¨é»è®¤å»éç½®å åæºçå¼å¸¸å£è´§ä½å· |
| | | task.CurrentAddress = input.Position; |
| | | task.TargetAddress = "002-021-000"; |
| | | task.NextAddress = "002-021-000"; |
| | | task.TaskState = (int)TaskInStatusEnum.Line_InFinish; |
| | | bool isResult = await BaseDal.UpdateDataAsync(task); |
| | | return content.OK(data: task); |
| | | } |
| | | else |
| | | { |
| | | var location = await GetLocationDistributeAsync(task.Roadway); |
| | | if (location == null) |
| | | { |
| | | return content.Error("æ æ³è·åè´§ä½ä¿¡æ¯"); |
| | | } |
| | | |
| | | // æ´æ°ä»»å¡ä¿¡æ¯ |
| | | string toAddress = location.LocationCode; |
| | | int taskState = (int)TaskInStatusEnum.Line_InFinish; |
| | | int beforeStatus = location.LocationStatus; |
| | | // æ´æ°è´§ä½ä¿¡æ¯ |
| | | location.LocationStatus = (int)LocationEnum.Lock; |
| | | |
| | | // æ´æ°ä»»å¡ä¿¡æ¯ |
| | | MapTaskProperties(task, input, toAddress, taskState); |
| | | |
| | | // å¼å§äºå¡ |
| | | var isResult = await UpdateTaskAsync(task, location, beforeStatus); |
| | | if (!isResult) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error("æ´æ°ä»»å¡å¤±è´¥"); |
| | | } |
| | | |
| | | // æäº¤äºå¡ |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content.OK(data: task); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // åæ»äºå¡ |
| | | _unitOfWorkManage.RollbackTran(); |
| | | // è¿éå¯ä»¥æ·»å æ¥å¿è®°å½ |
| | | return new WebResponseContent().Error($"æ´æ°ä»»å¡æ¶åçé误: {ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | private void MapTaskProperties(Dt_Task task, RequestTaskDto input, string toAddress, int taskState) |
| | | { |
| | | task.CurrentAddress = input.Position; |
| | | task.TargetAddress = toAddress; |
| | | task.NextAddress = toAddress; |
| | | task.TaskState = taskState; |
| | | } |
| | | |
| | | // å¼å§äºå¡ |
| | | _unitOfWorkManage.BeginTran(); |
| | | // å®ä¹åé |
| | | bool isUpdateLo = true; |
| | | bool isUpdateChange = true; |
| | | |
| | | // å°è¯æ´æ°ä»»å¡ |
| | | // ä¿®æ¹ä»»å¡ |
| | | private async Task<bool> UpdateTaskAsync(Dt_Task task, DtLocationInfo location, int beforeStatus) |
| | | { |
| | | bool isResult = await BaseDal.UpdateDataAsync(task); |
| | | bool isTaskDetail = await _taskExecuteDetailRepository.AddDetailAsync(task, false, TaskDescription.GetTaskUpdateDescription(task.PalletCode, original, input.Position, TaskInStatusEnum.Line_InFinish.GetIntegralRuleTypeEnumDesc())); |
| | | bool isTaskDetail = await _taskExecuteDetailRepository.AddDetailAsync(task, false, TaskDescription.GetTaskUpdateDescription(task.PalletCode, task.CurrentAddress, task.TargetAddress, TaskInStatusEnum.Line_InFinish.GetIntegralRuleTypeEnumDesc())); |
| | | |
| | | // å建LocationChangeRecordDto对象 |
| | | LocationChangeRecordDto changeRecordDto = new LocationChangeRecordDto() |
| | | { |
| | | // 设置åé |
| | | AfterStatus = location.LocationStatus, |
| | | BeforeStatus = beforeStatus, |
| | | TaskNum = task.TaskNum.Value, |
| | |
| | | LocationCode = location.LocationCode, |
| | | ChangeType = (int)StatusChangeTypeEnum.AutomaticStorage, |
| | | }; |
| | | // æ´æ°ä½ç½®ç¶æ |
| | | isUpdateChange = _locationStatusChangeRecordRepository.AddStatusChangeRecord(changeRecordDto); |
| | | isUpdateLo = await _locationRepository.UpdateDataAsync(location); |
| | | |
| | | if (isResult && isUpdateLo && isTaskDetail) |
| | | { |
| | | // æäº¤äºå¡ |
| | | _unitOfWorkManage.CommitTran(); |
| | | content.OK(data: task); |
| | | } |
| | | else |
| | | { |
| | | // åæ»äºå¡ |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error("æ´æ°ä»»å¡å¤±è´¥"); |
| | | } |
| | | return content; |
| | | bool isUpdateChange = _locationStatusChangeRecordRepository.AddStatusChangeRecord(changeRecordDto); |
| | | bool isUpdateLo = await _locationRepository.UpdateDataAsync(location); |
| | | |
| | | return isResult && isUpdateLo && isTaskDetail; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | // è·åç®æ å°å |
| | | //string ToAddress = await GetRoadWayAsync(process); |
| | | string ToAddress = await GetRoadWayAsync(input, process); |
| | | string ToAddress = string.Empty; |
| | | if (flag != 2) |
| | | ToAddress = await GetRoadWayAsync(input, process); |
| | | else |
| | | ToAddress = process[0]; |
| | | |
| | | // å建æ°ä»»å¡å®ä¾ |
| | | var task = new Dt_Task |
| | |
| | | PalletCode = input.PalletCode, |
| | | SourceAddress = input.Position, |
| | | TaskState = (int)TaskInStatusEnum.InNew, |
| | | TaskType = flag == 0 ? (int)TaskInboundTypeEnum.Inbound : (int)TaskInboundTypeEnum.InTray, |
| | | TaskType = flag == 0 ? (int)TaskInboundTypeEnum.Inbound : flag == 1 ? (int)TaskInboundTypeEnum.InTray : (int)TaskInboundTypeEnum.InNG, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | }; |
| | |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = task.SourceAddress, |
| | | TargetAddress = task.Roadway, |
| | | TargetAddress = task.TargetAddress, |
| | | TaskState = task.TaskState.Value, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |