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
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
496 additions
and
35 deletions
+496
-35
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpPurchaseOrderController.java
+0
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/PurchaseOrderController.java
+0
-0
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
This diff is collapsed.
Click to expand it.
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/PurchaseOrderController.java
View file @
b3ea9f0a
This diff is collapsed.
Click to expand it.
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;
...
@@ -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.ExcelIgnoreUnannotated
;
import
cn.idev.excel.annotation.ExcelProperty
;
import
cn.idev.excel.annotation.ExcelProperty
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
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
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.constraints.NotNull
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -98,8 +101,7 @@ public class ErpPurchaseOrderRespVO {
...
@@ -98,8 +101,7 @@ public class ErpPurchaseOrderRespVO {
@Schema
(
description
=
"采购退货数量"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"100.00"
)
@Schema
(
description
=
"采购退货数量"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"100.00"
)
private
BigDecimal
returnCount
;
private
BigDecimal
returnCount
;
@Schema
(
description
=
"客户订单id"
)
private
Long
customerId
;
@Schema
(
description
=
"客户订单id"
)
@Schema
(
description
=
"客户订单id"
)
private
Long
customerOrderId
;
private
Long
customerOrderId
;
...
@@ -112,6 +114,32 @@ public class ErpPurchaseOrderRespVO {
...
@@ -112,6 +114,32 @@ public class ErpPurchaseOrderRespVO {
@Schema
(
description
=
"发货状态"
)
@Schema
(
description
=
"发货状态"
)
private
String
deliveryStatus
;
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
@Data
public
static
class
Item
{
public
static
class
Item
{
...
@@ -152,20 +180,21 @@ public class ErpPurchaseOrderRespVO {
...
@@ -152,20 +180,21 @@ public class ErpPurchaseOrderRespVO {
// ========== 关联字段 ==========
// ========== 关联字段 ==========
@Schema
(
description
=
"产品名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"巧克力"
)
@Schema
(
description
=
"商品信息"
)
private
String
productName
;
private
ProductInfo
productInfo
;
@Schema
(
description
=
"产品条码"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"A9985"
)
private
String
productBarCode
;
@Schema
(
description
=
"产品单位名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"盒"
)
private
String
productUnitName
;
@Schema
(
description
=
"库存数量"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"100.00"
)
@Schema
(
description
=
"库存数量"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"100.00"
)
private
BigDecimal
stockCount
;
// 该字段仅仅在“详情”和“编辑”时使用
private
BigDecimal
stockCount
;
// 该字段仅仅在“详情”和“编辑”时使用
@Schema
(
description
=
"客户订单id"
)
@Schema
(
description
=
"客户子订单id"
)
private
Long
customerId
;
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 {
...
@@ -67,8 +67,8 @@ public class ErpPurchaseOrderSaveReqVO {
@Schema
(
description
=
"订单项编号"
,
example
=
"11756"
)
@Schema
(
description
=
"订单项编号"
,
example
=
"11756"
)
private
Long
id
;
private
Long
id
;
@Schema
(
description
=
"客户订单id"
)
@Schema
(
description
=
"客户
子
订单id"
)
private
Long
customerOrderId
;
private
Long
customerOrderI
temI
d
;
@Schema
(
description
=
"产品编号"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"3113"
)
@Schema
(
description
=
"产品编号"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"3113"
)
@NotNull
(
message
=
"产品编号不能为空"
)
@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;
...
@@ -11,6 +11,12 @@ import lombok.Data;
@Data
@Data
public
class
SupplierMonthOrderRespVO
{
public
class
SupplierMonthOrderRespVO
{
@Schema
(
description
=
"供应商id"
)
private
Long
supplierId
;
@Schema
(
description
=
"供应商名称"
)
private
String
supplierName
;
@Schema
(
description
=
"月份"
)
@Schema
(
description
=
"月份"
)
private
String
month
;
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 {
...
@@ -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"
)
@GetMapping
(
"/simple-list"
)
@Operation
(
summary
=
"获得客户精简列表"
,
description
=
"只包含被开启的客户,主要用于前端的下拉选项"
)
@Operation
(
summary
=
"获得客户精简列表"
,
description
=
"只包含被开启的客户,主要用于前端的下拉选项"
)
public
CommonResult
<
List
<
ErpCustomerRespVO
>>
getCustomerSimpleList
()
{
public
CommonResult
<
List
<
ErpCustomerRespVO
>>
getCustomerSimpleList
()
{
List
<
ErpCustomerDO
>
list
=
customerService
.
getCustomerListByStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
());
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"
)
@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;
...
@@ -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.KeySequence
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
lombok.*
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -89,12 +90,9 @@ public class ErpPurchaseOrderItemDO extends BaseDO {
...
@@ -89,12 +90,9 @@ public class ErpPurchaseOrderItemDO extends BaseDO {
*/
*/
private
BigDecimal
returnCount
;
private
BigDecimal
returnCount
;
/**
/**
* 客户订单id
* 客户订单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>
...
@@ -113,19 +113,23 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
default
PageResult
<
SupplierMonthOrderRespVO
>
pageMonth
(
SupplierMonthOrderPageReqVO
pageReqVO
,
Long
supplierId
)
{
default
PageResult
<
SupplierMonthOrderRespVO
>
pageMonth
(
SupplierMonthOrderPageReqVO
pageReqVO
,
Long
supplierId
)
{
MPJQueryWrapper
<
ErpPurchaseOrderDO
>
wrapper
=
new
MPJQueryWrapper
<>();
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
(
"DATE_FORMAT( t.create_time, '%Y-%m' ) AS 'month'"
);
wrapper
.
select
(
"count( t.id ) AS 'orderCount'"
);
wrapper
.
select
(
"count( t.id ) AS 'orderCount'"
);
wrapper
.
select
(
"SUM( t.total_price ) AS 'orderPrice'"
);
wrapper
.
select
(
"SUM( t.total_price ) AS 'orderPrice'"
);
// TODO payablePrice 这个字段待定
// 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
.
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
.
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
(),
wrapper
.
in
(
"t.delivery_status"
,
CommonUtil
.
asList
(
ErpDeliveryStatus
.
RECONCILIATION
.
getStatus
(),
ErpDeliveryStatus
.
ARRIVAL
.
getStatus
()));
ErpDeliveryStatus
.
ARRIVAL
.
getStatus
()));
wrapper
.
in
(
"t1.order_status"
,
CommonUtil
.
asList
(
CustomerOrderStatus
.
SIGN_RECEIPT
.
getKey
()),
CustomerOrderStatus
.
FINISH
.
getKey
());
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
.
eq
(
CommonUtil
.
isNotBlank
(
pageReqVO
.
getMonth
()),
"DATE_FORMAT(t.create_time, '%Y-%m') "
,
pageReqVO
.
getMonth
());
wrapper
.
orderByDesc
(
"t.id"
);
wrapper
.
orderByDesc
(
"t.id"
);
wrapper
.
groupBy
(
"DATE_FORMAT( t.create_time, '%Y-%m' ), t.supplier_id"
);
return
this
.
selectJoinPage
(
pageReqVO
,
SupplierMonthOrderRespVO
.
class
,
wrapper
);
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> {
...
@@ -35,7 +35,7 @@ public interface ErpSaleOrderMapper extends BaseMapperX<ErpSaleOrderDO> {
.
eqIfPresent
(
ErpSaleOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getDeliveryStaffId
,
reqVO
.
getDeliveryStaffId
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getDeliveryStaffId
,
reqVO
.
getDeliveryStaffId
())
.
betweenIfPresent
(
ErpSaleOrderDO:
:
getAcceptTime
,
reqVO
.
getAcceptTime
())
.
betweenIfPresent
(
ErpSaleOrderDO:
:
getAcceptTime
,
reqVO
.
getAcceptTime
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getPickUpStatus
,
reqVO
.
getPickUpStatus
()
.
getType
()
)
.
eqIfPresent
(
ErpSaleOrderDO:
:
getPickUpStatus
,
reqVO
.
getPickUpStatus
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getCustomerDeptId
,
reqVO
.
getCustomerDeptId
())
.
eqIfPresent
(
ErpSaleOrderDO:
:
getCustomerDeptId
,
reqVO
.
getCustomerDeptId
())
.
inIfPresent
(
ErpSaleOrderDO:
:
getCustomerDeptId
,
reqVO
.
getCustomerDeptIds
())
.
inIfPresent
(
ErpSaleOrderDO:
:
getCustomerDeptId
,
reqVO
.
getCustomerDeptIds
())
.
orderByDesc
(
ErpSaleOrderDO:
:
getId
);
.
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 {
...
@@ -129,4 +129,6 @@ public interface ErpPurchaseOrderService {
* @param supplierId 当前供应商id
* @param supplierId 当前供应商id
*/
*/
void
reconciliation
(
List
<
ErpPurchaseOrderDO
>
purchaseOrderList
,
Long
supplierId
);
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 {
...
@@ -106,10 +106,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
calculateTotalPrice
(
purchaseOrder
,
purchaseOrderItems
);
calculateTotalPrice
(
purchaseOrder
,
purchaseOrderItems
);
purchaseOrderMapper
.
insert
(
purchaseOrder
);
purchaseOrderMapper
.
insert
(
purchaseOrder
);
// 2.2 插入订单项
// 2.2 插入订单项
purchaseOrderItems
.
forEach
(
o
->
{
purchaseOrderItems
.
forEach
(
o
->
o
.
setOrderId
(
purchaseOrder
.
getId
()));
o
.
setOrderId
(
purchaseOrder
.
getId
());
o
.
setCustomerOrderId
(
purchaseOrder
.
getCustomerOrderId
());
});
purchaseOrderItemMapper
.
insertBatch
(
purchaseOrderItems
);
purchaseOrderItemMapper
.
insertBatch
(
purchaseOrderItems
);
return
purchaseOrder
.
getId
();
return
purchaseOrder
.
getId
();
}
}
...
@@ -331,11 +328,14 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
...
@@ -331,11 +328,14 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
public
void
delivery
(
List
<
Long
>
ids
,
Long
supplierId
,
ErpDeliveryStatus
oriStatus
,
ErpDeliveryStatus
updateStatus
,
CustomerOrderStatus
updateOrderStatus
)
{
public
void
delivery
(
List
<
Long
>
ids
,
Long
supplierId
,
ErpDeliveryStatus
oriStatus
,
ErpDeliveryStatus
updateStatus
,
CustomerOrderStatus
updateOrderStatus
)
{
List
<
ErpPurchaseOrderDO
>
orderList
=
purchaseOrderMapper
.
selectList
(
Wrappers
.<
ErpPurchaseOrderDO
>
lambdaQuery
()
List
<
ErpPurchaseOrderDO
>
orderList
=
purchaseOrderMapper
.
selectList
(
Wrappers
.<
ErpPurchaseOrderDO
>
lambdaQuery
()
.
in
(
ErpPurchaseOrderDO:
:
getId
,
ids
)
.
in
(
ErpPurchaseOrderDO:
:
getId
,
ids
)
.
eq
(
ErpPurchaseOrderDO:
:
getSupplierId
,
supplierId
));
.
eq
(
CommonUtil
.
isNotEmpty
(
supplierId
)
,
ErpPurchaseOrderDO:
:
getSupplierId
,
supplierId
));
if
(
CommonUtil
.
isEmpty
(
orderList
))
{
if
(
CommonUtil
.
isEmpty
(
orderList
))
{
throw
exception
(
PURCHASE_ORDER_NOT_EXISTS
);
throw
exception
(
PURCHASE_ORDER_NOT_EXISTS
);
}
}
if
(
CommonUtil
.
isEmpty
(
supplierId
))
{
supplierId
=
orderList
.
get
(
0
).
getSupplierId
();
}
Set
<
Long
>
customerOrderSet
=
new
HashSet
<>();
Set
<
Long
>
customerOrderSet
=
new
HashSet
<>();
for
(
ErpPurchaseOrderDO
item
:
orderList
)
{
for
(
ErpPurchaseOrderDO
item
:
orderList
)
{
...
@@ -373,7 +373,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
...
@@ -373,7 +373,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
inSaveReqVO
.
setRemark
(
purchaseOrder
.
getRemark
());
inSaveReqVO
.
setRemark
(
purchaseOrder
.
getRemark
());
List
<
ErpPurchaseOrderItemDO
>
purchaseOrderItems
=
purchaseOrderItemMapper
.
selectListByOrderId
(
purchaseOrder
.
getId
());
List
<
ErpPurchaseOrderItemDO
>
purchaseOrderItems
=
purchaseOrderItemMapper
.
selectListByOrderId
(
purchaseOrder
.
getId
());
inSaveReqVO
.
setItems
(
CommonUtil
.
listConvert
(
purchaseOrderItems
,
purchaseOrderItem
->
inSaveReqVO
.
setItems
(
CommonUtil
.
listConvert
(
purchaseOrderItems
,
purchaseOrderItem
->
getItem
(
purchaseOrderItem
,
customerOrderApi
.
queryById
(
purchaseOrder
Item
.
getCustomerOrderId
()))));
getItem
(
purchaseOrderItem
,
customerOrderApi
.
queryById
(
purchaseOrder
.
getCustomerOrderId
()))));
purchaseInService
.
createPurchaseIn
(
inSaveReqVO
);
purchaseInService
.
createPurchaseIn
(
inSaveReqVO
);
// 新增来料质检
// 新增来料质检
...
@@ -451,6 +451,15 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
...
@@ -451,6 +451,15 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
purchaseOrderMapper
.
updateBatch
(
updateBatch
);
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
@Async
@TransactionalEventListener
(
classes
=
PurchaseOrderSplitEvent
.
class
,
phase
=
TransactionPhase
.
AFTER_COMMIT
)
@TransactionalEventListener
(
classes
=
PurchaseOrderSplitEvent
.
class
,
phase
=
TransactionPhase
.
AFTER_COMMIT
)
public
void
orderSplit
(
PurchaseOrderSplitEvent
event
)
{
public
void
orderSplit
(
PurchaseOrderSplitEvent
event
)
{
...
@@ -480,7 +489,8 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
...
@@ -480,7 +489,8 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
purhcaseOrderItem
.
setProductUnit
(
customerOrderItem
.
getProductInfo
().
getUnitName
());
purhcaseOrderItem
.
setProductUnit
(
customerOrderItem
.
getProductInfo
().
getUnitName
());
purhcaseOrderItem
.
setProductPrice
(
customerOrderItem
.
getOrderItemPrice
());
purhcaseOrderItem
.
setProductPrice
(
customerOrderItem
.
getOrderItemPrice
());
purhcaseOrderItem
.
setCount
(
customerOrderItem
.
getOrderItemQuantity
());
purhcaseOrderItem
.
setCount
(
customerOrderItem
.
getOrderItemQuantity
());
purhcaseOrderItem
.
setCustomerOrderId
(
orderId
);
purhcaseOrderItem
.
setCustomerOrderItemId
(
customerOrderItem
.
getId
());
purhcaseOrderItem
.
setRemark
(
customerOrderItem
.
getCustomerRemark
());
purchaseOrder
.
put
(
purhcaseOrderItem
);
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 {
...
@@ -37,6 +37,6 @@ public class CustomerRequirePageReqVO extends PageParam {
private
LocalDateTime
[]
updateTime
;
private
LocalDateTime
[]
updateTime
;
@Schema
(
description
=
"创建人"
)
@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 {
...
@@ -73,7 +73,7 @@ public class AppCustomerRequireController {
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户需求分页"
)
@Operation
(
summary
=
"获得客户需求分页"
)
public
CommonResult
<
PageResult
<
CustomerRequireRespVO
>>
getCustomerRequirePage
(
@Valid
CustomerRequirePageReqVO
pageReqVO
)
{
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
);
PageResult
<
CustomerRequireDO
>
pageResult
=
customerRequireService
.
getCustomerRequirePage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerRequireRespVO
.
class
));
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;
...
@@ -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.dto.CustomerOrderItemDTO
;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
/**
* @author : yanghao
* @author : yanghao
...
@@ -18,4 +21,8 @@ public interface CustomerOrderApi {
...
@@ -18,4 +21,8 @@ public interface CustomerOrderApi {
List
<
CustomerOrderItemDTO
>
queryItemsByOrderId
(
Long
customerOrderId
);
List
<
CustomerOrderItemDTO
>
queryItemsByOrderId
(
Long
customerOrderId
);
void
updateOrderStatus
(
Long
customerOrderId
,
CustomerOrderStatus
updateOrderStatus
);
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 {
...
@@ -67,4 +67,8 @@ public class CustomerOrderItemDTO {
* 订单备注
* 订单备注
*/
*/
private
CustomerOrderRemark
orderRemark
;
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
;
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.AppCustomerOrderScoreReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderScoreRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderScoreRespVO
;
import
cn.iocoder.foodnexus.module.order.service.checktaskitems.CheckTaskItemsService
;
import
cn.iocoder.foodnexus.module.order.service.checktaskitems.CheckTaskItemsService
;
...
@@ -45,6 +51,15 @@ public class CheckTaskController {
...
@@ -45,6 +51,15 @@ public class CheckTaskController {
@Autowired
@Autowired
private
CheckTaskItemsService
checkTaskItemsService
;
private
CheckTaskItemsService
checkTaskItemsService
;
@Autowired
private
ErpSupplierApi
supplierApi
;
@Autowired
private
ErpPurchaseOrderService
purchaseOrderService
;
@Autowired
private
ErpCustomerApi
customerApi
;
@PostMapping
(
"/create"
)
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建来料质检"
)
@Operation
(
summary
=
"创建来料质检"
)
@PreAuthorize
(
"@ss.hasPermission('order:check-task:create')"
)
@PreAuthorize
(
"@ss.hasPermission('order:check-task:create')"
)
...
@@ -86,6 +101,11 @@ public class CheckTaskController {
...
@@ -86,6 +101,11 @@ public class CheckTaskController {
CheckTaskDO
checkTask
=
checkTaskService
.
getCheckTask
(
id
);
CheckTaskDO
checkTask
=
checkTaskService
.
getCheckTask
(
id
);
return
success
(
BeanUtils
.
toBean
(
checkTask
,
CheckTaskRespVO
.
class
,
item
->
{
return
success
(
BeanUtils
.
toBean
(
checkTask
,
CheckTaskRespVO
.
class
,
item
->
{
item
.
setItems
(
BeanUtils
.
toBean
(
checkTaskItemsService
.
queryByCheckId
(
item
.
getId
()),
CheckTaskItemsRespVO
.
class
));
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 {
...
@@ -94,7 +114,19 @@ public class CheckTaskController {
@PreAuthorize
(
"@ss.hasPermission('order:check-task:query')"
)
@PreAuthorize
(
"@ss.hasPermission('order:check-task:query')"
)
public
CommonResult
<
PageResult
<
CheckTaskRespVO
>>
getCheckTaskPage
(
@Valid
CheckTaskPageReqVO
pageReqVO
)
{
public
CommonResult
<
PageResult
<
CheckTaskRespVO
>>
getCheckTaskPage
(
@Valid
CheckTaskPageReqVO
pageReqVO
)
{
PageResult
<
CheckTaskDO
>
pageResult
=
checkTaskService
.
getCheckTaskPage
(
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"
)
@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 {
...
@@ -65,4 +65,19 @@ public class CheckTaskRespVO {
@Schema
(
description
=
"质检子项(详情接口返回)"
)
@Schema
(
description
=
"质检子项(详情接口返回)"
)
private
List
<
CheckTaskItemsRespVO
>
items
;
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 {
...
@@ -81,4 +81,7 @@ public class CustomerOrderPageReqVO extends PageParam {
@Schema
(
description
=
"筛选待评价"
)
@Schema
(
description
=
"筛选待评价"
)
private
Boolean
filterToBeScore
;
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 {
...
@@ -85,5 +85,7 @@ public class CustomerOrderItemRespVO {
@Schema
(
description
=
"退货总价,单位:分"
)
@Schema
(
description
=
"退货总价,单位:分"
)
private
Integer
returnsTotal
;
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 {
...
@@ -88,7 +88,7 @@ public class CustomerAddressController {
@GetMapping
(
"/page"
)
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户 - 我的地址分页"
)
@Operation
(
summary
=
"获得客户 - 我的地址分页"
)
public
CommonResult
<
PageResult
<
CustomerAddressRespVO
>>
getCustomerAddressPage
(
@Valid
CustomerAddressPageReqVO
pageReqVO
)
{
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
);
PageResult
<
CustomerAddressDO
>
pageResult
=
customerAddressService
.
getCustomerAddressPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerAddressRespVO
.
class
));
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 {
...
@@ -50,4 +50,7 @@ public class CustomerAddressPageReqVO extends PageParam {
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
LocalDateTime
[]
createTime
;
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 {
...
@@ -101,4 +101,9 @@ public class CustomerOrderItemDO extends BaseDO {
* 退货总价,单位:分
* 退货总价,单位:分
*/
*/
private
Integer
returnsTotal
;
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> {
...
@@ -29,6 +29,7 @@ public interface CustomerAddressMapper extends BaseMapperX<CustomerAddressDO> {
.
eqIfPresent
(
CustomerAddressDO:
:
getAddress
,
reqVO
.
getAddress
())
.
eqIfPresent
(
CustomerAddressDO:
:
getAddress
,
reqVO
.
getAddress
())
.
eqIfPresent
(
CustomerAddressDO:
:
getIsDefault
,
reqVO
.
getIsDefault
())
.
eqIfPresent
(
CustomerAddressDO:
:
getIsDefault
,
reqVO
.
getIsDefault
())
.
betweenIfPresent
(
CustomerAddressDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
betweenIfPresent
(
CustomerAddressDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
eqIfPresent
(
CustomerAddressDO:
:
getCreator
,
reqVO
.
getCreator
())
.
orderByDesc
(
CustomerAddressDO:
:
getId
));
.
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> {
...
@@ -46,6 +46,7 @@ public interface CustomerOrderMapper extends BaseMapperX<CustomerOrderDO> {
.
eqIfPresent
(
CustomerOrderDO:
:
getOperCompany
,
reqVO
.
getOperCompany
())
.
eqIfPresent
(
CustomerOrderDO:
:
getOperCompany
,
reqVO
.
getOperCompany
())
.
betweenIfPresent
(
CustomerOrderDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
betweenIfPresent
(
CustomerOrderDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
eqIfPresent
(
CustomerOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
eqIfPresent
(
CustomerOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
eqIfPresent
(
CustomerOrderDO:
:
getHasScore
,
reqVO
.
getHasScore
())
.
orderByDesc
(
CustomerOrderDO:
:
getId
);
.
orderByDesc
(
CustomerOrderDO:
:
getId
);
if
(
CommonUtil
.
isNotBlank
(
reqVO
.
getCreateYearMonth
()))
{
if
(
CommonUtil
.
isNotBlank
(
reqVO
.
getCreateYearMonth
()))
{
String
createMonth
=
reqVO
.
getCreateYearMonth
().
trim
();
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 {
...
@@ -302,6 +302,7 @@ public class CheckTaskServiceImpl implements CheckTaskService, CheckTaskApi {
CheckTaskItemsSaveReqVO
item
=
new
CheckTaskItemsSaveReqVO
();
CheckTaskItemsSaveReqVO
item
=
new
CheckTaskItemsSaveReqVO
();
ProductSpuDO
productSpuDO
=
spuMap
.
get
(
purchaseOrderItem
.
getProductId
());
ProductSpuDO
productSpuDO
=
spuMap
.
get
(
purchaseOrderItem
.
getProductId
());
item
.
setProductId
(
purchaseOrderItem
.
getProductId
());
item
.
setProductId
(
purchaseOrderItem
.
getProductId
());
item
.
setProductName
(
productSpuDO
.
getName
());
item
.
setCategoryId
(
productSpuDO
.
getCategoryId
());
item
.
setCategoryId
(
productSpuDO
.
getCategoryId
());
item
.
setCategoryName
(
productCategoryService
.
queryNameById
(
productSpuDO
.
getCategoryId
()));
item
.
setCategoryName
(
productCategoryService
.
queryNameById
(
productSpuDO
.
getCategoryId
()));
item
.
setPicUrl
(
productSpuDO
.
getPicUrl
());
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 {
...
@@ -61,5 +61,7 @@ public interface CheckTaskItemsService {
*/
*/
PageResult
<
CheckTaskItemsDO
>
getCheckTaskItemsPage
(
CheckTaskItemsPageReqVO
pageReqVO
);
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
;
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.CheckTaskItemsPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.checktask.vo.CheckTaskItemsSaveReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.checktask.vo.CheckTaskItemsSaveReqVO
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -74,4 +76,23 @@ public class CheckTaskItemsServiceImpl implements CheckTaskItemsService {
...
@@ -74,4 +76,23 @@ public class CheckTaskItemsServiceImpl implements CheckTaskItemsService {
return
checkTaskItemsMapper
.
selectList
(
CheckTaskItemsDO:
:
getCheckTaskId
,
id
);
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;
...
@@ -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.api.CustomerOrderRecordApi
;
import
cn.iocoder.foodnexus.module.order.controller.admin.orderScore.vo.OrderScoreSaveReqVO
;
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.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.*
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderRemark
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderRemark
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customerorderitem.CustomerOrderItemDO
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customerorderitem.CustomerOrderItemDO
;
...
@@ -35,6 +36,7 @@ import cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus;
...
@@ -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.customeraddress.CustomerAddressService
;
import
cn.iocoder.foodnexus.module.order.service.customerorderitem.CustomerOrderItemService
;
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.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.InquireCustomerApi
;
import
cn.iocoder.foodnexus.module.product.api.dto.CustomerVisibleProductRespDTO
;
import
cn.iocoder.foodnexus.module.product.api.dto.CustomerVisibleProductRespDTO
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
...
@@ -44,6 +46,7 @@ import cn.iocoder.foodnexus.module.system.dal.dataobject.user.AdminUserDO;
...
@@ -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.service.user.AdminUserService
;
import
cn.iocoder.foodnexus.module.system.util.GenCodeUtils
;
import
cn.iocoder.foodnexus.module.system.util.GenCodeUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.apache.commons.compress.utils.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -135,6 +138,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
...
@@ -135,6 +138,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
private
AdminUserService
userService
;
private
AdminUserService
userService
;
@Autowired
@Autowired
private
ShoppingCartService
shoppingCartService
;
@Autowired
private
GenCodeUtils
genCodeUtils
;
private
GenCodeUtils
genCodeUtils
;
@Override
@Override
...
@@ -244,6 +250,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
...
@@ -244,6 +250,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
createOrder
.
setAddressInfo
(
BeanUtils
.
toBean
(
addressService
.
getCustomerAddress
(
createReqVO
.
getAddressId
()),
CustomerAddressInfo
.
class
));
createOrder
.
setAddressInfo
(
BeanUtils
.
toBean
(
addressService
.
getCustomerAddress
(
createReqVO
.
getAddressId
()),
CustomerAddressInfo
.
class
));
createOrder
.
setSupplierCount
(
supplierSet
.
size
());
createOrder
.
setSupplierCount
(
supplierSet
.
size
());
createOrder
.
setProductCount
(
procuctSet
.
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
);
AtomicReference
<
Integer
>
orderAmount
=
new
AtomicReference
<>(
0
);
List
<
CustomerOrderItemDO
>
collect
=
createReqVO
.
getOrderItems
().
stream
().
map
(
orderItem
->
{
List
<
CustomerOrderItemDO
>
collect
=
createReqVO
.
getOrderItems
().
stream
().
map
(
orderItem
->
{
...
@@ -254,6 +263,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
...
@@ -254,6 +263,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
item
.
setProductName
(
item
.
getProductInfo
().
getName
());
item
.
setProductName
(
item
.
getProductInfo
().
getName
());
item
.
setSignedQuantity
(
0
);
item
.
setSignedQuantity
(
0
);
item
.
setSignedTotal
(
0
);
item
.
setSignedTotal
(
0
);
if
(
shoppingMap
.
containsKey
(
orderItem
.
getProductId
()))
{
item
.
setCustomerRemark
(
shoppingMap
.
get
(
orderItem
.
getProductId
()).
getRemark
());
}
orderAmount
.
updateAndGet
(
v
->
v
+
item
.
getOrderItemTotal
());
orderAmount
.
updateAndGet
(
v
->
v
+
item
.
getOrderItemTotal
());
return
item
;
return
item
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
@@ -263,6 +275,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
...
@@ -263,6 +275,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
customerOrderId
=
this
.
createCustomerOrder
(
createOrder
);
customerOrderId
=
this
.
createCustomerOrder
(
createOrder
);
customerOrderItemService
.
createBatch
(
collect
,
customerOrderId
);
customerOrderItemService
.
createBatch
(
collect
,
customerOrderId
);
// 删除购物车中的同样商品的信息
shoppingCartService
.
deleteByProductId
(
loginUser
.
getId
(),
productIds
);
// 拆分采购订单
// 拆分采购订单
orderSplitPurchase
(
customerOrderId
);
orderSplitPurchase
(
customerOrderId
);
...
@@ -580,14 +595,12 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
...
@@ -580,14 +595,12 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
}
}
});
});
}
}
CustomerOrderDO
updateScore
=
new
CustomerOrderDO
();
if
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getOrderRemark
()))
{
if
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getOrderRemark
()))
{
reqVO
.
getOrderRemark
().
setOperTime
(
new
Date
());
reqVO
.
getOrderRemark
().
setOperTime
(
new
Date
());
customerOrderMapper
.
update
(
Wrappers
.<
CustomerOrderDO
>
lambdaUpdate
()
updateScore
.
setOrderRemark
(
reqVO
.
getOrderRemark
());
.
eq
(
CustomerOrderDO:
:
getId
,
id
)
.
set
(
CustomerOrderDO:
:
getOrderRemark
,
reqVO
.
getOrderRemark
()));
}
}
CustomerOrderDO
updateScore
=
new
CustomerOrderDO
();
updateScore
.
setId
(
id
);
updateScore
.
setId
(
id
);
updateScore
.
setHasScore
(
Boolean
.
TRUE
);
updateScore
.
setHasScore
(
Boolean
.
TRUE
);
customerOrderMapper
.
updateById
(
updateScore
);
customerOrderMapper
.
updateById
(
updateScore
);
...
@@ -741,4 +754,19 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
...
@@ -741,4 +754,19 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
.
set
(
CustomerOrderDO:
:
getOrderStatus
,
updateOrderStatus
)
.
set
(
CustomerOrderDO:
:
getOrderStatus
,
updateOrderStatus
)
.
eq
(
CustomerOrderDO:
:
getId
,
customerOrderId
));
.
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 {
...
@@ -64,4 +64,8 @@ public interface OrderScoreService {
boolean
exists
(
Long
orderId
,
Long
scoreId
);
boolean
exists
(
Long
orderId
,
Long
scoreId
);
PageResult
<
OrderScoreSupplierRespVO
>
supplierPage
(
OrderScoreSupplierPageReqVO
pageReqVO
);
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 {
...
@@ -181,6 +181,21 @@ public class OrderScoreServiceImpl implements OrderScoreService {
return
null
;
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
)
{
public
BigDecimal
divideInts
(
int
num1
,
int
num2
)
{
// 处理除数为0的情况
// 处理除数为0的情况
if
(
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 {
...
@@ -60,4 +60,7 @@ public interface ShoppingCartService {
*/
*/
PageResult
<
ShoppingCartDO
>
getShoppingCartPage
(
ShoppingCartPageReqVO
pageReqVO
);
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
;
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.ShoppingCartPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.shoppingcart.vo.ShoppingCartSaveReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.shoppingcart.vo.ShoppingCartSaveReqVO
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -32,6 +34,17 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
...
@@ -32,6 +34,17 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
@Override
@Override
public
Long
createShoppingCart
(
ShoppingCartSaveReqVO
createReqVO
)
{
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
);
ShoppingCartDO
shoppingCart
=
BeanUtils
.
toBean
(
createReqVO
,
ShoppingCartDO
.
class
);
shoppingCartMapper
.
insert
(
shoppingCart
);
shoppingCartMapper
.
insert
(
shoppingCart
);
...
@@ -80,4 +93,22 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
...
@@ -80,4 +93,22 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
return
shoppingCartMapper
.
selectPage
(
pageReqVO
);
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 {
...
@@ -40,6 +40,10 @@ public class ProductInfo implements Serializable {
*/
*/
private
Long
categoryId
;
private
Long
categoryId
;
/**
/**
* 分类名称
*/
private
String
categoryName
;
/**
* 商品封面图
* 商品封面图
*/
*/
private
String
picUrl
;
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 {
...
@@ -19,4 +19,7 @@ public class DeptListReqVO {
@Schema
(
description
=
"用户体系"
,
example
=
"1"
)
@Schema
(
description
=
"用户体系"
,
example
=
"1"
)
private
String
userSystem
;
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> {
...
@@ -16,6 +16,7 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
return
selectList
(
new
LambdaQueryWrapperX
<
DeptDO
>()
return
selectList
(
new
LambdaQueryWrapperX
<
DeptDO
>()
.
likeIfPresent
(
DeptDO:
:
getName
,
reqVO
.
getName
())
.
likeIfPresent
(
DeptDO:
:
getName
,
reqVO
.
getName
())
.
eqIfPresent
(
DeptDO:
:
getStatus
,
reqVO
.
getStatus
())
.
eqIfPresent
(
DeptDO:
:
getStatus
,
reqVO
.
getStatus
())
.
eqIfPresent
(
DeptDO:
:
getParentId
,
reqVO
.
getParentId
())
.
eqIfPresent
(
DeptDO:
:
getUserSystem
,
reqVO
.
getUserSystem
()));
.
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