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
b16932ae
Commit
b16932ae
authored
Sep 26, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
87b3f462
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
70 deletions
+25
-70
foodnexus-module-erp-api/src/main/java/cn/iocoder/foodnexus/module/erp/api/service/ErpCustomerApi.java
+2
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpCustomerServiceImpl.java
+5
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/CustomerOrderController.java
+16
-3
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderDetailsVO.java
+2
-67
No files found.
foodnexus-module-erp-api/src/main/java/cn/iocoder/foodnexus/module/erp/api/service/ErpCustomerApi.java
View file @
b16932ae
...
...
@@ -24,4 +24,6 @@ public interface ErpCustomerApi {
Long
queryCustomerIdByUserId
(
Long
userId
);
Map
<
Long
,
String
>
queryNameMapByIds
(
Collection
<
Long
>
collection
);
String
queryNameStrById
(
Long
customerId
);
}
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpCustomerServiceImpl.java
View file @
b16932ae
...
...
@@ -229,4 +229,9 @@ public class ErpCustomerServiceImpl implements ErpCustomerService, ErpCustomerAp
List
<
ErpCustomerDO
>
customers
=
customerMapper
.
selectByIds
(
collection
);
return
CommonUtil
.
listConvertMap
(
customers
,
ErpCustomerDO:
:
getId
,
ErpCustomerDO:
:
getName
);
}
@Override
public
String
queryNameStrById
(
Long
customerId
)
{
return
Optional
.
ofNullable
(
customerMapper
.
selectById
(
customerId
)).
map
(
ErpCustomerDO:
:
getName
).
orElse
(
""
);
}
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/CustomerOrderController.java
View file @
b16932ae
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
customerorder
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.collection.MapUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi
;
import
cn.iocoder.foodnexus.module.order.api.CustomerOrderApi
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorderitem.vo.CustomerOrderItemRespVO
;
import
cn.iocoder.foodnexus.module.order.service.customerorderitem.CustomerOrderItemService
;
import
cn.iocoder.foodnexus.module.order.service.customerorderrecord.CustomerOrderRecordService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -49,6 +53,10 @@ public class CustomerOrderController {
@Autowired
private
CustomerOrderRecordService
customerOrderRecordService
;
@Autowired
@Lazy
private
ErpCustomerApi
customerApi
;
/* @DeleteMapping("/delete")
@Operation(summary = "删除客户总订单")
...
...
@@ -75,8 +83,11 @@ public class CustomerOrderController {
@PreAuthorize
(
"@ss.hasPermission('order:customer-order:query')"
)
public
CommonResult
<
CustomerOrderDetailsVO
>
getCustomerOrder
(
@RequestParam
(
"id"
)
Long
id
)
{
CustomerOrderDO
customerOrder
=
customerOrderService
.
getCustomerOrder
(
id
);
return
success
(
BeanUtils
.
toBean
(
customerOrder
,
CustomerOrderDetailsVO
.
class
,
item
->
item
.
setOrderItems
(
BeanUtils
.
toBean
(
customerOrderApi
.
queryItemsByOrderId
(
item
.
getId
()),
CustomerOrderItemRespVO
.
class
))));
return
success
(
BeanUtils
.
toBean
(
customerOrder
,
CustomerOrderDetailsVO
.
class
,
item
->
{
item
.
setOrderItems
(
BeanUtils
.
toBean
(
customerOrderApi
.
queryItemsByOrderId
(
item
.
getId
()),
CustomerOrderItemRespVO
.
class
));
item
.
setCustomerName
(
customerApi
.
queryNameStrById
(
item
.
getCustomerId
()));
}));
}
@GetMapping
(
"/page"
)
...
...
@@ -84,7 +95,9 @@ public class CustomerOrderController {
@PreAuthorize
(
"@ss.hasPermission('order:customer-order:query')"
)
public
CommonResult
<
PageResult
<
CustomerOrderRespVO
>>
getCustomerOrderPage
(
@Valid
CustomerOrderPageReqVO
pageReqVO
)
{
PageResult
<
CustomerOrderDO
>
pageResult
=
customerOrderService
.
getCustomerOrderPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerOrderRespVO
.
class
));
Map
<
Long
,
String
>
nameMap
=
customerApi
.
queryNameMapByIds
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
CustomerOrderDO:
:
getCustomerId
));
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerOrderRespVO
.
class
,
item
->
MapUtils
.
findAndThen
(
nameMap
,
item
.
getCustomerId
(),
item:
:
setCustomerName
)));
}
@GetMapping
(
"/record"
)
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderDetailsVO.java
View file @
b16932ae
...
...
@@ -6,6 +6,7 @@ import cn.iocoder.foodnexus.framework.excel.core.annotations.DictFormat;
import
cn.iocoder.foodnexus.framework.excel.core.convert.DictConvert
;
import
cn.iocoder.foodnexus.module.erp.api.vo.warehouse.WarehouseInfo
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorderitem.vo.CustomerOrderItemRespVO
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerAddressInfo
;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
import
cn.iocoder.foodnexus.module.order.enums.DeliveryMode
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
...
@@ -17,73 +18,7 @@ import java.util.List;
@Schema
(
description
=
"管理后台 - 客户总订单 Response VO"
)
@Data
@ExcelIgnoreUnannotated
public
class
CustomerOrderDetailsVO
{
@Schema
(
description
=
"id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"19291"
)
@ExcelProperty
(
"id"
)
private
Long
id
;
@Schema
(
description
=
"订单编号"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"订单编号"
)
private
String
code
;
@Schema
(
description
=
"订单状态"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"2"
)
@ExcelProperty
(
value
=
"订单状态"
,
converter
=
DictConvert
.
class
)
@DictFormat
(
"order_customer_order_status"
)
// TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private
CustomerOrderStatus
orderStatus
;
@Schema
(
description
=
"客户id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"20189"
)
@ExcelProperty
(
"客户id"
)
private
Long
customerId
;
@Schema
(
description
=
"收获仓库id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"27065"
)
@ExcelProperty
(
"收获仓库id"
)
private
Long
warehouseId
;
@Schema
(
description
=
"收获库区id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"26507"
)
@ExcelProperty
(
"收获库区id"
)
private
Long
warehouseAreaId
;
@Schema
(
description
=
"仓库信息"
)
@ExcelProperty
(
"仓库信息"
)
private
WarehouseInfo
warehouseInfo
;
@Schema
(
description
=
"配送模式"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
value
=
"配送模式"
,
converter
=
DictConvert
.
class
)
@DictFormat
(
"order_delivery_mode"
)
// TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private
DeliveryMode
deliveryMode
;
@Schema
(
description
=
"采购订单数"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"12099"
)
@ExcelProperty
(
"采购订单数"
)
private
Integer
productCount
;
@Schema
(
description
=
"供应商数"
,
example
=
"8062"
)
@ExcelProperty
(
"供应商数"
)
private
Integer
supplierCount
;
@Schema
(
description
=
"预计配送开始时间"
)
@ExcelProperty
(
"预计配送开始时间"
)
private
LocalDateTime
planDeliveryStartTime
;
@Schema
(
description
=
"预计配送结束时间"
)
@ExcelProperty
(
"预计配送结束时间"
)
private
LocalDateTime
planDeliveryEndTime
;
@Schema
(
description
=
"订单总金额(分)"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"订单总金额(分)"
)
private
Integer
orderAmount
;
@Schema
(
description
=
"实际支付总金额(分)"
)
@ExcelProperty
(
"实际支付总金额(分)"
)
private
Integer
actualAmount
;
@Schema
(
description
=
"配送公司"
)
@ExcelProperty
(
"配送公司"
)
private
String
operCompany
;
@Schema
(
description
=
"创建时间"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
public
class
CustomerOrderDetailsVO
extends
CustomerOrderRespVO
{
@Schema
(
description
=
"子订单"
)
private
List
<
CustomerOrderItemRespVO
>
orderItems
;
...
...
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