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
a9cea543
Commit
a9cea543
authored
Oct 11, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流程推进至商品评价;
parent
dfdb4183
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
99 changed files
with
2410 additions
and
268 deletions
+2410
-268
foodnexus-module-erp-api/src/main/java/cn/iocoder/foodnexus/module/erp/api/enums/ErpDeliveryStatus.java
+1
-0
foodnexus-module-erp-api/src/main/java/cn/iocoder/foodnexus/module/erp/api/service/ErpCustomerApi.java
+1
-1
foodnexus-module-erp-api/src/main/java/cn/iocoder/foodnexus/module/erp/api/service/ErpSupplierApi.java
+1
-1
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpSupplierController.java
+31
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderPageReqVO.java
+4
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderRespVO.java
+3
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/SupplierMonthOrderDetailsRespVO.java
+41
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/SupplierMonthOrderPageReqVO.java
+18
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/SupplierMonthOrderRespVO.java
+29
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/ErpCustomerController.java
+8
-7
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/vo/customer/ErpCustomerRespVO.java
+6
-1
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/stock/ErpWarehouseController.java
+10
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/purchase/ErpPurchaseOrderMapper.java
+25
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/stock/ErpWarehouseMapper.java
+6
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/enums/ErrorCodeConstants.java
+1
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/customerwarehouse/CustomerWarehouseService.java
+3
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/customerwarehouse/CustomerWarehouseServiceImpl.java
+6
-4
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderService.java
+5
-0
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderServiceImpl.java
+8
-6
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpSupplierServiceImpl.java
+2
-2
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpCustomerService.java
+4
-3
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpCustomerServiceImpl.java
+10
-8
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleOrderServiceImpl.java
+10
-4
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleOutServiceImpl.java
+4
-4
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/stock/ErpWarehouseService.java
+1
-1
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/stock/ErpWarehouseServiceImpl.java
+2
-2
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/CustomerRequireController.java
+99
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequirePageReqVO.java
+43
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequireRespVO.java
+55
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequireSaveReqVO.java
+29
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/inquirepriceitem/vo/InquirePriceItemRespVO.java
+3
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/inquiresupplierpush/InquireSupplierPushController.java
+28
-38
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/inquiresupplierpush/vo/AppInquireSupplierPushConfirmReqVO.java
+1
-1
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/inquiresupplierpush/vo/AppInquireSupplierPushDetailsRespVO.java
+1
-2
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/inquiresupplierpush/vo/AppInquireSupplierPushPageReqVO.java
+1
-1
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/inquiresupplierpush/vo/AppInquireSupplierPushRespVO.java
+1
-1
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/scoringweight/ScoringWeightController.java
+105
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/scoringweight/vo/ScoringWeightPageReqVO.java
+37
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/scoringweight/vo/ScoringWeightRespVO.java
+48
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/scoringweight/vo/ScoringWeightSaveReqVO.java
+40
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/customerrequire/AppCustomerRequireController.java
+79
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/inquirecustomerpush/AppInquireCustomerPushController.java
+9
-1
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/inquiresupplierpush/AppInquireSupplierPushController.java
+0
-77
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/dataobject/customerrequire/CustomerRequireDO.java
+57
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/dataobject/scoringweight/ScoringWeightDO.java
+56
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/customerrequire/CustomerRequireMapper.java
+34
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/inquirecustomerpush/InquireCustomerPushMapper.java
+18
-14
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/inquiresupplierpush/InquireSupplierPushMapper.java
+2
-2
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/scoringweight/ScoringWeightMapper.java
+32
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/enums/ErrorCodeConstants.java
+6
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/customerrequire/CustomerRequireService.java
+64
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/customerrequire/CustomerRequireServiceImpl.java
+101
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/inquirepriceitem/InquirePriceItemService.java
+1
-2
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/inquirepriceitem/InquirePriceItemServiceImpl.java
+1
-7
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/inquiresupplierpush/InquireSupplierPushService.java
+3
-4
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/inquiresupplierpush/InquireSupplierPushServiceImpl.java
+3
-10
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/scoringweight/ScoringWeightService.java
+66
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/scoringweight/ScoringWeightServiceImpl.java
+96
-0
foodnexus-module-mall/foodnexus-module-order-api/pom.xml
+6
-0
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/dto/CustomerOrderRemark.java
+2
-1
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/enums/CustomerOrderStatus.java
+6
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/CheckTaskController.java
+8
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/vo/CheckTaskRespVO.java
+4
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderPageReqVO.java
+11
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorder/vo/CustomerOrderRespVO.java
+9
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorderitem/vo/CustomerOrderItemRespVO.java
+8
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/orderScore/OrderScoreController.java
+105
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/orderScore/vo/OrderScorePageReqVO.java
+39
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/orderScore/vo/OrderScoreRespVO.java
+48
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/orderScore/vo/OrderScoreSaveReqVO.java
+42
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/supplier/SupplierPurchaseOrderController.java
+96
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/AppCustomerOrderController.java
+32
-5
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderScoreReqVO.java
+46
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderScoreRespVO.java
+37
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/delivery/DeliveryOrderController.java
+14
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorderitem/CustomerOrderItemDO.java
+9
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/orderScore/OrderScoreDO.java
+63
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customerorder/CustomerOrderMapper.java
+13
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/orderScore/OrderScoreMapper.java
+33
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/enums/ErrorCodeConstants.java
+5
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktask/CheckTaskServiceImpl.java
+3
-2
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktaskitems/CheckTaskItemsService.java
+2
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktaskitems/CheckTaskItemsServiceImpl.java
+6
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderService.java
+17
-3
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderServiceImpl.java
+114
-11
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorderitem/CustomerOrderItemService.java
+7
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorderitem/CustomerOrderItemServiceImpl.java
+11
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/orderScore/OrderScoreService.java
+67
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/orderScore/OrderScoreServiceImpl.java
+102
-0
foodnexus-module-mall/foodnexus-module-product/src/main/java/cn/iocoder/foodnexus/module/product/service/spu/ProductSpuService.java
+7
-0
foodnexus-module-mall/foodnexus-module-product/src/main/java/cn/iocoder/foodnexus/module/product/service/spu/ProductSpuServiceImpl.java
+10
-0
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/aspect/AppSystemAspect.java
+27
-21
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/controller/admin/dept/DeptController.java
+3
-7
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/controller/admin/dept/vo/dept/DeptSaveRespVO.java
+23
-0
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/enums/ErrorCodeConstants.java
+1
-0
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/service/dept/DeptService.java
+2
-1
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/service/dept/DeptServiceImpl.java
+9
-4
foodnexus-module-system/src/test/java/cn/iocoder/foodnexus/module/system/service/dept/DeptServiceImplTest.java
+1
-1
No files found.
foodnexus-module-erp-api/src/main/java/cn/iocoder/foodnexus/module/erp/api/enums/ErpDeliveryStatus.java
View file @
a9cea543
...
...
@@ -17,6 +17,7 @@ public enum ErpDeliveryStatus implements ArrayValuable<String> {
NOT_YET
(
"NOT_YET"
,
"未发货"
),
ALREADY
(
"ALREADY"
,
"已发货"
),
ARRIVAL
(
"ARRIVAL"
,
"已到货"
),
RECONCILIATION
(
"RECONCILIATION"
,
"已对账"
),
;
public
static
final
String
[]
ARRAYS
=
Arrays
.
stream
(
values
()).
map
(
ErpDeliveryStatus:
:
getStatus
).
toArray
(
String
[]::
new
);
...
...
foodnexus-module-erp-api/src/main/java/cn/iocoder/foodnexus/module/erp/api/service/ErpCustomerApi.java
View file @
a9cea543
...
...
@@ -15,7 +15,7 @@ import java.util.Map;
@Valid
public
interface
ErpCustomerApi
{
void
createByDept
(
Long
deptId
,
@Valid
@NotNull
(
message
=
"客户信息不能为空"
)
CustomerAddReqVO
customerAddReqVO
);
Long
createByDept
(
Long
deptId
,
@Valid
@NotNull
(
message
=
"客户信息不能为空"
)
CustomerAddReqVO
customerAddReqVO
);
void
updateByDept
(
Long
deptId
,
@Valid
@NotNull
(
message
=
"客户信息不能为空"
)
CustomerAddReqVO
customerAddReqVO
);
...
...
foodnexus-module-erp-api/src/main/java/cn/iocoder/foodnexus/module/erp/api/service/ErpSupplierApi.java
View file @
a9cea543
...
...
@@ -15,7 +15,7 @@ import java.util.Map;
*/
public
interface
ErpSupplierApi
{
void
createByDept
(
Long
deptId
,
@Valid
@NotNull
(
message
=
"供应商不能为空"
)
SupplierAddReqVO
supplier
);
Long
createByDept
(
Long
deptId
,
@Valid
@NotNull
(
message
=
"供应商不能为空"
)
SupplierAddReqVO
supplier
);
void
updateByDept
(
Long
deptId
,
@Valid
@NotNull
(
message
=
"供应商不能为空"
)
SupplierAddReqVO
supplier
);
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/ErpSupplierController.java
View file @
a9cea543
...
...
@@ -2,22 +2,28 @@ package cn.iocoder.foodnexus.module.erp.controller.admin.purchase;
import
cn.iocoder.foodnexus.framework.apilog.core.annotation.ApiAccessLog
;
import
cn.iocoder.foodnexus.framework.common.enums.CommonStatusEnum
;
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.object.BeanUtils
;
import
cn.iocoder.foodnexus.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.supplier.ErpProductSupplierBindReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.supplier.ErpSupplierPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.supplier.ErpSupplierRespVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.supplier.ErpSupplierSaveReqVO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpSupplierDO
;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpSupplierService
;
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.annotation.Resource
;
import
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -38,6 +44,9 @@ public class ErpSupplierController {
@Resource
private
ErpSupplierService
supplierService
;
@Autowired
private
ErpSupplierApi
supplierApi
;
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建供应商"
)
@PreAuthorize
(
"@ss.hasPermission('erp:supplier:create')"
)
...
...
@@ -71,6 +80,13 @@ public class ErpSupplierController {
return
success
(
BeanUtils
.
toBean
(
supplier
,
ErpSupplierRespVO
.
class
));
}
@PostMapping
(
"/bind-product"
)
@Operation
(
summary
=
"供应商绑定商品"
)
public
CommonResult
<
Boolean
>
bindProduct
(
@Valid
@RequestBody
ErpProductSupplierBindReqVO
reqVO
)
{
supplierService
.
bindProduct
(
reqVO
);
return
success
(
Boolean
.
TRUE
);
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得供应商分页"
)
@PreAuthorize
(
"@ss.hasPermission('erp:supplier:query')"
)
...
...
@@ -88,6 +104,21 @@ public class ErpSupplierController {
.
setName
(
supplier
.
getName
())));
}
@AppSystemAuth
(
UserSystemEnum
.
SUPPLIER
)
@GetMapping
(
"/get-supplier-info-by-user"
)
@Operation
(
summary
=
"根据用户获取对应供应商信息"
)
public
CommonResult
<
ErpSupplierRespVO
>
getSupplierInfo
()
{
ErpSupplierDO
supplier
=
supplierService
.
getSupplier
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
return
success
(
BeanUtils
.
toBean
(
supplier
,
ErpSupplierRespVO
.
class
));
}
@AppSystemAuth
(
UserSystemEnum
.
SUPPLIER
)
@GetMapping
(
"/get-supplier-id-by-user"
)
@Operation
(
summary
=
"根据用户获取对应供应商id"
)
public
CommonResult
<
Long
>
getSupplierId
()
{
return
success
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
}
@GetMapping
(
"/export-excel"
)
@Operation
(
summary
=
"导出供应商 Excel"
)
@PreAuthorize
(
"@ss.hasPermission('erp:supplier:export')"
)
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderPageReqVO.java
View file @
a9cea543
...
...
@@ -77,4 +77,7 @@ public class ErpPurchaseOrderPageReqVO extends PageParam {
@Schema
(
description
=
"是否可退货"
,
example
=
"true"
)
private
Boolean
returnEnable
;
@Schema
(
description
=
"创建月份 yyyy-MM"
)
private
String
createMonth
;
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/ErpPurchaseOrderRespVO.java
View file @
a9cea543
...
...
@@ -101,6 +101,9 @@ public class ErpPurchaseOrderRespVO {
@Schema
(
description
=
"客户订单id"
)
private
Long
customerId
;
@Schema
(
description
=
"客户订单id"
)
private
Long
customerOrderId
;
/**
* 发货状态
*
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/SupplierMonthOrderDetailsRespVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
erp
.
controller
.
admin
.
purchase
.
vo
.
order
;
import
cn.idev.excel.annotation.ExcelProperty
;
import
cn.iocoder.foodnexus.framework.excel.core.annotations.DictFormat
;
import
cn.iocoder.foodnexus.framework.excel.core.convert.DictConvert
;
import
cn.iocoder.foodnexus.module.order.enums.DeliveryMode
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* @author : yanghao
* create at: 2025/10/11 13:53
* @description: 月度账单明细
*/
@Data
public
class
SupplierMonthOrderDetailsRespVO
extends
ErpPurchaseOrderRespVO
{
@Schema
(
description
=
"配送模式"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
value
=
"配送模式"
,
converter
=
DictConvert
.
class
)
@DictFormat
(
"order_delivery_mode"
)
// TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private
DeliveryMode
deliveryMode
;
@Schema
(
description
=
"预计配送开始时间"
)
@ExcelProperty
(
"预计配送开始时间"
)
private
LocalDateTime
planDeliveryStartTime
;
@Schema
(
description
=
"预计配送结束时间"
)
@ExcelProperty
(
"预计配送结束时间"
)
private
LocalDateTime
planDeliveryEndTime
;
@Schema
(
description
=
"应对账总金额(分)"
)
private
Integer
payablePrice
;
@Schema
(
description
=
"签收金额"
)
private
Integer
signedTotal
;
@Schema
(
description
=
"退款金额"
)
private
Integer
returnsTotal
;
}
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/SupplierMonthOrderPageReqVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
erp
.
controller
.
admin
.
purchase
.
vo
.
order
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
/**
* @author : yanghao
* create at: 2025/10/11 10:33
* @description: 供应商 月度账单
*/
@Data
public
class
SupplierMonthOrderPageReqVO
extends
PageParam
{
@Schema
(
description
=
"月度"
)
private
String
month
;
}
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/purchase/vo/order/SupplierMonthOrderRespVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
erp
.
controller
.
admin
.
purchase
.
vo
.
order
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
/**
* @author : yanghao
* create at: 2025/10/11 10:33
* @description: 供应商 月度账单
*/
@Data
public
class
SupplierMonthOrderRespVO
{
@Schema
(
description
=
"月份"
)
private
String
month
;
@Schema
(
description
=
"订单总数"
)
private
Integer
orderCount
;
@Schema
(
description
=
"订单总金额(分)"
)
private
Integer
orderPrice
;
@Schema
(
description
=
"应对账总金额(分)"
)
private
Integer
payablePrice
;
@Schema
(
description
=
"状态(是否对账)"
)
private
Boolean
status
;
}
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/ErpCustomerController.java
View file @
a9cea543
...
...
@@ -67,17 +67,18 @@ public class ErpCustomerController {
@PostMapping
(
"/bind-warehouse"
)
@Operation
(
summary
=
"客户绑定仓库"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
@Parameter
(
name
=
"warehouseAreaId
"
,
description
=
"库区id
"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
Boolean
>
bindWarehouse
(
@RequestParam
(
"id"
)
Long
id
,
@RequestParam
(
"warehouseAreaId
"
)
Long
warehouseAreaId
)
{
customerService
.
bindWarehouse
(
id
,
warehouseAreaId
);
@Parameter
(
name
=
"warehouseAreaId
s"
,
description
=
"库区id集合
"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
Boolean
>
bindWarehouse
(
@RequestParam
(
"id"
)
Long
id
,
@RequestParam
(
"warehouseAreaId
s"
)
List
<
Long
>
warehouseAreaIds
)
{
customerService
.
bindWarehouse
(
id
,
warehouseAreaId
s
);
return
success
(
Boolean
.
TRUE
);
}
@DeleteMapping
(
"/bind-warehouse-release"
)
@Operation
(
summary
=
"客户解绑仓库"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
Boolean
>
bindWarehouseRelease
(
@RequestParam
(
"id"
)
Long
id
)
{
customerService
.
bindWarehouseRelease
(
id
);
@Parameter
(
name
=
"warehouseAreaIds"
,
description
=
"库区id集合"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
Boolean
>
bindWarehouseRelease
(
@RequestParam
(
"id"
)
Long
id
,
@RequestParam
(
"warehouseAreaIds"
)
List
<
Long
>
warehouseAreaIds
)
{
customerService
.
bindWarehouseRelease
(
id
,
warehouseAreaIds
);
return
success
(
Boolean
.
TRUE
);
}
...
...
@@ -88,7 +89,7 @@ public class ErpCustomerController {
public
CommonResult
<
ErpCustomerRespVO
>
getCustomer
(
@RequestParam
(
"id"
)
Long
id
)
{
ErpCustomerDO
customer
=
customerService
.
getCustomer
(
id
);
return
success
(
BeanUtils
.
toBean
(
customer
,
ErpCustomerRespVO
.
class
,
item
->
{
item
.
setWarehouseAreaId
(
customerService
.
queryWarehouseAreaIdByCustomerId
(
item
.
getId
()));
item
.
setWarehouseAreaId
s
(
customerService
.
queryWarehouseAreaIdByCustomerId
(
item
.
getId
()));
}));
}
...
...
@@ -98,7 +99,7 @@ public class ErpCustomerController {
public
CommonResult
<
PageResult
<
ErpCustomerRespVO
>>
getCustomerPage
(
@Valid
ErpCustomerPageReqVO
pageReqVO
)
{
PageResult
<
ErpCustomerDO
>
pageResult
=
customerService
.
getCustomerPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
ErpCustomerRespVO
.
class
,
item
->
{
item
.
setWarehouseAreaId
(
customerService
.
queryWarehouseAreaIdByCustomerId
(
item
.
getId
()));
item
.
setWarehouseAreaId
s
(
customerService
.
queryWarehouseAreaIdByCustomerId
(
item
.
getId
()));
}));
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/sale/vo/customer/ErpCustomerRespVO.java
View file @
a9cea543
...
...
@@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
lombok.*
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
cn.idev.excel.annotation.*
;
import
cn.iocoder.foodnexus.framework.excel.core.annotations.DictFormat
;
import
cn.iocoder.foodnexus.framework.excel.core.convert.DictConvert
;
...
...
@@ -100,6 +102,9 @@ public class ErpCustomerRespVO {
private
String
address
;
@Schema
(
description
=
"绑定库区id"
)
private
Long
warehouseAreaId
;
private
List
<
Long
>
warehouseAreaIds
;
@Schema
(
description
=
"关联部门id"
)
private
Long
systemDeptId
;
}
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/controller/admin/stock/ErpWarehouseController.java
View file @
a9cea543
...
...
@@ -84,6 +84,14 @@ public class ErpWarehouseController {
return
success
(
BeanUtils
.
toBean
(
warehouse
,
ErpWarehouseRespVO
.
class
));
}
@GetMapping
(
"/list-by-ids"
)
@Operation
(
summary
=
"获得仓库"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
@PreAuthorize
(
"@ss.hasPermission('erp:warehouse:query')"
)
public
CommonResult
<
List
<
ErpWarehouseRespVO
>>
getWarehouse
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
BeanUtils
.
toBean
(
warehouseService
.
getWarehouseList
(
ids
),
ErpWarehouseRespVO
.
class
));
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得仓库分页"
)
@PreAuthorize
(
"@ss.hasPermission('erp:warehouse:query')"
)
...
...
@@ -94,8 +102,8 @@ public class ErpWarehouseController {
@GetMapping
(
"/simple-list"
)
@Operation
(
summary
=
"获得仓库精简列表"
,
description
=
"只包含被开启的仓库,主要用于前端的下拉选项"
)
public
CommonResult
<
List
<
ErpWarehouseRespVO
>>
getWarehouseSimpleList
()
{
List
<
ErpWarehouseDO
>
list
=
warehouseService
.
getWarehouseListByStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
());
public
CommonResult
<
List
<
ErpWarehouseRespVO
>>
getWarehouseSimpleList
(
@RequestParam
(
value
=
"level"
,
required
=
false
)
String
level
)
{
List
<
ErpWarehouseDO
>
list
=
warehouseService
.
getWarehouseListByStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
()
,
level
);
return
success
(
convertList
(
list
,
warehouse
->
new
ErpWarehouseRespVO
().
setId
(
warehouse
.
getId
())
.
setName
(
warehouse
.
getName
()).
setDefaultStatus
(
warehouse
.
getDefaultStatus
())));
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/purchase/ErpPurchaseOrderMapper.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
erp
.
dal
.
mysql
.
purchase
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.mybatis.core.mapper.BaseMapperX
;
import
cn.iocoder.foodnexus.framework.mybatis.core.query.MPJLambdaWrapperX
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseOrderDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseOrderItemDO
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpAuditStatus
;
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.order.enums.CustomerOrderStatus
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.github.yulichang.query.MPJQueryWrapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
...
...
@@ -91,4 +97,22 @@ public interface ErpPurchaseOrderMapper extends BaseMapperX<ErpPurchaseOrderDO>
return
selectOne
(
ErpPurchaseOrderDO:
:
getNo
,
no
);
}
default
PageResult
<
SupplierMonthOrderRespVO
>
pageMonth
(
SupplierMonthOrderPageReqVO
pageReqVO
,
Long
supplierId
)
{
MPJQueryWrapper
<
ErpPurchaseOrderDO
>
wrapper
=
new
MPJQueryWrapper
<>();
wrapper
.
select
(
"DATE_FORMAT( t.create_time, '%Y-%m' ) AS 'month'"
);
wrapper
.
select
(
"count( t.id ) AS 'orderCount'"
);
wrapper
.
select
(
"SUM( t.total_price ) AS 'orderPrice'"
);
// TODO payablePrice 这个字段待定
wrapper
.
select
(
"CASE WHEN SUM(CASE WHEN t.delivery_status='ARRIVAL' THEN 1 ELSE 0 END)> 0 THEN 0 ELSE 1 END AS 'status'"
);
wrapper
.
leftJoin
(
"order_customer_order t1 on t.customer_order_id = t1.id"
);
wrapper
.
eq
(
"t.supplier_id"
,
supplierId
);
wrapper
.
in
(
"t.delivery_status"
,
CommonUtil
.
asList
(
ErpDeliveryStatus
.
RECONCILIATION
.
getStatus
(),
ErpDeliveryStatus
.
ARRIVAL
.
getStatus
()));
wrapper
.
in
(
"t1.order_status"
,
CommonUtil
.
asList
(
CustomerOrderStatus
.
SIGN_RECEIPT
.
getKey
()),
CustomerOrderStatus
.
FINISH
.
getKey
());
wrapper
.
eq
(
CommonUtil
.
isNotBlank
(
pageReqVO
.
getMonth
()),
"DATE_FORMAT(t.create_time, '%Y-%m') "
,
pageReqVO
.
getMonth
());
return
this
.
selectJoinPage
(
pageReqVO
,
SupplierMonthOrderRespVO
.
class
,
wrapper
);
}
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/dal/mysql/stock/ErpWarehouseMapper.java
View file @
a9cea543
...
...
@@ -31,8 +31,11 @@ public interface ErpWarehouseMapper extends BaseMapperX<ErpWarehouseDO> {
return
selectOne
(
ErpWarehouseDO:
:
getDefaultStatus
,
true
);
}
default
List
<
ErpWarehouseDO
>
selectListByStatus
(
Integer
status
)
{
return
selectList
(
ErpWarehouseDO:
:
getStatus
,
status
);
default
List
<
ErpWarehouseDO
>
selectListByStatus
(
Integer
status
,
String
level
)
{
return
selectList
(
new
LambdaQueryWrapperX
<
ErpWarehouseDO
>()
.
eqIfPresent
(
ErpWarehouseDO:
:
getStatus
,
status
)
.
eqIfPresent
(
ErpWarehouseDO:
:
getLevel
,
level
)
.
orderByDesc
(
ErpWarehouseDO:
:
getId
));
}
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/enums/ErrorCodeConstants.java
View file @
a9cea543
...
...
@@ -70,6 +70,7 @@ ErrorCode PURCHASE_ORDER_ITEM_RETURN_FAIL_IN_EXCEED = new ErrorCode(1_030_101_00
ErrorCode
SALE_ORDER_ITEM_RETURN_FAIL_OUT_EXCEED
=
new
ErrorCode
(
1_020_201_009
,
"销售订单项({})超过最大允许退货数量({})"
);
ErrorCode
SALE_ORDER_PROCESS_FAIL_EXISTS_RETURN
=
new
ErrorCode
(
1_020_201_010
,
"反审核失败,已存在对应的销售退货单"
);
ErrorCode
SALE_ORDER_PICKUP_STATUS_FAIL
=
new
ErrorCode
(
1_020_201_011
,
"销售订单状态异常"
);
ErrorCode
SALE_ORDER_NO_DELIVERY_STAFF
=
new
ErrorCode
(
1_020_201_012
,
"未选择配送员"
);
// ========== ERP 销售出库(1-030-202-000) ==========
ErrorCode
SALE_OUT_NOT_EXISTS
=
new
ErrorCode
(
1_020_202_000
,
"销售出库单不存在"
);
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/customerwarehouse/CustomerWarehouseService.java
View file @
a9cea543
...
...
@@ -63,9 +63,9 @@ public interface CustomerWarehouseService {
* 根据客户id删除数据
* @param customerId
*/
void
deleteByCustomerId
(
Long
customerId
);
void
deleteByCustomerId
(
Long
customerId
,
List
<
Long
>
warehouseAreaIds
);
CustomerWarehouseDO
getCustomerWarehouseByCustomerId
(
Long
id
);
List
<
CustomerWarehouseDO
>
getCustomerWarehouseByCustomerId
(
Long
id
);
boolean
exists
(
Long
warehouseAreaId
,
Long
customerId
);
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/customerwarehouse/CustomerWarehouseServiceImpl.java
View file @
a9cea543
...
...
@@ -89,13 +89,15 @@ public class CustomerWarehouseServiceImpl implements CustomerWarehouseService {
* @param customerId
*/
@Override
public
void
deleteByCustomerId
(
Long
customerId
)
{
customerWarehouseMapper
.
delete
(
CustomerWarehouseDO:
:
getCustomerId
,
customerId
);
public
void
deleteByCustomerId
(
Long
customerId
,
List
<
Long
>
warehouseAreaIds
)
{
customerWarehouseMapper
.
delete
(
Wrappers
.<
CustomerWarehouseDO
>
lambdaQuery
()
.
eq
(
CustomerWarehouseDO:
:
getCustomerId
,
customerId
)
.
in
(
CustomerWarehouseDO:
:
getWarehouseAreaId
,
warehouseAreaIds
));
}
@Override
public
CustomerWarehouseDO
getCustomerWarehouseByCustomerId
(
Long
customerId
)
{
return
customerWarehouseMapper
.
select
One
(
CustomerWarehouseDO:
:
getCustomerId
,
customerId
);
public
List
<
CustomerWarehouseDO
>
getCustomerWarehouseByCustomerId
(
Long
customerId
)
{
return
customerWarehouseMapper
.
select
List
(
CustomerWarehouseDO:
:
getCustomerId
,
customerId
);
}
@Override
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderService.java
View file @
a9cea543
...
...
@@ -6,6 +6,8 @@ import cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPur
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderSaveReqVO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseOrderDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseOrderItemDO
;
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.order.enums.CustomerOrderStatus
;
import
jakarta.validation.Valid
;
...
...
@@ -117,4 +119,6 @@ public interface ErpPurchaseOrderService {
void
delivery
(
List
<
Long
>
ids
,
Long
supplierId
,
ErpDeliveryStatus
oriStatus
,
ErpDeliveryStatus
updateStatus
,
CustomerOrderStatus
updateOrderStatus
);
Map
<
String
,
Long
>
queryCountByDeliveryStatus
(
ErpPurchaseOrderPageReqVO
pageReqVO
);
PageResult
<
SupplierMonthOrderRespVO
>
pageMonth
(
SupplierMonthOrderPageReqVO
pageReqVO
,
Long
supplierId
);
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpPurchaseOrderServiceImpl.java
View file @
a9cea543
...
...
@@ -4,30 +4,27 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.number.MoneyUtils
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.erp.api.PurchaseOrderSplitEvent
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpDeliveryStatus
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.in.ErpPurchaseInSaveReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.ErpPurchaseOrderSaveReqVO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.product.ErpProductDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseOrderDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpPurchaseOrderItemDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpSaleOrderItemDO
;
import
cn.iocoder.foodnexus.module.erp.dal.mysql.purchase.ErpPurchaseOrderItemMapper
;
import
cn.iocoder.foodnexus.module.erp.dal.mysql.purchase.ErpPurchaseOrderMapper
;
import
cn.iocoder.foodnexus.module.erp.dal.redis.no.ErpNoRedisDAO
;
import
cn.iocoder.foodnexus.module.erp.api.enums.ErpAuditStatus
;
import
cn.iocoder.foodnexus.module.erp.enums.ErrorCodeConstants
;
import
cn.iocoder.foodnexus.module.erp.service.finance.ErpAccountService
;
import
cn.iocoder.foodnexus.module.erp.service.product.ErpProductService
;
import
cn.iocoder.foodnexus.module.order.api.CheckTaskApi
;
import
cn.iocoder.foodnexus.module.order.api.CustomerOrderApi
;
import
cn.iocoder.foodnexus.module.order.api.CustomerOrderRecordApi
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderDTO
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderItemDTO
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderRecordEvent
;
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.order.enums.CustomerOrderStatus
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
jakarta.annotation.Resource
;
...
...
@@ -151,7 +148,7 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
purchaseOrder
.
setDiscountPercent
(
0
);
}
// purchaseOrder.setDiscountPrice(MoneyUtils.priceMultiplyPercent(purchaseOrder.getTotalPrice(), purchaseOrder.getDiscountPercent()));
purchaseOrder
.
setTotalPrice
(
purchaseOrder
.
getTotalPrice
()
/*.subtract(purchaseOrder.getDiscountPrice())*/
);
//
purchaseOrder.setTotalPrice(purchaseOrder.getTotalPrice()/*.subtract(purchaseOrder.getDiscountPrice())*/);
}
@Override
...
...
@@ -413,6 +410,11 @@ public class ErpPurchaseOrderServiceImpl implements ErpPurchaseOrderService {
return
resultMap
;
}
@Override
public
PageResult
<
SupplierMonthOrderRespVO
>
pageMonth
(
SupplierMonthOrderPageReqVO
pageReqVO
,
Long
supplierId
)
{
return
purchaseOrderMapper
.
pageMonth
(
pageReqVO
,
supplierId
);
}
@Async
@TransactionalEventListener
(
classes
=
PurchaseOrderSplitEvent
.
class
,
phase
=
TransactionPhase
.
AFTER_COMMIT
)
public
void
orderSplit
(
PurchaseOrderSplitEvent
event
)
{
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/purchase/ErpSupplierServiceImpl.java
View file @
a9cea543
...
...
@@ -169,8 +169,8 @@ public class ErpSupplierServiceImpl implements ErpSupplierService, ErpSupplierAp
@Override
public
void
createByDept
(
Long
deptId
,
SupplierAddReqVO
supplier
)
{
this
.
createSupplier
(
BeanUtils
.
toBean
(
supplier
,
ErpSupplierSaveReqVO
.
class
,
item
->
public
Long
createByDept
(
Long
deptId
,
SupplierAddReqVO
supplier
)
{
return
this
.
createSupplier
(
BeanUtils
.
toBean
(
supplier
,
ErpSupplierSaveReqVO
.
class
,
item
->
item
.
setSystemDeptId
(
deptId
)));
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpCustomerService.java
View file @
a9cea543
...
...
@@ -96,18 +96,18 @@ public interface ErpCustomerService {
* @param id
* @param warehouseAreaId
*/
void
bindWarehouse
(
Long
id
,
L
ong
warehouseAreaId
);
void
bindWarehouse
(
Long
id
,
L
ist
<
Long
>
warehouseAreaIds
);
/**
* 客户解绑仓库
* @param id
*/
void
bindWarehouseRelease
(
Long
id
);
void
bindWarehouseRelease
(
Long
id
,
List
<
Long
>
warehouseAreaIds
);
/**
* 根据客户id返回对应绑定的库区id
* @param id
* @return
*/
L
ong
queryWarehouseAreaIdByCustomerId
(
Long
id
);
L
ist
<
Long
>
queryWarehouseAreaIdByCustomerId
(
Long
id
);
}
\ No newline at end of file
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpCustomerServiceImpl.java
View file @
a9cea543
...
...
@@ -139,14 +139,15 @@ public class ErpCustomerServiceImpl implements ErpCustomerService, ErpCustomerAp
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
bindWarehouse
(
Long
id
,
L
ong
warehouseAreaId
)
{
public
void
bindWarehouse
(
Long
id
,
L
ist
<
Long
>
warehouseAreaIds
)
{
this
.
validateCustomer
(
id
);
for
(
Long
warehouseAreaId
:
warehouseAreaIds
)
{
ErpWarehouseDO
warehouseArea
=
warehouseService
.
getWarehouse
(
warehouseAreaId
);
Optional
.
ofNullable
(
warehouseArea
).
orElseThrow
(()
->
new
ServiceException
(
WAREHOUSE_NOT_EXISTS
));
ErpWarehouseDO
warehouse
=
warehouseService
.
getWarehouse
(
warehouseArea
.
getParentId
());
Optional
.
ofNullable
(
warehouse
).
orElseThrow
(()
->
new
ServiceException
(
WAREHOUSE_NOT_EXISTS
));
customerWarehouseService
.
deleteByCustomerId
(
id
);
customerWarehouseService
.
deleteByCustomerId
(
id
,
CommonUtil
.
asList
(
warehouseAreaId
)
);
CustomerWarehouseSaveReqVO
saveReqVO
=
new
CustomerWarehouseSaveReqVO
();
saveReqVO
.
setCustomerId
(
id
);
...
...
@@ -154,6 +155,7 @@ public class ErpCustomerServiceImpl implements ErpCustomerService, ErpCustomerAp
saveReqVO
.
setWarehouseAreaId
(
warehouseArea
.
getId
());
customerWarehouseService
.
createCustomerWarehouse
(
saveReqVO
);
}
}
/**
* 客户解绑仓库
...
...
@@ -161,9 +163,9 @@ public class ErpCustomerServiceImpl implements ErpCustomerService, ErpCustomerAp
* @param id
*/
@Override
public
void
bindWarehouseRelease
(
Long
id
)
{
public
void
bindWarehouseRelease
(
Long
id
,
List
<
Long
>
warehouseAreaIds
)
{
this
.
validateCustomer
(
id
);
customerWarehouseService
.
deleteByCustomerId
(
id
);
customerWarehouseService
.
deleteByCustomerId
(
id
,
warehouseAreaIds
);
}
/**
...
...
@@ -173,15 +175,15 @@ public class ErpCustomerServiceImpl implements ErpCustomerService, ErpCustomerAp
* @return
*/
@Override
public
L
ong
queryWarehouseAreaIdByCustomerId
(
Long
id
)
{
return
Optional
.
ofNullable
(
customerWarehouseService
.
getCustomerWarehouseByCustomerId
(
id
)).
map
(
CustomerWarehouseDO:
:
getWarehouseAreaId
).
orElse
(
null
);
public
L
ist
<
Long
>
queryWarehouseAreaIdByCustomerId
(
Long
id
)
{
return
CommonUtil
.
listConvert
(
customerWarehouseService
.
getCustomerWarehouseByCustomerId
(
id
),
CustomerWarehouseDO:
:
getWarehouseAreaId
);
}
/* --------------- api --------------- */
@Override
public
void
createByDept
(
Long
deptId
,
CustomerAddReqVO
customerAddReqVO
)
{
this
.
createCustomer
(
BeanUtils
.
toBean
(
customerAddReqVO
,
ErpCustomerSaveReqVO
.
class
,
item
->
public
Long
createByDept
(
Long
deptId
,
CustomerAddReqVO
customerAddReqVO
)
{
return
this
.
createCustomer
(
BeanUtils
.
toBean
(
customerAddReqVO
,
ErpCustomerSaveReqVO
.
class
,
item
->
item
.
setSystemDeptId
(
deptId
)));
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleOrderServiceImpl.java
View file @
a9cea543
...
...
@@ -315,9 +315,9 @@ public class ErpSaleOrderServiceImpl implements ErpSaleOrderService {
@Override
public
ErpSaleOrderDO
validateSaleOrder
(
Long
id
)
{
ErpSaleOrderDO
saleOrder
=
validateSaleOrderExists
(
id
);
if
(
ObjectUtil
.
notEqual
(
saleOrder
.
getStatus
(),
ErpAuditStatus
.
APPROVE
.
getStatus
()))
{
/*
if (ObjectUtil.notEqual(saleOrder.getStatus(), ErpAuditStatus.APPROVE.getStatus())) {
throw exception(SALE_ORDER_NOT_APPROVE);
}
}
*/
return
saleOrder
;
}
...
...
@@ -358,11 +358,14 @@ public class ErpSaleOrderServiceImpl implements ErpSaleOrderService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updatePickUp
(
Long
id
,
Long
itemId
)
{
ErpSaleOrderDO
saleOrder
=
getSaleOrder
(
id
);
if
(
CommonUtil
.
isEmpty
(
saleOrder
))
{
throw
exception
(
SALE_ORDER_NOT_EXISTS
);
}
ErpSaleOrderItemDO
saleItemOrder
=
saleOrderItemMapper
.
selectById
(
itemId
);
CustomerOrderDTO
customerOrder
=
customerOrderApi
.
queryById
(
saleOrder
.
getCustomerOrderId
());
if
(
CommonUtil
.
isEmpty
(
saleOrder
)
||
CommonUtil
.
isEmpty
(
saleItemOrder
))
{
if
(
CommonUtil
.
isEmpty
(
saleItemOrder
))
{
throw
exception
(
SALE_ORDER_NOT_EXISTS
);
}
CustomerOrderDTO
customerOrder
=
customerOrderApi
.
queryById
(
saleOrder
.
getCustomerOrderId
());
saleOrderItemMapper
.
update
(
Wrappers
.<
ErpSaleOrderItemDO
>
lambdaUpdate
()
.
set
(
ErpSaleOrderItemDO:
:
getPickUpStatus
,
SaleOrderPickUpStatus
.
PICK_UP
.
getType
())
...
...
@@ -374,6 +377,9 @@ public class ErpSaleOrderServiceImpl implements ErpSaleOrderService {
.
eq
(
ErpSaleOrderItemDO:
:
getOrderId
,
saleOrder
.
getId
())
.
eq
(
ErpSaleOrderItemDO:
:
getPickUpStatus
,
SaleOrderPickUpStatus
.
PICK_UP
.
getType
()));
if
(
allCount
>
0
&&
Objects
.
equals
(
pickUpCount
,
allCount
))
{
if
(
CommonUtil
.
isEmpty
(
saleOrder
.
getDeliveryStaffId
()))
{
throw
exception
(
SALE_ORDER_NO_DELIVERY_STAFF
);
}
saleOrderMapper
.
update
(
Wrappers
.<
ErpSaleOrderDO
>
lambdaUpdate
()
.
set
(
ErpSaleOrderDO:
:
getPickUpStatus
,
SaleOrderPickUpStatus
.
PICK_UP
.
getType
())
.
eq
(
ErpSaleOrderDO:
:
getId
,
saleOrder
.
getId
()));
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/sale/ErpSaleOutServiceImpl.java
View file @
a9cea543
...
...
@@ -78,12 +78,12 @@ public class ErpSaleOutServiceImpl implements ErpSaleOutService {
ErpSaleOrderDO
saleOrder
=
saleOrderService
.
validateSaleOrder
(
createReqVO
.
getOrderId
());
// 1.2 校验出库项的有效性
List
<
ErpSaleOutItemDO
>
saleOutItems
=
validateSaleOutItems
(
createReqVO
.
getItems
());
// 1.3 校验结算账户
/
*/
/ 1.3 校验结算账户
accountService.validateAccount(createReqVO.getAccountId());
// 1.4 校验销售人员
if (createReqVO.getSaleUserId() != null) {
adminUserApi.validateUser(createReqVO.getSaleUserId());
}
}
*/
// 1.5 生成出库单号,并校验唯一性
String
no
=
noRedisDAO
.
generate
(
ErpNoRedisDAO
.
SALE_OUT_NO_PREFIX
);
if
(
saleOutMapper
.
selectByNo
(
no
)
!=
null
)
{
...
...
@@ -284,9 +284,9 @@ public class ErpSaleOutServiceImpl implements ErpSaleOutService {
@Override
public
ErpSaleOutDO
validateSaleOut
(
Long
id
)
{
ErpSaleOutDO
saleOut
=
validateSaleOutExists
(
id
);
if
(
ObjectUtil
.
notEqual
(
saleOut
.
getStatus
(),
ErpAuditStatus
.
APPROVE
.
getStatus
()))
{
/*
if (ObjectUtil.notEqual(saleOut.getStatus(), ErpAuditStatus.APPROVE.getStatus())) {
throw exception(SALE_OUT_NOT_APPROVE);
}
}
*/
return
saleOut
;
}
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/stock/ErpWarehouseService.java
View file @
a9cea543
...
...
@@ -71,7 +71,7 @@ public interface ErpWarehouseService {
* @param status 状态
* @return 仓库列表
*/
List
<
ErpWarehouseDO
>
getWarehouseListByStatus
(
Integer
status
);
List
<
ErpWarehouseDO
>
getWarehouseListByStatus
(
Integer
status
,
String
level
);
/**
* 获得仓库列表
...
...
foodnexus-module-erp/src/main/java/cn/iocoder/foodnexus/module/erp/service/stock/ErpWarehouseServiceImpl.java
View file @
a9cea543
...
...
@@ -112,8 +112,8 @@ public class ErpWarehouseServiceImpl implements ErpWarehouseService, ErpWarehous
}
@Override
public
List
<
ErpWarehouseDO
>
getWarehouseListByStatus
(
Integer
status
)
{
return
warehouseMapper
.
selectListByStatus
(
status
);
public
List
<
ErpWarehouseDO
>
getWarehouseListByStatus
(
Integer
status
,
String
level
)
{
return
warehouseMapper
.
selectListByStatus
(
status
,
level
);
}
@Override
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/CustomerRequireController.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
admin
.
customerrequire
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Operation
;
import
jakarta.validation.constraints.*
;
import
jakarta.validation.*
;
import
jakarta.servlet.http.*
;
import
java.util.*
;
import
java.io.IOException
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
cn.iocoder.foodnexus.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.framework.apilog.core.annotation.ApiAccessLog
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
apilog
.
core
.
enums
.
OperateTypeEnum
.*;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.customerrequire.CustomerRequireDO
;
import
cn.iocoder.foodnexus.module.operations.service.customerrequire.CustomerRequireService
;
@Tag
(
name
=
"管理后台 - 客户需求"
)
@RestController
@RequestMapping
(
"/oper/customer-require"
)
@Validated
public
class
CustomerRequireController
{
@Resource
private
CustomerRequireService
customerRequireService
;
@PostMapping
(
"/require"
)
@Operation
(
summary
=
"受理客户需求"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
)
public
CommonResult
<
Boolean
>
require
(
@RequestParam
(
"id"
)
Long
id
)
{
customerRequireService
.
require
(
id
);
return
success
(
true
);
}
@DeleteMapping
(
"/delete"
)
@Operation
(
summary
=
"删除客户需求"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
)
@PreAuthorize
(
"@ss.hasPermission('oper:customer-require:delete')"
)
public
CommonResult
<
Boolean
>
deleteCustomerRequire
(
@RequestParam
(
"id"
)
Long
id
)
{
customerRequireService
.
deleteCustomerRequire
(
id
);
return
success
(
true
);
}
@DeleteMapping
(
"/delete-list"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
@Operation
(
summary
=
"批量删除客户需求"
)
@PreAuthorize
(
"@ss.hasPermission('oper:customer-require:delete')"
)
public
CommonResult
<
Boolean
>
deleteCustomerRequireList
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
customerRequireService
.
deleteCustomerRequireListByIds
(
ids
);
return
success
(
true
);
}
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得客户需求"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
@PreAuthorize
(
"@ss.hasPermission('oper:customer-require:query')"
)
public
CommonResult
<
CustomerRequireRespVO
>
getCustomerRequire
(
@RequestParam
(
"id"
)
Long
id
)
{
CustomerRequireDO
customerRequire
=
customerRequireService
.
getCustomerRequire
(
id
);
return
success
(
BeanUtils
.
toBean
(
customerRequire
,
CustomerRequireRespVO
.
class
));
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户需求分页"
)
@PreAuthorize
(
"@ss.hasPermission('oper:customer-require:query')"
)
public
CommonResult
<
PageResult
<
CustomerRequireRespVO
>>
getCustomerRequirePage
(
@Valid
CustomerRequirePageReqVO
pageReqVO
)
{
PageResult
<
CustomerRequireDO
>
pageResult
=
customerRequireService
.
getCustomerRequirePage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerRequireRespVO
.
class
));
}
@GetMapping
(
"/export-excel"
)
@Operation
(
summary
=
"导出客户需求 Excel"
)
@PreAuthorize
(
"@ss.hasPermission('oper:customer-require:export')"
)
@ApiAccessLog
(
operateType
=
EXPORT
)
public
void
exportCustomerRequireExcel
(
@Valid
CustomerRequirePageReqVO
pageReqVO
,
HttpServletResponse
response
)
throws
IOException
{
pageReqVO
.
setPageSize
(
PageParam
.
PAGE_SIZE_NONE
);
List
<
CustomerRequireDO
>
list
=
customerRequireService
.
getCustomerRequirePage
(
pageReqVO
).
getList
();
// 导出 Excel
ExcelUtils
.
write
(
response
,
"客户需求.xls"
,
"数据"
,
CustomerRequireRespVO
.
class
,
BeanUtils
.
toBean
(
list
,
CustomerRequireRespVO
.
class
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequirePageReqVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
admin
.
customerrequire
.
vo
;
import
lombok.*
;
import
java.util.*
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
@Schema
(
description
=
"管理后台 - 客户需求分页 Request VO"
)
@Data
public
class
CustomerRequirePageReqVO
extends
PageParam
{
@Schema
(
description
=
"客户id"
,
example
=
"23236"
)
private
Long
customerId
;
@Schema
(
description
=
"需求标题"
)
private
String
requireTitle
;
@Schema
(
description
=
"需求内容"
)
private
String
requireContent
;
@Schema
(
description
=
"商品分类编号"
,
example
=
"28601"
)
private
Long
categoryId
;
@Schema
(
description
=
"是否受理"
)
private
Boolean
isRequire
;
@Schema
(
description
=
"创建时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
LocalDateTime
[]
createTime
;
@Schema
(
description
=
"更新时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
LocalDateTime
[]
updateTime
;
@Schema
(
description
=
"创建人"
)
private
String
creator
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequireRespVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
admin
.
customerrequire
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
java.util.*
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
cn.idev.excel.annotation.*
;
@Schema
(
description
=
"管理后台 - 客户需求 Response VO"
)
@Data
@ExcelIgnoreUnannotated
public
class
CustomerRequireRespVO
{
@Schema
(
description
=
"id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"32398"
)
@ExcelProperty
(
"id"
)
private
Long
id
;
@Schema
(
description
=
"客户id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"23236"
)
@ExcelProperty
(
"客户id"
)
private
Long
customerId
;
@Schema
(
description
=
"需求标题"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"需求标题"
)
private
String
requireTitle
;
@Schema
(
description
=
"需求内容"
)
@ExcelProperty
(
"需求内容"
)
private
String
requireContent
;
@Schema
(
description
=
"商品分类编号"
,
example
=
"28601"
)
@ExcelProperty
(
"商品分类编号"
)
private
Long
categoryId
;
@Schema
(
description
=
"是否受理"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"是否受理"
)
private
Boolean
isRequire
;
@Schema
(
description
=
"受理时间"
)
private
LocalDateTime
requireTime
;
@Schema
(
description
=
"创建时间"
)
@ExcelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@Schema
(
description
=
"更新时间"
)
@ExcelProperty
(
"更新时间"
)
private
LocalDateTime
updateTime
;
@Schema
(
description
=
"创建人"
)
@ExcelProperty
(
"创建人"
)
private
String
creator
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/customerrequire/vo/CustomerRequireSaveReqVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
admin
.
customerrequire
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
java.util.*
;
import
jakarta.validation.constraints.*
;
@Schema
(
description
=
"管理后台 - 客户需求新增/修改 Request VO"
)
@Data
public
class
CustomerRequireSaveReqVO
{
@Schema
(
description
=
"id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"32398"
)
private
Long
id
;
@Schema
(
description
=
"客户id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"23236"
,
hidden
=
true
)
private
Long
customerId
;
@Schema
(
description
=
"需求标题"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@NotEmpty
(
message
=
"需求标题不能为空"
)
private
String
requireTitle
;
@Schema
(
description
=
"需求内容"
)
private
String
requireContent
;
@Schema
(
description
=
"商品分类编号"
,
example
=
"28601"
)
private
Long
categoryId
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/inquirepriceitem/vo/InquirePriceItemRespVO.java
View file @
a9cea543
...
...
@@ -25,6 +25,9 @@ public class InquirePriceItemRespVO {
@ExcelProperty
(
"商品id"
)
private
Long
productId
;
@Schema
(
description
=
"商品名称"
)
private
String
productName
;
@Schema
(
description
=
"商品分类编号"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"13698"
)
@ExcelProperty
(
"商品分类编号"
)
private
Long
categoryId
;
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/inquiresupplierpush/InquireSupplierPushController.java
View file @
a9cea543
...
...
@@ -6,10 +6,12 @@ import cn.iocoder.foodnexus.framework.common.util.collection.MapUtils;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.purchase.ErpSupplierDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpCustomerDO
;
import
cn.iocoder.foodnexus.module.erp.service.purchase.ErpSupplierService
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquirepriceitem.vo.InquirePriceItemRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushConfirmReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.AppInquireSupplierPushConfirmReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.AppInquireSupplierPushDetailsRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.AppInquireSupplierPushPageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.AppInquireSupplierPushRespVO
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquirepriceitem.InquirePriceItemDO
;
import
cn.iocoder.foodnexus.module.operations.service.inquirepriceitem.InquirePriceItemService
;
import
cn.iocoder.foodnexus.module.product.controller.admin.spu.vo.ProductSpuRespVO
;
...
...
@@ -26,13 +28,10 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Operation
;
import
jakarta.validation.constraints.*
;
import
jakarta.validation.*
;
import
jakarta.servlet.http.*
;
import
java.util.*
;
import
java.io.IOException
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
java.util.stream.Collectors
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
...
...
@@ -72,39 +71,6 @@ public class InquireSupplierPushController {
private
ErpSupplierService
supplierService
;
/*@PostMapping("/create")
@Operation(summary = "创建询价推送")
@PreAuthorize("@ss.hasPermission('operations:inquire-supplier-push:create')")
public CommonResult<Long> createInquireSupplierPush(@Valid @RequestBody InquireSupplierPushSaveReqVO createReqVO) {
return success(inquireSupplierPushService.createInquireSupplierPush(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新询价推送")
@PreAuthorize("@ss.hasPermission('operations:inquire-supplier-push:update')")
public CommonResult<Boolean> updateInquireSupplierPush(@Valid @RequestBody InquireSupplierPushSaveReqVO updateReqVO) {
inquireSupplierPushService.updateInquireSupplierPush(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除询价推送")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('operations:inquire-supplier-push:delete')")
public CommonResult<Boolean> deleteInquireSupplierPush(@RequestParam("id") Long id) {
inquireSupplierPushService.deleteInquireSupplierPush(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除询价推送")
@PreAuthorize("@ss.hasPermission('operations:inquire-supplier-push:delete')")
public CommonResult<Boolean> deleteInquireSupplierPushList(@RequestParam("ids") List<Long> ids) {
inquireSupplierPushService.deleteInquireSupplierPushListByIds(ids);
return success(true);
}*/
@PostMapping
(
"/confirm"
)
@Operation
(
summary
=
"确认询价"
)
public
CommonResult
<
Boolean
>
updateInquireSupplierPush
(
@Valid
@RequestBody
AppInquireSupplierPushConfirmReqVO
updateReqVO
)
{
...
...
@@ -152,6 +118,30 @@ public class InquireSupplierPushController {
}));
}
@GetMapping
(
"/inquirePrice/get"
)
@Operation
(
summary
=
"inquirePrice获得询价推送"
)
@Parameter
(
name
=
"id"
,
description
=
"询价主题id"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
AppInquireSupplierPushDetailsRespVO
>
getInquireSupplierPushDetails
(
@RequestParam
(
"id"
)
Long
id
)
{
AppInquireSupplierPushPageReqVO
pageReqVO
=
new
AppInquireSupplierPushPageReqVO
();
pageReqVO
.
setInquirePriceId
(
id
);
pageReqVO
.
setSupplierId
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
PageResult
<
AppInquireSupplierPushRespVO
>
result
=
inquireSupplierPushService
.
getAppInquireSupplierPushPage
(
pageReqVO
);
if
(
CommonUtil
.
isNotEmpty
(
result
)
&&
CommonUtil
.
isNotEmpty
(
result
.
getList
()))
{
AppInquireSupplierPushRespVO
inquirePrice
=
result
.
getList
().
get
(
0
);
return
success
(
BeanUtils
.
toBean
(
inquirePrice
,
AppInquireSupplierPushDetailsRespVO
.
class
,
item
->
{
item
.
setSupplierItems
(
inquirePriceItemService
.
queryListWithSupplierQuote
(
item
.
getId
(),
pageReqVO
.
getSupplierId
()));
}));
}
return
success
(
new
AppInquireSupplierPushDetailsRespVO
());
}
@GetMapping
(
"/inquirePrice/page"
)
@Operation
(
summary
=
"inquirePrice获得询价推送分页"
)
public
CommonResult
<
PageResult
<
AppInquireSupplierPushRespVO
>>
getInquireSupplierPushPage
(
@Valid
AppInquireSupplierPushPageReqVO
pageReqVO
)
{
pageReqVO
.
setSupplierId
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
return
success
(
inquireSupplierPushService
.
getAppInquireSupplierPushPage
(
pageReqVO
));
}
@GetMapping
(
"/export-excel"
)
@Operation
(
summary
=
"导出询价推送 Excel"
)
@PreAuthorize
(
"@ss.hasPermission('operations:inquire-supplier-push:export')"
)
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/a
pp
/inquiresupplierpush/vo/AppInquireSupplierPushConfirmReqVO.java
→
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/a
dmin
/inquiresupplierpush/vo/AppInquireSupplierPushConfirmReqVO.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
a
pp
.
inquiresupplierpush
.
vo
;
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
a
dmin
.
inquiresupplierpush
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.Valid
;
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/a
pp
/inquiresupplierpush/vo/AppInquireSupplierPushDetailsRespVO.java
→
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/a
dmin
/inquiresupplierpush/vo/AppInquireSupplierPushDetailsRespVO.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
a
pp
.
inquiresupplierpush
.
vo
;
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
a
dmin
.
inquiresupplierpush
.
vo
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquirepriceitem.InquirePriceItemDO
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/a
pp
/inquiresupplierpush/vo/AppInquireSupplierPushPageReqVO.java
→
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/a
dmin
/inquiresupplierpush/vo/AppInquireSupplierPushPageReqVO.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
a
pp
.
inquiresupplierpush
.
vo
;
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
a
dmin
.
inquiresupplierpush
.
vo
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquireprice.vo.InquirePriceRespVO
;
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/a
pp
/inquiresupplierpush/vo/AppInquireSupplierPushRespVO.java
→
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/a
dmin
/inquiresupplierpush/vo/AppInquireSupplierPushRespVO.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
a
pp
.
inquiresupplierpush
.
vo
;
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
a
dmin
.
inquiresupplierpush
.
vo
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquireprice.vo.InquirePriceRespVO
;
import
io.swagger.v3.oas.annotations.media.Schema
;
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/scoringweight/ScoringWeightController.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
admin
.
scoringweight
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Operation
;
import
jakarta.validation.constraints.*
;
import
jakarta.validation.*
;
import
jakarta.servlet.http.*
;
import
java.util.*
;
import
java.io.IOException
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
cn.iocoder.foodnexus.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.framework.apilog.core.annotation.ApiAccessLog
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
apilog
.
core
.
enums
.
OperateTypeEnum
.*;
import
cn.iocoder.foodnexus.module.operations.controller.admin.scoringweight.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.scoringweight.ScoringWeightDO
;
import
cn.iocoder.foodnexus.module.operations.service.scoringweight.ScoringWeightService
;
@Tag
(
name
=
"管理后台 - 评分权重"
)
@RestController
@RequestMapping
(
"/operations/scoring-weight"
)
@Validated
public
class
ScoringWeightController
{
@Resource
private
ScoringWeightService
scoringWeightService
;
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建评分权重"
)
@PreAuthorize
(
"@ss.hasPermission('operations:scoring-weight:create')"
)
public
CommonResult
<
Long
>
createScoringWeight
(
@Valid
@RequestBody
ScoringWeightSaveReqVO
createReqVO
)
{
return
success
(
scoringWeightService
.
createScoringWeight
(
createReqVO
));
}
@PutMapping
(
"/update"
)
@Operation
(
summary
=
"更新评分权重"
)
@PreAuthorize
(
"@ss.hasPermission('operations:scoring-weight:update')"
)
public
CommonResult
<
Boolean
>
updateScoringWeight
(
@Valid
@RequestBody
ScoringWeightSaveReqVO
updateReqVO
)
{
scoringWeightService
.
updateScoringWeight
(
updateReqVO
);
return
success
(
true
);
}
@DeleteMapping
(
"/delete"
)
@Operation
(
summary
=
"删除评分权重"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
)
@PreAuthorize
(
"@ss.hasPermission('operations:scoring-weight:delete')"
)
public
CommonResult
<
Boolean
>
deleteScoringWeight
(
@RequestParam
(
"id"
)
Long
id
)
{
scoringWeightService
.
deleteScoringWeight
(
id
);
return
success
(
true
);
}
@DeleteMapping
(
"/delete-list"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
@Operation
(
summary
=
"批量删除评分权重"
)
@PreAuthorize
(
"@ss.hasPermission('operations:scoring-weight:delete')"
)
public
CommonResult
<
Boolean
>
deleteScoringWeightList
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
scoringWeightService
.
deleteScoringWeightListByIds
(
ids
);
return
success
(
true
);
}
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得评分权重"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
@PreAuthorize
(
"@ss.hasPermission('operations:scoring-weight:query')"
)
public
CommonResult
<
ScoringWeightRespVO
>
getScoringWeight
(
@RequestParam
(
"id"
)
Long
id
)
{
ScoringWeightDO
scoringWeight
=
scoringWeightService
.
getScoringWeight
(
id
);
return
success
(
BeanUtils
.
toBean
(
scoringWeight
,
ScoringWeightRespVO
.
class
));
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得评分权重分页"
)
@PreAuthorize
(
"@ss.hasPermission('operations:scoring-weight:query')"
)
public
CommonResult
<
PageResult
<
ScoringWeightRespVO
>>
getScoringWeightPage
(
@Valid
ScoringWeightPageReqVO
pageReqVO
)
{
PageResult
<
ScoringWeightDO
>
pageResult
=
scoringWeightService
.
getScoringWeightPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
ScoringWeightRespVO
.
class
));
}
@GetMapping
(
"/export-excel"
)
@Operation
(
summary
=
"导出评分权重 Excel"
)
@PreAuthorize
(
"@ss.hasPermission('operations:scoring-weight:export')"
)
@ApiAccessLog
(
operateType
=
EXPORT
)
public
void
exportScoringWeightExcel
(
@Valid
ScoringWeightPageReqVO
pageReqVO
,
HttpServletResponse
response
)
throws
IOException
{
pageReqVO
.
setPageSize
(
PageParam
.
PAGE_SIZE_NONE
);
List
<
ScoringWeightDO
>
list
=
scoringWeightService
.
getScoringWeightPage
(
pageReqVO
).
getList
();
// 导出 Excel
ExcelUtils
.
write
(
response
,
"评分权重.xls"
,
"数据"
,
ScoringWeightRespVO
.
class
,
BeanUtils
.
toBean
(
list
,
ScoringWeightRespVO
.
class
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/scoringweight/vo/ScoringWeightPageReqVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
admin
.
scoringweight
.
vo
;
import
lombok.*
;
import
java.util.*
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
java.math.BigDecimal
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
@Schema
(
description
=
"管理后台 - 评分权重分页 Request VO"
)
@Data
public
class
ScoringWeightPageReqVO
extends
PageParam
{
@Schema
(
description
=
"评价指标名称"
,
example
=
"赵六"
)
private
String
scoreName
;
@Schema
(
description
=
"评分权重"
)
private
BigDecimal
weightRatio
;
@Schema
(
description
=
"是否展示"
)
private
Boolean
isDisplay
;
@Schema
(
description
=
"面向用户群体"
)
private
String
userSystem
;
@Schema
(
description
=
"排序"
)
private
Integer
sort
;
@Schema
(
description
=
"创建时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
LocalDateTime
[]
createTime
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/scoringweight/vo/ScoringWeightRespVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
admin
.
scoringweight
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
java.util.*
;
import
java.math.BigDecimal
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
cn.idev.excel.annotation.*
;
import
cn.iocoder.foodnexus.framework.excel.core.annotations.DictFormat
;
import
cn.iocoder.foodnexus.framework.excel.core.convert.DictConvert
;
@Schema
(
description
=
"管理后台 - 评分权重 Response VO"
)
@Data
@ExcelIgnoreUnannotated
public
class
ScoringWeightRespVO
{
@Schema
(
description
=
"id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"8877"
)
@ExcelProperty
(
"id"
)
private
Long
id
;
@Schema
(
description
=
"评价指标名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"赵六"
)
@ExcelProperty
(
"评价指标名称"
)
private
String
scoreName
;
@Schema
(
description
=
"评分权重"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"评分权重"
)
private
BigDecimal
weightRatio
;
@Schema
(
description
=
"是否展示"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"是否展示"
)
private
Boolean
isDisplay
;
@Schema
(
description
=
"面向用户群体"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
value
=
"面向用户群体"
,
converter
=
DictConvert
.
class
)
@DictFormat
(
"USER_SYSTEM"
)
// TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private
String
userSystem
;
@Schema
(
description
=
"排序"
)
@ExcelProperty
(
"排序"
)
private
Integer
sort
;
@Schema
(
description
=
"创建时间"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/scoringweight/vo/ScoringWeightSaveReqVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
admin
.
scoringweight
.
vo
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
cn.iocoder.foodnexus.framework.common.enums.UserTypeEnum
;
import
cn.iocoder.foodnexus.framework.common.validation.InEnum
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
java.util.*
;
import
jakarta.validation.constraints.*
;
import
java.math.BigDecimal
;
@Schema
(
description
=
"管理后台 - 评分权重新增/修改 Request VO"
)
@Data
public
class
ScoringWeightSaveReqVO
{
@Schema
(
description
=
"id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"8877"
)
private
Long
id
;
@Schema
(
description
=
"评价指标名称"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"赵六"
)
@NotEmpty
(
message
=
"评价指标名称不能为空"
)
private
String
scoreName
;
@Schema
(
description
=
"评分权重"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@NotNull
(
message
=
"评分权重不能为空"
)
private
BigDecimal
weightRatio
;
@Schema
(
description
=
"是否展示"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@NotNull
(
message
=
"是否展示不能为空"
)
private
Boolean
isDisplay
;
@Schema
(
description
=
"面向用户群体"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@NotEmpty
(
message
=
"面向用户群体不能为空"
)
@InEnum
(
value
=
UserSystemEnum
.
class
,
message
=
"用户类型必须是 {value}"
)
private
String
userSystem
;
@Schema
(
description
=
"排序"
)
private
Integer
sort
;
}
\ 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
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
app
.
customerrequire
;
import
cn.iocoder.foodnexus.framework.apilog.core.annotation.ApiAccessLog
;
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.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi
;
import
cn.iocoder.foodnexus.module.erp.service.product.ErpProductService
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.CustomerRequirePageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.CustomerRequireRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.CustomerRequireSaveReqVO
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.customerrequire.CustomerRequireDO
;
import
cn.iocoder.foodnexus.module.operations.service.customerrequire.CustomerRequireService
;
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
jakarta.servlet.http.HttpServletResponse
;
import
jakarta.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.IOException
;
import
java.util.List
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
apilog
.
core
.
enums
.
OperateTypeEnum
.
EXPORT
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
@Tag
(
name
=
"APP - 客户需求"
)
@RestController
@RequestMapping
(
"/oper/customer-require"
)
@Validated
public
class
AppCustomerRequireController
{
@Resource
private
CustomerRequireService
customerRequireService
;
@Autowired
private
ErpCustomerApi
customerApi
;
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建客户需求"
)
public
CommonResult
<
Long
>
createCustomerRequire
(
@Valid
@RequestBody
CustomerRequireSaveReqVO
createReqVO
)
{
createReqVO
.
setCustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
return
success
(
customerRequireService
.
createCustomerRequire
(
createReqVO
));
}
@PutMapping
(
"/update"
)
@Operation
(
summary
=
"更新客户需求"
)
public
CommonResult
<
Boolean
>
updateCustomerRequire
(
@Valid
@RequestBody
CustomerRequireSaveReqVO
updateReqVO
)
{
updateReqVO
.
setCustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
customerRequireService
.
updateCustomerRequire
(
updateReqVO
);
return
success
(
true
);
}
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得客户需求"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
CustomerRequireRespVO
>
getCustomerRequire
(
@RequestParam
(
"id"
)
Long
id
)
{
CustomerRequireDO
customerRequire
=
customerRequireService
.
getCustomerRequire
(
id
);
return
success
(
BeanUtils
.
toBean
(
customerRequire
,
CustomerRequireRespVO
.
class
));
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户需求分页"
)
public
CommonResult
<
PageResult
<
CustomerRequireRespVO
>>
getCustomerRequirePage
(
@Valid
CustomerRequirePageReqVO
pageReqVO
)
{
pageReqVO
.
setCustomerId
(
customerApi
.
queryCustomerIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
PageResult
<
CustomerRequireDO
>
pageResult
=
customerRequireService
.
getCustomerRequirePage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerRequireRespVO
.
class
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/inquirecustomerpush/AppInquireCustomerPushController.java
View file @
a9cea543
...
...
@@ -5,6 +5,7 @@ import cn.iocoder.foodnexus.framework.common.pojo.PageResult;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi
;
import
cn.iocoder.foodnexus.module.erp.service.product.ErpProductService
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquireprice.vo.InquirePriceRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquirepriceitem.vo.InquirePriceItemRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquirecustomerpush.vo.AppInquireCustomerPushPageReqVO
;
...
...
@@ -13,6 +14,8 @@ import cn.iocoder.foodnexus.module.operations.dal.dataobject.inquirecustomerpush
import
cn.iocoder.foodnexus.module.operations.service.inquirecustomerpush.InquireCustomerPushService
;
import
cn.iocoder.foodnexus.module.operations.service.inquireprice.InquirePriceService
;
import
cn.iocoder.foodnexus.module.operations.service.inquirepriceitem.InquirePriceItemService
;
import
cn.iocoder.foodnexus.module.product.api.ProductSpuApi
;
import
cn.iocoder.foodnexus.module.product.service.spu.ProductSpuService
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
io.swagger.v3.oas.annotations.Operation
;
...
...
@@ -48,6 +51,9 @@ public class AppInquireCustomerPushController {
@Autowired
private
InquirePriceItemService
inquirePriceItemService
;
@Autowired
private
ProductSpuService
productService
;
@PostMapping
(
"/confirm"
)
@Operation
(
summary
=
"确认询价"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
...
...
@@ -63,7 +69,9 @@ public class AppInquireCustomerPushController {
InquireCustomerPushDO
inquireCustomerPush
=
inquireCustomerPushService
.
getInquireCustomerPush
(
id
);
return
success
(
BeanUtils
.
toBean
(
inquireCustomerPush
,
AppInquireCustomerPushRespVO
.
class
,
item
->
{
item
.
setInquirePrice
(
BeanUtils
.
toBean
(
inquirePriceService
.
getInquirePrice
(
inquireCustomerPush
.
getInquirePriceId
()),
InquirePriceRespVO
.
class
,
inquire
->
{
inquire
.
setItems
(
BeanUtils
.
toBean
(
inquirePriceItemService
.
queryByInquireId
(
inquire
.
getId
()),
InquirePriceItemRespVO
.
class
));
inquire
.
setItems
(
BeanUtils
.
toBean
(
inquirePriceItemService
.
queryByInquireId
(
inquire
.
getId
()),
InquirePriceItemRespVO
.
class
,
inquireItem
->
{
inquireItem
.
setProductName
(
productService
.
queryName
(
inquireItem
.
getProductId
()));
}));
}));
item
.
setInquirePriceItemCount
((
long
)
Optional
.
ofNullable
(
item
.
getInquirePrice
().
getItems
()).
orElse
(
Lists
.
newArrayList
()).
size
());
}));
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/app/inquiresupplierpush/AppInquireSupplierPushController.java
deleted
100644 → 0
View file @
dfdb4183
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
controller
.
app
.
inquiresupplierpush
;
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.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushConfirmReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushDetailsRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushPageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushRespVO
;
import
cn.iocoder.foodnexus.module.operations.service.inquirepriceitem.InquirePriceItemService
;
import
cn.iocoder.foodnexus.module.operations.service.inquiresupplierpush.InquireSupplierPushService
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
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
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
;
@Tag
(
name
=
"APP - 询价推送"
)
@RestController
@RequestMapping
(
"/operations/inquire-supplier-push"
)
@Validated
@AppSystemAuth
(
UserSystemEnum
.
SUPPLIER
)
public
class
AppInquireSupplierPushController
{
@Resource
private
InquireSupplierPushService
inquireSupplierPushService
;
@Autowired
private
InquirePriceItemService
inquirePriceItemService
;
@Autowired
private
ErpSupplierApi
supplierApi
;
@PostMapping
(
"/confirm"
)
@Operation
(
summary
=
"确认询价"
)
public
CommonResult
<
Boolean
>
updateInquireSupplierPush
(
@Valid
@RequestBody
AppInquireSupplierPushConfirmReqVO
updateReqVO
)
{
updateReqVO
.
setSupplierId
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
inquireSupplierPushService
.
confirm
(
updateReqVO
);
return
success
(
true
);
}
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得询价推送"
)
@Parameter
(
name
=
"id"
,
description
=
"询价主题id"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
AppInquireSupplierPushDetailsRespVO
>
getInquireSupplierPush
(
@RequestParam
(
"id"
)
Long
id
)
{
AppInquireSupplierPushPageReqVO
pageReqVO
=
new
AppInquireSupplierPushPageReqVO
();
pageReqVO
.
setInquirePriceId
(
id
);
pageReqVO
.
setSupplierId
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
PageResult
<
AppInquireSupplierPushRespVO
>
result
=
inquireSupplierPushService
.
getAppInquireSupplierPushPage
(
pageReqVO
);
if
(
CommonUtil
.
isNotEmpty
(
result
)
&&
CommonUtil
.
isNotEmpty
(
result
.
getList
()))
{
AppInquireSupplierPushRespVO
inquirePrice
=
result
.
getList
().
get
(
0
);
return
success
(
BeanUtils
.
toBean
(
inquirePrice
,
AppInquireSupplierPushDetailsRespVO
.
class
,
item
->
{
item
.
setSupplierItems
(
inquirePriceItemService
.
queryListWithSupplierQuote
(
item
.
getId
(),
pageReqVO
.
getSupplierId
()));
}));
}
return
success
(
new
AppInquireSupplierPushDetailsRespVO
());
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得询价推送分页"
)
public
CommonResult
<
PageResult
<
AppInquireSupplierPushRespVO
>>
getInquireSupplierPushPage
(
@Valid
AppInquireSupplierPushPageReqVO
pageReqVO
)
{
pageReqVO
.
setSupplierId
(
supplierApi
.
querySupplierIdByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
()));
return
success
(
inquireSupplierPushService
.
getAppInquireSupplierPushPage
(
pageReqVO
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/dataobject/customerrequire/CustomerRequireDO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
dal
.
dataobject
.
customerrequire
;
import
lombok.*
;
import
java.util.*
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.*
;
import
cn.iocoder.foodnexus.framework.mybatis.core.dataobject.BaseDO
;
/**
* 客户需求 DO
*
* @author 超级管理员
*/
@TableName
(
"oper_customer_require"
)
@KeySequence
(
"oper_customer_require_seq"
)
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
CustomerRequireDO
extends
BaseDO
{
/**
* id
*/
@TableId
private
Long
id
;
/**
* 客户id
*/
private
Long
customerId
;
/**
* 需求标题
*/
private
String
requireTitle
;
/**
* 需求内容
*/
private
String
requireContent
;
/**
* 商品分类编号
*/
private
Long
categoryId
;
/**
* 是否受理
*/
private
Boolean
isRequire
;
/**
* 受理时间
*/
private
LocalDateTime
requireTime
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/dataobject/scoringweight/ScoringWeightDO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
dal
.
dataobject
.
scoringweight
;
import
lombok.*
;
import
java.util.*
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.*
;
import
cn.iocoder.foodnexus.framework.mybatis.core.dataobject.BaseDO
;
/**
* 评分权重 DO
*
* @author 超级管理员
*/
@TableName
(
"oper_scoring_weight"
)
@KeySequence
(
"oper_scoring_weight_seq"
)
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
ScoringWeightDO
extends
BaseDO
{
/**
* id
*/
@TableId
private
Long
id
;
/**
* 评价指标名称
*/
private
String
scoreName
;
/**
* 评分权重
*/
private
BigDecimal
weightRatio
;
/**
* 是否展示
*/
private
Boolean
isDisplay
;
/**
* 面向用户群体
*
* 枚举 {@link TODO USER_SYSTEM 对应的类}
*/
private
String
userSystem
;
/**
* 排序
*/
private
Integer
sort
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/customerrequire/CustomerRequireMapper.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
dal
.
mysql
.
customerrequire
;
import
java.util.*
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.foodnexus.framework.mybatis.core.mapper.BaseMapperX
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.customerrequire.CustomerRequireDO
;
import
org.apache.ibatis.annotations.Mapper
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.*
;
/**
* 客户需求 Mapper
*
* @author 超级管理员
*/
@Mapper
public
interface
CustomerRequireMapper
extends
BaseMapperX
<
CustomerRequireDO
>
{
default
PageResult
<
CustomerRequireDO
>
selectPage
(
CustomerRequirePageReqVO
reqVO
)
{
return
selectPage
(
reqVO
,
new
LambdaQueryWrapperX
<
CustomerRequireDO
>()
.
eqIfPresent
(
CustomerRequireDO:
:
getCustomerId
,
reqVO
.
getCustomerId
())
.
eqIfPresent
(
CustomerRequireDO:
:
getRequireTitle
,
reqVO
.
getRequireTitle
())
.
eqIfPresent
(
CustomerRequireDO:
:
getRequireContent
,
reqVO
.
getRequireContent
())
.
eqIfPresent
(
CustomerRequireDO:
:
getCategoryId
,
reqVO
.
getCategoryId
())
.
eqIfPresent
(
CustomerRequireDO:
:
getIsRequire
,
reqVO
.
getIsRequire
())
.
betweenIfPresent
(
CustomerRequireDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
betweenIfPresent
(
CustomerRequireDO:
:
getUpdateTime
,
reqVO
.
getUpdateTime
())
.
eqIfPresent
(
CustomerRequireDO:
:
getCreator
,
reqVO
.
getCreator
())
.
orderByDesc
(
CustomerRequireDO:
:
getId
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/inquirecustomerpush/InquireCustomerPushMapper.java
View file @
a9cea543
...
...
@@ -36,20 +36,24 @@ public interface InquireCustomerPushMapper extends BaseMapperX<InquireCustomerPu
}
default
PageResult
<
AppInquireCustomerPushRespVO
>
selectPage
(
AppInquireCustomerPushPageReqVO
reqVO
)
{
MPJLambdaWrapper
<
InquireCustomerPushDO
>
wrapperX
=
new
MPJLambdaWrapper
<
InquireCustomerPushDO
>()
.
selectAll
(
InquireCustomerPushDO
.
class
)
.
selectCount
(
InquirePriceItemDO:
:
getId
,
"inquirePriceItemCount"
)
.
leftJoin
(
InquirePriceDO
.
class
,
InquirePriceDO:
:
getId
,
InquireCustomerPushDO:
:
getInquirePriceId
)
.
leftJoin
(
InquirePriceItemDO
.
class
,
InquirePriceItemDO:
:
getInquireId
,
InquirePriceDO:
:
getId
)
.
eq
(
InquireCustomerPushDO:
:
getCustomerId
,
reqVO
.
getCustomerId
())
.
eqIfExists
(
InquireCustomerPushDO:
:
getInquirePriceId
,
reqVO
.
getInquirePriceId
())
.
eqIfExists
(
InquireCustomerPushDO:
:
getConfirm
,
reqVO
.
getConfirm
())
.
eqIfExists
(
InquireCustomerPushDO:
:
getConfirmUser
,
reqVO
.
getConfirmUser
())
.
between
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getConfirmTime
()),
InquireCustomerPushDO:
:
getConfirmTime
,
reqVO
.
getConfirmTime
()[
0
],
reqVO
.
getConfirmTime
()[
1
])
.
between
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getCreateTime
()),
InquireCustomerPushDO:
:
getCreateTime
,
reqVO
.
getCreateTime
()[
0
],
reqVO
.
getCreateTime
()[
1
])
.
eqIfExists
(
InquirePriceDO:
:
getInquiryYearMonth
,
reqVO
.
getInquiryYearMonth
())
.
groupBy
(
InquireCustomerPushDO:
:
getId
)
.
orderByDesc
(
InquireCustomerPushDO:
:
getId
);
MPJLambdaWrapper
<
InquireCustomerPushDO
>
wrapperX
=
new
MPJLambdaWrapper
<
InquireCustomerPushDO
>();
wrapperX
.
selectAll
(
InquireCustomerPushDO
.
class
);
wrapperX
.
selectCount
(
InquirePriceItemDO:
:
getId
,
"inquirePriceItemCount"
);
wrapperX
.
leftJoin
(
InquirePriceDO
.
class
,
InquirePriceDO:
:
getId
,
InquireCustomerPushDO:
:
getInquirePriceId
);
wrapperX
.
leftJoin
(
InquirePriceItemDO
.
class
,
InquirePriceItemDO:
:
getInquireId
,
InquirePriceDO:
:
getId
);
wrapperX
.
eq
(
InquireCustomerPushDO:
:
getCustomerId
,
reqVO
.
getCustomerId
());
wrapperX
.
eqIfExists
(
InquireCustomerPushDO:
:
getInquirePriceId
,
reqVO
.
getInquirePriceId
());
wrapperX
.
eqIfExists
(
InquireCustomerPushDO:
:
getConfirm
,
reqVO
.
getConfirm
());
wrapperX
.
eqIfExists
(
InquireCustomerPushDO:
:
getConfirmUser
,
reqVO
.
getConfirmUser
());
if
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getConfirmTime
()))
{
wrapperX
.
between
(
InquireCustomerPushDO:
:
getConfirmTime
,
reqVO
.
getConfirmTime
()[
0
],
reqVO
.
getConfirmTime
()[
1
]);
}
if
(
CommonUtil
.
isNotEmpty
(
reqVO
.
getCreateTime
()))
{
wrapperX
.
between
(
InquireCustomerPushDO:
:
getCreateTime
,
reqVO
.
getCreateTime
()[
0
],
reqVO
.
getCreateTime
()[
1
]);
}
wrapperX
.
eqIfExists
(
InquirePriceDO:
:
getInquiryYearMonth
,
reqVO
.
getInquiryYearMonth
());
wrapperX
.
groupBy
(
InquireCustomerPushDO:
:
getId
);
wrapperX
.
orderByDesc
(
InquireCustomerPushDO:
:
getId
);
return
selectJoinPage
(
reqVO
,
AppInquireCustomerPushRespVO
.
class
,
wrapperX
);
}
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/inquiresupplierpush/InquireSupplierPushMapper.java
View file @
a9cea543
...
...
@@ -5,8 +5,8 @@ import java.util.*;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.foodnexus.framework.mybatis.core.mapper.BaseMapperX
;
import
cn.iocoder.foodnexus.module.operations.controller.a
pp
.inquiresupplierpush.vo.AppInquireSupplierPushPageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
pp
.inquiresupplierpush.vo.AppInquireSupplierPushRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
dmin
.inquiresupplierpush.vo.AppInquireSupplierPushPageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
dmin
.inquiresupplierpush.vo.AppInquireSupplierPushRespVO
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquirecustomerpush.InquireCustomerPushDO
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquireprice.InquirePriceDO
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquiresupplierpush.InquireSupplierPushDO
;
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/mysql/scoringweight/ScoringWeightMapper.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
dal
.
mysql
.
scoringweight
;
import
java.util.*
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.foodnexus.framework.mybatis.core.mapper.BaseMapperX
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.scoringweight.ScoringWeightDO
;
import
org.apache.ibatis.annotations.Mapper
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.scoringweight.vo.*
;
/**
* 评分权重 Mapper
*
* @author 超级管理员
*/
@Mapper
public
interface
ScoringWeightMapper
extends
BaseMapperX
<
ScoringWeightDO
>
{
default
PageResult
<
ScoringWeightDO
>
selectPage
(
ScoringWeightPageReqVO
reqVO
)
{
return
selectPage
(
reqVO
,
new
LambdaQueryWrapperX
<
ScoringWeightDO
>()
.
likeIfPresent
(
ScoringWeightDO:
:
getScoreName
,
reqVO
.
getScoreName
())
.
eqIfPresent
(
ScoringWeightDO:
:
getWeightRatio
,
reqVO
.
getWeightRatio
())
.
eqIfPresent
(
ScoringWeightDO:
:
getIsDisplay
,
reqVO
.
getIsDisplay
())
.
eqIfPresent
(
ScoringWeightDO:
:
getUserSystem
,
reqVO
.
getUserSystem
())
.
eqIfPresent
(
ScoringWeightDO:
:
getSort
,
reqVO
.
getSort
())
.
betweenIfPresent
(
ScoringWeightDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
orderByDesc
(
ScoringWeightDO:
:
getId
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/enums/ErrorCodeConstants.java
View file @
a9cea543
...
...
@@ -34,4 +34,10 @@ public interface ErrorCodeConstants {
// ========== 询价推送 1_008_016_000 ==========
ErrorCode
INQUIRE_SUPPLIER_PUSH_NOT_EXISTS
=
new
ErrorCode
(
1_008_016_000
,
"询价推送不存在"
);
// ========== 客户需求 1_008_017_000 ==========
ErrorCode
CUSTOMER_REQUIRE_NOT_EXISTS
=
new
ErrorCode
(
1_008_017_000
,
"客户需求不存在"
);
ErrorCode
CUSTOMER_REQUIRE_IS_REQUIRE
=
new
ErrorCode
(
1_008_017_001
,
"客户需求已受理"
);
// ========== 评分权重 1_008_018_000 ==========
ErrorCode
SCORING_WEIGHT_NOT_EXISTS
=
new
ErrorCode
(
1_008_018_000
,
"评分权重不存在"
);
}
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/customerrequire/CustomerRequireService.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
service
.
customerrequire
;
import
java.util.*
;
import
jakarta.validation.*
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.customerrequire.CustomerRequireDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
/**
* 客户需求 Service 接口
*
* @author 超级管理员
*/
public
interface
CustomerRequireService
{
/**
* 创建客户需求
*
* @param createReqVO 创建信息
* @return 编号
*/
Long
createCustomerRequire
(
@Valid
CustomerRequireSaveReqVO
createReqVO
);
/**
* 更新客户需求
*
* @param updateReqVO 更新信息
*/
void
updateCustomerRequire
(
@Valid
CustomerRequireSaveReqVO
updateReqVO
);
/**
* 删除客户需求
*
* @param id 编号
*/
void
deleteCustomerRequire
(
Long
id
);
/**
* 批量删除客户需求
*
* @param ids 编号
*/
void
deleteCustomerRequireListByIds
(
List
<
Long
>
ids
);
/**
* 获得客户需求
*
* @param id 编号
* @return 客户需求
*/
CustomerRequireDO
getCustomerRequire
(
Long
id
);
/**
* 获得客户需求分页
*
* @param pageReqVO 分页查询
* @return 客户需求分页
*/
PageResult
<
CustomerRequireDO
>
getCustomerRequirePage
(
CustomerRequirePageReqVO
pageReqVO
);
void
require
(
Long
id
);
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/customerrequire/CustomerRequireServiceImpl.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
service
.
customerrequire
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.customerrequire.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.customerrequire.CustomerRequireDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.operations.dal.mysql.customerrequire.CustomerRequireMapper
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertList
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
diffList
;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
enums
.
ErrorCodeConstants
.*;
/**
* 客户需求 Service 实现类
*
* @author 超级管理员
*/
@Service
@Validated
public
class
CustomerRequireServiceImpl
implements
CustomerRequireService
{
@Resource
private
CustomerRequireMapper
customerRequireMapper
;
@Override
public
Long
createCustomerRequire
(
CustomerRequireSaveReqVO
createReqVO
)
{
// 插入
CustomerRequireDO
customerRequire
=
BeanUtils
.
toBean
(
createReqVO
,
CustomerRequireDO
.
class
);
customerRequireMapper
.
insert
(
customerRequire
);
// 返回
return
customerRequire
.
getId
();
}
@Override
public
void
updateCustomerRequire
(
CustomerRequireSaveReqVO
updateReqVO
)
{
// 校验存在
validateCustomerRequireExists
(
updateReqVO
.
getId
());
// 更新
CustomerRequireDO
updateObj
=
BeanUtils
.
toBean
(
updateReqVO
,
CustomerRequireDO
.
class
);
customerRequireMapper
.
updateById
(
updateObj
);
}
@Override
public
void
deleteCustomerRequire
(
Long
id
)
{
// 校验存在
validateCustomerRequireExists
(
id
);
// 删除
customerRequireMapper
.
deleteById
(
id
);
}
@Override
public
void
deleteCustomerRequireListByIds
(
List
<
Long
>
ids
)
{
// 删除
customerRequireMapper
.
deleteByIds
(
ids
);
}
private
void
validateCustomerRequireExists
(
Long
id
)
{
CustomerRequireDO
customerRequireDO
=
customerRequireMapper
.
selectById
(
id
);
if
(
customerRequireDO
==
null
)
{
throw
exception
(
CUSTOMER_REQUIRE_NOT_EXISTS
);
}
if
(
customerRequireDO
.
getIsRequire
())
{
throw
exception
(
CUSTOMER_REQUIRE_IS_REQUIRE
);
}
}
@Override
public
CustomerRequireDO
getCustomerRequire
(
Long
id
)
{
return
customerRequireMapper
.
selectById
(
id
);
}
@Override
public
PageResult
<
CustomerRequireDO
>
getCustomerRequirePage
(
CustomerRequirePageReqVO
pageReqVO
)
{
return
customerRequireMapper
.
selectPage
(
pageReqVO
);
}
@Override
public
void
require
(
Long
id
)
{
this
.
validateCustomerRequireExists
(
id
);
customerRequireMapper
.
update
(
Wrappers
.<
CustomerRequireDO
>
lambdaUpdate
()
.
set
(
CustomerRequireDO:
:
getIsRequire
,
Boolean
.
TRUE
)
.
set
(
CustomerRequireDO:
:
getRequireTime
,
LocalDateTime
.
now
())
.
eq
(
CustomerRequireDO:
:
getId
,
id
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/inquirepriceitem/InquirePriceItemService.java
View file @
a9cea543
...
...
@@ -3,12 +3,11 @@ package cn.iocoder.foodnexus.module.operations.service.inquirepriceitem;
import
java.util.*
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.module.operations.controller.a
pp
.inquiresupplierpush.vo.AppInquireSupplierPushDetailsRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
dmin
.inquiresupplierpush.vo.AppInquireSupplierPushDetailsRespVO
;
import
jakarta.validation.*
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquirepriceitem.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquirepriceitem.InquirePriceItemDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
/**
* 询价管理子 Service 接口
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/inquirepriceitem/InquirePriceItemServiceImpl.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
service
.
inquirepriceitem
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquireprice.vo.InquirePriceRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushDetailsRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.AppInquireSupplierPushDetailsRespVO
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquiresupplierpush.InquireSupplierPushDO
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.github.yulichang.query.MPJLambdaQueryWrapper
;
import
com.github.yulichang.wrapper.MPJLambdaWrapper
;
import
org.apache.commons.compress.utils.Lists
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
...
...
@@ -22,14 +18,12 @@ import java.util.stream.Collectors;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquirepriceitem.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquirepriceitem.InquirePriceItemDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.operations.dal.mysql.inquirepriceitem.InquirePriceItemMapper
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertList
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
diffList
;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
enums
.
ErrorCodeConstants
.*;
/**
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/inquiresupplierpush/InquireSupplierPushService.java
View file @
a9cea543
...
...
@@ -3,14 +3,13 @@ package cn.iocoder.foodnexus.module.operations.service.inquiresupplierpush;
import
java.util.*
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.module.operations.controller.a
pp
.inquiresupplierpush.vo.AppInquireSupplierPushConfirmReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
pp
.inquiresupplierpush.vo.AppInquireSupplierPushPageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
pp
.inquiresupplierpush.vo.AppInquireSupplierPushRespVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
dmin
.inquiresupplierpush.vo.AppInquireSupplierPushConfirmReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
dmin
.inquiresupplierpush.vo.AppInquireSupplierPushPageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.a
dmin
.inquiresupplierpush.vo.AppInquireSupplierPushRespVO
;
import
jakarta.validation.*
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquiresupplierpush.InquireSupplierPushDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
/**
* 询价推送 Service 接口
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/inquiresupplierpush/InquireSupplierPushServiceImpl.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
service
.
inquiresupplierpush
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushConfirmReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushPageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.app.inquiresupplierpush.vo.AppInquireSupplierPushRespVO
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquirecustomerpush.InquireCustomerPushDO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.AppInquireSupplierPushConfirmReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.AppInquireSupplierPushPageReqVO
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.AppInquireSupplierPushRespVO
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquirepriceitem.InquirePriceItemDO
;
import
cn.iocoder.foodnexus.module.operations.service.inquireprice.InquirePriceService
;
import
cn.iocoder.foodnexus.module.operations.service.inquirepriceitem.InquirePriceItemService
;
import
cn.iocoder.foodnexus.module.system.dal.redis.RedisKeyConstants
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.inquiresupplierpush.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.inquiresupplierpush.InquireSupplierPushDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.operations.dal.mysql.inquiresupplierpush.InquireSupplierPushMapper
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertList
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
diffList
;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
enums
.
ErrorCodeConstants
.*;
/**
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/scoringweight/ScoringWeightService.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
service
.
scoringweight
;
import
java.util.*
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
jakarta.validation.*
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.scoringweight.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.scoringweight.ScoringWeightDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
/**
* 评分权重 Service 接口
*
* @author 超级管理员
*/
public
interface
ScoringWeightService
{
/**
* 创建评分权重
*
* @param createReqVO 创建信息
* @return 编号
*/
Long
createScoringWeight
(
@Valid
ScoringWeightSaveReqVO
createReqVO
);
/**
* 更新评分权重
*
* @param updateReqVO 更新信息
*/
void
updateScoringWeight
(
@Valid
ScoringWeightSaveReqVO
updateReqVO
);
/**
* 删除评分权重
*
* @param id 编号
*/
void
deleteScoringWeight
(
Long
id
);
/**
* 批量删除评分权重
*
* @param ids 编号
*/
void
deleteScoringWeightListByIds
(
List
<
Long
>
ids
);
/**
* 获得评分权重
*
* @param id 编号
* @return 评分权重
*/
ScoringWeightDO
getScoringWeight
(
Long
id
);
/**
* 获得评分权重分页
*
* @param pageReqVO 分页查询
* @return 评分权重分页
*/
PageResult
<
ScoringWeightDO
>
getScoringWeightPage
(
ScoringWeightPageReqVO
pageReqVO
);
List
<
ScoringWeightDO
>
queryByUserSystem
(
UserSystemEnum
userSystemEnum
);
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/scoringweight/ScoringWeightServiceImpl.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
service
.
scoringweight
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
cn.iocoder.foodnexus.module.operations.controller.admin.scoringweight.vo.*
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.scoringweight.ScoringWeightDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.operations.dal.mysql.scoringweight.ScoringWeightMapper
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertList
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
diffList
;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
operations
.
enums
.
ErrorCodeConstants
.*;
/**
* 评分权重 Service 实现类
*
* @author 超级管理员
*/
@Service
@Validated
public
class
ScoringWeightServiceImpl
implements
ScoringWeightService
{
@Resource
private
ScoringWeightMapper
scoringWeightMapper
;
@Override
public
Long
createScoringWeight
(
ScoringWeightSaveReqVO
createReqVO
)
{
// 插入
ScoringWeightDO
scoringWeight
=
BeanUtils
.
toBean
(
createReqVO
,
ScoringWeightDO
.
class
);
scoringWeightMapper
.
insert
(
scoringWeight
);
// 返回
return
scoringWeight
.
getId
();
}
@Override
public
void
updateScoringWeight
(
ScoringWeightSaveReqVO
updateReqVO
)
{
// 校验存在
validateScoringWeightExists
(
updateReqVO
.
getId
());
// 更新
ScoringWeightDO
updateObj
=
BeanUtils
.
toBean
(
updateReqVO
,
ScoringWeightDO
.
class
);
scoringWeightMapper
.
updateById
(
updateObj
);
}
@Override
public
void
deleteScoringWeight
(
Long
id
)
{
// 校验存在
validateScoringWeightExists
(
id
);
// 删除
scoringWeightMapper
.
deleteById
(
id
);
}
@Override
public
void
deleteScoringWeightListByIds
(
List
<
Long
>
ids
)
{
// 删除
scoringWeightMapper
.
deleteByIds
(
ids
);
}
private
void
validateScoringWeightExists
(
Long
id
)
{
if
(
scoringWeightMapper
.
selectById
(
id
)
==
null
)
{
throw
exception
(
SCORING_WEIGHT_NOT_EXISTS
);
}
}
@Override
public
ScoringWeightDO
getScoringWeight
(
Long
id
)
{
return
scoringWeightMapper
.
selectById
(
id
);
}
@Override
public
PageResult
<
ScoringWeightDO
>
getScoringWeightPage
(
ScoringWeightPageReqVO
pageReqVO
)
{
return
scoringWeightMapper
.
selectPage
(
pageReqVO
);
}
@Override
public
List
<
ScoringWeightDO
>
queryByUserSystem
(
UserSystemEnum
userSystemEnum
)
{
return
scoringWeightMapper
.
selectList
(
Wrappers
.<
ScoringWeightDO
>
lambdaQuery
()
.
eq
(
ScoringWeightDO:
:
getIsDisplay
,
Boolean
.
TRUE
)
.
eq
(
ScoringWeightDO:
:
getUserSystem
,
userSystemEnum
.
getKey
())
.
orderByAsc
(
ScoringWeightDO:
:
getSort
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order-api/pom.xml
View file @
a9cea543
...
...
@@ -36,6 +36,12 @@
<artifactId>
foodnexus-module-product-api
</artifactId>
<version>
${revision}
</version>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-annotations-jakarta
</artifactId>
<version>
2.2.28
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/dto/CustomerOrderRemark.java
View file @
a9cea543
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -22,7 +23,7 @@ public class CustomerOrderRemark implements Serializable {
/**
* 操作时间
*/
private
LocalDateTim
e
operTime
;
private
Dat
e
operTime
;
/**
* 相关文件
...
...
foodnexus-module-mall/foodnexus-module-order-api/src/main/java/cn/iocoder/foodnexus/module/order/enums/CustomerOrderStatus.java
View file @
a9cea543
...
...
@@ -86,7 +86,12 @@ public enum CustomerOrderStatus implements ArrayValuable<String> {
return
"您的商品完成签收查看签收单【%s】"
;
}
},
FINISH
(
"订单完成"
,
"FINISH"
,
10
)
{
@Override
public
String
getText
()
{
return
"订单已完成"
;
}
},
CANCEL
(
"取消订单"
,
"CANCEL"
,
9999
)
{
@Override
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/CheckTaskController.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
checktask
;
import
cn.iocoder.foodnexus.module.order.service.checktaskitems.CheckTaskItemsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -38,6 +40,9 @@ public class CheckTaskController {
@Resource
private
CheckTaskService
checkTaskService
;
@Autowired
private
CheckTaskItemsService
checkTaskItemsService
;
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建来料质检"
)
@PreAuthorize
(
"@ss.hasPermission('order:check-task:create')"
)
...
...
@@ -77,7 +82,9 @@ public class CheckTaskController {
@PreAuthorize
(
"@ss.hasPermission('order:check-task:query')"
)
public
CommonResult
<
CheckTaskRespVO
>
getCheckTask
(
@RequestParam
(
"id"
)
Long
id
)
{
CheckTaskDO
checkTask
=
checkTaskService
.
getCheckTask
(
id
);
return
success
(
BeanUtils
.
toBean
(
checkTask
,
CheckTaskRespVO
.
class
));
return
success
(
BeanUtils
.
toBean
(
checkTask
,
CheckTaskRespVO
.
class
,
item
->
{
item
.
setItems
(
BeanUtils
.
toBean
(
checkTaskItemsService
.
queryByCheckId
(
item
.
getId
()),
CheckTaskItemsRespVO
.
class
));
}));
}
@GetMapping
(
"/page"
)
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/checktask/vo/CheckTaskRespVO.java
View file @
a9cea543
...
...
@@ -59,4 +59,7 @@ public class CheckTaskRespVO {
@ExcelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@Schema
(
description
=
"质检子项(详情接口返回)"
)
private
List
<
CheckTaskItemsRespVO
>
items
;
}
\ 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 @
a9cea543
...
...
@@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
...
...
@@ -17,12 +18,18 @@ import static cn.iocoder.foodnexus.framework.common.util.date.DateUtils.FORMAT_Y
@Data
public
class
CustomerOrderPageReqVO
extends
PageParam
{
@Schema
(
description
=
"id集合"
)
private
List
<
Long
>
ids
;
@Schema
(
description
=
"订单编号"
)
private
String
code
;
@Schema
(
description
=
"订单状态"
,
example
=
"2"
)
private
CustomerOrderStatus
orderStatus
;
@Schema
(
description
=
"订单状态集合"
)
private
List
<
String
>
orderStatusList
;
@Schema
(
description
=
"客户id"
,
example
=
"20189"
)
private
Long
customerId
;
...
...
@@ -65,4 +72,7 @@ public class CustomerOrderPageReqVO extends PageParam {
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
LocalDateTime
[]
createTime
;
@Schema
(
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/admin/customerorder/vo/CustomerOrderRespVO.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
customerorder
.
vo
;
import
cn.iocoder.foodnexus.module.erp.api.vo.warehouse.WarehouseInfo
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorderitem.vo.CustomerOrderItemRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorderrecord.vo.CustomerOrderRecordRespVO
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerAddressInfo
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderRemark
;
import
cn.iocoder.foodnexus.module.order.enums.CustomerOrderStatus
;
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
lombok.*
;
...
...
@@ -101,4 +103,10 @@ public class CustomerOrderRespVO {
@Schema
(
description
=
"当前订单进度"
)
private
List
<
CustomerOrderRecordRespVO
>
currentRecords
;
@Schema
(
description
=
"商品集合(page接口返回)"
)
private
List
<
ProductInfo
>
productInfos
;
@Schema
(
description
=
"订单子项(详情接口返回)"
)
private
List
<
CustomerOrderItemRespVO
>
orderItems
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/customerorderitem/vo/CustomerOrderItemRespVO.java
View file @
a9cea543
...
...
@@ -72,4 +72,11 @@ public class CustomerOrderItemRespVO {
@Schema
(
description
=
"订单备注"
)
private
CustomerOrderRemark
orderRemark
;
@Schema
(
description
=
"退货数量"
)
private
Integer
returnsQuantity
;
@Schema
(
description
=
"退货总价,单位:分"
)
private
Integer
returnsTotal
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/orderScore/OrderScoreController.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
orderScore
;
import
org.springframework.web.bind.annotation.*
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Operation
;
import
jakarta.validation.constraints.*
;
import
jakarta.validation.*
;
import
jakarta.servlet.http.*
;
import
java.util.*
;
import
java.io.IOException
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
cn.iocoder.foodnexus.framework.excel.core.util.ExcelUtils
;
import
cn.iocoder.foodnexus.framework.apilog.core.annotation.ApiAccessLog
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
apilog
.
core
.
enums
.
OperateTypeEnum
.*;
import
cn.iocoder.foodnexus.module.order.controller.admin.orderScore.vo.*
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.orderScore.OrderScoreDO
;
import
cn.iocoder.foodnexus.module.order.service.orderScore.OrderScoreService
;
@Tag
(
name
=
"管理后台 - 订单评价"
)
@RestController
@RequestMapping
(
"/order/score"
)
@Validated
public
class
OrderScoreController
{
@Resource
private
OrderScoreService
scoreService
;
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建订单评价"
)
@PreAuthorize
(
"@ss.hasPermission('order:score:create')"
)
public
CommonResult
<
Long
>
createScore
(
@Valid
@RequestBody
OrderScoreSaveReqVO
createReqVO
)
{
return
success
(
scoreService
.
createScore
(
createReqVO
));
}
@PutMapping
(
"/update"
)
@Operation
(
summary
=
"更新订单评价"
)
@PreAuthorize
(
"@ss.hasPermission('order:score:update')"
)
public
CommonResult
<
Boolean
>
updateScore
(
@Valid
@RequestBody
OrderScoreSaveReqVO
updateReqVO
)
{
scoreService
.
updateScore
(
updateReqVO
);
return
success
(
true
);
}
@DeleteMapping
(
"/delete"
)
@Operation
(
summary
=
"删除订单评价"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
)
@PreAuthorize
(
"@ss.hasPermission('order:score:delete')"
)
public
CommonResult
<
Boolean
>
deleteScore
(
@RequestParam
(
"id"
)
Long
id
)
{
scoreService
.
deleteScore
(
id
);
return
success
(
true
);
}
@DeleteMapping
(
"/delete-list"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
@Operation
(
summary
=
"批量删除订单评价"
)
@PreAuthorize
(
"@ss.hasPermission('order:score:delete')"
)
public
CommonResult
<
Boolean
>
deleteScoreList
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
scoreService
.
deleteScoreListByIds
(
ids
);
return
success
(
true
);
}
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得订单评价"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
@PreAuthorize
(
"@ss.hasPermission('order:score:query')"
)
public
CommonResult
<
OrderScoreRespVO
>
getScore
(
@RequestParam
(
"id"
)
Long
id
)
{
OrderScoreDO
score
=
scoreService
.
getScore
(
id
);
return
success
(
BeanUtils
.
toBean
(
score
,
OrderScoreRespVO
.
class
));
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得订单评价分页"
)
@PreAuthorize
(
"@ss.hasPermission('order:score:query')"
)
public
CommonResult
<
PageResult
<
OrderScoreRespVO
>>
getScorePage
(
@Valid
OrderScorePageReqVO
pageReqVO
)
{
PageResult
<
OrderScoreDO
>
pageResult
=
scoreService
.
getScorePage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
OrderScoreRespVO
.
class
));
}
@GetMapping
(
"/export-excel"
)
@Operation
(
summary
=
"导出订单评价 Excel"
)
@PreAuthorize
(
"@ss.hasPermission('order:score:export')"
)
@ApiAccessLog
(
operateType
=
EXPORT
)
public
void
exportScoreExcel
(
@Valid
OrderScorePageReqVO
pageReqVO
,
HttpServletResponse
response
)
throws
IOException
{
pageReqVO
.
setPageSize
(
PageParam
.
PAGE_SIZE_NONE
);
List
<
OrderScoreDO
>
list
=
scoreService
.
getScorePage
(
pageReqVO
).
getList
();
// 导出 Excel
ExcelUtils
.
write
(
response
,
"订单评价.xls"
,
"数据"
,
OrderScoreRespVO
.
class
,
BeanUtils
.
toBean
(
list
,
OrderScoreRespVO
.
class
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/orderScore/vo/OrderScorePageReqVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
orderScore
.
vo
;
import
lombok.*
;
import
java.util.*
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
date
.
DateUtils
.
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
;
@Schema
(
description
=
"管理后台 - 订单评价分页 Request VO"
)
@Data
public
class
OrderScorePageReqVO
extends
PageParam
{
@Schema
(
description
=
"客户订单id"
,
example
=
"4107"
)
private
Long
orderId
;
@Schema
(
description
=
"评价指标id"
,
example
=
"15052"
)
private
Long
scoreId
;
@Schema
(
description
=
"评价指标名称"
,
example
=
"芋艿"
)
private
String
scoreName
;
@Schema
(
description
=
"供应商id"
,
example
=
"23453"
)
private
Set
<
Long
>
supplierIds
;
@Schema
(
description
=
"客户id"
,
example
=
"7606"
)
private
Long
customerId
;
@Schema
(
description
=
"得分"
)
private
Integer
score
;
@Schema
(
description
=
"创建时间"
)
@DateTimeFormat
(
pattern
=
FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND
)
private
LocalDateTime
[]
createTime
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/orderScore/vo/OrderScoreRespVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
orderScore
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
java.util.*
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
cn.idev.excel.annotation.*
;
@Schema
(
description
=
"管理后台 - 订单评价 Response VO"
)
@Data
@ExcelIgnoreUnannotated
public
class
OrderScoreRespVO
{
@Schema
(
description
=
"id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"12656"
)
@ExcelProperty
(
"id"
)
private
Long
id
;
@Schema
(
description
=
"客户订单id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"4107"
)
@ExcelProperty
(
"客户订单id"
)
private
Long
orderId
;
@Schema
(
description
=
"评价指标id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"15052"
)
@ExcelProperty
(
"评价指标id"
)
private
Long
scoreId
;
@Schema
(
description
=
"评价指标名称"
,
example
=
"芋艿"
)
@ExcelProperty
(
"评价指标名称"
)
private
String
scoreName
;
@Schema
(
description
=
"供应商id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"23453"
)
@ExcelProperty
(
"供应商id"
)
private
Set
<
Long
>
supplierIds
;
@Schema
(
description
=
"客户id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"7606"
)
@ExcelProperty
(
"客户id"
)
private
Long
customerId
;
@Schema
(
description
=
"得分"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"得分"
)
private
Integer
score
;
@Schema
(
description
=
"创建时间"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/orderScore/vo/OrderScoreSaveReqVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
orderScore
.
vo
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.*
;
import
java.util.*
;
import
jakarta.validation.constraints.*
;
@Schema
(
description
=
"管理后台 - 订单评价新增/修改 Request VO"
)
@Data
public
class
OrderScoreSaveReqVO
{
@Schema
(
description
=
"id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"12656"
)
private
Long
id
;
@Schema
(
description
=
"客户订单id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"4107"
)
@NotNull
(
message
=
"客户订单id不能为空"
)
private
Long
orderId
;
@Schema
(
description
=
"评价指标id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"15052"
)
@NotNull
(
message
=
"评价指标id不能为空"
)
private
Long
scoreId
;
@Schema
(
description
=
"评价指标名称"
,
example
=
"芋艿"
)
private
String
scoreName
;
@Schema
(
description
=
"供应商id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"23453"
)
@NotNull
(
message
=
"供应商id不能为空"
)
private
Set
<
Long
>
supplierIds
;
@Schema
(
description
=
"客户id"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"7606"
)
@NotNull
(
message
=
"客户id不能为空"
)
private
Long
customerId
;
@Schema
(
description
=
"得分"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@NotNull
(
message
=
"得分不能为空"
)
private
Integer
score
;
@Schema
(
description
=
"排序"
)
private
Integer
sort
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/admin/supplier/SupplierPurchaseOrderController.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
admin
.
supplier
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.purchase.vo.order.*
;
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
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
io.swagger.v3.oas.annotations.Operation
;
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.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
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/11 10:28
* @description: 供应商 - 对账
*/
@Tag
(
name
=
"供应商 - 对账"
)
@RestController
@RequestMapping
(
"/supplier/reconciliation"
)
@Validated
@AppSystemAuth
(
UserSystemEnum
.
SUPPLIER
)
public
class
SupplierPurchaseOrderController
{
@Resource
private
ErpPurchaseOrderService
purchaseOrderService
;
@Autowired
private
ErpSupplierApi
supplierApi
;
@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
,
supplierApi
.
querySupplierIdByUserId
(
getLoginUserId
())));
}
@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
());
PageResult
<
ErpPurchaseOrderDO
>
pageResult
=
purchaseOrderService
.
getPurchaseOrderPage
(
orderPageReqVo
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
SupplierMonthOrderDetailsRespVO
.
class
,
this
::
accept
));
}
private
void
accept
(
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/customerOrder/AppCustomerOrderController.java
View file @
a9cea543
...
...
@@ -10,12 +10,13 @@ import cn.iocoder.foodnexus.module.erp.service.sale.ErpSaleOutService;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorder.vo.CustomerOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorder.vo.CustomerOrderRecordMapVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorder.vo.CustomerOrderRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderReceiptRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderRemarkReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderSaveReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorderitem.vo.CustomerOrderItemRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.*
;
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.dto.AppCustomerReturnOrderReqVO
;
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.customerorderrecord.CustomerOrderRecordService
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
io.swagger.v3.oas.annotations.Operation
;
...
...
@@ -29,8 +30,10 @@ import org.springframework.web.bind.annotation.*;
import
javax.sql.rowset.serial.SerialException
;
import
java.util.List
;
import
java.util.Map
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
security
.
core
.
util
.
SecurityFrameworkUtils
.
getLoginUserId
;
@Tag
(
name
=
"APP - 客户总订单"
)
@RestController
...
...
@@ -44,7 +47,14 @@ public class AppCustomerOrderController {
@Autowired
private
CustomerOrderRecordService
customerOrderRecordService
;
@Autowired
private
ErpSaleOutService
saleOutService
;
private
CustomerOrderItemService
customerOrderItemService
;
@GetMapping
(
"status-count"
)
@Operation
(
summary
=
"客户订单各状态对应数量"
)
public
CommonResult
<
Map
<
String
,
Long
>>
queryStatusCount
()
{
Long
loginUserId
=
getLoginUserId
();
return
success
(
customerOrderService
.
queryStatusCount
(
loginUserId
));
}
@PostMapping
(
"/create"
)
@Operation
(
summary
=
"创建客户总订单"
)
...
...
@@ -83,13 +93,27 @@ public class AppCustomerOrderController {
return
success
(
Boolean
.
TRUE
);
}
@PostMapping
(
"
/
return"
)
@PostMapping
(
"return"
)
@Operation
(
summary
=
"退货"
)
public
CommonResult
<
Boolean
>
orderReturn
(
@Valid
@RequestBody
AppCustomerReturnOrderReqVO
reqVO
)
{
customerOrderService
.
orderReturn
(
reqVO
);
return
success
(
Boolean
.
TRUE
);
}
@GetMapping
(
"score"
)
@Operation
(
summary
=
"查询订单评价"
)
@Parameter
(
name
=
"id"
,
description
=
"客户订单id"
,
required
=
true
)
public
CommonResult
<
AppCustomerOrderScoreRespVO
>
queryScore
(
@RequestParam
(
"id"
)
Long
id
)
{
return
success
(
customerOrderService
.
queryScore
(
id
));
}
@PostMapping
(
"score"
)
@Operation
(
summary
=
"评价订单"
)
public
CommonResult
<
Boolean
>
score
(
@Valid
@RequestBody
AppCustomerOrderScoreReqVO
reqVO
)
{
customerOrderService
.
score
(
reqVO
);
return
success
(
Boolean
.
TRUE
);
}
@DeleteMapping
(
"/delete-list"
)
@Parameter
(
name
=
"ids"
,
description
=
"编号"
,
required
=
true
)
@Operation
(
summary
=
"批量删除客户总订单"
)
...
...
@@ -105,15 +129,18 @@ public class AppCustomerOrderController {
CustomerOrderDO
customerOrder
=
customerOrderService
.
getCustomerOrder
(
id
);
return
success
(
BeanUtils
.
toBean
(
customerOrder
,
CustomerOrderRespVO
.
class
,
item
->
{
item
.
setCurrentRecords
(
customerOrderRecordService
.
queryCurrentRecords
(
item
.
getId
(),
item
.
getOrderStatus
()));
item
.
setOrderItems
(
BeanUtils
.
toBean
(
customerOrderItemService
.
queryByOrderId
(
item
.
getId
()),
CustomerOrderItemRespVO
.
class
));
}));
}
@GetMapping
(
"/page"
)
@Operation
(
summary
=
"获得客户总订单分页"
)
public
CommonResult
<
PageResult
<
CustomerOrderRespVO
>>
getCustomerOrderPage
(
@Valid
CustomerOrderPageReqVO
pageReqVO
)
{
pageReqVO
.
setCreator
(
getLoginUserId
());
PageResult
<
CustomerOrderDO
>
pageResult
=
customerOrderService
.
getCustomerOrderPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
CustomerOrderRespVO
.
class
,
item
->
{
item
.
setCurrentRecords
(
customerOrderRecordService
.
queryCurrentRecords
(
item
.
getId
(),
item
.
getOrderStatus
()));
item
.
setProductInfos
(
CommonUtil
.
listConvert
(
customerOrderItemService
.
queryByOrderId
(
item
.
getId
()),
CustomerOrderItemDO:
:
getProductInfo
));
}));
}
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderScoreReqVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
app
.
customerOrder
.
vo
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderRemark
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.Valid
;
import
jakarta.validation.constraints.Max
;
import
jakarta.validation.constraints.Min
;
import
jakarta.validation.constraints.NotNull
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author : yanghao
* create at: 2025/10/10 15:20
* @description: 客户订单评价
*/
@Data
public
class
AppCustomerOrderScoreReqVO
{
@Schema
(
description
=
"客户订单id"
)
@NotNull
(
message
=
"客户订单id不能为空"
)
private
Long
orderId
;
@Schema
(
description
=
"订单备注"
)
private
CustomerOrderRemark
orderRemark
;
@Schema
(
description
=
"评价指标项"
)
@Valid
private
List
<
Item
>
items
;
@Data
public
static
class
Item
{
@Schema
(
description
=
"评价指标id"
)
@NotNull
(
message
=
"评价指标id不能为空"
)
private
Long
scoreId
;
@Schema
(
description
=
"得分"
)
@Min
(
value
=
1
,
message
=
"得分最低1分"
)
@Max
(
value
=
5
,
message
=
"得分最高5分"
)
private
Integer
score
;
}
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/vo/AppCustomerOrderScoreRespVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
app
.
customerOrder
.
vo
;
import
cn.iocoder.foodnexus.module.order.dto.CustomerOrderRemark
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author : yanghao
* create at: 2025/10/10 15:20
* @description: 客户订单评价
*/
@Data
public
class
AppCustomerOrderScoreRespVO
{
@Schema
(
description
=
"订单备注"
)
private
CustomerOrderRemark
orderRemark
;
@Schema
(
description
=
"评价指标项"
)
private
List
<
Item
>
items
;
@Data
public
static
class
Item
{
@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/app/delivery/DeliveryOrderController.java
View file @
a9cea543
...
...
@@ -10,12 +10,16 @@ import cn.iocoder.foodnexus.framework.security.core.util.SecurityFrameworkUtils;
import
cn.iocoder.foodnexus.module.erp.controller.admin.product.vo.product.ErpProductRespVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.sale.vo.order.ErpSaleOrderPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.sale.vo.order.ErpSaleOrderRespVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.sale.vo.out.ErpSaleOutPageReqVO
;
import
cn.iocoder.foodnexus.module.erp.controller.admin.sale.vo.out.ErpSaleOutRespVO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpCustomerDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpSaleOrderDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpSaleOrderItemDO
;
import
cn.iocoder.foodnexus.module.erp.dal.dataobject.sale.ErpSaleOutDO
;
import
cn.iocoder.foodnexus.module.erp.service.product.ErpProductService
;
import
cn.iocoder.foodnexus.module.erp.service.sale.ErpCustomerService
;
import
cn.iocoder.foodnexus.module.erp.service.sale.ErpSaleOrderService
;
import
cn.iocoder.foodnexus.module.erp.service.sale.ErpSaleOutService
;
import
cn.iocoder.foodnexus.module.order.api.DeliveryStaffApi
;
import
cn.iocoder.foodnexus.module.order.dto.DeliveryOrderUpdateReqVO
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
...
...
@@ -27,6 +31,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import
jakarta.annotation.Resource
;
import
jakarta.validation.Valid
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -59,6 +64,8 @@ public class DeliveryOrderController {
private
ErpProductService
productService
;
@Resource
private
ErpCustomerService
customerService
;
@Autowired
private
ErpSaleOutService
saleOutService
;
@Resource
private
AdminUserApi
adminUserApi
;
...
...
@@ -84,6 +91,13 @@ public class DeliveryOrderController {
return
success
(
Boolean
.
TRUE
);
}
@GetMapping
(
"/sale-out/page"
)
@Operation
(
summary
=
"获得销售出库分页"
)
public
CommonResult
<
PageResult
<
ErpSaleOutRespVO
>>
getSaleOutPage
(
@Valid
ErpSaleOutPageReqVO
pageReqVO
)
{
PageResult
<
ErpSaleOutDO
>
pageResult
=
saleOutService
.
getSaleOutPage
(
pageReqVO
);
return
success
(
BeanUtils
.
toBean
(
pageResult
,
ErpSaleOutRespVO
.
class
));
}
// 订单到货
@PostMapping
(
"/arrival"
)
@Operation
(
summary
=
"订单到货"
)
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/customerorderitem/CustomerOrderItemDO.java
View file @
a9cea543
...
...
@@ -83,4 +83,12 @@ public class CustomerOrderItemDO extends BaseDO {
@TableField
(
typeHandler
=
JacksonTypeHandler
.
class
)
private
CustomerOrderRemark
orderRemark
;
/**
* 退货数量
*/
private
Integer
returnsQuantity
;
/**
* 退货总价,单位:分
*/
private
Integer
returnsTotal
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/dataobject/orderScore/OrderScoreDO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
dal
.
dataobject
.
orderScore
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
lombok.*
;
import
java.util.*
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.*
;
import
cn.iocoder.foodnexus.framework.mybatis.core.dataobject.BaseDO
;
/**
* 订单评价 DO
*
* @author 超级管理员
*/
@TableName
(
value
=
"order_score"
,
autoResultMap
=
true
)
@KeySequence
(
"order_score_seq"
)
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
OrderScoreDO
extends
BaseDO
{
/**
* id
*/
@TableId
private
Long
id
;
/**
* 客户订单id
*/
private
Long
orderId
;
/**
* 评价指标id
*/
private
Long
scoreId
;
/**
* 评价指标名称
*/
private
String
scoreName
;
/**
* 供应商id
*/
@TableField
(
typeHandler
=
JacksonTypeHandler
.
class
)
private
Set
<
Long
>
supplierIds
;
/**
* 客户id
*/
private
Long
customerId
;
/**
* 得分
*/
private
Integer
score
;
/**
* 排序
*/
private
Integer
sort
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/customerorder/CustomerOrderMapper.java
View file @
a9cea543
...
...
@@ -5,7 +5,9 @@ import java.util.*;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.foodnexus.framework.mybatis.core.mapper.BaseMapperX
;
import
cn.iocoder.foodnexus.framework.mybatis.core.query.QueryWrapperX
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customerorder.CustomerOrderDO
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
cn.iocoder.foodnexus.module.order.controller.admin.customerorder.vo.*
;
...
...
@@ -19,8 +21,10 @@ public interface CustomerOrderMapper extends BaseMapperX<CustomerOrderDO> {
default
PageResult
<
CustomerOrderDO
>
selectPage
(
CustomerOrderPageReqVO
reqVO
)
{
return
selectPage
(
reqVO
,
new
LambdaQueryWrapperX
<
CustomerOrderDO
>()
.
inIfPresent
(
CustomerOrderDO:
:
getId
,
reqVO
.
getIds
())
.
eqIfPresent
(
CustomerOrderDO:
:
getCode
,
reqVO
.
getCode
())
.
eqIfPresent
(
CustomerOrderDO:
:
getOrderStatus
,
reqVO
.
getOrderStatus
())
.
inIfPresent
(
CustomerOrderDO:
:
getOrderStatus
,
reqVO
.
getOrderStatusList
())
.
eqIfPresent
(
CustomerOrderDO:
:
getCustomerId
,
reqVO
.
getCustomerId
())
.
eqIfPresent
(
CustomerOrderDO:
:
getWarehouseId
,
reqVO
.
getWarehouseId
())
.
eqIfPresent
(
CustomerOrderDO:
:
getWarehouseAreaId
,
reqVO
.
getWarehouseAreaId
())
...
...
@@ -34,7 +38,15 @@ public interface CustomerOrderMapper extends BaseMapperX<CustomerOrderDO> {
.
eqIfPresent
(
CustomerOrderDO:
:
getActualAmount
,
reqVO
.
getActualAmount
())
.
eqIfPresent
(
CustomerOrderDO:
:
getOperCompany
,
reqVO
.
getOperCompany
())
.
betweenIfPresent
(
CustomerOrderDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
eqIfPresent
(
CustomerOrderDO:
:
getCreator
,
reqVO
.
getCreator
())
.
orderByDesc
(
CustomerOrderDO:
:
getId
));
}
default
List
<
Map
<
String
,
Object
>>
queryStatusCount
(
Long
loginUserId
)
{
QueryWrapperX
<
CustomerOrderDO
>
queryWrapper
=
new
QueryWrapperX
<>();
queryWrapper
.
select
(
"order_status, count(*) as 'status_count'"
);
queryWrapper
.
eq
(
"creator"
,
loginUserId
);
queryWrapper
.
groupBy
(
"order_status"
);
return
this
.
selectMaps
(
queryWrapper
);
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/dal/mysql/orderScore/OrderScoreMapper.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
dal
.
mysql
.
orderScore
;
import
java.util.*
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.foodnexus.framework.mybatis.core.mapper.BaseMapperX
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.orderScore.OrderScoreDO
;
import
org.apache.ibatis.annotations.Mapper
;
import
cn.iocoder.foodnexus.module.order.controller.admin.orderScore.vo.*
;
/**
* 订单评价 Mapper
*
* @author 超级管理员
*/
@Mapper
public
interface
OrderScoreMapper
extends
BaseMapperX
<
OrderScoreDO
>
{
default
PageResult
<
OrderScoreDO
>
selectPage
(
OrderScorePageReqVO
reqVO
)
{
return
selectPage
(
reqVO
,
new
LambdaQueryWrapperX
<
OrderScoreDO
>()
.
eqIfPresent
(
OrderScoreDO:
:
getOrderId
,
reqVO
.
getOrderId
())
.
eqIfPresent
(
OrderScoreDO:
:
getScoreId
,
reqVO
.
getScoreId
())
.
likeIfPresent
(
OrderScoreDO:
:
getScoreName
,
reqVO
.
getScoreName
())
//.eqIfPresent(OrderScoreDO::getSupplierId, reqVO.getSupplierId())
.
eqIfPresent
(
OrderScoreDO:
:
getCustomerId
,
reqVO
.
getCustomerId
())
.
eqIfPresent
(
OrderScoreDO:
:
getScore
,
reqVO
.
getScore
())
.
betweenIfPresent
(
OrderScoreDO:
:
getCreateTime
,
reqVO
.
getCreateTime
())
.
orderByDesc
(
OrderScoreDO:
:
getId
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/enums/ErrorCodeConstants.java
View file @
a9cea543
...
...
@@ -19,6 +19,7 @@ public interface ErrorCodeConstants {
ErrorCode
CUSTOMER_ORDER_STATUS_ERROR
=
new
ErrorCode
(
1_019_100_005
,
"客户订单状态异常"
);
ErrorCode
CUSTOMER_ORDER_OUT_ERROR
=
new
ErrorCode
(
1_019_100_006
,
"客户订单出库环节异常"
);
ErrorCode
CUSTOMER_ORDER_RETURN_PRODUCT_ERROR
=
new
ErrorCode
(
1_019_100_006
,
"客户订单退货商品异常"
);
ErrorCode
CUSTOMER_ORDER_RETURN_COUNT_ERROR
=
new
ErrorCode
(
1_019_100_007
,
"商品{}退货数量异常"
);
// ========== 客户订单-子订单 1_020_100_0001 ==========
ErrorCode
CUSTOMER_ORDER_ITEM_NOT_EXISTS
=
new
ErrorCode
(
1_020_100_001
,
"客户订单-子订单不存在"
);
...
...
@@ -34,4 +35,8 @@ public interface ErrorCodeConstants {
ErrorCode
CHECK_TASK_NOT_EXISTS
=
new
ErrorCode
(
1_023_100_001
,
"来料质检不存在"
);
ErrorCode
CHECK_TASK_CREATE_ERROR
=
new
ErrorCode
(
1_023_100_002
,
"来料质检新增失败"
);
ErrorCode
CHECK_TASK_STATUS_ERROR
=
new
ErrorCode
(
1_023_100_003
,
"来料质检已质检"
);
// ========== 订单评价 1_024_100_001 ==========
ErrorCode
SCORE_NOT_EXISTS
=
new
ErrorCode
(
1_024_100_001
,
"订单评价不存在"
);
ErrorCode
SCORE_EXISTS
=
new
ErrorCode
(
1_024_100_002
,
"订单评价已存在"
);
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktask/CheckTaskServiceImpl.java
View file @
a9cea543
...
...
@@ -26,6 +26,7 @@ import cn.iocoder.foodnexus.module.product.service.category.ProductCategoryServi
import
cn.iocoder.foodnexus.module.product.service.spu.ProductSpuService
;
import
cn.iocoder.foodnexus.module.system.util.GenCodeUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
jakarta.annotation.PostConstruct
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
...
...
@@ -167,7 +168,7 @@ public class CheckTaskServiceImpl implements CheckTaskService, CheckTaskApi {
if
(
checkTaskDO
==
null
)
{
throw
exception
(
CHECK_TASK_NOT_EXISTS
);
}
if
(
CheckTaskStatus
.
NORMAL
.
getKey
().
equals
(
updateReqV
O
.
getStatus
()))
{
if
(
!
CheckTaskStatus
.
TO_BE_CHECK
.
getKey
().
equals
(
checkTaskD
O
.
getStatus
()))
{
throw
exception
(
CHECK_TASK_STATUS_ERROR
);
}
...
...
@@ -228,7 +229,7 @@ public class CheckTaskServiceImpl implements CheckTaskService, CheckTaskApi {
CustomerOrderDO
customerOrder
=
customerOrderService
.
getCustomerOrder
(
purchaseOrder
.
getCustomerOrderId
());
checkTask
.
setNo
(
genCodeUtils
.
createAmBatch
(
"LLZJ"
));
checkTask
.
setStatus
(
CheckTaskStatus
.
TO_BE_CHECK
.
getKey
());
checkTask
.
setSupplierId
(
checkTask
.
getSupplierId
());
checkTask
.
setSupplierId
(
purchaseOrder
.
getSupplierId
());
checkTask
.
setPurchaseOrderId
(
purchaseOrder
.
getId
());
checkTask
.
setCustomerOrderId
(
purchaseOrder
.
getCustomerOrderId
());
checkTask
.
setCustomerId
(
customerOrder
.
getCustomerId
());
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/checktaskitems/CheckTaskItemsService.java
View file @
a9cea543
...
...
@@ -61,4 +61,5 @@ public interface CheckTaskItemsService {
*/
PageResult
<
CheckTaskItemsDO
>
getCheckTaskItemsPage
(
CheckTaskItemsPageReqVO
pageReqVO
);
List
<
CheckTaskItemsDO
>
queryByCheckId
(
Long
id
);
}
\ 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 @
a9cea543
...
...
@@ -69,4 +69,9 @@ public class CheckTaskItemsServiceImpl implements CheckTaskItemsService {
return
checkTaskItemsMapper
.
selectPage
(
pageReqVO
);
}
@Override
public
List
<
CheckTaskItemsDO
>
queryByCheckId
(
Long
id
)
{
return
checkTaskItemsMapper
.
selectList
(
CheckTaskItemsDO:
:
getCheckTaskId
,
id
);
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorder/CustomerOrderService.java
View file @
a9cea543
...
...
@@ -2,9 +2,7 @@ package cn.iocoder.foodnexus.module.order.service.customerorder;
import
java.util.*
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderReceiptRespVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderRemarkReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderSaveReqVO
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.*
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderSaveReqVO
;
import
cn.iocoder.foodnexus.module.order.dto.AppCustomerReturnOrderReqVO
;
import
jakarta.validation.*
;
...
...
@@ -102,4 +100,19 @@ public interface CustomerOrderService {
* @param reqVO
*/
void
orderReturn
(
AppCustomerReturnOrderReqVO
reqVO
);
/**
* 查询订单评价
* @param id
* @return
*/
AppCustomerOrderScoreRespVO
queryScore
(
Long
id
);
/**
* 评价订单
* @param reqVO
*/
void
score
(
AppCustomerOrderScoreReqVO
reqVO
);
Map
<
String
,
Long
>
queryStatusCount
(
Long
loginUserId
);
}
\ 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 @
a9cea543
This diff is collapsed.
Click to expand it.
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorderitem/CustomerOrderItemService.java
View file @
a9cea543
...
...
@@ -62,4 +62,10 @@ public interface CustomerOrderItemService {
PageResult
<
CustomerOrderItemDO
>
getCustomerOrderItemPage
(
CustomerOrderItemPageReqVO
pageReqVO
);
void
createBatch
(
List
<
CustomerOrderItemDO
>
orderItems
,
Long
orderId
);
default
List
<
CustomerOrderItemDO
>
queryByOrderId
(
Long
customerOrderId
)
{
return
queryByOrderId
(
customerOrderId
,
null
);
}
List
<
CustomerOrderItemDO
>
queryByOrderId
(
Long
customerOrderId
,
Long
supplierId
);
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/customerorderitem/CustomerOrderItemServiceImpl.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
service
.
customerorderitem
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.module.erp.service.product.ErpProductService
;
import
cn.iocoder.foodnexus.module.order.controller.app.customerOrder.vo.AppCustomerOrderItemSaveReqVO
;
import
cn.iocoder.foodnexus.module.product.api.dto.ProductInfo
;
import
cn.iocoder.foodnexus.module.product.service.spu.ProductSpuService
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
...
...
@@ -98,4 +101,11 @@ public class CustomerOrderItemServiceImpl implements CustomerOrderItemService {
customerOrderItemMapper
.
insertBatch
(
orderItems
);
}
@Override
public
List
<
CustomerOrderItemDO
>
queryByOrderId
(
Long
customerOrderId
,
Long
supplierId
)
{
return
customerOrderItemMapper
.
selectList
(
Wrappers
.<
CustomerOrderItemDO
>
lambdaQuery
()
.
eq
(
CustomerOrderItemDO:
:
getOrderId
,
customerOrderId
)
.
eq
(
CommonUtil
.
isNotEmpty
(
supplierId
),
CustomerOrderItemDO:
:
getSupplierId
,
supplierId
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/orderScore/OrderScoreService.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
service
.
orderScore
;
import
java.util.*
;
import
jakarta.validation.*
;
import
cn.iocoder.foodnexus.module.order.controller.admin.orderScore.vo.*
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.orderScore.OrderScoreDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
/**
* 订单评价 Service 接口
*
* @author 超级管理员
*/
public
interface
OrderScoreService
{
/**
* 创建订单评价
*
* @param createReqVO 创建信息
* @return 编号
*/
Long
createScore
(
@Valid
OrderScoreSaveReqVO
createReqVO
);
/**
* 更新订单评价
*
* @param updateReqVO 更新信息
*/
void
updateScore
(
@Valid
OrderScoreSaveReqVO
updateReqVO
);
/**
* 删除订单评价
*
* @param id 编号
*/
void
deleteScore
(
Long
id
);
/**
* 批量删除订单评价
*
* @param ids 编号
*/
void
deleteScoreListByIds
(
List
<
Long
>
ids
);
/**
* 获得订单评价
*
* @param id 编号
* @return 订单评价
*/
OrderScoreDO
getScore
(
Long
id
);
/**
* 获得订单评价分页
*
* @param pageReqVO 分页查询
* @return 订单评价分页
*/
PageResult
<
OrderScoreDO
>
getScorePage
(
OrderScorePageReqVO
pageReqVO
);
Integer
queryScore
(
Long
customerOrderId
,
Long
scoreId
);
boolean
exists
(
Long
customerOrderId
,
Long
scoreId
);
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/service/orderScore/OrderScoreServiceImpl.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
service
.
orderScore
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
cn.iocoder.foodnexus.module.order.controller.admin.orderScore.vo.*
;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.orderScore.OrderScoreDO
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageParam
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.order.dal.mysql.orderScore.OrderScoreMapper
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
convertList
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
util
.
collection
.
CollectionUtils
.
diffList
;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
order
.
enums
.
ErrorCodeConstants
.*;
/**
* 订单评价 Service 实现类
*
* @author 超级管理员
*/
@Service
@Validated
public
class
OrderScoreServiceImpl
implements
OrderScoreService
{
@Resource
private
OrderScoreMapper
scoreMapper
;
@Override
public
Long
createScore
(
OrderScoreSaveReqVO
createReqVO
)
{
// 插入
OrderScoreDO
score
=
BeanUtils
.
toBean
(
createReqVO
,
OrderScoreDO
.
class
);
scoreMapper
.
insert
(
score
);
// 返回
return
score
.
getId
();
}
@Override
public
void
updateScore
(
OrderScoreSaveReqVO
updateReqVO
)
{
// 校验存在
validateScoreExists
(
updateReqVO
.
getId
());
// 更新
OrderScoreDO
updateObj
=
BeanUtils
.
toBean
(
updateReqVO
,
OrderScoreDO
.
class
);
scoreMapper
.
updateById
(
updateObj
);
}
@Override
public
void
deleteScore
(
Long
id
)
{
// 校验存在
validateScoreExists
(
id
);
// 删除
scoreMapper
.
deleteById
(
id
);
}
@Override
public
void
deleteScoreListByIds
(
List
<
Long
>
ids
)
{
// 删除
scoreMapper
.
deleteByIds
(
ids
);
}
private
void
validateScoreExists
(
Long
id
)
{
if
(
scoreMapper
.
selectById
(
id
)
==
null
)
{
throw
exception
(
SCORE_NOT_EXISTS
);
}
}
@Override
public
OrderScoreDO
getScore
(
Long
id
)
{
return
scoreMapper
.
selectById
(
id
);
}
@Override
public
PageResult
<
OrderScoreDO
>
getScorePage
(
OrderScorePageReqVO
pageReqVO
)
{
return
scoreMapper
.
selectPage
(
pageReqVO
);
}
@Override
public
Integer
queryScore
(
Long
customerOrderId
,
Long
scoreId
)
{
OrderScoreDO
orderScoreDO
=
scoreMapper
.
selectOne
(
Wrappers
.<
OrderScoreDO
>
lambdaQuery
()
.
eq
(
OrderScoreDO:
:
getOrderId
,
customerOrderId
)
.
eq
(
OrderScoreDO:
:
getScoreId
,
scoreId
));
return
Optional
.
ofNullable
(
orderScoreDO
).
map
(
OrderScoreDO:
:
getScore
).
orElse
(
null
);
}
@Override
public
boolean
exists
(
Long
customerOrderId
,
Long
scoreId
)
{
return
scoreMapper
.
exists
(
Wrappers
.<
OrderScoreDO
>
lambdaQuery
()
.
eq
(
OrderScoreDO:
:
getOrderId
,
customerOrderId
)
.
eq
(
OrderScoreDO:
:
getScoreId
,
scoreId
));
}
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-product/src/main/java/cn/iocoder/foodnexus/module/product/service/spu/ProductSpuService.java
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
product
.
service
.
spu
;
import
cn.iocoder.foodnexus.framework.common.pojo.PageResult
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.framework.common.util.collection.CollectionUtils
;
import
cn.iocoder.foodnexus.module.customerpermission.core.annotation.CustomerVisible
;
import
cn.iocoder.foodnexus.module.product.controller.admin.spu.vo.ProductSpuPageReqVO
;
...
...
@@ -158,4 +159,10 @@ public interface ProductSpuService {
}
List
<
ProductSpuDO
>
validProductList
(
Set
<
Long
>
ids
);
default
String
queryName
(
Long
productId
)
{
return
queryName
(
CommonUtil
.
asList
(
productId
));
}
String
queryName
(
Collection
<
Long
>
productIds
);
}
foodnexus-module-mall/foodnexus-module-product/src/main/java/cn/iocoder/foodnexus/module/product/service/spu/ProductSpuServiceImpl.java
View file @
a9cea543
...
...
@@ -22,7 +22,9 @@ import cn.iocoder.foodnexus.module.product.enums.spu.ProductSpuStatusEnum;
import
cn.iocoder.foodnexus.module.product.service.category.ProductCategoryService
;
import
cn.iocoder.foodnexus.module.system.annotations.AutoSetPrice
;
import
cn.iocoder.foodnexus.module.system.controller.admin.vo.AuditCommonReqVO
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
de.danielbechler.util.Strings
;
import
jakarta.annotation.Resource
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -160,6 +162,14 @@ public class ProductSpuServiceImpl implements ProductSpuService {
}
@Override
public
String
queryName
(
Collection
<
Long
>
productIds
)
{
List
<
ProductSpuDO
>
productSpuDOS
=
productSpuMapper
.
selectList
(
Wrappers
.<
ProductSpuDO
>
lambdaQuery
()
.
select
(
ProductSpuDO:
:
getName
)
.
in
(
ProductSpuDO:
:
getId
,
productIds
));
return
Strings
.
join
(
","
,
CommonUtil
.
listConvert
(
productSpuDOS
,
ProductSpuDO:
:
getName
));
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteSpu
(
Long
id
)
{
// 校验存在
...
...
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/aspect/AppSystemAspect.java
View file @
a9cea543
...
...
@@ -11,14 +11,15 @@ import org.aspectj.lang.JoinPoint;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Before
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.lang.reflect.Method
;
import
java.util.*
;
import
static
cn
.
iocoder
.
foodnexus
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
system
.
enums
.
ErrorCodeConstants
.
NOT_APP_USER
;
import
static
cn
.
iocoder
.
foodnexus
.
module
.
system
.
enums
.
ErrorCodeConstants
.
USER_SYSTEM_ERROR
;
/**
* @author : yanghao
...
...
@@ -33,31 +34,36 @@ public class AppSystemAspect {
private
final
AdminUserService
userService
;
public
static
List
<
Long
>
CACHE
=
new
ArrayList
<>();
public
static
Map
<
Long
,
String
>
CACHE
=
new
HashMap
<>();
// 切点:匹配所有带有 @AppSystemAuth 注解的方法
@Pointcut
(
"@annotation(cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth)"
)
public
void
appSystemAuthPointcut
()
{}
// 前置通知:在目标方法执行前执行
@Before
(
"@within(cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth) || @annotation(cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth)"
)
public
void
beforeAppSystemAuth
(
JoinPoint
joinPoint
)
{
Method
method
=
((
MethodSignature
)
joinPoint
.
getSignature
()).
getMethod
();
Class
<?>
targetClass
=
joinPoint
.
getTarget
().
getClass
();
// 前置通知
@Before
(
"appSystemAuthPointcut() && @annotation(appSystemAuth)"
)
public
void
beforeAppSystemAuth
(
JoinPoint
joinPoint
,
AppSystemAuth
appSystemAuth
)
{
Long
loginUserId
=
SecurityFrameworkUtils
.
getLoginUserId
();
if
(!
CACHE
.
contains
(
loginUserId
))
{
AdminUserDO
user
=
userService
.
getUser
(
loginUserId
);
// 1️⃣ 优先取方法上的注解
AppSystemAuth
appSystemAuth
=
method
.
getAnnotation
(
AppSystemAuth
.
class
);
if
(
appSystemAuth
.
value
()
==
null
)
{
if
(!
UserSystemEnum
.
isAppUser
(
user
.
getUserSystem
())
)
{
throw
exception
(
NOT_APP_USER
);
// 2️⃣ 如果方法上没有,再取类上的注解
if
(
appSystemAuth
==
null
)
{
appSystemAuth
=
targetClass
.
getAnnotation
(
AppSystemAuth
.
class
);
}
Long
loginUserId
=
SecurityFrameworkUtils
.
getLoginUserId
();
String
userSystem
;
if
(
CACHE
.
containsKey
(
loginUserId
))
{
userSystem
=
CACHE
.
get
(
loginUserId
);
}
else
{
// 校验用户体系是否在允许范围内
if
(
Arrays
.
stream
(
appSystemAuth
.
value
()).
noneMatch
(
e
->
e
.
getKey
()
==
user
.
getUserSystem
()))
{
throw
exception
(
NOT_APP_USER
);
}
AdminUserDO
user
=
userService
.
getUser
(
loginUserId
);
userSystem
=
user
.
getUserSystem
();
CACHE
.
put
(
loginUserId
,
userSystem
);
}
// 校验用户体系是否在允许范围内
if
(
Arrays
.
stream
(
appSystemAuth
.
value
()).
noneMatch
(
e
->
Objects
.
equals
(
e
.
getKey
(),
userSystem
)))
{
throw
exception
(
USER_SYSTEM_ERROR
,
Arrays
.
stream
(
appSystemAuth
.
value
()).
toList
());
}
CACHE
.
add
(
loginUserId
);
}
}
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/controller/admin/dept/DeptController.java
View file @
a9cea543
...
...
@@ -3,10 +3,7 @@ package cn.iocoder.foodnexus.module.system.controller.admin.dept;
import
cn.iocoder.foodnexus.framework.common.enums.CommonStatusEnum
;
import
cn.iocoder.foodnexus.framework.common.pojo.CommonResult
;
import
cn.iocoder.foodnexus.framework.common.util.object.BeanUtils
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptListReqVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptRespVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptSimpleRespVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.*
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.dept.DeptDO
;
import
cn.iocoder.foodnexus.module.system.service.dept.DeptService
;
import
io.swagger.v3.oas.annotations.Operation
;
...
...
@@ -34,9 +31,8 @@ public class DeptController {
@PostMapping
(
"create"
)
@Operation
(
summary
=
"创建部门"
)
@PreAuthorize
(
"@ss.hasPermission('system:dept:create')"
)
public
CommonResult
<
Long
>
createDept
(
@Valid
@RequestBody
DeptSaveReqVO
createReqVO
)
{
Long
deptId
=
deptService
.
createDept
(
createReqVO
);
return
success
(
deptId
);
public
CommonResult
<
DeptSaveRespVO
>
createDept
(
@Valid
@RequestBody
DeptSaveReqVO
createReqVO
)
{
return
success
(
deptService
.
createDept
(
createReqVO
));
}
@PutMapping
(
"update"
)
...
...
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/controller/admin/dept/vo/dept/DeptListReqVO.java
View file @
a9cea543
...
...
@@ -13,6 +13,9 @@ public class DeptListReqVO {
@Schema
(
description
=
"展示状态,参见 CommonStatusEnum 枚举类"
,
example
=
"1"
)
private
Integer
status
;
@Schema
(
description
=
"等级"
)
private
String
level
;
@Schema
(
description
=
"用户体系"
,
example
=
"1"
)
private
String
userSystem
;
...
...
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/controller/admin/dept/vo/dept/DeptSaveRespVO.java
0 → 100644
View file @
a9cea543
package
cn
.
iocoder
.
foodnexus
.
module
.
system
.
controller
.
admin
.
dept
.
vo
.
dept
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
/**
* @author : yanghao
* create at: 2025/10/9 16:58
* @description:
*/
@Data
public
class
DeptSaveRespVO
{
@Schema
(
description
=
"部门id"
)
private
Long
id
;
@Schema
(
description
=
"供应商id"
)
private
Long
supplierId
;
@Schema
(
description
=
"客户id"
)
private
Long
customerId
;
}
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/enums/ErrorCodeConstants.java
View file @
a9cea543
...
...
@@ -19,6 +19,7 @@ public interface ErrorCodeConstants {
// ========== APP AUTH 模块 1-002-000-000 ==========
ErrorCode
NOT_APP_USER
=
new
ErrorCode
(
2_002_000_000
,
"非app用户!"
);
ErrorCode
USER_SYSTEM_ERROR
=
new
ErrorCode
(
2_002_000_001
,
"非{}用户!"
);
// ========== 菜单模块 1-002-001-000 ==========
ErrorCode
MENU_NAME_DUPLICATE
=
new
ErrorCode
(
1_002_001_000
,
"已经存在该名字的菜单"
);
...
...
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/service/dept/DeptService.java
View file @
a9cea543
...
...
@@ -3,6 +3,7 @@ package cn.iocoder.foodnexus.module.system.service.dept;
import
cn.iocoder.foodnexus.framework.common.util.collection.CollectionUtils
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptListReqVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptSaveRespVO
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.dept.DeptDO
;
import
java.util.*
;
...
...
@@ -20,7 +21,7 @@ public interface DeptService {
* @param createReqVO 部门信息
* @return 部门编号
*/
Long
createDept
(
DeptSaveReqVO
createReqVO
);
DeptSaveRespVO
createDept
(
DeptSaveReqVO
createReqVO
);
/**
* 更新部门
...
...
foodnexus-module-system/src/main/java/cn/iocoder/foodnexus/module/system/service/dept/DeptServiceImpl.java
View file @
a9cea543
...
...
@@ -11,6 +11,7 @@ import cn.iocoder.foodnexus.module.erp.api.service.ErpCustomerApi;
import
cn.iocoder.foodnexus.module.erp.api.service.ErpSupplierApi
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptListReqVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO
;
import
cn.iocoder.foodnexus.module.system.controller.admin.dept.vo.dept.DeptSaveRespVO
;
import
cn.iocoder.foodnexus.module.system.dal.dataobject.dept.DeptDO
;
import
cn.iocoder.foodnexus.module.system.dal.mysql.dept.DeptMapper
;
import
cn.iocoder.foodnexus.module.system.dal.redis.RedisKeyConstants
;
...
...
@@ -54,7 +55,7 @@ public class DeptServiceImpl implements DeptService {
@CacheEvict
(
cacheNames
=
RedisKeyConstants
.
DEPT_CHILDREN_ID_LIST
,
allEntries
=
true
)
// allEntries 清空所有缓存,因为操作一个部门,涉及到多个缓存
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
createDept
(
DeptSaveReqVO
createReqVO
)
{
public
DeptSaveRespVO
createDept
(
DeptSaveReqVO
createReqVO
)
{
if
(
createReqVO
.
getParentId
()
==
null
)
{
createReqVO
.
setParentId
(
DeptDO
.
PARENT_ID_ROOT
);
}
...
...
@@ -66,14 +67,18 @@ public class DeptServiceImpl implements DeptService {
// 插入部门
DeptDO
dept
=
BeanUtils
.
toBean
(
createReqVO
,
DeptDO
.
class
);
deptMapper
.
insert
(
dept
);
DeptSaveRespVO
deptSaveRespVO
=
new
DeptSaveRespVO
();
if
(
DeptDO
.
PARENT_ID_ROOT
.
equals
(
dept
.
getParentId
()))
{
if
(
UserSystemEnum
.
CUSTOMER
.
getKey
().
equals
(
createReqVO
.
getUserSystem
()))
{
customerApi
.
createByDept
(
dept
.
getId
(),
createReqVO
.
getCustomer
());
Long
customerId
=
customerApi
.
createByDept
(
dept
.
getId
(),
createReqVO
.
getCustomer
());
deptSaveRespVO
.
setCustomerId
(
customerId
);
}
else
if
(
UserSystemEnum
.
SUPPLIER
.
getKey
().
equals
(
createReqVO
.
getUserSystem
()))
{
supplierApi
.
createByDept
(
dept
.
getId
(),
createReqVO
.
getSupplier
());
Long
supplierId
=
supplierApi
.
createByDept
(
dept
.
getId
(),
createReqVO
.
getSupplier
());
deptSaveRespVO
.
setSupplierId
(
supplierId
);
}
}
return
dept
.
getId
();
deptSaveRespVO
.
setId
(
dept
.
getId
());
return
deptSaveRespVO
;
}
@Override
...
...
foodnexus-module-system/src/test/java/cn/iocoder/foodnexus/module/system/service/dept/DeptServiceImplTest.java
View file @
a9cea543
...
...
@@ -45,7 +45,7 @@ public class DeptServiceImplTest extends BaseDbUnitTest {
});
// 调用
Long
deptId
=
deptService
.
createDept
(
reqVO
);
Long
deptId
=
deptService
.
createDept
(
reqVO
)
.
getId
()
;
// 断言
assertNotNull
(
deptId
);
// 校验记录的属性是否正确
...
...
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