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
f86e3c65
Commit
f86e3c65
authored
Nov 12, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug调整
parent
cc58b6b0
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
108 additions
and
31 deletions
+108
-31
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/ErpSaleOrderController.java
+1
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleOrderService.java
+2
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleOrderServiceImpl.java
+12
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleReturnService.java
+2
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleReturnServiceImpl.java
+25
-6
foodnexus-module-infra/src/main/java/cn/iocoder/foodnexus/module/infra/framework/file/core/utils/FileTypeUtils.java
+6
-5
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/supplier/SupplierPurchaseOrderController.java
+1
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/AppCustomerOrderReconciliationController.java
+20
-5
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerYearOrderPageReqVO.java
+3
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customerorder/CustomerOrderMapper.java
+8
-5
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/enums/ErrorCodeConstants.java
+1
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderService.java
+1
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
+17
-3
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/shoppingcart/ShoppingCartServiceImpl.java
+7
-1
foodnexus-module-mall/foodnexus-module-product/src/main/java/cn/iocoder/foodnexus/module/product/controller/app/spu/AppProductSpuController.java
+2
-2
No files found.
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/ErpSaleOrderController.java
View file @
f86e3c65
...
...
@@ -154,6 +154,7 @@ public class ErpSaleOrderController {
if
(
CommonUtil
.
isNotEmpty
(
saleOrderVO
.
getDeliveryStaffId
()))
{
saleOrderVO
.
setDeliveryStaffInfo
(
deliveryStaffApi
.
querybyStaffId
(
saleOrderVO
.
getDeliveryStaffId
()));
}
saleOrderVO
.
setCustomerName
(
Optional
.
ofNullable
(
customerService
.
getCustomer
(
saleOrderVO
.
getCustomerId
())).
map
(
ErpCustomerDO:
:
getName
).
orElse
(
""
));
saleOrderVO
.
setItems
(
BeanUtils
.
toBean
(
saleOrderItemList
,
ErpSaleOrderRespVO
.
Item
.
class
,
item
->
{
MapUtils
.
findAndThen
(
supplierMap
,
item
.
getSupplierId
(),
item:
:
setSupplierName
);
MapUtils
.
findAndThen
(
purchaseOrderMap
,
item
.
getPurchaseOrderId
(),
purchaseOrder
->
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleOrderService.java
View file @
f86e3c65
...
...
@@ -163,4 +163,5 @@ public interface ErpSaleOrderService {
*/
List
<
DeliveryStatusCountRespVO
>
statusCount
(
Long
userId
,
Set
<
Long
>
deptIds
);
void
update
(
ErpSaleOrderDO
updateSaleOrder
,
List
<
ErpSaleOrderItemDO
>
updateSaleOrderItems
);
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleOrderServiceImpl.java
View file @
f86e3c65
...
...
@@ -700,4 +700,16 @@ public class ErpSaleOrderServiceImpl implements ErpSaleOrderService {
return
result
;
}
@Override
public
void
update
(
ErpSaleOrderDO
updateSaleOrder
,
List
<
ErpSaleOrderItemDO
>
updateSaleOrderItems
)
{
saleOrderMapper
.
updateById
(
updateSaleOrder
);
if
(
CommonUtil
.
isNotEmpty
(
updateSaleOrderItems
))
{
saleOrderItemMapper
.
updateBatch
(
updateSaleOrderItems
);
}
else
{
saleOrderItemMapper
.
update
(
Wrappers
.<
ErpSaleOrderItemDO
>
lambdaUpdate
()
.
set
(
ErpSaleOrderItemDO:
:
getPickUpStatus
,
updateSaleOrder
.
getPickUpStatus
())
.
eq
(
ErpSaleOrderItemDO:
:
getOrderId
,
updateSaleOrder
.
getId
()));
}
}
}
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleReturnService.java
View file @
f86e3c65
...
...
@@ -105,9 +105,9 @@ public interface ErpSaleReturnService {
*/
ErpSaleReturnDO
queryByCustomerOrderId
(
Long
id
);
void
accept
(
Long
i
d
,
Long
deliveryStaffId
);
void
accept
(
Long
saleOrderI
d
,
Long
deliveryStaffId
);
void
delivery
(
Long
i
d
,
Long
deliveryStaffId
);
void
delivery
(
Long
saleOrderI
d
,
Long
deliveryStaffId
);
void
arrival
(
DeliveryOrderUpdateReqVO
reqVO
,
Long
aLong
);
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleReturnServiceImpl.java
View file @
f86e3c65
...
...
@@ -257,6 +257,12 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
customerOrderApi
.
updateActualAmount
(
saleReturn
.
getCustomerOrderId
(),
-
returnsTotal
);
customerOrderApi
.
updateItems
(
updateItems
);
// 销售订单状态变更
ErpSaleOrderDO
updateSaleOrder
=
new
ErpSaleOrderDO
();
updateSaleOrder
.
setId
(
saleReturn
.
getOrderId
());
updateSaleOrder
.
setPickUpStatus
(
RETURNS_APPROVE
);
saleOrderService
.
update
(
updateSaleOrder
,
null
);
// TODO 退款确认后才进行库存变更
/*Integer bizType = approve ? ErpStockRecordBizTypeEnum.SALE_RETURN.getType()
: ErpStockRecordBizTypeEnum.SALE_RETURN_CANCEL.getType();
...
...
@@ -419,6 +425,19 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
return
saleReturn
;
}
private
ErpSaleReturnDO
validateBySaleOrderId
(
Long
saleOrderId
)
{
ErpSaleReturnDO
saleReturn
=
saleReturnMapper
.
selectOne
(
Wrappers
.<
ErpSaleReturnDO
>
lambdaQuery
()
.
eq
(
ErpSaleReturnDO:
:
getOrderId
,
saleOrderId
)
.
last
(
"LIMIT 1"
));
if
(
saleReturn
==
null
)
{
throw
exception
(
SALE_RETURN_NOT_EXISTS
);
}
if
(
ObjectUtil
.
notEqual
(
saleReturn
.
getStatus
(),
ErpAuditStatus
.
APPROVE
.
getStatus
()))
{
throw
exception
(
SALE_RETURN_NOT_APPROVE
);
}
return
saleReturn
;
}
@Override
public
PageResult
<
ErpSaleReturnDO
>
getSaleReturnPage
(
ErpSaleReturnPageReqVO
pageReqVO
)
{
return
saleReturnMapper
.
selectPage
(
pageReqVO
);
...
...
@@ -454,9 +473,9 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
accept
(
Long
i
d
,
Long
deliveryStaffId
)
{
ErpSale
ReturnDO
saleReturn
=
validateSaleReturn
(
i
d
);
ErpSale
OrderDO
saleOrder
=
saleOrderService
.
validateSaleOrder
(
saleReturn
.
getOrderId
()
);
public
void
accept
(
Long
saleOrderI
d
,
Long
deliveryStaffId
)
{
ErpSale
OrderDO
saleOrder
=
saleOrderService
.
validateSaleOrder
(
saleOrderI
d
);
ErpSale
ReturnDO
saleReturn
=
validateBySaleOrderId
(
saleOrderId
);
if
(!
saleReturn
.
getReturnsStatus
().
equals
(
RETURNS_APPROVE
.
getType
())
||
!
saleOrder
.
getPickUpStatus
().
equals
(
RETURNS_APPROVE
))
{
throw
exception
(
SALE_ORDER_PICKUP_STATUS_FAIL
);
...
...
@@ -490,9 +509,9 @@ public class ErpSaleReturnServiceImpl implements ErpSaleReturnService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
delivery
(
Long
i
d
,
Long
deliveryStaffId
)
{
ErpSale
ReturnDO
saleReturn
=
validateSaleReturn
(
i
d
);
ErpSale
OrderDO
saleOrder
=
saleOrderService
.
validateSaleOrder
(
saleReturn
.
getOrderId
()
);
public
void
delivery
(
Long
saleOrderI
d
,
Long
deliveryStaffId
)
{
ErpSale
OrderDO
saleOrder
=
saleOrderService
.
validateSaleOrder
(
saleOrderI
d
);
ErpSale
ReturnDO
saleReturn
=
validateBySaleOrderId
(
saleOrderId
);
if
(!
saleReturn
.
getReturnsStatus
().
equals
(
RETURNS_STAFF_ACCEPT
.
getType
())
||
!
saleOrder
.
getPickUpStatus
().
equals
(
RETURNS_STAFF_ACCEPT
))
{
throw
exception
(
SALE_ORDER_PICKUP_STATUS_FAIL
);
...
...
foodnexus-module-infra/src/main/java/cn/iocoder/foodnexus/module/infra/framework/file/core/utils/FileTypeUtils.java
View file @
f86e3c65
...
...
@@ -86,15 +86,16 @@ public class FileTypeUtils {
if
(
StrUtil
.
containsIgnoreCase
(
contentType
,
"image/"
))
{
// 参见 https://github.com/YunaiV/ruoyi-vue-pro/issues/692 讨论
response
.
setHeader
(
"Content-Disposition"
,
"inline;filename="
+
HttpUtils
.
encodeUtf8
(
filename
));
}
else
{
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
HttpUtils
.
encodeUtf8
(
filename
));
}
// 针对 video 的特殊处理,解决视频地址在移动端播放的兼容性问题
if
(
StrUtil
.
containsIgnoreCase
(
contentType
,
"video"
))
{
}
// 针对 video 的特殊处理,解决视频地址在移动端播放的兼容性问题
else
if
(
StrUtil
.
containsIgnoreCase
(
contentType
,
"video"
))
{
response
.
setHeader
(
"Content-Disposition"
,
"inline;filename="
+
HttpUtils
.
encodeUtf8
(
filename
));
response
.
setHeader
(
"Content-Length"
,
String
.
valueOf
(
content
.
length
));
response
.
setHeader
(
"Content-Range"
,
"bytes 0-"
+
(
content
.
length
-
1
)
+
"/"
+
content
.
length
);
response
.
setHeader
(
"Accept-Ranges"
,
"bytes"
);
}
else
{
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
HttpUtils
.
encodeUtf8
(
filename
));
}
// 输出附件
IoUtil
.
write
(
response
.
getOutputStream
(),
false
,
content
);
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/supplier/SupplierPurchaseOrderController.java
View file @
f86e3c65
...
...
@@ -98,9 +98,9 @@ public class SupplierPurchaseOrderController {
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
.
setPayablePrice
(
CommonUtil
.
getEls
(
purchaseOrder
.
getSignedTotal
(),
0
)
-
CommonUtil
.
getEls
(
purchaseOrder
.
getReturnsTotal
(),
0
));
purchaseOrder
.
setSupplierName
(
customerOrderItemDOS
.
get
(
0
).
getSupplierName
());
StringBuilder
productNames
=
new
StringBuilder
();
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/AppCustomerOrderReconciliationController.java
View file @
f86e3c65
...
...
@@ -50,9 +50,15 @@ public class AppCustomerOrderReconciliationController {
@GetMapping
(
"/page-year"
)
@Operation
(
summary
=
"分页获取月度账单(按年份)"
)
public
CommonResult
<
AppCustomerMonthOrderRespVO
>
pageYear
(
@Valid
AppCustomerYearOrderPageReqVO
reqVO
)
{
reqVO
.
setDeptIds
(
customerApi
.
queryCustomerDeptIdsByUserId
(
getLoginUserId
()));
if
(
CommonUtil
.
isEmpty
(
reqVO
.
getDeptIds
()))
{
return
success
(
null
);
// reqVO.setDeptIds(customerApi.queryCustomerDeptIdsByUserId(getLoginUserId()));
Pair
<
Boolean
,
Set
<
Long
>>
pair
=
customerApi
.
queryCustomerOrUserByUserId
(
getLoginUserId
());
if
(
pair
.
getKey
())
{
if
(
CommonUtil
.
isEmpty
(
pair
.
getValue
()))
{
return
success
(
null
);
}
reqVO
.
setDeptIds
(
pair
.
getValue
());
}
else
{
reqVO
.
setCreator
(
getLoginUserId
());
}
return
success
(
customerOrderService
.
reconciliationPageYear
(
reqVO
));
}
...
...
@@ -61,8 +67,17 @@ public class AppCustomerOrderReconciliationController {
@Operation
(
summary
=
"分页获取客户订单(按月份)"
)
@Parameter
(
name
=
"yearMonth"
,
description
=
"年月(yyyy-MM)"
,
required
=
true
)
public
CommonResult
<
AppCustomerMonthOrderTotalRespVO
>
monthTotal
(
@RequestParam
(
"yearMonth"
)
String
yearMonth
)
{
Set
<
Long
>
deptIds
=
customerApi
.
queryCustomerDeptIdsByUserId
(
getLoginUserId
());
return
success
(
customerOrderService
.
monthTotal
(
yearMonth
,
deptIds
));
// Set<Long> deptIds = customerApi.queryCustomerDeptIdsByUserId(getLoginUserId());
Pair
<
Boolean
,
Set
<
Long
>>
pair
=
customerApi
.
queryCustomerOrUserByUserId
(
getLoginUserId
());
if
(
pair
.
getKey
())
{
if
(
CommonUtil
.
isEmpty
(
pair
.
getValue
()))
{
return
success
(
null
);
}
return
success
(
customerOrderService
.
monthTotal
(
yearMonth
,
pair
.
getValue
(),
null
));
}
else
{
return
success
(
customerOrderService
.
monthTotal
(
yearMonth
,
null
,
getLoginUserId
()));
}
}
@PostMapping
(
"/confirm"
)
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerYearOrderPageReqVO.java
View file @
f86e3c65
...
...
@@ -25,6 +25,9 @@ public class AppCustomerYearOrderPageReqVO extends PageParam {
@Schema
(
description
=
"客户灶点集合"
,
hidden
=
true
)
private
Set
<
Long
>
deptIds
;
@Schema
(
description
=
"用户id"
,
hidden
=
true
)
private
Long
creator
;
/*@Schema(description = "月份(1-12)")
@Max(value = 12, message = "异常月份")
@Min(value = 1, message = "异常月份")
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customerorder/CustomerOrderMapper.java
View file @
f86e3c65
...
...
@@ -89,7 +89,7 @@ public interface CustomerOrderMapper extends BaseMapperX<CustomerOrderDO> {
return
this
.
selectMaps
(
queryWrapper
);
}
default
AppCustomerMonthOrderRespVO
reconciliationPageYearTotal
(
String
year
,
Set
<
Long
>
deptIds
)
{
default
AppCustomerMonthOrderRespVO
reconciliationPageYearTotal
(
String
year
,
Set
<
Long
>
deptIds
,
Long
creator
)
{
year
=
year
.
trim
();
String
begin
=
year
+
"-01-01 00:00:00"
;
String
end
=
year
+
"-12-31 23:59:59"
;
...
...
@@ -99,7 +99,8 @@ public interface CustomerOrderMapper extends BaseMapperX<CustomerOrderDO> {
queryWrapperX
.
in
(
"order_status"
,
CommonUtil
.
asList
(
CustomerOrderStatus
.
SIGN_RECEIPT
.
getKey
(),
CustomerOrderStatus
.
FINISH
.
getKey
(),
CustomerOrderStatus
.
RETURN
.
getKey
()));
queryWrapperX
.
in
(
"customer_dept_id"
,
deptIds
);
queryWrapperX
.
in
(
CommonUtil
.
isNotEmpty
(
deptIds
),
"customer_dept_id"
,
deptIds
);
queryWrapperX
.
eq
(
CommonUtil
.
isNotEmpty
(
creator
),
"creator"
,
creator
);
return
this
.
selectJoinOne
(
AppCustomerMonthOrderRespVO
.
class
,
queryWrapperX
);
}
...
...
@@ -114,14 +115,15 @@ public interface CustomerOrderMapper extends BaseMapperX<CustomerOrderDO> {
queryWrapperX
.
in
(
"order_status"
,
CommonUtil
.
asList
(
CustomerOrderStatus
.
SIGN_RECEIPT
.
getKey
(),
CustomerOrderStatus
.
FINISH
.
getKey
(),
CustomerOrderStatus
.
RETURN
.
getKey
()));
queryWrapperX
.
in
(
"customer_dept_id"
,
reqVO
.
getDeptIds
());
queryWrapperX
.
in
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getDeptIds
()),
"customer_dept_id"
,
reqVO
.
getDeptIds
());
queryWrapperX
.
eq
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getCreator
()),
"creator"
,
reqVO
.
getCreator
());
queryWrapperX
.
groupBy
(
"DATE_FORMAT(create_time, '%Y-%m') "
);
queryWrapperX
.
orderByDesc
(
"id"
);
return
this
.
selectJoinPage
(
reqVO
,
AppCustomerMonthOrderRespVO
.
MonthItems
.
class
,
queryWrapperX
);
}
default
AppCustomerMonthOrderTotalRespVO
reconciliationMonthTotal
(
String
yearMonth
,
Set
<
Long
>
deptIds
)
{
default
AppCustomerMonthOrderTotalRespVO
reconciliationMonthTotal
(
String
yearMonth
,
Set
<
Long
>
deptIds
,
Long
creator
)
{
String
createMonth
=
yearMonth
.
trim
();
String
startOfMonth
=
createMonth
+
"-01 00:00:00"
;
String
[]
parts
=
createMonth
.
split
(
"-"
);
...
...
@@ -137,7 +139,8 @@ public interface CustomerOrderMapper extends BaseMapperX<CustomerOrderDO> {
queryWrapperX
.
in
(
"order_status"
,
CommonUtil
.
asList
(
CustomerOrderStatus
.
SIGN_RECEIPT
.
getKey
(),
CustomerOrderStatus
.
FINISH
.
getKey
(),
CustomerOrderStatus
.
RETURN
.
getKey
()));
queryWrapperX
.
in
(
"customer_dept_id"
,
deptIds
);
queryWrapperX
.
in
(
CommonUtil
.
isNotEmpty
(
deptIds
),
"customer_dept_id"
,
deptIds
);
queryWrapperX
.
eq
(
CommonUtil
.
isNotEmpty
(
creator
),
"creator"
,
creator
);
queryWrapperX
.
orderByDesc
(
"id"
);
return
this
.
selectJoinOne
(
AppCustomerMonthOrderTotalRespVO
.
class
,
queryWrapperX
);
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/enums/ErrorCodeConstants.java
View file @
f86e3c65
...
...
@@ -11,6 +11,7 @@ public interface ErrorCodeConstants {
// ========== 购物车 1_018-000-000 ==========
ErrorCode
SHOPPING_CART_NOT_EXISTS
=
new
ErrorCode
(
1_018_100_000
,
"购物车不存在"
);
ErrorCode
PRODUCT_DISABLE
=
new
ErrorCode
(
1_018_100_001
,
"商品【{}】已下架"
);
ErrorCode
PRODUCT_NO_EXISTS
=
new
ErrorCode
(
1_018_100_002
,
"商品不存在"
);
// ========== 客户总订单 1_019_100_0001 ==========
ErrorCode
CUSTOMER_ORDER_NOT_EXISTS
=
new
ErrorCode
(
1_019_100_001
,
"客户总订单不存在"
);
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderService.java
View file @
f86e3c65
...
...
@@ -130,7 +130,7 @@ public interface CustomerOrderService {
* @param yearMonth
* @return
*/
AppCustomerMonthOrderTotalRespVO
monthTotal
(
String
yearMonth
,
Set
<
Long
>
deptIds
);
AppCustomerMonthOrderTotalRespVO
monthTotal
(
String
yearMonth
,
Set
<
Long
>
deptIds
,
Long
creator
);
/**
* 对账确认
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
View file @
f86e3c65
...
...
@@ -524,7 +524,14 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
returnSaveReqVO
.
setWarehouseInfo
(
saleOrderDO
.
getWarehouseInfo
());
returnSaveReqVO
.
setAddressId
(
saleOrderDO
.
getAddressId
());
returnSaveReqVO
.
setAddressInfo
(
saleOrderDO
.
getAddressInfo
());
// 更新销售订单
ErpSaleOrderDO
updateSaleOrder
=
new
ErpSaleOrderDO
();
updateSaleOrder
.
setId
(
saleOrderDO
.
getId
());
updateSaleOrder
.
setPickUpStatus
(
SaleOrderPickUpStatus
.
RETURNS_PROCESS
);
List
<
ErpSaleReturnSaveReqVO
.
Item
>
items
=
new
ArrayList
<>(
reqVO
.
getOrderItems
().
size
());
List
<
ErpSaleOrderItemDO
>
updateSaleOrderItems
=
new
ArrayList
<>(
reqVO
.
getOrderItems
().
size
());
for
(
AppCustomerReturnOrderReqVO
.
ReturnItems
item
:
reqVO
.
getOrderItems
())
{
CustomerOrderItemDO
customerOrderItemDO
=
orderItemMap
.
get
(
item
.
getCustomerOrderItemId
());
if
(!
Objects
.
equals
(
customerOrderItemDO
.
getProductId
(),
item
.
getProductId
()))
{
...
...
@@ -532,6 +539,9 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
}
ErpSaleReturnSaveReqVO
.
Item
returnItem
=
new
ErpSaleReturnSaveReqVO
.
Item
();
ErpSaleOrderItemDO
saleOrderItemDO
=
saleOrderService
.
queryItemByCustomerOrderItemId
(
customerOrderItemDO
.
getId
());
ErpSaleOrderItemDO
updateSaleOrderitem
=
new
ErpSaleOrderItemDO
();
updateSaleOrderitem
.
setId
(
saleOrderItemDO
.
getId
());
updateSaleOrderitem
.
setPickUpStatus
(
SaleOrderPickUpStatus
.
RETURNS_PROCESS
);
if
(
customerOrderItemDO
.
getSignedQuantity
()
-
CommonUtil
.
getEls
(
customerOrderItemDO
.
getReturnsQuantity
(),
0
)
<
item
.
getReturnCount
())
{
throw
exception
(
CUSTOMER_ORDER_RETURN_COUNT_ERROR
,
customerOrderItemDO
.
getProductName
());
...
...
@@ -547,9 +557,13 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
returnItem
.
setRemark
(
item
.
getRemark
());
returnItem
.
setSupplierId
(
customerOrderItemDO
.
getSupplierId
());
items
.
add
(
returnItem
);
updateSaleOrderItems
.
add
(
updateSaleOrderitem
);
}
returnSaveReqVO
.
setItems
(
items
);
saleReturnService
.
createSaleReturn
(
returnSaveReqVO
);
saleOrderService
.
update
(
updateSaleOrder
,
updateSaleOrderItems
);
}
finally
{
RedisUtils
.
unLockRds
(
lock
);
}
...
...
@@ -660,7 +674,7 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
*/
@Override
public
AppCustomerMonthOrderRespVO
reconciliationPageYear
(
AppCustomerYearOrderPageReqVO
reqVO
)
{
AppCustomerMonthOrderRespVO
respVO
=
customerOrderMapper
.
reconciliationPageYearTotal
(
reqVO
.
getYear
(),
reqVO
.
getDeptIds
());
AppCustomerMonthOrderRespVO
respVO
=
customerOrderMapper
.
reconciliationPageYearTotal
(
reqVO
.
getYear
(),
reqVO
.
getDeptIds
()
,
reqVO
.
getCreator
()
);
if
(
CommonUtil
.
isNotEmpty
(
respVO
))
{
respVO
.
setPageResult
(
customerOrderMapper
.
reconciliationPageYearPage
(
reqVO
));
}
...
...
@@ -674,8 +688,8 @@ public class CustomerOrderServiceImpl implements CustomerOrderService, CustomerO
* @return
*/
@Override
public
AppCustomerMonthOrderTotalRespVO
monthTotal
(
String
yearMonth
,
Set
<
Long
>
deptIds
)
{
return
customerOrderMapper
.
reconciliationMonthTotal
(
yearMonth
,
deptIds
);
public
AppCustomerMonthOrderTotalRespVO
monthTotal
(
String
yearMonth
,
Set
<
Long
>
deptIds
,
Long
loginUserId
)
{
return
customerOrderMapper
.
reconciliationMonthTotal
(
yearMonth
,
deptIds
,
loginUserId
);
}
@Override
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/shoppingcart/ShoppingCartServiceImpl.java
View file @
f86e3c65
...
...
@@ -77,12 +77,18 @@ public class ShoppingCartServiceImpl implements ShoppingCartService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
createBatch
(
ShoppingCartSaveBatchReqVO
createReqVO
)
{
List
<
ProductSpuDO
>
spuList
=
productSpuService
.
getSpuList
(
CommonUtil
.
listConvert
(
createReqVO
.
getItems
(),
ShoppingCartSaveReqVO:
:
getProductId
));
if
(
CommonUtil
.
isEmpty
(
spuList
))
{
throw
exception
(
PRODUCT_NO_EXISTS
);
}
List
<
ProductSpuDO
>
collect
=
spuList
.
stream
().
filter
(
item
->
ProductSpuStatusEnum
.
isEnable
(
item
.
getStatus
())).
toList
();
if
(
CommonUtil
.
isEmpty
(
collect
))
{
throw
exception
(
PRODUCT_DISABLE
,
String
.
join
(
","
,
CommonUtil
.
listConvertSet
(
createReqVO
.
getItems
(),
ShoppingCartSaveReqVO:
:
getProductName
)));
}
List
<
Long
>
productIds
=
CommonUtil
.
listConvert
(
collect
,
ProductSpuDO:
:
getId
);
for
(
ShoppingCartSaveReqVO
item
:
createReqVO
.
getItems
())
{
this
.
createShoppingCart
(
item
);
if
(
productIds
.
contains
(
item
.
getProductId
()))
{
this
.
createShoppingCart
(
item
);
}
}
}
...
...
foodnexus-module-mall/foodnexus-module-product/src/main/java/cn/iocoder/foodnexus/module/product/controller/app/spu/AppProductSpuController.java
View file @
f86e3c65
...
...
@@ -79,9 +79,9 @@ public class AppProductSpuController {
if
(
spu
==
null
)
{
throw
exception
(
SPU_NOT_EXISTS
);
}
if
(!
ProductSpuStatusEnum
.
isEnable
(
spu
.
getStatus
()))
{
/*
if (!ProductSpuStatusEnum.isEnable(spu.getStatus())) {
throw exception(SPU_NOT_ENABLE, spu.getName());
}
}
*/
// 增加浏览量
productSpuService
.
updateBrowseCount
(
id
,
1
);
...
...
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