Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
185b1bc5
Commit
185b1bc5
authored
May 20, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
装箱
parent
fb6614a1
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
409 additions
and
107 deletions
+409
-107
BoxMergePkgMapper.java
...er/yudao/module/shipment/dal/mysql/BoxMergePkgMapper.java
+139
-2
BoxOrderCheckInfoMapper.java
.../dal/mysql/boxOrderCheckInfo/BoxOrderCheckInfoMapper.java
+3
-0
BoxMergePkgServiceImpl.java
.../shipment/service/boxMergePkg/BoxMergePkgServiceImpl.java
+159
-4
BoxOrderCheckInfoService.java
...t/service/boxOrderCheckInfo/BoxOrderCheckInfoService.java
+2
-0
BoxOrderCheckInfoServiceImpl.java
...rvice/boxOrderCheckInfo/BoxOrderCheckInfoServiceImpl.java
+48
-0
BoxPkgOrderServiceImpl.java
.../shipment/service/boxPkgOrder/BoxPkgOrderServiceImpl.java
+39
-101
BoxOrderInstallVO.java
...coder/yudao/module/shipment/vo/box/BoxOrderInstallVO.java
+19
-0
No files found.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/dal/mysql/BoxMergePkgMapper.java
View file @
185b1bc5
...
...
@@ -4,8 +4,11 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import
cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.BoxMergePkgDO
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.boxOrderCheckInfo.BoxOrderCheckInfoDO
;
import
cn.iocoder.yudao.module.shipment.dto.BoxMergePkgPageDto
;
import
cn.iocoder.yudao.module.shipment.vo.box.BoxOrderInstallVO
;
import
cn.iocoder.yudao.module.shipment.vo.boxMergePkg.BoxMergePkgPDAListVO
;
import
cn.iocoder.yudao.module.shipment.vo.boxMergePkg.BoxMergePkgQueryVO
;
import
cn.iocoder.yudao.module.shipment.vo.boxMergePkg.BoxMergePkgWebVO
;
...
...
@@ -96,14 +99,46 @@ public interface BoxMergePkgMapper extends AbstractMapper<BoxMergePkgDO> {
"</script>"
)
BoxMergePkgDO
getMergePkgInfoById
(
@Param
(
"id"
)
Long
id
);
// @Select("<script>" +
// "select t.order_id,t.order_no,t.product_record,t.sum_num,t.sum_volume,t.sum_weight,t.sum_quantity,t1.tally_time ,t.customs_type " +
// "from ecw_box_preload_goods t2 left join ecw_order t on t2.order_id=t.order_id " +
// "LEFT JOIN ecw_box_tally t1 on t.order_id=t1.order_id and t1.deleted=0 and t1.shipment_id=#{shipmentId} " +
// "where 1=1 and not exists (select 1 from ecw_box_pkg_order a where a.order_id=t.order_id and a.deleted=0) " +
// "and t.deleted=0 and t2.deleted=0 and t.transport_id in (3,4) and t2.shipment_id=#{shipmentId} group by t2.order_id" +
// "</script>")
@Select
(
"<script>"
+
"select t.order_id,t.order_no,t.product_record,t.sum_num,t.sum_volume,t.sum_weight,t.sum_quantity,t1.tally_time ,t.customs_type "
+
"from ecw_box_preload_goods t2 left join ecw_order t on t2.order_id=t.order_id "
+
"LEFT JOIN ecw_box_tally t1 on t.order_id=t1.order_id and t1.deleted=0 and t1.shipment_id=#{shipmentId} "
+
"where 1=1 "
+
"<when test = 'unInstallOrderList != null'>"
+
"AND t2.order_id in"
+
"<foreach item='orderid' index='index' collection='unInstallOrderList' open='(' separator=',' close=')'>"
+
"#{orderid}"
+
"</foreach> "
+
"</when>"
+
"and t.deleted=0 and t2.deleted=0 and t.transport_id in (3,4) and t2.shipment_id=#{shipmentId} group by t2.order_id"
+
"</script>"
)
IPage
<
BoxMergePkgWebVO
>
getUnPkgPage
(
IPage
<
BoxMergePkgWebVO
>
mpPage
,
@Param
(
"shipmentId"
)
Long
shipmentId
,
@Param
(
"unInstallOrderList"
)
List
<
Long
>
unInstallOrderList
);
@Select
(
"<script>"
+
"select t.order_id,t.order_no,t.product_record,t.sum_num,t.sum_volume,t.sum_weight,t.sum_quantity,t1.tally_time ,t.customs_type "
+
"from ecw_box_preload_goods t2 left join ecw_order t on t2.order_id=t.order_id "
+
"LEFT JOIN ecw_box_tally t1 on t.order_id=t1.order_id and t1.deleted=0 and t1.shipment_id=#{shipmentId} "
+
"where 1=1 and not exists (select 1 from ecw_box_pkg_order a where a.order_id=t.order_id and a.deleted=0) "
+
"where 1=1 "
+
"<when test = 'installOrderList != null'>"
+
"AND t2.order_id not in"
+
"<foreach item='orderid' index='index' collection='installOrderList' open='(' separator=',' close=')'>"
+
"#{orderid}"
+
"</foreach> "
+
"</when>"
+
"and t.deleted=0 and t2.deleted=0 and t.transport_id in (3,4) and t2.shipment_id=#{shipmentId} group by t2.order_id"
+
"</script>"
)
IPage
<
BoxMergePkgWebVO
>
getUnPkgPage
(
IPage
<
BoxMergePkgWebVO
>
mpPage
,
@Param
(
"shipmentId"
)
Long
shipmentId
);
IPage
<
BoxMergePkgWebVO
>
getUnPkgPage2
(
IPage
<
BoxMergePkgWebVO
>
mpPage
,
@Param
(
"shipmentId"
)
Long
shipmentId
,
@Param
(
"installOrderList"
)
List
<
Long
>
installOrderList
);
@Select
(
"<script>"
+
"select t.order_id,t.order_no,t.product_record,t.sum_num,t.sum_volume,t.sum_weight,t.sum_quantity,t1.tally_time, "
+
...
...
@@ -143,4 +178,106 @@ public interface BoxMergePkgMapper extends AbstractMapper<BoxMergePkgDO> {
"</when>"
+
"</script>"
)
IPage
<
BoxMergePkgPDAListVO
>
getBoxMergePkgList4PDAPage
(
IPage
<
BoxMergePkgPDAListVO
>
mpPage
,
@Param
(
"warehouseIdList"
)
Set
<
Long
>
warehouseIds
,
@Param
(
"selfNo"
)
String
selfNo
);
@Select
(
"<script>"
+
"SELECT "
+
" ci.order_id as orderId, "
+
"ci.order_num_code as orderNumCode FROM "
+
" ecw_box_order_check_info ci "
+
"LEFT JOIN ecw_box_pkg_order pk ON pk.order_id = ci.order_id AND ci.deleted = 0 "
+
"WHERE ci.shipment_id = #{shipmentId} AND ci.deleted = 0 AND ci.type = 1 "
+
"<when test = 'orderId != null'>"
+
"and ci.order_id = #{orderId} "
+
"</when>"
+
" GROUP BY ci.order_num_code "
+
"</script>"
)
List
<
BoxOrderCheckInfoDO
>
getInstallBoxByShipmentId
(
@Param
(
"shipmentId"
)
Long
shipmentId
,
@Param
(
"orderId"
)
Long
orderId
);
@Select
(
"<script>"
+
"SELECT\n"
+
" t.order_id,\n"
+
" t.order_no,\n"
+
" t.product_record,\n"
+
"\t t.sum_num,\n"
+
"\t t.sum_volume,\n"
+
"\t t.sum_weight,\n"
+
"\t t.sum_quantity,\n"
+
"\t t1.tally_time,\n"
+
"\t t.customs_type \n"
+
"FROM \n"
+
"\t ecw_box_preload_goods t2\n"
+
"\t LEFT JOIN ecw_order t ON t2.order_id = t.order_id\n"
+
"\t LEFT JOIN ecw_box_tally t1 ON t.order_id = t1.order_id \n"
+
"\t AND t1.deleted = 0 \n"
+
"\t AND t1.shipment_id = #{shipmentId} \n"
+
"\t\n"
+
"WHERE\n"
+
"\t 1 = 1 \n"
+
" \t AND EXISTS ( SELECT 1 FROM ecw_box_pkg_order a WHERE a.order_id = t.order_id AND a.deleted = 0 ) \n"
+
" AND t2.order_id NOT in ( "
+
" SELECT\n"
+
" ci.order_id \n"
+
" FROM\n"
+
" ecw_box_order_check_info ci\n"
+
" LEFT JOIN ecw_box_pkg_order pk ON pk.order_id = ci.order_id AND ci.deleted = 0 \n"
+
" WHERE ci.shipment_id = #{shipmentId} AND ci.deleted = 0 AND ci.type = 1 GROUP BY ci.order_num_code\n"
+
" ) "
+
"\t AND t.deleted = 0 \n"
+
"\t AND t2.deleted = 0 \n"
+
"\t AND t.transport_id IN ( 3, 4 ) \n"
+
"\t AND t2.shipment_id = #{shipmentId} group by t2.order_id "
+
"</script>"
)
List
<
BoxMergePkgWebVO
>
getNotInPkgOrderByShipmentId
(
@Param
(
"shipmentId"
)
Long
shipmentId
,
@Param
(
"orderIds"
)
List
<
Long
>
orderIds
);
@Select
(
"<script>"
+
"select t2.order_id,o.order_no, o.sum_num , case WHEN o.sum_num >1 THEN 1 ELSE 0 END as boxNumMoreOne from ecw_box_preload_goods t2 \n"
+
" LEFT JOIN ecw_order o ON o.order_id = t2.order_id AND o.deleted=0 \n"
+
" where 1=1 and t2.deleted=0 and t2.shipment_id=#{shipmentId} group by t2.order_id "
+
"</script>"
)
List
<
BoxOrderInstallVO
>
getBoxOrderInstallVo
(
Long
shipmentId
);
@Select
(
"<script>"
+
"SELECT\n"
+
"\t t.order_id,\n"
+
"\t t.order_no,\n"
+
"\t t.product_record,\n"
+
"\t t.sum_num,\n"
+
"\t t.sum_volume,\n"
+
"\t t.sum_weight,\n"
+
"\t t.sum_quantity,\n"
+
"\t t.customs_type \n"
+
"FROM \n"
+
"\tecw_box_preload_goods t2\n"
+
"LEFT JOIN ecw_order t ON t2.order_id = t.order_id\t\n"
+
"LEFT JOIN ecw_box_pkg_order a ON a.order_id = t2.order_id AND a.deleted = 0\n"
+
"WHERE 1=1 \n"
+
"AND t.deleted = 0 \n"
+
"\tAND t2.deleted = 0 \n"
+
"\tAND t.transport_id IN ( 3, 4 ) "
+
"\tAND t2.shipment_id = #{shipmentId} "
+
"<when test = 'orderIds != null'>"
+
"AND a.order_id in"
+
"<foreach item='orderid' index='index' collection='orderIds' open='(' separator=',' close=')'>"
+
"#{orderid}"
+
"</foreach> "
+
"</when>"
+
" group by t2.order_id "
+
"</script>"
)
List
<
BoxMergePkgWebVO
>
getAllBoxPgkOrder
(
@Param
(
"shipmentId"
)
Long
shipmentId
,
@Param
(
"orderIds"
)
List
<
Long
>
orderIds
);
@Select
(
"<script>"
+
"SELECT "
+
" ci.order_id as orderId, "
+
"ci.order_num_code as orderNumCode FROM "
+
" ecw_box_order_check_info ci "
+
"LEFT JOIN ecw_box_pkg_order pk ON pk.order_id = ci.order_id AND ci.deleted = 0 "
+
"WHERE ci.shipment_id = #{shipmentId} AND ci.deleted = 0 AND ci.type = 1 "
+
"<when test = 'orderIds != null'>"
+
"AND ci.order_id in"
+
"<foreach item='orderid' index='index' collection='orderIds' open='(' separator=',' close=')'>"
+
" #{orderid} "
+
"</foreach> "
+
"</when>"
+
" GROUP BY ci.order_num_code "
+
"</script>"
)
List
<
BoxOrderCheckInfoDO
>
getAlllBoxOrderCheck
(
@Param
(
"shipmentId"
)
Long
shipmentId
,
@Param
(
"orderIds"
)
List
<
Long
>
orderIds
);
}
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/dal/mysql/boxOrderCheckInfo/BoxOrderCheckInfoMapper.java
View file @
185b1bc5
...
...
@@ -47,4 +47,7 @@ public interface BoxOrderCheckInfoMapper extends AbstractMapper<BoxOrderCheckInf
return
null
;
}
List
<
BoxOrderCheckInfoDO
>
getBoxOrderCheckInfoByShipIdAndOrerId
(
Long
shipmentId
,
Long
orderId
)
;
}
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxMergePkg/BoxMergePkgServiceImpl.java
View file @
185b1bc5
This diff is collapsed.
Click to expand it.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxOrderCheckInfo/BoxOrderCheckInfoService.java
View file @
185b1bc5
...
...
@@ -86,4 +86,6 @@ public interface BoxOrderCheckInfoService extends IService<BoxOrderCheckInfoDO>
void
orderTally
(
Collection
<
Long
>
orderIdList
,
Long
shipmentId
);
List
<
String
>
getOrderTagList
(
OrderDO
orderDO
)
;
List
<
BoxOrderCheckInfoDO
>
getOrderTagNumList
(
OrderDO
order
);
}
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxOrderCheckInfo/BoxOrderCheckInfoServiceImpl.java
View file @
185b1bc5
...
...
@@ -675,6 +675,42 @@ public class BoxOrderCheckInfoServiceImpl extends AbstractService<BoxOrderCheckI
return
tagList
;
}
private
List
<
BoxOrderCheckInfoDO
>
getOrderTagNumCaseList
(
OrderDO
orderDO
,
List
<
OrderLabelDO
>
orderLabelList
)
{
//从OrderLabel里面查找订单的箱号
String
orderNo
=
orderDO
.
getOrderNo
();
List
<
BoxOrderCheckInfoDO
>
tagList
=
new
ArrayList
<>();
int
start
;
int
end
;
if
(
CollectionUtil
.
isEmpty
(
orderLabelList
))
{
//没有存箱号,从订单的总箱数里面取
int
totalNum
=
orderDO
.
getSumNum
();
//总箱数
start
=
1
;
end
=
totalNum
;
for
(
int
i
=
start
;
i
<=
end
;
i
++)
{
String
tag
=
CodeUtils
.
createOrderTagNumber
(
orderNo
,
i
);
BoxOrderCheckInfoDO
checkInfoDO
=
new
BoxOrderCheckInfoDO
()
;
checkInfoDO
.
setOrderId
(
orderDO
.
getOrderId
());
checkInfoDO
.
setOrderNumCode
(
tag
)
;
tagList
.
add
(
checkInfoDO
);
}
}
else
{
orderLabelList
.
sort
(
Comparator
.
comparing
(
OrderLabelDO:
:
getId
));
for
(
OrderLabelDO
orderLabelDO
:
orderLabelList
)
{
start
=
orderLabelDO
.
getStart
();
end
=
orderLabelDO
.
getEnd
();
for
(
int
i
=
start
;
i
<=
end
;
i
++)
{
String
tag
=
CodeUtils
.
createOrderTagNumber
(
orderNo
,
i
);
BoxOrderCheckInfoDO
checkInfoDO
=
new
BoxOrderCheckInfoDO
()
;
checkInfoDO
.
setOrderId
(
orderDO
.
getOrderId
());
checkInfoDO
.
setOrderNumCode
(
tag
)
;
tagList
.
add
(
checkInfoDO
);
}
}
}
return
tagList
;
}
private
OrderDO
getOrderByNo
(
String
orderNo
)
{
//根据订单编号找到订单
OrderQueryVO
orderQueryVO
=
new
OrderQueryVO
();
...
...
@@ -695,6 +731,18 @@ public class BoxOrderCheckInfoServiceImpl extends AbstractService<BoxOrderCheckI
return
getOrderTagList
(
orderDO
,
orderLabelList
);
}
@Override
public
List
<
BoxOrderCheckInfoDO
>
getOrderTagNumList
(
OrderDO
orderDO
)
{
//从OrderLabel里面查找订单的箱号
Long
orderId
=
orderDO
.
getOrderId
();
OrderLabelQueryVO
queryVO
=
new
OrderLabelQueryVO
();
queryVO
.
setOrderId
(
orderId
);
List
<
OrderLabelDO
>
orderLabelList
=
orderLabelService
.
getLabelList
(
queryVO
);
return
getOrderTagNumCaseList
(
orderDO
,
orderLabelList
);
}
private
void
checkShipmentStepStatus
(
Long
shipmentId
,
Integer
type
)
{
BoxDO
box
=
boxService
.
getBox
(
shipmentId
);
if
(
type
==
0
)
{
...
...
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxPkgOrder/BoxPkgOrderServiceImpl.java
View file @
185b1bc5
This diff is collapsed.
Click to expand it.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/vo/box/BoxOrderInstallVO.java
0 → 100644
View file @
185b1bc5
package
cn
.
iocoder
.
yudao
.
module
.
shipment
.
vo
.
box
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
BoxOrderInstallVO
{
/**
* 订单ID
*/
private
Long
orderId
;
@ApiModelProperty
(
"订单编号"
)
private
String
orderNo
;
@ApiModelProperty
(
"箱数是否大于1"
)
private
Boolean
boxNumMoreOne
;
}
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