| | |
| | | using System.IO; |
| | | using WIDESEA_Model.Models; |
| | | using System; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Core.LogHelper; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | |
| | | |
| | | [HttpPost, HttpGet, Route("UploadApp"), AllowAnonymous] |
| | | public async Task<WebResponseContent> UploadApk(IEnumerable<IFormFile> fileInput) |
| | | { |
| | | { |
| | | // æ£æ¥æ¯å¦ææä»¶ä¸ä¼ |
| | | if (fileInput == null || !fileInput.Any()) |
| | | { |
| | |
| | | |
| | | var formFile = fileInput.First(); |
| | | var uploadFolder = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "Upload"); |
| | | Directory.CreateDirectory(uploadFolder); |
| | | Directory.CreateDirectory(uploadFolder); |
| | | |
| | | var fileName = $"WMS-PDA.apk"; |
| | | var filePath = Path.Combine(uploadFolder, fileName); |
| | |
| | | } |
| | | memory.Position = 0; |
| | | var ext = Path.GetExtension(filePath).ToLowerInvariant(); |
| | | return File(memory, new Dictionary<string, string>{{ ".apk", "application/vnd.android.package-archive" }}[ext], Path.GetFileName(filePath)); |
| | | return File(memory, new Dictionary<string, string> { { ".apk", "application/vnd.android.package-archive" } }[ext], Path.GetFileName(filePath)); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | [HttpPost, Route("EmptyInBound"), AllowAnonymous] |
| | | public WebResponseContent EmptyInBound(string PalletCode) |
| | | { |
| | | return _taskService.PalletInboundRequest("R01-001-023-001",PalletCode); |
| | | return _taskService.PalletInboundRequest("R01-001-023-001", PalletCode); |
| | | } |
| | | |
| | | |
| | |
| | | /// <param name="PalletCode">æçå·</param> |
| | | /// <param name="trayType">æçç±»åï¼1ï¼å°æç 2ï¼å¤§æç</param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("EmptyOutBound"), AllowAnonymous] |
| | | [HttpGet, Route("EmptyOutBound"), AllowAnonymous] |
| | | public WebResponseContent EmptyOutBound(string trayType) |
| | | { |
| | | return _taskService.PalletOutboundTask("R01", "R01-001-023-001",trayType); |
| | | return _taskService.PalletOutboundTask("R01", "R01-001-023-001", trayType); |
| | | |
| | | } |
| | | |
| | |
| | | /// <param name="materielGroupDTO"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("MaterielGroup"), AllowAnonymous] |
| | | public WebResponseContent MaterielGroup([FromBody] MaterielGroupDTO materielGroupDTO) |
| | | public WebResponseContent MaterielGroup([FromBody] SaveModel saveModel) |
| | | { |
| | | string PalletCode = saveModel.MainData["PalletCode"].ToString(); |
| | | var ReceviveSN = saveModel.MainData["SerialNumbers"]; |
| | | |
| | | string str = "1.0 ReceviveSN=" + ReceviveSN; |
| | | //Logger.Write_Log("System/test", "", str); |
| | | |
| | | List<string> OldSerialNumbers = JsonConvert.DeserializeObject<List<string>>(ReceviveSN.ToString()); |
| | | List<string> SerialNumbers = new List<string>(); |
| | | string code = ""; |
| | | foreach (var number in OldSerialNumbers) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "1.0.1 "); |
| | | if (number.Contains("S:")) |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "1.0.1.1 "); |
| | | List<string> nums = number.Split(';').ToList(); |
| | | foreach (var item in nums) |
| | | { |
| | | if (item.Contains("S:")) |
| | | { |
| | | //Logger.Write_Log("System/test", "", "1.0.1.2 "); |
| | | string SerialNumber = item.Replace("S:", ""); |
| | | if (!string.IsNullOrEmpty(SerialNumber)) |
| | | { |
| | | SerialNumbers.Add(SerialNumber); |
| | | code += SerialNumber; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | |
| | | //Logger.Write_Log("System/test", "", "1.0.2 "); |
| | | SerialNumbers.Add(number); |
| | | code += number; |
| | | } |
| | | } |
| | | |
| | | //Logger.Write_Log("System/test", "", "1.1 " + code); |
| | | |
| | | MaterielGroupDTO materielGroupDTO = new MaterielGroupDTO(); |
| | | materielGroupDTO.SerialNumbers = SerialNumbers; |
| | | materielGroupDTO.OrderNo = ""; |
| | | materielGroupDTO.PalletCode = PalletCode; |
| | | return _inboundService.InbounOrderService.MaterielGroup(materielGroupDTO); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="PalletCode">æçå·</param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("MaterielInBoundConfirm"), AllowAnonymous] |
| | | [HttpGet, Route("MaterielInBoundConfirm"), AllowAnonymous] |
| | | public WebResponseContent MaterielInBoundConfirm(string palletCode) |
| | | { |
| | | return _taskService.InboundRequest("R01-001-023-001", palletCode); |
| | |
| | | /// </summary> |
| | | /// <param name="PalletCode">æçå·</param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("MaterielGroupRevoke"), AllowAnonymous] |
| | | [HttpGet, Route("MaterielGroupRevoke"), AllowAnonymous] |
| | | public WebResponseContent MaterielGroupRevoke(string PalletCode) |
| | | { |
| | | return _inboundService.InbounOrderService.MaterielGroupRevoke(PalletCode); |
| | |
| | | /// </summary> |
| | | /// <param name="PalletCode">æçå·</param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("MaterielInBoundReturnConfirm"), AllowAnonymous] |
| | | public WebResponseContent MaterielInBoundReturnConfirm([FromBody] string PalletCode) |
| | | [HttpGet, Route("MaterielInBoundReturnConfirm"), AllowAnonymous] |
| | | public WebResponseContent MaterielInBoundReturnConfirm(string PalletCode) |
| | | { |
| | | return null; |
| | | return _taskService.ReturnInboundRequest("R01-001-023-001", PalletCode); |
| | | } |
| | | |
| | | |