| | |
| | | using System; |
| | | using HslCommunication; |
| | | using Newtonsoft.Json; |
| | | using Quartz.Util; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IWMsInfoServices; |
| | | using WIDESEA_Model.Models; |
| | | using static WIDESEA_DTO.SquareCabin.TowcsDto; |
| | | |
| | | namespace WIDESEA_WMsInfoServices |
| | | { |
| | |
| | | public MaterielInfoService(IRepository<Dt_MaterielInfo> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | public IRepository<Dt_MaterielInfo> Repository => BaseDal; |
| | | public override WebResponseContent DeleteData(object[] keys) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | if (keys.ToList().Count > 1) throw new Exception("䏿¬¡åªè½éæ©ä¸æ¡æ°æ®"); |
| | | Dt_MaterielInfo goods = BaseDal.QueryFirst(x => keys.Contains(x.Id)); |
| | | var medicineDTO = new ProductInfo |
| | | { |
| | | //ç¨æ·code |
| | | customerCode = "905", |
| | | //ç©æç±»å |
| | | materialCode = "YY", |
| | | //产åç¼ç |
| | | productCode = goods.MaterielCode, |
| | | //产åå |
| | | productName = goods.MaterielName, |
| | | //äº§åæ¡ç |
| | | productBarCode = goods.MaterielCode, |
| | | |
| | | //è§æ ¼ |
| | | productSpecifications = goods.MaterielSpec, |
| | | //åä½ |
| | | unit = goods.MaterielUnit, |
| | | //é¿ |
| | | singleProductLongNum = goods.MaterielLength.ToString(), |
| | | //宽 |
| | | singleProductWideNum = goods.MaterielWide.ToString(), |
| | | //é« |
| | | singleProductHighNum = goods.MaterielHeight.ToString(), |
| | | //éé |
| | | singleProductWeight = goods.MaterielWeight.ToString(), |
| | | //ä½ç§¯ |
| | | singleProductVolume = goods.MaterielVolume.ToString(), |
| | | //æ¯å¦åæ¶ 0æ¯ä¸å é¤ï¼1å é¤ |
| | | isDelete = "1" |
| | | }; |
| | | var url = "http://172.16.1.2:9357/file-admin/api/product/productSynchronous"; |
| | | //var url = "http://172.16.1.245:9357/file-admin/api/product/productSynchronous"; |
| | | |
| | | var result = HttpHelper.Post(url, medicineDTO.ToJsonString()); |
| | | var resp = JsonConvert.DeserializeObject<TowcsResponse<object>>(result); |
| | | if (resp != null && resp.code == "0") return base.DeleteData(keys); |
| | | |
| | | return WebResponseContent.Instance.Error("å é¤å¤±è´¥è¯·éè¯"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | |
| | | |
| | | public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | { |
| | | if (saveModel.MainData["goodStatusState"].ToString() != "æªä¸å") |
| | | { |
| | | saveModel.MainData.Remove("goodStatusState"); |
| | | saveModel.MainData.Add("goodStatusState", "æªä¸å"); |
| | | } |
| | | // æ¹æ³2ï¼æè
ç´æ¥æ¯è¾å符串 |
| | | if (saveModel.MainData["boxQty"].ToString() == "0" ) |
| | | { |
| | | // è¿éæ·»å ä½ çé»è¾ |
| | | return WebResponseContent.Instance.Error("ç®±è§åæå°åºåæ°ä¸å¯å·²ä¸º0"); |
| | | } |
| | | return base.UpdateData(saveModel); |
| | | } |
| | | } |
| | | } |