|
@@ -598,33 +598,22 @@ public class PayController {
|
|
|
this.pushIntegral(customerPoints);
|
|
|
}
|
|
|
|
|
|
- Map map = new HashMap();
|
|
|
- map.put("stationId", infoMap.get("stationId").toString());
|
|
|
- map.put("oilGunNo", infoMap.get("oilGun").toString());
|
|
|
- List<Map> listDevices = stationOilGunService.getPrinterSnByStationIdAndOilGunNoList(map);
|
|
|
- if(listDevices !=null && listDevices.size() ==2){
|
|
|
- for(Map m : listDevices){
|
|
|
- if(m.get("deviceType").toString().equals("1")){
|
|
|
- //打印小票
|
|
|
- infoMap.put("sn", m.get("printerSn").toString());
|
|
|
- infoMap.put("printSetting", m.get("printSetting").toString());
|
|
|
+ if(stationInfos !=null && StringUtils.isNotBlank(stationInfo.getPrintDeviceType())){
|
|
|
+ switch (stationInfos.getPrintDeviceType()){
|
|
|
+ case "1": //小票机打印
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("stationId", infoMap.get("stationId").toString());
|
|
|
+ map.put("oilGunNo", infoMap.get("oilGun").toString());
|
|
|
+ map.put("deviceType", stationInfos.getPrintDeviceType());
|
|
|
+ List<Map> listDevices = stationOilGunService.getPrinterSnByStationIdAndOilGunNoList(map);
|
|
|
+ infoMap.put("sn", listDevices.get(0).get("printerSn").toString());
|
|
|
+ infoMap.put("printSetting", stationInfos.getPrintSetting());
|
|
|
this.printReceipt(infoMap);
|
|
|
- }else {
|
|
|
- //pos机打印小票
|
|
|
+ break;
|
|
|
+ case "2": //POS机打印
|
|
|
payOrder.setIntegral(String.valueOf(integral));
|
|
|
this.posPrintReceipt(payOrder);
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(listDevices !=null && listDevices.size() ==1){
|
|
|
- if(listDevices.get(0).get("deviceType").toString().equals("1")){
|
|
|
- //打印小票
|
|
|
- infoMap.put("sn", listDevices.get(0).get("printerSn").toString());
|
|
|
- infoMap.put("printSetting", listDevices.get(0).get("printSetting").toString());
|
|
|
- this.printReceipt(infoMap);
|
|
|
- }else {
|
|
|
- //POS机打印
|
|
|
- payOrder.setIntegral(String.valueOf(integral));
|
|
|
- this.posPrintReceipt(payOrder);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}else{
|