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
abaa0888
Commit
abaa0888
authored
Mar 11, 2025
by
Smile
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/jd_cons' into jd_cons
parents
c1670481
ba6f6a1c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
14 deletions
+109
-14
ConsService.java
.../iocoder/yudao/module/order/service/cons/ConsService.java
+5
-0
ConsServiceImpl.java
...oder/yudao/module/order/service/cons/ConsServiceImpl.java
+61
-10
ConsBaseVO.java
...ava/cn/iocoder/yudao/module/order/vo/cons/ConsBaseVO.java
+1
-1
ConsController.java
...ao/module/order/controller/admin/cons/ConsController.java
+42
-3
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/cons/ConsService.java
View file @
abaa0888
...
...
@@ -85,4 +85,9 @@ public interface ConsService extends IService<ConsDO> {
* @return
*/
void
createPad
(
ConsCreateReqVO
createReqVO
);
/**
* 签收PDA
*/
void
signedPda
(
ConsUpdateReqVO
updateReqVO
);
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/cons/ConsServiceImpl.java
View file @
abaa0888
...
...
@@ -32,6 +32,8 @@ import cn.iocoder.yudao.module.product.dal.dataobject.product.ProductDO;
import
cn.iocoder.yudao.module.product.dal.mysql.product.ProductMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.apache.commons.lang3.StringUtils
;
import
org.checkerframework.checker.units.qual.C
;
import
org.redisson.api.RAtomicLong
;
import
org.redisson.api.RLock
;
import
org.redisson.api.RedissonClient
;
...
...
@@ -77,6 +79,7 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme
@Resource
private
CustomerContactsService
customerContactsService
;
@Override
@Transactional
public
Long
createCons
(
ConsCreateReqVO
createReqVO
)
{
...
...
@@ -322,11 +325,58 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme
}
}
}
/**
* 签收PDA
*/
@Transactional
@Override
public
void
signedPda
(
ConsUpdateReqVO
updateReqVO
)
{
if
(
StringUtils
.
isBlank
(
updateReqVO
.
getExpressNo
()))
{
throw
new
ServiceException
(
30004
,
"包裹快递号不能为空"
);
}
if
(
updateReqVO
.
getExpressId
()
==
null
)
{
throw
new
ServiceException
(
30004
,
"请选择快递公司"
);
}
Long
count
=
consMapper
.
selectCount
(
new
LambdaQueryWrapperX
<
ConsDO
>().
eq
(
ConsDO:
:
getExpressNo
,
updateReqVO
.
getExpressNo
())
.
ne
(
ConsDO:
:
getId
,
updateReqVO
.
getId
()));
if
(
count
>
0
)
{
throw
new
ServiceException
(
30004
,
"包裹快递号已存在,请检查"
);
}
//更新图片地址,仅签收情况
if
(
updateReqVO
.
getMediaUrl
()
!=
null
&&
updateReqVO
.
getSigner
()
!=
null
)
{
ConsMediaDO
consMedia
=
consMediaService
.
selectOne
(
new
LambdaQueryWrapperX
<
ConsMediaDO
>()
.
eq
(
ConsMediaDO:
:
getBizId
,
updateReqVO
.
getId
())
.
eq
(
ConsMediaDO:
:
getConsId
,
updateReqVO
.
getId
())
.
eq
(
ConsMediaDO:
:
getMediaBusinessType
,
3
));
if
(
consMedia
!=
null
)
{
consMedia
.
setMediaUrl
(
updateReqVO
.
getMediaUrl
());
consMediaService
.
updateById
(
consMedia
);
}
else
{
ConsMediaCreateReqVO
consMediaCreateReqVO
=
new
ConsMediaCreateReqVO
();
consMediaCreateReqVO
.
setConsId
(
updateReqVO
.
getId
());
consMediaCreateReqVO
.
setMediaUrl
(
updateReqVO
.
getMediaUrl
());
consMediaCreateReqVO
.
setMediaBusinessType
(
3
);
consMediaCreateReqVO
.
setBizId
(
updateReqVO
.
getId
());
consMediaCreateReqVO
.
setTableName
(
"ecw_cons"
);
consMediaCreateReqVO
.
setColumnName
(
"files"
);
consMediaCreateReqVO
.
setOriginalFileName
(
"签收图片"
);
consMediaService
.
createConsMedia
(
consMediaCreateReqVO
);
}
}
// 更新
ConsDO
updateObj
=
ConsConvert
.
INSTANCE
.
convert
(
updateReqVO
);
consMapper
.
updateById
(
updateObj
);
}
@Override
public
OrderBackVO
getTempOrderByConsIds
(
Collection
<
Long
>
ids
)
{
List
<
ConsDO
>
consList
=
consMapper
.
selectList
(
new
LambdaQueryWrapperX
<
ConsDO
>().
in
(
ConsDO:
:
getId
,
ids
));
if
(
consList
==
null
||
consList
.
isEmpty
())
{
throw
exception
(
30004
,
"包裹不存在"
);
if
(
consList
==
null
||
consList
.
isEmpty
())
{
throw
exception
(
30004
,
"包裹不存在"
);
}
OrderBackVO
orderBackVO
=
new
OrderBackVO
();
orderBackVO
.
setDeliveryDate
(
new
Date
());
...
...
@@ -345,7 +395,7 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme
Map
<
Long
,
List
<
ConsItemDO
>>
consItemsMap
=
consItemDOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
ConsItemDO:
:
getConsId
));
for
(
int
j
=
0
;
j
<
consList
.
size
();
j
++)
{
ConsDO
consDO
=
consList
.
get
(
j
);
if
(
j
==
0
)
{
if
(
j
==
0
)
{
List
<
CustomerContactsDO
>
customerContacts
=
customerContactsService
.
getCustomerContactsListByCustomerId
(
consDO
.
getCustomerId
());
Optional
<
CustomerContactsDO
>
firstDefault
=
customerContacts
.
stream
()
.
filter
(
customerContactsDO
->
customerContactsDO
.
getIsDefault
()
==
1
)
...
...
@@ -372,18 +422,18 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme
orderConsignorBackVO
.
setCountryCode
(
contact
.
getAreaCode
());
orderBackVO
.
setConsigneeVO
(
orderConsigneeBackVO
);
orderBackVO
.
setConsignorVO
(
orderConsignorBackVO
);
}
else
{
throw
exception
(
30004
,
"包裹联系人为空"
);
}
else
{
throw
exception
(
30004
,
"包裹联系人为空"
);
}
}
if
(
consDO
.
getCustomerId
()
!=
null
&&
orderBackVO
.
getCustomerId
()==
null
)
{
if
(
consDO
.
getCustomerId
()
!=
null
&&
orderBackVO
.
getCustomerId
()
==
null
)
{
orderBackVO
.
setCustomerId
(
consDO
.
getCustomerId
());
orderBackVO
.
setMarks
(
consDO
.
getCustomerNumber
());
}
if
(
consDO
.
getTransportId
()!=
null
&&
orderBackVO
.
getTransportId
()==
null
)
{
if
(
consDO
.
getTransportId
()
!=
null
&&
orderBackVO
.
getTransportId
()
==
null
)
{
orderBackVO
.
setTransportId
(
consDO
.
getTransportId
());
}
if
(
consDO
.
getWarehouseLineId
()!=
null
&&
logisticsInfo
.
getLineId
()==
null
)
{
if
(
consDO
.
getWarehouseLineId
()
!=
null
&&
logisticsInfo
.
getLineId
()
==
null
)
{
logisticsInfo
.
setLineId
(
consDO
.
getWarehouseLineId
());
logisticsInfo
.
setDestCityId
(
consDO
.
getConsigneeCityId
());
logisticsInfo
.
setDestCountryId
(
consDO
.
getConsigneeCountryId
());
...
...
@@ -396,7 +446,7 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme
for
(
int
i
=
0
;
i
<
consItemDOList
.
size
();
i
++)
{
ConsItemDO
consItemDO
=
consItemDOList
.
get
(
i
);
OrderItemBackVO
orderItemBackVO
=
new
OrderItemBackVO
();
if
(
i
==
0
)
{
if
(
i
==
0
)
{
orderItemBackVO
.
setWorth
(
consDO
.
getWorth
());
}
orderItemBackVO
.
setProdId
(
consItemDO
.
getProdId
());
...
...
@@ -419,7 +469,8 @@ public class ConsServiceImpl extends AbstractService<ConsMapper, ConsDO> impleme
}
orderBackVO
.
setOrderItemVOList
(
orderItemVOList
);
};
}
;
orderBackVO
.
setIsCargoControl
(
false
);
return
orderBackVO
;
}
...
...
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/cons/ConsBaseVO.java
View file @
abaa0888
...
...
@@ -82,7 +82,7 @@ public class ConsBaseVO {
private
Boolean
signed
;
@ApiModelProperty
(
value
=
"签收时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY
_HOUR_MINUTE_SECOND
)
private
Date
signedTime
;
@ApiModelProperty
(
value
=
"签收备注"
)
...
...
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/controller/admin/cons/ConsController.java
View file @
abaa0888
...
...
@@ -127,7 +127,7 @@ public class ConsController {
consBackVO
.
setPhoneNew
(
customerContacts
.
getPhoneNew
());
consBackVO
.
setCustomerName
(
customer
.
getName
());
//获取签收图片
if
(
cons
.
getSigned
())
{
if
(
cons
.
getSigned
())
{
ConsMediaDO
consMedia
=
consentMediaService
.
getOne
(
new
LambdaQueryWrapperX
<
ConsMediaDO
>().
eq
(
ConsMediaDO:
:
getConsId
,
cons
.
getId
())
.
eq
(
ConsMediaDO:
:
getBizId
,
cons
.
getId
()));
consBackVO
.
setMediaUrl
(
consMedia
.
getMediaUrl
());
...
...
@@ -165,7 +165,7 @@ public class ConsController {
@PreAuthorize
(
"@ss.hasPermission('ecw:cons:export')"
)
@OperateLog
(
type
=
EXPORT
)
public
void
exportConsExcel
(
@Valid
ConsQueryVO
query
,
HttpServletResponse
response
)
throws
IOException
{
HttpServletResponse
response
)
throws
IOException
{
List
<
ConsDO
>
list
=
consService
.
getConsList
(
query
);
// 导出 Excel
List
<
ConsBackVO
>
datas
=
ConsConvert
.
INSTANCE
.
convertList
(
list
);
...
...
@@ -193,8 +193,47 @@ public class ConsController {
@GetMapping
(
"/getTempOrderByConsIds"
)
@ApiOperation
(
"创建转运临时order对象"
)
public
CommonResult
<
OrderBackVO
>
getTempOrderByConsIds
(
@RequestParam
(
"ids"
)
Collection
<
Long
>
ids
){
public
CommonResult
<
OrderBackVO
>
getTempOrderByConsIds
(
@RequestParam
(
"ids"
)
Collection
<
Long
>
ids
)
{
OrderBackVO
tempOrderByConsIds
=
consService
.
getTempOrderByConsIds
(
ids
);
return
CommonResult
.
success
(
tempOrderByConsIds
);
}
@GetMapping
(
"/getPad"
)
@ApiOperation
(
"获得集运包裹主"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
example
=
"1024"
,
dataTypeClass
=
Long
.
class
)
public
CommonResult
<
ConsBackVO
>
getPad
(
@RequestParam
(
"id"
)
Long
id
)
{
ConsDO
cons
=
consService
.
getCons
(
id
);
CustomerDO
customer
=
customerService
.
selectOne
(
"id"
,
cons
.
getCustomerId
());
CustomerContactsDO
customerContacts
=
customerContactsService
.
getDefaultContacts
(
cons
.
getCustomerId
());
List
<
ConsItemBackVO
>
consItemBackVOS
=
consItemService
.
getConsItemBackVOList
(
new
ConsItemQueryVO
().
setConsId
(
id
));
ConsBackVO
consBackVO
=
ConsConvert
.
INSTANCE
.
convert
(
cons
);
consBackVO
.
setConsItemVOList
(
consItemBackVOS
);
consBackVO
.
setAreaCode
(
customerContacts
.
getAreaCode
());
consBackVO
.
setPhoneNew
(
customerContacts
.
getPhoneNew
());
consBackVO
.
setCustomerName
(
customer
.
getName
());
//获取签收图片
if
(
cons
.
getSigned
())
{
ConsMediaDO
consMedia
=
consentMediaService
.
getOne
(
new
LambdaQueryWrapperX
<
ConsMediaDO
>().
eq
(
ConsMediaDO:
:
getConsId
,
cons
.
getId
())
.
eq
(
ConsMediaDO:
:
getBizId
,
cons
.
getId
())
.
eq
(
ConsMediaDO:
:
getMediaBusinessType
,
3
));
consBackVO
.
setMediaUrl
(
consMedia
==
null
?
""
:
consMedia
.
getMediaUrl
());
}
// 物流信息查询
LogisticsInfoDto
initialLogisticsInfoDto
=
warehouseLineMapper
.
getStartInfoAndDestInfoByLineId
(
cons
.
getWarehouseLineId
());
if
(
Objects
.
isNull
(
initialLogisticsInfoDto
))
{
throw
exception
(
NOT_FIND_LOGISTICS_INFO
);
}
//初始物流信息
consBackVO
.
setInitialLogisticsInfoDto
(
initialLogisticsInfoDto
);
return
success
(
consBackVO
);
}
@PutMapping
(
"/signedPda"
)
@ApiOperation
(
"签收PDA"
)
public
CommonResult
<
Boolean
>
signedPda
(
@Valid
@RequestBody
ConsUpdateReqVO
updateReqVO
)
{
consService
.
signedPda
(
updateReqVO
);
return
success
(
true
);
}
}
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