Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
d453c659
Commit
d453c659
authored
May 28, 2022
by
季圣华
Browse files
增加关联明细id字段,解决明细中重复商品进行批次发货遇到的问题
parent
1cc71232
Changes
9
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/docs/jsh_erp.sql
View file @
d453c659
...
@@ -219,6 +219,7 @@ CREATE TABLE `jsh_depot_item` (
...
@@ -219,6 +219,7 @@ CREATE TABLE `jsh_depot_item` (
`sn_list`
varchar
(
2000
)
DEFAULT
NULL
COMMENT
'序列号列表'
,
`sn_list`
varchar
(
2000
)
DEFAULT
NULL
COMMENT
'序列号列表'
,
`batch_number`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'批号'
,
`batch_number`
varchar
(
100
)
DEFAULT
NULL
COMMENT
'批号'
,
`expiration_date`
datetime
DEFAULT
NULL
COMMENT
'有效日期'
,
`expiration_date`
datetime
DEFAULT
NULL
COMMENT
'有效日期'
,
`link_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'关联明细id'
,
`tenant_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'租户id'
,
`tenant_id`
bigint
(
20
)
DEFAULT
NULL
COMMENT
'租户id'
,
`delete_flag`
varchar
(
1
)
DEFAULT
'0'
COMMENT
'删除标记,0未删除,1删除'
,
`delete_flag`
varchar
(
1
)
DEFAULT
'0'
COMMENT
'删除标记,0未删除,1删除'
,
PRIMARY
KEY
(
`id`
),
PRIMARY
KEY
(
`id`
),
...
@@ -231,24 +232,24 @@ CREATE TABLE `jsh_depot_item` (
...
@@ -231,24 +232,24 @@ CREATE TABLE `jsh_depot_item` (
-- ----------------------------
-- ----------------------------
-- Records of jsh_depot_item
-- Records of jsh_depot_item
-- ----------------------------
-- ----------------------------
INSERT
INTO
`jsh_depot_item`
VALUES
(
'312'
,
'258'
,
'588'
,
'10'
,
'个'
,
null
,
'10.000000'
,
'10.000000'
,
'11.000000'
,
null
,
'110.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'312'
,
'258'
,
'588'
,
'10'
,
'个'
,
null
,
'10.000000'
,
'10.000000'
,
'11.000000'
,
null
,
'110.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'313'
,
'259'
,
'588'
,
'10'
,
'个'
,
null
,
'10.000000'
,
'10.000000'
,
'11.000000'
,
null
,
'110.000000'
,
null
,
'14'
,
null
,
null
,
'0.000000'
,
'110.000000'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'313'
,
'259'
,
'588'
,
'10'
,
'个'
,
null
,
'10.000000'
,
'10.000000'
,
'11.000000'
,
null
,
'110.000000'
,
null
,
'14'
,
null
,
null
,
'0.000000'
,
'110.000000'
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'314'
,
'260'
,
'588'
,
'10'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'11.000000'
,
'11.000000'
,
'22.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'22.000000'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'314'
,
'260'
,
'588'
,
'10'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'11.000000'
,
'11.000000'
,
'22.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'22.000000'
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'315'
,
'261'
,
'588'
,
'10'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'22.000000'
,
null
,
'44.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'315'
,
'261'
,
'588'
,
'10'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'22.000000'
,
null
,
'44.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'316'
,
'262'
,
'588'
,
'10'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'22.000000'
,
null
,
'44.000000'
,
null
,
'14'
,
null
,
null
,
'0.000000'
,
'44.000000'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'316'
,
'262'
,
'588'
,
'10'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'22.000000'
,
null
,
'44.000000'
,
null
,
'14'
,
null
,
null
,
'0.000000'
,
'44.000000'
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'317'
,
'263'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'22.000000'
,
'22.000000'
,
'22.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'22.000000'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'317'
,
'263'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'22.000000'
,
'22.000000'
,
'22.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'22.000000'
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'318'
,
'264'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'22.000000'
,
null
,
'22.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'318'
,
'264'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'22.000000'
,
null
,
'22.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'319'
,
'265'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'22.000000'
,
null
,
'22.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'319'
,
'265'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'22.000000'
,
null
,
'22.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'320'
,
'266'
,
'568'
,
'2'
,
'个'
,
null
,
'5.000000'
,
'5.000000'
,
'11.000000'
,
null
,
'55.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'320'
,
'266'
,
'568'
,
'2'
,
'个'
,
null
,
'5.000000'
,
'5.000000'
,
'11.000000'
,
null
,
'55.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'321'
,
'267'
,
'568'
,
'2'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'15.000000'
,
null
,
'30.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'321'
,
'267'
,
'568'
,
'2'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'15.000000'
,
null
,
'30.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'322'
,
'268'
,
'568'
,
'2'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'11.000000'
,
null
,
'11.000000'
,
null
,
'14'
,
'15'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'322'
,
'268'
,
'568'
,
'2'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'11.000000'
,
null
,
'11.000000'
,
null
,
'14'
,
'15'
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'323'
,
'269'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'0.000000'
,
null
,
'0.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
'组合件'
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'323'
,
'269'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'0.000000'
,
null
,
'0.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
'组合件'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'324'
,
'269'
,
'568'
,
'2'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'0.000000'
,
null
,
'0.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
'普通子件'
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'324'
,
'269'
,
'568'
,
'2'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'0.000000'
,
null
,
'0.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
'普通子件'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'325'
,
'270'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'0.000000'
,
null
,
'0.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
'组合件'
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'325'
,
'270'
,
'588'
,
'10'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'0.000000'
,
null
,
'0.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
'组合件'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'326'
,
'270'
,
'568'
,
'2'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'0.000000'
,
null
,
'0.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
'普通子件'
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'326'
,
'270'
,
'568'
,
'2'
,
'个'
,
null
,
'1.000000'
,
'1.000000'
,
'0.000000'
,
null
,
'0.000000'
,
null
,
'14'
,
null
,
null
,
null
,
null
,
'普通子件'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'327'
,
'271'
,
'570'
,
'4'
,
'个'
,
null
,
'10.000000'
,
'10.000000'
,
'8.000000'
,
'8.000000'
,
'80.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'80.000000'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'327'
,
'271'
,
'570'
,
'4'
,
'个'
,
null
,
'10.000000'
,
'10.000000'
,
'8.000000'
,
'8.000000'
,
'80.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'80.000000'
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'328'
,
'272'
,
'570'
,
'4'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'14.000000'
,
'14.000000'
,
'28.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'28.000000'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'328'
,
'272'
,
'570'
,
'4'
,
'个'
,
null
,
'2.000000'
,
'2.000000'
,
'14.000000'
,
'14.000000'
,
'28.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'28.000000'
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'330'
,
'273'
,
'619'
,
'37'
,
'件'
,
'橙色,L'
,
'5.000000'
,
'5.000000'
,
'12.000000'
,
'12.000000'
,
'60.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'60.000000'
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
INSERT
INTO
`jsh_depot_item`
VALUES
(
'330'
,
'273'
,
'619'
,
'37'
,
'件'
,
'橙色,L'
,
'5.000000'
,
'5.000000'
,
'12.000000'
,
'12.000000'
,
'60.000000'
,
null
,
'14'
,
null
,
'0.000000'
,
'0.000000'
,
'60.000000'
,
null
,
null
,
null
,
null
,
null
,
'63'
,
'0'
);
-- ----------------------------
-- ----------------------------
-- Table structure for jsh_function
-- Table structure for jsh_function
...
...
jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt
View file @
d453c659
...
@@ -1353,4 +1353,11 @@ alter table jsh_system_config add sale_agreement varchar(500) DEFAULT NULL COMME
...
@@ -1353,4 +1353,11 @@ alter table jsh_system_config add sale_agreement varchar(500) DEFAULT NULL COMME
-- --------------------------------------------------------
-- --------------------------------------------------------
alter table jsh_depot_head add purchase_status varchar(1) DEFAULT NULL COMMENT '采购状态,0未采购、2完成采购、3部分采购' after status;
alter table jsh_depot_head add purchase_status varchar(1) DEFAULT NULL COMMENT '采购状态,0未采购、2完成采购、3部分采购' after status;
alter table jsh_system_config add purchase_by_sale_flag varchar(1) DEFAULT '0' COMMENT '以销定购启用标记,0未启用,1启用' after minus_stock_flag;
alter table jsh_system_config add purchase_by_sale_flag varchar(1) DEFAULT '0' COMMENT '以销定购启用标记,0未启用,1启用' after minus_stock_flag;
update jsh_depot_head set purchase_status='0';
update jsh_depot_head set purchase_status='0';
\ No newline at end of file
-- --------------------------------------------------------
-- 时间 2022年05月28日
-- by jishenghua
-- 给单据子表增加关联明细id
-- --------------------------------------------------------
alter table jsh_depot_item add link_id bigint(20) DEFAULT NULL COMMENT '关联明细id' after expiration_date;
\ No newline at end of file
jshERP-boot/src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
d453c659
...
@@ -207,12 +207,13 @@ public class DepotItemController {
...
@@ -207,12 +207,13 @@ public class DepotItemController {
item
.
put
(
"operNumber"
,
diEx
.
getOperNumber
());
item
.
put
(
"operNumber"
,
diEx
.
getOperNumber
());
item
.
put
(
"basicNumber"
,
diEx
.
getBasicNumber
());
item
.
put
(
"basicNumber"
,
diEx
.
getBasicNumber
());
item
.
put
(
"preNumber"
,
diEx
.
getOperNumber
());
//原数量
item
.
put
(
"preNumber"
,
diEx
.
getOperNumber
());
//原数量
item
.
put
(
"finishNumber"
,
depotItemService
.
getFinishNumber
(
diEx
.
getMaterialExtendId
(),
diEx
.
getHeaderId
(),
unitInfo
,
materialUnit
,
linkType
));
//已入库|已出库
item
.
put
(
"finishNumber"
,
depotItemService
.
getFinishNumber
(
diEx
.
getMaterialExtendId
(),
diEx
.
getId
(),
diEx
.
getHeaderId
(),
unitInfo
,
materialUnit
,
linkType
));
//已入库|已出库
item
.
put
(
"purchaseDecimal"
,
diEx
.
getPurchaseDecimal
());
//采购价
item
.
put
(
"purchaseDecimal"
,
diEx
.
getPurchaseDecimal
());
//采购价
item
.
put
(
"unitPrice"
,
diEx
.
getUnitPrice
());
item
.
put
(
"unitPrice"
,
diEx
.
getUnitPrice
());
item
.
put
(
"taxUnitPrice"
,
diEx
.
getTaxUnitPrice
());
item
.
put
(
"taxUnitPrice"
,
diEx
.
getTaxUnitPrice
());
item
.
put
(
"allPrice"
,
diEx
.
getAllPrice
());
item
.
put
(
"allPrice"
,
diEx
.
getAllPrice
());
item
.
put
(
"remark"
,
diEx
.
getRemark
());
item
.
put
(
"remark"
,
diEx
.
getRemark
());
item
.
put
(
"linkId"
,
diEx
.
getLinkId
());
item
.
put
(
"depotId"
,
diEx
.
getDepotId
()
==
null
?
""
:
diEx
.
getDepotId
());
item
.
put
(
"depotId"
,
diEx
.
getDepotId
()
==
null
?
""
:
diEx
.
getDepotId
());
item
.
put
(
"depotName"
,
diEx
.
getDepotId
()
==
null
?
""
:
diEx
.
getDepotName
());
item
.
put
(
"depotName"
,
diEx
.
getDepotId
()
==
null
?
""
:
diEx
.
getDepotName
());
item
.
put
(
"anotherDepotId"
,
diEx
.
getAnotherDepotId
()
==
null
?
""
:
diEx
.
getAnotherDepotId
());
item
.
put
(
"anotherDepotId"
,
diEx
.
getAnotherDepotId
()
==
null
?
""
:
diEx
.
getAnotherDepotId
());
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItem.java
View file @
d453c659
...
@@ -46,6 +46,8 @@ public class DepotItem {
...
@@ -46,6 +46,8 @@ public class DepotItem {
private
Date
expirationDate
;
private
Date
expirationDate
;
private
Long
linkId
;
private
Long
tenantId
;
private
Long
tenantId
;
private
String
deleteFlag
;
private
String
deleteFlag
;
...
@@ -218,6 +220,14 @@ public class DepotItem {
...
@@ -218,6 +220,14 @@ public class DepotItem {
this
.
expirationDate
=
expirationDate
;
this
.
expirationDate
=
expirationDate
;
}
}
public
Long
getLinkId
()
{
return
linkId
;
}
public
void
setLinkId
(
Long
linkId
)
{
this
.
linkId
=
linkId
;
}
public
Long
getTenantId
()
{
public
Long
getTenantId
()
{
return
tenantId
;
return
tenantId
;
}
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/DepotItemExample.java
View file @
d453c659
...
@@ -1426,6 +1426,66 @@ public class DepotItemExample {
...
@@ -1426,6 +1426,66 @@ public class DepotItemExample {
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andLinkIdIsNull
()
{
addCriterion
(
"link_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdIsNotNull
()
{
addCriterion
(
"link_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdEqualTo
(
Long
value
)
{
addCriterion
(
"link_id ="
,
value
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"link_id <>"
,
value
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdGreaterThan
(
Long
value
)
{
addCriterion
(
"link_id >"
,
value
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"link_id >="
,
value
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdLessThan
(
Long
value
)
{
addCriterion
(
"link_id <"
,
value
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"link_id <="
,
value
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"link_id in"
,
values
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"link_id not in"
,
values
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"link_id between"
,
value1
,
value2
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLinkIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"link_id not between"
,
value1
,
value2
,
"linkId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andTenantIdIsNull
()
{
public
Criteria
andTenantIdIsNull
()
{
addCriterion
(
"tenant_id is null"
);
addCriterion
(
"tenant_id is null"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
...
...
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
View file @
d453c659
...
@@ -143,11 +143,13 @@ public interface DepotItemMapperEx {
...
@@ -143,11 +143,13 @@ public interface DepotItemMapperEx {
BigDecimal
getFinishNumber
(
BigDecimal
getFinishNumber
(
@Param
(
"meId"
)
Long
meId
,
@Param
(
"meId"
)
Long
meId
,
@Param
(
"linkId"
)
Long
linkId
,
@Param
(
"linkNumber"
)
String
linkNumber
,
@Param
(
"linkNumber"
)
String
linkNumber
,
@Param
(
"goToType"
)
String
goToType
);
@Param
(
"goToType"
)
String
goToType
);
BigDecimal
getRealFinishNumber
(
BigDecimal
getRealFinishNumber
(
@Param
(
"meId"
)
Long
meId
,
@Param
(
"meId"
)
Long
meId
,
@Param
(
"linkId"
)
Long
linkId
,
@Param
(
"linkNumber"
)
String
linkNumber
,
@Param
(
"linkNumber"
)
String
linkNumber
,
@Param
(
"currentHeaderId"
)
Long
currentHeaderId
,
@Param
(
"currentHeaderId"
)
Long
currentHeaderId
,
@Param
(
"goToType"
)
String
goToType
);
@Param
(
"goToType"
)
String
goToType
);
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
d453c659
...
@@ -259,12 +259,12 @@ public class DepotItemService {
...
@@ -259,12 +259,12 @@ public class DepotItemService {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
public
DepotItem
getPreItemByHeaderIdAndMaterial
(
String
linkNumber
,
Long
meId
)
throws
Exception
{
public
DepotItem
getPreItemByHeaderIdAndMaterial
(
String
linkNumber
,
Long
meId
,
Long
linkId
)
throws
Exception
{
DepotItem
depotItem
=
new
DepotItem
();
DepotItem
depotItem
=
new
DepotItem
();
try
{
try
{
DepotHead
depotHead
=
depotHeadService
.
getDepotHead
(
linkNumber
);
DepotHead
depotHead
=
depotHeadService
.
getDepotHead
(
linkNumber
);
DepotItemExample
example
=
new
DepotItemExample
();
DepotItemExample
example
=
new
DepotItemExample
();
example
.
createCriteria
().
andHeaderIdEqualTo
(
depotHead
.
getId
()).
andMaterialExtendIdEqualTo
(
meId
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
createCriteria
().
andHeaderIdEqualTo
(
depotHead
.
getId
()).
andMaterialExtendIdEqualTo
(
meId
).
andIdEqualTo
(
linkId
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
DepotItem
>
list
=
depotItemMapper
.
selectByExample
(
example
);
List
<
DepotItem
>
list
=
depotItemMapper
.
selectByExample
(
example
);
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
depotItem
=
list
.
get
(
0
);
depotItem
=
list
.
get
(
0
);
...
@@ -430,6 +430,9 @@ public class DepotItemService {
...
@@ -430,6 +430,9 @@ public class DepotItemService {
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"sku"
)))
{
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"sku"
)))
{
depotItem
.
setSku
(
rowObj
.
getString
(
"sku"
));
depotItem
.
setSku
(
rowObj
.
getString
(
"sku"
));
}
}
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"linkId"
)))
{
depotItem
.
setLinkId
(
rowObj
.
getLong
(
"linkId"
));
}
//以下进行单位换算
//以下进行单位换算
Unit
unitInfo
=
materialService
.
findUnit
(
materialExtend
.
getMaterialId
());
//查询计量单位信息
Unit
unitInfo
=
materialService
.
findUnit
(
materialExtend
.
getMaterialId
());
//查询计量单位信息
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"operNumber"
)))
{
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"operNumber"
)))
{
...
@@ -467,9 +470,9 @@ public class DepotItemService {
...
@@ -467,9 +470,9 @@ public class DepotItemService {
String
unit
=
rowObj
.
get
(
"unit"
).
toString
();
String
unit
=
rowObj
.
get
(
"unit"
).
toString
();
Long
preHeaderId
=
depotHeadService
.
getDepotHead
(
depotHead
.
getLinkNumber
()).
getId
();
Long
preHeaderId
=
depotHeadService
.
getDepotHead
(
depotHead
.
getLinkNumber
()).
getId
();
//前一个单据的数量
//前一个单据的数量
BigDecimal
preNumber
=
getPreItemByHeaderIdAndMaterial
(
depotHead
.
getLinkNumber
(),
depotItem
.
getMaterialExtendId
()).
getOperNumber
();
BigDecimal
preNumber
=
getPreItemByHeaderIdAndMaterial
(
depotHead
.
getLinkNumber
(),
depotItem
.
getMaterialExtendId
()
,
depotItem
.
getLinkId
()
).
getOperNumber
();
//除去此单据之外的已入库|已出库
//除去此单据之外的已入库|已出库
BigDecimal
realFinishNumber
=
getRealFinishNumber
(
depotItem
.
getMaterialExtendId
(),
preHeaderId
,
headerId
,
unitInfo
,
unit
);
BigDecimal
realFinishNumber
=
getRealFinishNumber
(
depotItem
.
getMaterialExtendId
(),
depotItem
.
getLinkId
(),
preHeaderId
,
headerId
,
unitInfo
,
unit
);
if
(
depotItem
.
getOperNumber
().
add
(
realFinishNumber
).
compareTo
(
preNumber
)>
0
)
{
if
(
depotItem
.
getOperNumber
().
add
(
realFinishNumber
).
compareTo
(
preNumber
)>
0
)
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE
,
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG
,
barCode
));
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG
,
barCode
));
...
@@ -853,7 +856,8 @@ public class DepotItemService {
...
@@ -853,7 +856,8 @@ public class DepotItemService {
}
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
BigDecimal
getFinishNumber
(
Long
meId
,
Long
headerId
,
Unit
unitInfo
,
String
materialUnit
,
String
linkType
)
{
public
BigDecimal
getFinishNumber
(
Long
meId
,
Long
id
,
Long
headerId
,
Unit
unitInfo
,
String
materialUnit
,
String
linkType
)
{
Long
linkId
=
id
;
String
goToType
=
""
;
String
goToType
=
""
;
DepotHead
depotHead
=
depotHeadMapper
.
selectByPrimaryKey
(
headerId
);
DepotHead
depotHead
=
depotHeadMapper
.
selectByPrimaryKey
(
headerId
);
String
linkNumber
=
depotHead
.
getNumber
();
//订单号
String
linkNumber
=
depotHead
.
getNumber
();
//订单号
...
@@ -869,7 +873,7 @@ public class DepotItemService {
...
@@ -869,7 +873,7 @@ public class DepotItemService {
goToType
=
BusinessConstants
.
SUB_TYPE_SALES
;
goToType
=
BusinessConstants
.
SUB_TYPE_SALES
;
}
}
}
}
BigDecimal
count
=
depotItemMapperEx
.
getFinishNumber
(
meId
,
linkNumber
,
goToType
);
BigDecimal
count
=
depotItemMapperEx
.
getFinishNumber
(
meId
,
linkId
,
linkNumber
,
goToType
);
//根据多单位情况进行数量的转换
//根据多单位情况进行数量的转换
if
(
materialUnit
.
equals
(
unitInfo
.
getOtherUnit
())
&&
unitInfo
.
getRatio
()
!=
0
)
{
if
(
materialUnit
.
equals
(
unitInfo
.
getOtherUnit
())
&&
unitInfo
.
getRatio
()
!=
0
)
{
count
=
count
.
divide
(
BigDecimal
.
valueOf
(
unitInfo
.
getRatio
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
count
=
count
.
divide
(
BigDecimal
.
valueOf
(
unitInfo
.
getRatio
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
...
@@ -886,6 +890,7 @@ public class DepotItemService {
...
@@ -886,6 +890,7 @@ public class DepotItemService {
/**
/**
* 除去此单据之外的已入库|已出库
* 除去此单据之外的已入库|已出库
* @param meId
* @param meId
* @param linkId
* @param preHeaderId
* @param preHeaderId
* @param currentHeaderId
* @param currentHeaderId
* @param unitInfo
* @param unitInfo
...
@@ -893,7 +898,7 @@ public class DepotItemService {
...
@@ -893,7 +898,7 @@ public class DepotItemService {
* @return
* @return
*/
*/
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
BigDecimal
getRealFinishNumber
(
Long
meId
,
Long
preHeaderId
,
Long
currentHeaderId
,
Unit
unitInfo
,
String
materialUnit
)
{
public
BigDecimal
getRealFinishNumber
(
Long
meId
,
Long
linkId
,
Long
preHeaderId
,
Long
currentHeaderId
,
Unit
unitInfo
,
String
materialUnit
)
{
String
goToType
=
""
;
String
goToType
=
""
;
DepotHead
depotHead
=
depotHeadMapper
.
selectByPrimaryKey
(
preHeaderId
);
DepotHead
depotHead
=
depotHeadMapper
.
selectByPrimaryKey
(
preHeaderId
);
String
linkNumber
=
depotHead
.
getNumber
();
//订单号
String
linkNumber
=
depotHead
.
getNumber
();
//订单号
...
@@ -903,7 +908,7 @@ public class DepotItemService {
...
@@ -903,7 +908,7 @@ public class DepotItemService {
if
(
BusinessConstants
.
SUB_TYPE_SALES_ORDER
.
equals
(
depotHead
.
getSubType
()))
{
if
(
BusinessConstants
.
SUB_TYPE_SALES_ORDER
.
equals
(
depotHead
.
getSubType
()))
{
goToType
=
BusinessConstants
.
SUB_TYPE_SALES
;
goToType
=
BusinessConstants
.
SUB_TYPE_SALES
;
}
}
BigDecimal
count
=
depotItemMapperEx
.
getRealFinishNumber
(
meId
,
linkNumber
,
currentHeaderId
,
goToType
);
BigDecimal
count
=
depotItemMapperEx
.
getRealFinishNumber
(
meId
,
linkId
,
linkNumber
,
currentHeaderId
,
goToType
);
//根据多单位情况进行数量的转换
//根据多单位情况进行数量的转换
if
(
materialUnit
.
equals
(
unitInfo
.
getOtherUnit
())
&&
unitInfo
.
getRatio
()
!=
0
)
{
if
(
materialUnit
.
equals
(
unitInfo
.
getOtherUnit
())
&&
unitInfo
.
getRatio
()
!=
0
)
{
count
=
count
.
divide
(
BigDecimal
.
valueOf
(
unitInfo
.
getRatio
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
count
=
count
.
divide
(
BigDecimal
.
valueOf
(
unitInfo
.
getRatio
()),
2
,
BigDecimal
.
ROUND_HALF_UP
);
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapper.xml
View file @
d453c659
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
<result
column=
"sn_list"
jdbcType=
"VARCHAR"
property=
"snList"
/>
<result
column=
"sn_list"
jdbcType=
"VARCHAR"
property=
"snList"
/>
<result
column=
"batch_number"
jdbcType=
"VARCHAR"
property=
"batchNumber"
/>
<result
column=
"batch_number"
jdbcType=
"VARCHAR"
property=
"batchNumber"
/>
<result
column=
"expiration_date"
jdbcType=
"TIMESTAMP"
property=
"expirationDate"
/>
<result
column=
"expiration_date"
jdbcType=
"TIMESTAMP"
property=
"expirationDate"
/>
<result
column=
"link_id"
jdbcType=
"BIGINT"
property=
"linkId"
/>
<result
column=
"tenant_id"
jdbcType=
"BIGINT"
property=
"tenantId"
/>
<result
column=
"tenant_id"
jdbcType=
"BIGINT"
property=
"tenantId"
/>
<result
column=
"delete_flag"
jdbcType=
"VARCHAR"
property=
"deleteFlag"
/>
<result
column=
"delete_flag"
jdbcType=
"VARCHAR"
property=
"deleteFlag"
/>
</resultMap>
</resultMap>
...
@@ -88,7 +89,7 @@
...
@@ -88,7 +89,7 @@
id, header_id, material_id, material_extend_id, material_unit, sku, oper_number,
id, header_id, material_id, material_extend_id, material_unit, sku, oper_number,
basic_number, unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id,
basic_number, unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id,
tax_rate, tax_money, tax_last_money, material_type, sn_list, batch_number, expiration_date,
tax_rate, tax_money, tax_last_money, material_type, sn_list, batch_number, expiration_date,
tenant_id, delete_flag
link_id,
tenant_id, delete_flag
</sql>
</sql>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"BaseResultMap"
>
select
select
...
@@ -128,7 +129,8 @@
...
@@ -128,7 +129,8 @@
depot_id, another_depot_id, tax_rate,
depot_id, another_depot_id, tax_rate,
tax_money, tax_last_money, material_type,
tax_money, tax_last_money, material_type,
sn_list, batch_number, expiration_date,
sn_list, batch_number, expiration_date,
tenant_id, delete_flag)
link_id, tenant_id, delete_flag
)
values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT},
values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT},
#{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR},
#{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR},
#{operNumber,jdbcType=DECIMAL}, #{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL},
#{operNumber,jdbcType=DECIMAL}, #{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL},
...
@@ -136,7 +138,8 @@
...
@@ -136,7 +138,8 @@
#{depotId,jdbcType=BIGINT}, #{anotherDepotId,jdbcType=BIGINT}, #{taxRate,jdbcType=DECIMAL},
#{depotId,jdbcType=BIGINT}, #{anotherDepotId,jdbcType=BIGINT}, #{taxRate,jdbcType=DECIMAL},
#{taxMoney,jdbcType=DECIMAL}, #{taxLastMoney,jdbcType=DECIMAL}, #{materialType,jdbcType=VARCHAR},
#{taxMoney,jdbcType=DECIMAL}, #{taxLastMoney,jdbcType=DECIMAL}, #{materialType,jdbcType=VARCHAR},
#{snList,jdbcType=VARCHAR}, #{batchNumber,jdbcType=VARCHAR}, #{expirationDate,jdbcType=TIMESTAMP},
#{snList,jdbcType=VARCHAR}, #{batchNumber,jdbcType=VARCHAR}, #{expirationDate,jdbcType=TIMESTAMP},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
#{linkId,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.DepotItem"
>
<insert
id=
"insertSelective"
parameterType=
"com.jsh.erp.datasource.entities.DepotItem"
>
insert into jsh_depot_item
insert into jsh_depot_item
...
@@ -204,6 +207,9 @@
...
@@ -204,6 +207,9 @@
<if
test=
"expirationDate != null"
>
<if
test=
"expirationDate != null"
>
expiration_date,
expiration_date,
</if>
</if>
<if
test=
"linkId != null"
>
link_id,
</if>
<if
test=
"tenantId != null"
>
<if
test=
"tenantId != null"
>
tenant_id,
tenant_id,
</if>
</if>
...
@@ -275,6 +281,9 @@
...
@@ -275,6 +281,9 @@
<if
test=
"expirationDate != null"
>
<if
test=
"expirationDate != null"
>
#{expirationDate,jdbcType=TIMESTAMP},
#{expirationDate,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"linkId != null"
>
#{linkId,jdbcType=BIGINT},
</if>
<if
test=
"tenantId != null"
>
<if
test=
"tenantId != null"
>
#{tenantId,jdbcType=BIGINT},
#{tenantId,jdbcType=BIGINT},
</if>
</if>
...
@@ -355,6 +364,9 @@
...
@@ -355,6 +364,9 @@
<if
test=
"record.expirationDate != null"
>
<if
test=
"record.expirationDate != null"
>
expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"record.linkId != null"
>
link_id = #{record.linkId,jdbcType=BIGINT},
</if>
<if
test=
"record.tenantId != null"
>
<if
test=
"record.tenantId != null"
>
tenant_id = #{record.tenantId,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
</if>
...
@@ -389,6 +401,7 @@
...
@@ -389,6 +401,7 @@
sn_list = #{record.snList,jdbcType=VARCHAR},
sn_list = #{record.snList,jdbcType=VARCHAR},
batch_number = #{record.batchNumber,jdbcType=VARCHAR},
batch_number = #{record.batchNumber,jdbcType=VARCHAR},
expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
link_id = #{record.linkId,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
...
@@ -458,6 +471,9 @@
...
@@ -458,6 +471,9 @@
<if
test=
"expirationDate != null"
>
<if
test=
"expirationDate != null"
>
expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
</if>
</if>
<if
test=
"linkId != null"
>
link_id = #{linkId,jdbcType=BIGINT},
</if>
<if
test=
"tenantId != null"
>
<if
test=
"tenantId != null"
>
tenant_id = #{tenantId,jdbcType=BIGINT},
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
</if>
...
@@ -489,6 +505,7 @@
...
@@ -489,6 +505,7 @@
sn_list = #{snList,jdbcType=VARCHAR},
sn_list = #{snList,jdbcType=VARCHAR},
batch_number = #{batchNumber,jdbcType=VARCHAR},
batch_number = #{batchNumber,jdbcType=VARCHAR},
expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
link_id = #{linkId,jdbcType=BIGINT},
tenant_id = #{tenantId,jdbcType=BIGINT},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
delete_flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
...
...
jshERP-boot/src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
d453c659
...
@@ -598,6 +598,7 @@
...
@@ -598,6 +598,7 @@
<select
id=
"getFinishNumber"
resultType=
"java.math.BigDecimal"
>
<select
id=
"getFinishNumber"
resultType=
"java.math.BigDecimal"
>
select ifnull(sum(di.basic_number),0) from jsh_depot_item di
select ifnull(sum(di.basic_number),0) from jsh_depot_item di
where di.material_extend_id=#{meId}
where di.material_extend_id=#{meId}
and di.link_id=#{linkId}
and ifnull(di.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
and di.header_id
and di.header_id
in
in
...
@@ -615,6 +616,7 @@
...
@@ -615,6 +616,7 @@
<select
id=
"getRealFinishNumber"
resultType=
"java.math.BigDecimal"
>
<select
id=
"getRealFinishNumber"
resultType=
"java.math.BigDecimal"
>
select ifnull(sum(di.basic_number),0) from jsh_depot_item di
select ifnull(sum(di.basic_number),0) from jsh_depot_item di
where di.material_extend_id=#{meId}
where di.material_extend_id=#{meId}
and di.link_id=#{linkId}
and ifnull(di.delete_flag,'0') !='1'
and ifnull(di.delete_flag,'0') !='1'
and di.header_id
and di.header_id
in
in
...
...
Write
Preview
Supports
Markdown
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