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
3976f929
Commit
3976f929
authored
Sep 12, 2024
by
zhengyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报关删单退场业务bug修复
parent
73dd431f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
8 deletions
+82
-8
BoxApprovalController.java
...dule/shipment/controller/admin/BoxApprovalController.java
+22
-1
BoxController.java
...yudao/module/shipment/controller/admin/BoxController.java
+30
-6
BoxCustomsController.java
...odule/shipment/controller/admin/BoxCustomsController.java
+24
-1
Constant.java
...o/module/shipment/controller/admin/constant/Constant.java
+6
-0
No files found.
yudao-module-shipment/yudao-module-shipment-rest/src/main/java/cn/iocoder/yudao/module/shipment/controller/admin/BoxApprovalController.java
View file @
3976f929
...
...
@@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog
;
import
cn.iocoder.yudao.framework.redis.helper.RedisHelper
;
import
cn.iocoder.yudao.module.order.dal.dataobject.approval.OrderApprovalDO
;
import
cn.iocoder.yudao.module.order.enums.ApprovalResultStatusEnum
;
import
cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum
;
...
...
@@ -32,11 +33,16 @@ import javax.annotation.Resource;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
java.io.IOException
;
import
java.text.MessageFormat
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
error
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
operatelog
.
core
.
enums
.
OperateTypeEnum
.
EXPORT
;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.
ORDER_UPDATE_REPEAT_COMMIT
;
import
static
cn
.
iocoder
.
yudao
.
module
.
shipment
.
controller
.
admin
.
constant
.
Constant
.
BOX_UPDATE_KEY
;
@Validated
@RestController
...
...
@@ -53,6 +59,8 @@ public class BoxApprovalController {
@Resource
private
OrderApprovalService
orderApprovalService
;
@Resource
private
RedisHelper
redisHelper
;
/*
创建出货审批流程
*/
...
...
@@ -62,7 +70,20 @@ public class BoxApprovalController {
//@PreAuthorize("@ss.hasPermission('ecw:box-approval:create')")
public
CommonResult
<
Long
>
createBoxApproval
(
@Valid
@RequestBody
BoxApprovalCreateReqVO
createReqVO
)
{
return
success
(
boxApprovalService
.
createBoxApproval
(
createReqVO
));
String
redisKey
=
MessageFormat
.
format
(
BOX_UPDATE_KEY
,
createReqVO
.
getShipmentId
().
toString
());
Long
count
=
redisHelper
.
incrBy
(
redisKey
,
1
);
if
(
count
>
1
)
{
return
error
(
ORDER_UPDATE_REPEAT_COMMIT
);
}
redisHelper
.
expire
(
redisKey
,
1
,
TimeUnit
.
MINUTES
);
try
{
Long
id
=
boxApprovalService
.
createBoxApproval
(
createReqVO
);
return
success
(
id
);
}
catch
(
Exception
e
){
throw
e
;
}
finally
{
redisHelper
.
delete
(
redisKey
);
}
}
@PostMapping
(
"/approvalDetail"
)
...
...
yudao-module-shipment/yudao-module-shipment-rest/src/main/java/cn/iocoder/yudao/module/shipment/controller/admin/BoxController.java
View file @
3976f929
...
...
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.i18n.core.I18nMessage;
import
cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent
;
import
cn.iocoder.yudao.framework.limiter.dynamic.DynamicRateLimiter
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.redis.helper.RedisHelper
;
import
cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO
;
import
cn.iocoder.yudao.module.order.dto.ContainerNumberSummaryDto
;
import
cn.iocoder.yudao.module.order.dto.OrderCostSummaryDto
;
...
...
@@ -27,7 +28,9 @@ import com.alibaba.excel.write.metadata.fill.FillConfig;
import
com.alibaba.fastjson.JSONObject
;
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.*
;
...
...
@@ -36,16 +39,22 @@ import javax.validation.*;
import
javax.servlet.http.*
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.text.MessageFormat
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
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
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.
ORDER_UPDATE_REPEAT_COMMIT
;
import
static
cn
.
iocoder
.
yudao
.
module
.
shipment
.
controller
.
admin
.
constant
.
Constant
.
BOX_UPDATE_KEY
;
import
static
cn
.
iocoder
.
yudao
.
module
.
shipment
.
enums
.
ErrorCodeConstants
.
BOX_REPORT_NOT_EXIST
;
import
cn.iocoder.yudao.module.shipment.vo.box.*
;
...
...
@@ -62,6 +71,9 @@ public class BoxController {
@Resource
private
BoxService
boxService
;
@Resource
private
RedisHelper
redisHelper
;
@Resource
private
FileMakeApi
fileMakeApi
;
...
...
@@ -105,7 +117,19 @@ public class BoxController {
@DynamicRateLimiter
(
base
=
"#Headers['Authorization']"
,
permits
=
1
)
@Idempotent
(
timeout
=
5
)
public
CommonResult
<
Boolean
>
updateBox
(
@Valid
@RequestBody
BoxUpdateReqVO
updateReqVO
)
{
String
redisKey
=
MessageFormat
.
format
(
BOX_UPDATE_KEY
,
updateReqVO
.
getId
().
toString
());
Long
count
=
redisHelper
.
incrBy
(
redisKey
,
1
);
if
(
count
>
1
)
{
return
error
(
ORDER_UPDATE_REPEAT_COMMIT
);
}
redisHelper
.
expire
(
redisKey
,
1
,
TimeUnit
.
MINUTES
);
try
{
boxService
.
updateBox
(
updateReqVO
);
}
catch
(
Exception
e
)
{
throw
e
;
}
finally
{
redisHelper
.
delete
(
redisKey
);
}
return
success
(
true
);
}
...
...
@@ -330,7 +354,7 @@ public class BoxController {
public
CommonResult
exportOrderSummary
(
BoxSettlementQueryVO
query
,
HttpServletResponse
response
)
throws
Exception
{
FileMakeReqDTO
reqDTO
=
new
FileMakeReqDTO
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"query"
,
JSONObject
.
toJSONString
(
query
));
jsonObject
.
put
(
"query"
,
JSONObject
.
toJSONString
(
query
));
reqDTO
.
setType
(
DownloadTypeEnum
.
SHIPMENT_SUMMERY_EXCEL_EXPORT
.
getType
());
reqDTO
.
setName
(
"出货应收报表"
);
reqDTO
.
setFileSuffix
(
"xlsx"
);
...
...
yudao-module-shipment/yudao-module-shipment-rest/src/main/java/cn/iocoder/yudao/module/shipment/controller/admin/BoxCustomsController.java
View file @
3976f929
package
cn
.
iocoder
.
yudao
.
module
.
shipment
.
controller
.
admin
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.redis.helper.RedisHelper
;
import
cn.iocoder.yudao.module.shipment.convert.BoxCustomsConvert
;
import
cn.iocoder.yudao.module.shipment.dal.dataobject.BoxCustomsDO
;
import
cn.iocoder.yudao.module.shipment.service.boxCustoms.BoxCustomsService
;
...
...
@@ -15,14 +16,21 @@ import org.springframework.security.access.prepost.PreAuthorize;
import
io.swagger.annotations.*
;
import
javax.validation.*
;
import
javax.servlet.http.*
;
import
java.text.MessageFormat
;
import
java.util.*
;
import
java.io.IOException
;
import
java.util.concurrent.TimeUnit
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
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
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
order
.
enums
.
ErrorCodeConstants
.
ORDER_UPDATE_REPEAT_COMMIT
;
import
static
cn
.
iocoder
.
yudao
.
module
.
shipment
.
controller
.
admin
.
constant
.
Constant
.
BOX_UPDATE_KEY
;
@Validated
@RestController
...
...
@@ -33,6 +41,9 @@ public class BoxCustomsController {
@Resource
private
BoxCustomsService
boxCustomsService
;
@Resource
private
RedisHelper
redisHelper
;
@PostMapping
(
"/create"
)
@ApiOperation
(
"创建报关,use this"
)
// @PreAuthorize("@ss.hasPermission('ecw:box-customs:create')")
...
...
@@ -44,7 +55,19 @@ public class BoxCustomsController {
@ApiOperation
(
"更新报关, use this"
)
// @PreAuthorize("@ss.hasPermission('ecw:box-customs:update')")
public
CommonResult
<
Boolean
>
updateBoxCustoms
(
@Valid
@RequestBody
BoxCustomsUpdateReqVO
updateReqVO
)
{
String
redisKey
=
MessageFormat
.
format
(
BOX_UPDATE_KEY
,
updateReqVO
.
getShipmentId
().
toString
());
Long
count
=
redisHelper
.
incrBy
(
redisKey
,
1
);
if
(
count
>
1
)
{
return
error
(
ORDER_UPDATE_REPEAT_COMMIT
);
}
redisHelper
.
expire
(
redisKey
,
1
,
TimeUnit
.
MINUTES
);
try
{
boxCustomsService
.
updateBoxCustoms
(
updateReqVO
);
}
catch
(
Exception
e
){
throw
e
;
}
finally
{
redisHelper
.
delete
(
redisKey
);
}
return
success
(
true
);
}
...
...
yudao-module-shipment/yudao-module-shipment-rest/src/main/java/cn/iocoder/yudao/module/shipment/controller/admin/constant/Constant.java
0 → 100644
View file @
3976f929
package
cn
.
iocoder
.
yudao
.
module
.
shipment
.
controller
.
admin
.
constant
;
public
interface
Constant
{
String
BOX_UPDATE_KEY
=
"jiedao:box:update:{0}"
;
}
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