using System; using System.Collections.Generic; using System.Text; using WIDESEA.Entity.DomainModels; using WIDESEA.Services.Repositories; namespace WIDESEA.Services.Services { public partial class CommonFunction { public static object GetZCInfo(VV_ContainerInfo container, string materiel, string barcode, string fcbAVG, string ydAVG, string zjAVG, string ldCode , string target, string direction) { decimal fcbMes = string.IsNullOrEmpty(fcbAVG) ? 0 : decimal.Parse(fcbAVG); decimal fcbWms = string.IsNullOrEmpty(container.csize_four_3) ? 0 : decimal.Parse(container.csize_four_3); decimal fcbdiff = 0; if (fcbMes != 0 && fcbWms != 0) fcbdiff = fcbMes - fcbWms; decimal ydMes = string.IsNullOrEmpty(ydAVG) ? 0 : decimal.Parse(ydAVG); decimal ydWms = string.IsNullOrEmpty(container.csize_three_3) ? 0 : decimal.Parse(container.csize_three_3); decimal yddiff = 0; if (ydMes != 0 && ydWms != 0) yddiff = ydMes - ydWms; decimal zjMes = string.IsNullOrEmpty(zjAVG) ? 0 : decimal.Parse(zjAVG); decimal zjWms = string.IsNullOrEmpty(container.csize_in_value) ? 0 : decimal.Parse(container.csize_in_value); decimal zjdiff = 0; if (zjMes != 0 && zjWms != 0) zjdiff = zjMes - zjWms; //decimal fcbDiff = ((string.IsNullOrEmpty(fcbAVG) ? 0 : decimal.Parse(fcbAVG)) - (string.IsNullOrEmpty(container.csize_four_3) ? 0 : decimal.Parse(container.csize_four_3))); //decimal ydDiff = ((string.IsNullOrEmpty(ydAVG) ? 0 : decimal.Parse(ydAVG) - (string.IsNullOrEmpty(container.csize_three_3) ? 0 : decimal.Parse(container.csize_three_3)))); //decimal zjdDiff = ((string.IsNullOrEmpty(zjAVG) ? 0 : decimal.Parse(zjAVG) - (string.IsNullOrEmpty(container.csize_in_value) ? 0 : decimal.Parse(container.csize_in_value)))); dt_selectionRecord record = new dt_selectionRecord() { record_barcode = container.containerdtl_barcode, record_createTime = DateTime.Now, record_fcbAVG_diff = fcbdiff, record_fcbAVG_mes = fcbMes, record_fcbAVG_wms = fcbWms, record_id = Guid.NewGuid(), record_ldCode = ldCode, record_ldNumber = barcode, record_locationId = container.location_id, record_madeUnit = container.containerdtl_madeUnit, record_materielId = container.materiel_id, record_materielNumber = container.containerdtl_goodsCode, record_materielType = container.containerdtl_type, record_standa = container.containerdtl_standard, record_userName = Core.ManageUser.UserContext.Current.UserTrueName, record_weight = string.IsNullOrEmpty(container.containerdtl_goodsWeight) ? 0 : decimal.Parse(container.containerdtl_goodsWeight), record_ydAVG_diff = yddiff, record_ydAVG_mes = ydMes, record_ydAVG_wms = ydWms, record_zjAVG_diff = zjdiff, record_zjAVG_mes = zjMes, record_zjAVG_wms = zjWms, record_direction = "left".Equals(direction) ? "左侧" : "右侧", record_outstation = target, record_inboundTime = container.DateDiffResult, record_lotNumber=container.containerdtl_lotNumber==""?"0": container.containerdtl_lotNumber, record_ProductDate=container.containerdtl_ProductDate == "" ? "0" : container.containerdtl_ProductDate }; dt_selectionRecordRepository.Instance.Add(record, true); //object zcInfo = new //{ // mesInfo = new // { // materielId = materiel, // barcode = barcode, // fcbAVG = fcbAVG, // ydAVG = ydAVG, // zjAVG = zjAVG, // //轮对号 // ldCode = ldCode, // }, // wmsInfo = new // { // materielId = container.materiel_id, // barcode = container.containerdtl_barcode, // fcbAVG = record.record_fcbAVG_wms, // fcbDiff = record.record_fcbAVG_diff, // ydAVG = record.record_ydAVG_wms, // ydDiff = record.record_ydAVG_diff, // zjAVG = record.record_zjAVG_wms, // zjdDiff = record.record_zjAVG_diff, // standa = container.containerdtl_standard, // weight = container.containerdtl_goodsWeight, // materielType = container.containerdtl_type, // //轴承编号 // materielNumber = container.containerdtl_number // } //}; //object zcInfo = new //{ // wmsInfo = new List(){ // new // { // name = "托盘号", // value =record.record_barcode, // column2Name="车型", // column2Value=record.record_materielId // }, // new // { // name = "轮对号", // value = ldCode, // column2Name = "轮对编码", // column2Value =barcode, // }, // new // { name = "轴承型号", // value = record.record_materielType, // column2Name = "轴承编码", // column2Value = record.record_materielNumber, // }, // new // { // name = "重量(克)", // value = record.record_weight, // column2Name = "测量标准", // column2Value = record.record_standa, // }, // new // { // name = "轴颈平均值", // value = record.record_zjAVG_mes, // column2Name = "防尘板座平均值", // column2Value = record.record_fcbAVG_mes, // }, // new // { // name = "轴承内径平均值", // value = record.record_zjAVG_wms, // column2Name = "后档平均值", // column2Value =record.record_fcbAVG_wms, // }, // new // { // name = "轴承内径过盈量", // value =record.record_zjAVG_diff, // column2Name = "防尘板座过盈量", // column2Value = record.record_fcbAVG_diff, // }, //} //}; object zcInfo = new { wmsInfo = new List(){ new { name = "轮对号", value = ldCode, }, new{ name = "轴承编号", value = record.record_materielNumber, }, new { name = "轴承类别", value = record.record_standa, }, new { name="轴承内径平均值", value = record.record_zjAVG_wms, }, new { name = "轴承内径过盈量", value = record.record_zjAVG_diff, }, new { name = "重量(克)", value = record.record_weight, } } }; return zcInfo; } } }