Merge branch 'master' of https://codeup.aliyun.com/bsdtec/biz-api-cloud
This commit is contained in:
commit
46d4757f55
6 files changed
+167
-3
No files matched your search
+61
@@ -0,0 +1,61 @@
|
||||
package com.bsd.pjcloud.canteen.vo.preferences;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* @author ml
|
||||
* 点菜明细
|
||||
*/
|
||||
@Data
|
||||
public class FoodOrderVO {
|
||||
|
||||
private String userId;
|
||||
|
||||
@ExcelProperty("用户名称")
|
||||
private String nickName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ExcelProperty(value = "支付时间",format = "yyyy-MM-dd HH:mm:ss")
|
||||
private String payTime;
|
||||
|
||||
/**
|
||||
* 支付总数
|
||||
*/
|
||||
private Integer payNum;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
/**
|
||||
* 支付总金额
|
||||
*/
|
||||
@ExcelProperty(value = "支付金额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
@ExcelProperty(value = "商品id")
|
||||
private Long id;
|
||||
|
||||
@ExcelProperty(value = "商品名称")
|
||||
private String spuName;
|
||||
|
||||
/**
|
||||
* 商品封面图
|
||||
*/
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@ExcelProperty(value = "商品分类")
|
||||
private String categoryName;
|
||||
|
||||
}
|
||||
@@ -77,6 +77,21 @@
|
||||
<artifactId>pjcloud-canteen-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-hardware-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-wallet-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-upms-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
</dependency>
|
||||
<!--必备: log 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
|
||||
+35
-1
@@ -3,14 +3,27 @@ package com.bsd.pjcloud.canteen.service.impl;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.canteen.dto.UserPageDTO;
|
||||
import com.bsd.pjcloud.canteen.mapper.OrderingPreferencesMapper;
|
||||
import com.bsd.pjcloud.canteen.service.OrderingPreferencesService;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderPreferencesDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.feign.RemoteHardOrderService;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteWalletService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -19,8 +32,29 @@ public class OrderingPreferencesServiceImpl implements OrderingPreferencesServi
|
||||
|
||||
private final OrderingPreferencesMapper orderingPreferencesMapper;
|
||||
|
||||
private final RemoteHardOrderService remoteHardOrderService;
|
||||
|
||||
private final RemoteMchService remoteMchService;
|
||||
|
||||
private final RemoteUserService userService;
|
||||
@Override
|
||||
public IPage getPage(Page page, UserPageDTO userPageDTO) {
|
||||
return orderingPreferencesMapper.getPage(page,userPageDTO,DataScope.of());
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
|
||||
Long deptId = user.getDeptId();
|
||||
MchManageVo manageVo = remoteMchService.getByDeptId(deptId).getData();
|
||||
HardOrderPreferencesDto hardOrderPreferencesDto = new HardOrderPreferencesDto();
|
||||
//管理员
|
||||
if (user.getId() != 1L){
|
||||
hardOrderPreferencesDto.setMerchantId(manageVo.getId());
|
||||
}
|
||||
hardOrderPreferencesDto.setOrderType(HardOrderTypeEnum.BELOW.getType());
|
||||
hardOrderPreferencesDto.setTimes(userPageDTO.getTimes());
|
||||
|
||||
R<Page<List<HardOrderEntity>>> pageData= remoteHardOrderService.getPage(page, hardOrderPreferencesDto);
|
||||
//todo 调用用户和购物车组合
|
||||
pageData.getData().getRecords().forEach(item->{
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户点餐明细dto
|
||||
*/
|
||||
@Data
|
||||
public class HardOrderPreferencesDto {
|
||||
|
||||
/**
|
||||
* 订单类型
|
||||
*/
|
||||
@Schema(description="订单类型")
|
||||
private String orderType;
|
||||
|
||||
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
@Schema(description="商户id")
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDate[] times;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
@Schema(description="订单状态")
|
||||
private String orderStatus;
|
||||
|
||||
}
|
||||
+8
@@ -1,11 +1,15 @@
|
||||
package com.bsd.pjcloud.hard.api.feign;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderPreferencesDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
@@ -17,4 +21,8 @@ public interface RemoteHardOrderService {
|
||||
@GetMapping("/hard-order/get-by-ids")
|
||||
R<List<HardOrderEntity>> getByIds(@RequestParam List<Long> ids);
|
||||
|
||||
|
||||
|
||||
@PostMapping("/hard-order/page")
|
||||
R<Page<List<HardOrderEntity>>> getPage(@RequestParam Page page, @RequestBody HardOrderPreferencesDto hardOrderPreferencesDto);
|
||||
}
|
||||
+7
-2
@@ -15,6 +15,7 @@ import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderPreferencesDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.mapper.order.HardOrderMapper;
|
||||
@@ -87,10 +88,14 @@ public class HardOrderController {
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PostMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_view')")
|
||||
public R getHardwareOrderPage(@ParameterObject Page page, @ParameterObject HardOrderEntity hardwareOrder) {
|
||||
public R<Page<List<HardOrderEntity>>> getHardwareOrderPage(@ParameterObject Page page, @RequestBody HardOrderPreferencesDto hpPreferencesDto) {
|
||||
LambdaQueryWrapper<HardOrderEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(hpPreferencesDto.getMerchantId()!=null, HardOrderEntity::getMerchantId, hpPreferencesDto.getMerchantId());
|
||||
wrapper.eq(HardOrderEntity::getOrderType, hpPreferencesDto.getOrderType());
|
||||
wrapper.eq(hpPreferencesDto.getOrderStatus()!=null, HardOrderEntity::getOrderStatus, hpPreferencesDto.getOrderStatus());
|
||||
wrapper.between(hpPreferencesDto.getTimes()!=null, HardOrderEntity::getCreateTime, hpPreferencesDto.getTimes()[0], hpPreferencesDto.getTimes()[1]);
|
||||
return R.ok(hardwareOrderService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user