| | |
| | | using Microsoft.EntityFrameworkCore.Metadata.Internal; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_IStoragIntegrationServices; |
| | | using WIDESEA_StorageBasicRepository; |
| | | |
| | | namespace WIDESEA_StorageBasicService; |
| | |
| | | // è¿åéªè¯ç»æå表 |
| | | return validationResults; |
| | | } |
| | | |
| | | |
| | | public WebResponseContent RequestAxleloading(RequestTaskDto input) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_CZInfo_mes CZInfot = BaseDal.QueryFirst(x => x.CurrentStatue == "1" || x.CurrentStatue == "11"); |
| | | |
| | | if (CZInfot != null) |
| | | { |
| | | CZInfot.CurrentStatue = CZInfot.CurrentStatue=="1"?"2":"12"; |
| | | BaseDal.UpdateData(CZInfot); |
| | | return content.OK(data: CZInfot.CZTM); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("æªæ¾å°éè¦ä¸æ¶ç车轴æ¡ç "); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent UpdateAxleCurrentStatue(RequestTaskDto input) |
| | | { |
| | | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_CZInfo_mes CZInfot = BaseDal.QueryFirst(x => x.CZTM == input.PalletCode); |
| | | |
| | | if (CZInfot != null) |
| | | { |
| | | if (CZInfot.CurrentStatue == "2") |
| | | { |
| | | CZInfot.CurrentStatue = "3"; |
| | | } |
| | | else if (CZInfot.CurrentStatue == "12") |
| | | { |
| | | CZInfot.CurrentStatue = "13"; |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"æªæ¾å°ç³è¯·è½¦è½´æ¡ç ä¿¡æ¯ï¼ç¶æä¸ä¸ºè¾é线è¿è¡ä¸ï¼ç³è¯·æ¡ç ï¼{input.PalletCode}"); |
| | | } |
| | | |
| | | BaseDal.UpdateData(CZInfot); //å
ä¿®æ¹äºç¶æ |
| | | return content.OK(); |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"æªæ¾å°ç³è¯·è½¦è½´æ¡ç ä¿¡æ¯ï¼ç³è¯·æ¡ç ï¼{input.PalletCode}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return content.Error($"æ´æ°è½¦è½´ä¿¡æ¯ç¶æåºéï¼ç³è¯·æ¡ç ï¼{input.PalletCode},é误信æ¯ï¼{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | try |
| | | { |
| | | int id = int.Parse(saveModel.MainData["id"]?.ToString()); |
| | | string cztm = saveModel.MainData["cztm"]?.ToString(); |
| | | if (string.IsNullOrEmpty(cztm)) |
| | | throw new Exception($"车轴å·ä¸ºç©º"); |
| | | string currentStatue = saveModel.MainData["currentStatue"]?.ToString(); |
| | | if (string.IsNullOrEmpty(currentStatue)) |
| | | throw new Exception($"è½¦è½´ç¶æä¸ºç©º"); |
| | | Dt_CZInfo_mes CZInfot = BaseDal.QueryFirst(x => x.ID == id); |
| | | if (CZInfot != null) |
| | | { |
| | | CZInfot.CZTM = cztm; |
| | | CZInfot.CurrentStatue = currentStatue; |
| | | BaseDal.UpdateData(CZInfot); //å
ä¿®æ¹äºç¶æ |
| | | return webResponse.OK($"ä¿®æ¹æå"); |
| | | } |
| | | else |
| | | { |
| | | return webResponse.Error($"ä¿®æ¹å¤±è´¥ï¼æªæ¾å°è½¦è½´ä¿¡æ¯"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return webResponse.Error($"ä¿®æ¹å¤±è´¥ï¼é误信æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | } |