| | |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_IPackInfoService; |
| | | <<<<<<< HEAD |
| | | ======= |
| | | using WIDESEAWCS_IBasicInfoRepository; |
| | | |
| | | >>>>>>> main |
| | | |
| | | namespace WIDESEAWCS_PackInfoService |
| | | { |
| | | public class PackaxisService : ServiceBase<Dt_Packaxis, IPackaxisRepository>, IPackaxisService |
| | | { |
| | | <<<<<<< HEAD |
| | | public PackaxisService(IPackaxisRepository BaseDal) : base(BaseDal) |
| | | { |
| | | ======= |
| | | } |
| | | private readonly IPackTypeRepository _packTypeRepository; |
| | | private readonly IStationMangerRepository _stationMangerRepository; |
| | | public PackaxisService(IPackaxisRepository BaseDal, IPackTypeRepository packTypeRepository, IStationMangerRepository stationMangerRepository) : base(BaseDal) |
| | | { |
| | | _packTypeRepository = packTypeRepository; |
| | | _stationMangerRepository = stationMangerRepository; |
| | | >>>>>>> main |
| | | } |
| | | public override WebResponseContent Import(List<IFormFile> files) |
| | | { |
| | |
| | | using (ImportExcelHelper excelHelper = new ImportExcelHelper(fullPath)) |
| | | { |
| | | dtExcel = excelHelper.ExcelToDataTable(); |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> main |
| | | } |
| | | List<Dt_Packaxis> addAxis = new List<Dt_Packaxis>(); |
| | | List<Dt_Packaxis> updateAxis = new List<Dt_Packaxis>(); |
| | |
| | | string AxisZCount = row["AxisZCount"]?.ToString() ?? string.Empty; |
| | | string AxisZSpacing = row["AxisZSpacing"]?.ToString() ?? string.Empty; |
| | | var axis = BaseDal.QueryFirst(x => x.DeviceCode == DeviceCode && x.StationCode == StationCode && x.PackType == PackType); |
| | | <<<<<<< HEAD |
| | | if(axis == null) |
| | | ======= |
| | | if (axis == null) |
| | | >>>>>>> main |
| | | { |
| | | Dt_Packaxis packaxis = new Dt_Packaxis() |
| | | if (axis == null) |
| | | { |
| | | DeviceCode = DeviceCode, |
| | | StationCode = StationCode, |
| | | PackType = PackType, |
| | | PackNum = Convert.ToInt32(PackNum), |
| | | AxisX = Convert.ToInt32(AxisX), |
| | | AxisXCount = Convert.ToInt32(AxisXCount), |
| | | AxisXSpacing = Convert.ToInt32(AxisXSpacing), |
| | | AxisY = Convert.ToInt32(AxisY), |
| | | AxisYCount = Convert.ToInt32(AxisYCount), |
| | | AxisYSpacing = Convert.ToInt32(AxisYSpacing), |
| | | AxisZ = Convert.ToInt32(AxisZ), |
| | | AxisZCount = Convert.ToInt32(AxisZCount), |
| | | AxisZSpacing = Convert.ToInt32(AxisZSpacing), |
| | | Creater = App.User.UserId > 0 ? App.User.UserName : "System", |
| | | CreateDate = DateTime.Now |
| | | }; |
| | | addAxis.Add(packaxis); |
| | | } |
| | | else |
| | | { |
| | | axis.DeviceCode = DeviceCode; |
| | | axis.StationCode = StationCode; |
| | | axis.PackType = PackType; |
| | | axis.PackNum = Convert.ToInt32(PackNum); |
| | | axis.AxisX = Convert.ToInt32(AxisX); |
| | | axis.AxisXCount = Convert.ToInt32(AxisXCount); |
| | | axis.AxisXSpacing = Convert.ToInt32(AxisXSpacing); |
| | | axis.AxisY = Convert.ToInt32(AxisY); |
| | | axis.AxisYCount = Convert.ToInt32(AxisYCount); |
| | | axis.AxisYSpacing = Convert.ToInt32(AxisYSpacing); |
| | | axis.AxisZ = Convert.ToInt32(AxisZ); |
| | | axis.AxisZCount = Convert.ToInt32(AxisZCount); |
| | | axis.AxisZSpacing = Convert.ToInt32(AxisZSpacing); |
| | | axis.Modifier = App.User.UserId > 0 ? App.User.UserName : "System"; |
| | | axis.ModifyDate = DateTime.Now; |
| | | updateAxis.Add(axis); |
| | | } |
| | | Dt_Packaxis packaxis = new Dt_Packaxis() |
| | | { |
| | | DeviceCode = DeviceCode, |
| | | StationCode = StationCode, |
| | | PackType = PackType, |
| | | PackNum = Convert.ToInt32(PackNum), |
| | | AxisX = Convert.ToInt32(AxisX), |
| | | AxisXCount = Convert.ToInt32(AxisXCount), |
| | | AxisXSpacing = Convert.ToInt32(AxisXSpacing), |
| | | AxisY = Convert.ToInt32(AxisY), |
| | | AxisYCount = Convert.ToInt32(AxisYCount), |
| | | AxisYSpacing = Convert.ToInt32(AxisYSpacing), |
| | | AxisZ = Convert.ToInt32(AxisZ), |
| | | AxisZCount = Convert.ToInt32(AxisZCount), |
| | | AxisZSpacing = Convert.ToInt32(AxisZSpacing), |
| | | Creater = App.User.UserId > 0 ? App.User.UserName : "System", |
| | | CreateDate = DateTime.Now |
| | | }; |
| | | addAxis.Add(packaxis); |
| | | } |
| | | else |
| | | { |
| | | axis.DeviceCode = DeviceCode; |
| | | axis.StationCode = StationCode; |
| | | axis.PackType = PackType; |
| | | axis.PackNum = Convert.ToInt32(PackNum); |
| | | axis.AxisX = Convert.ToInt32(AxisX); |
| | | axis.AxisXCount = Convert.ToInt32(AxisXCount); |
| | | axis.AxisXSpacing = Convert.ToInt32(AxisXSpacing); |
| | | axis.AxisY = Convert.ToInt32(AxisY); |
| | | axis.AxisYCount = Convert.ToInt32(AxisYCount); |
| | | axis.AxisYSpacing = Convert.ToInt32(AxisYSpacing); |
| | | axis.AxisZ = Convert.ToInt32(AxisZ); |
| | | axis.AxisZCount = Convert.ToInt32(AxisZCount); |
| | | axis.AxisZSpacing = Convert.ToInt32(AxisZSpacing); |
| | | axis.Modifier = App.User.UserId > 0 ? App.User.UserName : "System"; |
| | | axis.ModifyDate = DateTime.Now; |
| | | updateAxis.Add(axis); |
| | | } |
| | | } |
| | | BaseDal.AddData(addAxis); |
| | | BaseDal.UpdateData(updateAxis); |
| | |
| | | |
| | | return content; |
| | | } |
| | | <<<<<<< HEAD |
| | | ======= |
| | | /// <summary> |
| | | /// æ·»å åæ æ°æ® |
| | | /// </summary> |
| | |
| | | { |
| | | string json = JsonConvert.SerializeObject(saveModel.MainData); |
| | | Dt_Packaxis dt_Pack = JsonConvert.DeserializeObject<Dt_Packaxis>(json); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == dt_Pack.StationCode && x.StackerCraneCode == dt_Pack.DeviceCode); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == dt_Pack.StationCode && x.StackerCraneCode == dt_Pack.DeviceCode); |
| | | Dt_PackType packTyp = _packTypeRepository.QueryFirst(x => x.Id == dt_Pack.PackType); |
| | | |
| | | int w = 1200;//è¿ä¸ªæ¯ç åæç宽1.2ç±³ |
| | |
| | | |
| | | Dt_Packaxis packaxis = BaseDal.QueryFirst(x => x.DeviceCode == dt_Pack.DeviceCode && x.StationCode == dt_Pack.StationCode && x.PackType == dt_Pack.PackType); |
| | | |
| | | |
| | | |
| | | |
| | | if (packaxis.IsNullOrEmpty()) |
| | | { |
| | | |
| | | |
| | | saveModel.MainData["PackNum"] = dt_Pack.AxisXCount * dt_Pack.AxisYCount * dt_Pack.AxisZCount; |
| | | |
| | | return base.AddData(saveModel); |
| | |
| | | Dt_Packaxis packaxis = BaseDal.QueryFirst(x => x.Id != dt_Pack.Id && x.DeviceCode == dt_Pack.DeviceCode && x.StationCode == dt_Pack.StationCode && x.PackType == dt_Pack.PackType); |
| | | if (packaxis.IsNullOrEmpty()) |
| | | { |
| | | |
| | | |
| | | saveModel.MainData["PackNum"] = dt_Pack.AxisXCount * dt_Pack.AxisYCount * dt_Pack.AxisZCount; |
| | | |
| | | return base.UpdateData(saveModel); |
| | |
| | | return content; |
| | | |
| | | } |
| | | >>>>>>> main |
| | | } |
| | | } |