修改食堂
This commit is contained in:
1 parent
d7d73c863b
commit
4936b59d70
7 files changed
+176
-21
No files matched your search
@@ -13,6 +13,11 @@
|
||||
<artifactId>pjcloud-app-server-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-canteen-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-upms-api</artifactId>
|
||||
|
||||
+22
-13
@@ -24,6 +24,10 @@ import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteTokenService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.app.service.AppUserService;
|
||||
import com.bsd.pjcloud.canteen.api.feign.RemoteCanteenSpuService;
|
||||
import com.bsd.pjcloud.canteen.api.feign.RemoteOnlineCanteenSpuService;
|
||||
import com.bsd.pjcloud.canteen.entity.CanteenSpuEntity;
|
||||
import com.bsd.pjcloud.canteen.vo.app.CanteenOnlineSpuAppVO;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.thirdparty.api.feign.RemoterThirdPartyAuthService;
|
||||
@@ -47,6 +51,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -73,6 +78,10 @@ public class AppUserAutoLoginController {
|
||||
|
||||
private final RemoterThirdPartyAuthService remoterThirdPartyAuthService;
|
||||
|
||||
private final RemoteCanteenSpuService remoteCanteenSpuService;
|
||||
|
||||
private final RemoteOnlineCanteenSpuService remoteOnlineCanteenSpuService;
|
||||
|
||||
/*
|
||||
*
|
||||
* @param token 浙政钉前端获取的token
|
||||
@@ -241,20 +250,20 @@ public class AppUserAutoLoginController {
|
||||
stringObjectHashMap.put("refreshToken", refreshToken);
|
||||
return R.ok(stringObjectHashMap);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = { "/test" })
|
||||
@Inner(value = false)
|
||||
public R info() {
|
||||
|
||||
R<List<CanteenOnlineSpuAppVO>> spuListByIds = remoteOnlineCanteenSpuService.getSpuListByIds(Arrays.asList(1876870696924069890L));
|
||||
//
|
||||
// /**
|
||||
// * 获取当前用户全部信息
|
||||
// * @return 用户信息
|
||||
// */
|
||||
// @GetMapping(value = { "/info" })
|
||||
// public R info() {
|
||||
// String username = SecurityUtils.getUser().getUsername();
|
||||
// AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getUsername, username));
|
||||
// if (user == null) {
|
||||
// return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_QUERY_ERROR));
|
||||
// }
|
||||
// return R.ok(appUserService.findUserInfo(user));
|
||||
// }
|
||||
// R<List<CanteenSpuEntity>> spuListByIds = remoteCanteenSpuService.getSpuListByIds(Arrays.asList(1876517188510273537L, 1866411313032441857L));
|
||||
|
||||
List<CanteenOnlineSpuAppVO> data = spuListByIds.getData();
|
||||
|
||||
return R.ok(data);
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 分页查询
|
||||
|
||||
+2
-1
@@ -21,6 +21,7 @@ package com.bsd.pjcloud.canteen.api.feign;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.canteen.dto.CanteenSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.canteen.entity.CanteenSpuEntity;
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
@@ -63,6 +64,6 @@ public interface RemoteCanteenSpuService {
|
||||
* @return ids
|
||||
*/
|
||||
@PostMapping("/canteenSpu/ad/getSpuListByIds")
|
||||
R getSpuListByIds(@RequestBody List<Long> ids);
|
||||
R<List<CanteenSpuEntity>> getSpuListByIds(@RequestBody List<Long> ids);
|
||||
|
||||
}
|
||||
+2
-1
@@ -21,6 +21,7 @@ package com.bsd.pjcloud.canteen.api.feign;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.canteen.dto.CanteenSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.canteen.vo.app.CanteenOnlineSpuAppVO;
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
@@ -63,6 +64,6 @@ public interface RemoteOnlineCanteenSpuService {
|
||||
* @return ids
|
||||
*/
|
||||
@PostMapping("/canteenOnlineSpu/app/getSpuListByIds")
|
||||
R getSpuListByIds(@RequestBody List<Long> ids);
|
||||
R<List<CanteenOnlineSpuAppVO>> getSpuListByIds(@RequestBody List<Long> ids);
|
||||
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package com.bsd.pjcloud.canteen.vo.app;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.MoneyDeserializer;
|
||||
import com.bsd.pjcloud.common.core.util.MoneySerializer;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 在线点餐spu
|
||||
*
|
||||
* @author zjf
|
||||
* @date 2024-12-16 23:42:19
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "在线点餐app spuVo")
|
||||
public class CanteenOnlineSpuAppVO {
|
||||
|
||||
|
||||
/**
|
||||
* 商品 SPU 编号,自增
|
||||
*/
|
||||
@Schema(description="商品 SPU 编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description="商品名称")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@Schema(description="商品详情")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 商品分类编号
|
||||
*/
|
||||
@Schema(description="商品分类编号")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品封面图
|
||||
*/
|
||||
@Schema(description="商品封面图")
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 商品轮播图地址
|
||||
数组,以逗号分隔
|
||||
最多上传15张
|
||||
*/
|
||||
@Schema(description="商品轮播图地址")
|
||||
private String sliderPicUrls;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@Schema(description="排序字段")
|
||||
private Integer sort;
|
||||
|
||||
|
||||
/**
|
||||
* 商品价格,单位使用:分
|
||||
*/
|
||||
@Schema(description="商品价格,单位使用:分")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
* 市场价,单位使用:分
|
||||
*/
|
||||
@Schema(description="市场价,单位使用:分")
|
||||
@JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
@JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer marketPrice;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@Schema(description="库存")
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
@Schema(description="赠送积分")
|
||||
private Integer giveIntegral;
|
||||
|
||||
/**
|
||||
* 商品销量
|
||||
*/
|
||||
@Schema(description="商品销量")
|
||||
private Integer salesCount;
|
||||
|
||||
/**
|
||||
* 商品点击量
|
||||
*/
|
||||
@Schema(description="商品点击量")
|
||||
private Integer browseCount;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Schema(description="商户编号")
|
||||
private Long merchantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
}
|
||||
+8
-3
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.canteen.dto.CanteenOnlineSpuUpdateStockReqDTO;
|
||||
import com.bsd.pjcloud.canteen.vo.app.CanteenOnlineSpuAppVO;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.canteen.entity.CanteenOnlineSpuEntity;
|
||||
@@ -151,9 +153,12 @@ public class CanteenOnlineSpuController {
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过ids查询" , description = "通过ids查询" )
|
||||
@PostMapping("/ad/getSpuListByIds" )
|
||||
@PostMapping("/app/getSpuListByIds" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenSpu_view')" )
|
||||
public R getByIds(@RequestBody List<Long> ids) {
|
||||
return R.ok( canteenOnlineSpuService.list(new LambdaQueryWrapper<CanteenOnlineSpuEntity>().in(CanteenOnlineSpuEntity::getId,ids)));
|
||||
public R<List<CanteenOnlineSpuAppVO>> getByIds(@RequestBody List<Long> ids) {
|
||||
List<CanteenOnlineSpuEntity> list = canteenOnlineSpuService.list(new LambdaQueryWrapper<CanteenOnlineSpuEntity>().in(CanteenOnlineSpuEntity::getId, ids));
|
||||
List<CanteenOnlineSpuAppVO> canteenOnlineSpuAppVOS = BeanUtils.toBean(list, CanteenOnlineSpuAppVO.class);
|
||||
return R.ok(canteenOnlineSpuAppVOS);
|
||||
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -159,8 +159,8 @@ public class CanteenSpuController {
|
||||
*/
|
||||
@Operation(summary = "通过ids查询" , description = "通过ids查询" )
|
||||
@PostMapping("/ad/getSpuListByIds" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenSpu_view')" )
|
||||
public R getByIds(@RequestBody List<Long> ids) {
|
||||
return R.ok( canteenSpuService.list(new LambdaQueryWrapper<CanteenSpuEntity>().in(CanteenSpuEntity::getId,ids)));
|
||||
public R<List<CanteenSpuEntity>> getByIds(@RequestBody List<Long> ids) {
|
||||
List<CanteenSpuEntity> list = canteenSpuService.list(new LambdaQueryWrapper<CanteenSpuEntity>().in(CanteenSpuEntity::getId, ids));
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user