From e557ae3f3046f77805f490219ea447eebcd7355d Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期四, 10 十一月 2022 17:02:48 +0800
Subject: [PATCH] #feat 商品接口提交

---
 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java          |   80 +++++--
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java     |  232 ++++++++---------------
 springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java |  283 ++++++++++++++++++++++++++++
 3 files changed, 422 insertions(+), 173 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
index 890c7ae..a791bf7 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -24,6 +24,7 @@
 import com.panzhihua.common.model.dtos.neighbor.*;
 import com.panzhihua.common.model.dtos.property.PagePropertyWorkerDTO;
 import com.panzhihua.common.model.dtos.property.PropertyWorkerDTO;
+import com.panzhihua.common.model.dtos.shop.*;
 import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO;
 import com.panzhihua.common.model.vos.community.acid.ComActAcidCheckRecordVO;
 import com.panzhihua.common.model.vos.community.acid.ComActAcidMemberVO;
@@ -33,6 +34,7 @@
 import com.panzhihua.common.model.vos.community.raffle.ComActRaffleRecordVO;
 import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO;
 import com.panzhihua.common.model.vos.community.reserve.ComActReserveDangerAreaVO;
+import com.panzhihua.common.model.vos.shop.AddShopFlowerGoodsVO;
 import io.swagger.annotations.ApiParam;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.scheduling.annotation.Async;
@@ -203,27 +205,6 @@
 import com.panzhihua.common.model.dtos.neighbor.DeleteNeighborCircleAppDTO;
 import com.panzhihua.common.model.dtos.neighbor.DetailNeighborAllCommentByAdminDTO;
 import com.panzhihua.common.model.dtos.neighbor.DetailNeighborCommentReplyByAdminDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopAddressDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopCartDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopEditNubCartDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopFundsExportDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderCreateDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderDeliverDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderExportDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderPreviewDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderQueryDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderShipDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopSysConfDTO;
-import com.panzhihua.common.model.dtos.shop.OrderPayDTO;
-import com.panzhihua.common.model.dtos.shop.PageComOrderListDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopAddressDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopFundsSearchDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopSysConfDTO;
-import com.panzhihua.common.model.dtos.shop.WxPayNotifyOrderDTO;
 import com.panzhihua.common.model.dtos.user.PageInputUserDTO;
 import com.panzhihua.common.model.dtos.vaccines.VaccinesByAdminDTO;
 import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollByAdminDTO;
@@ -2952,6 +2933,63 @@
     R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status);
 
     /**
+     * 商品列表-分页查询
+     *
+     * @param pageComShopGoodsDTO
+     *            添加数据
+     */
+    @PostMapping("/shopFlower/pageGoods")
+    R pageFlowerGoodsList(@RequestBody PageComShopFlowerGoodsDTO pageComShopGoodsDTO);
+
+    /**
+     * 商品列表-分页查询
+     *
+     * @param comShopFlowerGoodsDTO
+     *            添加数据
+     */
+    @PostMapping("/shopFlower/pageShopFlowerGoodsByApp")
+    R pageShopFlowerGoodsByApp(@RequestBody  ComShopFlowerGoodsDTO comShopFlowerGoodsDTO);
+
+
+    /**
+     * 新增商品
+     *
+     * @param addShopGoodsVO
+     * @return
+     */
+    @PostMapping("/shopFlower/saveShopGoods")
+    R saveFlowerShopGoods(@RequestBody AddShopFlowerGoodsVO addShopGoodsVO);
+
+    /**
+     * 编辑商品
+     *
+     * @param id
+     * @param addShopGoodsVO
+     * @return
+     */
+    @PostMapping("/shopFlower/editShopGoods/{id}")
+    R editFlowerShopGoods(@PathVariable("id") Long id, @RequestBody AddShopFlowerGoodsVO addShopGoodsVO);
+
+    /**
+     * 删除商品
+     *
+     * @param id
+     * @return
+     */
+    @PostMapping("/shopFlower/deleteShopGoods")
+    R deleteFlowerShopGoods(@RequestBody Long[] id);
+
+    /**
+     * 修改商品状态
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("/shopFlower/changeShopGoodsStatus")
+    R changeFlowerStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status);
+
+
+    /**
      * 结果
      *
      * @param shopOperlog
diff --git a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java
new file mode 100644
index 0000000..00bb30d
--- /dev/null
+++ b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java
@@ -0,0 +1,283 @@
+package com.panzhihua.community_backstage.api;
+
+import com.panzhihua.common.controller.BaseController;
+import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO;
+import com.panzhihua.common.model.dtos.shop.PageComShopFlowerGoodsDTO;
+import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.model.vos.shop.AddShopFlowerGoodsVO;
+import com.panzhihua.common.model.vos.shop.PageShopGoodsVO;
+import com.panzhihua.common.service.community.CommunityService;
+import com.panzhihua.common.service.user.UserService;
+import com.panzhihua.common.validated.AddGroup;
+import com.panzhihua.common.validated.PutGroup;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+/**
+ * @auther yh
+ * @describe 商城管理
+ */
+@Slf4j
+@Api(tags = {"商城管理模块"})
+@RestController("/shopFlower")
+public class ShopFlowerApi extends BaseController {
+    @Value("${excel.userurl}")
+    private String excelUrl;
+    // FTP 登录用户名
+    @Value("${ftp.username}")
+    private String userName;
+    // FTP 登录密码
+    @Value("${ftp.password}")
+    private String password;
+    // FTP 服务器地址IP地址
+    @Value("${ftp.host}")
+    private String host;
+    // FTP 端口
+    @Value("${ftp.port}")
+    private int port;
+    @Resource
+    private CommunityService communityService;
+    @Resource
+    private UserService userService;
+
+
+    @ApiOperation(value = "编辑便民服务商家")
+    @PutMapping("/merchant/put")
+    public R putMerchant(@RequestBody @Validated(PutGroup.class) ConvenientMerchantDTO convenientMerchantDTO) {
+        convenientMerchantDTO.setUpdatedBy(this.getUserId());
+        convenientMerchantDTO.setCreatedBy(this.getUserId());
+        return communityService.putMerchant(convenientMerchantDTO);
+    }
+
+
+    @ApiOperation(value = "分页查询商品", response = PageShopGoodsVO.class)
+    @PostMapping("/goods/page")
+    public R pageGoodsList(@RequestBody PageComShopFlowerGoodsDTO pageComShopGoodsDTO) {
+        return communityService.pageFlowerGoodsList(pageComShopGoodsDTO);
+    }
+
+    @ApiOperation(value = "新增商品")
+    @PostMapping("/goods/save")
+    public R saveShopGoods(@RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) {
+        return communityService.saveFlowerShopGoods(addShopGoodsVO);
+    }
+
+    @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/delete")
+    public R deleteShopGoods(@RequestBody Long[] id) {
+        return communityService.deleteFlowerShopGoods(id);
+    }
+
+    @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 = "订单_分页列表", response = ComShopOrderSearchVO.class)
+    @PostMapping("/order/page")
+    public R page(@RequestBody @Validated PageComShopOrderSearchDTO pageComShopOrderSearchDTO) {
+        // pageComShopOrderSearchDTO.setUserId(this.getUserId());
+        ClazzUtils.setIfStringIsEmpty(pageComShopOrderSearchDTO);
+        return communityService.pageShopOrder(pageComShopOrderSearchDTO);
+    }
+
+    @ApiOperation(value = "订单_详细", response = ComShopOrderPageVO.class)
+    @GetMapping("/order/detail")
+    @ShopOperLog(operType = 11)
+    public R detail(@RequestParam("orderId") Long orderId) {
+        return communityService.orderDetail(orderId);
+    }
+
+    @ApiOperation(value = "订单_导出表格")
+    @PostMapping("/order/export")
+    @ShopOperLog(operType = 12)
+    public R export(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO) {
+        ClazzUtils.setIfStringIsEmpty(comShopOrderExportDTO);
+        String url = excelUrl;
+        String uuid = UUID.randomUUID().toString().replace("-", "");
+        // String name=uuid+".xlsx";
+        String ftpUrl = "/mnt/data/web/excel/";
+
+        R r = communityService.shopOrderExportData(comShopOrderExportDTO);
+        if (R.isOk(r)) {
+            List<ExcelShopOrderDTO> excelShopOrderDTO =
+                JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopOrderDTO.class);
+            if (excelShopOrderDTO == null || excelShopOrderDTO.size() == 0) {
+                return R.ok("未找到数据");
+            }
+            try {
+                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
+                sftp.login();
+                String name = "商城订单-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx";
+                boolean existDir = sftp.isExistDir(ftpUrl + name);
+                if (!existDir) {
+                    String property = System.getProperty("user.dir");
+                    String fileName = property + File.separator + name;
+                    // 这里 需要指定写用哪个class去写
+                    ExcelWriter excelWriter = null;
+                    InputStream inputStream = null;
+                    try {
+                        excelWriter = EasyExcel.write(fileName, ExcelShopOrderDTO.class)
+                            .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
+                            .registerWriteHandler(new CustomSheetWriteHandler()).build();
+                        WriteSheet writeSheet = EasyExcel.writerSheet("订单").build();
+                        excelWriter.write(excelShopOrderDTO, writeSheet);
+                        excelWriter.finish();
+                        File file = new File(fileName);
+                        inputStream = new FileInputStream(file);
+                        sftp.uploadMore(ftpUrl, name, inputStream);
+                        sftp.logout();
+                        inputStream.close();
+                        String absolutePath = file.getAbsolutePath();
+                        boolean delete = file.delete();
+                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
+                    } finally {
+                        // 千万别忘记finish 会帮忙关闭流
+                        if (inputStream != null) {
+                            inputStream.close();
+                        }
+                        if (excelWriter != null) {
+                            excelWriter.finish();
+                        }
+                    }
+                }
+                return R.ok(url + URLEncoder.encode(name, "UTF-8"));
+            } catch (Exception e) {
+                e.printStackTrace();
+                log.error("文件传输失败【{}】", e.getMessage());
+                return R.fail();
+            }
+        }
+        return R.fail("导出数据失败");
+    }
+
+    @ApiOperation(value = "资金_统计信息")
+    @GetMapping("/capital/stat")
+    public R stat() {
+        Long userId = 0L;
+        return communityService.getFundsStat(userId);
+    }
+
+    @ApiOperation(value = "资金_分页列表")
+    @PostMapping("/capital/page")
+    public R page(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO) {
+        pageComShopFundsSearchDTO.setUserId(getUserId());
+        ClazzUtils.setIfStringIsEmpty(pageComShopFundsSearchDTO);
+        return communityService.pageShopFunds(pageComShopFundsSearchDTO);
+    }
+
+    @ApiOperation(value = "资金_详情", response = CapitalDetailVO.class)
+    @ApiImplicitParam(name = "orderId", value = "订单Id")
+    @GetMapping("/capital/capitalDetailByStore")
+    R capitalDetailByStore(@RequestParam("orderId") Long orderId) {
+        return communityService.capitalDetailByStore(orderId);
+    }
+
+    @ApiOperation(value = "资金_导出表格")
+    @PostMapping("/capital/export")
+    @ShopOperLog(operType = 12)
+    public R export(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO) {
+        ClazzUtils.setIfStringIsEmpty(comShopFundsExportDTO);
+        String url = excelUrl;
+        String uuid = UUID.randomUUID().toString().replace("-", "");
+        // String name=uuid+".xlsx";
+        String ftpUrl = "/mnt/data/web/excel/";
+
+        Long userId = this.getUserId();
+        comShopFundsExportDTO.setUserId(userId);
+        R r = communityService.shopOrderFundsExportData(comShopFundsExportDTO);
+        if (R.isOk(r)) {
+            List<ExcelShopFundsDTO> excelShopFundsDTO =
+                JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopFundsDTO.class);
+            if (excelShopFundsDTO == null || excelShopFundsDTO.size() == 0) {
+                return R.ok("未找到数据");
+            }
+            try {
+                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
+                sftp.login();
+                String name = "商家资金流水-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx";
+                boolean existDir = sftp.isExistDir(ftpUrl + name);
+                if (!existDir) {
+                    String property = System.getProperty("user.dir");
+                    String fileName = property + File.separator + name;
+                    // 这里 需要指定写用哪个class去写
+                    ExcelWriter excelWriter = null;
+                    InputStream inputStream = null;
+                    try {
+                        excelWriter = EasyExcel.write(fileName, ExcelShopFundsDTO.class)
+                            .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
+                            .registerWriteHandler(new CustomSheetWriteHandler()).build();
+                        WriteSheet writeSheet = EasyExcel.writerSheet("订单").build();
+                        excelWriter.write(excelShopFundsDTO, writeSheet);
+                        excelWriter.finish();
+                        File file = new File(fileName);
+                        inputStream = new FileInputStream(file);
+                        sftp.uploadMore(ftpUrl, name, inputStream);
+                        sftp.logout();
+                        inputStream.close();
+                        String absolutePath = file.getAbsolutePath();
+                        boolean delete = file.delete();
+                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
+                    } finally {
+                        // 千万别忘记finish 会帮忙关闭流
+                        if (inputStream != null) {
+                            inputStream.close();
+                        }
+                        if (excelWriter != null) {
+                            excelWriter.finish();
+                        }
+                    }
+                }
+                return R.ok(url + URLEncoder.encode(name, "UTF-8"));
+            } catch (Exception e) {
+                e.printStackTrace();
+                log.error("文件传输失败【{}】", e.getMessage());
+                return R.fail();
+            }
+        }
+        return R.fail("导出数据失败");
+    }
+
+    @ApiOperation(value = "商家配置修改")
+    @PutMapping("/shop/conf")
+    public R editConf(@RequestBody ComShopSysConfDTO comShopSysConfDTO) {
+        return communityService.editShopSysConf(comShopSysConfDTO);
+    }
+
+    @ApiOperation(value = "商家配置查询", response = ComShopHiddenConfVO.class)
+    @GetMapping("/shop/conf")
+    public R getConf() {
+        PageComShopSysConfDTO pageComShopSysConfDTO = new PageComShopSysConfDTO();
+        R r = communityService.pageShopSysConf(pageComShopSysConfDTO);
+        if (R.isOk(r) && r.getData() != null) {
+            ComShopSysConfVO comShopSysConfVO =
+                JSONObject.parseObject(JSONObject.toJSONString(r.getData()), ComShopSysConfVO.class);
+            if (comShopSysConfVO != null) {
+                ComShopHiddenConfVO comShopHiddenConfVO = new ComShopHiddenConfVO();
+                comShopHiddenConfVO.setId(comShopSysConfVO.getId());
+                comShopHiddenConfVO.setHidden(comShopSysConfVO.getVal());
+                return R.ok(comShopHiddenConfVO);
+            }
+        }
+        return r;
+    }*/
+
+}
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java
index 39ad2ee..e764885 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java
@@ -1,53 +1,17 @@
 package com.panzhihua.service_community.api;
 
-import java.util.List;
+import com.panzhihua.common.model.dtos.shop.ComShopFlowerGoodsDTO;
+import com.panzhihua.common.model.dtos.shop.PageComShopFlowerGoodsDTO;
+import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.model.vos.shop.AddShopFlowerGoodsVO;
+import com.panzhihua.common.service.user.UserService;
+import com.panzhihua.service_community.service.ComShopFlowerGoodsService;
+import com.panzhihua.service_community.service.ConvenientMerchantService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-
-import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO;
-import com.panzhihua.service_community.service.*;
-import org.springframework.beans.BeanUtils;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.panzhihua.common.model.dtos.PageDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopAddressDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopCartDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopEditNubCartDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopFundsExportDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderCreateDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderDeliverDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderExportDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderPreviewDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderQueryDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopOrderShipDTO;
-import com.panzhihua.common.model.dtos.shop.ComShopSysConfDTO;
-import com.panzhihua.common.model.dtos.shop.OrderPayDTO;
-import com.panzhihua.common.model.dtos.shop.PageComOrderListDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopAddressDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopFundsSearchDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO;
-import com.panzhihua.common.model.dtos.shop.PageComShopSysConfDTO;
-import com.panzhihua.common.model.dtos.shop.WxPayNotifyOrderDTO;
-import com.panzhihua.common.model.vos.R;
-import com.panzhihua.common.model.vos.shop.AddShopGoodsVO;
-import com.panzhihua.common.model.vos.shop.ComShopSysConfVO;
-import com.panzhihua.common.model.vos.shop.ShopOperLogVO;
-import com.panzhihua.common.model.vos.shop.ShopStoreVO;
-import com.panzhihua.common.service.user.UserService;
-import com.panzhihua.service_community.model.dos.ComShopSysConfDO;
-
-import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
 @RestController
@@ -70,8 +34,77 @@
     @Resource
     private UserService userService;
 
+
+    /**
+     * 商品列表-分页查询
+     *
+     * @param pageComShopGoodsDTO 查询参数
+     * @return PageShopStoreVO
+     */
+    @PostMapping("pageGoods")
+    public R pageFlowerGoodsList(@RequestBody PageComShopFlowerGoodsDTO pageComShopGoodsDTO) {
+        return comShopFlowerGoodsService.pageFlowerGoodsList(pageComShopGoodsDTO);
+    }
+
+    /**
+     * 商品列表-APP分页查询
+     *
+     * @param comShopFlowerGoodsDTO 查询参数
+     * @return PageShopStoreVO
+     */
+    @PostMapping("pageShopFlowerGoodsByApp")
+    public R pageShopFlowerGoodsByApp(@RequestBody ComShopFlowerGoodsDTO comShopFlowerGoodsDTO) {
+        return comShopFlowerGoodsService.pageShopFlowerGoodsByApp(comShopFlowerGoodsDTO);
+    }
+
+    /**
+     * 新增商品
+     *
+     * @param addShopGoodsVO
+     * @return
+     */
+    @PostMapping("saveShopGoods")
+    public R saveFlowerShopGoods(@RequestBody AddShopFlowerGoodsVO addShopGoodsVO) {
+        return comShopFlowerGoodsService.saveShopFlowerGoods(addShopGoodsVO);
+    }
+
+    /**
+     * 编辑商品
+     *
+     * @param addShopGoodsVO
+     * @param id             商铺Id
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @PostMapping("editShopGoods/{id}")
+    public R editFlowerShopGoods(@PathVariable("id") Long id, @RequestBody AddShopFlowerGoodsVO addShopGoodsVO) {
+        return comShopFlowerGoodsService.editFlowerShopGoods(id, addShopGoodsVO);
+    }
+
+    /**
+     * 删除商品
+     *
+     * @param id
+     * @return
+     */
+    @PostMapping("deleteShopGoods")
+    public R deleteFlowerShopGoods(@RequestBody Long[] id) {
+        return comShopFlowerGoodsService.deleteShopFlowerGoods(id);
+    }
+
+    /**
+     * 修改商品状态
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("changeShopGoodsStatus")
+    public R changeFlowerStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) {
+        return comShopFlowerGoodsService.changeStatus(id, status);
+    }
+
     /*
-    *//**
+     *//**
      * 分页查询 商家订单
      *
      * @param pageComShopOrderSearchDTO
@@ -130,54 +163,6 @@
     @PostMapping("shopCartList")
     public R shopCartList(@RequestParam("userId") Long userId) {
         return comShopCartService.shopCartList(userId);
-    }
-
-    *//**
-     * 查询用户购物车数量
-     *
-     * @param userId
-     *            用户id
-     * @return 用户购物车商品数量
-     *//*
-    @PostMapping("shopCartUserTotal")
-    public R shopCartUserTotal(@RequestParam("userId") Long userId) {
-        return comShopCartService.shopCartUserTotal(userId);
-    }
-
-    *//**
-     * 购物车添加
-     *
-     * @param comShopCartDTO
-     *            请求参数
-     * @return 添加结果
-     *//*
-    @PostMapping("shopAddCart")
-    public R shopAddCart(@RequestBody ComShopCartDTO comShopCartDTO) {
-        return comShopCartService.shopAddCart(comShopCartDTO);
-    }
-
-    *//**
-     * 购物车内商品数量添加
-     *
-     * @param shopEditNubCartDTO
-     *            请求参数
-     * @return 修改结果
-     *//*
-    @PostMapping("shopEditNubCart")
-    public R shopEditNubCart(@RequestBody ComShopEditNubCartDTO shopEditNubCartDTO) {
-        return comShopCartService.shopEditNubCart(shopEditNubCartDTO);
-    }
-
-    *//**
-     * 删除购物车记录
-     *
-     * @param Ids
-     *            购物车id集合
-     * @return 删除结果
-     *//*
-    @PostMapping("shopDelCart")
-    public R shopDelCart(@RequestBody List<Long> Ids) {
-        return comShopCartService.shopDelCart(Ids);
     }
 
     *//**
@@ -324,64 +309,7 @@
         return comShopOrderService.orderStatistics(userId);
     }
 
-    *//**
-     * 商品列表-分页查询
-     *
-     * @param pageComShopGoodsDTO
-     *            查询参数
-     * @return PageShopStoreVO
-     *//*
-    @PostMapping("pageGoods")
-    public R pageShopStore(@RequestBody PageComShopGoodsDTO pageComShopGoodsDTO) {
-        return comShopFlowerGoodsService.pageGoodsList(pageComShopGoodsDTO);
-    }
 
-    *//**
-     * 新增商品
-     *
-     * @param addShopGoodsVO
-     * @return
-     *//*
-    @PostMapping("saveShopGoods")
-    public R saveStore(@RequestBody AddShopGoodsVO addShopGoodsVO) {
-        return comShopFlowerGoodsService.saveShopGoods(addShopGoodsVO);
-    }
-
-    *//**
-     * 编辑商品
-     *
-     * @param addShopGoodsVO
-     * @param id
-     *            商铺Id
-     * @return
-     *//*
-    @Transactional(rollbackFor = Exception.class)
-    @PostMapping("editShopGoods/{id}")
-    public R editShopGoods(@PathVariable("id") Long id, @RequestBody AddShopGoodsVO addShopGoodsVO) {
-        return comShopFlowerGoodsService.editShopGoods(id, addShopGoodsVO);
-    }
-
-    *//**
-     * 删除商品
-     *
-     * @param id
-     * @return
-     *//*
-    @PostMapping("deleteShopGoods")
-    public R deleteShopGoods(@RequestBody Long[] id) {
-        return comShopFlowerGoodsService.deleteShopGoods(id);
-    }
-
-    *//**
-     * 修改商品状态
-     *
-     * @param id
-     * @return
-     *//*
-    @GetMapping("changeShopGoodsStatus")
-    public R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) {
-        return comShopFlowerGoodsService.changeStatus(id, status);
-    }
 
     *//**
      * 商家资金的订单详情

--
Gitblit v1.7.1