检测是否有预约抬杆

master
ZR20090193-陈敬勇 2 years ago
parent 915e0f96df
commit f4a1c76080

@ -7,12 +7,12 @@
<appSettings>
<add key="RedisStr" value="192.168.1.11:6379,defaultDatabase=1,poolsize=50,ssl=false,writeBuffer=10240"/>
<!--<add key="RedisStr" value="127.0.0.1:6379,defaultDatabase=1,poolsize=50,ssl=false,writeBuffer=10240"/>-->
<add key="RedisKey" value="OutRecord"/>
<add key="pIP" value="192.168.1.99"/>
<add key="pIPUser" value="2"/>
<add key="RedisKey" value="EnterRecord"/>
<add key="pIP" value="192.168.1.98"/>
<add key="pIPUser" value="1"/>
<add key="SqlServerStr" value="Data Source=192.168.1.11;Initial Catalog=ShippingWeb_DJZ;Persist Security Info=True;User ID=sa;Password=Ds20040201;Connect Timeout=500;"/>
<!--<add key="AccessStr" value="Provider = Microsoft.ACE.OLEDB.12.0;Data Source='//192.168.1.3/con-ocr/CONLOG.mdb';"/>-->
<add key="AccessStr" value="Provider = Microsoft.ACE.OLEDB.12.0;Data Source='//192.168.1.11/con-ocr/CONLOG.mdb';"/>
<add key="AccessStr" value="Provider = Microsoft.ACE.OLEDB.12.0;Data Source='//192.168.1.3/con-ocr/CONLOG.mdb';"/>
<!--<add key="AccessStr" value="Provider = Microsoft.ACE.OLEDB.12.0;Data Source='//192.168.1.11/con-ocr/CONLOG.mdb';"/>-->
<!--<add key="AccessStr" value="Provider = Microsoft.ACE.OLEDB.12.0;Data Source='//127.0.0.1/ModelGeneration/CONLOG.mdb';"/>-->
<!--<add key="AccessStr1" value="Provider = Microsoft.ACE.OLEDB.12.0;Data Source='//192.168.1.11/con-ocr/CONLOG.mdb';"/>-->
<add key="PostUrl" value="http://192.168.1.11:9991/api/OP_YARD_CTNMNG/PublicFunc"/>

@ -348,19 +348,26 @@ namespace PlatformScalePortReadData
{
redis.LPop(key);
}
result = YARDService.PublicFunc(record);
//抬杠
if (NativeMethods.CLIENT_LPRC_SetRelayClose(this.pIP, 8080) == 0)
if (YARDService.CheckBook(record.TRUCKNO, record.BoxCode))
{
textBoxReceive.AppendText("自动抬杆成功!");
result = YARDService.PublicFunc(record);
//抬杠
if (NativeMethods.CLIENT_LPRC_SetRelayClose(this.pIP, 8080) == 0)
{
textBoxReceive.AppendText("自动抬杆成功!");
}
else
{
textBoxReceive.AppendText("自动抬杆失败!");
}
}
else
{
textBoxReceive.AppendText("自动抬杆失败!");
{
textBoxReceive.AppendText("未检测到预约数据:车牌 " + record.TRUCKNO + " 箱号:" + record.BoxCode + " 箱号2:" + record.BoxCode2 + ",请及时在客户端预约! " );
}
}
}
@ -661,6 +668,8 @@ namespace PlatformScalePortReadData
/// <returns></returns>
public decimal ReadPortWeright()
{
//清空 buffer 缓存
buffer.Clear();
decimal weight = 0M;
bool a = true;
if (!serialPort.IsOpen)

@ -0,0 +1,257 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PlatformScalePortReadData.Model
{
[SugarTable("VW_OP_YARD_CTNMNG_DJZ")]
public partial class VW_OP_YARD_CTNMNG_DJZ
{
public VW_OP_YARD_CTNMNG_DJZ()
{
}
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public Guid GID { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string BSNO { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string CUSTOMERNAME { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string GOODNAME { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public DateTime? ENTERDATE { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string TRUCKNO { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string LinkTel { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string BoxCode { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string BoxType { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public decimal? BoxWeigth { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public DateTime? ENTERDATE_ACTUAL { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public DateTime? OutDate { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public bool? ISTwoBox { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string REMARK { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public Guid? EnterOrderGid { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? DAYS { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string BILLSTATUS_CUST { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string BoxStatus { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? BondType { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string AREACODE { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public decimal? EnterWeight { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public decimal? OutWeight { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public decimal? NetWeight { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:False
/// </summary>
public short Status { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public bool? IsCollectTRUCK { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public bool? IsCollectBox { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public bool? IsUpLoadPackBox { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? BusinessType { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? AuditStatus { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public decimal? LimitRatio { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public Guid? TrainId { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string TrainNum { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public string OrgId { get; set; }
/// <summary>
/// Desc:
/// Default:
/// Nullable:True
/// </summary>
public int? MaterialStatus { get; set; }
}
}

@ -166,6 +166,7 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Model\VW_OP_YARD_CTNMNG_DJZ.cs" />
<Compile Include="Utils\StringUtil.cs" />
<Compile Include="Utils\CsRedisHelper.cs" />
<Compile Include="Form1.cs">

@ -12,7 +12,30 @@ namespace PlatformScalePortReadData.Service
{
internal class YARDService
{
public static bool CheckBook(string TRUCKNO,string BoxCode)
{
bool res = false;
try
{
using (var db = SqlSugarFactory.GetInstance("1"))
{
var info = db.Queryable<VW_OP_YARD_CTNMNG_DJZ>().Where(x => x.TRUCKNO == TRUCKNO && x.Status == 1 && x.AuditStatus == 1)
.WhereIF(!String.IsNullOrEmpty(BoxCode), x => x.BoxCode == BoxCode).OrderByDescending(x => x.ENTERDATE).First();
if (info != null)
{
res = true;
}
return res;
}
}
catch (Exception ex)
{
//return "程序异常:" + ex.ToString();
return res;
}
}
/// <summary>
/// 添加进出站记录
/// </summary>

Loading…
Cancel
Save