| | |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 1.成型机下线记录 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public ResponseResult cxjOffLineRecord(OffLineModel model) |
| | | { |
| | | LogHelper.Info("【1.成型机下线记录】Request:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | var result = ApiHelper.cxjOffLineRecord(model); |
| | | LogHelper.Info("【1.成型机下线记录】response:" + JsonConvert.SerializeObject(result), "WMS"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 2.设备信号反馈 |
| | | /// 1.设备信号反馈 |
| | | /// 业务场景:WCS反馈成型机胚胎下线入库信号(注:必须两托一起上报,没有两托,则补充一个空托) |
| | | /// 逻辑: |
| | | /// 1.查询成型机下线记录表,判断RFID是否存在,状态是否OK,不存在或NG异常排出 |
| | |
| | | [HttpPost] |
| | | public ResponseResult notifyDeviceSignal(NotifyDeviceSignalModel model) |
| | | { |
| | | LogHelper.Info("【2.设备信号反馈】notifyDeviceSignal 入参:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | LogHelper.Info("【1.设备信号反馈】notifyDeviceSignal 入参:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | ResponseResult responseResult = new ResponseResult(); |
| | | try |
| | | { |
| | | if (model.signalType == 1) |
| | | switch (model.signalType) |
| | | { |
| | | responseResult = ApiHelper.offLineRequest(model); |
| | | } |
| | | else if(model.signalType == 3) |
| | | { |
| | | responseResult = ApiHelper.readCodeRequest(model); |
| | | case 1: |
| | | responseResult = ApiHelper.offLineRequest(model); // 下线请求 |
| | | break; |
| | | case 2: |
| | | responseResult = ApiHelper.callItemOutStock(model); // 叫料请求 |
| | | break; |
| | | case 3: |
| | | responseResult = ApiHelper.readCodeRequest(model); // 读码请求 |
| | | break; |
| | | case 4: |
| | | responseResult = ApiHelper.cxjOffLineRecord(model); // 下线记录 |
| | | break ; |
| | | case 5: |
| | | responseResult = ApiHelper.anomalyRequest(model); // 异常申请 |
| | | break; |
| | | case 6: |
| | | responseResult = ApiHelper.emptyTrayInStock(model); // 空托回库 |
| | | break; |
| | | case 7: |
| | | responseResult = ApiHelper.callEmptyTrayOutStock(model); // 空托出库 |
| | | break; |
| | | case 8: |
| | | responseResult = ApiHelper.anomalyTrayInStock(model); // 空托重置 |
| | | break; |
| | | } |
| | | } |
| | | catch (BusinessException be) |
| | |
| | | responseResult.code = 500; |
| | | responseResult.msg = $"WMS内部错误,请联系开发人员处理"; |
| | | } |
| | | LogHelper.Info("【2.设备信号反馈】notifyDeviceSignal 出参:" + JsonConvert.SerializeObject(responseResult), "WMS"); |
| | | LogHelper.Info("【1.设备信号反馈】notifyDeviceSignal 出参:" + JsonConvert.SerializeObject(responseResult), "WMS"); |
| | | return responseResult; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 2.WCS 任务状态反馈 |
| | | /// 业务场景:WCS在执行任务时,回报任务状态 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | /*[Route("notifyTaskStatus")]*/ |
| | | public ReturnResult notifyTaskStatus(TaskStatusFeedbackModel model) |
| | | { |
| | | LogHelper.Info("【2.WCS任务状态反馈】Request:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | var result = ApiHelper.taskStatusFeedback(model); |
| | | LogHelper.Info("【2.WCS任务状态反馈】response:" + JsonConvert.SerializeObject(result), "WMS"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 4.硫化机呼叫胚胎出库 |
| | | /// 逻辑: |
| | | /// 1.根据机台号查询【硫化机工单表】、【胚胎已完成的条码中间表】筛选当前班次的生产计划数量是否满足,当预计生产数量 = 实际数+在途数量 ,则停止叫料 |
| | | /// 2.查询机台号在【硫化机工单表】对应的物料编码, |
| | | /// 开始计算(1.巷道不报警、2.物料状态OK、3.小于失效时间 大于等于生效时间 4.加急料先出、5.先入先出(生产时间))出库物料,生成任务 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public ResponseResult callItemOutStock(CallItemModel model ) |
| | | { |
| | | LogHelper.Info("【4.硫化机呼叫胚胎出库】callItemOutStock 入参:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | ResponseResult responseResult = new ResponseResult(); |
| | | responseResult = ApiHelper.callItemOutStock(model); |
| | | LogHelper.Info("【4.硫化机呼叫胚胎出库】callItemOutStock 出参:" + JsonConvert.SerializeObject(responseResult), "WMS"); |
| | | return responseResult; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 5.空托回立库 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public ResponseResult emptyTrayInStock(EmptyTrayInStockModel model ) |
| | | { |
| | | LogHelper.Info("【5.空托回立库】emptyTrayInStock 入参:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | ResponseResult responseResult = new ResponseResult(); |
| | | responseResult = ApiHelper.emptyTrayInStock(model); |
| | | LogHelper.Info("【5.空托回立库】emptyTrayInStock 出参:" + JsonConvert.SerializeObject(responseResult), "WMS"); |
| | | return responseResult; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 6.成型机呼叫空托 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public ResponseResult callEmptyTrayOutStock(CallEmptyTrayOutStockModel model) |
| | | { |
| | | LogHelper.Info("【6.成型机呼叫空托】callEmptyTrayOutStock 入参:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | ResponseResult responseResult = new ResponseResult(); |
| | | responseResult = ApiHelper.callEmptyTrayOutStock(model); |
| | | LogHelper.Info("【6.成型机呼叫空托】callEmptyTrayOutStock 出参:" + JsonConvert.SerializeObject(responseResult), "WMS"); |
| | | return responseResult; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 7.胎胚立库抽检出库、人工出库胎胚 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public ResponseResult embryoCheckOutStock(EmbryoCheckOutStockModel model) |
| | | { |
| | | LogHelper.Info("【7.胎胚立库抽检出库】embryoCheckOutStock 入参:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | ResponseResult responseResult = new ResponseResult(); |
| | | responseResult = ApiHelper.embryoCheckOutStock(model); |
| | | LogHelper.Info("【 7.胎胚立库抽检出库】embryoCheckOutStock 出参:" + JsonConvert.SerializeObject(responseResult), "WMS"); |
| | | return responseResult; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 8.异常回库流程 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | public ResponseResult anomalyTrayInStock(AnomalyTrayInStockModel model) |
| | | { |
| | | LogHelper.Info("【8.异常回库流程】embryoCheckOutStock 入参:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | ResponseResult responseResult = new ResponseResult(); |
| | | responseResult = ApiHelper.anomalyTrayInStock(model); |
| | | LogHelper.Info("【8.异常回库流程】embryoCheckOutStock 出参:" + JsonConvert.SerializeObject(responseResult), "WMS"); |
| | | return responseResult; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 9.WCS 任务状态反馈 |
| | | /// 业务场景:WCS在执行任务时,回报任务状态 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | /*[Route("notifyTaskStatus")]*/ |
| | | public ReturnResult notifyTaskStatus(TaskStatusFeedbackModel model) |
| | | { |
| | | LogHelper.Info("【9.WCS任务状态反馈】Request:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | var result = ApiHelper.taskStatusFeedback(model); |
| | | LogHelper.Info("【9.WCS任务状态反馈】response:" + JsonConvert.SerializeObject(result), "WMS"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 10.空托盘解绑 |
| | | /// 4.空托盘解绑 |
| | | /// 业务场景:空托盘回主线 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | |
| | | [HttpPost] |
| | | public ReturnResult emptyTrayUnBind(EmptyTrayUnBindModel model) |
| | | { |
| | | LogHelper.Info("【10.空托盘解绑】Request:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | LogHelper.Info("【4.空托盘解绑】Request:" + JsonConvert.SerializeObject(model), "WMS"); |
| | | var result = ApiHelper.emptyTrayUnBind(model); |
| | | LogHelper.Info("【10.空托盘解绑】response:" + JsonConvert.SerializeObject(result), "WMS"); |
| | | LogHelper.Info("【4.空托盘解绑】response:" + JsonConvert.SerializeObject(result), "WMS"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 8.同步GT条码物料信息 |
| | | /// 业务场景:将GT服务器上的新增条码信息,同步到WMS服务上 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | /*[Route("notifyTaskStatus")]*/ |
| | | public ReturnResult synMatlInformation(SynBarcodeInfoModel model) |
| | | { |
| | | LogHelper.Info("【8.同步GT条码物料信息】Request:" + JsonConvert.SerializeObject(model), "GT"); |
| | | var result = ApiHelper.synMatlInformation(model.barcodeInfoList); |
| | | LogHelper.Info("【8.同步GT条码物料信息】response:" + JsonConvert.SerializeObject(result), "GT"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 9.同步硫化工单表 |
| | | /// 业务场景:将GT服务器上的新增条码信息,同步到WMS服务上 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | /*[Route("notifyTaskStatus")]*/ |
| | | public ReturnResult synProductionShedule(SynProductionSheduleModel model) |
| | | { |
| | | LogHelper.Info("【9.同步硫化工单表】Request:" + JsonConvert.SerializeObject(model), "GT"); |
| | | var result = ApiHelper.synProductionShedule(model.productionSheduleList); |
| | | LogHelper.Info("【9.同步硫化工单表】response:" + JsonConvert.SerializeObject(result), "GT"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 10.同步条码状态信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | /*[Route("notifyTaskStatus")]*/ |
| | | public ReturnResult synBarcodeStatus(SynUpdateMatlStatusModel model) |
| | | { |
| | | LogHelper.Info("【10.同步条码状态表信息】Request:" + JsonConvert.SerializeObject(model), "GT"); |
| | | var result = ApiHelper.synBarcodeStatus(model.updateMatlStatuses); |
| | | LogHelper.Info("【10.同步条码状态表信息】response:" + JsonConvert.SerializeObject(result), "GT"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 11.同步抽检状态表信息 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | /*[Route("notifyTaskStatus")]*/ |
| | | public ReturnResult synSampleStatus(SynUpdateMatlStatusModel model) |
| | | { |
| | | LogHelper.Info("【11.同步抽检状态表信息】Request:" + JsonConvert.SerializeObject(model), "GT"); |
| | | var result = ApiHelper.synSampleStatus(model.updateMatlStatuses); |
| | | LogHelper.Info("【11.同步抽检状态表信息】response:" + JsonConvert.SerializeObject(result), "GT"); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 11.查询中间表最后的同步时间 |
| | | /// 业务场景:记录物料条码信息同步、物料状态信息同步时间 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | /*[Route("notifyTaskStatus")]*/ |
| | | public ReturnResult findDataLastSynTime(SynTableModel model) |
| | | { |
| | | LogHelper.Info("【11.查询上一次的数据同步时间】Request:" + JsonConvert.SerializeObject(model), "GT"); |
| | | var result = ApiHelper.findDataLastSynTime(model.tableType); |
| | | LogHelper.Info("【11.查询上一次的数据同步时间】response:" + JsonConvert.SerializeObject(result), "GT"); |
| | | return result; |
| | | } |
| | | |
| | | public class LocStateFeedBackModel |
| | | { |
| | | public string reqId { get; set; } |
| | | public string reqTime { get; set; } |
| | | public string loc_code { get; set; } // 站台编码 |
| | | public string type { get; set; } // 请求类型 1 允许取货 2 允许放货 |
| | | public string req_no { get; set; } // 任务号 |
| | | } |
| | | |
| | | public class SynTableModel |
| | | { |
| | | public int tableType { get; set; } // 1.半制品条码信息表 2.条码状态表 3.抽检状态表 |
| | | } |
| | | |
| | | public class SynUpdateMatlStatusModel |
| | | { |
| | | public List<UpdateMatlStatus> updateMatlStatuses { get; set; } |
| | | } |
| | | |
| | | public class UpdateMatlStatus |
| | | { |
| | | public string bc_entried { get; set; } |
| | | public string mcngrp { get; set; } |
| | | public string jdge { get; set; } |
| | | public string last_modify_time { get; set; } |
| | | } |
| | | |
| | | public class SynProductionSheduleModel |
| | | { |
| | | public List<ProductionSheduleModel> productionSheduleList { get; set; } |
| | | } |
| | | |
| | | public class ProductionSheduleModel |
| | | { |
| | | public string cur_mcn { get; set; } |
| | | public int schstatus { get; set; } |
| | | public int n_4m { get; set; } |
| | | public string cur_planstartdate { get; set; } |
| | | public string cur_shift { get; set; } |
| | | public string itemcode { get; set; } |
| | | public string last_modify_time { get; set; } |
| | | } |
| | | |
| | | public class SynBarcodeInfoModel |
| | | { |
| | | public List<BarcodeInfoModel> barcodeInfoList { get; set; } |
| | | } |
| | | |
| | | public class BarcodeInfoModel |
| | | { |
| | | public string itemcode { get; set; } // 物料编码 |
| | | public string barcode { get; set; } // 条形码 |
| | | public string mcn { get; set; } // 机器代码 |
| | | public int qty { get; set; } // 数量 |
| | | public string txndate { get; set; } // 生产时间 |
| | | public string date_shift { get; set; } // 转班日期 |
| | | public string jdge { get; set; } // 生效时间 |
| | | public string minhour { get; set; } // 生效时间 |
| | | public string overage { get; set; } // 失效时间 |
| | | public int inner_diameter { get; set; } // 胚胎内径 |
| | | public int outer_diameter { get; set; } // 胚胎外径 |
| | | public int height { get; set; } // 胚胎高度 |
| | | public string last_modify_time { get; set; } // 更新时间 |
| | | } |
| | | |
| | | public class EmptyTrayUnBindModel |
| | |
| | | public string taskNo { get; set; } |
| | | public string cntrNo { get; set; } |
| | | public int signalType { get; set; } |
| | | public List<BarcodeModel> extData { get; set; } |
| | | public object extData { get; set; } |
| | | public string deviceNo { get; set; } |
| | | } |
| | | |