Prechádzať zdrojové kódy

Merge branch 'xwt' into dev-activity

codingliang 1 rok pred
rodič
commit
933823767b
23 zmenil súbory, kde vykonal 2016 pridanie a 241 odobranie
  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. 383 0
      src/main/java/com/sqx/modules/printInfo/controller/PrintInfoController.java
  4. 28 0
      src/main/java/com/sqx/modules/printInfo/controller/app/AppPrintInfoController.java
  5. 18 0
      src/main/java/com/sqx/modules/printInfo/dao/PrintInfoDao.java
  6. 19 0
      src/main/java/com/sqx/modules/printInfo/dao/PrintInfoShopDao.java
  7. 27 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintDropVo.java
  8. 50 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintInfo.java
  9. 50 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintInfoShop.java
  10. 34 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintModelDetailResult.java
  11. 36 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintModelResult.java
  12. 43 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintModelTypeResult.java
  13. 28 0
      src/main/java/com/sqx/modules/printInfo/entity/PrintResultModelVo.java
  14. 82 0
      src/main/java/com/sqx/modules/printInfo/entity/eOrderTypeExtra.java
  15. 90 0
      src/main/java/com/sqx/modules/printInfo/entity/ePrintStatu.java
  16. 74 0
      src/main/java/com/sqx/modules/printInfo/entity/eWordSize.java
  17. 29 0
      src/main/java/com/sqx/modules/printInfo/service/PrintInfoService.java
  18. 23 0
      src/main/java/com/sqx/modules/printInfo/service/PrintInfoShopService.java
  19. 78 0
      src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoServiceImpl.java
  20. 44 0
      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. 6 0
      src/main/resources/mapper/printInfo/PrintInfoDao.xml
  23. 6 0
      src/main/resources/mapper/printInfo/PrintInfoShopDao.xml

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

@@ -40,4 +40,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

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

+ 383 - 0
src/main/java/com/sqx/modules/printInfo/controller/PrintInfoController.java

@@ -0,0 +1,383 @@
+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.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.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 活动管理
+ * </p>
+ *
+ * @author 吴畅
+ * @since 2022-11-04
+ */
+@RestController
+@Api(value = "管理端-打印模板信息", tags = {"管理端-打印模板信息"})
+@RequestMapping("/admin/printInfo/")
+public class PrintInfoController {
+    @Autowired
+    private PrintInfoService printInfoService;
+
+    @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();
+    }
+
+
+    @GetMapping("getPrintInfoList")
+    @ApiOperation("获取打印信息列表")
+    public Result getPrintInfoList(Integer page, Integer limit) {
+        return printInfoService.selectPrintInfoList(page, limit);
+    }
+
+    @GetMapping("getPrintInfo")
+    @ApiOperation("获取打印信息")
+    public Result getPrintInfoInfo(Integer id) {
+        return printInfoService.selectPrintInfoById(id);
+    }
+
+    @PostMapping("insertPrintInfo")
+    @ApiOperation("新增打印信息")
+    public Result insertPrintInfo(@RequestBody PrintInfo printInfo) {
+        return printInfoService.insertPrintInfo(printInfo);
+    }
+
+    @GetMapping("updatePrintInfo")
+    @ApiOperation("更新打印信息")
+    private Result updatePrintInfo(@RequestBody PrintInfo printInfo) {
+        return printInfoService.updatePrintInfo(printInfo);
+    }
+
+    @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);
+    }
+
+    /**
+     * 根据店铺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("testPrintInfo")
+    @ApiOperation("测试打印功能")
+    public Result testPrintInfo(String sn) {
+        FeiYunUtils.testPrint(sn);
+        return Result.success();
+    }
+}
+

+ 28 - 0
src/main/java/com/sqx/modules/printInfo/controller/app/AppPrintInfoController.java

@@ -0,0 +1,28 @@
+package com.sqx.modules.printInfo.controller.app;
+
+
+import com.sqx.common.utils.Result;
+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.*;
+
+/**
+ * <p>
+ * 活动管理
+ * </p>
+ *
+ * @author 吴畅
+ * @since 2022-11-04
+ */
+@RestController
+@RequestMapping("/app/printInfo/")
+public class AppPrintInfoController {
+    @Autowired
+    private PrintInfoService printInfoService;
+
+
+
+}
+

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

@@ -0,0 +1,18 @@
+package com.sqx.modules.printInfo.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Mapper
+public interface PrintInfoDao extends BaseMapper<PrintInfo> {
+
+}

+ 19 - 0
src/main/java/com/sqx/modules/printInfo/dao/PrintInfoShopDao.java

@@ -0,0 +1,19 @@
+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;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Mapper
+public interface PrintInfoShopDao extends BaseMapper<PrintInfoShop> {
+
+}

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

@@ -0,0 +1,27 @@
+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;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Data
+public class PrintDropVo {
+
+    @ApiModelProperty("数据下拉id")
+    private Integer id;
+
+    @ApiModelProperty("名称")
+    private String name;
+
+}

+ 50 - 0
src/main/java/com/sqx/modules/printInfo/entity/PrintInfo.java

@@ -0,0 +1,50 @@
+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>
+ *
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Data
+public class PrintInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(type = IdType.AUTO)
+    @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("是否删除(0:未删除;1:删除)")
+    private Integer deleteFlag;
+}

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

@@ -0,0 +1,50 @@
+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;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Data
+public class PrintInfoShop implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty("主键id 商家小票模板ID")
+    private Integer id;
+
+    @ApiModelProperty("商家ID")
+    private Integer shopId;
+
+    @ApiModelProperty("基本信息")
+    private String baseInfo;
+
+    @ApiModelProperty("商品信息")
+    private String goodInfo;
+
+    @ApiModelProperty("支付信息")
+    private String payInfo;
+
+    @ApiModelProperty("用户信息")
+    private String userInfo;
+
+    @ApiModelProperty("创建时间")
+    private String createTime;
+
+    @ApiModelProperty("修改时间")
+    private String updateTime;
+
+    @ApiModelProperty("是否删除(0:未删除;1:删除)")
+    private Integer deleteFlag;
+}

+ 34 - 0
src/main/java/com/sqx/modules/printInfo/entity/PrintModelDetailResult.java

@@ -0,0 +1,34 @@
+package com.sqx.modules.printInfo.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Data
+public class PrintModelDetailResult {
+
+    @ApiModelProperty("打印信息字段ID")
+    private Integer id;
+
+    @ApiModelProperty("打印信息名称")
+    private String printName;
+
+    @ApiModelProperty("打印信息字段名")
+    private String printField;
+
+    /**
+     * 是否勾选
+     * 否:0
+     * 是:1
+     */
+    @ApiModelProperty("是否勾选")
+    private Integer isCheck;
+
+}

+ 36 - 0
src/main/java/com/sqx/modules/printInfo/entity/PrintModelResult.java

@@ -0,0 +1,36 @@
+package com.sqx.modules.printInfo.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Data
+public class PrintModelResult {
+
+    @ApiModelProperty("类型ID")
+    private Integer id;
+
+    @ApiModelProperty("类型名称")
+    private String name;
+
+    /**
+     * 明细集合
+     */
+    @ApiModelProperty("明细集合")
+    private List<PrintModelDetailResult> details;
+
+    /**
+     * 样式集合
+     */
+    @ApiModelProperty("样式集合")
+    private List<PrintModelTypeResult> types;
+}

+ 43 - 0
src/main/java/com/sqx/modules/printInfo/entity/PrintModelTypeResult.java

@@ -0,0 +1,43 @@
+package com.sqx.modules.printInfo.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Data
+public class PrintModelTypeResult {
+
+    @ApiModelProperty("打印信息字段ID")
+    private Integer id;
+
+    @ApiModelProperty("打印信息名称")
+    private String printName;
+
+    @ApiModelProperty("打印信息字段名")
+    private String printField;
+
+    /**
+     * 打印字号
+     * 都没选:0
+     * 正常:1
+     * 放大:2
+     */
+    @ApiModelProperty("打印字号")
+    private Integer wordSize;
+
+    /**
+     * 是否加粗
+     * 否:0
+     * 是:1
+     */
+    @ApiModelProperty("打印字号")
+    private Integer isBlod;
+
+}

+ 28 - 0
src/main/java/com/sqx/modules/printInfo/entity/PrintResultModelVo.java

@@ -0,0 +1,28 @@
+package com.sqx.modules.printInfo.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Data
+public class PrintResultModelVo {
+
+    @ApiModelProperty("数据id")
+    private Integer id;
+
+    @ApiModelProperty("店铺id")
+    private Integer shopId;
+
+    @ApiModelProperty("打印小票模板数据")
+    private List<PrintModelResult> modelDatas;
+
+}

+ 82 - 0
src/main/java/com/sqx/modules/printInfo/entity/eOrderTypeExtra.java

@@ -0,0 +1,82 @@
+package com.sqx.modules.printInfo.entity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/6 星期四 16:34
+ * @Description: com.template.model.enumModel
+ * @Version: 1.0
+ * 订单类型
+ */
+//上门:1
+//骑手配送:2
+//商家配送:3
+public enum eOrderTypeExtra {
+    Door(1),//上门
+    Rider(2),//骑手配送
+    Store(3);//商家配送
+
+    private int value;
+
+    eOrderTypeExtra(int value){
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+    public static eOrderTypeExtra valueOf(int value) {
+        switch (value) {
+            case 1:
+                return eOrderTypeExtra.Door;
+            case 2:
+                return eOrderTypeExtra.Rider;
+            case 3:
+                return eOrderTypeExtra.Store;
+            default:
+                return null;
+        }
+    }
+
+    public static Integer integerOf(String value) {
+        switch (value) {
+            case "上门":
+                return 1;
+            case "骑手配送":
+                return 2;
+            case "商家配送":
+                return 3;
+            default:
+                return null;
+        }
+    }
+
+    public static String stringOf(Integer value) {
+        switch (value) {
+            case 1:
+                return "上门";
+            case 2:
+                return "骑手配送";
+            case 3:
+                return "商家配送";
+            default:
+                return null;
+        }
+    }
+
+    /**
+     * 获取考勤状态集合
+     * @return
+     */
+    public static List<Integer> attendanceStatus(){
+        List<Integer> result = new ArrayList<>();
+        result.add(0);
+        result.add(1);
+        result.add(3);
+        result.add(6);
+        result.add(7);
+        return result;
+    }
+}

+ 90 - 0
src/main/java/com/sqx/modules/printInfo/entity/ePrintStatu.java

@@ -0,0 +1,90 @@
+package com.sqx.modules.printInfo.entity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author: binguo
+ * @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);//用户信息
+
+    private int value;
+
+    ePrintStatu(int value){
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+    public static ePrintStatu valueOf(int value) {
+        switch (value) {
+            case 1:
+                return ePrintStatu.Base;
+            case 2:
+                return ePrintStatu.Good;
+            case 3:
+                return ePrintStatu.Pay;
+            case 4:
+                return ePrintStatu.User;
+            default:
+                return null;
+        }
+    }
+
+    public static Integer integerOf(String value) {
+        switch (value) {
+            case "基本信息":
+                return 1;
+            case "商品信息":
+                return 2;
+            case "支付信息":
+                return 3;
+            case "用户信息":
+                return 4;
+            default:
+                return null;
+        }
+    }
+
+    public static String stringOf(Integer value) {
+        switch (value) {
+            case 1:
+                return "基本信息";
+            case 2:
+                return "商品信息";
+            case 3:
+                return "支付信息";
+            case 4:
+                return "用户信息";
+            default:
+                return null;
+        }
+    }
+
+    /**
+     * 获取考勤状态集合
+     * @return
+     */
+    public static List<Integer> attendanceStatus(){
+        List<Integer> result = new ArrayList<>();
+        result.add(0);
+        result.add(1);
+        result.add(3);
+        result.add(6);
+        result.add(7);
+        return result;
+    }
+}

+ 74 - 0
src/main/java/com/sqx/modules/printInfo/entity/eWordSize.java

@@ -0,0 +1,74 @@
+package com.sqx.modules.printInfo.entity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author: binguo
+ * @Date: 2023/7/6 星期四 16:34
+ * @Description: com.template.model.enumModel
+ * @Version: 1.0
+ * 订单类型
+ */
+//正常:1
+//放大:2
+public enum eWordSize {
+    Normal(1),//正常
+    Amplify(2);//放大
+
+    private int value;
+
+    eWordSize(int value){
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+    public static eWordSize valueOf(int value) {
+        switch (value) {
+            case 1:
+                return eWordSize.Normal;
+            case 2:
+                return eWordSize.Amplify;
+            default:
+                return null;
+        }
+    }
+
+    public static Integer integerOf(String value) {
+        switch (value) {
+            case "正常":
+                return 1;
+            case "放大":
+                return 2;
+            default:
+                return null;
+        }
+    }
+
+    public static String stringOf(Integer value) {
+        switch (value) {
+            case 1:
+                return "正常";
+            case 2:
+                return "放大";
+            default:
+                return null;
+        }
+    }
+
+    /**
+     * 获取考勤状态集合
+     * @return
+     */
+    public static List<Integer> attendanceStatus(){
+        List<Integer> result = new ArrayList<>();
+        result.add(0);
+        result.add(1);
+        result.add(3);
+        result.add(6);
+        result.add(7);
+        return result;
+    }
+}

+ 29 - 0
src/main/java/com/sqx/modules/printInfo/service/PrintInfoService.java

@@ -0,0 +1,29 @@
+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 java.util.List;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+public interface PrintInfoService extends IService<PrintInfo> {
+    Result selectPrintInfoList(Integer page, Integer limit);
+
+    Result insertPrintInfo(PrintInfo PrintInfo);
+
+    Result updatePrintInfo(PrintInfo PrintInfo);
+
+    Result selectPrintInfoById(Integer id);
+
+    Result deletePrintInfo(Integer id);
+
+    List<PrintInfo> printInfos();
+}

+ 23 - 0
src/main/java/com/sqx/modules/printInfo/service/PrintInfoShopService.java

@@ -0,0 +1,23 @@
+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>
+ * 服务类
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+public interface PrintInfoShopService extends IService<PrintInfoShop> {
+
+    PrintInfoShop selectPrintInfoShopById(Integer shopId);
+
+    Result insertPrintInfoShop(PrintInfoShop PrintInfoShop);
+
+    Result updatePrintInfoShop(PrintInfoShop PrintInfoShop);
+}

+ 78 - 0
src/main/java/com/sqx/modules/printInfo/service/impl/PrintInfoServiceImpl.java

@@ -0,0 +1,78 @@
+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.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.List;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author www.javacoder.top
+ * @since 2022-11-04
+ */
+@Service
+public class PrintInfoServiceImpl extends ServiceImpl<PrintInfoDao, PrintInfo> implements PrintInfoService {
+    @Autowired
+    private PrintInfoDao printInfoDao;
+
+    @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);
+    }
+
+    @Transactional
+    @Override
+    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 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 selectPrintInfoById(Integer id) {
+        PrintInfo PrintInfo = baseMapper.selectById(id);
+        return Result.success().put("data", PrintInfo);
+    }
+
+    @Override
+    public Result deletePrintInfo(Integer id) {
+        baseMapper.deleteById(id);
+        return Result.success();
+    }
+
+    @Override
+    public List<PrintInfo> printInfos() {
+        QueryWrapper<PrintInfo> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("delete_flag",0);
+        List<PrintInfo> result = baseMapper.selectList(queryWrapper);
+        return result;
+    }
+}

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

@@ -0,0 +1,44 @@
+package com.sqx.modules.printInfo.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sqx.common.utils.Result;
+import com.sqx.modules.printInfo.dao.PrintInfoShopDao;
+import com.sqx.modules.printInfo.entity.PrintInfo;
+import com.sqx.modules.printInfo.entity.PrintInfoShop;
+import com.sqx.modules.printInfo.service.PrintInfoShopService;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@Service
+public class PrintInfoShopServiceImpl extends ServiceImpl<PrintInfoShopDao, PrintInfoShop> implements PrintInfoShopService {
+
+    @Override
+    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;
+    }
+
+    @Override
+    public Result insertPrintInfoShop(PrintInfoShop PrintInfoShop) {
+        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+        PrintInfoShop.setCreateTime(format);
+        PrintInfoShop.setUpdateTime(format);
+        PrintInfoShop.setDeleteFlag(0);
+        baseMapper.insert(PrintInfoShop);
+        return Result.success();
+    }
+
+    @Override
+    public Result updatePrintInfoShop(PrintInfoShop PrintInfoShop) {
+        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+        PrintInfoShop.setUpdateTime(format);
+        baseMapper.updateById(PrintInfoShop);
+        return Result.success();
+    }
+}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 859 - 241
src/main/java/com/sqx/modules/utils/fieYun/FeiYunUtils.java


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

@@ -0,0 +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>

+ 6 - 0
src/main/resources/mapper/printInfo/PrintInfoShopDao.xml

@@ -0,0 +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.PrintInfoShopDao">
+
+
+</mapper>