|
|
@@ -1,7 +1,6 @@
|
|
|
using AutoMapper;
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
using Newtonsoft.Json;
|
|
|
-using NPOI.SS.Formula.Functions;
|
|
|
using SqlSugar;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
@@ -1476,7 +1475,7 @@ namespace wms.service.Service
|
|
|
Tunnel = "",
|
|
|
MaterialCode = stock.MatCode,
|
|
|
MatCode = stock.MatCode,
|
|
|
- BusType = CpTaskBusType.TaskBusType_CP_WeightIn.GetDescription()
|
|
|
+ BusType = CpTaskBusType.TaskBusType_CP_WeightIn.GetDescription()
|
|
|
};
|
|
|
|
|
|
if (stock.BatchNo == "10") //空托盘组库尾入库库存中批号值等于十表示强制入五巷道
|
|
|
@@ -2391,7 +2390,7 @@ namespace wms.service.Service
|
|
|
if (wcstask.BusType == CpTaskBusType.TaskBusType_CP_WeightOut.GetDescription())
|
|
|
{
|
|
|
//更新库存
|
|
|
- _billnowrepository.UpdateModelColumns(p => new cpBillInvnow() { InvStateCode = InvState.InvEcecState_BuildUp.ToString()}, p => p.InvStateCode == InvState.InvEcecState_OutGoing.ToString() && p.ContGrpBarCode == wcstask.BarCode);
|
|
|
+ _billnowrepository.UpdateModelColumns(p => new cpBillInvnow() { InvStateCode = InvState.InvEcecState_BuildUp.ToString() }, p => p.InvStateCode == InvState.InvEcecState_OutGoing.ToString() && p.ContGrpBarCode == wcstask.BarCode);
|
|
|
}
|
|
|
if (stocklist == null || !stocklist.Any())
|
|
|
{
|
|
|
@@ -4866,13 +4865,6 @@ namespace wms.service.Service
|
|
|
}
|
|
|
if (task.Type == TaskType.EnterDepot)
|
|
|
{
|
|
|
- //if (task.BarCode != request.RFID)
|
|
|
- //{
|
|
|
- // res.ResCode = ResponseStatusCodeEnum.Fail.GetHashCode();
|
|
|
- // res.ResMsg = "条码异常:上传条码" + request.RFID + "与当前任务条码不符" + request.TaskCode;
|
|
|
- // return res;
|
|
|
- //}
|
|
|
-
|
|
|
if (request.Weight == 0)
|
|
|
{
|
|
|
res.ResCode = ResponseStatusCodeEnum.ErrParam.GetHashCode();
|
|
|
@@ -4891,6 +4883,9 @@ namespace wms.service.Service
|
|
|
{
|
|
|
netWQty = request.Weight - stock.TareWQty + stock.CaQty;
|
|
|
}
|
|
|
+
|
|
|
+ #region 上抛MES
|
|
|
+
|
|
|
var url = wms.util.AppSettings.GetConfig("EsbMesPushUrl");
|
|
|
var reqids = Guid.NewGuid().ToString();
|
|
|
var reqs = new EsbReq() { headers = new HeadersReq() { serviceCode = "163J162008", requestId = reqids, TrackId = reqids, sourceCode = "163J" } };
|
|
|
@@ -4928,6 +4923,9 @@ namespace wms.service.Service
|
|
|
EditTime = DateTime.Now
|
|
|
}, p => p.ContGrpBarCode == stock.ContGrpBarCode);
|
|
|
}
|
|
|
+
|
|
|
+ #endregion 上抛MES
|
|
|
+
|
|
|
var flow = _mapper.Map<cpBillInvflow>(stock);
|
|
|
flow.Id = GetId();
|
|
|
flow.TolWQty = request.Weight;
|
|
|
@@ -4988,10 +4986,27 @@ namespace wms.service.Service
|
|
|
StandardWeight = stock.TolWQty,
|
|
|
UpperDeviationLimit = Convert.ToDecimal(config.Default1),
|
|
|
LowerDeviationLimit = Convert.ToDecimal(config.Default2),
|
|
|
- IsOutOfTolerance = request.Weight < upperDeviationLimit || request.Weight > lowerDeviationLimit ? true : false
|
|
|
+ IsOutOfTolerance = request.Weight > upperDeviationLimit || request.Weight < lowerDeviationLimit ? true : false
|
|
|
};
|
|
|
_baseWeighingResult.InsertReturnEntity(weighingResult);
|
|
|
//上安灯系统
|
|
|
+
|
|
|
+ var url = wms.util.AppSettings.GetConfig("EsbMesPushUrl");
|
|
|
+ var reqids = Guid.NewGuid().ToString();
|
|
|
+ var reqs = new EsbReq() { headers = new HeadersReq() { serviceCode = "163U163U11", requestId = reqids, TrackId = reqids, sourceCode = "163U" } };
|
|
|
+ var upload = new WeighingResultRequest()
|
|
|
+ {
|
|
|
+ MeasuredWeight = weighingResult.MeasuredWeight,
|
|
|
+ StandardWeight = weighingResult.StandardWeight,
|
|
|
+ UpperDeviationLimit = weighingResult.UpperDeviationLimit,
|
|
|
+ LowerDeviationLimit = weighingResult.LowerDeviationLimit,
|
|
|
+ IsOutOfTolerance = weighingResult.IsOutOfTolerance,
|
|
|
+ WareHouse = "成品库"
|
|
|
+ };
|
|
|
+ _logger.LogInformation("自动称重上传安灯:标重" + upload.MeasuredWeight + ",实际重:" + upload.StandardWeight, "超重:" + upload.IsOutOfTolerance);
|
|
|
+ var str = HttpUtil.PostRequest(url, JsonConvert.SerializeObject(upload), 30000, "UTF-8", "application/json", reqids, reqs.headers.sourceCode, reqs.headers.serviceCode);
|
|
|
+ var response = JsonConvert.DeserializeObject<SRes>(str);
|
|
|
+ _logger.LogInformation("自动称重上传安灯结果:箱号" + stock.BoxBarCode + "安灯结果:" + response.ResCode + response.ResMsg);
|
|
|
}
|
|
|
|
|
|
return res;
|
|
|
@@ -5533,9 +5548,9 @@ namespace wms.service.Service
|
|
|
return result;
|
|
|
}
|
|
|
isContinue = true;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (_wcstaskinfo.IsAny(p => p.AddrTo == deviceId && p.Status == TaskStatus.NewBuild))
|
|
|
{
|
|
|
result.ResCode = ResponseStatusCodeEnum.EquipInfoNotExist.GetHashCode();
|
|
|
@@ -5543,7 +5558,6 @@ namespace wms.service.Service
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (!isContinue)
|
|
|
{
|
|
|
result.ResCode = ResponseStatusCodeEnum.EquipInfoNotExist.GetHashCode();
|
|
|
@@ -5669,8 +5683,8 @@ namespace wms.service.Service
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public bool ShouldTriggerScaleTask(string config,int hour)
|
|
|
- {
|
|
|
+ public bool ShouldTriggerScaleTask(string config, int hour)
|
|
|
+ {
|
|
|
DateTime now = DateTime.Now;
|
|
|
DateTime todayAt10 = new DateTime(now.Year, now.Month, now.Day, hour, 0, 0);
|
|
|
|