# Задание на стикерование

Задание на стикерование предназначено для документов которые необходимо стикеровать особым образом, например с уникальными номерами. Сейчас данный функционал реализован для Поставки и Комплектации(вся логика реализована в ветке 9063\_new\_chz\_loading).

##### Создание редактирование задание на стикерование через json

/api/lite/sticker/task/json или /api/lite/sticker/task/{sticker\_task\_id}/json

Данный метод предназначен для загрузки или редактирования задания на стикерование из json файла. Редактирование происходит с очисткой ранее загруженных но не зарезервированных уникальных номеров.

Параметры:

<span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">doc\_id</span> - номер документа(Поставки или Комплектации)

<span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">doc\_type</span> - тип документа(PURCHASE\_ORDER, <span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">PHYSICAL\_SET\_ORDER</span>)

Пример вызова:

```
{
	"items": [
		{
			"variantId" : "1036",
			"productId" : "2bc478a4-9d3d-f9bd-339b-024e4cbf053c",
			"stickerTemplateCode" : "testTemplate2",
			"stickerContentData" : "{        \"blocks\": [          {            \"name\": \"block1\",            \"value\": \"Состав: - 54% шерсть, 40% полиэстер, 5% другие нити, 1% эластан /nПодкладка - 100% полиэстер\"          },          {            \"name\": \"block2\",            \"value\": \"Рекомендации по уходу /n- Не стирать /n- Не отбеливать /n- Не сушить в стиральной машине /n- Гладить при средней температуре /n- Бережная профессиональная химчистка\"          },          {            \"name\": \"block_img\",            \"value\": \"https://asset1.marksandspencer.com/is/image/mands/SD_03_T15_1436T_XB_X_EC_1?$PRODVIEWER_SUB$\"          }          ]      }",
			"stickering" : false,
			"stickeringWithUnigueNumber" : false,
            "uniqueNumbers" : [
		{
			"uniqueNumber" : "898789891",
			"type" : "UIT"
		}
		
	]
		}
	]
}
```

Пример ответа:

```
{
    "c": "01de612f-209c-bbbb-167c-fc6f2e7649c0",
    "orderId": "1016",
    "success": true
}
```

##### Создание редактирование задание на стикерование через excel

/api/lite/sticker/task/excel или /api/lite/sticker/task/{sticker\_task\_id}/excel

Данный метод предназначен для загрузки или редактирования задания на стикерование из файла эксель(formData). Редактирование происходит с очисткой ранее загруженных но не зарезервированных уникальных номеров.

Параметры:

<span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">doc\_id</span> - номер документа(Поставки или Комплектации)

<span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">doc\_type</span> - тип документа(PURCHASE\_ORDER, <span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">PHYSICAL\_SET\_ORDER</span>)

upFile - файл excel в formData

Пример вызова :

```
{ 
  "fileName" : "chestnyznak.xls",	  
  "content" : "0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAA......" - base64
}
```

Пример ответа:

```
{
    "c": "01de612f-209c-bbbb-167c-fc6f2e7649c0",
    "orderId": "1016",
    "success": true
}
```

Файл эксель:

1\. уникальные номера(второй лист):

[![imei.png](https://wiki.kak2c.ru/uploads/images/gallery/2023-06/scaled-1680-/imei.png)](https://wiki.kak2c.ru/uploads/images/gallery/2023-06/imei.png)

2\. Строки задания на стикерования(первый лист):

[![задание на стикерование.png](https://wiki.kak2c.ru/uploads/images/gallery/2023-06/scaled-1680-/zadanie-na-stikerovanie.png)](https://wiki.kak2c.ru/uploads/images/gallery/2023-06/zadanie-na-stikerovanie.png)

##### Получение задания на стикерование

/api/lite/sticker/task

id(не обязательный) - номер задания на стикерование

parent\_doc\_id - номер Поставки или Комплектации

<span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">doc\_type</span> - тип документа(PURCHASE\_ORDER, <span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">PHYSICAL\_SET\_ORDER</span>)

Необходимо передать либо id, либо parent\_doc\_id и <span style="font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">doc\_type. Если не заполнить данные параметры то возвратится ошибка что документ не найден. </span>

Пример ответа:

```
{
	"id": "1037"
	"parentDocument": "1022"
    "items": [
    	{
        	"variantId": "1025",
            "productId": "af25e75b-412e-4a0c-9662-4db575bf6df3",
            "num": 1,
            "stickerTemplateName": "testTemplate",
            "stickerContentData" : "{        \"blocks\": [          {            \"name\": \"block1\",            \"value\": \"Состав: - 54% шерсть, 40% полиэстер, 5% другие нити, 1% эластан /nПодкладка - 100% полиэстер\"          },          {            \"name\": \"block2\",            \"value\": \"Рекомендации по уходу /n- Не стирать /n- Не отбеливать /n- Не сушить в стиральной машине /n- Гладить при средней температуре /n- Бережная профессиональная химчистка\"          },          {            \"name\": \"block_img\",            \"value\": \"https://asset1.marksandspencer.com/is/image/mands/SD_03_T15_1436T_XB_X_EC_1?$PRODVIEWER_SUB$\"          }          ]      }",
            "stickering": true,
            "stickeringWithUnigueNumber": true
        }
    ]
}
```

##### Получение списка типов документов в Кактусе

/api/lite/sticker/task/document\_types

Пример ответа:

```
[
    "ORDER",
    "PURCHASE_ORDER",
    "SKU_QTY_CORRECTION",
    "INTER_MOVEMENT",
    "PURCHASE_RETURN",
    "ORDER_RETURN",
    "TAKE_IN_PLAN",
    "TAKE_IN_FACT",
    "TAKE_OUT_PLAN",
    "TAKE_OUT_FACT",
    "TAKE_OUT_PACKING",
    "TAKE_OUT_PALLET",
    "COD_IMPORT",
    "COD_DOC",
    "COD_PAYMENT_DOC",
    "DELIVERY_PLAN",
    "DELIVERY_BILL_IMPORT",
    "DELIVERY_BILL_DOC",
    "WAREHOUSE_BILL_IMPORT",
    "WAREHOUSE_BILL_DOC",
    "CONFIRMATION",
    "RTU",
    "PTU",
    "STORNO_RTU",
    "PRICE_DOC",
    "RESERVE_DOC",
    "TAKE_OUT_LIST",
    "GATHER_REQUEST",
    "PAYMENT",
    "FORCED_BALANCE_PAYMENT",
    "ORDER_EXPENSE_PAYMENT_DOC",
    "ORDER_PAYMENT_DOC_FACT",
    "CUSTOMER_ORDER_PAYMENT_DOC_PLAN",
    "CUSTOMER_ORDER_PAYMENT_DOC_FACT",
    "CUSTOMER_ORDER_FULL_PAYMENT_DOC",
    "CLIENT_BILL",
    "CONDITION_MOVEMENT",
    "PHYSICAL_SET_ORDER",
    "BILLING_DOC",
    "STICKER_TASK"
]
```

##### Получение всех чз

**<span style="color: #212121; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">/products/all/unique\_numbers/excel</span>**

<span style="color: #212121; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', Helvetica, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Пример отчета: </span>

```
{
    "success": true,
    "url": "https://storage.yandexcloud.net/feed-cactus/un_test@test.ru_06.03.2024_12-00-44.xls"
}
```