|
|
@@ -12,6 +12,7 @@ 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.PrintInfoDetailService;
|
|
|
import com.sqx.modules.printInfo.service.PrintInfoService;
|
|
|
import com.sqx.modules.printInfo.service.PrintInfoShopService;
|
|
|
import com.sqx.modules.utils.fieYun.FeiYunUtils;
|
|
|
@@ -52,6 +53,27 @@ public class PrintInfoController {
|
|
|
@Autowired
|
|
|
private GoodsShopService goodsShopService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PrintInfoDetailService printInfoDetailService;
|
|
|
+
|
|
|
+ @GetMapping("getOrderPrintDetailList")
|
|
|
+ @ApiOperation("获取订单打印记录列表")
|
|
|
+ public Result getPrintInfoList(Integer page, Integer limit, Long orderId) {
|
|
|
+ //region 参数判断
|
|
|
+ if(page == null){
|
|
|
+ return Result.error("当前页不能为空!");
|
|
|
+ }
|
|
|
+ if(limit == null){
|
|
|
+ return Result.error("一页数据条数不能为空!");
|
|
|
+ }
|
|
|
+ if(orderId == null){
|
|
|
+ return Result.error("订单ID不能为空!");
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+
|
|
|
+ return printInfoDetailService.selectPrintInfoDetailList(page, limit, orderId);
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("testPrintModel")
|
|
|
@ApiOperation("获取打印信息列表")
|
|
|
public Result testPrintModel(Long orderId) {
|
|
|
@@ -66,7 +88,7 @@ public class PrintInfoController {
|
|
|
tbOrder.setCountOrder(3);
|
|
|
|
|
|
if (StringUtils.isNotEmpty(goodsShop.getSnCode())) {
|
|
|
- FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder,null);
|
|
|
+ FeiYunUtils.print(goodsShop.getSnCode(), null, tbOrder, null);
|
|
|
} else {
|
|
|
return Result.error("当前商家未绑定打印机!");
|
|
|
}
|
|
|
@@ -95,8 +117,6 @@ public class PrintInfoController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@GetMapping("getPrintInfoList")
|
|
|
@ApiOperation("获取打印信息列表")
|
|
|
public Result getPrintInfoList(Integer page, Integer limit) {
|
|
|
@@ -147,12 +167,12 @@ public class PrintInfoController {
|
|
|
files.add("user_id");
|
|
|
files.add("coupon_id");
|
|
|
files.add("expect_delivery_time");
|
|
|
- if(!files.contains(printInfo.getPrintField())){
|
|
|
+ if (!files.contains(printInfo.getPrintField())) {
|
|
|
return Result.error("无法新增非法字段");
|
|
|
}
|
|
|
|
|
|
- int existCount = printInfoService.existInfo(printInfo.getTypeId(),printInfo.getPrintField());
|
|
|
- if(existCount > 0){
|
|
|
+ int existCount = printInfoService.existInfo(printInfo.getTypeId(), printInfo.getPrintField());
|
|
|
+ if (existCount > 0) {
|
|
|
return Result.error("当前类型中已包含该字段");
|
|
|
}
|
|
|
|
|
|
@@ -197,12 +217,12 @@ public class PrintInfoController {
|
|
|
files.add("user_id");
|
|
|
files.add("coupon_id");
|
|
|
files.add("expect_delivery_time");
|
|
|
- if(!files.contains(printInfo.getPrintField())){
|
|
|
+ if (!files.contains(printInfo.getPrintField())) {
|
|
|
return Result.error("无法将数据更新为非法字段");
|
|
|
}
|
|
|
|
|
|
- PrintInfo existData = printInfoService.existInfoData(printInfo.getTypeId(),printInfo.getPrintField());
|
|
|
- if(existData != null && existData.getId().intValue() != printInfo.getId().intValue()){
|
|
|
+ PrintInfo existData = printInfoService.existInfoData(printInfo.getTypeId(), printInfo.getPrintField());
|
|
|
+ if (existData != null && existData.getId().intValue() != printInfo.getId().intValue()) {
|
|
|
return Result.error("当前类型中已包含该字段");
|
|
|
}
|
|
|
|
|
|
@@ -278,9 +298,9 @@ public class PrintInfoController {
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
details.add(detailData);
|
|
|
@@ -315,9 +335,9 @@ public class PrintInfoController {
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
details.add(detailData);
|
|
|
@@ -342,14 +362,14 @@ public class PrintInfoController {
|
|
|
List<Integer> detailIds = (data.getDetails() != null && data.getDetails().size() > 0) ? data.getDetails().stream().map(PrintModelDetailResult::getId).distinct().collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
|
|
List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Base.getValue() && !detailIds.contains(e.getId())).collect(Collectors.toList());
|
|
|
- for (PrintInfo nowInfo:nowInfos) {
|
|
|
+ for (PrintInfo nowInfo : nowInfos) {
|
|
|
PrintModelDetailResult detailData = new PrintModelDetailResult();
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
data.getDetails().add(detailData);
|
|
|
@@ -376,9 +396,9 @@ public class PrintInfoController {
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
details.add(detailData);
|
|
|
@@ -402,14 +422,14 @@ public class PrintInfoController {
|
|
|
List<Integer> detailIds = (data.getDetails() != null && data.getDetails().size() > 0) ? data.getDetails().stream().map(PrintModelDetailResult::getId).distinct().collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
|
|
List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Good.getValue() && !detailIds.contains(e.getId())).collect(Collectors.toList());
|
|
|
- for (PrintInfo nowInfo:nowInfos) {
|
|
|
+ for (PrintInfo nowInfo : nowInfos) {
|
|
|
PrintModelDetailResult detailData = new PrintModelDetailResult();
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
data.getDetails().add(detailData);
|
|
|
@@ -436,9 +456,9 @@ public class PrintInfoController {
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
details.add(detailData);
|
|
|
@@ -462,14 +482,14 @@ public class PrintInfoController {
|
|
|
List<Integer> detailIds = (data.getDetails() != null && data.getDetails().size() > 0) ? data.getDetails().stream().map(PrintModelDetailResult::getId).distinct().collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
|
|
List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.Pay.getValue() && !detailIds.contains(e.getId())).collect(Collectors.toList());
|
|
|
- for (PrintInfo nowInfo:nowInfos) {
|
|
|
+ for (PrintInfo nowInfo : nowInfos) {
|
|
|
PrintModelDetailResult detailData = new PrintModelDetailResult();
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
data.getDetails().add(detailData);
|
|
|
@@ -495,9 +515,9 @@ public class PrintInfoController {
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
details.add(detailData);
|
|
|
@@ -521,14 +541,14 @@ public class PrintInfoController {
|
|
|
List<Integer> detailIds = (data.getDetails() != null && data.getDetails().size() > 0) ? data.getDetails().stream().map(PrintModelDetailResult::getId).distinct().collect(Collectors.toList()) : new ArrayList<>();
|
|
|
|
|
|
List<PrintInfo> nowInfos = infos.stream().filter(e -> e.getTypeId().intValue() == ePrintStatu.User.getValue() && !detailIds.contains(e.getId())).collect(Collectors.toList());
|
|
|
- for (PrintInfo nowInfo:nowInfos) {
|
|
|
+ for (PrintInfo nowInfo : nowInfos) {
|
|
|
PrintModelDetailResult detailData = new PrintModelDetailResult();
|
|
|
detailData.setId(nowInfo.getId());
|
|
|
detailData.setPrintField(nowInfo.getPrintField());
|
|
|
detailData.setPrintName(nowInfo.getPrintName());
|
|
|
- if(haves.contains(nowInfo.getPrintField())){
|
|
|
+ if (haves.contains(nowInfo.getPrintField())) {
|
|
|
detailData.setIsCheck(1);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
detailData.setIsCheck(0);
|
|
|
}
|
|
|
data.getDetails().add(detailData);
|
|
|
@@ -628,9 +648,9 @@ public class PrintInfoController {
|
|
|
@GetMapping("testPrintInfo")
|
|
|
@ApiOperation("测试打印功能")
|
|
|
public Result testPrintInfo(String sn) {
|
|
|
- log.info("进入打印:sn"+sn);
|
|
|
+ log.info("进入打印:sn" + sn);
|
|
|
FeiYunUtils.testPrint(sn);
|
|
|
- log.info("打印结束:sn"+sn);
|
|
|
+ log.info("打印结束:sn" + sn);
|
|
|
return Result.success();
|
|
|
}
|
|
|
}
|