夏文涛 1 год назад
Родитель
Сommit
c8fd9d00ec
23 измененных файлов с 1452 добавлено и 745 удалено
  1. 1 0
      src/main/java/com/sqx/modules/goods/service/GoodsShopService.java
  2. 8 0
      src/main/java/com/sqx/modules/goods/service/impl/GoodsShopServiceImpl.java
  3. 350 42
      src/main/java/com/sqx/modules/printInfo/controller/PrintInfoController.java
  4. 7 34
      src/main/java/com/sqx/modules/printInfo/controller/app/AppPrintInfoController.java
  5. 2 2
      src/main/java/com/sqx/modules/printInfo/dao/PrintInfoDao.java
  6. 2 1
      src/main/java/com/sqx/modules/printInfo/dao/PrintInfoShopDao.java
  7. 4 27
      src/main/java/com/sqx/modules/printInfo/entity/PrintDropVo.java
  8. 20 35
      src/main/java/com/sqx/modules/printInfo/entity/PrintInfo.java
  9. 13 13
      src/main/java/com/sqx/modules/printInfo/entity/PrintInfoShop.java
  10. 15 4
      src/main/java/com/sqx/modules/printInfo/entity/PrintModelDetailResult.java
  11. 15 6
      src/main/java/com/sqx/modules/printInfo/entity/PrintModelResult.java
  12. 13 4
      src/main/java/com/sqx/modules/printInfo/entity/PrintModelTypeResult.java
  13. 8 7
      src/main/java/com/sqx/modules/printInfo/entity/PrintResultModelVo.java
  14. 19 27
      src/main/java/com/sqx/modules/printInfo/entity/eOrderTypeExtra.java
  15. 30 38
      src/main/java/com/sqx/modules/printInfo/entity/ePrintStatu.java
  16. 13 21
      src/main/java/com/sqx/modules/printInfo/entity/eWordSize.java
  17. 11 28
      src/main/java/com/sqx/modules/printInfo/service/PrintInfoService.java
  18. 5 7
      src/main/java/com/sqx/modules/printInfo/service/PrintInfoShopService.java
  19. 36 157
      src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoServiceImpl.java
  20. 18 44
      src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoShopServiceImpl.java
  21. 859 241
      src/main/java/com/sqx/modules/utils/fieYun/FeiYunUtils.java
  22. 2 6
      src/main/resources/mapper/printInfo/PrintInfoDao.xml
  23. 1 1
      src/main/resources/mapper/printInfo/PrintInfoShopDao.xml

+ 1 - 0
src/main/java/com/sqx/modules/goods/service/GoodsShopService.java

@@ -43,4 +43,5 @@ public interface GoodsShopService extends IService<GoodsShop> {
 
     ActivityManage getShopActivity(Long shopId);
 
+    GoodsShop selectGoodDatas(Long shopId);
 }

+ 8 - 0
src/main/java/com/sqx/modules/goods/service/impl/GoodsShopServiceImpl.java

@@ -530,5 +530,13 @@ public class GoodsShopServiceImpl extends ServiceImpl<GoodsShopDao, GoodsShop> i
 
     }
 
+    @Override
+    public GoodsShop selectGoodDatas(Long shopId) {
+        QueryWrapper<GoodsShop> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("shop_id",shopId);
+        GoodsShop result = goodsShopDao.selectOne(queryWrapper);
+        return result;
+    }
+
 
 }

+ 350 - 42
src/main/java/com/sqx/modules/printInfo/controller/PrintInfoController.java

@@ -1,17 +1,30 @@
-package com.sqx.modules.activityManage.controller;
+package com.sqx.modules.printInfo.controller;
 
 
+import com.alibaba.fastjson.JSON;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.sqx.common.utils.Result;
-import com.sqx.modules.activityManage.entity.ActivityManage;
-import com.sqx.modules.activityManage.service.ActivityManageService;
+import com.sqx.modules.address.entity.Address;
 import com.sqx.modules.goods.entity.GoodsShop;
+import com.sqx.modules.goods.service.GoodsShopService;
+import com.sqx.modules.order.entity.TbOrder;
+import com.sqx.modules.order.service.AppOrderService;
+import com.sqx.modules.order.service.impl.AppAppOrderServiceImpl;
+import com.sqx.modules.printInfo.entity.*;
+import com.sqx.modules.printInfo.service.PrintInfoService;
+import com.sqx.modules.printInfo.service.PrintInfoShopService;
+import com.sqx.modules.utils.fieYun.FeiYunUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -22,54 +35,349 @@ import org.springframework.web.bind.annotation.RestController;
  * @since 2022-11-04
  */
 @RestController
-@RequestMapping("/admin/activityManage/")
-public class AdminActivityManageController {
+@Api(value = "管理端-打印模板信息", tags = {"管理端-打印模板信息"})
+@RequestMapping("/admin/printInfo/")
+public class PrintInfoController {
     @Autowired
-    private ActivityManageService activityManageService;
+    private PrintInfoService printInfoService;
 
-    @PostMapping("addActivity")
-    @ApiOperation("添加活动")
-    public Result addActivity(ActivityManage activityManage) {
-        return activityManageService.addActivity(activityManage);
+    @Autowired
+    private PrintInfoShopService printInfoShopService;
+
+    @Autowired
+    private AppAppOrderServiceImpl appAppOrderService;
+
+    @Autowired
+    private GoodsShopService goodsShopService;
+
+    @GetMapping("testPrintModel")
+    @ApiOperation("获取打印信息列表")
+    public Result testPrintModel(Long orderId) {
+        // 查询订单信息
+        TbOrder tbOrder = appAppOrderService.selectOrderByIds(orderId);
+        Long shopId = tbOrder.getShopId();
+
+        // 查询店铺信息
+        GoodsShop goodsShop = goodsShopService.selectGoodDatas(shopId);
+
+        // 查询当天店铺所有已支付的订单号,按支付时间排序
+        tbOrder.setCountOrder(3);
+
+        if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
+            FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder);
+        } else {
+            return Result.error("当前商家未绑定打印机!");
+        }
+        return Result.success();
     }
 
-    @PostMapping("updateActivity")
-    @ApiOperation("修改活动")
-    public Result updateActivity(ActivityManage activityManage) {
-        return activityManageService.updateActivity(activityManage);
+
+    @GetMapping("getPrintInfoList")
+    @ApiOperation("获取打印信息列表")
+    public Result getPrintInfoList(Integer page, Integer limit) {
+        return printInfoService.selectPrintInfoList(page, limit);
     }
 
-    @PostMapping("deleteActivity")
-    @ApiOperation("删除活动")
-    public Result deleteActivity(Long activityId) {
-        return activityManageService.deleteActivity(activityId);
+    @GetMapping("getPrintInfo")
+    @ApiOperation("获取打印信息")
+    public Result getPrintInfoInfo(Integer id) {
+        return printInfoService.selectPrintInfoById(id);
     }
 
-    @GetMapping("getActivityList")
-    @ApiOperation("获取活动列表")
-    public Result getActivityList(Integer page, Integer limit, ActivityManage activityManage) {
-        return Result.success().put("data", activityManageService.getActivityList(page, limit, activityManage));
+    @PostMapping("insertPrintInfo")
+    @ApiOperation("新增打印信息")
+    public Result insertPrintInfo(@RequestBody PrintInfo printInfo) {
+        return printInfoService.insertPrintInfo(printInfo);
     }
-    @GetMapping("getActivityInfo")
-    @ApiOperation("获取活动信息")
-    public Result getActivityInfo(Long activityId){
-        return Result.success().put("data", activityManageService.getActivityInfo(activityId));
 
+    @GetMapping("updatePrintInfo")
+    @ApiOperation("更新打印信息")
+    private Result updatePrintInfo(@RequestBody PrintInfo printInfo) {
+        return printInfoService.updatePrintInfo(printInfo);
     }
-    @GetMapping("getShoActivityShopList")
-    @ApiOperation("根据活动查找商家列表")
-    public Result getShoActivityShopList(Integer page, Integer limit, GoodsShop goodsShop) {
-        return Result.success().put("data", activityManageService.getAdminShoActivityShopList(page, limit, goodsShop));
+
+    @GetMapping("getPrintDropList")
+    @ApiOperation("获取打印信息类型下拉列表")
+    public Result getPrintDropList() {
+
+        int length = ePrintStatu.values().length;
+        List<PrintDropVo> result = new ArrayList<>();
+        for (int i = 1; i < length + 1; i++) {
+            PrintDropVo data = new PrintDropVo();
+            data.setId(i);
+            data.setName(ePrintStatu.stringOf(i));
+            result.add(data);
+        }
+        return Result.success().put("data", result);
     }
-    @GetMapping("cancelActivityShop")
-    @ApiOperation("删除活动中的商家")
-    public Result cancelActivityShop(Long activityId,Long shopId){
-        return activityManageService.cancelActivityShop(activityId,shopId);
+
+    /**
+     * 根据店铺ID获取对应店铺的打印模板信息
+     *
+     * @param shopId
+     * @return
+     */
+    @GetMapping("getPrintModelData")
+    @ApiOperation("获取打印模板信息")
+    public Result getPrintModelData(Integer shopId) throws JsonProcessingException {
+
+        if (shopId == null) {
+            return Result.error("商铺ID不能为空");
+        }
+        PrintResultModelVo resultData = new PrintResultModelVo();
+        resultData.setShopId(shopId);
+        List<PrintModelResult> result = new ArrayList<>();
+        List<PrintInfo> infos = printInfoService.printInfos();
+        List<Integer> typeIds = infos.stream().map(PrintInfo::getTypeId).distinct().collect(Collectors.toList());
+        PrintInfoShop pis = printInfoShopService.selectPrintInfoShopById(shopId);
+        if (pis == null) {
+            for (Integer typeId : typeIds) {
+                List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == typeId.intValue()).collect(Collectors.toList());
+                PrintModelResult data = new PrintModelResult();
+                List<PrintModelDetailResult> details = new ArrayList<>();
+                List<PrintModelTypeResult> types = new ArrayList<>();
+                for (PrintInfo nowInfo : nowInfos) {
+                    PrintModelDetailResult detailData = new PrintModelDetailResult();
+                    detailData.setId(nowInfo.getId());
+                    detailData.setPrintField(nowInfo.getPrintField());
+                    detailData.setPrintName(nowInfo.getPrintName());
+                    detailData.setIsCheck(0);
+                    details.add(detailData);
+
+                    PrintModelTypeResult typeData = new PrintModelTypeResult();
+                    typeData.setId(nowInfo.getId());
+                    typeData.setIsBlod(0);
+                    typeData.setWordSize(0);
+                    typeData.setPrintField(nowInfo.getPrintField());
+                    typeData.setPrintName(nowInfo.getPrintName());
+                    types.add(typeData);
+
+                }
+                if (nowInfos != null && nowInfos.size() > 0) {
+                    data.setId(typeId);
+                    data.setName(nowInfos.get(0).getTypeName());
+                }
+                data.setDetails(details);
+                data.setTypes(types);
+                result.add(data);
+            }
+        } else {
+            //要修改获取逻辑
+            resultData.setId(pis.getId());
+            if (pis.getBaseInfo().isEmpty()) {
+                PrintModelResult data = new PrintModelResult();
+                List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Base.getValue()).collect(Collectors.toList());
+                List<PrintModelDetailResult> details = new ArrayList<>();
+                List<PrintModelTypeResult> types = new ArrayList<>();
+                for (PrintInfo nowInfo : nowInfos) {
+                    PrintModelDetailResult detailData = new PrintModelDetailResult();
+                    detailData.setId(nowInfo.getId());
+                    detailData.setPrintField(nowInfo.getPrintField());
+                    detailData.setPrintName(nowInfo.getPrintName());
+                    detailData.setIsCheck(0);
+                    details.add(detailData);
+
+                    PrintModelTypeResult typeData = new PrintModelTypeResult();
+                    typeData.setId(nowInfo.getId());
+                    typeData.setIsBlod(0);
+                    typeData.setWordSize(0);
+                    typeData.setPrintField(nowInfo.getPrintField());
+                    typeData.setPrintName(nowInfo.getPrintName());
+                    types.add(typeData);
+                }
+                data.setId(ePrintStatu.Base.getValue());
+                data.setName(nowInfos.get(0).getTypeName());
+                data.setDetails(details);
+                data.setTypes(types);
+                result.add(data);
+            } else {
+                ObjectMapper objectMapper = new ObjectMapper();
+                PrintModelResult data = objectMapper.readValue(pis.getBaseInfo(), PrintModelResult.class);
+                result.add(data);
+            }
+
+            if (pis.getGoodInfo().isEmpty()) {
+                PrintModelResult data = new PrintModelResult();
+                List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Good.getValue()).collect(Collectors.toList());
+                List<PrintModelDetailResult> details = new ArrayList<>();
+                List<PrintModelTypeResult> types = new ArrayList<>();
+                for (PrintInfo nowInfo : nowInfos) {
+                    PrintModelDetailResult detailData = new PrintModelDetailResult();
+                    detailData.setId(nowInfo.getId());
+                    detailData.setPrintField(nowInfo.getPrintField());
+                    detailData.setPrintName(nowInfo.getPrintName());
+                    detailData.setIsCheck(0);
+                    details.add(detailData);
+
+                    PrintModelTypeResult typeData = new PrintModelTypeResult();
+                    typeData.setId(nowInfo.getId());
+                    typeData.setIsBlod(0);
+                    typeData.setWordSize(0);
+                    typeData.setPrintField(nowInfo.getPrintField());
+                    typeData.setPrintName(nowInfo.getPrintName());
+                    types.add(typeData);
+                }
+                data.setId(ePrintStatu.Good.getValue());
+                data.setName(nowInfos.get(0).getTypeName());
+                data.setDetails(details);
+                data.setTypes(types);
+                result.add(data);
+            } else {
+                ObjectMapper objectMapper = new ObjectMapper();
+                PrintModelResult data = objectMapper.readValue(pis.getGoodInfo(), PrintModelResult.class);
+                result.add(data);
+            }
+
+            if (pis.getPayInfo().isEmpty()) {
+                PrintModelResult data = new PrintModelResult();
+                List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Pay.getValue()).collect(Collectors.toList());
+                List<PrintModelDetailResult> details = new ArrayList<>();
+                List<PrintModelTypeResult> types = new ArrayList<>();
+                for (PrintInfo nowInfo : nowInfos) {
+                    PrintModelDetailResult detailData = new PrintModelDetailResult();
+                    detailData.setId(nowInfo.getId());
+                    detailData.setPrintField(nowInfo.getPrintField());
+                    detailData.setPrintName(nowInfo.getPrintName());
+                    detailData.setIsCheck(0);
+                    details.add(detailData);
+
+                    PrintModelTypeResult typeData = new PrintModelTypeResult();
+                    typeData.setId(nowInfo.getId());
+                    typeData.setIsBlod(0);
+                    typeData.setWordSize(0);
+                    typeData.setPrintField(nowInfo.getPrintField());
+                    typeData.setPrintName(nowInfo.getPrintName());
+                    types.add(typeData);
+                }
+                data.setId(ePrintStatu.Pay.getValue());
+                data.setName(nowInfos.get(0).getTypeName());
+                data.setDetails(details);
+                data.setTypes(types);
+                result.add(data);
+            } else {
+                ObjectMapper objectMapper = new ObjectMapper();
+                PrintModelResult data = objectMapper.readValue(pis.getPayInfo(), PrintModelResult.class);
+                result.add(data);
+            }
+
+            if (pis.getUserInfo().isEmpty()) {
+                PrintModelResult data = new PrintModelResult();
+                List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.User.getValue()).collect(Collectors.toList());
+                List<PrintModelDetailResult> details = new ArrayList<>();
+                List<PrintModelTypeResult> types = new ArrayList<>();
+                for (PrintInfo nowInfo : nowInfos) {
+                    PrintModelDetailResult detailData = new PrintModelDetailResult();
+                    detailData.setId(nowInfo.getId());
+                    detailData.setPrintField(nowInfo.getPrintField());
+                    detailData.setPrintName(nowInfo.getPrintName());
+                    detailData.setIsCheck(0);
+                    details.add(detailData);
+
+                    PrintModelTypeResult typeData = new PrintModelTypeResult();
+                    typeData.setId(nowInfo.getId());
+                    typeData.setIsBlod(0);
+                    typeData.setWordSize(0);
+                    typeData.setPrintField(nowInfo.getPrintField());
+                    typeData.setPrintName(nowInfo.getPrintName());
+                    types.add(typeData);
+                }
+                data.setId(ePrintStatu.User.getValue());
+                data.setName(nowInfos.get(0).getTypeName());
+                data.setDetails(details);
+                data.setTypes(types);
+                result.add(data);
+            } else {
+                ObjectMapper objectMapper = new ObjectMapper();
+                PrintModelResult data = objectMapper.readValue(pis.getUserInfo(), PrintModelResult.class);
+                result.add(data);
+            }
+
+        }
+        resultData.setModelDatas(result);
+        return Result.success().put("data", resultData);
+    }
+
+
+    /**
+     * 根据店铺ID获取对应店铺的打印模板信息
+     *
+     * @param printResult 模板信息数据
+     * @return
+     */
+    @PostMapping("insertPrintModelData")
+    @ApiOperation("新增打印模板信息")
+    public Result insertPrintModelData(@RequestBody PrintResultModelVo printResult) {
+        PrintInfoShop pis = new PrintInfoShop();
+        pis.setShopId(printResult.getShopId());
+        if (printResult != null && printResult.getModelDatas() != null && printResult.getModelDatas().size() > 0) {
+            for (PrintModelResult pmr : printResult.getModelDatas()) {
+                switch (pmr.getId().intValue()) {
+                    case 1://基本信息:1
+                        pis.setBaseInfo(JSON.toJSONString(pmr));
+                        break;
+                    case 2:// 商品信息:2
+                        pis.setGoodInfo(JSON.toJSONString(pmr));
+                        break;
+                    case 3:// 支付信息:3
+                        pis.setPayInfo(JSON.toJSONString(pmr));
+                        break;
+                    case 4:// 用户信息:4
+                        pis.setUserInfo(JSON.toJSONString(pmr));
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
+
+        return printInfoShopService.insertPrintInfoShop(pis);
+    }
+
+    /**
+     * 根据店铺ID获取对应店铺的打印模板信息
+     *
+     * @param printResult 模板信息数据
+     * @return
+     */
+    @PostMapping("updatePrintModelData")
+    @ApiOperation("更新打印模板信息")
+    public Result updatePrintModelData(@RequestBody PrintResultModelVo printResult) {
+        PrintInfoShop pis = new PrintInfoShop();
+        pis.setId(printResult.getId());
+        pis.setShopId(printResult.getShopId());
+        if (printResult != null && printResult.getModelDatas() != null && printResult.getModelDatas().size() > 0) {
+            for (PrintModelResult pmr : printResult.getModelDatas()) {
+                switch (pmr.getId().intValue()) {
+                    case 1://基本信息:1
+                        pis.setBaseInfo(JSON.toJSONString(pmr));
+                        break;
+                    case 2:// 商品信息:2
+                        pis.setGoodInfo(JSON.toJSONString(pmr));
+                        break;
+                    case 3:// 支付信息:3
+                        pis.setPayInfo(JSON.toJSONString(pmr));
+                        break;
+                    case 4:// 用户信息:4
+                        pis.setUserInfo(JSON.toJSONString(pmr));
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
+
+        return printInfoShopService.updatePrintInfoShop(pis);
     }
-    @GetMapping("shopJoinActivity")
-    @ApiOperation("将商家加入活动")
-    private Result shopJoinActivity(Long shopId, Long activityId) {
-        return activityManageService.shopJoinActivity(shopId, activityId,1);
+
+
+    /**
+     * 测试打印功能
+     */
+    @GetMapping("testPrintInfo")
+    @ApiOperation("测试打印功能")
+    public Result testPrintInfo(String sn) {
+        FeiYunUtils.testPrint(sn);
+        return Result.success();
     }
 }
 

+ 7 - 34
src/main/java/com/sqx/modules/printInfo/controller/app/AppPrintInfoController.java

@@ -1,16 +1,12 @@
-package com.sqx.modules.activityManage.controller.app;
+package com.sqx.modules.printInfo.controller.app;
 
 
 import com.sqx.common.utils.Result;
-import com.sqx.modules.activityManage.entity.ActivityManage;
-import com.sqx.modules.activityManage.service.ActivityManageService;
-import com.sqx.modules.goods.entity.GoodsShop;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+import com.sqx.modules.printInfo.service.PrintInfoService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * <p>
@@ -21,35 +17,12 @@ import org.springframework.web.bind.annotation.RestController;
  * @since 2022-11-04
  */
 @RestController
-@RequestMapping("/app/activityManage/")
-public class AppActivityManageController {
+@RequestMapping("/app/printInfo/")
+public class AppPrintInfoController {
     @Autowired
-    private ActivityManageService activityManageService;
+    private PrintInfoService printInfoService;
 
 
-    @GetMapping("getActivityList")
-    @ApiOperation("获取活动列表")
-    public Result getActivityList(Integer page, Integer limit, ActivityManage activityManage) {
-        activityManage.setIsEnable(1);
-        return Result.success().put("data", activityManageService.getActivityList(page, limit, activityManage));
-    }
 
-    @GetMapping("getActivityInfo")
-    @ApiOperation("获取活动信息")
-    public Result getActivityInfo(Long activityId) {
-        return Result.success().put("data", activityManageService.getActivityInfo(activityId));
-    }
-
-    @GetMapping("getShoActivityShopList")
-    @ApiOperation("根据活动查找商家列表")
-    public Result getShoActivityShopList(Integer page, Integer limit,Double lng,Double lat, GoodsShop goodsShop) {
-        return Result.success().put("data", activityManageService.getShoActivityShopList(page, limit,lng,lat ,goodsShop));
-    }
-
-    @GetMapping("shopJoinActivity")
-    @ApiOperation("商户主动加入活动")
-    private Result shopJoinActivity(Long shopId, Long activityId) {
-        return activityManageService.shopJoinActivity(shopId, activityId,0);
-    }
 }
 

+ 2 - 2
src/main/java/com/sqx/modules/printInfo/dao/PrintInfoDao.java

@@ -1,7 +1,7 @@
 package com.sqx.modules.printInfo.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.sqx.modules.printInfo.entity.ActivityManage;
+import com.sqx.modules.printInfo.entity.PrintInfo;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -13,6 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
  * @since 2022-11-04
  */
 @Mapper
-public interface ActivityManageDao extends BaseMapper<ActivityManage> {
+public interface PrintInfoDao extends BaseMapper<PrintInfo> {
 
 }

+ 2 - 1
src/main/java/com/sqx/modules/printInfo/dao/PrintInfoShopDao.java

@@ -2,6 +2,7 @@ package com.sqx.modules.printInfo.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sqx.modules.printInfo.entity.PrintInfo;
+import com.sqx.modules.printInfo.entity.PrintInfoShop;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -13,6 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
  * @since 2022-11-04
  */
 @Mapper
-public interface PrintInfoDao extends BaseMapper<PrintInfo> {
+public interface PrintInfoShopDao extends BaseMapper<PrintInfoShop> {
 
 }

+ 4 - 27
src/main/java/com/sqx/modules/printInfo/entity/PrintDropVo.java

@@ -1,14 +1,11 @@
 package com.sqx.modules.printInfo.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.SqlCondition;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
-import java.util.Date;
 
 /**
  * <p>
@@ -19,32 +16,12 @@ import java.util.Date;
  * @since 2022-11-04
  */
 @Data
-public class PrintInfo implements Serializable {
+public class PrintDropVo {
 
-    private static final long serialVersionUID = 1L;
-
-    @TableId(type = IdType.AUTO)
-    @ApiModelProperty("主键id")
+    @ApiModelProperty("数据下拉id")
     private Integer id;
 
-    @ApiModelProperty("类型id")
-    private Integer typeId;
-
-    @ApiModelProperty("打印信息类型")
-    private String typeName;
-
-    @ApiModelProperty("打印信息名称")
-    private String printName;
-
-    @ApiModelProperty("打印信息字段名")
-    private String printField;
-
-    @ApiModelProperty("创建时间")
-    private String createTime;
-
-    @ApiModelProperty("修改时间")
-    private String updateTime;
+    @ApiModelProperty("名称")
+    private String name;
 
-    @ApiModelProperty("是否删除(0:未删除;1:删除)")
-    private Integer deleteFlag;
 }

+ 20 - 35
src/main/java/com/sqx/modules/printInfo/entity/PrintInfo.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.SqlCondition;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -18,48 +19,32 @@ import java.util.Date;
  * @since 2022-11-04
  */
 @Data
-public class ActivityManage implements Serializable {
+public class PrintInfo implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    /**
-     * 活动id
-     */
-    @TableId(value = "activity_id", type = IdType.AUTO)
-    private Long activityId;
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty("主键id")
+    private Integer id;
 
-    /**
-     * 活动标题
-     */
-    @TableField(condition = SqlCondition.LIKE)
-    private String activityTitle;
+    @ApiModelProperty("类型id")
+    private Integer typeId;
 
-    /**
-     * 活动内容介绍
-     */
-    private String activityContent;
+    @ApiModelProperty("打印信息类型")
+    private String typeName;
 
-    /**
-     * 活动图片
-     */
-    private String activityImage;
+    @ApiModelProperty("打印信息名称")
+    private String printName;
 
-    /**
-     * 是否启用(0否 1是)
-     */
-    private Integer isEnable;
+    @ApiModelProperty("打印信息字段名")
+    private String printField;
 
-    /**
-     * 创建时间
-     */
-    private Date createTime;
+    @ApiModelProperty("创建时间")
+    private String createTime;
 
-    /**
-     * 更新时间
-     */
-    private Date updateTime;
-    /**
-     * 是否允许商户主动加入 0否 1是
-     */
-    private Integer isAllowShop;
+    @ApiModelProperty("修改时间")
+    private String updateTime;
+
+    @ApiModelProperty("是否删除(0:未删除;1:删除)")
+    private Integer deleteFlag;
 }

+ 13 - 13
src/main/java/com/sqx/modules/printInfo/entity/PrintInfoShop.java

@@ -1,14 +1,11 @@
 package com.sqx.modules.printInfo.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.SqlCondition;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
-import java.util.Date;
 
 /**
  * <p>
@@ -19,25 +16,28 @@ import java.util.Date;
  * @since 2022-11-04
  */
 @Data
-public class PrintInfo implements Serializable {
+public class PrintInfoShop implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
     @TableId(type = IdType.AUTO)
-    @ApiModelProperty("主键id")
+    @ApiModelProperty("主键id 商家小票模板ID")
     private Integer id;
 
-    @ApiModelProperty("类型id")
-    private Integer typeId;
+    @ApiModelProperty("商家ID")
+    private Integer shopId;
 
-    @ApiModelProperty("打印信息类型")
-    private String typeName;
+    @ApiModelProperty("基本信息")
+    private String baseInfo;
 
-    @ApiModelProperty("打印信息名称")
-    private String printName;
+    @ApiModelProperty("商品信息")
+    private String goodInfo;
 
-    @ApiModelProperty("打印信息字段名")
-    private String printField;
+    @ApiModelProperty("支付信息")
+    private String payInfo;
+
+    @ApiModelProperty("用户信息")
+    private String userInfo;
 
     @ApiModelProperty("创建时间")
     private String createTime;

+ 15 - 4
src/main/java/com/sqx/modules/printInfo/entity/PrintModelDetailResult.java

@@ -12,12 +12,23 @@ import lombok.Data;
  * @since 2022-11-04
  */
 @Data
-public class PrintModelResult {
+public class PrintModelDetailResult {
 
-    @ApiModelProperty("类型ID")
+    @ApiModelProperty("打印信息字段ID")
     private Integer id;
 
-    @ApiModelProperty("类型名称")
-    private String name;
+    @ApiModelProperty("打印信息名称")
+    private String printName;
+
+    @ApiModelProperty("打印信息字段名")
+    private String printField;
+
+    /**
+     * 是否勾选
+     * 否:0
+     * 是:1
+     */
+    @ApiModelProperty("是否勾选")
+    private Integer isCheck;
 
 }

+ 15 - 6
src/main/java/com/sqx/modules/printInfo/entity/PrintModelResult.java

@@ -1,11 +1,9 @@
 package com.sqx.modules.printInfo.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.io.Serializable;
+import java.util.List;
 
 /**
  * <p>
@@ -16,12 +14,23 @@ import java.io.Serializable;
  * @since 2022-11-04
  */
 @Data
-public class PrintDropVo {
+public class PrintModelResult {
 
-    @ApiModelProperty("数据下拉id")
+    @ApiModelProperty("类型ID")
     private Integer id;
 
-    @ApiModelProperty("名称")
+    @ApiModelProperty("类型名称")
     private String name;
 
+    /**
+     * 明细集合
+     */
+    @ApiModelProperty("明细集合")
+    private List<PrintModelDetailResult> details;
+
+    /**
+     * 样式集合
+     */
+    @ApiModelProperty("样式集合")
+    private List<PrintModelTypeResult> types;
 }

+ 13 - 4
src/main/java/com/sqx/modules/printInfo/entity/PrintModelTypeResult.java

@@ -12,7 +12,7 @@ import lombok.Data;
  * @since 2022-11-04
  */
 @Data
-public class PrintModelDetailResult {
+public class PrintModelTypeResult {
 
     @ApiModelProperty("打印信息字段ID")
     private Integer id;
@@ -24,11 +24,20 @@ public class PrintModelDetailResult {
     private String printField;
 
     /**
-     * 是否勾选
+     * 打印字号
+     * 都没选:0
+     * 正常:1
+     * 放大:2
+     */
+    @ApiModelProperty("打印字号")
+    private Integer wordSize;
+
+    /**
+     * 是否加粗
      * 否:0
      * 是:1
      */
-    @ApiModelProperty("是否勾选")
-    private Integer isCheck;
+    @ApiModelProperty("打印字号")
+    private Integer isBlod;
 
 }

+ 8 - 7
src/main/java/com/sqx/modules/printInfo/entity/PrintResultModelVo.java

@@ -1,11 +1,9 @@
 package com.sqx.modules.printInfo.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import java.io.Serializable;
+import java.util.List;
 
 /**
  * <p>
@@ -16,12 +14,15 @@ import java.io.Serializable;
  * @since 2022-11-04
  */
 @Data
-public class PrintDropVo {
+public class PrintResultModelVo {
 
-    @ApiModelProperty("数据下拉id")
+    @ApiModelProperty("数据id")
     private Integer id;
 
-    @ApiModelProperty("名称")
-    private String name;
+    @ApiModelProperty("店铺id")
+    private Integer shopId;
+
+    @ApiModelProperty("打印小票模板数据")
+    private List<PrintModelResult> modelDatas;
 
 }

+ 19 - 27
src/main/java/com/sqx/modules/printInfo/entity/eOrderTypeExtra.java

@@ -8,37 +8,33 @@ import java.util.List;
  * @Date: 2023/7/6 星期四 16:34
  * @Description: com.template.model.enumModel
  * @Version: 1.0
- * 考勤状态
+ * 订单类型
  */
-// 基本信息:1
-// 商品信息:2
-// 支付信息:3
-// 用户信息:4
-public enum ePrintStatu {
-    Base(1),//基本信息
-    Good(2),//商品信息
-    Pay(3),//支付信息
-    User(4);//用户信息
+//上门:1
+//骑手配送:2
+//商家配送:3
+public enum eOrderTypeExtra {
+    Door(1),//上门
+    Rider(2),//骑手配送
+    Store(3);//商家配送
 
     private int value;
 
-    ePrintStatu(int value){
+    eOrderTypeExtra(int value){
         this.value = value;
     }
 
     public int getValue() {
         return value;
     }
-    public static ePrintStatu valueOf(int value) {
+    public static eOrderTypeExtra valueOf(int value) {
         switch (value) {
             case 1:
-                return ePrintStatu.Base;
+                return eOrderTypeExtra.Door;
             case 2:
-                return ePrintStatu.Good;
+                return eOrderTypeExtra.Rider;
             case 3:
-                return ePrintStatu.Pay;
-            case 4:
-                return ePrintStatu.User;
+                return eOrderTypeExtra.Store;
             default:
                 return null;
         }
@@ -46,14 +42,12 @@ public enum ePrintStatu {
 
     public static Integer integerOf(String value) {
         switch (value) {
-            case "基本信息":
+            case "上门":
                 return 1;
-            case "商品信息":
+            case "骑手配送":
                 return 2;
-            case "支付信息":
+            case "商家配送":
                 return 3;
-            case "用户信息":
-                return 4;
             default:
                 return null;
         }
@@ -62,13 +56,11 @@ public enum ePrintStatu {
     public static String stringOf(Integer value) {
         switch (value) {
             case 1:
-                return "基本信息";
+                return "上门";
             case 2:
-                return "商品信息";
+                return "骑手配送";
             case 3:
-                return "支付信息";
-            case 4:
-                return "用户信息";
+                return "商家配送";
             default:
                 return null;
         }

+ 30 - 38
src/main/java/com/sqx/modules/printInfo/entity/ePrintStatu.java

@@ -1,4 +1,4 @@
-package com.template.model.enumModel;
+package com.sqx.modules.printInfo.entity;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -10,39 +10,35 @@ import java.util.List;
  * @Version: 1.0
  * 考勤状态
  */
-// 准时:0
-// 迟到:1
-// 缺卡:3
-// 请假:6
-// 超时打卡:7
-public enum eAttendanceStatu {
-    OnTime(0),//准时
-    BeLate(1),//迟到
-    LackCard(3),//缺卡
-    AskLeave(6),//请假
-    ClockIn(7);//超时打卡
+// 基本信息:1
+// 商品信息:2
+// 支付信息:3
+// 用户信息:4
+public enum ePrintStatu {
+    Base(1),//基本信息
+    Good(2),//商品信息
+    Pay(3),//支付信息
+    User(4);//用户信息
 
     private int value;
 
-    eAttendanceStatu(int value){
+    ePrintStatu(int value){
         this.value = value;
     }
 
     public int getValue() {
         return value;
     }
-    public static eAttendanceStatu valueOf(int value) {
+    public static ePrintStatu valueOf(int value) {
         switch (value) {
-            case 0:
-                return eAttendanceStatu.OnTime;
             case 1:
-                return eAttendanceStatu.BeLate;
+                return ePrintStatu.Base;
+            case 2:
+                return ePrintStatu.Good;
             case 3:
-                return eAttendanceStatu.LackCard;
-            case 6:
-                return eAttendanceStatu.AskLeave;
-            case 7:
-                return eAttendanceStatu.ClockIn;
+                return ePrintStatu.Pay;
+            case 4:
+                return ePrintStatu.User;
             default:
                 return null;
         }
@@ -50,16 +46,14 @@ public enum eAttendanceStatu {
 
     public static Integer integerOf(String value) {
         switch (value) {
-            case "准时":
-                return 0;
-            case "迟到":
+            case "基本信息":
                 return 1;
-            case "缺卡":
+            case "商品信息":
+                return 2;
+            case "支付信息":
                 return 3;
-            case "请假":
-                return 6;
-            case "超时打卡":
-                return 7;
+            case "用户信息":
+                return 4;
             default:
                 return null;
         }
@@ -67,16 +61,14 @@ public enum eAttendanceStatu {
 
     public static String stringOf(Integer value) {
         switch (value) {
-            case 0:
-                return "准时";
             case 1:
-                return "迟到";
+                return "基本信息";
+            case 2:
+                return "商品信息";
             case 3:
-                return "缺卡";
-            case 6:
-                return "请假";
-            case 7:
-                return "超时打卡";
+                return "支付信息";
+            case 4:
+                return "用户信息";
             default:
                 return null;
         }

+ 13 - 21
src/main/java/com/sqx/modules/printInfo/entity/eWordSize.java

@@ -10,31 +10,27 @@ import java.util.List;
  * @Version: 1.0
  * 订单类型
  */
-//上门:1
-//骑手配送:2
-//商家配送:3
-public enum eOrderTypeExtra {
-    Door(1),//上门
-    Rider(2),//骑手配送
-    Store(3);//商家配送
+//正常:1
+//放大:2
+public enum eWordSize {
+    Normal(1),//正常
+    Amplify(2);//放大
 
     private int value;
 
-    eOrderTypeExtra(int value){
+    eWordSize(int value){
         this.value = value;
     }
 
     public int getValue() {
         return value;
     }
-    public static eOrderTypeExtra valueOf(int value) {
+    public static eWordSize valueOf(int value) {
         switch (value) {
             case 1:
-                return eOrderTypeExtra.Door;
+                return eWordSize.Normal;
             case 2:
-                return eOrderTypeExtra.Rider;
-            case 3:
-                return eOrderTypeExtra.Store;
+                return eWordSize.Amplify;
             default:
                 return null;
         }
@@ -42,12 +38,10 @@ public enum eOrderTypeExtra {
 
     public static Integer integerOf(String value) {
         switch (value) {
-            case "上门":
+            case "正常":
                 return 1;
-            case "骑手配送":
+            case "放大":
                 return 2;
-            case "商家配送":
-                return 3;
             default:
                 return null;
         }
@@ -56,11 +50,9 @@ public enum eOrderTypeExtra {
     public static String stringOf(Integer value) {
         switch (value) {
             case 1:
-                return "上门";
+                return "正常";
             case 2:
-                return "骑手配送";
-            case 3:
-                return "商家配送";
+                return "放大";
             default:
                 return null;
         }

+ 11 - 28
src/main/java/com/sqx/modules/printInfo/service/PrintInfoService.java

@@ -1,46 +1,29 @@
 package com.sqx.modules.printInfo.service;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.Result;
-import com.sqx.modules.goods.entity.GoodsShop;
-import com.sqx.modules.printInfo.entity.ActivityManage;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+
+import java.util.List;
 
 /**
  * <p>
- *  服务类
+ * 服务类
  * </p>
  *
  * @author www.javacoder.top
  * @since 2022-11-04
  */
-public interface ActivityManageService extends IService<ActivityManage> {
-
-    Result addActivity(ActivityManage activityManage);
-
-    Result updateActivity(ActivityManage activityManage);
-
-    Result deleteActivity(Long activityId);
-
-    IPage<ActivityManage> getActivityList(Integer page, Integer limit, ActivityManage activityManage);
-
-
-    ActivityManage getActivityInfo(Long activityId);
+public interface PrintInfoService extends IService<PrintInfo> {
+    Result selectPrintInfoList(Integer page, Integer limit);
 
-    IPage<GoodsShop> getShoActivityShopList(Integer page, Integer limit, Double lng, Double lat, GoodsShop goodsShop);
+    Result insertPrintInfo(PrintInfo PrintInfo);
 
-    IPage<GoodsShop> getAdminShoActivityShopList(Integer page, Integer limit, GoodsShop goodsShop);
+    Result updatePrintInfo(PrintInfo PrintInfo);
 
-    Result cancelActivityShop(Long activityId, Long shopId);
+    Result selectPrintInfoById(Integer id);
 
-    /**
-     *
-     * @param shopId
-     * @param activityId
-     * @param auth 1表示是管理员给活动中添加商铺
-     * @return
-     */
-    Result shopJoinActivity(Long shopId, Long activityId, Integer auth);
+    Result deletePrintInfo(Integer id);
 
-    Result addShopActivity(Long activityId, Long shopId);
+    List<PrintInfo> printInfos();
 }

+ 5 - 7
src/main/java/com/sqx/modules/printInfo/service/PrintInfoShopService.java

@@ -3,6 +3,7 @@ package com.sqx.modules.printInfo.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.sqx.common.utils.Result;
 import com.sqx.modules.printInfo.entity.PrintInfo;
+import com.sqx.modules.printInfo.entity.PrintInfoShop;
 
 /**
  * <p>
@@ -12,14 +13,11 @@ import com.sqx.modules.printInfo.entity.PrintInfo;
  * @author www.javacoder.top
  * @since 2022-11-04
  */
-public interface PrintInfoService extends IService<PrintInfo> {
-    Result selectPrintInfoList(Integer page, Integer limit);
+public interface PrintInfoShopService extends IService<PrintInfoShop> {
 
-    Result insertPrintInfo(PrintInfo PrintInfo);
+    PrintInfoShop selectPrintInfoShopById(Integer shopId);
 
-    Result updatePrintInfo(PrintInfo PrintInfo);
+    Result insertPrintInfoShop(PrintInfoShop PrintInfoShop);
 
-    Result selectPrintInfoById(Integer id);
-
-    Result deletePrintInfo(Integer id);
+    Result updatePrintInfoShop(PrintInfoShop PrintInfoShop);
 }

+ 36 - 157
src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoServiceImpl.java

@@ -1,29 +1,20 @@
 package com.sqx.modules.printInfo.service.impl;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-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.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
-import com.sqx.modules.app.entity.UserEntity;
-import com.sqx.modules.app.service.UserService;
-import com.sqx.modules.common.entity.CommonInfo;
-import com.sqx.modules.common.service.CommonInfoService;
-import com.sqx.modules.goods.dao.GoodsShopDao;
-import com.sqx.modules.goods.entity.GoodsShop;
-import com.sqx.modules.goods.service.GoodsShopService;
 import com.sqx.modules.printInfo.dao.PrintInfoDao;
-import com.sqx.modules.printInfo.entity.ActivityManage;
-import com.sqx.modules.printInfo.service.ActivityManageService;
-import com.sqx.modules.utils.HttpClientUtil;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+import com.sqx.modules.printInfo.service.PrintInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.List;
 
 /**
  * <p>
@@ -34,166 +25,54 @@ import java.util.Map;
  * @since 2022-11-04
  */
 @Service
-public class ActivityManageServiceImpl extends ServiceImpl<PrintInfoDao, ActivityManage> implements ActivityManageService {
+public class PrintInfoServiceImpl extends ServiceImpl<PrintInfoDao, PrintInfo> implements PrintInfoService {
     @Autowired
-    private PrintInfoDao activityManageDao;
-    @Autowired
-    private GoodsShopService goodsShopService;
-    @Autowired
-    private UserService userService;
-    @Autowired
-    private GoodsShopDao goodsShopDao;
-    @Autowired
-    private CommonInfoService commonInfoService;
-    @Override
-    public Result addActivity(ActivityManage activityManage) {
-        activityManage.setCreateTime(new Date());
-        activityManage.setUpdateTime(new Date());
-        return Result.upStatus(activityManageDao.insert(activityManage));
-
-    }
-
-    @Override
-    public Result updateActivity(ActivityManage activityManage) {
-        if (activityManage.getActivityId() == null) {
-            return Result.error("活动id不能为空");
-        }
-        return Result.upStatus(activityManageDao.updateById(activityManage));
-
-    }
-
-    @Override
-    public Result deleteActivity(Long activityId) {
-
-        return Result.upStatus(activityManageDao.deleteById(activityId));
-
-
-    }
-
-    @Override
-    public IPage<ActivityManage> getActivityList(Integer page, Integer limit, ActivityManage activityManage) {
-        IPage<ActivityManage> pages;
-        if (page != null && limit != null) {
-            pages = new Page<>(page, limit);
-        } else {
-            pages = new Page<>();
-        }
-        return activityManageDao.selectPage(pages, new QueryWrapper<>(activityManage));
-    }
+    private PrintInfoDao printInfoDao;
 
     @Override
-    public ActivityManage getActivityInfo(Long activityId) {
-
-        return activityManageDao.selectById(activityId);
-
+    public Result selectPrintInfoList(Integer page, Integer limit) {
+        Page<PrintInfo> pages = new Page<>(page, limit);
+        PageUtils pageUtils = new PageUtils(baseMapper.selectPage(pages,null));
+        return Result.success().put("data", pageUtils);
     }
 
+    @Transactional
     @Override
-    public IPage<GoodsShop> getShoActivityShopList(Integer page, Integer limit, Double lng, Double lat, GoodsShop goodsShop) {
-        Page<GoodsShop> pages;
-        if (page != null && limit != null) {
-            pages = new Page<>(page, limit);
-        } else {
-            pages = new Page<>();
-        }
-        //如果没有经纬度,则默认为北京的经纬度
-       if(lng==null && lat==null){
-           lng = 121.47;
-           lat = 31.23;
-       }
-
-       goodsShop.setShopLng(lng);
-       goodsShop.setShopLat(lat);
-
-
-        String way = commonInfoService.findOne(416).getValue();
-        if("1".equals(way)){
-            CommonInfo one = commonInfoService.findOne(235);
-            String url = "https://apis.map.qq.com/ws/geocoder/v1/";
-            Map<String, String> maps = new HashMap<>();
-            maps.put("location", lat + "," + lng);
-            maps.put("key", one.getValue());
-            String data = HttpClientUtil.doGet(url, maps);
-            JSONObject jsonObject = JSON.parseObject(data);
-            String status = jsonObject.getString("status");
-            if ("0".equals(status)) {
-                JSONObject result = jsonObject.getJSONObject("result");
-                JSONObject adInfo = result.getJSONObject("ad_info");
-                String city = (String)adInfo.get("city");
-                goodsShop.setCity(city);
-                return goodsShopDao.getShoActivityShopList(pages, goodsShop);
-            }
-        }else{
-            String value = commonInfoService.findOne(417).getValue();
-            String url="http://api.tianditu.gov.cn/geocoder";
-            Map<String,String> param=new HashMap<>();
-            JSONObject postStr=new JSONObject();
-            postStr.put("lon",lng);
-            postStr.put("lat",lat);
-            postStr.put("ver","1");
-            param.put("postStr",postStr.toJSONString());
-            param.put("type","geocode");
-            param.put("tk",value);
-            String s = HttpClientUtil.doGet(url,param);
-            JSONObject jsonObject = JSONObject.parseObject(s);
-            String status = jsonObject.getString("status");
-            if("0".equals(status)){
-                JSONObject result = jsonObject.getJSONObject("result");
-                JSONObject addressComponent = result.getJSONObject("addressComponent");
-                String city = addressComponent.getString("city");
-                goodsShop.setCity(city);
-                return goodsShopDao.getShoActivityShopList(pages, goodsShop);
-            }
-        }
-        return null;
+    public Result insertPrintInfo(PrintInfo PrintInfo) {
+        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+        PrintInfo.setCreateTime(format);
+        PrintInfo.setUpdateTime(format);
+        PrintInfo.setDeleteFlag(0);
+        baseMapper.insert(PrintInfo);
+        return Result.success();
     }
 
-
+    @Transactional
     @Override
-    public IPage<GoodsShop> getAdminShoActivityShopList(Integer page, Integer limit, GoodsShop goodsShop) {
-        Page<GoodsShop> pages;
-        if (page != null && limit != null) {
-            pages = new Page<>(page, limit);
-        } else {
-            pages = new Page<>();
-        }
-        return goodsShopDao.getAdminShoActivityShopList(pages, goodsShop);
+    public Result updatePrintInfo(PrintInfo PrintInfo) {
+        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+        PrintInfo.setUpdateTime(format);
+        baseMapper.updateById(PrintInfo);
+        return Result.success();
     }
 
-
-
-
     @Override
-    public Result cancelActivityShop(Long activityId, Long shopId) {
-        return Result.upStatus(goodsShopService.cancelActivityShop(activityId, shopId));
-
+    public Result selectPrintInfoById(Integer id) {
+        PrintInfo PrintInfo = baseMapper.selectById(id);
+        return Result.success().put("data", PrintInfo);
     }
 
     @Override
-    public Result shopJoinActivity(Long shopId, Long activityId, Integer auth) {
-        ActivityManage activityManage = activityManageDao.selectById(activityId);
-        if (activityManage == null) {
-            return Result.error("当前活动不存在");
-        }
-        if (auth != 1) {
-            if (activityManage.getIsAllowShop() == 0) {
-                return Result.error("当前活动不允许商家自行加入");
-            }
-        }
-
-        GoodsShop goodsShop = new GoodsShop();
-        goodsShop.setShopId(shopId);
-        goodsShop.setActivityId(activityId);
-        goodsShopService.updateById(goodsShop);
+    public Result deletePrintInfo(Integer id) {
+        baseMapper.deleteById(id);
         return Result.success();
-
     }
 
     @Override
-    public Result addShopActivity(Long activityId, Long shopId) {
-        UserEntity entity = new UserEntity();
-
-        userService.updateById(entity);
-        return Result.success();
+    public List<PrintInfo> printInfos() {
+        QueryWrapper<PrintInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("delete_flag",0);
+        List<PrintInfo> result = baseMapper.selectList(queryWrapper);
+        return result;
     }
 }

+ 18 - 44
src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoShopServiceImpl.java

@@ -1,70 +1,44 @@
 package com.sqx.modules.printInfo.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.sqx.common.utils.PageUtils;
 import com.sqx.common.utils.Result;
-import com.sqx.modules.printInfo.dao.PrintInfoDao;
+import com.sqx.modules.printInfo.dao.PrintInfoShopDao;
 import com.sqx.modules.printInfo.entity.PrintInfo;
-import com.sqx.modules.printInfo.service.PrintInfoService;
-import com.sqx.modules.shop.entity.SearchHistory;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.sqx.modules.printInfo.entity.PrintInfoShop;
+import com.sqx.modules.printInfo.service.PrintInfoShopService;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-/**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author www.javacoder.top
- * @since 2022-11-04
- */
 @Service
-public class PrintInfoServiceImpl extends ServiceImpl<PrintInfoDao, PrintInfo> implements PrintInfoService {
-    @Autowired
-    private PrintInfoDao printInfoDao;
+public class PrintInfoShopServiceImpl extends ServiceImpl<PrintInfoShopDao, PrintInfoShop> implements PrintInfoShopService {
 
     @Override
-    public Result selectPrintInfoList(Integer page, Integer limit) {
-        Page<PrintInfo> pages = new Page<>(page, limit);
-        PageUtils pageUtils = new PageUtils(baseMapper.selectPage(pages,null));
-        return Result.success().put("data", pageUtils);
+    public PrintInfoShop selectPrintInfoShopById(Integer shopId) {
+        QueryWrapper<PrintInfoShop> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("shop_id", shopId);
+        queryWrapper.eq("delete_flag", 0);
+        PrintInfoShop printInfoShop = baseMapper.selectOne(queryWrapper);
+        return printInfoShop;
     }
 
-    @Transactional
     @Override
-    public Result insertPrintInfo(PrintInfo PrintInfo) {
+    public Result insertPrintInfoShop(PrintInfoShop PrintInfoShop) {
         String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
-        PrintInfo.setCreateTime(format);
-        PrintInfo.setUpdateTime(format);
-        PrintInfo.setDeleteFlag(0);
-        baseMapper.insert(PrintInfo);
+        PrintInfoShop.setCreateTime(format);
+        PrintInfoShop.setUpdateTime(format);
+        PrintInfoShop.setDeleteFlag(0);
+        baseMapper.insert(PrintInfoShop);
         return Result.success();
     }
 
-    @Transactional
     @Override
-    public Result updatePrintInfo(PrintInfo PrintInfo) {
+    public Result updatePrintInfoShop(PrintInfoShop PrintInfoShop) {
         String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
-        PrintInfo.setUpdateTime(format);
-        baseMapper.updateById(PrintInfo);
-        return Result.success();
-    }
-
-    @Override
-    public Result selectPrintInfoById(Integer id) {
-        PrintInfo PrintInfo = baseMapper.selectById(id);
-        return Result.success().put("data", PrintInfo);
-    }
-
-    @Override
-    public Result deletePrintInfo(Integer id) {
-        baseMapper.deleteById(id);
+        PrintInfoShop.setUpdateTime(format);
+        baseMapper.updateById(PrintInfoShop);
         return Result.success();
     }
 }

Разница между файлами не показана из-за своего большого размера
+ 859 - 241
src/main/java/com/sqx/modules/utils/fieYun/FeiYunUtils.java


+ 2 - 6
src/main/resources/mapper/printInfo/PrintInfoDao.xml

@@ -1,10 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.sqx.modules.address.dao.AddressDao">
+<mapper namespace="com.sqx.modules.printInfo.dao.PrintInfoDao">
 
-    <select id="selectAddressList" resultType="com.sqx.modules.address.entity.Address">
-        select * from address where user_id = #{userId}
-        order by address_default desc, update_time desc
-    </select>
 
-</mapper>
+</mapper>

+ 1 - 1
src/main/resources/mapper/printInfo/PrintInfoShopDao.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.sqx.modules.printInfo.dao.PrintInfoDao">
+<mapper namespace="com.sqx.modules.printInfo.dao.PrintInfoShopDao">
 
 
 </mapper>