| | |
| | | SkuNo: SkuNo, |
| | | SkuName: SkuName, |
| | | IsQualified: IsQualified, |
| | | Origin: 'WMS' |
| | | Origin: '' |
| | | }; |
| | | // console.log(param) |
| | | var url = "/BllQuality/GetBllQualityList"; |
| | |
| | | /// </summary> |
| | | public string lotNo { get; set; } |
| | | } |
| | | |
| | | public class BackAsnVm |
| | | { |
| | | /// <summary> |
| | | /// 防重码 |
| | | /// </summary> |
| | | public string ZUUID { get; set; } |
| | | /// <summary> |
| | | /// 入库单号 |
| | | /// </summary> |
| | | public string VBELN { get; set; } |
| | | /// <summary> |
| | | /// 订单类型:0:成品入库 1:采购入库 3:退货入库 4:余料退回入库 8 :生产退料入库 |
| | | /// </summary> |
| | | public string LFART { get; set; } |
| | | /// <summary> |
| | | /// 入库完成时间 |
| | | /// </summary> |
| | | public string WADAT_IST { get; set; } |
| | | /// <summary> |
| | | /// 入库单明细列表 |
| | | /// </summary> |
| | | public List<BackAsnDetail> ITEM { get; set; } |
| | | } |
| | | public class BackAsnDetail |
| | | { |
| | | /// <summary> |
| | | /// 行编码 |
| | | /// </summary> |
| | | public string POSNR { get; set; } |
| | | /// <summary> |
| | | /// 药品编码 |
| | | /// </summary> |
| | | public string MATNR { get; set; } |
| | | /// <summary> |
| | | /// 药品名称 |
| | | /// </summary> |
| | | public string MAKTX { get; set; } |
| | | /// <summary> |
| | | /// 实收数量 |
| | | /// </summary> |
| | | public string LFIMG { get; set; } |
| | | /// <summary> |
| | | /// 单位 |
| | | /// </summary> |
| | | public string MEINS { get; set; } |
| | | /// <summary> |
| | | /// 批号 |
| | | /// </summary> |
| | | public string CHARG { get; set; } |
| | | /// <summary> |
| | | /// 生产日期 |
| | | /// </summary> |
| | | public string HSDAT { get; set; } |
| | | /// <summary> |
| | | /// 到期日期 |
| | | /// </summary> |
| | | public string VFDAT { get; set; } |
| | | } |
| | | |
| | | public class BackSoVm |
| | | { |
| | | /// <summary> |
| | | /// 防重码 |
| | | /// </summary> |
| | | public string ZUUID { get; set; } |
| | | /// <summary> |
| | | /// 出库单号 |
| | | /// </summary> |
| | | public string VBELN { get; set; } |
| | | /// <summary> |
| | | /// 货主编码 |
| | | /// </summary> |
| | | public string WERKS { get; set; } |
| | | /// <summary> |
| | | /// 出库单类型,单据类型 0:成品出库 1:领料出库 4:不合格品出库 7:其他出库 9 :生产领料出库 |
| | | /// </summary> |
| | | public string LFART { get; set; } |
| | | /// <summary> |
| | | /// 订单完成时间 |
| | | /// </summary> |
| | | public string WADAT_IST { get; set; } |
| | | /// <summary> |
| | | /// 订单明细 |
| | | /// </summary> |
| | | public List<BackSoDetail> ITEM { get; set; } |
| | | } |
| | | public class BackSoDetail |
| | | { |
| | | /// <summary> |
| | | /// 行号 |
| | | /// </summary> |
| | | public string POSNR { get; set; } |
| | | /// <summary> |
| | | /// 药品编码 |
| | | /// </summary> |
| | | public string MATNR { get; set; } |
| | | /// <summary> |
| | | /// 批次号 |
| | | /// </summary> |
| | | public string CHARG { get; set; } |
| | | /// <summary> |
| | | /// 数量 |
| | | /// </summary> |
| | | public string LFIMG { get; set; } |
| | | /// <summary> |
| | | /// 单位 |
| | | /// </summary> |
| | | public string MEINS { get; set; } |
| | | /// <summary> |
| | | /// 生产日期 |
| | | /// </summary> |
| | | public string HSDAT { get; set; } |
| | | /// <summary> |
| | | /// 到期日期 |
| | | /// </summary> |
| | | public string VFDAT { get; set; } |
| | | } |
| | | |
| | | public class SapQualityVm |
| | | { |
| | | public string @operator{ get; set; } |
| | | public SendQualityVm data { get; set; } |
| | | } |
| | | public class SendQualityVm |
| | | { |
| | | /// <summary> |
| | | /// 调整单号 |
| | | /// </summary> |
| | | public string orderNo { get; set; } |
| | | /// <summary> |
| | | /// 调整单明细列表 |
| | | /// </summary> |
| | | public List<SendQualityDetailVm> adjustmentDList { get; set; } |
| | | } |
| | | public class SendQualityDetailVm |
| | | { |
| | | /// <summary> |
| | | /// 行号 |
| | | /// </summary> |
| | | public string lineNo { get; set; } |
| | | /// <summary> |
| | | /// 货主编号 |
| | | /// </summary> |
| | | public string ownerNo { get; set; } |
| | | /// <summary> |
| | | /// 物料编码 |
| | | /// </summary> |
| | | public string skuNo { get; set; } |
| | | /// <summary> |
| | | /// 物料名称 |
| | | /// </summary> |
| | | public string skuName { get; set; } |
| | | /// <summary> |
| | | /// 批号 |
| | | /// </summary> |
| | | public string lotNo { get; set; } |
| | | /// <summary> |
| | | /// 调整数量 |
| | | /// </summary> |
| | | public decimal skuQty { get; set; } |
| | | /// <summary> |
| | | /// 是否合格 |
| | | /// </summary> |
| | | public string IsQualified { get; set; } |
| | | } |
| | | |
| | | public class SapSampleVm |
| | | { |
| | | public SendSampleVm data { get; set; } |
| | | } |
| | | public class SendSampleVm |
| | | { |
| | | public List<SendSampleSku> pallDataList { get; set; } |
| | | } |
| | | public class SendSampleSku |
| | | { |
| | | /// <summary> |
| | | /// 物料编码 |
| | | /// </summary> |
| | | public string skuNo { get; set; } |
| | | /// <summary> |
| | | /// 物料名称 |
| | | /// </summary> |
| | | public string skuName { get; set; } |
| | | /// <summary> |
| | | /// 批号 |
| | | /// </summary> |
| | | public string lotNo { get; set; } |
| | | /// <summary> |
| | | /// 扣除数量 |
| | | /// </summary> |
| | | public decimal skuQty { get; set; } |
| | | } |
| | | |
| | | |
| | | public class SapQcVm |
| | | { |
| | | public SendSapQcVm data { get; set; } |
| | | } |
| | | public class SendSapQcVm |
| | | { |
| | | public List<SendSapQcDetailVm> pallDataList { get; set; } |
| | | } |
| | | public class SendSapQcDetailVm |
| | | { |
| | | /// <summary> |
| | | /// 请验编号 |
| | | /// </summary> |
| | | public string QcNo { get; set; } |
| | | /// <summary> |
| | | /// 物料编码 |
| | | /// </summary> |
| | | public string skuNo { get; set; } |
| | | /// <summary> |
| | | /// 物料名称 |
| | | /// </summary> |
| | | public string skuName { get; set; } |
| | | /// <summary> |
| | | /// 批号 |
| | | /// </summary> |
| | | public string lotNo { get; set; } |
| | | /// <summary> |
| | | /// 到货数量 |
| | | /// </summary> |
| | | public decimal Qty { get; set; } |
| | | /// <summary> |
| | | /// 供货批次 |
| | | /// </summary> |
| | | public string SupplierLot { get; set; } |
| | | } |
| | | #endregion |
| | | } |
| | |
| | | using Model.ModelDto.SysDto; |
| | | using Model.ModelVm; |
| | | using Model.ModelVm.SysVm; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Linq.Expressions; |
| | | using System.Threading.Tasks; |
| | | using Utility.Tools; |
| | | using WMS.BLL.LogServer; |
| | | using WMS.DAL; |
| | | using WMS.Entity.BllAsnEntity; |
| | |
| | | |
| | | var detailModel = new BllArrivalNoticeDetail() |
| | | { |
| | | OrderDetailCode = asnDetailModel.lineNo, |
| | | ASNNo = asnNo, |
| | | SkuNo = asnDetailModel.skuNo.ToString(), |
| | | SkuName = skuModel.SkuName, |
| | |
| | | FactQty = 0, |
| | | CompleteQty = 0, |
| | | PackagNo = skuModel.PackagNo, |
| | | SupplierLot = asnDetailModel.supplyBatch,//生产日期 |
| | | Lot1 = asnDetailModel.productionDate,//过期日期 |
| | | Lot2 = asnDetailModel.expireDate, |
| | | SupplierLot = asnDetailModel.supplyBatch, |
| | | Lot1 = asnDetailModel.productionDate,//生产日期 |
| | | Lot2 = asnDetailModel.expireDate,//过期日期 |
| | | Status = "0", |
| | | IsSampling = "0", |
| | | InspectStatus = "0", |
| | |
| | | { |
| | | throw new Exception("复核失败,复核人员和关闭订单人员不能相同!"); |
| | | } |
| | | var list = new List<AsnDetail>(); |
| | | var list = new List<BackAsnDetail>(); |
| | | foreach (var d in detail) |
| | | { |
| | | var item = new AsnDetail() |
| | | var mater = Db.Queryable<SysMaterials>().First(w => w.IsDel == "0" && w.SkuNo == d.SkuNo); |
| | | if (mater == null) |
| | | { |
| | | SkuNo = d.SkuNo, |
| | | LotNo = d.LotNo, |
| | | Qty = d.CompleteQty, |
| | | PackagNo = d.PackagNo, |
| | | SupplierLot = d.SupplierLot |
| | | throw new Exception($"复核失败,物料编码:{d.SkuNo}的物料信息不存在"); |
| | | } |
| | | var item = new BackAsnDetail() |
| | | { |
| | | POSNR=d.OrderDetailCode, |
| | | MATNR = d.SkuNo, |
| | | MAKTX=d.SkuName, |
| | | LFIMG = d.CompleteQty.ToString(), |
| | | MEINS= mater.UnitNo, |
| | | CHARG = d.LotNo, |
| | | HSDAT = d.Lot1, |
| | | VFDAT = d.Lot2 |
| | | }; |
| | | list.Add(item); |
| | | } |
| | | var soInfo = new AsnInfo() |
| | | var soInfo = new BackAsnVm() |
| | | { |
| | | OrderCode = notice.OrderCode, |
| | | AsnDetails = list |
| | | ZUUID = Guid.NewGuid().ToString(), |
| | | VBELN = notice.OrderCode, |
| | | LFART = notice.Type, |
| | | WADAT_IST = Convert.ToDateTime(notice.CompleteTime).ToString("yyyy-MM-dd"), |
| | | ITEM = list |
| | | }; |
| | | |
| | | #region 通过接口发送至erp |
| | | //系统对接后放开 |
| | | /*var jsonData = JsonConvert.SerializeObject(soInfo); |
| | | var jsonData = JsonConvert.SerializeObject(soInfo); |
| | | |
| | | var response = HttpHelper.DoPost(url, jsonData, "入库单完成上传", "ERP"); |
| | | |
| | |
| | | if (obj.Success != 0) |
| | | { |
| | | throw new Exception("上传失败" + obj.Message); |
| | | }*/ |
| | | } |
| | | #endregion |
| | | |
| | | notice.Status = "4"; |
| | |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using Model.InterFaceModel; |
| | | using Model.ModelDto.BllQualityDto; |
| | | using Model.ModelVm; |
| | | using SqlSugar; |
| | |
| | | |
| | | return isquality; |
| | | } |
| | | /// <summary> |
| | | /// SAP下发库存调整单 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public string InsertQualitySap(SendQualityVm model) |
| | | { |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(model.orderNo) || model.adjustmentDList.Count <= 0) |
| | | { |
| | | throw new Exception("参数错误"); |
| | | } |
| | | var asnInfo = Db.Queryable<BllArrivalNotice>().First(w => w.IsDel == "0" && w.OrderCode == model.orderNo); |
| | | if (asnInfo == null) |
| | | { |
| | | throw new Exception($"未查询到{model.orderNo}对应的入库单信息"); |
| | | } |
| | | //开启事务 |
| | | Db.BeginTran(); |
| | | |
| | | foreach (var item in model.adjustmentDList) |
| | | { |
| | | var asnDetail = Db.Queryable<BllArrivalNoticeDetail>().First(w => w.IsDel == "0" && w.ASNNo == asnInfo.ASNNo && w.OrderDetailCode == item.lineNo && w.SkuNo == item.skuNo && w.LotNo == item.lotNo); |
| | | if (asnDetail == null) |
| | | { |
| | | throw new Exception($"未查询到{item.lineNo}对应的入库单明细信息"); |
| | | } |
| | | asnDetail.InspectStatus = item.IsQualified; |
| | | //更新入库单明细质检状态 |
| | | Db.Updateable(asnDetail).ExecuteCommand(); |
| | | |
| | | //获取物料信息 |
| | | var sku = Db.Queryable<SysMaterials>().First(a => a.IsDel == "0" && a.SkuNo == item.skuNo); |
| | | if (sku == null) |
| | | { |
| | | throw new Exception($"物料编码为{item.skuNo}的物料信息不存在,请核查!"); |
| | | } |
| | | |
| | | string toDayTime = DateTime.Now.ToString("yyyyMMdd"); |
| | | var maxInspectNo = Db.Queryable<BllQualityInspect>().Where(m => m.IsDel == "0" && m.InspectNo.Contains("SAP")).Max(m => m.InspectNo); |
| | | if (string.IsNullOrWhiteSpace(maxInspectNo)) |
| | | { |
| | | maxInspectNo = "SAP" + toDayTime + "0001"; |
| | | } |
| | | else |
| | | { |
| | | var lotStr = maxInspectNo.Substring(3, 8); |
| | | if (lotStr == toDayTime) |
| | | { |
| | | maxInspectNo = "SAP" + toDayTime + (int.Parse(maxInspectNo.Replace("SAP","").Substring(8, 4)) + 1).ToString().PadLeft(4, '0'); |
| | | } |
| | | else |
| | | { |
| | | maxInspectNo = "SAP" + toDayTime + "0001"; |
| | | } |
| | | } |
| | | var qualityModel = new BllQualityInspect |
| | | { |
| | | ASNNo = asnDetail.ASNNo, |
| | | InspectNo = maxInspectNo, |
| | | SkuNo = item.skuNo, |
| | | SkuName = item.skuName, |
| | | Standard = sku.Standard, |
| | | LotNo = item.lotNo, |
| | | IsQualified = item.IsQualified, |
| | | Origin = "SAP", |
| | | FailQty = 0, |
| | | PassQty = 0 |
| | | }; |
| | | |
| | | //查找库存信息 |
| | | var stockDetailList = Db.Queryable<DataStockDetail>().Where(w => w.IsDel == "0" && w.SkuNo == item.skuNo && w.LotNo == item.lotNo).ToList(); |
| | | foreach(var datailItem in stockDetailList) |
| | | { |
| | | List<DataBoxInfo> boxList = Db.Queryable<DataBoxInfo>().Where(a => a.IsDel == "0" && a.SkuNo == item.skuNo && a.LotNo == item.lotNo && a.PalletNo == datailItem.PalletNo).ToList(); |
| | | foreach (var boxItem in boxList) |
| | | { |
| | | if (item.IsQualified == "0")//不合格 |
| | | { |
| | | boxItem.InspectStatus = "2"; |
| | | } |
| | | else//合格 |
| | | { |
| | | boxItem.InspectStatus = "1"; |
| | | } |
| | | } |
| | | //更新箱码明细质检状态 |
| | | Db.Updateable(boxList).ExecuteCommand(); |
| | | |
| | | if (item.IsQualified == "0")//不合格 |
| | | { |
| | | datailItem.InspectStatus = "2"; |
| | | //不合格数量 |
| | | qualityModel.FailQty += datailItem.Qty; |
| | | } |
| | | else//合格 |
| | | { |
| | | datailItem.InspectStatus = "1"; |
| | | //合格数量 |
| | | qualityModel.PassQty += datailItem.Qty; |
| | | } |
| | | //更新库存明细质检状态 |
| | | Db.Updateable(datailItem).ExecuteCommand(); |
| | | } |
| | | //添加质检变更记录 |
| | | Db.Insertable(qualityModel).ExecuteCommand(); |
| | | } |
| | | //提交事务 |
| | | Db.CommitTran(); |
| | | |
| | | return "0"; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //回滚事务 |
| | | Db.RollbackTran(); |
| | | //抛出异常 |
| | | throw new Exception("接收SAP下发库存调整单异常:", ex); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | //回传出库单 |
| | | public bool FinishSo(int id, string url, int userId) |
| | | public bool FinishSo(int id, string url, string url2, int userId) |
| | | { |
| | | try |
| | | { |
| | |
| | | { |
| | | throw new Exception("复核失败,复核人员和关闭订单人员不能相同!"); |
| | | } |
| | | var list = new List<SoDetail>(); |
| | | if (notice.Type == "2")//抽检出库 |
| | | { |
| | | var list = new List<SendSampleSku>(); |
| | | foreach (var d in detail) |
| | | { |
| | | var item = new SoDetail() |
| | | var item = new SendSampleSku() |
| | | { |
| | | SkuNo = d.SkuNo, |
| | | LotNo = d.LotNo, |
| | | Qty = (decimal)d.CompleteQty |
| | | skuNo = d.SkuNo, |
| | | skuName = d.SkuName, |
| | | lotNo = d.LotNo, |
| | | skuQty = Convert.ToDecimal(d.CompleteQty) |
| | | }; |
| | | list.Add(item); |
| | | } |
| | | var soInfo = new SoInfo() |
| | | SendSampleVm sendSampleVm = new SendSampleVm(); |
| | | sendSampleVm.pallDataList = list; |
| | | |
| | | SapSampleVm sapSampleVm = new SapSampleVm(); |
| | | sapSampleVm.data = sendSampleVm; |
| | | |
| | | #region 通过接口发送至erp |
| | | //系统对接后放开 |
| | | /*var jsonData = JsonConvert.SerializeObject(sapSampleVm); |
| | | |
| | | var response = HttpHelper.DoPost(url2, jsonData, "抽检出库完成上传", "ERP"); |
| | | |
| | | var obj = JsonConvert.DeserializeObject<ErpModel>(response);//解析返回数据 |
| | | if (obj.Success != 0) |
| | | { |
| | | OrderCode = notice.OrderCode, |
| | | SoDetails = list |
| | | throw new Exception("上传失败" + obj.Message); |
| | | }*/ |
| | | #endregion |
| | | } |
| | | else |
| | | { |
| | | var list = new List<BackSoDetail>(); |
| | | foreach (var d in detail) |
| | | { |
| | | var mater = Db.Queryable<SysMaterials>().First(w => w.IsDel == "0" && w.SkuNo == d.SkuNo); |
| | | if (mater == null) |
| | | { |
| | | throw new Exception($"复核失败,物料编码:{d.SkuNo}的物料信息不存在"); |
| | | } |
| | | var item = new BackSoDetail() |
| | | { |
| | | POSNR = d.OrderDetailCode, |
| | | MATNR = d.SkuNo, |
| | | CHARG = d.LotNo, |
| | | LFIMG = d.CompleteQty.ToString(), |
| | | MEINS = mater.UnitNo, |
| | | HSDAT = "", |
| | | VFDAT = "" |
| | | }; |
| | | list.Add(item); |
| | | } |
| | | var soInfo = new BackSoVm() |
| | | { |
| | | ZUUID = Guid.NewGuid().ToString(), |
| | | VBELN = notice.OrderCode, |
| | | WERKS = notice.CustomerNo, |
| | | LFART = notice.Type, |
| | | WADAT_IST = Convert.ToDateTime(notice.CompleteTime).ToString("yyyy-MM-dd"), |
| | | ITEM = list |
| | | }; |
| | | #region 通过接口发送至erp |
| | | //系统对接后放开 |
| | |
| | | throw new Exception("上传失败" + obj.Message); |
| | | }*/ |
| | | #endregion |
| | | } |
| | | |
| | | notice.Status = "6"; |
| | | notice.CheckTime = DateTime.Now; |
| | |
| | | //Db.Insertable(exTask).ExecuteCommand(); |
| | | |
| | | |
| | | // 调用Limes接口发起请验 |
| | | var sendModel = new SendLimesModel() |
| | | // 调用Sqp接口发起请验 |
| | | var sendModel = new SendSapQcDetailVm() |
| | | { |
| | | QcNo = data.QcNo, |
| | | SkuNo = data.SkuNo, |
| | | Qty = data.Qty.ToString(), |
| | | LotNo = data.LotNo, |
| | | SupplierLot = data.SupplierLot, |
| | | RequestUser = userName, // 请验人 |
| | | skuNo=data.SkuNo, |
| | | skuName = data.SkuNo, |
| | | lotNo = data.LotNo, |
| | | Qty = Convert.ToDecimal(data.Qty), |
| | | SupplierLot = data.SupplierLot |
| | | }; |
| | | var jsonData = JsonConvert.SerializeObject(sendModel); |
| | | string response = ""; |
| | |
| | | try |
| | | { |
| | | var time1 = DateTime.Now;//发送时间 .ToString("yyyy-MM-dd HH:mm:ss") |
| | | //response = HttpHelper.DoPost(url, jsonData, "上传Limes系统发起请验", "Limes"); |
| | | //response = HttpHelper.DoPost(url, jsonData, "上传Sap系统发起请验", "Sap"); |
| | | var time2 = DateTime.Now;//返回时间 .ToString("yyyy-MM-dd HH:mm:ss") |
| | | |
| | | ////解析返回数据 |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using Model.InterFaceModel; |
| | | using Model.ModelDto.BllQualityDto; |
| | | using WMS.Entity.BllQualityEntity; |
| | | |
| | |
| | | /// <returns></returns> |
| | | int InsertQuality(BllQualityInspect model); |
| | | |
| | | /// <summary> |
| | | /// SAP下发库存调整单 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | string InsertQualitySap(SendQualityVm model); |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | /// <param name="url">上传路径</param> |
| | | /// <param name="userId">操作人</param> |
| | | /// <returns></returns> |
| | | bool FinishSo(int id, string url, int userId); |
| | | bool FinishSo(int id, string url, string url2, int userId); |
| | | /// <summary> |
| | | /// 接受生产叫料信号接口 |
| | | /// </summary> |
| | |
| | | using System.Xml.Linq; |
| | | using WMS.IBLL.ISysServer; |
| | | using ZXing; |
| | | using WMS.IBLL.IBllQualityServer; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | private readonly IPdaAsnServer _pdaAsnServer;// PDA |
| | | private readonly IMaterialsServer _materialSvc;//物料Svc |
| | | private readonly ICustomerServer _customerSvc;//客户Svc |
| | | private readonly IQualityInspectServer _inspectSvc;//质量Svc |
| | | private readonly IHttpServer _http; |
| | | |
| | | |
| | | private string logStr = $@".\log\SAP赋码\Sap下发报文" + DateTime.Now.ToString("yyyyMMdd") + ".txt"; |
| | | |
| | | public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc, IPdaAsnServer pdaAsnServer, IMaterialsServer materialSvc, ICustomerServer customerSvc, IHttpServer http) |
| | | public UpApiController(IOptions<ApiUrlConfig> setting, IExportNoticeServer exNoticeSvc, IArrivalNoticeServer arrivalNoticeServer, IStockCheckServer stockCheckSvc, IProcurePlanServer procurePlanSvc, IPdaAsnServer pdaAsnServer, IMaterialsServer materialSvc, ICustomerServer customerSvc,IQualityInspectServer inspectSvc, IHttpServer http) |
| | | { |
| | | _config = setting.Value; |
| | | _exNoticeSvc = exNoticeSvc; |
| | |
| | | _pdaAsnServer = pdaAsnServer; |
| | | _materialSvc = materialSvc; |
| | | _customerSvc = customerSvc; |
| | | _inspectSvc = inspectSvc; |
| | | _http = http; |
| | | } |
| | | #endregion |
| | |
| | | try |
| | | { |
| | | var jsonData = JsonConvert.SerializeObject(model); |
| | | LogFile.SaveLogToFile($"Sap入库单下发:( {jsonData} ),", logStr); |
| | | LogFile.SaveLogToFile($"Sap入库单数据:( {jsonData} ),", logStr); |
| | | |
| | | var _result = _arrivalNoticeSvc.CreateAsn(model.data, model.@operator); |
| | | |
| | | var list = new { Success = 0, Message = "下发成功" }; |
| | | if (_result.Success == 0) |
| | | { |
| | | LogFile.SaveLogToFile($"客户供应商主数据同步:( {JsonConvert.SerializeObject(list)} ),", logStr); |
| | | LogFile.SaveLogToFile($"Sap入库单下发成功:( {JsonConvert.SerializeObject(list)} ),", logStr); |
| | | return Ok(new { result = true, code = "1", message = "success" }); |
| | | } |
| | | else |
| | | { |
| | | list = new { Success = -1, Message = _result.Message }; |
| | | |
| | | LogFile.SaveLogToFile($"客户供应商主数据同步:( {JsonConvert.SerializeObject(list)} ),", logStr); |
| | | LogFile.SaveLogToFile($"Sap入库单下发失败:( {JsonConvert.SerializeObject(list)} ),", logStr); |
| | | return Ok(new { result = false, code = "400", message = _result.Message }); |
| | | } |
| | | } |
| | |
| | | /// <returns></returns> |
| | | [AllowAnonymous] |
| | | [HttpPost] |
| | | public IActionResult UpQuality(object model) |
| | | public IActionResult UpQuality(SapQualityVm model) |
| | | { |
| | | |
| | | var logStr = $@".\log\SAP\库存质量状态接收" + DateTime.Now.ToString("yyyyMMdd") + ".txt"; |
| | | try |
| | | { |
| | | // var sd = JsonConvert.SerializeObject(model); |
| | | // var sd2 = JsonConvert.DeserializeObject<BoxPalletBindVm>(sd); |
| | | LogFile.SaveLogToFile($"Sap质量状态变更:( {model} ),", logStr); |
| | | var jsonData = JsonConvert.SerializeObject(model); |
| | | LogFile.SaveLogToFile($"Sap库存质量状态下发:( {jsonData} ),", logStr); |
| | | |
| | | _inspectSvc.InsertQualitySap(model.data); |
| | | return Ok(new { result = true, code = "1", message = "success" }); |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | return Ok(new { code = 1, msg = "未获取到当前操作人信息" }); |
| | | } |
| | | _exNoticeSvc.FinishSo(model.Id, _config.ErpHost + _config.SoFinishUrl, int.Parse(userId)); |
| | | _exNoticeSvc.FinishSo(model.Id, _config.ErpHost + _config.SoFinishUrl, _config.ErpHost + _config.SoFinishUrl2, int.Parse(userId)); |
| | | return Ok(new { code = 0, count = 0, msg = "出库单复核并上传成功" }); |
| | | } |
| | | catch (Exception e) |
| | |
| | | /// 出库订单关闭上传 |
| | | /// </summary> |
| | | public string SoFinishUrl { get; set; } |
| | | /// <summary> |
| | | /// 抽检出库订单关闭上传 |
| | | /// </summary> |
| | | public string SoFinishUrl2 { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 库存变更上传(盘库调整后) |