Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CDEK Development
cdek-warehouse
Commits
0e8ddca3
Commit
0e8ddca3
authored
7 years ago
by
Anna
Browse files
Options
Download
Email Patches
Plain Diff
Доп. статус
parent
37f4b685
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
warehouse-common/warehouse-api/src/test/resources/test-files/waybill.json
+1
-0
.../warehouse-api/src/test/resources/test-files/waybill.json
warehouse-common/warehouse-dao/src/main/resources/com-cdek-warehouse-db-migration/V80__additional_status.sql
+21
-0
...om-cdek-warehouse-db-migration/V80__additional_status.sql
warehouse-common/warehouse-dao/src/main/resources/com-cdek-warehouse-db-migration/V81__waybill_add_column.sql
+1
-0
...m-cdek-warehouse-db-migration/V81__waybill_add_column.sql
warehouse-common/warehouse-dao/src/main/resources/com/warehouse/dao/mybatis/mappers/ReturningWaybillMapper.xml
+3
-1
.../warehouse/dao/mybatis/mappers/ReturningWaybillMapper.xml
warehouse-common/warehouse-dao/src/main/resources/com/warehouse/dao/mybatis/mappers/WaybillMapper.xml
+4
-2
...urces/com/warehouse/dao/mybatis/mappers/WaybillMapper.xml
warehouse-common/warehouse-dao/src/test/resources/entries/return_list.xml
+4
-1
.../warehouse-dao/src/test/resources/entries/return_list.xml
warehouse-common/warehouse-model/src/main/java/com/cdek/transport/model/returning/front/ReturningWaybillTO.java
+3
-3
...k/transport/model/returning/front/ReturningWaybillTO.java
warehouse-common/warehouse-model/src/main/java/com/cdek/transport/model/sync/CatalogType.java
+2
-0
.../main/java/com/cdek/transport/model/sync/CatalogType.java
warehouse-common/warehouse-model/src/main/java/com/cdek/transport/model/waybill/Waybill.java
+11
-0
...c/main/java/com/cdek/transport/model/waybill/Waybill.java
warehouse-common/warehouse-parent/pom.xml
+1
-1
warehouse-common/warehouse-parent/pom.xml
warehouse-common/warehouse-services/src/main/java/com/cdek/warehouse/services/sync/ek4/impl/SyncReturnListServiceImpl.java
+4
-5
...use/services/sync/ek4/impl/SyncReturnListServiceImpl.java
warehouse-common/warehouse-services/src/main/java/com/cdek/warehouse/services/sync/ek4integration/impl/WaybillSyncServiceImpl.java
+3
-0
...ices/sync/ek4integration/impl/WaybillSyncServiceImpl.java
warehouse-common/warehouse-services/src/test/resources/test-files/waybill.json
+1
-0
...house-services/src/test/resources/test-files/waybill.json
warehouse-common/warehouse-web/config/config_dev.properties
+1
-1
warehouse-common/warehouse-web/config/config_dev.properties
warehouse-common/warehouse-web/webapp/WEB-INF/config.properties
+1
-1
...use-common/warehouse-web/webapp/WEB-INF/config.properties
with
61 additions
and
15 deletions
+61
-15
warehouse-common/warehouse-api/src/test/resources/test-files/waybill.json
View file @
0e8ddca3
...
...
@@ -22,6 +22,7 @@
"outsizeCargo"
:
false
,
"intakeMode"
:
0
,
"currentState"
:
1
,
"additionalStatus"
:
1
,
"departmentState"
:
44
,
"deleted"
:
false
}
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-dao/src/main/resources/com-cdek-warehouse-db-migration/V80__additional_status.sql
0 → 100644
View file @
0e8ddca3
CREATE
TABLE
delivery_detail_additional_status
(
id
SERIAL
NOT
NULL
,
code
TEXT
NOT
NULL
,
name
TEXT
NOT
NULL
,
lang
TEXT
NOT
NULL
,
for_online_shop
BOOLEAN
NOT
NULL
DEFAULT
FALSE
,
code_status
TEXT
NOT
NULL
,
active
BOOLEAN
NOT
NULL
DEFAULT
TRUE
,
date_created
timestamp
NOT
NULL
DEFAULT
NOW
(),
date_updated
timestamp
NOT
NULL
DEFAULT
NOW
(),
CONSTRAINT
delivery_detail_additional_status_pkey
PRIMARY
KEY
(
id
),
CONSTRAINT
udx_delivery_detail_additional_status
UNIQUE
(
code
,
lang
)
);
COMMENT
ON
TABLE
delivery_detail_additional_status
IS
'Справочник дополнительных статусов ДД'
;
COMMENT
ON
COLUMN
delivery_detail_additional_status
.
id
IS
'Идентификатор'
;
COMMENT
ON
COLUMN
delivery_detail_additional_status
.
code
IS
'Код статуса'
;
COMMENT
ON
COLUMN
delivery_detail_additional_status
.
name
IS
'Наименование статуса'
;
COMMENT
ON
COLUMN
delivery_detail_additional_status
.
lang
IS
'Код языка ISO-639-3'
;
COMMENT
ON
COLUMN
delivery_detail_additional_status
.
for_online_shop
IS
'Статус для заказа ИМ'
;
COMMENT
ON
COLUMN
delivery_detail_additional_status
.
code_status
IS
'Код основного статуса'
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-dao/src/main/resources/com-cdek-warehouse-db-migration/V81__waybill_add_column.sql
0 → 100644
View file @
0e8ddca3
ALTER
TABLE
waybill
ADD
COLUMN
additional_status
TEXT
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-dao/src/main/resources/com/warehouse/dao/mybatis/mappers/ReturningWaybillMapper.xml
View file @
0e8ddca3
...
...
@@ -62,7 +62,7 @@
waybill.number AS waybillNumber,
waybill.number_in AS waybillNumberIn,
waybill.date AS waybillDate,
waybill.current_stat
e AS waybillCurrentState,
additional_status.nam
e AS waybillCurrentState,
replace((contragent_seller.name::json->#{lang})::text, '"', '') AS sellerName,
rw.id_sost AS idSost,
rw.price AS price,
...
...
@@ -75,6 +75,8 @@
FROM returning_waybill rw
LEFT JOIN return_list r ON r.uuid=rw.return_list_uuid
LEFT JOIN waybill waybill ON waybill.uuid=rw.waybill_uuid
LEFT JOIN delivery_detail_additional_status additional_status ON additional_status.code = waybill.additional_status
AND additional_status.lang = #{lang}
LEFT JOIN cargo_place cp ON cp.waybill_uuid = waybill.uuid
LEFT JOIN cargo_place_status cps ON cps.cargo_place_uuid = cp.uuid
LEFT JOIN warehouse warehouse ON warehouse.code = rw.id_sklad AND warehouse.lang=#{lang}
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-dao/src/main/resources/com/warehouse/dao/mybatis/mappers/WaybillMapper.xml
View file @
0e8ddca3
...
...
@@ -13,11 +13,11 @@
INSERT INTO waybill
(uuid, external_id, number, number_in, shipper_city,recipient_city, shipper_branch, recipient_branch, anchor_branch,
type, shipping_scheme_type, delivery_mode, route_id, recipient_address, delivery_point_code, tariff, payer_id,
dangerous_cargo, outsize_cargo, intake_mode, current_state, department_state, deleted, date, date_updated, date_synced)
dangerous_cargo, outsize_cargo, intake_mode, current_state,
additional_status,
department_state, deleted, date, date_updated, date_synced)
VALUES (
#{uuid}::uuid, #{externalId}, #{number}, #{numberIn}, #{shipperCity}, #{recipientCity}, #{shipperBranch}, #{recipientBranch}, #{anchorBranch},
#{type}, #{shippingSchemeType}, #{deliveryMode}, #{routeId}, #{recipientAddress}, #{deliveryPointCode}, #{tariff}, #{payerId},
#{dangerousCargo}, #{outsizeCargo}, #{intakeMode}, #{currentState}, #{departmentState}, #{deleted}, #{date}, #{dateUpdated}, #{dateSynced}
#{dangerousCargo}, #{outsizeCargo}, #{intakeMode}, #{currentState},
#{additionalStatus},
#{departmentState}, #{deleted}, #{date}, #{dateUpdated}, #{dateSynced}
)
</insert>
...
...
@@ -48,6 +48,7 @@
intake_mode = #{intakeMode},
current_state = #{currentState},
additional_status = #{additionalStatus},
department_state = #{departmentState},
deleted = #{deleted},
...
...
@@ -256,6 +257,7 @@
<result
column=
"intake_mode"
property=
"intakeMode"
/>
<result
column=
"current_state"
property=
"currentState"
/>
<result
column=
"additional_status"
property=
"additionalStatus"
/>
<result
column=
"department_state"
property=
"departmentState"
/>
<result
column=
'deleted'
property=
'deleted'
/>
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-dao/src/test/resources/entries/return_list.xml
View file @
0e8ddca3
...
...
@@ -27,6 +27,9 @@
<employee
id=
"2"
code=
"2"
name=
"user2"
lang=
"rus"
active=
"true"
/>
<employee
id=
"3"
code=
"3"
name=
"user3"
lang=
"rus"
active=
"true"
/>
<!-- Допю статус -->
<delivery_detail_additional_status
id=
"1"
code=
"1"
name=
"статус"
lang=
"rus"
active=
"true"
date_created=
"2017-10-25 02:26:48.161"
date_updated=
"2017-10-25 02:26:49.225"
code_status=
"1"
/>
<contragent
uuid=
"053405af-b5ea-44ae-969d-5a9fb1796674"
carrier=
"true"
country_code=
"22"
city_code=
"222"
kind_of_activity_code=
"22"
ownership_type_code=
"22"
name=
"{"rus": "контрагент1"}"
contract_number=
"222"
firstname=
"222"
date_created=
"2017-10-04 23:28:02.678"
date_updated=
"2017-10-04 23:28:03.877"
...
...
@@ -88,7 +91,7 @@
waybill_uuid=
"053405af-b5ea-44ae-969d-5a9fb1797734"
date=
"2017-09-22 01:15:26.871"
return_list_uuid=
"053405af-b5ea-44ae-969d-5a9fb1796632"
/>
<waybill
uuid=
"053405af-b5ea-44ae-969d-5a9fb1797734"
external_id=
"38457"
number=
"987654"
number_in=
"123456"
shipper_city=
"4f18j59mnhf3uhlb3po57q2g8b"
number_in=
"123456"
shipper_city=
"4f18j59mnhf3uhlb3po57q2g8b"
additional_status=
"1"
recipient_city=
"7cfnc25kf46cf2hrnkc0beuljl"
shipper_branch=
"17sskgj0attu81m0k515mcij65"
recipient_branch=
"30fjlrlj242c9lts9jeo1g4qnt"
anchor_branch=
"1pm6p09l0vn2ka1r27179gru3t"
type=
"-2086904598"
shipping_scheme_type=
"2069266678"
delivery_mode=
"-7742738610918953084"
route_id=
"8004217737854698935"
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-model/src/main/java/com/cdek/transport/model/returning/front/ReturningWaybillTO.java
View file @
0e8ddca3
...
...
@@ -53,7 +53,7 @@ public class ReturningWaybillTO extends BaseEntity {
/*
* Доп.статус
*/
private
Integer
currentState
;
private
String
currentState
;
/*
* Причина удаления
...
...
@@ -142,11 +142,11 @@ public class ReturningWaybillTO extends BaseEntity {
this
.
sost
=
sost
;
}
public
Integer
getCurrentState
()
{
public
String
getCurrentState
()
{
return
currentState
;
}
public
void
setCurrentState
(
Integer
currentState
)
{
public
void
setCurrentState
(
String
currentState
)
{
this
.
currentState
=
currentState
;
}
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-model/src/main/java/com/cdek/transport/model/sync/CatalogType.java
View file @
0e8ddca3
...
...
@@ -17,6 +17,8 @@ public enum CatalogType {
SHIPMENT_PROBLEM_TYPE
,
ACCEPTANCE_PROBLEM_TYPE
,
SPEED_TYPE
,
/*доп. статусы*/
DELIVERY_DETAIL_ADDITIONAL_STATUS
,
CARRIERS
,
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-model/src/main/java/com/cdek/transport/model/waybill/Waybill.java
View file @
0e8ddca3
...
...
@@ -96,6 +96,9 @@ public class Waybill extends BaseEntity {
/** Текущий статус накладной Состояние */
private
Integer
currentState
;
/** Доп. статус накладной Состояние */
private
String
additionalStatus
;
/** Текущий статус накладной Филиал */
private
Integer
departmentState
;
...
...
@@ -288,6 +291,14 @@ public class Waybill extends BaseEntity {
this
.
currentState
=
currentState
;
}
public
String
getAdditionalStatus
()
{
return
additionalStatus
;
}
public
void
setAdditionalStatus
(
String
additionalStatus
)
{
this
.
additionalStatus
=
additionalStatus
;
}
public
Integer
getDepartmentState
()
{
return
departmentState
;
}
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-parent/pom.xml
View file @
0e8ddca3
...
...
@@ -15,7 +15,7 @@
<!-- Релизная версия для отображения на интерфейсе-->
<releaseVerion>
dev
</releaseVerion>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<cdek.chinaLib.version>
1.0-12
2
</cdek.chinaLib.version>
<cdek.chinaLib.version>
1.0-12
5
</cdek.chinaLib.version>
<cdek.commons.version>
1.0-75
</cdek.commons.version>
<cdek.catalog.common.version>
1.0-4
</cdek.catalog.common.version>
<cdek.catalog.entities.version>
1.0-40
</cdek.catalog.entities.version>
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-services/src/main/java/com/cdek/warehouse/services/sync/ek4/impl/SyncReturnListServiceImpl.java
View file @
0e8ddca3
...
...
@@ -331,12 +331,11 @@ public class SyncReturnListServiceImpl extends BaseSyncDispatcher implements Syn
//Assert.notNull(response.document.getCode(), "ReturningWaybillId can't be null");
//returnList.setReturnNumberOrd(Long.valueOf(response.document.getNumber()));
//returnList.setReturnOrderId(Long.valueOf(response.document.getCode()));
returnList
.
setReturnNumberOrd
(
response
.
document
.
getReturnOrderNumber
());
Waybill
waybill
=
waybillService
.
findByNumber
(
response
.
document
.
getReturnOrderNumber
());
Assert
.
notNull
(
waybill
,
"Waybill can't be null"
);
Assert
.
notNull
(
waybill
.
getNumber
(),
"Waybill number can't be null"
);
Assert
.
notNull
(
waybill
.
getExternalId
(),
"Waybill externalId can't be null"
);
returnList
.
setReturnNumberOrd
(
waybill
.
getNumber
());
returnList
.
setReturnOrderId
(
waybill
.
getExternalId
());
if
(
waybill
!=
null
)
{
returnList
.
setReturnOrderId
(
waybill
.
getExternalId
());
}
returnListService
.
save
(
returnList
);
return
returnList
;
}
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-services/src/main/java/com/cdek/warehouse/services/sync/ek4integration/impl/WaybillSyncServiceImpl.java
View file @
0e8ddca3
...
...
@@ -530,6 +530,9 @@ public class WaybillSyncServiceImpl implements WaybillSyncService {
waybill
.
setOutsizeCargo
(
order
.
big
);
waybill
.
setIntakeMode
(
order
.
idRegimFrom
==
null
?
null
:
Long
.
valueOf
(
order
.
idRegimFrom
));
waybill
.
setCurrentState
(
order
.
idExecSost
);
if
(
order
.
idExecsostDop
==
null
)
{
waybill
.
setAdditionalStatus
(
String
.
valueOf
(
order
.
idExecsostDop
));
}
waybill
.
setDepartmentState
(
order
.
idExecCity
);
waybill
.
setDeleted
(
Constants
.
SYNC_EK4_WAYBILL_DELETED_FLAG
.
equals
(
order
.
idExecSost
));
if
(
found
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-services/src/test/resources/test-files/waybill.json
View file @
0e8ddca3
...
...
@@ -22,6 +22,7 @@
"outsizeCargo"
:
false
,
"intakeMode"
:
0
,
"currentState"
:
1
,
"additionalStatus"
:
1
,
"departmentState"
:
44
,
"deleted"
:
false
}
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-web/config/config_dev.properties
View file @
0e8ddca3
...
...
@@ -38,7 +38,7 @@ event.type.contragent = contragent
# Настройки синхронизации каталогов
cdek.integration.connectTimeoutSeconds
=
3600
url.catalog.server
=
http://catalogserver.qa2.cdek.ru/catalog/
catalogs.needEntities
=
CITY, COUNTRY, LANGUAGE, USERS_CATALOG, EMPLOYEE, BRANCH, WAREHOUSE, TRANSPORT_TYPE, FLIGHT, SHIPMENT_PROBLEM_TYPE, ACCEPTANCE_PROBLEM_TYPE
catalogs.needEntities
=
CITY, COUNTRY, LANGUAGE, USERS_CATALOG, EMPLOYEE, BRANCH, WAREHOUSE, TRANSPORT_TYPE, FLIGHT, SHIPMENT_PROBLEM_TYPE, ACCEPTANCE_PROBLEM_TYPE
, DELIVERY_DETAIL_ADDITIONAL_STATUS
catalog.refresh.timeout
=
86400000
#Настройки таймутов для синхронизации
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-web/webapp/WEB-INF/config.properties
View file @
0e8ddca3
...
...
@@ -37,7 +37,7 @@ event.type.contragent = contragent
# Настройки синхронизации каталогов
cdek.integration.connectTimeoutSeconds
=
3600
url.catalog.server
=
http://catalogserver.qa2.cdek.ru/catalog/
catalogs.needEntities
=
CITY, COUNTRY, LANGUAGE, USERS_CATALOG, EMPLOYEE, BRANCH, WAREHOUSE, TRANSPORT_TYPE, FLIGHT, SHIPMENT_PROBLEM_TYPE, ACCEPTANCE_PROBLEM_TYPE
catalogs.needEntities
=
CITY, COUNTRY, LANGUAGE, USERS_CATALOG, EMPLOYEE, BRANCH, WAREHOUSE, TRANSPORT_TYPE, FLIGHT, SHIPMENT_PROBLEM_TYPE, ACCEPTANCE_PROBLEM_TYPE
, DELIVERY_DETAIL_ADDITIONAL_STATUS
catalog.refresh.timeout
=
86400000
#Настройки таймутов для синхронизации
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment