Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
foodNexus-admin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
副食品筹措管理平台
foodNexus-admin
Commits
b3342487
Commit
b3342487
authored
Oct 22, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp流程调整
parent
c264d53b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
19 deletions
+94
-19
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpPurchaseInController.java
+2
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpPurchaseReturnController.java
+2
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/ErpSaleOrderController.java
+2
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/sale/ErpSaleReturnDO.java
+6
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/enums/SaleOrderPickUpStatus.java
+17
-12
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleReturnServiceImpl.java
+8
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderReturnRespVO.java
+21
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
+36
-0
No files found.
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpPurchaseInController.java
View file @
b3342487
...
...
@@ -63,7 +63,7 @@ public class ErpPurchaseInController {
@Resource
private
AdminUserApi
adminUserApi
;
@PostMapping
(
"/create"
)
/*
@PostMapping("/create")
@Operation(summary = "创建采购入库")
@PreAuthorize("@ss.hasPermission('erp:purchase-in:create')")
public CommonResult<Long> createPurchaseIn(@Valid @RequestBody ErpPurchaseInSaveReqVO createReqVO) {
...
...
@@ -85,7 +85,7 @@ public class ErpPurchaseInController {
@RequestParam("status") Integer status) {
purchaseInService.updatePurchaseInStatus(id, status);
return success(true);
}
}
*/
@DeleteMapping
(
"/delete"
)
@Operation
(
summary
=
"删除采购入库"
)
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpPurchaseReturnController.java
View file @
b3342487
...
...
@@ -60,7 +60,7 @@ public class ErpPurchaseReturnController {
@Resource
private
AdminUserApi
adminUserApi
;
@PostMapping
(
"/create"
)
/*
@PostMapping("/create")
@Operation(summary = "创建采购退货")
@PreAuthorize("@ss.hasPermission('erp:purchase-return:create')")
public CommonResult<Long> createPurchaseReturn(@Valid @RequestBody ErpPurchaseReturnSaveReqVO createReqVO) {
...
...
@@ -83,7 +83,7 @@ public class ErpPurchaseReturnController {
purchaseReturnService.updatePurchaseReturnStatus(id, status);
return success(true);
}
*/
@DeleteMapping
(
"/delete"
)
@Operation
(
summary
=
"删除采购退货"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号数组"
,
required
=
true
)
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/ErpSaleOrderController.java
View file @
b3342487
...
...
@@ -89,7 +89,7 @@ public class ErpSaleOrderController {
@Autowired
private
ErpSupplierApi
supplierApi
;
@PostMapping
(
"/create"
)
/*
@PostMapping("/create")
@Operation(summary = "创建销售订单")
@PreAuthorize("@ss.hasPermission('erp:sale-out:create')")
public CommonResult<Long> createSaleOrder(@Valid @RequestBody ErpSaleOrderSaveReqVO createReqVO) {
...
...
@@ -111,7 +111,7 @@ public class ErpSaleOrderController {
@RequestParam("status") Integer status) {
saleOrderService.updateSaleOrderStatus(id, status);
return success(true);
}
}
*/
@PostMapping
(
"/delivery-staff"
)
@Operation
(
summary
=
"选择配送人员"
)
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/sale/ErpSaleReturnDO.java
View file @
b3342487
...
...
@@ -194,4 +194,9 @@ public class ErpSaleReturnDO extends BaseDO {
*/
private
LocalDateTime
arrivalTime
;
/**
* 审核时间
*/
private
LocalDateTime
auditTime
;
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/enums/SaleOrderPickUpStatus.java
View file @
b3342487
...
...
@@ -16,37 +16,37 @@ import java.util.Arrays;
@Getter
public
enum
SaleOrderPickUpStatus
implements
ArrayValuable
<
String
>
{
CANCEL
(
"CANCEL"
,
"取消"
,
Boolean
.
FALSE
),
CANCEL
(
"CANCEL"
,
"取消"
,
Boolean
.
FALSE
,
-
1
),
TO_BE
(
"TO_BE"
,
"待拣"
,
Boolean
.
FALSE
),
TO_BE
(
"TO_BE"
,
"待拣"
,
Boolean
.
FALSE
,
0
),
PICK_UP
(
"PICK_UP"
,
"待接单"
,
Boolean
.
FALSE
),
PICK_UP
(
"PICK_UP"
,
"待接单"
,
Boolean
.
FALSE
,
1
),
ACCEPT
(
"ACCEPT"
,
"待配送"
,
Boolean
.
FALSE
),
ACCEPT
(
"ACCEPT"
,
"待配送"
,
Boolean
.
FALSE
,
2
),
ALREADY
(
"ALREADY"
,
"配送中"
,
Boolean
.
FALSE
),
ALREADY
(
"ALREADY"
,
"配送中"
,
Boolean
.
FALSE
,
3
),
ARRIVAL
(
"ARRIVAL"
,
"已到货"
,
Boolean
.
FALSE
),
ARRIVAL
(
"ARRIVAL"
,
"已到货"
,
Boolean
.
FALSE
,
4
),
SIGN
(
"SIGN"
,
"已签收"
,
Boolean
.
FALSE
),
SIGN
(
"SIGN"
,
"已签收"
,
Boolean
.
FALSE
,
5
),
/* ----- 退款 ------ */
// 生成销售退货单
RETURNS_PROCESS
(
"RETURNS_PROCESS"
,
"退款 - 审核中"
,
Boolean
.
TRUE
),
RETURNS_PROCESS
(
"RETURNS_PROCESS"
,
"退款 - 审核中"
,
Boolean
.
TRUE
,
6
),
// 销售退货单申请通过
RETURNS_APPROVE
(
"RETURNS_APPROVE"
,
"退款 - 已审核"
,
Boolean
.
TRUE
),
RETURNS_APPROVE
(
"RETURNS_APPROVE"
,
"退款 - 已审核"
,
Boolean
.
TRUE
,
7
),
// 销售退货单根据供应商拆分为采购退货单
// 配送员接受采购退货单
RETURNS_STAFF_ACCEPT
(
"RETURNS_STAFF_ACCEPT"
,
"退款 - 配送员接单"
,
Boolean
.
TRUE
),
RETURNS_STAFF_ACCEPT
(
"RETURNS_STAFF_ACCEPT"
,
"退款 - 配送员接单"
,
Boolean
.
TRUE
,
8
),
// 配送员取件发货
RETURNS_STAFF_ALREADY
(
"RETURNS_STAFF_ALREADY"
,
"退款 - 配送员已取件"
,
Boolean
.
TRUE
),
RETURNS_STAFF_ALREADY
(
"RETURNS_STAFF_ALREADY"
,
"退款 - 配送员已取件"
,
Boolean
.
TRUE
,
9
),
// 确认收获
RETURNS_FINISH
(
"RETURNS_FINISH"
,
"退款 - 退货完成"
,
Boolean
.
TRUE
),
RETURNS_FINISH
(
"RETURNS_FINISH"
,
"退款 - 退货完成"
,
Boolean
.
TRUE
,
10
),
;
...
...
@@ -66,6 +66,11 @@ public enum SaleOrderPickUpStatus implements ArrayValuable<String> {
*/
private
final
boolean
isReturns
;
/**
* 流程排序
*/
private
final
int
ascSort
;
public
static
SaleOrderPickUpStatus
getByType
(
String
pickUpStatus
)
{
if
(
CommonUtil
.
isBlank
(
pickUpStatus
))
{
return
null
;
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleReturnServiceImpl.java
View file @
b3342487
...
...
@@ -8,6 +8,7 @@ import cn.iocoder.foodnexus.framework.common.util.CommonUtil;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.framework.redis.utils.RedisUtils
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseReturnDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseReturnItemDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpSaleOutDO
;
import
cn.iocoder.foodnexus.module.erp.dal.mysql.purchase.ErpPurchaseReturnMapper
;
import
cn.iocoder.foodnexus.module.erp.dal.mysql.sale.ErpSaleOrderMapper
;
...
...
@@ -214,7 +215,7 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
// 2. 更新状态
int
updateCount
=
saleReturnMapper
.
updateByIdAndStatus
(
id
,
saleReturn
.
getStatus
(),
new
ErpSaleReturnDO
().
setStatus
(
status
).
setReturnsStatus
(
RETURNS_APPROVE
.
getType
()));
new
ErpSaleReturnDO
().
setStatus
(
status
).
set
AuditTime
(
LocalDateTime
.
now
()).
set
ReturnsStatus
(
RETURNS_APPROVE
.
getType
()));
if
(
updateCount
==
0
)
{
throw
exception
(
approve
?
SALE_RETURN_APPROVE_FAIL
:
SALE_RETURN_PROCESS_FAIL
);
}
...
...
@@ -544,6 +545,12 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
bizType
,
saleReturnItem
.
getReturnId
(),
saleReturnItem
.
getId
(),
saleReturn
.
getNo
()));
});
// 变更库存
List
<
ErpPurchaseReturnDO
>
purchaseReturnDOS
=
purchaseReturnMapper
.
selectList
(
ErpPurchaseReturnDO:
:
getSaleOrderId
,
saleOrder
.
getId
());
for
(
ErpPurchaseReturnDO
item
:
purchaseReturnDOS
)
{
purchaseReturnService
.
updatePurchaseReturnStatus
(
item
.
getId
(),
ErpAuditStatus
.
APPROVE
.
getStatus
());
}
}
finally
{
RedisUtils
.
unLockRds
(
key
);
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderReturnRespVO.java
View file @
b3342487
...
...
@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
...
...
@@ -31,6 +32,26 @@ public class AppCustomerOrderReturnRespVO {
@Schema
(
description
=
"退货子项"
)
private
List
<
ReturnItems
>
returnItems
;
@Schema
(
description
=
"当前状态"
)
private
String
returnsStatus
;
@Schema
(
description
=
"当前退货进度"
)
private
ReturnsRecords
currentReturnsRecords
;
@Schema
(
description
=
"全部退货进度"
)
private
List
<
ReturnsRecords
>
returnsRecords
;
@Data
public
static
class
ReturnsRecords
{
@Schema
(
description
=
"退货状态"
)
private
String
returnsStatus
;
@Schema
(
description
=
"处理时间"
)
private
LocalDateTime
recordTime
;
}
@Data
public
static
class
ReturnItems
{
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
View file @
b3342487
...
...
@@ -716,6 +716,12 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
result
.
setTotalReturnPrice
(
saleReturn
.
getTotalPrice
());
result
.
setRemark
(
saleReturn
.
getRemark
());
result
.
setRemarkFiles
(
saleReturn
.
getFilesUrl
());
result
.
setReturnsStatus
(
saleReturn
.
getReturnsStatus
());
List
<
AppCustomerOrderReturnRespVO
.
ReturnsRecords
>
transform
=
this
.
transform
(
saleReturn
);
result
.
setReturnsRecords
(
transform
);
Optional
<
AppCustomerOrderReturnRespVO
.
ReturnsRecords
>
first
=
Optional
.
ofNullable
(
transform
).
orElse
(
Lists
.
newArrayList
())
.
stream
().
filter
(
obj
->
obj
!=
null
&&
obj
.
getReturnsStatus
().
equals
(
saleReturn
.
getReturnsStatus
())).
findFirst
();
first
.
ifPresent
(
result:
:
setCurrentReturnsRecords
);
List
<
ErpSaleReturnItemDO
>
returnItems
=
saleReturnService
.
getSaleReturnItemListByReturnId
(
saleReturn
.
getId
());
List
<
CustomerOrderItemDO
>
customerOrderItems
=
customerOrderItemMapper
.
selectList
(
CustomerOrderItemDO:
:
getOrderId
,
id
);
Map
<
Long
,
CustomerOrderItemDO
>
orderItemMap
=
CommonUtil
.
listConvertMap
(
customerOrderItems
,
CustomerOrderItemDO:
:
getId
);
...
...
@@ -735,6 +741,36 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
return
result
;
}
private
List
<
AppCustomerOrderReturnRespVO
.
ReturnsRecords
>
transform
(
ErpSaleReturnDO
saleReturn
)
{
return
Arrays
.
stream
(
SaleOrderPickUpStatus
.
values
()).
filter
(
SaleOrderPickUpStatus:
:
isReturns
).
map
(
em
->
{
AppCustomerOrderReturnRespVO
.
ReturnsRecords
returnsRecords
=
new
AppCustomerOrderReturnRespVO
.
ReturnsRecords
();
switch
(
em
)
{
case
RETURNS_PROCESS:
returnsRecords
.
setRecordTime
(
saleReturn
.
getCreateTime
());
returnsRecords
.
setReturnsStatus
(
em
.
getType
());
break
;
case
RETURNS_APPROVE:
returnsRecords
.
setRecordTime
(
saleReturn
.
getAuditTime
());
returnsRecords
.
setReturnsStatus
(
em
.
getType
());
break
;
case
RETURNS_STAFF_ACCEPT:
returnsRecords
.
setRecordTime
(
saleReturn
.
getAcceptTime
());
returnsRecords
.
setReturnsStatus
(
em
.
getType
());
break
;
case
RETURNS_STAFF_ALREADY:
returnsRecords
.
setRecordTime
(
saleReturn
.
getDeliveryTime
());
returnsRecords
.
setReturnsStatus
(
em
.
getType
());
break
;
case
RETURNS_FINISH:
returnsRecords
.
setRecordTime
(
saleReturn
.
getArrivalTime
());
returnsRecords
.
setReturnsStatus
(
em
.
getType
());
break
;
default
:
break
;
}
return
returnsRecords
;
}).
collect
(
Collectors
.
toList
());
}
/**
* {@link ErpPurchaseOrderServiceImpl#orderSplit(PurchaseOrderSplitEvent)}
*/
...
...
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