|
|
|
@ -56,7 +56,7 @@ public class AdminController {
|
|
|
|
|
@DeleteMapping("/delete/{id}")
|
|
|
|
|
public Result<String> delete(@PathVariable Long id, @RequestParam @NotNull String operation) {
|
|
|
|
|
User user = userService.getById(id);
|
|
|
|
|
if(user == null) {
|
|
|
|
|
if (user == null) {
|
|
|
|
|
return new Result<>(401, "账号不存在", "");
|
|
|
|
|
}
|
|
|
|
|
switch (operation) {
|
|
|
|
@ -77,12 +77,6 @@ public class AdminController {
|
|
|
|
|
// 管理员发送消息
|
|
|
|
|
@PostMapping("/sendMessage")
|
|
|
|
|
public Result<String> sendMessage(@RequestBody @NotNull SendMessageDTO sendMessageDTO) {
|
|
|
|
|
LambdaQueryWrapper<User> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
userLambdaQueryWrapper.eq(User::getId, sendMessageDTO.getId());
|
|
|
|
|
User user = userService.getOne(userLambdaQueryWrapper);
|
|
|
|
|
if(user == null) {
|
|
|
|
|
return new Result<>(404, "用户不存在", "");
|
|
|
|
|
}
|
|
|
|
|
Message message = SendMessageUtil.sendMessage(sendMessageDTO);
|
|
|
|
|
messageService.save(message);
|
|
|
|
|
return new Result<>(200, "发送成功", "");
|
|
|
|
@ -96,7 +90,7 @@ public class AdminController {
|
|
|
|
|
List<ExpressListDTO> expressListDTOList = new ArrayList<>();
|
|
|
|
|
// 获取所有的快递记录
|
|
|
|
|
List<Records> recordsList = recordsService.list();
|
|
|
|
|
for(Records records : recordsList) {
|
|
|
|
|
for (Records records : recordsList) {
|
|
|
|
|
Goods goods = goodsService.getById(records.getGoodsId());
|
|
|
|
|
// 查询寄件人、收件人、签收者、快递员信息
|
|
|
|
|
User sender = userService.getById(records.getSendUserId());
|
|
|
|
|