| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | 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 = ""; |
| | | switch (_Warehouse.WarehouseCode) |
| | | { |
| | | case "HA153": |
| | | uplen = "Y"; |
| | | break; |
| | | default: |
| | | uplen = "N"; |
| | | break; |
| | | } |
| | | 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, |