|
@@ -34,6 +34,7 @@ import java.util.*;
|
|
*/
|
|
*/
|
|
@Controller
|
|
@Controller
|
|
@YiJiaRequest()
|
|
@YiJiaRequest()
|
|
|
|
+@CrossOrigin
|
|
public class ElectronicMembershipCardController {
|
|
public class ElectronicMembershipCardController {
|
|
private static Logger logger =(Logger) LoggerFactory.getLogger(ElectronicMembershipCardController.class);
|
|
private static Logger logger =(Logger) LoggerFactory.getLogger(ElectronicMembershipCardController.class);
|
|
|
|
|
|
@@ -497,6 +498,7 @@ public class ElectronicMembershipCardController {
|
|
break;
|
|
break;
|
|
case "2": //POS机打印
|
|
case "2": //POS机打印
|
|
payOrder.setIntegral(String.valueOf(integral));
|
|
payOrder.setIntegral(String.valueOf(integral));
|
|
|
|
+ payOrder.setPrintSetting(stationInfos.getPrintSetting());
|
|
this.posPrintReceipt(payOrder);
|
|
this.posPrintReceipt(payOrder);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -504,17 +506,13 @@ public class ElectronicMembershipCardController {
|
|
}else {
|
|
}else {
|
|
resultData=ResultData.error(CodeMsg.BALANCE_NOT_EENOUGH);
|
|
resultData=ResultData.error(CodeMsg.BALANCE_NOT_EENOUGH);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ }else {
|
|
resultData=ResultData.error(CodeMsg.NO_ORDER);
|
|
resultData=ResultData.error(CodeMsg.NO_ORDER);
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ resultData = ResultData.error(CodeMsg.REQUEST_FAIL);
|
|
}
|
|
}
|
|
- if(resultData !=null) {
|
|
|
|
- return gson.toJson(resultData);
|
|
|
|
- }else {
|
|
|
|
- resultData = ResultData.error(CodeMsg.SELECT_ORDER_ERROR);
|
|
|
|
- return gson.toJson(resultData);
|
|
|
|
- }
|
|
|
|
|
|
+ return gson.toJson(resultData);
|
|
}
|
|
}
|
|
|
|
|
|
//POS机打印小票
|
|
//POS机打印小票
|
|
@@ -586,10 +584,11 @@ public class ElectronicMembershipCardController {
|
|
if(infoMap !=null && infoMap.containsKey("stationId") && infoMap.get("stationId") !=null){
|
|
if(infoMap !=null && infoMap.containsKey("stationId") && infoMap.get("stationId") !=null){
|
|
m.put("stationId", infoMap.get("stationId").toString());
|
|
m.put("stationId", infoMap.get("stationId").toString());
|
|
}
|
|
}
|
|
- if(infoMap !=null && infoMap.containsKey("orderType") && infoMap.get("orderType") !=null){
|
|
|
|
- m.put("orderType", infoMap.get("orderType").toString());
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
+// if(infoMap !=null && infoMap.containsKey("orderType") && infoMap.get("orderType") !=null){
|
|
|
|
+// m.put("orderType", infoMap.get("orderType").toString());
|
|
|
|
+// }
|
|
|
|
+ m.put("orderType", "oil");
|
|
logger.info("要推送的订单的信息:" +m.toString());
|
|
logger.info("要推送的订单的信息:" +m.toString());
|
|
//定义推送格式
|
|
//定义推送格式
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
@@ -605,6 +604,7 @@ public class ElectronicMembershipCardController {
|
|
params.put("posFanoutExchange", stationDeviceManagerInfo.getPosFanoutExchange());
|
|
params.put("posFanoutExchange", stationDeviceManagerInfo.getPosFanoutExchange());
|
|
params.put("posQueue", stationDeviceManagerInfo.getPosQueue());
|
|
params.put("posQueue", stationDeviceManagerInfo.getPosQueue());
|
|
params.put("tusn", stationDeviceManagerInfo.getDeviceNo());
|
|
params.put("tusn", stationDeviceManagerInfo.getDeviceNo());
|
|
|
|
+ params.put("printSetting", payOrder.getPrintSetting()); //小票打印方式
|
|
}
|
|
}
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
list.add(m);
|
|
list.add(m);
|
|
@@ -656,7 +656,7 @@ public class ElectronicMembershipCardController {
|
|
if(infoMap.containsKey("oilName") && infoMap.get("oilName") !=null ){
|
|
if(infoMap.containsKey("oilName") && infoMap.get("oilName") !=null ){
|
|
oilNameP =infoMap.get("oilName").toString();
|
|
oilNameP =infoMap.get("oilName").toString();
|
|
}
|
|
}
|
|
- if(infoMap.containsKey("orderType") && infoMap.get("orderType").equals("1")) {
|
|
|
|
|
|
+ if(!infoMap.containsKey("orderType") && infoMap.get("orderType").equals("3")) {
|
|
//加油升数
|
|
//加油升数
|
|
if (infoMap.containsKey("orderLiters") && infoMap.get("orderLiters") != null) {
|
|
if (infoMap.containsKey("orderLiters") && infoMap.get("orderLiters") != null) {
|
|
orderLitersP = infoMap.get("orderLiters") + "";
|
|
orderLitersP = infoMap.get("orderLiters") + "";
|
|
@@ -668,7 +668,7 @@ public class ElectronicMembershipCardController {
|
|
if(infoMap.containsKey("discountAmt") && infoMap.get("discountAmt") !=null ){
|
|
if(infoMap.containsKey("discountAmt") && infoMap.get("discountAmt") !=null ){
|
|
discountAmtP =infoMap.get("discountAmt")+"";
|
|
discountAmtP =infoMap.get("discountAmt")+"";
|
|
}
|
|
}
|
|
- }else if(infoMap.containsKey("orderType") && infoMap.get("orderType").equals("2")) {
|
|
|
|
|
|
+ }else{
|
|
orderLitersP ="0.00";
|
|
orderLitersP ="0.00";
|
|
oilPirceP = "0.00";
|
|
oilPirceP = "0.00";
|
|
discountAmtP ="0.00";
|
|
discountAmtP ="0.00";
|
|
@@ -699,13 +699,13 @@ public class ElectronicMembershipCardController {
|
|
content1 += "订单号:"+orderNoP+" <BR>";
|
|
content1 += "订单号:"+orderNoP+" <BR>";
|
|
content1 += "时间:"+createdDateP+" <BR>";
|
|
content1 += "时间:"+createdDateP+" <BR>";
|
|
content1 += "油站:"+stationNameP+" <BR>";
|
|
content1 += "油站:"+stationNameP+" <BR>";
|
|
- if(infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("1")){
|
|
|
|
|
|
+ if(!infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("3")){
|
|
content1 += "油品: "+oilNameP+" <BR>";
|
|
content1 += "油品: "+oilNameP+" <BR>";
|
|
content1 += "油量: "+orderLitersP+" 升<BR>";
|
|
content1 += "油量: "+orderLitersP+" 升<BR>";
|
|
content1 += "单价: "+oilPirceP+" L/元<BR>";
|
|
content1 += "单价: "+oilPirceP+" L/元<BR>";
|
|
}
|
|
}
|
|
content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
|
|
content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
|
|
- if(infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("1")){
|
|
|
|
|
|
+ if(!infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("3")){
|
|
content1 += "优惠: "+discountAmtP+" 元<BR>";
|
|
content1 += "优惠: "+discountAmtP+" 元<BR>";
|
|
}
|
|
}
|
|
content1 += "支付: "+amtP+" 元<BR>";
|
|
content1 += "支付: "+amtP+" 元<BR>";
|
|
@@ -718,13 +718,13 @@ public class ElectronicMembershipCardController {
|
|
content2 += "订单号:"+orderNoP+" <BR>";
|
|
content2 += "订单号:"+orderNoP+" <BR>";
|
|
content2 += "时间:"+createdDateP+"<BR>";
|
|
content2 += "时间:"+createdDateP+"<BR>";
|
|
content2 += "油站:"+stationNameP+" <BR>";
|
|
content2 += "油站:"+stationNameP+" <BR>";
|
|
- if(infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("1")){
|
|
|
|
|
|
+ if(!infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("3")){
|
|
content2 += "油品: "+oilNameP+" <BR>";
|
|
content2 += "油品: "+oilNameP+" <BR>";
|
|
content2 += "油量: "+orderLitersP+" 升<BR>";
|
|
content2 += "油量: "+orderLitersP+" 升<BR>";
|
|
content2 += "单价: "+oilPirceP+" L/元<BR>";
|
|
content2 += "单价: "+oilPirceP+" L/元<BR>";
|
|
}
|
|
}
|
|
content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
|
|
content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
|
|
- if(infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("1")){
|
|
|
|
|
|
+ if(!infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("3")){
|
|
content2 += "优惠: "+discountAmtP+" 元<BR>";
|
|
content2 += "优惠: "+discountAmtP+" 元<BR>";
|
|
}
|
|
}
|
|
content2 += "支付: "+amtP+" 元<BR>";
|
|
content2 += "支付: "+amtP+" 元<BR>";
|