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
f46ce85e
Commit
f46ce85e
authored
Jun 14, 2024
by
lanbaoming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
0bff0b48
e1b13f77
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
40 deletions
+109
-40
BoxLadingBillService.java
.../shipment/service/boxLadingBill/BoxLadingBillService.java
+2
-0
BoxLadingBillServiceImpl.java
...pment/service/boxLadingBill/BoxLadingBillServiceImpl.java
+79
-29
BoxMergePkgServiceImpl.java
.../shipment/service/boxMergePkg/BoxMergePkgServiceImpl.java
+6
-2
BoxLadingBillController.java
...le/shipment/controller/admin/BoxLadingBillController.java
+22
-9
No files found.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxLadingBill/BoxLadingBillService.java
View file @
f46ce85e
...
...
@@ -62,4 +62,6 @@ public interface BoxLadingBillService extends IService<BoxLadingBillDO> {
List
<
BoxLadingBillDO
>
getBoxLadingBillList
(
BoxLadingBillQueryVO
query
);
Map
<
String
,
String
>
getBoxLadingBillPdf
(
Long
shipmentId
)
throws
Exception
;
Map
<
String
,
String
>
getBoxLadingBillPdf_2
(
Long
shipmentId
)
throws
Exception
;
}
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxLadingBill/BoxLadingBillServiceImpl.java
View file @
f46ce85e
...
...
@@ -166,6 +166,7 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
return
boxLadingBillMapper
.
selectList
(
query
);
}
/*
空运提单补料 lanbm 2024-05-28 添加注释
*/
...
...
@@ -180,8 +181,9 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
}
//包装单位 lanbm 2024-06-11 add
//2024-06-14 确认使用的单位字典
List
<
DictDataRespDTO
>
listPack
=
dictDataApi
.
getDictDatas
(
"
packaging
_type"
);
dictDataApi
.
getDictDatas
(
"
goods_package
_type"
);
Map
<
String
,
String
>
PackMap
=
null
;
if
(
CollectionUtil
.
isNotEmpty
(
listPack
))
{
PackMap
=
listPack
.
stream
().
collect
(
...
...
@@ -189,8 +191,6 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
DictDataRespDTO:
:
getLabel
));
}
//end 包装单位 lanbm 2024-06-11 add
BoxShippingDO
boxShippingDO
=
boxShippingService
.
getOne
(
new
LambdaQueryWrapperX
<
BoxShippingDO
>().
eq
(
BoxShippingDO:
:
getShipmentId
,
...
...
@@ -240,22 +240,14 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
if
(
boxLadingBillDO
.
getStartPortId
()
!=
null
&&
boxLadingBillDO
.
getStartPortId
()
>
0L
)
{
String
s_loadingPort
=
""
;
//lanbm 2024-05-28 添加语言判断
if
(
lan
==
0
)
{
s_loadingPort
=
dockService
.
getDock
(
boxLadingBillDO
.
getStartPortId
()).
getTitleZh
();
}
else
{
s_loadingPort
=
dockService
.
getDock
(
boxLadingBillDO
.
getStartPortId
()).
getTitleEn
();
}
s_loadingPort
=
dockService
.
getDock
(
boxLadingBillDO
.
getStartPortId
()).
getTitleEn
();
headMap
.
put
(
"loadingPort"
,
s_loadingPort
);
}
//目的港
if
(
boxLadingBillDO
.
getDestPortId
()
!=
null
&&
boxLadingBillDO
.
getDestPortId
()
>
0L
)
{
//lanbm 2024-05-28 添加语言判断
//lanbm 2024-05-28 添加语言判断
lan =0 中文 其他英语
String
s_dischargingPort
=
""
;
if
(
lan
==
0
)
{
s_dischargingPort
=
dockService
.
getDock
(
boxLadingBillDO
.
getDestPortId
()).
getTitleZh
();
}
else
{
s_dischargingPort
=
dockService
.
getDock
(
boxLadingBillDO
.
getDestPortId
()).
getTitleEn
();
}
s_dischargingPort
=
dockService
.
getDock
(
boxLadingBillDO
.
getDestPortId
()).
getTitleEn
();
headMap
.
put
(
"dischargingPort"
,
s_dischargingPort
);
}
...
...
@@ -271,20 +263,6 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
headMap
.
put
(
"pkgs"
,
boxLadingBillDO
.
getPackageNum
()
==
null
?
""
:
boxLadingBillDO
.
getPackageNum
()
+
""
);
}
}
// StringBuffer stringBuffer = new StringBuffer();
// SupplierExternalDO supplierExternal = supplierExternalService.selectOne(SupplierExternalDO::getSupplierId,boxLadingBillDO.getAgentId());
// if (supplierExternal != null) {
// if (StringUtils.isNotBlank(supplierExternal.getFromNo())) {
// stringBuffer.append("FROM M NO.:").append(supplierExternal.getFromNo()+"\r\n");
// }
// if (StringUtils.isNotBlank(supplierExternal.getBaNo())) {
// stringBuffer.append("BA NO.:").append(supplierExternal.getBaNo()+"\r\n");
// }
// if (StringUtils.isNotBlank(supplierExternal.getCtnNo())) {
// stringBuffer.append("CTN NO.:").append(supplierExternal.getCtnNo()+"\r\n");
// }
// }
// headMap.put("description",boxLadingBillDO.getGoodsDesc()+"\r\n"+stringBuffer.toString());
//lanbm 2024-06-06 添加保存数量和单位
String
sPackName
=
""
;
...
...
@@ -292,7 +270,7 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
if
(
CollectionUtil
.
isNotEmpty
(
PackMap
)
&&
sUnit
!=
null
&&
sUnit
.
length
()
>
0
)
{
sPackName
=
sPackName
=
PackMap
.
get
(
sUnit
);
}
String
sDes
=
boxLadingBillDO
.
getPackageNum
()
+
sPackName
;
String
sDes
=
""
;
//
boxLadingBillDO.getPackageNum() + sPackName;
sDes
+=
"\r\n"
+
boxLadingBillDO
.
getGoodsDesc
();
headMap
.
put
(
"description"
,
sDes
);
//headMap.put("description", boxLadingBillDO.getGoodsDesc());
...
...
@@ -306,6 +284,78 @@ public class BoxLadingBillServiceImpl extends AbstractService<BoxLadingBillMappe
return
headMap
;
}
/*
海运提单 lanbm 2024-06-14 添加注释
*/
@Override
public
Map
<
String
,
String
>
getBoxLadingBillPdf_2
(
Long
shipmentId
)
throws
Exception
{
BoxLadingBillDO
boxLadingBillDO
=
boxLadingBillMapper
.
selectOne
(
BoxLadingBillDO:
:
getShipmentId
,
shipmentId
);
if
(
boxLadingBillDO
==
null
)
{
throw
exception
(
MAKE_BILL_OF_LADING_NOT_EXISTS
);
}
BoxShippingDO
boxShippingDO
=
boxShippingService
.
getOne
(
new
LambdaQueryWrapperX
<
BoxShippingDO
>().
eq
(
BoxShippingDO:
:
getShipmentId
,
shipmentId
));
BoxDO
box
=
boxMapper
.
selectById
(
shipmentId
);
CabinetDO
cabinet
=
cabinetService
.
getCabinet
(
box
.
getCabinetId
());
Map
<
String
,
String
>
headMap
=
new
HashMap
<>();
String
shipType
=
"X1"
;
if
(
cabinet
!=
null
)
{
shipType
=
cabinet
.
getName
()
+
"X1"
;
}
headMap
.
put
(
"shipperInfo"
,
buildMsg
(
boxLadingBillDO
.
getShipperId
(),
0
));
headMap
.
put
(
"consigneeInfo"
,
buildMsg
(
boxLadingBillDO
.
getAgentId
(),
1
));
headMap
.
put
(
"notifyInfo"
,
buildMsg
(
boxLadingBillDO
.
getAgentId
(),
2
));
headMap
.
put
(
"mblNo"
,
boxLadingBillDO
.
getBlMblNo
());
headMap
.
put
(
"soNo"
,
boxLadingBillDO
.
getSoNo
());
if
(
boxShippingDO
!=
null
)
{
headMap
.
put
(
"date"
,
boxShippingDO
.
getDtRealShipTime
()
==
null
?
""
:
DateUtil
.
formatDateTime
(
boxShippingDO
.
getDtRealShipTime
()));
}
if
(
boxLadingBillDO
.
getShipCompanyId
()
!=
null
&&
boxLadingBillDO
.
getShipCompanyId
()
>
0L
)
{
headMap
.
put
(
"shipCompany"
,
supplierService
.
getSupplier
(
boxLadingBillDO
.
getShipCompanyId
()).
getCompanyEn
());
}
if
(
box
!=
null
)
{
headMap
.
put
(
"qyDate"
,
box
.
getQyDate
()
==
null
?
""
:
DateUtil
.
formatDateTime
(
box
.
getQyDate
()));
}
headMap
.
put
(
"shipType"
,
shipType
);
headMap
.
put
(
"freight"
,
"FREIGHT PREPAID"
);
StringBuffer
remarks
=
new
StringBuffer
();
Integer
issueType
=
boxLadingBillDO
.
getIssueType
();
if
(
StringUtils
.
isNotBlank
(
boxLadingBillDO
.
getRemarks
()))
{
remarks
.
append
(
boxLadingBillDO
.
getRemarks
());
}
if
(
issueType
==
1
)
{
remarks
.
append
(
"\r\n"
).
append
(
"正本"
);
}
else
if
(
issueType
==
2
)
{
remarks
.
append
(
"\r\n"
).
append
(
"电放"
);
}
headMap
.
put
(
"remark"
,
remarks
.
toString
());
if
(
boxLadingBillDO
.
getStartPortId
()
!=
null
&&
boxLadingBillDO
.
getStartPortId
()
>
0L
)
{
headMap
.
put
(
"loadingPort"
,
dockService
.
getDock
(
boxLadingBillDO
.
getStartPortId
()).
getTitleEn
());
}
if
(
boxLadingBillDO
.
getDestPortId
()
!=
null
&&
boxLadingBillDO
.
getDestPortId
()
>
0L
)
{
headMap
.
put
(
"dischargingPort"
,
dockService
.
getDock
(
boxLadingBillDO
.
getDestPortId
()).
getTitleEn
());
}
headMap
.
put
(
"markNo"
,
boxLadingBillDO
.
getMarkNo
());
if
(
StringUtils
.
isEmpty
(
boxLadingBillDO
.
getPackageUnit
()))
{
headMap
.
put
(
"pkgs"
,
boxLadingBillDO
.
getPackageNum
()
==
null
?
""
:
boxLadingBillDO
.
getPackageNum
()
+
""
);
}
else
{
DictDataRespDTO
dictDataFromCache
=
DictFrameworkUtils
.
getDictDataFromCache
(
"goods_package_type"
,
boxLadingBillDO
.
getPackageUnit
());
if
(
dictDataFromCache
!=
null
)
{
headMap
.
put
(
"pkgs"
,
boxLadingBillDO
.
getPackageNum
()
==
null
?
""
:
boxLadingBillDO
.
getPackageNum
()
+
dictDataFromCache
.
getLabelEn
());
}
else
{
headMap
.
put
(
"pkgs"
,
boxLadingBillDO
.
getPackageNum
()
==
null
?
""
:
boxLadingBillDO
.
getPackageNum
()
+
""
);
}
}
headMap
.
put
(
"description"
,
boxLadingBillDO
.
getGoodsDesc
());
headMap
.
put
(
"weight"
,
boxLadingBillDO
.
getKgs
()
==
null
?
""
:
String
.
valueOf
(
boxLadingBillDO
.
getKgs
().
doubleValue
()));
headMap
.
put
(
"volume"
,
boxLadingBillDO
.
getCbm
()
==
null
?
""
:
String
.
valueOf
(
boxLadingBillDO
.
getCbm
().
doubleValue
()));
headMap
.
put
(
"boxNo"
,
boxLadingBillDO
.
getContainerSealNo
());
headMap
.
put
(
"totalNum"
,
"SAY("
+
shipType
+
")ONLY "
);
headMap
.
put
(
"selfNo"
,
box
.
getSelfNo
()
==
null
?
""
:
box
.
getSelfNo
());
return
headMap
;
}
private
String
buildMsg
(
Long
id
,
int
i
)
{
StringBuffer
stringBuffer
=
new
StringBuffer
(
""
);
if
(
id
==
null
||
id
==
0L
)
{
...
...
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxMergePkg/BoxMergePkgServiceImpl.java
View file @
f46ce85e
...
...
@@ -456,10 +456,14 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
if
(
boxMergePkgDO
==
null
)
{
throw
exception
(
BOX_MERGE_PKG_NOT_EXISTS
);
}
List
<
BoxPkgOrderDO
>
boxPkgOrderDOS
=
boxPkgOrderService
.
selectList
(
BoxPkgOrderDO:
:
getPkgId
,
boxMergePkgDO
.
getId
());
List
<
BoxPkgOrderDO
>
boxPkgOrderDOS
=
boxPkgOrderService
.
selectList
(
BoxPkgOrderDO:
:
getPkgId
,
boxMergePkgDO
.
getId
());
List
<
Long
>
orderIds
=
boxPkgOrderDOS
.
stream
().
map
(
BoxPkgOrderDO:
:
getOrderId
).
distinct
().
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
orderIds
))
{
List
<
OrderDO
>
orderDOS
=
orderService
.
selectList
(
OrderDO:
:
getOrderId
,
orderIds
);
List
<
OrderDO
>
orderDOS
=
orderService
.
selectList
(
OrderDO:
:
getOrderId
,
orderIds
);
orderDOS
.
stream
().
forEach
(
item
->
{
BoxMergePkgPDAVO
boxMergePkgPDAVO
=
new
BoxMergePkgPDAVO
();
boxMergePkgPDAVO
.
setOrderId
(
item
.
getOrderId
());
...
...
yudao-module-shipment/yudao-module-shipment-rest/src/main/java/cn/iocoder/yudao/module/shipment/controller/admin/BoxLadingBillController.java
View file @
f46ce85e
...
...
@@ -18,10 +18,13 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import
com.itextpdf.text.pdf.*
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
io.swagger.annotations.*
;
import
javax.validation.constraints.*
;
import
javax.validation.*
;
import
javax.servlet.http.*
;
...
...
@@ -33,8 +36,10 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
error
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
cn.iocoder.yudao.framework.excel.util.ExcelUtils
;
import
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
operatelog
.
core
.
enums
.
OperateTypeEnum
.*;
@Validated
...
...
@@ -96,7 +101,7 @@ public class BoxLadingBillController {
@PreAuthorize
(
"@ss.hasPermission('ecw:box-lading-bill:export')"
)
@OperateLog
(
type
=
EXPORT
)
public
void
exportBoxLadingBillExcel
(
@Valid
BoxLadingBillQueryVO
query
,
HttpServletResponse
response
)
throws
IOException
{
HttpServletResponse
response
)
throws
IOException
{
List
<
BoxLadingBillDO
>
list
=
boxLadingBillService
.
getBoxLadingBillList
(
query
);
// 导出 Excel
List
<
BoxLadingBillBackVO
>
datas
=
BoxLadingBillConvert
.
INSTANCE
.
convertList
(
list
);
...
...
@@ -109,7 +114,7 @@ public class BoxLadingBillController {
@GetMapping
(
"/getBoxLadingBillPdf"
)
@ApiOperation
(
"获得提单补料pdf"
)
@ApiImplicitParam
(
name
=
"shipmentId"
,
value
=
"出货编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
public
CommonResult
<
String
>
getBoxLadingBillPdf
(
@RequestParam
(
"shipmentId"
)
Long
shipmentId
,
@RequestParam
(
"type"
)
Integer
type
,
HttpServletResponse
response
)
throws
Exception
{
public
CommonResult
<
String
>
getBoxLadingBillPdf
(
@RequestParam
(
"shipmentId"
)
Long
shipmentId
,
@RequestParam
(
"type"
)
Integer
type
,
HttpServletResponse
response
)
throws
Exception
{
InputStream
inputStream
=
null
;
OutputStream
outputStream
=
null
;
BoxLadingBillDO
boxLadingBillDO
=
boxLadingBillService
.
selectOne
(
BoxLadingBillDO:
:
getShipmentId
,
shipmentId
);
...
...
@@ -118,19 +123,27 @@ public class BoxLadingBillController {
}
try
{
// inputStream = new FileInputStream(new File("C:\\lzlj\\boxLadingBill.xlsx"));
if
(
type
==
1
)
{
if
(
type
==
1
)
{
//从海运页面进入
//海运叫提单确认件
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
path
+
"/boxLadingBill.xlsx"
);
}
else
if
(
type
==
2
){
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
path
+
"/boxLadingBill.xlsx"
);
}
else
if
(
type
==
2
)
{
//空运叫提单补料
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
path
+
"/boxAirLadingBill.xlsx"
);
inputStream
=
this
.
getClass
().
getClassLoader
().
getResourceAsStream
(
path
+
"/boxAirLadingBill.xlsx"
);
}
outputStream
=
response
.
getOutputStream
();
//获取模板字段值 lanbm 2024-05-28 添加注释
Map
<
String
,
String
>
boxLadingBillPdf
=
boxLadingBillService
.
getBoxLadingBillPdf
(
shipmentId
);
Map
<
String
,
String
>
boxLadingBillPdf
=
null
;
if
(
type
==
2
)
//空运
boxLadingBillPdf
=
boxLadingBillService
.
getBoxLadingBillPdf
(
shipmentId
);
else
if
(
type
==
1
)
//海运
boxLadingBillPdf
=
boxLadingBillService
.
getBoxLadingBillPdf_2
(
shipmentId
);
ExcelWriter
excelWriter
=
EasyExcel
.
write
(
outputStream
).
withTemplate
(
inputStream
).
build
();
...
...
@@ -139,7 +152,7 @@ public class BoxLadingBillController {
excelWriter
.
fill
(
boxLadingBillPdf
,
sheet
);
excelWriter
.
finish
();
outputStream
.
flush
();
}
finally
{
}
finally
{
if
(
inputStream
!=
null
)
{
inputStream
.
close
();
}
...
...
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