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
b3ea9f0a
Commit
b3ea9f0a
authored
Oct 16, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理后台接口调整
parent
179a4240
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
622 additions
and
128 deletions
+622
-128
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpPurchaseOrderController.java
+66
-57
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/PurchaseOrderController.java
+60
-36
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderRespVO.java
+39
-10
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderSaveReqVO.java
+2
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/SupplierMonthOrderRespVO.java
+6
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/ErpCustomerController.java
+9
-1
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/purchase/ErpPurchaseOrderItemDO.java
+3
-4
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/purchase/ErpPurchaseOrderMapper.java
+5
-1
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/sale/ErpSaleOrderMapper.java
+1
-1
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderService.java
+3
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderServiceImpl.java
+17
-7
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequirePageReqVO.java
+2
-1
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/customerrequire/AppCustomerRequireController.java
+1
-1
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/api/CustomerOrderApi.java
+7
-0
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/dto/CustomerOrderItemDTO.java
+4
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/CheckTaskController.java
+33
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/vo/CheckTaskRespVO.java
+16
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderPageReqVO.java
+4
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderScoreRespVO.java
+38
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorderitem/vo/CustomerOrderItemRespVO.java
+3
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/supplier/OperaSupplierPurchaseOrderController.java
+94
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/CustomerAddressController.java
+1
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/vo/CustomerAddressPageReqVO.java
+4
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/orderscore/AppCustomerOrderScoreController.java
+72
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorderitem/CustomerOrderItemDO.java
+6
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customeraddress/CustomerAddressMapper.java
+1
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customerorder/CustomerOrderMapper.java
+1
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktask/CheckTaskServiceImpl.java
+1
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktaskitems/CheckTaskItemsService.java
+4
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktaskitems/CheckTaskItemsServiceImpl.java
+22
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
+33
-4
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/orderScore/OrderScoreService.java
+5
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/orderScore/OrderScoreServiceImpl.java
+15
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/shoppingcart/ShoppingCartService.java
+4
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/shoppingcart/ShoppingCartServiceImpl.java
+32
-0
foodnexus-module-mall/foodnexus-module-product-api/src/main/java/cn/iocoder/foodnexus/module/product/api/dto/ProductInfo.java
+4
-0
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java
+3
-0
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/dal/mysql/dept/DeptMapper.java
+1
-0
No files found.
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpPurchaseOrderController.java
View file @
b3ea9f0a
...
...
@@ -6,9 +6,13 @@ import cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.collection.MapUtils
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.product.vo.product.ErpProductRespVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderRespVO
;
...
...
@@ -20,6 +24,11 @@ import cn.iocoder.foodnexus.module.erp.service.product.ErpProductService;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpPurchaseOrderService
;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpSupplierService
;
import
cn.iocoder.foodnexus.module.erp.service.stock.ErpStockService
;
import
cn.iocoder.foodnexus.module.order.api.CustomerOrderApi
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderDTO
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderItemDTO
;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
import
cn.iocoder.foodnexus.module.product.dal.dataobject.spu.ProductSpuDO
;
import
cn.iocoder.foodnexus.module.product.service.spu.ProductSpuService
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
...
...
@@ -31,6 +40,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
jakarta.annotation.Resource
;
import
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.validation.Valid
;
import
lombok.extern.apachecommons.CommonsLog
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -38,6 +48,8 @@ import org.springframework.web.bind.annotation.*;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -55,8 +67,6 @@ public class ErpPurchaseOrderController {
@Resource
private
ErpPurchaseOrderService
purchaseOrderService
;
@Resource
private
ErpStockService
stockService
;
@Resource
private
ErpSupplierService
supplierService
;
@Autowired
private
ProductSpuService
productService
;
...
...
@@ -64,38 +74,11 @@ public class ErpPurchaseOrderController {
@Resource
private
AdminUserApi
adminUserApi
;
/*@PostMapping("/create")
@Operation(summary = "创建采购订单")
@PreAuthorize("@ss.hasPermission('erp:purchase-order:create')")
public CommonResult<Long> createPurchaseOrder(@Valid @RequestBody ErpPurchaseOrderSaveReqVO createReqVO) {
return success(purchaseOrderService.createPurchaseOrder(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新采购订单")
@PreAuthorize("@ss.hasPermission('erp:purchase-order:update')")
public CommonResult<Boolean> updatePurchaseOrder(@Valid @RequestBody ErpPurchaseOrderSaveReqVO updateReqVO) {
purchaseOrderService.updatePurchaseOrder(updateReqVO);
return success(true);
}
@PutMapping("/update-status")
@Operation(summary = "更新采购订单的状态")
@PreAuthorize("@ss.hasPermission('erp:purchase-order:update-status')")
public CommonResult<Boolean> updatePurchaseOrderStatus(@RequestParam("id") Long id,
@RequestParam("status") Integer status) {
purchaseOrderService.updatePurchaseOrderStatus(id, status);
return success(true);
}
@Autowired
private
CustomerOrderApi
customerOrderApi
;
@DeleteMapping("/delete")
@Operation(summary = "删除采购订单")
@Parameter(name = "ids", description = "编号数组", required = true)
@PreAuthorize("@ss.hasPermission('erp:purchase-order:delete')")
public CommonResult<Boolean> deletePurchaseOrder(@RequestParam("ids") List<Long> ids) {
purchaseOrderService.deletePurchaseOrder(ids);
return success(true);
}*/
@Autowired
private
ErpCustomerApi
customerApi
;
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得采购订单"
)
...
...
@@ -106,16 +89,7 @@ public class ErpPurchaseOrderController {
if
(
purchaseOrder
==
null
)
{
return
success
(
null
);
}
List
<
ErpPurchaseOrderItemDO
>
purchaseOrderItemList
=
purchaseOrderService
.
getPurchaseOrderItemListByOrderId
(
id
);
Map
<
Long
,
ProductSpuDO
>
productMap
=
productService
.
getProductVOMap
(
convertSet
(
purchaseOrderItemList
,
ErpPurchaseOrderItemDO:
:
getProductId
));
return
success
(
BeanUtils
.
toBean
(
purchaseOrder
,
ErpPurchaseOrderRespVO
.
class
,
purchaseOrderVO
->
purchaseOrderVO
.
setItems
(
BeanUtils
.
toBean
(
purchaseOrderItemList
,
ErpPurchaseOrderRespVO
.
Item
.
class
,
item
->
{
BigDecimal
purchaseCount
=
stockService
.
getStockCount
(
item
.
getProductId
());
item
.
setStockCount
(
purchaseCount
!=
null
?
purchaseCount
:
BigDecimal
.
ZERO
);
MapUtils
.
findAndThen
(
productMap
,
item
.
getProductId
(),
product
->
item
.
setProductName
(
product
.
getName
())
.
setProductUnitName
(
product
.
getUnitName
()));
}))));
return
success
(
buildPurchaseOrderVOPageResult
(
CommonUtil
.
asList
(
purchaseOrder
),
true
).
get
(
0
));
}
@GetMapping
(
"/page"
)
...
...
@@ -123,7 +97,16 @@ public class ErpPurchaseOrderController {
@PreAuthorize
(
"@ss.hasPermission('erp:purchase-order:query')"
)
public
CommonResult
<
PageResult
<
ErpPurchaseOrderRespVO
>>
getPurchaseOrderPage
(
@Valid
ErpPurchaseOrderPageReqVO
pageReqVO
)
{
PageResult
<
ErpPurchaseOrderDO
>
pageResult
=
purchaseOrderService
.
getPurchaseOrderPage
(
pageReqVO
);
return
success
(
buildPurchaseOrderVOPageResult
(
pageResult
));
return
success
(
new
PageResult
<>(
buildPurchaseOrderVOPageResult
(
pageResult
.
getList
(),
false
),
pageResult
.
getTotal
()));
}
@PostMapping
(
"/arrival"
)
@Operation
(
summary
=
"到货"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
public
CommonResult
<
Boolean
>
arrival
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
purchaseOrderService
.
delivery
(
ids
,
null
,
ErpDeliveryStatus
.
ALREADY
,
ErpDeliveryStatus
.
ARRIVAL
,
CustomerOrderStatus
.
SUPPLIER_ARRIVE
);
return
success
(
Boolean
.
TRUE
);
}
@GetMapping
(
"/export-excel"
)
...
...
@@ -133,37 +116,63 @@ public class ErpPurchaseOrderController {
public
void
exportPurchaseOrderExcel
(
@Valid
ErpPurchaseOrderPageReqVO
pageReqVO
,
HttpServletResponse
response
)
throws
IOException
{
pageReqVO
.
setPageSize
(
PageParam
.
PAGE_SIZE_NONE
);
List
<
ErpPurchaseOrderRespVO
>
list
=
buildPurchaseOrderVOPageResult
(
purchaseOrderService
.
getPurchaseOrderPage
(
pageReqVO
)
).
getList
(
);
List
<
ErpPurchaseOrderRespVO
>
list
=
buildPurchaseOrderVOPageResult
(
purchaseOrderService
.
getPurchaseOrderPage
(
pageReqVO
)
.
getList
(),
false
);
// 导出 Excel
ExcelUtils
.
write
(
response
,
"采购订单.xls"
,
"数据"
,
ErpPurchaseOrderRespVO
.
class
,
list
);
}
private
PageResult
<
ErpPurchaseOrderRespVO
>
buildPurchaseOrderVOPageResult
(
PageResult
<
ErpPurchaseOrderDO
>
pageResult
)
{
if
(
CollUtil
.
isEmpty
(
pageResult
.
getList
()
))
{
return
PageResult
.
empty
(
pageResult
.
getTotal
()
);
private
List
<
ErpPurchaseOrderRespVO
>
buildPurchaseOrderVOPageResult
(
List
<
ErpPurchaseOrderDO
>
list
,
boolean
isDetails
)
{
if
(
CollUtil
.
isEmpty
(
list
))
{
return
new
ArrayList
<>(
);
}
// 1.1 订单项
List
<
ErpPurchaseOrderItemDO
>
purchaseOrderItemList
=
purchaseOrderService
.
getPurchaseOrderItemListByOrderIds
(
convertSet
(
pageResult
.
getList
()
,
ErpPurchaseOrderDO:
:
getId
));
convertSet
(
list
,
ErpPurchaseOrderDO:
:
getId
));
Map
<
Long
,
List
<
ErpPurchaseOrderItemDO
>>
purchaseOrderItemMap
=
convertMultiMap
(
purchaseOrderItemList
,
ErpPurchaseOrderItemDO:
:
getOrderId
);
// 1.2 产品信息
Map
<
Long
,
ProductSpuDO
>
productMap
=
productService
.
getProductVOMap
(
convertSet
(
purchaseOrderItemList
,
ErpPurchaseOrderItemDO:
:
getProductId
));
// 1.3 供应商信息
Map
<
Long
,
ErpSupplierDO
>
supplierMap
=
supplierService
.
getSupplierMap
(
convertSet
(
pageResult
.
getList
()
,
ErpPurchaseOrderDO:
:
getSupplierId
));
convertSet
(
list
,
ErpPurchaseOrderDO:
:
getSupplierId
));
// 1.4 管理员信息
Map
<
Long
,
AdminUserRespDTO
>
userMap
=
adminUserApi
.
getUserMap
(
convertSet
(
pageResult
.
getList
(),
purchaseOrder
->
Long
.
parseLong
(
purchaseOrder
.
getCreator
())));
convertSet
(
list
,
purchaseOrder
->
Long
.
parseLong
(
purchaseOrder
.
getCreator
())));
Map
<
Long
,
CustomerOrderDTO
>
customerOrderMap
=
customerOrderApi
.
getOrderMap
(
convertSet
(
list
,
ErpPurchaseOrderDO:
:
getCustomerOrderId
));
Map
<
Long
,
CustomerOrderItemDTO
>
customerOrderItemMap
;
if
(
isDetails
)
{
List
<
CustomerOrderItemDTO
>
customerOrderItems
=
customerOrderApi
.
queryItemsByIds
(
CommonUtil
.
listConvert
(
purchaseOrderItemList
,
ErpPurchaseOrderItemDO:
:
getCustomerOrderItemId
));
customerOrderItemMap
=
CommonUtil
.
listConvertMap
(
customerOrderItems
,
CustomerOrderItemDTO:
:
getId
);
}
else
{
customerOrderItemMap
=
new
HashMap
<>();
}
// 2. 开始拼接
return
BeanUtils
.
toBean
(
pageResult
,
ErpPurchaseOrderRespVO
.
class
,
purchaseOrder
->
{
purchaseOrder
.
setItems
(
BeanUtils
.
toBean
(
purchaseOrderItemMap
.
get
(
purchaseOrder
.
getId
()),
ErpPurchaseOrderRespVO
.
Item
.
class
,
item
->
MapUtils
.
findAndThen
(
productMap
,
item
.
getProductId
(),
product
->
item
.
setProductName
(
product
.
getName
())
.
setProductUnitName
(
product
.
getUnitName
()))));
purchaseOrder
.
setProductNames
(
CollUtil
.
join
(
purchaseOrder
.
getItems
(),
","
,
ErpPurchaseOrderRespVO
.
Item
::
getProductName
));
return
BeanUtils
.
toBean
(
list
,
ErpPurchaseOrderRespVO
.
class
,
purchaseOrder
->
{
purchaseOrder
.
setItems
(
BeanUtils
.
toBean
(
purchaseOrderItemMap
.
get
(
purchaseOrder
.
getId
()),
ErpPurchaseOrderRespVO
.
Item
.
class
,
item
->
{
MapUtils
.
findAndThen
(
productMap
,
item
.
getProductId
(),
product
->
{
item
.
setProductInfo
(
BeanUtils
.
toBean
(
product
,
ProductInfo
.
class
));
});
if
(
isDetails
)
{
MapUtils
.
findAndThen
(
customerOrderItemMap
,
item
.
getCustomerOrderItemId
(),
customerOrderItem
->
{
item
.
setSignedQuantity
(
customerOrderItem
.
getSignedQuantity
());
item
.
setSignedTotal
(
customerOrderItem
.
getSignedTotal
());
});
}
}));
purchaseOrder
.
setProductNames
(
CollUtil
.
join
(
purchaseOrder
.
getItems
(),
","
,
item
->
item
.
getProductInfo
().
getName
()));
MapUtils
.
findAndThen
(
supplierMap
,
purchaseOrder
.
getSupplierId
(),
supplier
->
purchaseOrder
.
setSupplierName
(
supplier
.
getName
()));
MapUtils
.
findAndThen
(
userMap
,
Long
.
parseLong
(
purchaseOrder
.
getCreator
()),
user
->
purchaseOrder
.
setCreatorName
(
user
.
getNickname
()));
MapUtils
.
findAndThen
(
customerOrderMap
,
purchaseOrder
.
getCustomerOrderId
(),
customerOrder
->
{
purchaseOrder
.
setAddressInfo
(
customerOrder
.
getAddressInfo
());
purchaseOrder
.
setPlanDeliveryStartTime
(
customerOrder
.
getPlanDeliveryStartTime
());
purchaseOrder
.
setPlanDeliveryEndTime
(
customerOrder
.
getPlanDeliveryEndTime
());
purchaseOrder
.
setCustomerOrderCode
(
customerOrder
.
getCode
());
purchaseOrder
.
setCustomerId
(
customerOrder
.
getCustomerId
());
purchaseOrder
.
setCustomerName
(
customerApi
.
queryNameStrById
(
customerOrder
.
getCustomerId
()));
purchaseOrder
.
setDeliveryMode
(
customerOrder
.
getDeliveryMode
());
});
});
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/PurchaseOrderController.java
View file @
b3ea9f0a
...
...
@@ -4,10 +4,12 @@ import cn.hutool.core.collection.CollUtil;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.collection.MapUtils
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderRespVO
;
...
...
@@ -17,7 +19,13 @@ import cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpSupplierDO;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpPurchaseOrderService
;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpSupplierService
;
import
cn.iocoder.foodnexus.module.erp.service.stock.ErpStockService
;
import
cn.iocoder.foodnexus.module.order.api.CustomerOrderApi
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderDTO
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderItemDTO
;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
import
cn.iocoder.foodnexus.module.product.dal.dataobject.spu.ProductSpuDO
;
import
cn.iocoder.foodnexus.module.product.service.spu.ProductSpuService
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
cn.iocoder.foodnexus.module.system.api.user.AdminUserApi
;
import
cn.iocoder.foodnexus.module.system.api.user.dto.AdminUserRespDTO
;
...
...
@@ -27,10 +35,13 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
jakarta.annotation.Resource
;
import
jakarta.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -53,14 +64,19 @@ public class PurchaseOrderController {
@Resource
private
ErpPurchaseOrderService
purchaseOrderService
;
@Resource
private
ErpStockService
stockService
;
@Resource
private
ErpSupplierService
supplierService
;
@Resource
private
AdminUserApi
adminUserApi
;
@Autowired
private
ErpSupplierApi
supplierApi
;
@Autowired
private
ProductSpuService
productService
;
@Autowired
private
CustomerOrderApi
customerOrderApi
;
@Autowired
private
ErpCustomerApi
customerApi
;
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得采购订单"
)
...
...
@@ -70,16 +86,7 @@ public class PurchaseOrderController {
if
(
purchaseOrder
==
null
)
{
return
success
(
null
);
}
List
<
ErpPurchaseOrderItemDO
>
purchaseOrderItemList
=
purchaseOrderService
.
getPurchaseOrderItemListByOrderId
(
id
);
/*Map<Long, ErpProductRespVO> productMap = productService.getProductVOMap(
convertSet(purchaseOrderItemList, ErpPurchaseOrderItemDO::getProductId));*/
return
success
(
BeanUtils
.
toBean
(
purchaseOrder
,
ErpPurchaseOrderRespVO
.
class
,
purchaseOrderVO
->
purchaseOrderVO
.
setItems
(
BeanUtils
.
toBean
(
purchaseOrderItemList
,
ErpPurchaseOrderRespVO
.
Item
.
class
,
item
->
{
BigDecimal
purchaseCount
=
stockService
.
getStockCount
(
item
.
getProductId
());
item
.
setStockCount
(
purchaseCount
!=
null
?
purchaseCount
:
BigDecimal
.
ZERO
);
/*MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()));*/
}))));
return
success
(
buildPurchaseOrderVOPageResult
(
CommonUtil
.
asList
(
purchaseOrder
),
true
).
get
(
0
));
}
@GetMapping
(
"/page"
)
...
...
@@ -87,7 +94,7 @@ public class PurchaseOrderController {
public
CommonResult
<
PageResult
<
ErpPurchaseOrderRespVO
>>
getPurchaseOrderPage
(
@Valid
ErpPurchaseOrderPageReqVO
pageReqVO
)
{
pageReqVO
.
setSupplierId
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
PageResult
<
ErpPurchaseOrderDO
>
pageResult
=
purchaseOrderService
.
getPurchaseOrderPage
(
pageReqVO
);
return
success
(
buildPurchaseOrderVOPageResult
(
pageResult
));
return
success
(
new
PageResult
<>(
buildPurchaseOrderVOPageResult
(
pageResult
.
getList
(),
false
),
pageResult
.
getTotal
()
));
}
@GetMapping
(
"count"
)
...
...
@@ -115,42 +122,59 @@ public class PurchaseOrderController {
return
success
(
Boolean
.
TRUE
);
}
@PostMapping
(
"/arrival"
)
@Operation
(
summary
=
"到货"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
public
CommonResult
<
Boolean
>
arrival
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
purchaseOrderService
.
delivery
(
ids
,
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()),
ErpDeliveryStatus
.
ALREADY
,
ErpDeliveryStatus
.
ARRIVAL
,
CustomerOrderStatus
.
SUPPLIER_ARRIVE
);
return
success
(
Boolean
.
TRUE
);
}
private
PageResult
<
ErpPurchaseOrderRespVO
>
buildPurchaseOrderVOPageResult
(
PageResult
<
ErpPurchaseOrderDO
>
pageResult
)
{
if
(
CollUtil
.
isEmpty
(
pageResult
.
getList
()))
{
return
PageResult
.
empty
(
pageResult
.
getTotal
());
private
List
<
ErpPurchaseOrderRespVO
>
buildPurchaseOrderVOPageResult
(
List
<
ErpPurchaseOrderDO
>
list
,
boolean
isDetails
)
{
if
(
CollUtil
.
isEmpty
(
list
))
{
return
new
ArrayList
<>();
}
// 1.1 订单项
List
<
ErpPurchaseOrderItemDO
>
purchaseOrderItemList
=
purchaseOrderService
.
getPurchaseOrderItemListByOrderIds
(
convertSet
(
pageResult
.
getList
()
,
ErpPurchaseOrderDO:
:
getId
));
convertSet
(
list
,
ErpPurchaseOrderDO:
:
getId
));
Map
<
Long
,
List
<
ErpPurchaseOrderItemDO
>>
purchaseOrderItemMap
=
convertMultiMap
(
purchaseOrderItemList
,
ErpPurchaseOrderItemDO:
:
getOrderId
);
// 1.2 产品信息
/*Map<Long, ErpProductRespV
O> productMap = productService.getProductVOMap(
convertSet(purchaseOrderItemList, ErpPurchaseOrderItemDO::getProductId));
*/
Map
<
Long
,
ProductSpuD
O
>
productMap
=
productService
.
getProductVOMap
(
convertSet
(
purchaseOrderItemList
,
ErpPurchaseOrderItemDO:
:
getProductId
));
// 1.3 供应商信息
Map
<
Long
,
ErpSupplierDO
>
supplierMap
=
supplierService
.
getSupplierMap
(
convertSet
(
pageResult
.
getList
()
,
ErpPurchaseOrderDO:
:
getSupplierId
));
convertSet
(
list
,
ErpPurchaseOrderDO:
:
getSupplierId
));
// 1.4 管理员信息
Map
<
Long
,
AdminUserRespDTO
>
userMap
=
adminUserApi
.
getUserMap
(
convertSet
(
pageResult
.
getList
(),
purchaseOrder
->
Long
.
parseLong
(
purchaseOrder
.
getCreator
())));
convertSet
(
list
,
purchaseOrder
->
Long
.
parseLong
(
purchaseOrder
.
getCreator
())));
Map
<
Long
,
CustomerOrderDTO
>
customerOrderMap
=
customerOrderApi
.
getOrderMap
(
convertSet
(
list
,
ErpPurchaseOrderDO:
:
getCustomerOrderId
));
Map
<
Long
,
CustomerOrderItemDTO
>
customerOrderItemMap
;
if
(
isDetails
)
{
List
<
CustomerOrderItemDTO
>
customerOrderItems
=
customerOrderApi
.
queryItemsByIds
(
CommonUtil
.
listConvert
(
purchaseOrderItemList
,
ErpPurchaseOrderItemDO:
:
getCustomerOrderItemId
));
customerOrderItemMap
=
CommonUtil
.
listConvertMap
(
customerOrderItems
,
CustomerOrderItemDTO:
:
getId
);
}
else
{
customerOrderItemMap
=
new
HashMap
<>();
}
// 2. 开始拼接
return
BeanUtils
.
toBean
(
pageResult
,
ErpPurchaseOrderRespVO
.
class
,
purchaseOrder
->
{
purchaseOrder
.
setItems
(
BeanUtils
.
toBean
(
purchaseOrderItemMap
.
get
(
purchaseOrder
.
getId
()),
ErpPurchaseOrderRespVO
.
Item
.
class
/*,
item -> MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()))*/
));
purchaseOrder
.
setProductNames
(
CollUtil
.
join
(
purchaseOrder
.
getItems
(),
","
,
ErpPurchaseOrderRespVO
.
Item
::
getProductName
));
return
BeanUtils
.
toBean
(
list
,
ErpPurchaseOrderRespVO
.
class
,
purchaseOrder
->
{
purchaseOrder
.
setItems
(
BeanUtils
.
toBean
(
purchaseOrderItemMap
.
get
(
purchaseOrder
.
getId
()),
ErpPurchaseOrderRespVO
.
Item
.
class
,
item
->
{
MapUtils
.
findAndThen
(
productMap
,
item
.
getProductId
(),
product
->
{
item
.
setProductInfo
(
BeanUtils
.
toBean
(
product
,
ProductInfo
.
class
));
});
if
(
isDetails
)
{
MapUtils
.
findAndThen
(
customerOrderItemMap
,
item
.
getCustomerOrderItemId
(),
customerOrderItem
->
{
item
.
setSignedQuantity
(
customerOrderItem
.
getSignedQuantity
());
item
.
setSignedTotal
(
customerOrderItem
.
getSignedTotal
());
});
}
}));
purchaseOrder
.
setProductNames
(
CollUtil
.
join
(
purchaseOrder
.
getItems
(),
","
,
item
->
item
.
getProductInfo
().
getName
()));
MapUtils
.
findAndThen
(
supplierMap
,
purchaseOrder
.
getSupplierId
(),
supplier
->
purchaseOrder
.
setSupplierName
(
supplier
.
getName
()));
MapUtils
.
findAndThen
(
userMap
,
Long
.
parseLong
(
purchaseOrder
.
getCreator
()),
user
->
purchaseOrder
.
setCreatorName
(
user
.
getNickname
()));
MapUtils
.
findAndThen
(
customerOrderMap
,
purchaseOrder
.
getCustomerOrderId
(),
customerOrder
->
{
purchaseOrder
.
setAddressInfo
(
customerOrder
.
getAddressInfo
());
purchaseOrder
.
setPlanDeliveryStartTime
(
customerOrder
.
getPlanDeliveryStartTime
());
purchaseOrder
.
setPlanDeliveryEndTime
(
customerOrder
.
getPlanDeliveryEndTime
());
purchaseOrder
.
setCustomerOrderCode
(
customerOrder
.
getCode
());
purchaseOrder
.
setCustomerId
(
customerOrder
.
getCustomerId
());
purchaseOrder
.
setCustomerName
(
customerApi
.
queryNameStrById
(
customerOrder
.
getCustomerId
()));
purchaseOrder
.
setDeliveryMode
(
customerOrder
.
getDeliveryMode
());
});
});
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderRespVO.java
View file @
b3ea9f0a
...
...
@@ -3,6 +3,9 @@ package cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order;
import
cn.idev.excel.annotation.ExcelIgnoreUnannotated
;
import
cn.idev.excel.annotation.ExcelProperty
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerAddressInfo
;
import
cn.iocoder.foodnexus.module.order.enums.DeliveryMode
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
...
...
@@ -98,8 +101,7 @@ public class ErpPurchaseOrderRespVO {
@Schema
(
description
=
"采购退货数量"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"100.00"
)
private
BigDecimal
returnCount
;
@Schema
(
description
=
"客户订单id"
)
private
Long
customerId
;
@Schema
(
description
=
"客户订单id"
)
private
Long
customerOrderId
;
...
...
@@ -112,6 +114,32 @@ public class ErpPurchaseOrderRespVO {
@Schema
(
description
=
"发货状态"
)
private
String
deliveryStatus
;
/* ------ 客户订单 ------ */
@Schema
(
description
=
"客户收货地址info"
)
private
CustomerAddressInfo
addressInfo
;
@Schema
(
description
=
"预计配送开始时间"
)
@ExcelProperty
(
"预计配送开始时间"
)
private
LocalDateTime
planDeliveryStartTime
;
@Schema
(
description
=
"预计配送结束时间"
)
@ExcelProperty
(
"预计配送结束时间"
)
private
LocalDateTime
planDeliveryEndTime
;
@Schema
(
description
=
"客户订单编号"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"客户订单编号"
)
private
String
customerOrderCode
;
@Schema
(
description
=
"客户id"
)
private
Long
customerId
;
@Schema
(
description
=
"客户名称"
)
private
String
customerName
;
@Schema
(
description
=
"配送模式"
)
private
DeliveryMode
deliveryMode
;
@Data
public
static
class
Item
{
...
...
@@ -152,20 +180,21 @@ public class ErpPurchaseOrderRespVO {
// ========== 关联字段 ==========
@Schema
(
description
=
"产品名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"巧克力"
)
private
String
productName
;
@Schema
(
description
=
"产品条码"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"A9985"
)
private
String
productBarCode
;
@Schema
(
description
=
"产品单位名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"盒"
)
private
String
productUnitName
;
@Schema
(
description
=
"商品信息"
)
private
ProductInfo
productInfo
;
@Schema
(
description
=
"库存数量"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"100.00"
)
private
BigDecimal
stockCount
;
// 该字段仅仅在“详情”和“编辑”时使用
@Schema
(
description
=
"客户订单id"
)
private
Long
customerId
;
@Schema
(
description
=
"客户子订单id"
)
private
Long
customerOrderItemId
;
@Schema
(
description
=
"签收数量"
)
private
Integer
signedQuantity
;
@Schema
(
description
=
"签收总价,单位:分"
)
private
Integer
signedTotal
;
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderSaveReqVO.java
View file @
b3ea9f0a
...
...
@@ -67,8 +67,8 @@ public class ErpPurchaseOrderSaveReqVO {
@Schema
(
description
=
"订单项编号"
,
example
=
"11756"
)
private
Long
id
;
@Schema
(
description
=
"客户订单id"
)
private
Long
customerOrderId
;
@Schema
(
description
=
"客户
子
订单id"
)
private
Long
customerOrderI
temI
d
;
@Schema
(
description
=
"产品编号"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"3113"
)
@NotNull
(
message
=
"产品编号不能为空"
)
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/SupplierMonthOrderRespVO.java
View file @
b3ea9f0a
...
...
@@ -11,6 +11,12 @@ import lombok.Data;
@Data
public
class
SupplierMonthOrderRespVO
{
@Schema
(
description
=
"供应商id"
)
private
Long
supplierId
;
@Schema
(
description
=
"供应商名称"
)
private
String
supplierName
;
@Schema
(
description
=
"月份"
)
private
String
month
;
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/ErpCustomerController.java
View file @
b3ea9f0a
...
...
@@ -107,11 +107,19 @@ public class ErpCustomerController {
}));
}
@GetMapping
(
"/list"
)
@Operation
(
summary
=
"获得客户列表"
,
description
=
"只包含被开启的客户,主要用于前端的下拉选项"
)
public
CommonResult
<
List
<
ErpCustomerRespVO
>>
getList
()
{
return
success
(
BeanUtils
.
toBean
(
customerService
.
getCustomerListByStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
()),
ErpCustomerRespVO
.
class
,
item
->
{
item
.
setWarehouseAreaIds
(
customerService
.
queryWarehouseAreaIdByCustomerId
(
item
.
getId
()));
}));
}
@GetMapping
(
"/simple-list"
)
@Operation
(
summary
=
"获得客户精简列表"
,
description
=
"只包含被开启的客户,主要用于前端的下拉选项"
)
public
CommonResult
<
List
<
ErpCustomerRespVO
>>
getCustomerSimpleList
()
{
List
<
ErpCustomerDO
>
list
=
customerService
.
getCustomerListByStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
());
return
success
(
convertList
(
list
,
customer
->
new
ErpCustomerRespVO
().
setId
(
customer
.
getId
()).
setName
(
customer
.
getName
())));
return
success
(
convertList
(
list
,
customer
->
new
ErpCustomerRespVO
().
setId
(
customer
.
getId
()).
setName
(
customer
.
getName
())
.
setSystemDeptId
(
customer
.
getSystemDeptId
())
));
}
@GetMapping
(
"/export-excel"
)
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/dataobject/purchase/ErpPurchaseOrderItemDO.java
View file @
b3ea9f0a
...
...
@@ -5,6 +5,7 @@ import cn.iocoder.foodnexus.module.erp.dal.dataobject.product.ErpProductDO;
import
com.baomidou.mybatisplus.annotation.KeySequence
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
java.math.BigDecimal
;
...
...
@@ -89,12 +90,9 @@ public class ErpPurchaseOrderItemDO extends BaseDO {
*/
private
BigDecimal
returnCount
;
/**
* 客户订单id
*/
private
Long
customerOrderId
;
private
Long
customerOrderI
temI
d
;
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/purchase/ErpPurchaseOrderMapper.java
View file @
b3ea9f0a
...
...
@@ -113,19 +113,23 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
default
PageResult
<
SupplierMonthOrderRespVO
>
pageMonth
(
SupplierMonthOrderPageReqVO
pageReqVO
,
Long
supplierId
)
{
MPJQueryWrapper
<
ErpPurchaseOrderDO
>
wrapper
=
new
MPJQueryWrapper
<>();
wrapper
.
select
(
"t.supplier_id"
);
wrapper
.
select
(
"es.name as 'supplier_name'"
);
wrapper
.
select
(
"DATE_FORMAT( t.create_time, '%Y-%m' ) AS 'month'"
);
wrapper
.
select
(
"count( t.id ) AS 'orderCount'"
);
wrapper
.
select
(
"SUM( t.total_price ) AS 'orderPrice'"
);
// TODO payablePrice 这个字段待定
wrapper
.
select
(
"CASE WHEN SUM(CASE WHEN t.delivery_status='ARRIVAL' THEN 1 ELSE 0 END)> 0 THEN 0 ELSE 1 END AS 'status'"
);
wrapper
.
leftJoin
(
"order_customer_order t1 on t.customer_order_id = t1.id"
);
wrapper
.
eq
(
"t.supplier_id"
,
supplierId
);
wrapper
.
leftJoin
(
"erp_supplier es on t.supplier_id = es.id"
);
wrapper
.
eq
(
CommonUtil
.
isNotEmpty
(
supplierId
),
"t.supplier_id"
,
supplierId
);
wrapper
.
in
(
"t.delivery_status"
,
CommonUtil
.
asList
(
ErpDeliveryStatus
.
RECONCILIATION
.
getStatus
(),
ErpDeliveryStatus
.
ARRIVAL
.
getStatus
()));
wrapper
.
in
(
"t1.order_status"
,
CommonUtil
.
asList
(
CustomerOrderStatus
.
SIGN_RECEIPT
.
getKey
()),
CustomerOrderStatus
.
FINISH
.
getKey
());
wrapper
.
eq
(
CommonUtil
.
isNotBlank
(
pageReqVO
.
getMonth
()),
"DATE_FORMAT(t.create_time, '%Y-%m') "
,
pageReqVO
.
getMonth
());
wrapper
.
orderByDesc
(
"t.id"
);
wrapper
.
groupBy
(
"DATE_FORMAT( t.create_time, '%Y-%m' ), t.supplier_id"
);
return
this
.
selectJoinPage
(
pageReqVO
,
SupplierMonthOrderRespVO
.
class
,
wrapper
);
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/sale/ErpSaleOrderMapper.java
View file @
b3ea9f0a
...
...
@@ -35,7 +35,7 @@ public interface ErpSaleOrderMapper extends BaseMapperX<ErpSaleOrderDO> {
.
eqIfPresent
(
ErpSaleOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getDeliveryStaffId
,
reqVO
.
getDeliveryStaffId
())
.
betweenIfPresent
(
ErpSaleOrderDO:
:
getAcceptTime
,
reqVO
.
getAcceptTime
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getPickUpStatus
,
reqVO
.
getPickUpStatus
()
.
getType
()
)
.
eqIfPresent
(
ErpSaleOrderDO:
:
getPickUpStatus
,
reqVO
.
getPickUpStatus
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getCustomerDeptId
,
reqVO
.
getCustomerDeptId
())
.
inIfPresent
(
ErpSaleOrderDO:
:
getCustomerDeptId
,
reqVO
.
getCustomerDeptIds
())
.
orderByDesc
(
ErpSaleOrderDO:
:
getId
);
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderService.java
View file @
b3ea9f0a
...
...
@@ -129,4 +129,6 @@ public interface ErpPurchaseOrderService {
* @param supplierId 当前供应商id
*/
void
reconciliation
(
List
<
ErpPurchaseOrderDO
>
purchaseOrderList
,
Long
supplierId
);
Map
<
Long
,
ErpPurchaseOrderDO
>
getMap
(
List
<
Long
>
longs
);
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderServiceImpl.java
View file @
b3ea9f0a
...
...
@@ -106,10 +106,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
calculateTotalPrice
(
purchaseOrder
,
purchaseOrderItems
);
purchaseOrderMapper
.
insert
(
purchaseOrder
);
// 2.2 插入订单项
purchaseOrderItems
.
forEach
(
o
->
{
o
.
setOrderId
(
purchaseOrder
.
getId
());
o
.
setCustomerOrderId
(
purchaseOrder
.
getCustomerOrderId
());
});
purchaseOrderItems
.
forEach
(
o
->
o
.
setOrderId
(
purchaseOrder
.
getId
()));
purchaseOrderItemMapper
.
insertBatch
(
purchaseOrderItems
);
return
purchaseOrder
.
getId
();
}
...
...
@@ -331,11 +328,14 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
public
void
delivery
(
List
<
Long
>
ids
,
Long
supplierId
,
ErpDeliveryStatus
oriStatus
,
ErpDeliveryStatus
updateStatus
,
CustomerOrderStatus
updateOrderStatus
)
{
List
<
ErpPurchaseOrderDO
>
orderList
=
purchaseOrderMapper
.
selectList
(
Wrappers
.<
ErpPurchaseOrderDO
>
lambdaQuery
()
.
in
(
ErpPurchaseOrderDO:
:
getId
,
ids
)
.
eq
(
ErpPurchaseOrderDO:
:
getSupplierId
,
supplierId
));
.
eq
(
CommonUtil
.
isNotEmpty
(
supplierId
)
,
ErpPurchaseOrderDO:
:
getSupplierId
,
supplierId
));
if
(
CommonUtil
.
isEmpty
(
orderList
))
{
throw
exception
(
PURCHASE_ORDER_NOT_EXISTS
);
}
if
(
CommonUtil
.
isEmpty
(
supplierId
))
{
supplierId
=
orderList
.
get
(
0
).
getSupplierId
();
}
Set
<
Long
>
customerOrderSet
=
new
HashSet
<>();
for
(
ErpPurchaseOrderDO
item
:
orderList
)
{
...
...
@@ -373,7 +373,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
inSaveReqVO
.
setRemark
(
purchaseOrder
.
getRemark
());
List
<
ErpPurchaseOrderItemDO
>
purchaseOrderItems
=
purchaseOrderItemMapper
.
selectListByOrderId
(
purchaseOrder
.
getId
());
inSaveReqVO
.
setItems
(
CommonUtil
.
listConvert
(
purchaseOrderItems
,
purchaseOrderItem
->
getItem
(
purchaseOrderItem
,
customerOrderApi
.
queryById
(
purchaseOrder
Item
.
getCustomerOrderId
()))));
getItem
(
purchaseOrderItem
,
customerOrderApi
.
queryById
(
purchaseOrder
.
getCustomerOrderId
()))));
purchaseInService
.
createPurchaseIn
(
inSaveReqVO
);
// 新增来料质检
...
...
@@ -451,6 +451,15 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
purchaseOrderMapper
.
updateBatch
(
updateBatch
);
}
@Override
public
Map
<
Long
,
ErpPurchaseOrderDO
>
getMap
(
List
<
Long
>
ids
)
{
if
(
CommonUtil
.
isEmpty
(
ids
))
{
return
new
HashMap
<>(
1
);
}
List
<
ErpPurchaseOrderDO
>
erpPurchaseOrderDOS
=
purchaseOrderMapper
.
selectByIds
(
ids
);
return
CommonUtil
.
listConvertMap
(
erpPurchaseOrderDOS
,
ErpPurchaseOrderDO:
:
getId
);
}
@Async
@TransactionalEventListener
(
classes
=
PurchaseOrderSplitEvent
.
class
,
phase
=
TransactionPhase
.
AFTER_COMMIT
)
public
void
orderSplit
(
PurchaseOrderSplitEvent
event
)
{
...
...
@@ -480,7 +489,8 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
purhcaseOrderItem
.
setProductUnit
(
customerOrderItem
.
getProductInfo
().
getUnitName
());
purhcaseOrderItem
.
setProductPrice
(
customerOrderItem
.
getOrderItemPrice
());
purhcaseOrderItem
.
setCount
(
customerOrderItem
.
getOrderItemQuantity
());
purhcaseOrderItem
.
setCustomerOrderId
(
orderId
);
purhcaseOrderItem
.
setCustomerOrderItemId
(
customerOrderItem
.
getId
());
purhcaseOrderItem
.
setRemark
(
customerOrderItem
.
getCustomerRemark
());
purchaseOrder
.
put
(
purhcaseOrderItem
);
}
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequirePageReqVO.java
View file @
b3ea9f0a
...
...
@@ -37,6 +37,6 @@ public class CustomerRequirePageReqVO extends PageParam {
private
LocalDateTime
[]
updateTime
;
@Schema
(
description
=
"创建人"
)
private
Stri
ng
creator
;
private
Lo
ng
creator
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/customerrequire/AppCustomerRequireController.java
View file @
b3ea9f0a
...
...
@@ -73,7 +73,7 @@ public class AppCustomerRequireController {
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户需求分页"
)
public
CommonResult
<
PageResult
<
CustomerRequireRespVO
>>
getCustomerRequirePage
(
@Valid
CustomerRequirePageReqVO
pageReqVO
)
{
pageReqVO
.
setC
ustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()
));
pageReqVO
.
setC
reator
(
SecurityFrameworkUtils
.
getLoginUserId
(
));
PageResult
<
CustomerRequireDO
>
pageResult
=
customerRequireService
.
getCustomerRequirePage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerRequireRespVO
.
class
));
}
...
...
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/api/CustomerOrderApi.java
View file @
b3ea9f0a
...
...
@@ -4,7 +4,10 @@ import cn.iocoder.foodnexus.module.order.dto.CustomerOrderDTO;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderItemDTO
;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* @author : yanghao
...
...
@@ -18,4 +21,8 @@ public interface CustomerOrderApi {
List
<
CustomerOrderItemDTO
>
queryItemsByOrderId
(
Long
customerOrderId
);
void
updateOrderStatus
(
Long
customerOrderId
,
CustomerOrderStatus
updateOrderStatus
);
Map
<
Long
,
CustomerOrderDTO
>
getOrderMap
(
Collection
<
Long
>
orderIds
);
List
<
CustomerOrderItemDTO
>
queryItemsByIds
(
Collection
<
Long
>
orderItems
);
}
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/dto/CustomerOrderItemDTO.java
View file @
b3ea9f0a
...
...
@@ -67,4 +67,8 @@ public class CustomerOrderItemDTO {
* 订单备注
*/
private
CustomerOrderRemark
orderRemark
;
/**
* 客户下单备注
*/
private
String
customerRemark
;
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/CheckTaskController.java
View file @
b3ea9f0a
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
checktask
;
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.erp.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseOrderDO
;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpPurchaseOrderService
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderScoreReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderScoreRespVO
;
import
cn.iocoder.foodnexus.module.order.service.checktaskitems.CheckTaskItemsService
;
...
...
@@ -45,6 +51,15 @@ public class CheckTaskController {
@Autowired
private
CheckTaskItemsService
checkTaskItemsService
;
@Autowired
private
ErpSupplierApi
supplierApi
;
@Autowired
private
ErpPurchaseOrderService
purchaseOrderService
;
@Autowired
private
ErpCustomerApi
customerApi
;
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建来料质检"
)
@PreAuthorize
(
"@ss.hasPermission('order:check-task:create')"
)
...
...
@@ -86,6 +101,11 @@ public class CheckTaskController {
CheckTaskDO
checkTask
=
checkTaskService
.
getCheckTask
(
id
);
return
success
(
BeanUtils
.
toBean
(
checkTask
,
CheckTaskRespVO
.
class
,
item
->
{
item
.
setItems
(
BeanUtils
.
toBean
(
checkTaskItemsService
.
queryByCheckId
(
item
.
getId
()),
CheckTaskItemsRespVO
.
class
));
item
.
setSupplierName
(
supplierApi
.
queryNameById
(
item
.
getSupplierId
()));
item
.
setCustomerName
(
customerApi
.
queryNameStrById
(
item
.
getCustomerId
()));
Map
<
Long
,
String
>
itemMap
=
checkTaskItemsService
.
queryProductInfoByCheckId
(
CommonUtil
.
asList
(
item
.
getId
()));
item
.
setProductNameInfo
(
itemMap
.
getOrDefault
(
item
.
getId
(),
""
));
item
.
setPurchaseOrderNo
(
purchaseOrderService
.
getPurchaseOrder
(
item
.
getPurchaseOrderId
()).
getNo
());
}));
}
...
...
@@ -94,7 +114,19 @@ public class CheckTaskController {
@PreAuthorize
(
"@ss.hasPermission('order:check-task:query')"
)
public
CommonResult
<
PageResult
<
CheckTaskRespVO
>>
getCheckTaskPage
(
@Valid
CheckTaskPageReqVO
pageReqVO
)
{
PageResult
<
CheckTaskDO
>
pageResult
=
checkTaskService
.
getCheckTaskPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CheckTaskRespVO
.
class
));
Map
<
Long
,
String
>
supplierNameMap
=
supplierApi
.
queryNameMapByIds
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
CheckTaskDO:
:
getSupplierId
));
Map
<
Long
,
String
>
productInfoMap
=
checkTaskItemsService
.
queryProductInfoByCheckId
(
CommonUtil
.
listConvertSet
(
pageResult
.
getList
(),
CheckTaskDO:
:
getId
));
Map
<
Long
,
ErpPurchaseOrderDO
>
purchaseOrderMap
=
purchaseOrderService
.
getMap
(
CommonUtil
.
listConvert
(
pageResult
.
getList
(),
CheckTaskDO:
:
getPurchaseOrderId
));
Map
<
Long
,
String
>
customerMap
=
customerApi
.
queryNameMapByIds
(
CommonUtil
.
listConvertSet
((
pageResult
.
getList
()),
CheckTaskDO:
:
getCustomerId
));
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CheckTaskRespVO
.
class
,
item
->
{
MapUtils
.
findAndThen
(
supplierNameMap
,
item
.
getSupplierId
(),
item:
:
setSupplierName
);
MapUtils
.
findAndThen
(
customerMap
,
item
.
getCustomerId
(),
item:
:
setCustomerName
);
MapUtils
.
findAndThen
(
productInfoMap
,
item
.
getId
(),
item:
:
setProductNameInfo
);
MapUtils
.
findAndThen
(
purchaseOrderMap
,
item
.
getPurchaseOrderId
(),
purchaseOrder
->
{
item
.
setPurchaseOrderNo
(
purchaseOrder
.
getNo
());
});
}));
}
@GetMapping
(
"score"
)
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/vo/CheckTaskRespVO.java
View file @
b3ea9f0a
...
...
@@ -65,4 +65,19 @@ public class CheckTaskRespVO {
@Schema
(
description
=
"质检子项(详情接口返回)"
)
private
List
<
CheckTaskItemsRespVO
>
items
;
@Schema
(
description
=
"供应商名称"
)
private
String
supplierName
;
@Schema
(
description
=
"产品信息"
)
private
String
productNameInfo
;
@Schema
(
description
=
"采购订单编号"
)
private
String
purchaseOrderNo
;
@Schema
(
description
=
"客户名称"
)
private
String
customerName
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderPageReqVO.java
View file @
b3ea9f0a
...
...
@@ -81,4 +81,7 @@ public class CustomerOrderPageReqVO extends PageParam {
@Schema
(
description
=
"筛选待评价"
)
private
Boolean
filterToBeScore
;
@Schema
(
description
=
"是否已评价"
)
private
Boolean
hasScore
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderScoreRespVO.java
0 → 100644
View file @
b3ea9f0a
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
customerorder
.
vo
;
import
cn.iocoder.foodnexus.module.order.controller.admin.orderScore.vo.OrderScoreRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderScoreRespVO
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author : yanghao
* create at: 2025/10/16 10:01
* @description: 客户 - 订单评价
*/
@Data
public
class
CustomerOrderScoreRespVO
extends
CustomerOrderRespVO
{
@Schema
(
description
=
"评价指标项"
)
private
List
<
orderScoreItems
>
orderScoreItems
;
@Data
public
static
class
orderScoreItems
{
@Schema
(
description
=
"订单评价id"
)
private
Long
id
;
@Schema
(
description
=
"评价指标id"
)
private
Long
scoreId
;
@Schema
(
description
=
"评价指标名称"
)
private
String
scoreName
;
@Schema
(
description
=
"得分"
)
private
Integer
score
;
}
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorderitem/vo/CustomerOrderItemRespVO.java
View file @
b3ea9f0a
...
...
@@ -85,5 +85,7 @@ public class CustomerOrderItemRespVO {
@Schema
(
description
=
"退货总价,单位:分"
)
private
Integer
returnsTotal
;
@Schema
(
description
=
"客户下单备注"
)
private
String
customerRemark
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/supplier/OperaSupplierPurchaseOrderController.java
0 → 100644
View file @
b3ea9f0a
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
supplier
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.SupplierMonthOrderDetailsRespVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.SupplierMonthOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.SupplierMonthOrderRespVO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseOrderDO
;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpPurchaseOrderService
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customerorder.CustomerOrderDO
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customerorderitem.CustomerOrderItemDO
;
import
cn.iocoder.foodnexus.module.order.service.customerorder.CustomerOrderService
;
import
cn.iocoder.foodnexus.module.order.service.customerorderitem.CustomerOrderItemService
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.annotation.Resource
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
security
.
core
.
util
.
SecurityFrameworkUtils
.
getLoginUserId
;
/**
* @author : yanghao
* create at: 2025/10/16 14:25
* @description: 管理后台 - 供应商 - 对账
*/
@Tag
(
name
=
"管理后台 - 供应商 - 对账"
)
@RestController
@RequestMapping
(
"/operation/reconciliation"
)
@Validated
public
class
OperaSupplierPurchaseOrderController
{
@Resource
private
ErpPurchaseOrderService
purchaseOrderService
;
@Autowired
private
CustomerOrderItemService
customerOrderItemService
;
@Autowired
private
CustomerOrderService
customerOrderService
;
@GetMapping
(
"/page-month"
)
@Operation
(
summary
=
"分页获取月度账单"
)
public
CommonResult
<
PageResult
<
SupplierMonthOrderRespVO
>>
pageMonth
(
SupplierMonthOrderPageReqVO
pageReqVO
)
{
return
success
(
purchaseOrderService
.
pageMonth
(
pageReqVO
,
null
));
}
@GetMapping
(
"/page-by-month"
)
@Operation
(
summary
=
"月度账单明细"
)
public
CommonResult
<
PageResult
<
SupplierMonthOrderDetailsRespVO
>>
listByMonth
(
SupplierMonthOrderPageReqVO
pageReqVO
)
{
if
(
CommonUtil
.
isEmpty
(
pageReqVO
.
getMonth
()))
{
throw
exception
(
"月份不能为空"
);
}
ErpPurchaseOrderPageReqVO
orderPageReqVo
=
new
ErpPurchaseOrderPageReqVO
();
orderPageReqVo
.
setPageSize
(
pageReqVO
.
getPageSize
());
orderPageReqVo
.
setPageNo
(
pageReqVO
.
getPageNo
());
// orderPageReqVo.setSupplierId(supplierApi.querySupplierIdByUserId(getLoginUserId()));
orderPageReqVo
.
setCreateMonth
(
pageReqVO
.
getMonth
());
orderPageReqVo
.
setDeliveryStatus
(
CommonUtil
.
asList
(
ErpDeliveryStatus
.
ARRIVAL
.
getStatus
(),
ErpDeliveryStatus
.
RECONCILIATION
.
getStatus
()));
PageResult
<
ErpPurchaseOrderDO
>
pageResult
=
purchaseOrderService
.
getPurchaseOrderPage
(
orderPageReqVo
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
SupplierMonthOrderDetailsRespVO
.
class
,
this
::
transform
));
}
private
void
transform
(
SupplierMonthOrderDetailsRespVO
purchaseOrder
)
{
CustomerOrderDO
customerOrder
=
customerOrderService
.
getCustomerOrder
(
purchaseOrder
.
getCustomerOrderId
());
List
<
CustomerOrderItemDO
>
customerOrderItemDOS
=
customerOrderItemService
.
queryByOrderId
(
purchaseOrder
.
getCustomerOrderId
(),
purchaseOrder
.
getSupplierId
());
purchaseOrder
.
setDeliveryMode
(
customerOrder
.
getDeliveryMode
());
purchaseOrder
.
setPlanDeliveryStartTime
(
customerOrder
.
getPlanDeliveryStartTime
());
purchaseOrder
.
setPlanDeliveryEndTime
(
customerOrder
.
getPlanDeliveryEndTime
());
// TODO 待定
// purchaseOrder.setPayablePrice();
purchaseOrder
.
setSignedTotal
(
customerOrderItemDOS
.
stream
().
mapToInt
(
CustomerOrderItemDO:
:
getSignedTotal
).
sum
());
purchaseOrder
.
setReturnsTotal
(
customerOrderItemDOS
.
stream
().
mapToInt
(
CustomerOrderItemDO:
:
getReturnsTotal
).
sum
());
purchaseOrder
.
setSupplierName
(
customerOrderItemDOS
.
get
(
0
).
getSupplierName
());
StringBuilder
productNames
=
new
StringBuilder
();
for
(
CustomerOrderItemDO
item
:
customerOrderItemDOS
)
{
productNames
.
append
(
item
.
getProductName
()).
append
(
"("
).
append
(
item
.
getOrderItemQuantity
()).
append
(
")\n"
);
}
purchaseOrder
.
setProductNames
(
productNames
.
toString
());
}
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/CustomerAddressController.java
View file @
b3ea9f0a
...
...
@@ -88,7 +88,7 @@ public class CustomerAddressController {
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户 - 我的地址分页"
)
public
CommonResult
<
PageResult
<
CustomerAddressRespVO
>>
getCustomerAddressPage
(
@Valid
CustomerAddressPageReqVO
pageReqVO
)
{
pageReqVO
.
setC
ustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
pageReqVO
.
setC
reator
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
PageResult
<
CustomerAddressDO
>
pageResult
=
customerAddressService
.
getCustomerAddressPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerAddressRespVO
.
class
));
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/vo/CustomerAddressPageReqVO.java
View file @
b3ea9f0a
...
...
@@ -50,4 +50,7 @@ public class CustomerAddressPageReqVO extends PageParam {
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
LocalDateTime
[]
createTime
;
@Schema
(
description
=
"创建者"
,
hidden
=
true
)
private
Long
creator
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/orderscore/AppCustomerOrderScoreController.java
0 → 100644
View file @
b3ea9f0a
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
app
.
orderscore
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorder.vo.CustomerOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorder.vo.CustomerOrderRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorder.vo.CustomerOrderScoreRespVO
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customerorder.CustomerOrderDO
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customerorderitem.CustomerOrderItemDO
;
import
cn.iocoder.foodnexus.module.order.service.customerorder.CustomerOrderService
;
import
cn.iocoder.foodnexus.module.order.service.customerorderitem.CustomerOrderItemService
;
import
cn.iocoder.foodnexus.module.order.service.orderScore.OrderScoreService
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
jakarta.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
security
.
core
.
util
.
SecurityFrameworkUtils
.
getLoginUserId
;
/**
* @author : yanghao
* create at: 2025/10/16 09:43
* @description: APP - 个人中心 - 我的评价
*/
@Tag
(
name
=
"APP - 个人中心 - 我的评价"
)
@RestController
@RequestMapping
(
"/my/order-score"
)
@Validated
@AppSystemAuth
(
UserSystemEnum
.
CUSTOMER
)
public
class
AppCustomerOrderScoreController
{
@Autowired
private
CustomerOrderService
customerOrderService
;
@Autowired
private
CustomerOrderItemService
customerOrderItemService
;
@Autowired
private
OrderScoreService
orderScoreService
;
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户总订单分页"
)
public
CommonResult
<
PageResult
<
CustomerOrderScoreRespVO
>>
queryMyOrderScorePage
(
@Valid
PageParam
reqVO
)
{
CustomerOrderPageReqVO
pageReqVO
=
new
CustomerOrderPageReqVO
();
pageReqVO
.
setPageNo
(
reqVO
.
getPageNo
());
pageReqVO
.
setPageSize
(
reqVO
.
getPageSize
());
pageReqVO
.
setCreator
(
getLoginUserId
());
pageReqVO
.
setHasScore
(
Boolean
.
TRUE
);
PageResult
<
CustomerOrderDO
>
pageResult
=
customerOrderService
.
getCustomerOrderPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerOrderScoreRespVO
.
class
,
item
->
{
item
.
setProductInfos
(
CommonUtil
.
listConvert
(
customerOrderItemService
.
queryByOrderId
(
item
.
getId
()),
CustomerOrderItemDO:
:
getProductInfo
));
item
.
setOrderScoreItems
(
BeanUtils
.
toBean
(
orderScoreService
.
listByOrderId
(
item
.
getId
()),
CustomerOrderScoreRespVO
.
orderScoreItems
.
class
));
}));
}
@PostMapping
(
"/delete-by-order-id"
)
@Operation
(
summary
=
"根据订单id删除评价"
)
@Parameter
(
name
=
"id"
,
description
=
"订单id"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
Boolean
>
deleteByOrderId
(
@RequestParam
(
"id"
)
Long
id
)
{
return
success
(
orderScoreService
.
deleteByOrderId
(
id
));
}
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorderitem/CustomerOrderItemDO.java
View file @
b3ea9f0a
...
...
@@ -101,4 +101,9 @@ public class CustomerOrderItemDO extends BaseDO {
* 退货总价,单位:分
*/
private
Integer
returnsTotal
;
/**
* 客户下单备注
*/
private
String
customerRemark
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customeraddress/CustomerAddressMapper.java
View file @
b3ea9f0a
...
...
@@ -29,6 +29,7 @@ public interface CustomerAddressMapper extends BaseMapperX<CustomerAddressDO> {
.
eqIfPresent
(
CustomerAddressDO:
:
getAddress
,
reqVO
.
getAddress
())
.
eqIfPresent
(
CustomerAddressDO:
:
getIsDefault
,
reqVO
.
getIsDefault
())
.
betweenIfPresent
(
CustomerAddressDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
eqIfPresent
(
CustomerAddressDO:
:
getCreator
,
reqVO
.
getCreator
())
.
orderByDesc
(
CustomerAddressDO:
:
getId
));
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customerorder/CustomerOrderMapper.java
View file @
b3ea9f0a
...
...
@@ -46,6 +46,7 @@ public interface CustomerOrderMapper extends BaseMapperX<CustomerOrderDO> {
.
eqIfPresent
(
CustomerOrderDO:
:
getOperCompany
,
reqVO
.
getOperCompany
())
.
betweenIfPresent
(
CustomerOrderDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
eqIfPresent
(
CustomerOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
eqIfPresent
(
CustomerOrderDO:
:
getHasScore
,
reqVO
.
getHasScore
())
.
orderByDesc
(
CustomerOrderDO:
:
getId
);
if
(
CommonUtil
.
isNotBlank
(
reqVO
.
getCreateYearMonth
()))
{
String
createMonth
=
reqVO
.
getCreateYearMonth
().
trim
();
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktask/CheckTaskServiceImpl.java
View file @
b3ea9f0a
...
...
@@ -302,6 +302,7 @@ public class CheckTaskServiceImpl implements CheckTaskService, CheckTaskApi {
CheckTaskItemsSaveReqVO
item
=
new
CheckTaskItemsSaveReqVO
();
ProductSpuDO
productSpuDO
=
spuMap
.
get
(
purchaseOrderItem
.
getProductId
());
item
.
setProductId
(
purchaseOrderItem
.
getProductId
());
item
.
setProductName
(
productSpuDO
.
getName
());
item
.
setCategoryId
(
productSpuDO
.
getCategoryId
());
item
.
setCategoryName
(
productCategoryService
.
queryNameById
(
productSpuDO
.
getCategoryId
()));
item
.
setPicUrl
(
productSpuDO
.
getPicUrl
());
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktaskitems/CheckTaskItemsService.java
View file @
b3ea9f0a
...
...
@@ -61,5 +61,7 @@ public interface CheckTaskItemsService {
*/
PageResult
<
CheckTaskItemsDO
>
getCheckTaskItemsPage
(
CheckTaskItemsPageReqVO
pageReqVO
);
List
<
CheckTaskItemsDO
>
queryByCheckId
(
Long
id
);
List
<
CheckTaskItemsDO
>
queryByCheckId
(
Long
checkId
);
Map
<
Long
,
String
>
queryProductInfoByCheckId
(
Collection
<
Long
>
checkIds
);
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktaskitems/CheckTaskItemsServiceImpl.java
View file @
b3ea9f0a
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
service
.
checktaskitems
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.module.order.controller.admin.checktask.vo.CheckTaskItemsPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.checktask.vo.CheckTaskItemsSaveReqVO
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -74,4 +76,23 @@ public class CheckTaskItemsServiceImpl implements CheckTaskItemsService {
return
checkTaskItemsMapper
.
selectList
(
CheckTaskItemsDO:
:
getCheckTaskId
,
id
);
}
@Override
public
Map
<
Long
,
String
>
queryProductInfoByCheckId
(
Collection
<
Long
>
checkIds
)
{
Map
<
Long
,
String
>
resultMap
=
new
HashMap
<>();
if
(
CommonUtil
.
isEmpty
(
checkIds
))
{
return
resultMap
;
}
List
<
CheckTaskItemsDO
>
checkTaskItemsDOS
=
checkTaskItemsMapper
.
selectList
(
Wrappers
.<
CheckTaskItemsDO
>
lambdaQuery
()
.
in
(
CheckTaskItemsDO:
:
getCheckTaskId
,
checkIds
));
if
(
CommonUtil
.
isEmpty
(
checkTaskItemsDOS
))
{
return
resultMap
;
}
Map
<
Long
,
List
<
CheckTaskItemsDO
>>
itemMap
=
CommonUtil
.
listConvertListMap
(
checkTaskItemsDOS
,
CheckTaskItemsDO:
:
getCheckTaskId
);
itemMap
.
forEach
((
checkId
,
list
)
->
resultMap
.
put
(
checkId
,
String
.
join
(
"\n"
,
CommonUtil
.
listConvert
(
list
,
item
->
item
.
getProductName
()
+
"("
+
item
.
getCheckCount
()
+
")"
))));
return
resultMap
;
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
View file @
b3ea9f0a
...
...
@@ -27,6 +27,7 @@ import cn.iocoder.foodnexus.module.order.api.CustomerOrderApi;
import
cn.iocoder.foodnexus.module.order.api.CustomerOrderRecordApi
;
import
cn.iocoder.foodnexus.module.order.controller.admin.orderScore.vo.OrderScoreSaveReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.*
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.shoppingcart.ShoppingCartDO
;
import
cn.iocoder.foodnexus.module.order.dto.*
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderRemark
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customerorderitem.CustomerOrderItemDO
;
...
...
@@ -35,6 +36,7 @@ import cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus;
import
cn.iocoder.foodnexus.module.order.service.customeraddress.CustomerAddressService
;
import
cn.iocoder.foodnexus.module.order.service.customerorderitem.CustomerOrderItemService
;
import
cn.iocoder.foodnexus.module.order.service.orderScore.OrderScoreService
;
import
cn.iocoder.foodnexus.module.order.service.shoppingcart.ShoppingCartService
;
import
cn.iocoder.foodnexus.module.product.api.InquireCustomerApi
;
import
cn.iocoder.foodnexus.module.product.api.dto.CustomerVisibleProductRespDTO
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
...
...
@@ -44,6 +46,7 @@ import cn.iocoder.foodnexus.module.system.dal.dataobject.user.AdminUserDO;
import
cn.iocoder.foodnexus.module.system.service.user.AdminUserService
;
import
cn.iocoder.foodnexus.module.system.util.GenCodeUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.apache.commons.compress.utils.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
...
...
@@ -135,6 +138,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
private
AdminUserService
userService
;
@Autowired
private
ShoppingCartService
shoppingCartService
;
@Autowired
private
GenCodeUtils
genCodeUtils
;
@Override
...
...
@@ -244,6 +250,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
createOrder
.
setAddressInfo
(
BeanUtils
.
toBean
(
addressService
.
getCustomerAddress
(
createReqVO
.
getAddressId
()),
CustomerAddressInfo
.
class
));
createOrder
.
setSupplierCount
(
supplierSet
.
size
());
createOrder
.
setProductCount
(
procuctSet
.
size
());
// 购物车信息
List
<
Long
>
productIds
=
CommonUtil
.
listConvert
(
createReqVO
.
getOrderItems
(),
AppCustomerOrderItemSaveReqVO:
:
getProductId
);
Map
<
Long
,
ShoppingCartDO
>
shoppingMap
=
shoppingCartService
.
getMap
(
loginUser
.
getId
(),
productIds
);
// 子订单补全
AtomicReference
<
Integer
>
orderAmount
=
new
AtomicReference
<>(
0
);
List
<
CustomerOrderItemDO
>
collect
=
createReqVO
.
getOrderItems
().
stream
().
map
(
orderItem
->
{
...
...
@@ -254,6 +263,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
item
.
setProductName
(
item
.
getProductInfo
().
getName
());
item
.
setSignedQuantity
(
0
);
item
.
setSignedTotal
(
0
);
if
(
shoppingMap
.
containsKey
(
orderItem
.
getProductId
()))
{
item
.
setCustomerRemark
(
shoppingMap
.
get
(
orderItem
.
getProductId
()).
getRemark
());
}
orderAmount
.
updateAndGet
(
v
->
v
+
item
.
getOrderItemTotal
());
return
item
;
}).
collect
(
Collectors
.
toList
());
...
...
@@ -263,6 +275,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
customerOrderId
=
this
.
createCustomerOrder
(
createOrder
);
customerOrderItemService
.
createBatch
(
collect
,
customerOrderId
);
// 删除购物车中的同样商品的信息
shoppingCartService
.
deleteByProductId
(
loginUser
.
getId
(),
productIds
);
// 拆分采购订单
orderSplitPurchase
(
customerOrderId
);
...
...
@@ -580,14 +595,12 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
}
});
}
CustomerOrderDO
updateScore
=
new
CustomerOrderDO
();
if
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getOrderRemark
()))
{
reqVO
.
getOrderRemark
().
setOperTime
(
new
Date
());
customerOrderMapper
.
update
(
Wrappers
.<
CustomerOrderDO
>
lambdaUpdate
()
.
eq
(
CustomerOrderDO:
:
getId
,
id
)
.
set
(
CustomerOrderDO:
:
getOrderRemark
,
reqVO
.
getOrderRemark
()));
updateScore
.
setOrderRemark
(
reqVO
.
getOrderRemark
());
}
CustomerOrderDO
updateScore
=
new
CustomerOrderDO
();
updateScore
.
setId
(
id
);
updateScore
.
setHasScore
(
Boolean
.
TRUE
);
customerOrderMapper
.
updateById
(
updateScore
);
...
...
@@ -741,4 +754,19 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
.
set
(
CustomerOrderDO:
:
getOrderStatus
,
updateOrderStatus
)
.
eq
(
CustomerOrderDO:
:
getId
,
customerOrderId
));
}
@Override
public
Map
<
Long
,
CustomerOrderDTO
>
getOrderMap
(
Collection
<
Long
>
orderIds
)
{
List
<
CustomerOrderDO
>
customerOrders
=
customerOrderMapper
.
selectByIds
(
orderIds
);
return
CommonUtil
.
listConvertMap
(
BeanUtils
.
toBean
(
customerOrders
,
CustomerOrderDTO
.
class
),
CustomerOrderDTO:
:
getId
);
}
@Override
public
List
<
CustomerOrderItemDTO
>
queryItemsByIds
(
Collection
<
Long
>
orderItems
)
{
if
(
CommonUtil
.
isEmpty
(
orderItems
))
{
return
Lists
.
newArrayList
();
}
return
BeanUtils
.
toBean
(
customerOrderItemMapper
.
selectByIds
(
orderItems
),
CustomerOrderItemDTO
.
class
);
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/orderScore/OrderScoreService.java
View file @
b3ea9f0a
...
...
@@ -64,4 +64,8 @@ public interface OrderScoreService {
boolean
exists
(
Long
orderId
,
Long
scoreId
);
PageResult
<
OrderScoreSupplierRespVO
>
supplierPage
(
OrderScoreSupplierPageReqVO
pageReqVO
);
List
<
OrderScoreDO
>
listByOrderId
(
Long
orderId
);
Boolean
deleteByOrderId
(
Long
orderId
);
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/orderScore/OrderScoreServiceImpl.java
View file @
b3ea9f0a
...
...
@@ -181,6 +181,21 @@ public class OrderScoreServiceImpl implements OrderScoreService {
return
null
;
}
@Override
public
List
<
OrderScoreDO
>
listByOrderId
(
Long
id
)
{
return
scoreMapper
.
selectList
(
OrderScoreDO:
:
getOrderId
,
id
);
}
@Override
public
Boolean
deleteByOrderId
(
Long
orderId
)
{
if
(!
scoreMapper
.
exists
(
Wrappers
.<
OrderScoreDO
>
lambdaQuery
()
.
eq
(
OrderScoreDO:
:
getOrderId
,
orderId
)))
{
return
Boolean
.
FALSE
;
}
return
scoreMapper
.
delete
(
Wrappers
.<
OrderScoreDO
>
lambdaQuery
()
.
eq
(
OrderScoreDO:
:
getOrderId
,
orderId
))
>
0
;
}
public
BigDecimal
divideInts
(
int
num1
,
int
num2
)
{
// 处理除数为0的情况
if
(
num2
==
0
)
{
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/shoppingcart/ShoppingCartService.java
View file @
b3ea9f0a
...
...
@@ -60,4 +60,7 @@ public interface ShoppingCartService {
*/
PageResult
<
ShoppingCartDO
>
getShoppingCartPage
(
ShoppingCartPageReqVO
pageReqVO
);
Map
<
Long
,
ShoppingCartDO
>
getMap
(
Long
creator
,
List
<
Long
>
productIds
);
void
deleteByProductId
(
Long
creator
,
List
<
Long
>
productIds
);
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/shoppingcart/ShoppingCartServiceImpl.java
View file @
b3ea9f0a
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
service
.
shoppingcart
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.module.order.controller.app.shoppingcart.vo.ShoppingCartPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.shoppingcart.vo.ShoppingCartSaveReqVO
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -32,6 +34,17 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
@Override
public
Long
createShoppingCart
(
ShoppingCartSaveReqVO
createReqVO
)
{
ShoppingCartDO
cart
=
shoppingCartMapper
.
selectOne
(
Wrappers
.<
ShoppingCartDO
>
lambdaQuery
()
.
eq
(
ShoppingCartDO:
:
getProductId
,
createReqVO
.
getProductId
())
.
last
(
"LIMIT 1"
));
if
(
CommonUtil
.
isNotEmpty
(
cart
))
{
ShoppingCartDO
updateCart
=
new
ShoppingCartDO
();
updateCart
.
setId
(
cart
.
getId
());
updateCart
.
setRemark
(
createReqVO
.
getRemark
());
updateCart
.
setOrderQuantity
(
cart
.
getOrderQuantity
()
+
createReqVO
.
getOrderQuantity
());
shoppingCartMapper
.
updateById
(
updateCart
);
return
cart
.
getId
();
}
// 插入
ShoppingCartDO
shoppingCart
=
BeanUtils
.
toBean
(
createReqVO
,
ShoppingCartDO
.
class
);
shoppingCartMapper
.
insert
(
shoppingCart
);
...
...
@@ -80,4 +93,22 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
return
shoppingCartMapper
.
selectPage
(
pageReqVO
);
}
@Override
public
Map
<
Long
,
ShoppingCartDO
>
getMap
(
Long
creator
,
List
<
Long
>
productIds
)
{
List
<
ShoppingCartDO
>
shoppingCartDOS
=
shoppingCartMapper
.
selectList
(
Wrappers
.<
ShoppingCartDO
>
lambdaQuery
()
.
in
(
ShoppingCartDO:
:
getProductId
,
productIds
)
.
eq
(
ShoppingCartDO:
:
getCreator
,
creator
));
return
CommonUtil
.
listConvertMap
(
shoppingCartDOS
,
ShoppingCartDO:
:
getProductId
);
}
@Override
public
void
deleteByProductId
(
Long
creator
,
List
<
Long
>
productIds
)
{
if
(
CommonUtil
.
isEmpty
(
productIds
))
{
return
;
}
shoppingCartMapper
.
delete
(
Wrappers
.<
ShoppingCartDO
>
lambdaQuery
()
.
in
(
ShoppingCartDO:
:
getProductId
,
productIds
)
.
eq
(
ShoppingCartDO:
:
getCreator
,
creator
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-product-api/src/main/java/cn/iocoder/foodnexus/module/product/api/dto/ProductInfo.java
View file @
b3ea9f0a
...
...
@@ -40,6 +40,10 @@ public class ProductInfo implements Serializable {
*/
private
Long
categoryId
;
/**
* 分类名称
*/
private
String
categoryName
;
/**
* 商品封面图
*/
private
String
picUrl
;
...
...
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java
View file @
b3ea9f0a
...
...
@@ -19,4 +19,7 @@ public class DeptListReqVO {
@Schema
(
description
=
"用户体系"
,
example
=
"1"
)
private
String
userSystem
;
@Schema
(
description
=
"parentId"
)
private
Long
parentId
;
}
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/dal/mysql/dept/DeptMapper.java
View file @
b3ea9f0a
...
...
@@ -16,6 +16,7 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
return
selectList
(
new
LambdaQueryWrapperX
<
DeptDO
>()
.
likeIfPresent
(
DeptDO:
:
getName
,
reqVO
.
getName
())
.
eqIfPresent
(
DeptDO:
:
getStatus
,
reqVO
.
getStatus
())
.
eqIfPresent
(
DeptDO:
:
getParentId
,
reqVO
.
getParentId
())
.
eqIfPresent
(
DeptDO:
:
getUserSystem
,
reqVO
.
getUserSystem
()));
}
...
...
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