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
9d633d1d
Commit
9d633d1d
authored
Sep 26, 2025
by
杨浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配送员创建系统用户
parent
4d0e9e6d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
7 deletions
+70
-7
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/deliverystaff/DeliveryStaffController.java
+1
-1
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/dataobject/deliverystaff/DeliveryStaffDO.java
+5
-0
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/deliverystaff/DeliveryStaffServiceImpl.java
+37
-3
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/AppCustomerOrderController.java
+1
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/CustomerAddressController.java
+1
-1
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/delivery/DeliveryOrderController.java
+24
-0
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/shoppingcart/ShoppingCartController.java
+1
-1
No files found.
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/controller/admin/deliverystaff/DeliveryStaffController.java
View file @
9d633d1d
...
...
@@ -31,7 +31,7 @@ import cn.iocoder.foodnexus.module.operations.controller.admin.deliverystaff.vo.
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.deliverystaff.DeliveryStaffDO
;
import
cn.iocoder.foodnexus.module.operations.service.deliverystaff.DeliveryStaffService
;
@Tag
(
name
=
"
管理后台
- 配送员信息"
)
@Tag
(
name
=
"
APP
- 配送员信息"
)
@RestController
@RequestMapping
(
"/operation/delivery-staff"
)
@Validated
...
...
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/dal/dataobject/deliverystaff/DeliveryStaffDO.java
View file @
9d633d1d
...
...
@@ -87,6 +87,10 @@ public class DeliveryStaffDO extends BaseDO {
* 备注
*/
private
String
remark
;
/**
* 关联系统用户id
*/
private
Long
userId
;
}
\ No newline at end of file
foodnexus-module-mall/foodnexus-module-operations/src/main/java/cn/iocoder/foodnexus/module/operations/service/deliverystaff/DeliveryStaffServiceImpl.java
View file @
9d633d1d
...
...
@@ -2,11 +2,16 @@ package cn.iocoder.foodnexus.module.operations.service.deliverystaff;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.stream.StreamUtil
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
cn.iocoder.foodnexus.framework.common.util.CommonUtil
;
import
cn.iocoder.foodnexus.module.operations.dal.dataobject.deliverystaffcustomer.DeliveryStaffCustomerDO
;
import
cn.iocoder.foodnexus.module.operations.dal.mysql.deliverystaffcustomer.DeliveryStaffCustomerMapper
;
import
cn.iocoder.foodnexus.module.order.api.DeliveryStaffApi
;
import
cn.iocoder.foodnexus.module.system.controller.admin.user.vo.user.UserSaveReqVO
;
import
cn.iocoder.foodnexus.module.system.service.dept.DeptService
;
import
cn.iocoder.foodnexus.module.system.service.user.AdminUserService
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
jakarta.annotation.Resource
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -41,23 +46,50 @@ public class DeliveryStaffServiceImpl implements DeliveryStaffService, DeliveryS
@Resource
private
DeliveryStaffCustomerMapper
deliveryStaffCustomerMapper
;
@Autowired
private
AdminUserService
userService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
createDeliveryStaff
(
DeliveryStaffSaveReqVO
createReqVO
)
{
// 插入
DeliveryStaffDO
deliveryStaff
=
BeanUtils
.
toBean
(
createReqVO
,
DeliveryStaffDO
.
class
);
// 新建一个账号
UserSaveReqVO
userSaveReqVO
=
new
UserSaveReqVO
();
userSaveReqVO
.
setUsername
(
createReqVO
.
getName
());
userSaveReqVO
.
setNickname
(
createReqVO
.
getName
());
userSaveReqVO
.
setRemark
(
createReqVO
.
getRemark
());
// TODO 待定
userSaveReqVO
.
setDeptId
(
100L
);
userSaveReqVO
.
setMobile
(
createReqVO
.
getContact
());
userSaveReqVO
.
setUserSystem
(
UserSystemEnum
.
DELIVERY
.
getKey
());
userSaveReqVO
.
setPassword
(
"123456"
);
Long
userId
=
userService
.
createUser
(
userSaveReqVO
);
deliveryStaff
.
setUserId
(
userId
);
deliveryStaffMapper
.
insert
(
deliveryStaff
);
// 返回
return
deliveryStaff
.
getId
();
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateDeliveryStaff
(
DeliveryStaffSaveReqVO
updateReqVO
)
{
// 校验存在
validateDeliveryStaffExists
(
updateReqVO
.
getId
());
DeliveryStaffDO
deliveryStaffDO
=
validateDeliveryStaffExists
(
updateReqVO
.
getId
());
// 更新
DeliveryStaffDO
updateObj
=
BeanUtils
.
toBean
(
updateReqVO
,
DeliveryStaffDO
.
class
);
deliveryStaffMapper
.
updateById
(
updateObj
);
UserSaveReqVO
updateUser
=
new
UserSaveReqVO
();
updateUser
.
setId
(
deliveryStaffDO
.
getUserId
());
updateUser
.
setUsername
(
updateReqVO
.
getName
());
updateUser
.
setNickname
(
updateReqVO
.
getName
());
updateUser
.
setRemark
(
updateReqVO
.
getRemark
());
updateUser
.
setMobile
(
updateReqVO
.
getContact
());
userService
.
updateUser
(
updateUser
);
}
@Override
...
...
@@ -75,10 +107,12 @@ public class DeliveryStaffServiceImpl implements DeliveryStaffService, DeliveryS
}
private
void
validateDeliveryStaffExists
(
Long
id
)
{
if
(
deliveryStaffMapper
.
selectById
(
id
)
==
null
)
{
private
DeliveryStaffDO
validateDeliveryStaffExists
(
Long
id
)
{
DeliveryStaffDO
deliveryStaffDO
=
deliveryStaffMapper
.
selectById
(
id
);
if
(
deliveryStaffDO
==
null
)
{
throw
exception
(
DELIVERY_STAFF_NOT_EXISTS
);
}
return
deliveryStaffDO
;
}
@Override
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customerOrder/AppCustomerOrderController.java
View file @
9d633d1d
...
...
@@ -34,7 +34,7 @@ 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
=
"
管理后台
- 客户总订单"
)
@Tag
(
name
=
"
APP
- 客户总订单"
)
@RestController
@RequestMapping
(
"/order/customer-order"
)
@Validated
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/customeraddress/CustomerAddressController.java
View file @
9d633d1d
...
...
@@ -30,7 +30,7 @@ import static cn.iocoder.foodnexus.framework.apilog.core.enums.OperateTypeEnum.*
import
cn.iocoder.foodnexus.module.order.dal.dataobject.customeraddress.CustomerAddressDO
;
import
cn.iocoder.foodnexus.module.order.service.customeraddress.CustomerAddressService
;
@Tag
(
name
=
"
管理后台
- 客户 - 我的地址"
)
@Tag
(
name
=
"
APP
- 客户 - 我的地址"
)
@RestController
@RequestMapping
(
"/order/customer-address"
)
@Validated
...
...
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/delivery/DeliveryOrderController.java
0 → 100644
View file @
9d633d1d
package
cn
.
iocoder
.
foodnexus
.
module
.
order
.
controller
.
app
.
delivery
;
import
cn.iocoder.foodnexus.framework.common.enums.UserSystemEnum
;
import
cn.iocoder.foodnexus.module.system.annotations.AppSystemAuth
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author : yanghao
* create at: 2025/9/26 09:49
* @description: 订单 - 配送
*/
@Tag
(
name
=
"管理后台 - 订单 - 配送"
)
@RestController
@RequestMapping
(
"/delivery/order"
)
@Validated
@AppSystemAuth
(
UserSystemEnum
.
DELIVERY
)
public
class
DeliveryOrderController
{
}
foodnexus-module-mall/foodnexus-module-order/src/main/java/cn/iocoder/foodnexus/module/order/controller/app/shoppingcart/ShoppingCartController.java
View file @
9d633d1d
...
...
@@ -26,7 +26,7 @@ import cn.iocoder.foodnexus.module.order.controller.app.shoppingcart.vo.*;
import
cn.iocoder.foodnexus.module.order.dal.dataobject.shoppingcart.ShoppingCartDO
;
import
cn.iocoder.foodnexus.module.order.service.shoppingcart.ShoppingCartService
;
@Tag
(
name
=
"
管理后台
- 购物车"
)
@Tag
(
name
=
"
APP
- 购物车"
)
@RestController
@RequestMapping
(
"/order/shopping-cart"
)
@Validated
...
...
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