Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
e89d53f0
Commit
e89d53f0
authored
8 years ago
by
Xenia Ulyanova
Browse files
Options
Download
Email Patches
Plain Diff
review fixes
parent
a05308a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
warehouse-common/warehouse-dao/src/main/resources/com-cdek-warehouse-db-migration/V38__terminal_documents.sql
+55
-30
...m-cdek-warehouse-db-migration/V38__terminal_documents.sql
warehouse-common/warehouse-dao/src/main/resources/com/warehouse/dao/mybatis/mappers/document/DeconsolidationMapper.xml
+1
-1
...se/dao/mybatis/mappers/document/DeconsolidationMapper.xml
warehouse-common/warehouse-services/src/main/java/com/cdek/warehouse/services/operation/impl/CorrectionAttemptServiceImpl.java
+0
-8
...services/operation/impl/CorrectionAttemptServiceImpl.java
with
56 additions
and
39 deletions
+56
-39
warehouse-common/warehouse-dao/src/main/resources/com-cdek-warehouse-db-migration/V38__terminal_documents.sql
View file @
e89d53f0
...
...
@@ -5,10 +5,13 @@ DROP TABLE IF EXISTS document_return_undelivered;
DROP
TABLE
IF
EXISTS
operation_return_undelivered_create_or_update
;
-- обновления модели Операции
ALTER
TABLE
operation_force_cargo_place_deletion
ADD
COLUMN
document_uuid
UUID
;
ALTER
TABLE
operation_force_cargo_place_deletion
ADD
COLUMN
document_uuid
UUID
;
BEGIN
;
ALTER
TABLE
operation_force_cargo_place_deletion
DROP
CONSTRAINT
check_document
;
ALTER
TABLE
operation_force_cargo_place_deletion
ADD
CONSTRAINT
check_document
CHECK
(
document_type
=
'CONSOLIDATION'
OR
document_type
=
'DELIVERY'
);
ALTER
TABLE
operation_force_cargo_place_deletion
DROP
CONSTRAINT
check_document
;
ALTER
TABLE
operation_force_cargo_place_deletion
ADD
CONSTRAINT
check_document
CHECK
(
document_type
=
'CONSOLIDATION'
OR
document_type
=
'DELIVERY'
);
COMMIT
;
CREATE
TABLE
document_return_undelivered
(
...
...
@@ -25,31 +28,43 @@ CREATE TABLE document_return_undelivered (
FOREIGN
KEY
(
uuid
)
REFERENCES
document
(
uuid
)
);
CREATE
INDEX
return_sked_index
ON
document_return_undelivered
(
sked_number
);
CREATE
INDEX
return_ext_id_index
ON
document_return_undelivered
(
external_id
);
CREATE
INDEX
return_ext_date_index
ON
document_return_undelivered
(
external_date_updated
);
CREATE
INDEX
return_emp_out_index
ON
document_return_undelivered
(
employee_passed
);
CREATE
INDEX
return_emp_in_index
ON
document_return_undelivered
(
employee_accepted
);
CREATE
TABLE
operation_return_undelivered_create_or_update
(
uuid
UUID
UNIQUE
,
type
VARCHAR
(
50
),
status
VARCHAR
(
50
),
date
DATE
NOT
NULL
,
description
JSONB
,
uuid
UUID
UNIQUE
,
type
VARCHAR
(
50
),
status
VARCHAR
(
50
),
date
DATE
NOT
NULL
,
description
JSONB
,
document_uuid
UUID
,
document_type
VARCHAR
(
50
),
branch
VARCHAR
(
50
),
document_uuid
UUID
,
document_type
VARCHAR
(
50
),
branch
VARCHAR
(
50
),
user_code
VARCHAR
(
50
),
error_code
VARCHAR
(
50
),
user_code
VARCHAR
(
50
),
error_code
VARCHAR
(
50
),
employee_passed
VARCHAR
(
50
),
employee_passed
VARCHAR
(
50
),
employee_accepted
VARCHAR
(
50
),
date_created
TIMESTAMP
NOT
NULL
DEFAULT
NOW
(),
date_updated
TIMESTAMP
NOT
NULL
DEFAULT
NOW
(),
date_created
TIMESTAMP
NOT
NULL
DEFAULT
NOW
(),
date_updated
TIMESTAMP
NOT
NULL
DEFAULT
NOW
(),
PRIMARY
KEY
(
uuid
),
CONSTRAINT
check_types
CHECK
(
type
=
'CREATION'
OR
type
=
'UPDATE'
)
);
CREATE
INDEX
op_return_created_index
ON
operation_return_undelivered_create_or_update
(
date_created
);
CREATE
INDEX
op_return_status_index
ON
operation_return_undelivered_create_or_update
(
status
);
CREATE
INDEX
op_return_document_index
ON
operation_return_undelivered_create_or_update
(
document_uuid
);
CREATE
INDEX
op_return_branch_index
ON
operation_return_undelivered_create_or_update
(
branch
);
CREATE
INDEX
op_return_user_index
ON
operation_return_undelivered_create_or_update
(
user_code
);
CREATE
INDEX
op_return_error_index
ON
operation_return_undelivered_create_or_update
(
error_code
);
CREATE
TABLE
document_delivery
(
...
...
@@ -58,33 +73,43 @@ CREATE TABLE document_delivery (
external_date_updated
TIMESTAMP
,
external_id
BIGINT
,
sked_number
VARCHAR
(
20
),
employee_passed
VARCHAR
(
20
),
employee_accepted
VARCHAR
(
20
),
employee_passed
VARCHAR
(
20
),
employee_accepted
VARCHAR
(
20
),
PRIMARY
KEY
(
uuid
),
FOREIGN
KEY
(
uuid
)
REFERENCES
document
(
uuid
)
);
CREATE
INDEX
delivery_sked_index
ON
document_delivery
(
sked_number
);
CREATE
INDEX
delivery_ext_id_index
ON
document_delivery
(
external_id
);
CREATE
INDEX
delivery_ext_date_index
ON
document_delivery
(
external_date_updated
);
CREATE
INDEX
delivery_emp_out_index
ON
document_delivery
(
employee_passed
);
CREATE
INDEX
delivery_emp_in_index
ON
document_delivery
(
employee_accepted
);
CREATE
TABLE
operation_delivery_create_or_update
(
uuid
UUID
UNIQUE
,
type
VARCHAR
(
50
),
document_type
VARCHAR
(
50
),
status
VARCHAR
(
50
),
user_code
VARCHAR
(
20
),
error_code
VARCHAR
(
50
),
description
JSONB
,
date_created
TIMESTAMP
NOT
NULL
DEFAULT
NOW
(),
date_updated
TIMESTAMP
NOT
NULL
DEFAULT
NOW
(),
uuid
UUID
UNIQUE
,
type
VARCHAR
(
50
),
document_type
VARCHAR
(
50
),
status
VARCHAR
(
50
),
user_code
VARCHAR
(
20
),
error_code
VARCHAR
(
50
),
description
JSONB
,
date_created
TIMESTAMP
NOT
NULL
DEFAULT
NOW
(),
date_updated
TIMESTAMP
NOT
NULL
DEFAULT
NOW
(),
document_uuid
UUID
,
employee_passed
VARCHAR
(
20
),
employee_accepted
VARCHAR
(
20
),
date
DATE
NOT
NULL
,
date
DATE
NOT
NULL
,
branch
VARCHAR
(
50
),
PRIMARY
KEY
(
uuid
),
CONSTRAINT
check_types
CHECK
(
type
=
'CREATION'
OR
type
=
'UPDATE'
)
);
-- TODO refactor: indexes?
\ No newline at end of file
CREATE
INDEX
op_delivery_created_index
ON
operation_delivery_create_or_update
(
date_created
);
CREATE
INDEX
op_delivery_status_index
ON
operation_delivery_create_or_update
(
status
);
CREATE
INDEX
op_delivery_document_index
ON
operation_delivery_create_or_update
(
document_uuid
);
CREATE
INDEX
op_delivery_branch_index
ON
operation_delivery_create_or_update
(
branch
);
CREATE
INDEX
op_delivery_user_index
ON
operation_delivery_create_or_update
(
user_code
);
CREATE
INDEX
op_delivery_error_index
ON
operation_delivery_create_or_update
(
error_code
);
\ 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/document/DeconsolidationMapper.xml
View file @
e89d53f0
...
...
@@ -42,7 +42,7 @@
<delete
id=
"delete"
parameterType=
"Deconsolidation"
>
<include
refid=
"com.cdek.warehouse.dao.mapper.document.DocumentMapper.deleteSql"
/>
<!--
TODO refactor: может не удалять
-->
<!--
для каждого КГМ разрешен только один документ расконсолидации
-->
UPDATE document_deconsolidation
SET cargo_place_uuid = NULL
WHERE uuid = #{uuid};
...
...
This diff is collapsed.
Click to expand it.
warehouse-common/warehouse-services/src/main/java/com/cdek/warehouse/services/operation/impl/CorrectionAttemptServiceImpl.java
View file @
e89d53f0
...
...
@@ -112,7 +112,6 @@ public class CorrectionAttemptServiceImpl extends DocumentOperationService imple
/**
* Операция добавления должна происходить в ту же дату, что и дата документа Приход-Коррекция
*/
//todo refactor, create date validator
protected
void
checkDate
(
CorrectionAttempt
operation
)
{
Assert
.
notNull
(
operation
.
getDateUpdated
());
CorrectionIncome
correctionIncome
=
correctionIncomeService
.
findByUuid
(
operation
.
getDocumentUuid
());
...
...
@@ -123,13 +122,6 @@ public class CorrectionAttemptServiceImpl extends DocumentOperationService imple
operation
.
makeFailed
(
e
.
getKey
());
operationDAO
.
save
(
operation
);
}
//TODO refactor: удалить мусор
// LocalDate operationDate = operation.getDateCreated().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// LocalDate documentDate = correctionIncome.getDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// if (!operationDate.equals(documentDate)) {
//
// operation.makeFailed(OperationError.DOCUMENT_AND_OPERATION_DATE_MISMATCH.getCode());
// }
}
/**
...
...
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
Menu
Projects
Groups
Snippets
Help