| | |
| | | Dt_StationManager station; |
| | | if (stationOut.WorkstationO == "0") |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::1" && x.stationType == 2); |
| | | var hasTaskOne = BaseDal.QueryFirst(x => x.TargetAddress == "B001::1"); |
| | | if (hasTaskOne == null) |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::1" && x.stationType == 2); |
| | | } |
| | | else |
| | | { |
| | | if (stationOut.WorkstationT == "0") |
| | | { |
| | | var hasTaskTwo = BaseDal.QueryFirst(x => x.TargetAddress == "B001::2"); |
| | | if (hasTaskTwo == null) |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("æªæ¾å°å¯ç¨ç«å°ï¼è¯·æ¥çç«å°æ¯å¦åå¨ä»»å¡"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error("åºåºç«å°ç¶æä¸æ¯ç©ºé²ï¼è¯·ç¡®è®¤åä¸ååºåºä»»å¡"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (stationOut.WorkstationT == "0") |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2); |
| | | var hasTaskOne = BaseDal.QueryFirst(x => x.TargetAddress == "B001::2"); |
| | | if (hasTaskOne == null) |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("æªæ¾å°å¯ç¨ç«å°ï¼è¯·æ¥çç«å°æ¯å¦åå¨ä»»å¡"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error("åºåºç«å°ç¶æä¸æ¯ç©ºé²ï¼è¯·ç¡®è®¤åä¸ååºåºä»»å¡"); |
| | | } |
| | | if (station == null) |
| | | { |
| | | return content.Error("æªæ¾å°åºåºç«å°ä¿¡æ¯"); |
| | | } |
| | | //if (station == null) |
| | | //{ |
| | | // return content.Error("æªæ¾å°åºåºç«å°ä¿¡æ¯"); |
| | | //} |
| | | |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.PalletCode == taskDTO.PalletCode); |
| | | if (task != null) |
| | |
| | | return content.Error("è·ååºåºç«å°ä¿¡æ¯å¤±è´¥ï¼è¯·éæ°åºåº"); |
| | | } |
| | | Dt_StationManager station; |
| | | //if (stationOut.WorkstationO == "0") |
| | | //{ |
| | | // station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::1" && x.stationType == 1); |
| | | //} |
| | | //else if (stationOut.WorkstationT == "0") |
| | | //{ |
| | | // station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::2" && x.stationType == 1); |
| | | //} |
| | | //else |
| | | //{ |
| | | // return content.Error("åºåºç«å°ç¶æä¸æ¯ç©ºé²ï¼è¯·ç¡®è®¤åä¸ååºåºä»»å¡"); |
| | | //} |
| | | //if (station == null) |
| | | //{ |
| | | // return content.Error("æªæ¾å°åºåºç«å°ä¿¡æ¯"); |
| | | //} |
| | | if (stationOut.WorkstationO == "0") |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::1" && x.stationType == 1); |
| | | var hasTaskOne = BaseDal.QueryFirst(x => x.TargetAddress == "B001::1"); |
| | | if (hasTaskOne == null) |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::1" && x.stationType == 2); |
| | | } |
| | | else |
| | | { |
| | | if (stationOut.WorkstationT == "0") |
| | | { |
| | | var hasTaskTwo = BaseDal.QueryFirst(x => x.TargetAddress == "B001::2"); |
| | | if (hasTaskTwo == null) |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("æªæ¾å°å¯ç¨ç«å°ï¼è¯·æ¥çç«å°æ¯å¦åå¨ä»»å¡"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error("åºåºç«å°ç¶æä¸æ¯ç©ºé²ï¼è¯·ç¡®è®¤åä¸ååºåºä»»å¡"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (stationOut.WorkstationT == "0") |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B002::2" && x.stationType == 1); |
| | | var hasTaskOne = BaseDal.QueryFirst(x => x.TargetAddress == "B001::2"); |
| | | if (hasTaskOne == null) |
| | | { |
| | | station = _stationManagerRepository.QueryFirst(x => x.stationName == "B001::2" && x.stationType == 2); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("æªæ¾å°å¯ç¨ç«å°ï¼è¯·æ¥çç«å°æ¯å¦åå¨ä»»å¡"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content.Error("åºåºç«å°ç¶æä¸æ¯ç©ºé²ï¼è¯·ç¡®è®¤åä¸ååºåºä»»å¡"); |
| | | } |
| | | if (station == null) |
| | | { |
| | | return content.Error("æªæ¾å°åºåºç«å°ä¿¡æ¯"); |
| | | } |
| | | |
| | | var stock = _stockInfoRepository.QueryFirst(x => x.LocationCode == taskDTO.SourceAddress); |
| | | if (stock == null) |
| | | { |