1
1
using Ws . Domain . Models . Entities . Print ;
2
+ using Ws . Labels . Service . Api ;
3
+ using Ws . Labels . Service . Api . Pallet . Output ;
4
+ using Ws . Labels . Service . Generate . Exceptions ;
2
5
using Ws . Labels . Service . Generate . Features . Piece ;
3
6
using Ws . Labels . Service . Generate . Features . Piece . Dto ;
4
7
using Ws . Labels . Service . Generate . Features . Weight ;
5
8
using Ws . Labels . Service . Generate . Features . Weight . Dto ;
9
+ using Ws . Shared . Api . ApiException ;
6
10
7
11
namespace Ws . Labels . Service . Generate ;
8
12
9
- internal class PrintLabelService ( LabelPieceGenerator labelPieceGenerator , LabelWeightGenerator labelWeightGenerator )
13
+ internal class PrintLabelService (
14
+ LabelPieceGenerator labelPieceGenerator ,
15
+ LabelWeightGenerator labelWeightGenerator ,
16
+ IPalychApi palychApi
17
+ )
10
18
: IPrintLabelService
11
19
{
12
20
public ( Label , LabelZpl ) GenerateWeightLabel ( GenerateWeightLabelDto weightLabelDto ) =>
13
21
labelWeightGenerator . GenerateLabel ( weightLabelDto ) ;
14
22
23
+ public async Task < bool > DeletePallet ( string palletNumber , bool isDelete )
24
+ {
25
+ PalletDeleteWrapperMsg ans =
26
+ await palychApi . Delete ( new ( ) { Pallet = new ( ) { IsDelete = isDelete , Number = palletNumber } } ) ;
27
+
28
+ if ( ans . Status . IsSuccess )
29
+ return true ;
30
+
31
+ throw new ApiExceptionServer
32
+ {
33
+ ExceptionType = LabelGenExceptions . ExchangeFailed ,
34
+ ErrorInternalMessage = ans . Status . Message
35
+ } ;
36
+ }
37
+
15
38
public Task < Guid > GeneratePiecePallet ( GeneratePiecePalletDto piecePalletDto , int labelCount , uint counter ) =>
16
39
labelPieceGenerator . GeneratePiecePallet ( piecePalletDto , labelCount , counter ) ;
17
40
}
0 commit comments