From 8893638de46547923e0684220df3d9782f7ec283 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周一, 10 3月 2025 11:01:49 +0800
Subject: [PATCH] 缓存岛需要加个批次号条件、可以选择某个批次出
---
CC/iWareCC_ASRS/WCF/CCWcfService.cs | 246 +++++++++++++------------------------------------
1 files changed, 66 insertions(+), 180 deletions(-)
diff --git a/CC/iWareCC_ASRS/WCF/CCWcfService.cs b/CC/iWareCC_ASRS/WCF/CCWcfService.cs
index debd05f..3ee62ad 100644
--- a/CC/iWareCC_ASRS/WCF/CCWcfService.cs
+++ b/CC/iWareCC_ASRS/WCF/CCWcfService.cs
@@ -1,6 +1,8 @@
锘�
using iWareCC.BLL;
using iWareCC.Common.Helper;
+using iWareCC.SrmService;
+using iWareCC.StationService;
using iWareCommon.Utils;
using iWareModel;
using iWareModel.Entity;
@@ -21,46 +23,9 @@
namespace iWareCC.WCF
{
// 娉ㄦ剰: 浣跨敤鈥滈噸鏋勨�濊彍鍗曚笂鐨勨�滈噸鍛藉悕鈥濆懡浠わ紝鍙互鍚屾椂鏇存敼浠g爜鍜岄厤缃枃浠朵腑鐨勭被鍚嶁�淐CWcfService鈥濄��
+ [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
public class CCWcfService : ICCWcfService
{
- /// <summary>
- /// MES鎻愪緵鏌愪釜鍙戝姩鏈虹殑璇︾粏淇℃伅
- /// </summary>
- /// <param name="_barCode"></param>
- public string getEngineInfo(string mes_url, string XiGang_Mes_Url_getEngineInfo, string token, string _barCode)
- {
- return MyMesService.getEngineInfo(mes_url, XiGang_Mes_Url_getEngineInfo, token, _barCode);
- }
-
- /// <summary>
- /// 鑾峰彇璁惧鍧愭爣
- /// </summary>
- /// <returns></returns>
- public DeviceCoordinat GetDeviceCoordinat()
- {
- DeviceCoordinat result = null;
- try
- {
- result = new DeviceCoordinat()
- {
-
- };
-
- result.RgvCoordinate = FormCC.rgvView.R_RGV_Coordinate;
-
- result.Srm1Coordinat = FormCC.srmViewDict[(int)EDevice.涓�鍙峰爢鍨涙満].R_PosXmm.ToString();
- result.Srm2Coordinat = FormCC.srmViewDict[(int)EDevice.浜屽彿鍫嗗灈鏈篯.R_PosXmm.ToString();
- result.Srm3Coordinat = FormCC.srmViewDict[(int)EDevice.涓夊彿鍫嗗灈鏈篯.R_PosXmm.ToString();
- result.Srm4Coordinat = FormCC.srmViewDict[(int)EDevice.鍥涘彿鍫嗗灈鏈篯.R_PosXmm.ToString();
-
- return result;
- }
- catch (Exception ex)
- {
- Log4NetHelper.WriteErrorLog(LogType.CCWCFService, "GetDeviceCoordinat鍑虹幇寮傚父锛�" + ex.Message, ex);
- return result;
- }
- }
/// <summary>
/// 妯″紡鏄惁姝e湪杩愯
@@ -72,55 +37,23 @@
}
/// <summary>
- /// 鐢熸垚鏈�鏂扮殑浠诲姟搴忓垪鍙�
+ /// 琛ユ澘宸ヤ綅鍏佽杩涙澘
/// </summary>
- /// <param name="edm"></param>
/// <returns></returns>
- public TaskSequenceEntity GenerateTaskSequence()
+ public FunRetEntity WriteStation_AllowIn()
{
try
{
- using (DbModel edm = new DbModel())
+ using (StationServiceClient client = new StationServiceClient())
{
- TaskSequenceEntity entity = new TaskSequenceEntity();
- entity = MainTaskHandler.GetTaskSequenceEntity(edm);
- return entity;
+ var res = client.WriteStation_AllowIn((int)EDevice.Station, true, StationLocationEnum.BZ39.ToString());
+ if (!res.result)
+ {
+ return FunRetEntity.Fail(res.resMsg);
+ }
}
- }
- catch (Exception ex)
- {
- Log4NetHelper.WriteErrorLog(LogType.CCWCFService, "GenerateTaskSequence鍑虹幇寮傚父锛�" + ex.Message, ex);
- return null;
- }
- }
-
-
- /// <summary>
- /// 缁勭洏鍏ュ簱
- /// </summary>
- /// <param name="taskSequence"></param>
- /// <param name="taskSequenceGuid"></param>
- /// <param name="isBtj"></param>
- /// <param name="Task_InStoreSlaver"></param>
- /// <param name="request"></param>
- /// <param name="userName"></param>
- /// <param name="userId"></param>
- /// <param name="inStoreNo">鍏ュ簱鍙�</param>
- /// <returns></returns>
- public FunRetEntity SalverMaterialBind(bool isValidate1015ScanValue,
- bool isBtj,
- C_Task_InStoreSlaverParam Task_InStoreSlaver, C_AnalyzeMaterialPostParam request,
- string userName, int userId, string inStoreNo)
- {
- try
- {
- var ret = SalverMaterialBindBLL.SalverMaterialBind(isValidate1015ScanValue, isBtj, Task_InStoreSlaver, request, userName, userId, inStoreNo);
- if (ret.success)
- {
- return FunRetEntity.Success("鎴愬姛");
- }
- return FunRetEntity.Fail(ret.msg);
+ return FunRetEntity.Success("鎴愬姛", "");
}
catch (Exception ex)
{
@@ -128,137 +61,90 @@
}
}
+
/// <summary>
- /// 閲嶆柊鎵弿杈撻�佺嚎1015涓婄殑鎵樼洏鍙�
+ /// 楠岃瘉妯″紡
/// </summary>
+ /// <param name="flag"></param>
/// <returns></returns>
- public FunRetEntity Write1015ReScan(bool value)
+ public FunRetEntity ValidateMode(int flag)
{
try
{
- if (WCSConfigHelper.GetConfig_IsSimulationPLC())
- {
- return FunRetEntity.Success("妯℃嫙鎴愬姛", "");
- }
-
- using (RgvService.RgvServiceClient client = new RgvService.RgvServiceClient())
- {
- iWareCC.RgvService.SdaResEntity result = client.Write1015ReScan((int)EDevice.RGV, value);
- if (result.result)
+ var rgvLocation = StationLocationEnum.BZ39.ToString();
+ var obj = FormCC.stationView.R_StationForReadCommList.Where(x => x.StationCode == rgvLocation.ToString()).FirstOrDefault();
+ if (flag == 1)
+ {//瑕佸己鍒跺嚭搴�
+ if (obj.R_ForceOutboundMode == false)
{
- return FunRetEntity.Success("鎴愬姛", "");
+ return FunRetEntity.Fail("PLC涓嶆槸寮哄埗鍑哄簱妯″紡");
}
- else
- {
- return FunRetEntity.Fail(result.resMsg, "");
- }
- }
- }
- catch (Exception ex)
- {
- return FunRetEntity.Fail("鑾峰彇杈撻�佺嚎1015涓婃壂鎻忕殑鎵樼洏鍙峰嚭鐜板紓甯�:" + ex.Message);
- }
- }
-
- /// <summary>
- /// 鑾峰彇杈撻�佺嚎1015涓婄殑鎵弿鍊�
- /// </summary>
- /// <returns></returns>
- public FunRetEntity GetScanValueFor1015()
- {
- try
- {
- //娉ㄦ剰锛氳繖閲屾槸妯℃嫙鐨勶紝鍙戝竷瑕佹敼杩囨潵鍟婏紒锛侊紒
- if (WCSConfigHelper.GetConfig_IsSimulationPLC())
- {
- return FunRetEntity.Success("妯℃嫙鎴愬姛", "XGT000205");
- }
-
- return FunRetEntity.Success("鎴愬姛", FormCC.rgvView.R_1015_Scan);
- }
- catch (Exception ex)
- {
- return FunRetEntity.Fail("鑾峰彇杈撻�佺嚎1015涓婃壂鎻忕殑鎵樼洏鍙峰嚭鐜板紓甯�:" + ex.Message);
- }
- }
-
- /// <summary>
- /// 閲嶆柊鎵弿杈撻�佺嚎1019涓婄殑鎵樼洏鍙�
- /// </summary>
- /// <returns></returns>
- public FunRetEntity Write1019ReScan(bool value)
- {
- try
- {
- if (WCSConfigHelper.GetConfig_IsSimulationPLC())
- {
- return FunRetEntity.Success("妯℃嫙鎴愬姛", "");
- }
-
- using (RgvService.RgvServiceClient client = new RgvService.RgvServiceClient())
- {
- iWareCC.RgvService.SdaResEntity result = client.Write1019ReScan((int)EDevice.RGV, value);
- if (result.result)
- {
- return FunRetEntity.Success("鎴愬姛", "");
- }
- else
- {
- return FunRetEntity.Fail(result.resMsg, "");
- }
- }
- }
- catch (Exception ex)
- {
- return FunRetEntity.Fail("鑾峰彇杈撻�佺嚎1019涓婃壂鎻忕殑鎵樼洏鍙峰嚭鐜板紓甯�:" + ex.Message);
- }
- }
-
- /// <summary>
- /// 鑾峰彇杈撻�佺嚎1019涓婄殑鎵弿鍊�
- /// </summary>
- /// <returns></returns>
- public FunRetEntity GetScanValueFor1019()
- {
- try
- {
- //娉ㄦ剰锛氳繖閲屾槸妯℃嫙鐨勶紝鍙戝竷瑕佹敼杩囨潵鍟婏紒锛侊紒
- if (WCSConfigHelper.GetConfig_IsSimulationPLC())
- {
- return FunRetEntity.Success("妯℃嫙鎴愬姛", "XGT000205");
}
else
{
- return FunRetEntity.Success("鎴愬姛", FormCC.rgvView.R_1019_Scan);
+ if (obj.R_OutboundMode == false)
+ {
+ return FunRetEntity.Fail("PLC涓嶆槸鍑哄簱妯″紡");
+ }
}
+ return FunRetEntity.Success("鎴愬姛", "");
}
catch (Exception ex)
{
- return FunRetEntity.Fail("鑾峰彇杈撻�佺嚎1019涓婃壂鎻忕殑鎵樼洏鍙峰嚭鐜板紓甯�:" + ex.Message);
+ return FunRetEntity.Fail("寮傚父:" + ex.Message);
}
}
- #region 1015鍜�1019
- #endregion
-
/// <summary>
- /// 瀵绘壘绌洪棽鐨勭珛搴撶┖搴撲綅 (鏅�氱墿鏂�)
+ /// 鎵爜璁板綍娓呴櫎
/// </summary>
/// <returns></returns>
- public Base_Station FindBestEmptyPlaceForOrdinaryMaterial(string orderNo)
+ public FunRetEntity WriteStation_PartClear()
{
try
{
- using (DbModel edm = new DbModel())
+ using (StationServiceClient client = new StationServiceClient())
{
- var item = StationHandler.FindBestEmptyPlaceForOrdinaryMaterial(edm, orderNo, MaterialTypeEnum.涓�鑸墿鏂�);
- return item;
+ var res = client.PartClear((int)EDevice.Station, true, StationLocationEnum.棣栨鎵爜宸ヤ綅.ToString());
+ if (!res.result)
+ {
+ return FunRetEntity.Fail(res.resMsg);
+ }
}
+
+ return FunRetEntity.Success("鎴愬姛", "");
}
catch (Exception ex)
{
- return null;
+ return FunRetEntity.Fail("寮傚父:" + ex.Message);
+ }
+ }
+
+
+ /// <summary>
+ /// 涓嬬嚎鏀捐鏂瑰悜
+ /// </summary>
+ /// <param name="iscomplete"></param>
+ /// <returns></returns>
+ public FunRetEntity WriteQiTaoInfo(bool iscomplete)
+ {
+ try
+ {
+ using (StationServiceClient client = new StationServiceClient())
+ {
+ var res = client.WriteQiTaoInfo((int)EDevice.Station, StationLocationEnum.BZ30.ToString(), iscomplete);
+ if (!res.result)
+ {
+ return FunRetEntity.Fail(res.resMsg);
+ }
+ }
+
+ return FunRetEntity.Success("鎴愬姛", "");
+ }
+ catch (Exception ex)
+ {
+ return FunRetEntity.Fail("寮傚父:" + ex.Message);
}
}
--
Gitblit v1.9.3