ldj/WcfService1/WmsOutPickRequestService.sv...

640 lines
20 KiB
C#
Raw Permalink Normal View History

2023-05-23 16:13:17 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
using DeiNiu.wms.Logical;
using DeiNiu.Utils;
using DeiNiu.wms.Data.Model;
namespace DeiNiu.Wcf
{
// 注意: 使用“重构”菜单上的“重命名”命令可以同时更改代码、svc 和配置文件中的类名“WmsOutPickRequest”。
public class WmsOutPickRequestService : basicService, IWmsOutPickRequest
2023-05-23 16:13:17 +08:00
{
private static lWmsOutPickRequest _lop;
2023-05-23 16:13:17 +08:00
lWmsOutPickRequest lop {
get
{
if (_lop == null || _lop.operId != getOperId())
{
_lop = new lWmsOutPickRequest(getOperId());
}
return _lop;
}
}
private static lWmsOutPickPort _lopp;
lWmsOutPickPort lopp
{
get
{
if (_lopp == null || _lopp.operId != getOperId())
{
_lopp = new lWmsOutPickPort(getOperId());
}
return _lopp;
}
}
private static lWmsWave _lww;
lWmsWave lww
2023-05-23 16:13:17 +08:00
{
get
{
if (_lww == null || _lww.operId != getOperId())
{
_lww = new lWmsWave(getOperId());
}
return _lww;
}
}
private static lWmsOutDesk _ldesk;
lWmsOutDesk ldesk
{
get
{
if (_ldesk == null || _ldesk.operId != getOperId())
{
_ldesk = new lWmsOutDesk(getOperId());
}
return _ldesk;
}
}
static bool isProcessWaveing = false;
public void newPickWave()
{
if (isProcessWaveing)
{
2024-11-04 23:34:38 +08:00
log.Debug( "!!!!!!!!!!!!!!!!! new pick wave ... is processing... return ....");
return;
2023-05-23 16:13:17 +08:00
}
isProcessWaveing = true;
// WmsConstants.WAVE_LINE = line;
// WmsConstants.WAVE_SALE = sales;
2023-05-23 16:13:17 +08:00
try
{
// lopp.newBulkDPSPickWave();
2023-05-23 16:13:17 +08:00
lop.newBulkDPSandSeedsPickWave();
2023-05-23 16:13:17 +08:00
isProcessWaveing = false;
}
catch (Exception e)
2023-05-23 16:13:17 +08:00
{
2024-11-04 23:34:38 +08:00
log.Error(e );
LogHelper.debug(typeof(WmsOutPickRequestService), e.StackTrace);
2023-05-23 16:13:17 +08:00
throw e;
}
finally
{
isProcessWaveing = false;
}
}
public void newSeedsWave()
{
if (isProcessWaveing)
{
LogHelper.debug(typeof(WmsOutPickRequestService), "!!!!!!!!!!!!!!!!! new pick wave ... is processing... return ....");
return;
}
isProcessWaveing = true;
// WmsConstants.WAVE_LINE = line;
// WmsConstants.WAVE_SALE = sales;
try
{
// lopp.newBulkDPSPickWave();
lop.newBulkSeedsDPSPickWave();
isProcessWaveing = false;
}
catch (Exception e)
{
throw e;
}
finally
{
isProcessWaveing = false;
}
}
public List<int> newPartPickWave()
{
2023-05-23 16:13:17 +08:00
try
{
return lop.newPartPickWave();
2023-05-23 16:13:17 +08:00
}
catch (Exception e)
{
throw e;
}
finally
{
2023-05-23 16:13:17 +08:00
}
}
static bool isProcessBatchWaveing = false;
public void createPDAPickTasks(enumOutStoreType pickOrderType)
{
LogHelper.debug(typeof(WmsOutPickRequestService), "begin ---to create pick out pda task data");
if (isProcessBatchWaveing)
{
LogHelper.debug(typeof(WmsOutPickRequestService), "!!!!!!!!!!!!!!!!! create pick out pda data ... is processing... return ....");
}
isProcessBatchWaveing = true;
// WmsConstants.WAVE_LINE = line;
// WmsConstants.WAVE_SALE = sales;
try
{
isProcessBatchWaveing = false;
lop.createPDAPickTasks();
LogHelper.debug(typeof(WmsOutPickRequestService), "end ---to create pick out pda task data");
}
catch (Exception e)
{
2023-09-04 22:41:19 +08:00
log.Error(e);
2023-05-23 16:13:17 +08:00
}
finally
{
isProcessBatchWaveing = false;
}
2023-05-23 16:13:17 +08:00
}
public void finishCurrentWave(string waveNo, bool isForce)
2023-05-23 16:13:17 +08:00
{
lop.finishCurrentWave(waveNo, isForce);
2023-05-23 16:13:17 +08:00
}
public void finishPartWave(int partion, bool isForce)
{
lop.finishPartWave(partion, isForce);
}
// public bool completeBulkValidation(string pickOrderNo, int bulkBox, int bulkBag, DataTable validationDetails)
// {
// return lop.completeBulkValidation(pickOrderNo, bulkBox, bulkBag, validationDetails);
// }
2023-05-23 16:13:17 +08:00
public bool completeBulkValidation(string pickOrderNo, int bulkBox, int bulkBag)
{
return lop.completeBulkValidation(pickOrderNo, bulkBox, bulkBag);
}
public bool completeSeedsPack(string pickOrderNo, int bulkBox = 0, int bulkBag = 0)
2023-05-23 16:13:17 +08:00
{
return lop.completeSeedsPack(pickOrderNo, bulkBox, bulkBag);
}
public bool completeBatchOut(string pickOrderNo)
{
return lop.updateBatchPickStatus(pickOrderNo, enumOutStockPickStatus.);
2023-05-23 16:13:17 +08:00
}
public bool startBatchPick(string pickOrder)
{
return lop.startPickBatchPickOrder(pickOrder);
}
public DataSet Query(string querystr, int rownumStart, int rownumEnd)
{
return lop.Query(querystr, rownumStart, rownumEnd);
}
public DataTable getBulkDetailInCurrentWave()
{
return lop.getWmsOutPickRequest.getBulkDetailInCurrentWave().Tables[0];
}
public DataTable getPartionBulkDetailInCurrentWave()
2023-05-23 16:13:17 +08:00
{
return lop.getWmsOutPickRequest.getPartionBulkDetailInCurrentWave();
2023-05-23 16:13:17 +08:00
}
2023-05-23 16:13:17 +08:00
public DataTable getPickDetailByWaveOrder(string waveOrder)
{
return lop.getWmsOutPickRequest.getPickDetailByWaveOrder(waveOrder).Tables[0];
}
public DataTable getBulkValidationException(int status)
{
return lop.getWmsOutPickRequest.getBulkValidationException((enumOutStockPickStatus)status).Tables[0];
2023-05-23 16:13:17 +08:00
}
public DataSet getBatchOutPickOrders4Pick()
{
return lop.getBatchOutPickOrders4Pick();
2023-05-23 16:13:17 +08:00
}
public DataTable getBatchOutPickOrderDetails(string pickOrderNo)
{
return lop.getBatchOutPickOrderDetails(pickOrderNo).Tables[0];
}
public DataTable getBatchOutPickOrderPickDetails(string pickOrderNo)
{
return lop.getBatchOutPickOrderPickDetails(pickOrderNo).Tables[0];
}
public DataTable getPickDetails(string orderNo, bool isPickOrder)
2023-05-23 16:13:17 +08:00
{
return lop.getPickDetails(orderNo, isPickOrder).Tables[0];
}
public DataSet getPickOrderDetails(string orderNo)
{
return lop.getPickDetails(orderNo, true);
2023-05-23 16:13:17 +08:00
}
public DataTable getOrderLogs(string orderNo, bool isSaleOrder)
{
return lop.getOrderLogs(orderNo, isSaleOrder);
2023-05-23 16:13:17 +08:00
}
public DataSet getPickRequest4BulkValidate(int desk)
{
return lop.getPickRequest4BulkValidate(desk);
2023-05-23 16:13:17 +08:00
}
public DataSet getPickRequest4SeedsOperation(int desk, int seedsStatus, string seedsNo = "")
{
enumOutStockRequestStatus status = (enumOutStockRequestStatus)seedsStatus;
return lop.getPickRequest4SeedsOperation(desk, status, seedsNo);
}
public DataTable getPickDetailByPickOrderNo(string pickOrder)
{
return lopp.getWmsOutPickPort.getPickDetails(pickOrder);
// return lop.getWmsOutPickRequest.getPickDetailByPickOrderNo(pickOrder).Tables[0];
2023-05-23 16:13:17 +08:00
}
public DataTable getPickDetailBySeedsPickOrderNo(string pickOrder, int skuId)
2023-05-23 16:13:17 +08:00
{
return lop.getWmsOutPickRequest.getPickDetailBySeedsPickOrderNo(pickOrder, skuId).Tables[0];
2023-05-23 16:13:17 +08:00
}
public DataTable getBulkValidationExceptionSolutions(int desk)
{
return lop.getWmsOutPickRequest.getBulkValidationExceptionSolutions(desk).Tables[0];
}
public DataTable getOutRequestDetail(string pickOrder)
{
return lop.getWmsOutPickRequest.getOutRequestDetail(pickOrder).Tables[0];
}
public DataTable getPickedData(int status)
{
return new WmsOutPickLable().getPickedData((enumPickState)status).Tables[0];
}
public DataTable getPartPickedData(int status)
{
return new WmsOutPickLable().getPartPickedData((enumPickState)status).Tables[0];
}
public DataTable getCurrentPickList(int status)
2023-05-23 16:13:17 +08:00
{
return new WmsOutPickLable().getCurrentPickList((enumPickState)status).Tables[0];
}
public DataTable getDpsPickList(string dpsOrder, int status)
2023-11-21 19:18:23 +08:00
{
return new WmsOutPickLable().getDpsPickList(dpsOrder, (enumPickState)status);
2023-11-21 19:18:23 +08:00
}
public DataTable getPartsPickList(int[] parts, int status)
2023-05-23 16:13:17 +08:00
{
return new WmsOutPickLable().getPartsPickList(parts, (enumPickState)status);
2023-05-23 16:13:17 +08:00
}
/// <summary>
/// 取指定分区的,指定状态的亮灯数据
/// 按复核台、波次号 asc 排序
/// </summary>
/// <param name="parts"></param>
/// <param name="status"></param>
/// <returns></returns>
public DataTable getSeedDesksPickList(int part, int status)
2023-05-23 16:13:17 +08:00
{
return lop.getSeedDesksPickList(part, (enumPickState)status);
}
public DataTable getRequests(int orderStatus)
2023-05-23 16:13:17 +08:00
{
return lop.getWmsOutPickRequest.getRequests((enumOutStockRequestStatus)orderStatus).Tables[0];
2023-05-23 16:13:17 +08:00
}
public int getRequests4WaveCnt(int orderStatus)
2023-05-23 16:13:17 +08:00
{
return lop.getWmsOutPickRequest.getRequests((enumOutStockRequestStatus)orderStatus).Tables[0].Rows.Count;
2023-05-23 16:13:17 +08:00
}
public bool updatePickingStatus(int color, int labId, int address, decimal count)
2023-11-21 19:18:23 +08:00
{
return lop.updatePickingStatus(color, labId, count, address);
}
public bool updatePortPickingStatus(int userId, int color, int labId, int address, decimal count)
{
return lop.updatePortPickingStatus(color, labId, count, address, userId);
}
public bool updateSeedsPickingStatus(int color, int labId, int address, decimal count, int partion = -1)
{
return lop.updateSeedsPickingStatus(color, labId, count, address);
}
public bool updateValidBulkPickStatus(int id, int status, string remark, int reason, decimal count, int checkedBy1)
{
return lop.finishBulkValidateItem(id, status, remark, reason, count, checkedBy1);
2023-11-21 19:18:23 +08:00
}
2023-05-23 16:13:17 +08:00
/// <summary>
/// exception feedback
/// </summary>
/// <param name="id"></param>
/// <param name="status"></param>
/// <param name="solution"></param>
/// <param name="reason"></param>
/// <returns></returns>
public bool updateValidBulkPickExceptionStatus(int id, int status, string solution, int reason)
{
2023-05-23 16:13:17 +08:00
WmsOutPickDetail_tmp tmp = new WmsOutPickDetail_tmp(id);
2023-05-23 16:13:17 +08:00
tmp.bulkPickState = status;
tmp.solutionRemark = solution;
tmp.validSolution = reason;
tmp.operater = getOperId();
2023-05-23 16:13:17 +08:00
return tmp.Update() > 0;
}
2023-05-23 16:13:17 +08:00
public bool updatePriority(string[] orders, int priority)
{
return lop.updatePriority(orders, priority, getOperId());
}
2023-05-23 16:13:17 +08:00
public void lightLables()
{
lop.lightLables();
}
2023-05-23 16:13:17 +08:00
/**
* seeds
*/
public DataTable getSeedsGoods(string seedsNo)
2023-05-23 16:13:17 +08:00
{
return lop.getSeedsGoods(seedsNo);
}
public DataSet getSeedsLightData(string seedsPickNo, string goodsId, string batch)
{
return new WmsOutPickRequest().getSeedsLightData(seedsPickNo, goodsId, batch);
2023-05-23 16:13:17 +08:00
}
public int updateSeedingStatus(string seedsPickNo, string goodsId, string batch, int labId, int address, decimal count, int checkedBy2)
{
LogHelper.debug(typeof(WmsOutPickRequestService), "begin to update seeding pick.....>");
return (int)lop.updateSeedingStatus(seedsPickNo, goodsId, batch, labId, address, count, checkedBy2);
}
2023-05-23 16:13:17 +08:00
public DataTable getSeedsPackingData(int desk)
{
return lop.outPickTmp.getPackingData(desk);
}
public DataTable getPackingDataByPickOrderNo(string pickOrderNo)
2023-05-23 16:13:17 +08:00
{
return lop.outPickTmp.getPackingDataByPickOrderNo(pickOrderNo);
}
public DataTable getPickOrderTmsInfo(string pickOrderNo)
{
return lop.getPickOrderTmsInfo(pickOrderNo);
}
2023-05-23 16:13:17 +08:00
/// <summary>
/// 取wave 拣货明细,打印取货标签
/// </summary>
/// <param name="waveNo"></param>
/// <returns></returns>
public DataTable getPickVolInfo(string waveNo, int volType)
{
return lopp.getPickInfo(waveNo, volType);
}
public DataTable getPickInfo(string waveNo)
{
return lopp.getPickInfo(waveNo);
}
2023-05-23 16:13:17 +08:00
public DataTable getPickSummary(string waveNo, int volType)
{
return lopp.getPickSummary(waveNo, volType);
}
2023-05-23 16:13:17 +08:00
public DataTable getPickLightTasks(int takeBy, int partion, int orderType)
2023-11-21 19:18:23 +08:00
{
return lopp.getPickLightTasks(takeBy, partion, orderType);
2023-11-21 19:18:23 +08:00
}
public int clearJobLightTask(string jobNo)
{
return lopp.clearJobLightTask(jobNo);
}
public bool regBox(string boxid, string waveno, int color)
{
return lop.regBox(boxid, waveno, color);
}
public DataSet getBoxRegWaves()
{
return lop.getBoxWaves();
}
public DataTable getBoxsByWave(string waveOrder, int color = -1)
{
return lop.getBoxsByWave(waveOrder, color);
}
public string getWaveNoByBoxId(string boxId)
{
return lop.getWaveNoByBoxId(boxId);
}
public DataTable getWaveDeskByBoxId(string boxId)
{
return lop.getWaveDeskByBoxId(boxId);
}
public DataTable getPartionPickDetailByBoxId(String boxId)
{
return lop.getPartionPickDetailByBoxId(boxId);
}
public void switchLights(bool isOn)
{
WmsConstants.OUT_LIGHT_ENABLE = isOn;
}
public DataTable getBoxsByPickOrder(string pickOrderNo)
{
return lop.getBoxsByPickOrder(pickOrderNo);
}
public List<int> getPartsFinishIds()
{
return lop.getPartsFinishIds();
}
public void newPartionPick(string pickOrderNo, int partion)
{
lop.newPartionPick(pickOrderNo, partion);
}
public DataTable getOrderPickList(string orderNo, bool isPickOrder, int partion)
{
return lop.getOrderPickList(orderNo, isPickOrder, partion);
}
public DataSet getWaves(string query, int rowStart, int rowEnd)
{
return lww.Query(query, rowStart, rowEnd);
}
public DataSet getTasks(string query, int rowStart, int rowEnd)
{
return lopp.Query(query, rowStart, rowEnd);
}
public DataTable getRepTasks(int takeBy, int taskPartion)
{
return lopp.getRepTasks(takeBy, taskPartion);
}
public DataSet getWaveDetailPages(string waveNo, int rowStart, int rowEnd)
{
return lopp.getWaveDetails(waveNo, rowStart, rowEnd);
}
public DataTable getWaveDetails(string waveNo)
{
return lopp.getWaveDetails(waveNo);
}
static bool isCreateWaveing = false;
2023-09-04 22:41:19 +08:00
public bool createPickWaves()
{
log.Debug(" svc begin to createPickWaves...");
bool ok = false;
if (isCreateWaveing)
{
log.Debug("!!!!!!!!!!!!!!!!! new pick wave ... is processing... return ....");
return false;
}
isCreateWaveing = true;
// WmsConstants.WAVE_LINE = line;
// WmsConstants.WAVE_SALE = sales;
try
{
ok = lopp.createPickWaves();
log.Debug("svc end createPickWaves...");
isCreateWaveing = false;
}
catch (Exception e)
{
log.Error(e);
}
finally
{
isCreateWaveing = false;
}
return ok;
}
2023-05-23 16:13:17 +08:00
public int regSeedsPlate(string plateId, int partion)
{
return (int)lop.regSeedsPlate(plateId, partion);
}
2023-05-23 16:13:17 +08:00
public DataTable getPlatePickList(string plateId, int partion)
{
return lop.getPlatePickList(plateId, partion);
}
2023-05-23 16:13:17 +08:00
public DataTable getDeskList(int deskType)
{
return lop.getDeskList((enumDeskType)deskType);
2023-05-23 16:13:17 +08:00
}
2023-05-23 16:13:17 +08:00
public int setDeskFree(int deskId)
{
return lop.setDeskFree(deskId);
}
public int setPlateFree(string plateId)
{
return lop.setPlateFree(plateId);
}
2023-05-23 16:13:17 +08:00
public DataTable getTaskAssigned(int operId, int partion, int lineId, bool batchOnly, int orderType)
{
return lopp.getAssignedTasks4Wince(operId, partion, lineId, batchOnly, (enumOrderType)orderType);
}
2023-05-23 16:13:17 +08:00
public DataTable getDeskByColor(int color)
{
return new WmsOutDesk().getDeskByColor(color);
}
2023-05-23 16:13:17 +08:00
public int setDeskAvailable(int color, bool isAvailable)
{
return ldesk.setAvailable(color, isAvailable);
}
2023-05-23 16:13:17 +08:00
public DataTable lightByJob(int userId, string jobNo, bool isValid)
2023-11-21 19:18:23 +08:00
{
return lopp.prePareLightByJob(userId, jobNo, isValid);
2023-11-21 19:18:23 +08:00
}
public DataTable getRequestDtByTransNo(string transNo)
{
return lop.getRequestDtByTransNo(transNo);
}
2023-12-03 22:13:49 +08:00
public string assignTasks(int[] ids, int empId)
2023-12-03 22:13:49 +08:00
{
return lop.assignTasks(ids, empId);
}
2024-02-06 19:36:47 +08:00
public DataTable getLightTasks(string query, int wareHouse, int partion, int lineId, int state, string date, bool isLight)
{
return lopp.getLightTasks(query, wareHouse, partion, lineId, state, date, isLight);
}
public DataTable lightSeeds(int deskId, string flowno, string barcode, int userId, bool isValid)
2024-02-06 19:36:47 +08:00
{
return lopp.prePareLightSeeds(deskId, flowno, barcode, userId, isValid);
2024-02-06 19:36:47 +08:00
}
2024-05-24 19:11:48 +08:00
public enumRepResult seedsPickOut2(string flowNo, int skuId, string productDate, string batch, int outDetailId, decimal seedCnt, string toFlowNo, int inDetailId, bool isForceClose,int userId)
2024-05-24 19:11:48 +08:00
{
if(userId>0) lopp.operId = userId;
return lopp.seedsPickOut(flowNo, skuId, productDate, batch, outDetailId, seedCnt, toFlowNo, inDetailId, isForceClose,userId);
2024-05-24 19:11:48 +08:00
}
2023-05-23 16:13:17 +08:00
}
}