| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | |
| | | { |
| | | public class PalletCodeInfoService : ServiceBase<Dt_PalletCodeInfo, IPalletCodeInfoRepository>, IPalletCodeInfoService |
| | | { |
| | | public PalletCodeInfoService(IPalletCodeInfoRepository BaseDal) : base(BaseDal) |
| | | private readonly IWarehouseRepository _warehouseRepository; |
| | | public PalletCodeInfoService(IPalletCodeInfoRepository BaseDal, IWarehouseRepository warehouseRepository) : base(BaseDal) |
| | | { |
| | | _warehouseRepository = warehouseRepository; |
| | | } |
| | | |
| | | static object locker = new object(); |
| | |
| | | { |
| | | serialNo = 1; |
| | | } |
| | | Dt_Warehouse _Warehouse = _warehouseRepository.QueryFirst(x=>x.WarehouseId== warehouseId); |
| | | |
| | | string uplen = _Warehouse.WarehouseCode switch |
| | | { |
| | | "HA57" => "B", |
| | | "HA58" => "P", |
| | | "HA152" => "G", |
| | | "HA64" => "S", |
| | | "é»çä»" => "Z", |
| | | "HA153" => "Y", |
| | | "HA71" => "C", |
| | | "HA60" => "F", |
| | | _ => "N" |
| | | }; |
| | | for (int i = 0; i < count; i++) |
| | | { |
| | | |
| | | palletCodeInfos.Add(new Dt_PalletCodeInfo |
| | | { |
| | | SerialNo = serialNo, |
| | | PalletCode = now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), |
| | | PalletCode = uplen+now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'), |
| | | PalletType = 1, |
| | | PalletTypeId = 0, |
| | | WarehouseId = warehouseId, |
| | |
| | | return base.AddData(palletCodeInfos); |
| | | } |
| | | } |
| | | public WebResponseContent PrintStatusUp(string printCode) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x=>x.PalletCode==printCode); |
| | | if (palletCodeInfo==null) |
| | | { |
| | | return content.Error("æå°çæçç ä¸åå¨"); |
| | | } |
| | | palletCodeInfo.Status = PrintStatusEnum.Printed.ObjToInt(); |
| | | BaseDal.UpdateData(palletCodeInfo); |
| | | return content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error("é误:"+ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |