Compare commits
No commits in common. "8eae72cefe3c45347bc5a037e03620b7445dba74" and "d54741be7ff4fa3e1a9314840301107525e6e073" have entirely different histories.
8eae72cefe
...
d54741be7f
@ -212,32 +212,32 @@ public class StoreOrderController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * 核销码核销订单
|
* 核销码核销订单
|
||||||
// *
|
*
|
||||||
// * @author stivepeim
|
* @author stivepeim
|
||||||
// * @since 2020-09-01
|
* @since 2020-09-01
|
||||||
// */
|
*/
|
||||||
// @PreAuthorize("hasAuthority('admin:order:write:update')")
|
@PreAuthorize("hasAuthority('admin:order:write:update')")
|
||||||
// @ApiOperation(value = "核销码核销订单")
|
@ApiOperation(value = "核销码核销订单")
|
||||||
// @RequestMapping(value = "/writeUpdate/{vCode}", method = RequestMethod.GET)
|
@RequestMapping(value = "/writeUpdate/{vCode}", method = RequestMethod.GET)
|
||||||
// public CommonResult<Object> verificationOrder(@PathVariable String vCode) {
|
public CommonResult<Object> verificationOrder(@PathVariable String vCode) {
|
||||||
// return CommonResult.success(storeOrderVerification.verificationOrderByCode(vCode));
|
return CommonResult.success(storeOrderVerification.verificationOrderByCode(vCode));
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// /**
|
/**
|
||||||
// * 核销码查询待核销订单
|
* 核销码查询待核销订单
|
||||||
// *
|
*
|
||||||
// * @author stivepeim
|
* @author stivepeim
|
||||||
// * @since 2020-09-01
|
* @since 2020-09-01
|
||||||
// */
|
*/
|
||||||
// @PreAuthorize("hasAuthority('admin:order:write:confirm')")
|
@PreAuthorize("hasAuthority('admin:order:write:confirm')")
|
||||||
// @ApiOperation(value = "核销码查询待核销订单")
|
@ApiOperation(value = "核销码查询待核销订单")
|
||||||
// @RequestMapping(value = "/writeConfirm/{vCode}", method = RequestMethod.GET)
|
@RequestMapping(value = "/writeConfirm/{vCode}", method = RequestMethod.GET)
|
||||||
// public CommonResult<Object> verificationConfirmOrder(
|
public CommonResult<Object> verificationConfirmOrder(
|
||||||
// @PathVariable String vCode) {
|
@PathVariable String vCode) {
|
||||||
// return CommonResult.success(storeOrderVerification.getVerificationOrderByCode(vCode));
|
return CommonResult.success(storeOrderVerification.getVerificationOrderByCode(vCode));
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单统计详情
|
* 订单统计详情
|
||||||
|
@ -1,35 +1,33 @@
|
|||||||
package com.zbkj.admin.controller;
|
package com.zbkj.admin.controller;
|
||||||
|
|
||||||
import com.zbkj.common.enums.EnumPintNode;
|
|
||||||
import com.zbkj.common.response.CommonResult;
|
import com.zbkj.common.response.CommonResult;
|
||||||
import com.zbkj.service.service.impl.printer.PrintHandle;
|
import com.zbkj.service.service.YlyPrintService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打印订单
|
* 易联云打印订单
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("api/admin/yly")
|
@RequestMapping("api/admin/yly")
|
||||||
@Api(tags = "打印订单小票") //配合swagger使用
|
@Api(tags = "易联云 打印订单小票") //配合swagger使用
|
||||||
public class PrintController {
|
public class YlyPrintController {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PrintHandle printHandle;
|
private YlyPrintService ylyPrintService;
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('admin:yly:print')")
|
@PreAuthorize("hasAuthority('admin:yly:print')")
|
||||||
@ApiOperation(value = "打印小票")
|
@ApiOperation(value = "打印小票")
|
||||||
@RequestMapping(value = "/print/{ordid}", method = RequestMethod.GET)
|
@RequestMapping(value = "/print/{ordid}", method = RequestMethod.GET)
|
||||||
public CommonResult<String> updateStatus(@PathVariable String ordid) {
|
public CommonResult<String> updateStatus(@PathVariable String ordid) {
|
||||||
printHandle.print(ordid, EnumPintNode.PLATFORM);
|
ylyPrintService.YlyPrint(ordid,false);
|
||||||
return CommonResult.success();
|
return CommonResult.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -562,11 +562,4 @@ public class Constants {
|
|||||||
/** 失效 */
|
/** 失效 */
|
||||||
public static final Integer STATUS_INVALID = 0;
|
public static final Integer STATUS_INVALID = 0;
|
||||||
|
|
||||||
// 支付成功自动打印开关
|
|
||||||
public static final String PRINT_AUTO_STATUS = "print_auto_status";
|
|
||||||
// 打印开关
|
|
||||||
public static final String PRINT_STATUS = "print_status";
|
|
||||||
// 打印类型,1佳博,2易联云
|
|
||||||
public static final String PRINT_TYPE = "pint_type";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,10 @@ public class YlyConstants {
|
|||||||
public static final String YLY_PRINT_APP_MACHINE_CODE = "ylyprint_app_machine_code";
|
public static final String YLY_PRINT_APP_MACHINE_CODE = "ylyprint_app_machine_code";
|
||||||
// 易联云打印机设备密钥
|
// 易联云打印机设备密钥
|
||||||
public static final String YLY_PRINT_APP_MACHINE_MSIGN = "ylyprint_app_machine_msign";
|
public static final String YLY_PRINT_APP_MACHINE_MSIGN = "ylyprint_app_machine_msign";
|
||||||
|
// 易联云打印开关
|
||||||
|
public static final String YLY_PRINT_AUTO_STATUS = "ylyprint_auto_status";
|
||||||
|
public static final String YLY_PRINT_STATUS = "ylyprint_status";
|
||||||
|
|
||||||
//
|
//
|
||||||
public static final String YLY_REDIS_TOKEN = "yly_token";
|
public static final String YLY_REDIS_TOKEN = "yly_token";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
package com.zbkj.common.enums;
|
|
||||||
|
|
||||||
public enum EnumPintNode {
|
|
||||||
|
|
||||||
CREATE_ORDER("1","下单自动打印"),
|
|
||||||
PLATFORM("2","平台手动打印"),
|
|
||||||
;
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
EnumPintNode(String name, String code) {
|
|
||||||
this.name = name;
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCode(String code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
}
|
|
@ -22,10 +22,6 @@
|
|||||||
<artifactId>food-common</artifactId>
|
<artifactId>food-common</artifactId>
|
||||||
<version>${food-common}</version>
|
<version>${food-common}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>net.java.dev.jna</groupId>
|
|
||||||
<artifactId>jna</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -1,17 +0,0 @@
|
|||||||
package com.zbkj.service.service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印机打印订单 service
|
|
||||||
*/
|
|
||||||
public interface PrintService {
|
|
||||||
|
|
||||||
String code();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印商品信息
|
|
||||||
*
|
|
||||||
* @param ordId 订单id
|
|
||||||
*/
|
|
||||||
void print(String ordId);
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.zbkj.service.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 易联云打印订单 service
|
||||||
|
|
||||||
|
*/
|
||||||
|
public interface YlyPrintService {
|
||||||
|
/**
|
||||||
|
* 易联云打印商品信息
|
||||||
|
* @param ordId 订单id
|
||||||
|
* @param isAuto 是否自动打印
|
||||||
|
*/
|
||||||
|
void YlyPrint(String ordId,boolean isAuto);
|
||||||
|
}
|
@ -6,7 +6,6 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zbkj.common.constants.*;
|
import com.zbkj.common.constants.*;
|
||||||
import com.zbkj.common.enums.EnumPintNode;
|
|
||||||
import com.zbkj.common.exception.CrmebException;
|
import com.zbkj.common.exception.CrmebException;
|
||||||
import com.zbkj.common.model.combination.StoreCombination;
|
import com.zbkj.common.model.combination.StoreCombination;
|
||||||
import com.zbkj.common.model.combination.StorePink;
|
import com.zbkj.common.model.combination.StorePink;
|
||||||
@ -29,7 +28,6 @@ import com.zbkj.common.utils.WxPayUtil;
|
|||||||
import com.zbkj.common.vo.*;
|
import com.zbkj.common.vo.*;
|
||||||
import com.zbkj.service.delete.OrderUtils;
|
import com.zbkj.service.delete.OrderUtils;
|
||||||
import com.zbkj.service.service.*;
|
import com.zbkj.service.service.*;
|
||||||
import com.zbkj.service.service.impl.printer.PrintHandle;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -146,7 +144,7 @@ public class OrderPayServiceImpl implements OrderPayService {
|
|||||||
private UserExperienceRecordService userExperienceRecordService;
|
private UserExperienceRecordService userExperienceRecordService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PrintHandle printHandle;
|
private YlyPrintService ylyPrintService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SystemNotificationService systemNotificationService;
|
private SystemNotificationService systemNotificationService;
|
||||||
@ -302,7 +300,7 @@ public class OrderPayServiceImpl implements OrderPayService {
|
|||||||
autoSendCoupons(storeOrder);
|
autoSendCoupons(storeOrder);
|
||||||
|
|
||||||
// 根据配置 打印小票
|
// 根据配置 打印小票
|
||||||
printHandle.print(storeOrder.getOrderId(), EnumPintNode.CREATE_ORDER);
|
ylyPrintService.YlyPrint(storeOrder.getOrderId(),true);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.zbkj.service.service.impl.printer;
|
package com.zbkj.service.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@ -9,7 +9,10 @@ import com.zbkj.common.model.order.StoreOrder;
|
|||||||
import com.zbkj.common.request.YlyPrintRequest;
|
import com.zbkj.common.request.YlyPrintRequest;
|
||||||
import com.zbkj.common.request.YlyPrintRequestGoods;
|
import com.zbkj.common.request.YlyPrintRequestGoods;
|
||||||
import com.zbkj.common.vo.StoreOrderInfoOldVo;
|
import com.zbkj.common.vo.StoreOrderInfoOldVo;
|
||||||
import com.zbkj.service.service.*;
|
import com.zbkj.service.service.StoreOrderInfoService;
|
||||||
|
import com.zbkj.service.service.StoreOrderService;
|
||||||
|
import com.zbkj.service.service.SystemConfigService;
|
||||||
|
import com.zbkj.service.service.YlyPrintService;
|
||||||
import com.zbkj.service.util.YlyUtil;
|
import com.zbkj.service.util.YlyUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -23,7 +26,7 @@ import java.util.List;
|
|||||||
* 易联云打印订单 service
|
* 易联云打印订单 service
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class YlyPrintServiceImpl implements PrintService {
|
public class YlyPrintServiceImpl implements YlyPrintService {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(YlyPrintServiceImpl.class);
|
private static final Logger logger = LoggerFactory.getLogger(YlyPrintServiceImpl.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
private StoreOrderService storeOrderService;
|
private StoreOrderService storeOrderService;
|
||||||
@ -37,19 +40,21 @@ public class YlyPrintServiceImpl implements PrintService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private YlyUtil ylyUtil;
|
private YlyUtil ylyUtil;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String code() {
|
|
||||||
return "2";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 易联云打印商品信息
|
* 易联云打印商品信息
|
||||||
*
|
*
|
||||||
* @param orderId 订单id
|
* @param orderId 订单id
|
||||||
|
* @param isAuto 是否自动打印
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void print(String orderId) {
|
public void YlyPrint(String orderId, boolean isAuto) {
|
||||||
|
if (ylyUtil.checkYlyPrintStatus()) {
|
||||||
|
throw new CrmebException("易联云 未开启打印");
|
||||||
|
}
|
||||||
|
// 判断是否开启自动打印
|
||||||
|
if (isAuto && ylyUtil.checkYlyPrintAfterPaySuccess()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
StoreOrder exitOrder = storeOrderService.getByOderId(orderId);
|
StoreOrder exitOrder = storeOrderService.getByOderId(orderId);
|
||||||
if (ObjectUtil.isNull(exitOrder)) {
|
if (ObjectUtil.isNull(exitOrder)) {
|
||||||
throw new CrmebException("易联云 打印时未找到 订单信息");
|
throw new CrmebException("易联云 打印时未找到 订单信息");
|
||||||
@ -90,4 +95,6 @@ public class YlyPrintServiceImpl implements PrintService {
|
|||||||
logger.error("易联云打印小票失败 " + e.getMessage());
|
logger.error("易联云打印小票失败 " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,87 +0,0 @@
|
|||||||
package com.zbkj.service.service.impl.printer;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.zbkj.common.exception.CrmebException;
|
|
||||||
import com.zbkj.common.model.order.StoreOrder;
|
|
||||||
import com.zbkj.common.vo.StoreOrderInfoOldVo;
|
|
||||||
import com.zbkj.service.service.PrintService;
|
|
||||||
import com.zbkj.service.service.StoreOrderInfoService;
|
|
||||||
import com.zbkj.service.service.StoreOrderService;
|
|
||||||
import com.zbkj.service.util.jiab.JiabUtil;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 佳博打印机
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class JiabPrintServiceImpl implements PrintService {
|
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(JiabPrintServiceImpl.class);
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreOrderService storeOrderService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StoreOrderInfoService storeOrderInfoService;
|
|
||||||
|
|
||||||
private static JiabUtil pjb = JiabUtil.INSTANCE;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String code() {
|
|
||||||
return "1";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void print(String orderId) {
|
|
||||||
System.out.println("1111");
|
|
||||||
StoreOrder exitOrder = storeOrderService.getByOderId(orderId);
|
|
||||||
if (ObjectUtil.isNull(exitOrder)) {
|
|
||||||
throw new CrmebException("佳博 打印时未找到 订单信息");
|
|
||||||
}
|
|
||||||
if (!exitOrder.getPaid()) {
|
|
||||||
throw new CrmebException("佳博 打印时出错, 订单未支付");
|
|
||||||
}
|
|
||||||
List<StoreOrderInfoOldVo> exitOrderInfo = storeOrderInfoService.getOrderListByOrderId(exitOrder.getId());
|
|
||||||
|
|
||||||
// System.setProperty("jna.encoding", "GBK");
|
|
||||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyMMddHHmmss");
|
|
||||||
//
|
|
||||||
// pjb.openport("GP-L80160 Series");
|
|
||||||
// pjb.setup("100", "200", "5", "8", "0", "0", "0");
|
|
||||||
// pjb.clearbuffer();
|
|
||||||
// pjb.windowsfont(120, 0, 48, 0, 0, 0, "宋体", "领料清单");
|
|
||||||
//
|
|
||||||
// int height = 100;
|
|
||||||
// pjb.windowsfont(5, height, 26, 0, 0, 0, "宋体", "单号:" + sdf.format(new Date()));
|
|
||||||
// height += 70;
|
|
||||||
// pjb.windowsfont(5, height, 32, 0, 0, 0, "宋体", "PO号");
|
|
||||||
// pjb.windowsfont(160, height, 32, 0, 0, 0, "宋体", "物料描述");
|
|
||||||
// pjb.windowsfont(330, height, 32, 0, 0, 0, "宋体", "数量");
|
|
||||||
//
|
|
||||||
// height = height + 45;
|
|
||||||
// pjb.windowsfont(5, height, 26, 0, 0, 0, "宋体", "111");
|
|
||||||
// pjb.windowsfont(380, height, 26, 0, 0, 0, "宋体", 2 + "");
|
|
||||||
//// if (line > 1) {
|
|
||||||
//// for (int j = 0; j < line; j++) {
|
|
||||||
//// String substring = desc.substring(8 * j, 8 * (j + 1) > desc.length() ? desc.length() : 8 * (j + 1));
|
|
||||||
//// pjb.windowsfont(130, height, 26, 0, 0, 0, "宋体", substring);
|
|
||||||
//// height = height + 45;
|
|
||||||
//// if(height > 800) {
|
|
||||||
//// pjb.printlabel("1", "1");
|
|
||||||
//// pjb.clearbuffer();
|
|
||||||
//// height = 0;
|
|
||||||
//// }
|
|
||||||
//// }
|
|
||||||
//// }
|
|
||||||
// pjb.windowsfont(200, height + 100, 28, 0, 0, 0, "宋体", "签字:");
|
|
||||||
// pjb.printlabel("1", "1");
|
|
||||||
// pjb.closeport();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
package com.zbkj.service.service.impl.printer;
|
|
||||||
|
|
||||||
import com.zbkj.common.constants.Constants;
|
|
||||||
import com.zbkj.common.constants.YlyConstants;
|
|
||||||
import com.zbkj.common.enums.EnumPintNode;
|
|
||||||
import com.zbkj.common.exception.CrmebException;
|
|
||||||
import com.zbkj.service.service.PrintService;
|
|
||||||
import com.zbkj.service.service.SystemConfigService;
|
|
||||||
import com.zbkj.service.util.YlyUtil;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class PrintHandle {
|
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(PrintHandle.class);
|
|
||||||
@Autowired private YlyUtil ylyUtil;
|
|
||||||
@Autowired private List<PrintService> printServices;
|
|
||||||
@Autowired private SystemConfigService systemConfigService;
|
|
||||||
private Map<String, PrintService> printHashMap = new HashMap<>();
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
printServices.stream().forEach(i -> {
|
|
||||||
printHashMap.put(i.code(), i);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void print(String orderId, EnumPintNode pintNode) {
|
|
||||||
if (pintNode == pintNode.CREATE_ORDER && ylyUtil.checkYlyPrintAfterPaySuccess()) {
|
|
||||||
logger.info("未开启支付成功自动打印开关,略过");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (ylyUtil.checkYlyPrintStatus()) {
|
|
||||||
logger.info("未开启打印开关,略过");
|
|
||||||
}
|
|
||||||
String printType = systemConfigService.getValueByKey(Constants.PRINT_TYPE);
|
|
||||||
if (StringUtils.isEmpty(printType)) {
|
|
||||||
logger.info("未配置打印类型,略过");
|
|
||||||
}
|
|
||||||
PrintService printService = printHashMap.get(printType);
|
|
||||||
if (null == printService) {
|
|
||||||
logger.info("未配置打印类型,略过");
|
|
||||||
}
|
|
||||||
printService.print(orderId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -3,7 +3,6 @@ package com.zbkj.service.util;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.zbkj.common.constants.Constants;
|
|
||||||
import com.zbkj.common.constants.YlyConstants;
|
import com.zbkj.common.constants.YlyConstants;
|
||||||
import com.zbkj.common.exception.CrmebException;
|
import com.zbkj.common.exception.CrmebException;
|
||||||
import com.zbkj.common.request.YlyPrintRequest;
|
import com.zbkj.common.request.YlyPrintRequest;
|
||||||
@ -64,7 +63,7 @@ public class YlyUtil {
|
|||||||
client_secret = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_APP_SECRET);
|
client_secret = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_APP_SECRET);
|
||||||
machine_code = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_APP_MACHINE_CODE);
|
machine_code = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_APP_MACHINE_CODE);
|
||||||
msign = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_APP_MACHINE_MSIGN);
|
msign = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_APP_MACHINE_MSIGN);
|
||||||
status = systemConfigService.getValueByKey(Constants.PRINT_STATUS);
|
status = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_STATUS);
|
||||||
if(StringUtils.isBlank(client_id) || StringUtils.isBlank(client_secret)
|
if(StringUtils.isBlank(client_id) || StringUtils.isBlank(client_secret)
|
||||||
|| StringUtils.isBlank(machine_code) || StringUtils.isBlank(msign)){
|
|| StringUtils.isBlank(machine_code) || StringUtils.isBlank(msign)){
|
||||||
throw new CrmebException("易联云配置数据不完整");
|
throw new CrmebException("易联云配置数据不完整");
|
||||||
@ -181,7 +180,7 @@ public class YlyUtil {
|
|||||||
* 付款成后打印易联云订单
|
* 付款成后打印易联云订单
|
||||||
*/
|
*/
|
||||||
public boolean checkYlyPrintAfterPaySuccess(){
|
public boolean checkYlyPrintAfterPaySuccess(){
|
||||||
String printAuto = systemConfigService.getValueByKey(Constants.PRINT_AUTO_STATUS);
|
String printAuto = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_AUTO_STATUS);
|
||||||
return !StringUtils.isBlank(printAuto) && "'0'".equals(printAuto);
|
return !StringUtils.isBlank(printAuto) && "'0'".equals(printAuto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +188,7 @@ public class YlyUtil {
|
|||||||
* 检查是否开启打印
|
* 检查是否开启打印
|
||||||
*/
|
*/
|
||||||
public boolean checkYlyPrintStatus(){
|
public boolean checkYlyPrintStatus(){
|
||||||
String printAuto = systemConfigService.getValueByKey(Constants.PRINT_STATUS);
|
String printAuto = systemConfigService.getValueByKey(YlyConstants.YLY_PRINT_STATUS);
|
||||||
return !StringUtils.isBlank(printAuto) && "'0'".equals(printAuto);
|
return !StringUtils.isBlank(printAuto) && "'0'".equals(printAuto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
package com.zbkj.service.util.jiab;
|
|
||||||
|
|
||||||
import com.sun.jna.Library;
|
|
||||||
import com.sun.jna.Native;
|
|
||||||
|
|
||||||
public interface JiabUtil extends Library {
|
|
||||||
|
|
||||||
JiabUtil INSTANCE = (JiabUtil) Native.loadLibrary("TSCLIB", JiabUtil.class);
|
|
||||||
|
|
||||||
int about();
|
|
||||||
|
|
||||||
int openport(String pirnterName);
|
|
||||||
|
|
||||||
int closeport();
|
|
||||||
|
|
||||||
int sendcommand(String printerCommand);
|
|
||||||
|
|
||||||
int setup(String width, String height, String speed, String density, String sensor, String vertical, String offset);
|
|
||||||
|
|
||||||
int downloadpcx(String filename, String image_name);
|
|
||||||
|
|
||||||
int barcode(String x, String y, String type, String height, String readable, String rotation, String narrow,
|
|
||||||
String wide, String code);
|
|
||||||
|
|
||||||
int printerfont(String x, String y, String fonttype, String rotation, String xmul, String ymul, String text);
|
|
||||||
|
|
||||||
int clearbuffer();
|
|
||||||
|
|
||||||
int printlabel(String set, String copy);
|
|
||||||
|
|
||||||
int formfeed();
|
|
||||||
|
|
||||||
int nobackfeed();
|
|
||||||
|
|
||||||
int windowsfont(int x, int y, int fontheight, int rotation, int fontstyle, int fontunderline, String szFaceName,
|
|
||||||
String content);
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user