| | |
| | | //请æ±åæ° |
| | | var requestData = new |
| | | { |
| | | searchDate = "2022-10-10 20:45:16" // æ£ç¡®çæ ¼å¼ |
| | | searchDate = "2009-1-10 20:45:16" // æ£ç¡®çæ ¼å¼ |
| | | }; |
| | | //if (string.IsNullOrEmpty(SearchDate)) |
| | | //{ |
| | |
| | | } |
| | | |
| | | //è·åææå·²åå¨çååç¼å· |
| | | var existingGoodsNos = BaseDal.Db.Queryable<Dt_MedicineGoods>() |
| | | .Select(g => g.Goods_no) |
| | | var existingGoodsNos = BaseDal.Db.Queryable<Dt_MaterielInfo>() |
| | | .Select(g => g.MaterielCode) |
| | | .ToList(); |
| | | |
| | | // æ¶éææè¦æå
¥çå®ä½ |
| | | var entityList = response.data.Where(Medicat => !existingGoodsNos.Contains(Medicat.goods_no)).Select(Medicat => new Dt_MedicineGoods |
| | | var entityList = response.data.Where(Medicat => !existingGoodsNos.Contains(Medicat.goods_no)).Select(Medicat => new Dt_MaterielInfo |
| | | { |
| | | Goods_no = Medicat.goods_no, |
| | | MaterialCode=Medicat.materialCode, |
| | | Goods_spm = Medicat.goods_spm, |
| | | Model = Medicat.model, |
| | | MaterielCode = Medicat.goods_no, |
| | | MaterielErpType = Medicat.materialCode, |
| | | item = Medicat.goods_tym, //éç¨å |
| | | MaterielName = Medicat.goods_spm,//ç©æåç§° |
| | | MaterielSpec = Medicat.model, |
| | | Factory = Medicat.factory, |
| | | Unit = Medicat.unit, |
| | | MaterielUnit = Medicat.unit,//åä½ |
| | | // ä½¿ç¨ ?? è¿ç®ç¬¦æä¾é»è®¤å¼ |
| | | Item_Iength = Medicat.item_length , |
| | | Item_width = Medicat.item_width, |
| | | Item_hight = Medicat.item_hight, |
| | | Item_volumn = Medicat.item_volumn, |
| | | Item_weight = Medicat.item_weight, |
| | | Storage_cond = Medicat.storage_cond, |
| | | MaterielLength = (float?)Medicat.item_length , |
| | | MaterielWide = (float?)Medicat.item_width, |
| | | MaterielHeight = (float?)Medicat.item_hight, |
| | | MaterielVolume = (float?)Medicat.item_volumn, |
| | | MaterielWeight = (float?)Medicat.item_weight, |
| | | MaterielStoragecondition = float.TryParse(Medicat.storage_confition, out var val) ? val : null, //å¨åæ¡ä»¶ |
| | | Remark = Medicat.remark, |
| | | GoodStatus = "æªä¸å", |
| | | GoodStatusState = "æªä¸å", |
| | | ModifyDate = Medicat.modify_date |
| | | }).ToList(); |
| | | // 䏿¬¡æ§æ¹éæå
¥æ°æ®åº |
| | |
| | | try |
| | | { |
| | | //å
æ¾å°æææªä¸åçè¯å |
| | | var list = BaseDal.QueryData(x => x.GoodStatus == "æªä¸å").ToList(); |
| | | //var list = BaseDal.QueryData(x => x.GoodStatus == "æªä¸å").ToList(); |
| | | var list =BaseDal.Db.Queryable<Dt_MaterielInfo>().Where(x => x.GoodStatusState == "æªä¸å").ToList(); |
| | | if (list == null || !list.Any()) |
| | | { |
| | | return new WebResponseContent().OK("æ æªä¸åè¯å"); |
| | |
| | | //ç¨æ·code |
| | | customerCode = "905", |
| | | //ç©æç±»å |
| | | materialCode =item.MaterialCode, |
| | | materialCode =item.MaterielErpType, |
| | | //产åç¼ç |
| | | productCode= item.Goods_no, |
| | | productCode= item.MaterielCode, |
| | | //产åå |
| | | productName =item.Goods_spm , |
| | | productName =item.MaterielName, |
| | | //äº§åæ¡ç |
| | | productBarCode= item.Goods_no, |
| | | productBarCode= item.MaterielCode, |
| | | |
| | | //è§æ ¼ |
| | | productSpecifications=item.Model, |
| | | productSpecifications=item.MaterielSpec, |
| | | //åä½ |
| | | unit = item.Unit, |
| | | unit = item.MaterielUnit, |
| | | //é¿ |
| | | singleProductLongNum = item.Item_Iength.ToString(), |
| | | singleProductLongNum = item.MaterielLength.ToString(), |
| | | //宽 |
| | | singleProductWideNum = item.Item_weight.ToString(), |
| | | singleProductWideNum = item.MaterielWide.ToString(), |
| | | //é« |
| | | singleProductHighNum = item.Item_hight.ToString(), |
| | | singleProductHighNum = item.MaterielHeight.ToString(), |
| | | //éé |
| | | singleProductWeight = item.Item_weight.ToString(), |
| | | singleProductWeight = item.MaterielWeight.ToString(), |
| | | //ä½ç§¯ |
| | | singleProductVolume = item.Item_volumn.ToString(), |
| | | singleProductVolume = item.MaterielVolume.ToString(), |
| | | //æ¯å¦åæ¶ 0æ¯ä¸å é¤ï¼1å é¤ |
| | | isDelete = "0" |
| | | }; |
| | |
| | | if (resp!=null&&resp.code=="0") |
| | | { |
| | | //æ´æ°è¯åç¶æ-已宿 |
| | | BaseDal.Db.Updateable<Dt_MedicineGoods>() |
| | | .SetColumns(x => x.GoodStatus == "ä¸å宿") |
| | | .Where(x => x.Goods_no == item.Goods_no) |
| | | BaseDal.Db.Updateable<Dt_MaterielInfo>() |
| | | .SetColumns(x => x.GoodStatusState == "ä¸å宿") |
| | | .Where(x => x.GoodStatusState == item.MaterielCode) |
| | | .ExecuteCommand(); |
| | | } |
| | | else |
| | |
| | | /// <returns></returns> |
| | | public WebResponseContent DeleteProduct(string goodsno) |
| | | { |
| | | |
| | | try |
| | | { |
| | | var goods = BaseDal.QueryData(x => x.Goods_no == goodsno).FirstOrDefault(); |
| | | var goods = BaseDal.Db.Queryable< Dt_MaterielInfo >().Where(x => x.MaterielCode == goodsno).First(); |
| | | if (goods == null) |
| | | { |
| | | return new WebResponseContent |
| | |
| | | //ç©æç±»å |
| | | materialCode = "YY", |
| | | //产åç¼ç |
| | | productCode = goods.Goods_no, |
| | | productCode = goods.MaterielCode, |
| | | //产åå |
| | | productName = goods.Goods_spm, |
| | | productName = goods.MaterielName, |
| | | //äº§åæ¡ç |
| | | productBarCode = goods.Goods_no, |
| | | productBarCode = goods.MaterielCode, |
| | | |
| | | //è§æ ¼ |
| | | productSpecifications = goods.Model, |
| | | productSpecifications = goods.MaterielSpec, |
| | | //åä½ |
| | | unit = goods.Unit, |
| | | unit = goods.MaterielUnit, |
| | | //é¿ |
| | | singleProductLongNum = goods.Item_Iength.ToString(), |
| | | singleProductLongNum = goods.MaterielLength.ToString(), |
| | | //宽 |
| | | singleProductWideNum = goods.Item_weight.ToString(), |
| | | singleProductWideNum = goods.MaterielWide.ToString(), |
| | | //é« |
| | | singleProductHighNum = goods.Item_hight.ToString(), |
| | | singleProductHighNum = goods.MaterielHeight.ToString(), |
| | | //éé |
| | | singleProductWeight = goods.Item_weight.ToString(), |
| | | singleProductWeight = goods.MaterielWeight.ToString(), |
| | | //ä½ç§¯ |
| | | singleProductVolume = goods.Item_volumn.ToString(), |
| | | singleProductVolume = goods.MaterielVolume.ToString(), |
| | | //æ¯å¦åæ¶ 0æ¯ä¸å é¤ï¼1å é¤ |
| | | isDelete = "1" |
| | | }; |
| | |
| | | if (resp != null && resp.code == "0") |
| | | { |
| | | //æèªå·±ä¹å é¤ |
| | | BaseDal.DeleteData(goods); |
| | | base.Db.Deleteable<Dt_MaterielInfo>().Where(x => x.MaterielCode == goodsno); |
| | | return new WebResponseContent { Status = true, Message = "å 餿å" }; |
| | | } |
| | | return new WebResponseContent { Status = false, Message = "å é¤å¤±è´¥è¯·éè¯" }; |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |