jk-GitHub-coder 3 éve
szülő
commit
0d1cc83525

+ 38 - 14
YijiaRestful/src/main/java/com/platform/yijia/controller/ElectronicMembershipCardController.java

@@ -711,6 +711,9 @@ public class ElectronicMembershipCardController {
         String content2;
         String orderNoP = "";
         String createdDateP ="";
+        String payDateP ="";
+        String oilGunP= "";
+        String receiptNameP="";
         String stationNameP ="";
         String oilNameP ="";
         String orderLitersP ="";
@@ -730,13 +733,21 @@ public class ElectronicMembershipCardController {
             SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             createdDateP =sdf.format(infoMap.get("createdDate"));
         }
+        if(infoMap.containsKey("payDate") && infoMap.get("payDate") !=null ){
+            //格式化日期
+            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            payDateP =sdf.format(infoMap.get("payDate"));
+        }
+        if(infoMap.containsKey("oilGun") && infoMap.get("oilGun") !=null ){
+            oilGunP =infoMap.get("oilGun").toString();
+        }
         if(infoMap.containsKey("stationName") && infoMap.get("stationName") !=null ){
             stationNameP =infoMap.get("stationName").toString();
         }
         if(infoMap.containsKey("oilName") && infoMap.get("oilName") !=null ){
             oilNameP =infoMap.get("oilName").toString();
         }
-        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").equals("3")) {
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").equals("3")) {
             //加油升数
             if (infoMap.containsKey("orderLiters") && infoMap.get("orderLiters") != null) {
                 orderLitersP = infoMap.get("orderLiters") + "";
@@ -748,11 +759,13 @@ public class ElectronicMembershipCardController {
             if(infoMap.containsKey("discountAmt") && infoMap.get("discountAmt") !=null ){
                 discountAmtP =infoMap.get("discountAmt")+"";
             }
+            receiptNameP = "油品订单";
         }else{
             orderLitersP ="0.00";
             oilPirceP = "0.00";
             discountAmtP ="0.00";
             receivableAmtP=infoMap.get("amt")+"";
+            receiptNameP = "非油品订单";
         }
         if(infoMap.containsKey("receivableAmt") && infoMap.get("receivableAmt") !=null ){
             receivableAmtP =infoMap.get("receivableAmt")+"";
@@ -775,41 +788,52 @@ public class ElectronicMembershipCardController {
             }
         }
 
-        content1 = "<CB>支付小票--顾客联</CB><BR>";
+        content1 = "<CB>"+receiptNameP+"--顾客联</CB><BR>";
+        content1 += "<BR>";
+        content1 += "--------------------------------<BR>";
+        content1 += "<BR>";
         content1 += "订单号:"+orderNoP+"  <BR>";
-        content1 += "时间:"+createdDateP+" <BR>";
+        content1 += "支付方式: "+payWayP+" <BR>";
+        content1 += "下单时间:"+createdDateP+" <BR>";
+        content1 += "付款时间:"+payDateP+" <BR>";
         content1 += "油站:"+stationNameP+"  <BR>";
-        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("3")){
+        content1 += "油枪:"+oilGunP+"号枪<BR>";
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content1 += "油品: "+oilNameP+"  <BR>";
             content1 += "油量: "+orderLitersP+"  升<BR>";
             content1 += "单价: "+oilPirceP+" L/元<BR>";
         }
         content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
-        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("3")){
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content1 += "优惠: "+discountAmtP+" 元<BR>";
         }
         content1 += "支付: "+amtP+" 元<BR>";
-        content1 += "支付方式: "+payWayP+" <BR>";
+        content1 += "手机号: "+mobilePhoneP+" <BR>";
         content1 += "<BR>";
         //content1 += "--------------------------------<BR>";
-        content1 += "<BR>";
+        //content1 += "<BR>";
 
-        content2 = "<CB>支付小票--商户联</CB><BR>";
-        content2 += "订单号:"+orderNoP+" <BR>";
-        content2 += "时间:"+createdDateP+"<BR>";
-        content2 += "油站:"+stationNameP+" <BR>";
-        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("3")){
+        content2 = "<CB>"+receiptNameP+"--商户联</CB><BR>";
+        content2 += "<BR>";
+        content2 += "--------------------------------<BR>";
+        content1 += "<BR>";
+        content2 += "订单号:"+orderNoP+"  <BR>";
+        content2 += "支付方式: "+payWayP+" <BR>";
+        content2 += "下单时间:"+createdDateP+" <BR>";
+        content2 += "付款时间:"+payDateP+" <BR>";
+        content2 += "油站:"+stationNameP+"  <BR>";
+        content2 += "油枪:"+oilGunP+"号枪<BR>";
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content2 += "油品: "+oilNameP+" <BR>";
             content2 += "油量: "+orderLitersP+" 升<BR>";
             content2 += "单价: "+oilPirceP+" L/元<BR>";
         }
         content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
-        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("3")){
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content2 += "优惠: "+discountAmtP+" 元<BR>";
         }
         content2 += "支付: "+amtP+" 元<BR>";
         content2 += "手机号: "+mobilePhoneP+" <BR>";
-        content2 += "支付方式: "+payWayP+" <BR>";
         content2 += "<BR>";
         //获取打印机编号
         //sn = "921611605";     //测试打印机 sn:921611605 key:72338zma

+ 38 - 14
YijiaRestful/src/main/java/com/platform/yijia/controller/PayController.java

@@ -882,6 +882,9 @@ public class PayController {
         String content2;
         String orderNoP = "";
         String createdDateP ="";
+        String payDateP ="";
+        String oilGunP= "";
+        String receiptNameP="";
         String stationNameP ="";
         String oilNameP ="";
         String orderLitersP ="";
@@ -901,13 +904,21 @@ public class PayController {
             SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             createdDateP =sdf.format(infoMap.get("createdDate"));
         }
+        if(infoMap.containsKey("payDate") && infoMap.get("payDate") !=null ){
+            //格式化日期
+            SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            payDateP =sdf.format(infoMap.get("payDate"));
+        }
+        if(infoMap.containsKey("oilGun") && infoMap.get("oilGun") !=null ){
+            oilGunP =infoMap.get("oilGun").toString();
+        }
         if(infoMap.containsKey("stationName") && infoMap.get("stationName") !=null ){
             stationNameP =infoMap.get("stationName").toString();
         }
         if(infoMap.containsKey("oilName") && infoMap.get("oilName") !=null ){
             oilNameP =infoMap.get("oilName").toString();
         }
-        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").equals("3")) {
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").equals("3")) {
             //加油升数
             if (infoMap.containsKey("orderLiters") && infoMap.get("orderLiters") != null) {
                 orderLitersP = infoMap.get("orderLiters") + "";
@@ -919,11 +930,13 @@ public class PayController {
             if(infoMap.containsKey("discountAmt") && infoMap.get("discountAmt") !=null ){
                 discountAmtP =infoMap.get("discountAmt")+"";
             }
+            receiptNameP = "油品订单";
         }else {
             orderLitersP ="0.00";
             oilPirceP = "0.00";
             discountAmtP ="0.00";
             receivableAmtP=infoMap.get("amt")+"";
+            receiptNameP = "非油品订单";
         }
         if(infoMap.containsKey("receivableAmt") && infoMap.get("receivableAmt") !=null ){
             receivableAmtP =infoMap.get("receivableAmt")+"";
@@ -946,41 +959,52 @@ public class PayController {
 
         }
 
-        content1 = "<CB>支付小票--顾客联</CB><BR>";
+        content1 = "<CB>"+receiptNameP+"--顾客联</CB><BR>";
+        content1 += "<BR>";
+        content1 += "--------------------------------<BR>";
+        content1 += "<BR>";
         content1 += "订单号:"+orderNoP+"  <BR>";
-        content1 += "时间:"+createdDateP+" <BR>";
+        content1 += "支付方式: "+payWayP+" <BR>";
+        content1 += "下单时间:"+createdDateP+" <BR>";
+        content1 += "付款时间:"+payDateP+" <BR>";
         content1 += "油站:"+stationNameP+"  <BR>";
-        if(infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("1")){
+        content1 += "油枪:"+oilGunP+"号枪<BR>";
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content1 += "油品: "+oilNameP+"  <BR>";
             content1 += "油量: "+orderLitersP+"  升<BR>";
             content1 += "单价: "+oilPirceP+" L/元<BR>";
         }
         content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
-        if(infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("1")){
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content1 += "优惠: "+discountAmtP+" 元<BR>";
         }
         content1 += "支付: "+amtP+" 元<BR>";
-        content1 += "支付方式: "+payWayP+" <BR>";
+        content1 += "手机号: "+mobilePhoneP+" <BR>";
         content1 += "<BR>";
         //content1 += "--------------------------------<BR>";
-        content1 += "<BR>";
+        //content1 += "<BR>";
 
-        content2 = "<CB>支付小票--商户联</CB><BR>";
-        content2 += "订单号:"+orderNoP+" <BR>";
-        content2 += "时间:"+createdDateP+"<BR>";
-        content2 += "油站:"+stationNameP+" <BR>";
-        if(infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("1")){
+        content2 = "<CB>"+receiptNameP+"--商户联</CB><BR>";
+        content2 += "<BR>";
+        content2 += "--------------------------------<BR>";
+        content1 += "<BR>";
+        content2 += "订单号:"+orderNoP+"  <BR>";
+        content2 += "支付方式: "+payWayP+" <BR>";
+        content2 += "下单时间:"+createdDateP+" <BR>";
+        content2 += "付款时间:"+payDateP+" <BR>";
+        content2 += "油站:"+stationNameP+"  <BR>";
+        content2 += "油枪:"+oilGunP+"号枪<BR>";
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content2 += "油品: "+oilNameP+" <BR>";
             content2 += "油量: "+orderLitersP+" 升<BR>";
             content2 += "单价: "+oilPirceP+" L/元<BR>";
         }
         content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
-        if(infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("1")){
+        if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content2 += "优惠: "+discountAmtP+" 元<BR>";
         }
         content2 += "支付: "+amtP+" 元<BR>";
         content2 += "手机号: "+mobilePhoneP+" <BR>";
-        content2 += "支付方式: "+payWayP+" <BR>";
         content2 += "<BR>";
         //获取打印机编号
         //sn = "921611605";     //测试打印机 sn:921611605 key:72338zma

+ 2 - 3
YijiaRestful/src/main/resources/mapper/StationInfoMapper.xml

@@ -612,11 +612,10 @@
         A.device_no                 AS printerSn,
         B.integral_print_flag       AS integralPrintFlag
     FROM  station_device_manage     AS A
-        LEFT JOIN station_pay       AS B ON A.station_id = B.station_id
+        LEFT JOIN sys_dept          AS B ON A.station_id = B.dept_id
     <where>
-      A.device_status = "1"
       <if test="stationId != null and stationId !=''">
-        AND A.station_id = #{stationId}
+        A.station_id = #{stationId}
       </if>
     </where>
   </select>

+ 4 - 4
YijiaRestful/src/main/resources/mapper/StationOilGunMapper.xml

@@ -281,16 +281,16 @@
     FROM  station_device_manage     AS A
         LEFT JOIN sys_dept          AS B ON A.station_id = B.dept_id
     <where>
-            A.device_status = "1"
+        <if test="stationId != null and stationId !=''">
+          A.station_id = #{stationId}
+        </if>
         <if test="oilGunNo != null and oilGunNo !=''">
           AND FIND_IN_SET(#{oilGunNo}, A.gun_no)
         </if>
         <if test="deviceType != null and deviceType !=''">
           AND A.device_type = #{deviceType}
         </if>
-        <if test="stationId != null and stationId !=''">
-          AND A.station_id = #{stationId}
-        </if>
+
     </where>
 
   </select>