yanghui
2022-11-21 d0875e8da50625ef0ce083a568de7c8b044aaf4c
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java
@@ -11,6 +11,7 @@
import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO;
import com.panzhihua.common.model.vos.shop.*;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.validated.AddGroup;
import com.panzhihua.common.validated.PutGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -30,7 +31,7 @@
@Slf4j
@RestController
@RequestMapping("/shopFlower/")
@Api(tags = {"商城服务"})
@Api(tags = {"花城商城服务"})
public class ShopFlowerApi extends BaseController {
    @Resource
@@ -60,10 +61,33 @@
    }
    @ApiOperation(value = "查询商品详情", response = ComShopFlowerGoodsVO.class)
    @PostMapping("shopGoodsDetail")
    @GetMapping("shopGoodsDetail")
    @ApiImplicitParam(name = "goodsId", value = "商品id", required = true)
    public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId) {
        return communityService.shopFlowerGoodsDetail(goodsId);
    }
    @ApiOperation(value = "删除商品")
    @DeleteMapping("/goods/delete")
    public R deleteShopGoods(@RequestParam("goodsId") Long goodsId) {
        return communityService.deleteFlowerShopGoods(goodsId);
    }
    @ApiOperation(value = "商品上下架")
    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "商品Id"),
            @ApiImplicitParam(name = "status", value = "1.上架  2.下架 ")})
    @GetMapping("/goods/changeStatus")
    public R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) {
        return communityService.changeFlowerStatus(id, status);
    }
    @ApiOperation(value = "编辑商品")
    @PostMapping("/goods/edit/{id}")
    public R editShopGoods(@PathVariable("id") Long id,
                           @RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) {
        return communityService.editFlowerShopGoods(id, addShopGoodsVO);
    }
    @ApiOperation(value = "新增商品")
    @PostMapping("/goods/save")
    public R saveShopGoods(@RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) {
        return communityService.saveFlowerShopGoods(addShopGoodsVO);
    }
    @ApiOperation(value = "查询用户收货地址列表", response = ComShopUserAddressVO.class)
@@ -145,7 +169,7 @@
    @PostMapping("orderDetail")
    @ApiImplicitParam(name = "orderId", value = "订单id", required = true)
    public R orderDetail(@RequestParam("orderId") Long orderId) {
        return communityService.orderDetail(orderId);
        return communityService.orderDetailFlower(orderId);
    }
    @ApiOperation(value = "取消订单")
@@ -176,17 +200,6 @@
    }
/*    @ApiOperation(value = "统计当前用户订单", response = OrderStatisticsVO.class)
    @PostMapping("orderStatistics")
    public R orderStatistics() {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        if (loginUserInfo == null) {
            return R.fail("请重新登陆");
        }
        return communityService.orderStatistics(loginUserInfo.getUserId());
    }*/
    @ApiOperation(value = "小程序微信调起支付")
    @PostMapping("wxpay")
    public R wxPay(@RequestBody OrderPayDTO orderPayDTO) {
@@ -195,7 +208,7 @@
            return R.fail("请重新登陆");
        }
        orderPayDTO.setOpenId(loginUserInfo.getOpenid());
        return communityService.wxPay(orderPayDTO);
        return communityService.wxPayFlower(orderPayDTO);
    }
    /**
@@ -350,5 +363,62 @@
        return communityService.pageOrderByStoreId(pageComFlowerOrderListDTO);
    }
    /**
     * 查询我的店铺各类统计数据
     * @param storeId
     * @return
     */
    @ApiOperation(value = "查询我的店铺各类统计数据")
    @GetMapping("/selectCountByStoreId")
    public R selectCountByStoreId(Long storeId){
        return communityService.selectCountByStoreId(storeId);
    }
    /**
     * 创建退款订单
     * @param comShopFlowerRefundOrderDTO
     * @return
     */
    @PostMapping("createRefundOrder")
    @ApiOperation(value = "创建退款订单")
    public R createRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO){
        return communityService.createRefundOrder(comShopFlowerRefundOrderDTO);
    }
    /**
     * 用户 分页查询退款订单
     * @param pageComOrderRefundDTO
     * @return
     */
    @PostMapping("pageRefundOrder")
    @ApiOperation(value = "退款订单分页查询 用户",response = ComShopFlowerRefundOrderVO.class)
    public R pageRefundOrder(@RequestBody PageComOrderRefundDTO pageComOrderRefundDTO){
        pageComOrderRefundDTO.setUserId(this.getUserId());
        return communityService.pageRefundOrder(pageComOrderRefundDTO);
    }
    /**
     * 修改退款订单
     * @param comShopFlowerRefundOrderDTO
     * @return
     */
    @PostMapping("updateRefundOrder")
    @ApiOperation(value = "修改退款订单")
    public R updateRefundOrder(@RequestBody ComShopFlowerRefundOrderDTO comShopFlowerRefundOrderDTO){
        return communityService.updateRefundOrder(comShopFlowerRefundOrderDTO);
    }
    /**
     * 商家后台-退款申请统计
     * @param storeId
     * @return
     */
    @GetMapping("selectCountGroupStatus")
    @ApiOperation(value = "商家后台-退款申请统计")
    public R selectCountGroupStatus(Long storeId){
        return communityService.selectCountGroupStatus(storeId);
    }
}