jk-GitHub-coder 4 anni fa
parent
commit
11b80951d4

+ 16 - 11
YijiaRestful/src/main/java/com/platform/yijia/controller/ElectronicMembershipCardController.java

@@ -159,6 +159,7 @@ public class ElectronicMembershipCardController {
                 customerCardSetting.setStationId(stationId);
                 customerCardSetting.setCardOilsType(cardOilsType);
                 customerCardSetting.setOrderBy("DESC");
+                customerCardSetting.setDelFlag("0");
                 //获取用户要充值电子卡的优惠规则信息
                 List<CustomerCardSetting> cardRechargeSettingList = electronicMembershipCardService.getCardRechargeSettingList(customerCardSetting);
                 if(cardRechargeSettingList !=null && cardRechargeSettingList.size() ==1){
@@ -317,7 +318,7 @@ public class ElectronicMembershipCardController {
                 String oilLiters = resultMap.get("orderLiters").toString();   //orderLiters
                 String receivableAmt = resultMap.get("receivableAmt").toString();
                 String amt = resultMap.get("amt").toString();
-                String orderType = resultMap.get("orderType").toString();
+                String oilType = resultMap.get("oilType").toString();
                 String groupId = resultMap.get("groupId").toString();
                 String oilGun = resultMap.get("oilGun").toString();
 
@@ -478,7 +479,7 @@ public class ElectronicMembershipCardController {
                         calculateIntegral.setReceivableAmt(new BigDecimal(receivableAmt));              //应收金额
                         calculateIntegral.setOilLiters(new BigDecimal(oilLiters));                      //加油升数
                         calculateIntegral.setOilName(oilName);                                          //油品名称
-                        calculateIntegral.setOilType(orderType);                                        //油类
+                        calculateIntegral.setOilType(oilType);                                        //油类
                         calculateIntegral.setStationId(Integer.valueOf(stationId));                     //油站ID
                         calculateIntegral.setUnionId(unionId);                                          //客户UnionID
                         calculateIntegral.setOpenId(minaOpenid);                                        //小程序openId
@@ -585,10 +586,14 @@ public class ElectronicMembershipCardController {
             m.put("stationId", infoMap.get("stationId").toString());
         }
 
-//        if(infoMap !=null && infoMap.containsKey("orderType") && infoMap.get("orderType") !=null){
-//            m.put("orderType", infoMap.get("orderType").toString());
-//        }
-        m.put("orderType", "oil");
+        if(infoMap !=null && infoMap.containsKey("oilType") && infoMap.get("oilType") !=null){
+            if(infoMap.get("oilType").equals("3")){
+                m.put("orderType", "noOil");
+            }else {
+                m.put("orderType", "oil");
+            }
+        }
+        //m.put("orderType", "oil");
         logger.info("要推送的订单的信息:" +m.toString());
         //定义推送格式
         Map<String, Object> params = new HashMap<>();
@@ -656,7 +661,7 @@ public class ElectronicMembershipCardController {
         if(infoMap.containsKey("oilName") && infoMap.get("oilName") !=null ){
             oilNameP =infoMap.get("oilName").toString();
         }
-        if(!infoMap.containsKey("orderType") && infoMap.get("orderType").equals("3")) {
+        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").equals("3")) {
             //加油升数
             if (infoMap.containsKey("orderLiters") && infoMap.get("orderLiters") != null) {
                 orderLitersP = infoMap.get("orderLiters") + "";
@@ -699,13 +704,13 @@ public class ElectronicMembershipCardController {
         content1 += "订单号:"+orderNoP+"  <BR>";
         content1 += "时间:"+createdDateP+" <BR>";
         content1 += "油站:"+stationNameP+"  <BR>";
-        if(!infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("3")){
+        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("orderType") && infoMap.get("orderType").toString().equals("3")){
+        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("3")){
             content1 += "优惠: "+discountAmtP+" 元<BR>";
         }
         content1 += "支付: "+amtP+" 元<BR>";
@@ -718,13 +723,13 @@ public class ElectronicMembershipCardController {
         content2 += "订单号:"+orderNoP+" <BR>";
         content2 += "时间:"+createdDateP+"<BR>";
         content2 += "油站:"+stationNameP+" <BR>";
-        if(!infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("3")){
+        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("orderType") && infoMap.get("orderType").toString().equals("3")){
+        if(!infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("3")){
             content2 += "优惠: "+discountAmtP+" 元<BR>";
         }
         content2 += "支付: "+amtP+" 元<BR>";

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

@@ -583,7 +583,7 @@ public class PayController {
                                 calculateIntegral.setStationId(Integer.valueOf(infoMap.get("stationId").toString()));           //油站ID
                                 calculateIntegral.setStationName(infoMap.get("stationName").toString());                        //油站名称
                                 calculateIntegral.setAmt(new BigDecimal(infoMap.get("amt").toString()));                        //实收金额
-                                calculateIntegral.setOilType(infoMap.get("orderType").toString());                              //订单类型
+                                calculateIntegral.setOilType(infoMap.get("oilType").toString());                              //订单类型
                                 calculateIntegral.setOilName(infoMap.get("oilName").toString());                                //油品名称
                                 calculateIntegral.setOilLiters(new BigDecimal(infoMap.get("orderLiters").toString()));          //加油升数
                                 calculateIntegral.setUnionId(infoMap.get("unionId").toString());                                //客户unionId
@@ -819,7 +819,13 @@ public class PayController {
 //        if(infoMap !=null && infoMap.containsKey("orderType") && infoMap.get("orderType") !=null){
 //            m.put("orderType", infoMap.get("orderType").toString());
 //        }
-        m.put("orderType", "oil");
+        if(infoMap !=null && infoMap.containsKey("oilType") && infoMap.get("oilType") !=null){
+            if(infoMap.get("oilType").equals("3")){
+                m.put("orderType", "noOil");
+            }else {
+                m.put("orderType", "oil");
+            }
+        }
         logger.info("要推送的订单的信息:" +m.toString());
         //定义推送格式
         Map<String, Object> params = new HashMap<>();
@@ -887,7 +893,7 @@ public class PayController {
         if(infoMap.containsKey("oilName") && infoMap.get("oilName") !=null ){
             oilNameP =infoMap.get("oilName").toString();
         }
-        if(infoMap.containsKey("orderType") && infoMap.get("orderType").equals("1")) {
+        if(infoMap.containsKey("oilType") && infoMap.get("oilType").equals("1")) {
             //加油升数
             if (infoMap.containsKey("orderLiters") && infoMap.get("orderLiters") != null) {
                 orderLitersP = infoMap.get("orderLiters") + "";
@@ -899,7 +905,7 @@ public class PayController {
             if(infoMap.containsKey("discountAmt") && infoMap.get("discountAmt") !=null ){
                 discountAmtP =infoMap.get("discountAmt")+"";
             }
-        }else if(infoMap.containsKey("orderType") && infoMap.get("orderType").equals("2")) {
+        }else if(infoMap.containsKey("oilType") && infoMap.get("oilType").equals("2")) {
             orderLitersP ="0.00";
             oilPirceP = "0.00";
             discountAmtP ="0.00";
@@ -927,13 +933,13 @@ public class PayController {
         content1 += "订单号:"+orderNoP+"  <BR>";
         content1 += "时间:"+createdDateP+" <BR>";
         content1 += "油站:"+stationNameP+"  <BR>";
-        if(infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("1")){
+        if(infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("1")){
             content1 += "油品: "+oilNameP+"  <BR>";
             content1 += "油量: "+orderLitersP+"  升<BR>";
             content1 += "单价: "+oilPirceP+" L/元<BR>";
         }
         content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
-        if(infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("1")){
+        if(infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("1")){
             content1 += "优惠: "+discountAmtP+" 元<BR>";
         }
         content1 += "支付: "+amtP+" 元<BR>";
@@ -946,13 +952,13 @@ public class PayController {
         content2 += "订单号:"+orderNoP+" <BR>";
         content2 += "时间:"+createdDateP+"<BR>";
         content2 += "油站:"+stationNameP+" <BR>";
-        if(infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("1")){
+        if(infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("1")){
             content2 += "油品: "+oilNameP+" <BR>";
             content2 += "油量: "+orderLitersP+" 升<BR>";
             content2 += "单价: "+oilPirceP+" L/元<BR>";
         }
         content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
-        if(infoMap.containsKey("orderType") && infoMap.get("orderType").toString().equals("1")){
+        if(infoMap.containsKey("oilType") && infoMap.get("oilType").toString().equals("1")){
             content2 += "优惠: "+discountAmtP+" 元<BR>";
         }
         content2 += "支付: "+amtP+" 元<BR>";

+ 5 - 4
YijiaRestful/src/main/java/com/platform/yijia/controller/PayOrderController.java

@@ -96,9 +96,8 @@ public class PayOrderController {
                 oil.setDictType("oil_name");
                 Oil oilInfo = sysDictDataService.selectOilType(oil);
                 payOrder.setOilType(oilInfo.getOilsType());     //油品类型
-                String orderType = oilInfo.getOilsType();                          //获取订单类型
-                logger.info("订单类型:" + orderType);
-                payOrder.setOrderType(orderType);
+                String oilsType = oilInfo.getOilsType();                          //获取订单类型
+                logger.info("订单油品类型:" + oilsType);
                 payOrderRequest.setCardOilsType(oilInfo.getOilsType());                 //电子卡类型;注:用于获取客户电子卡参数查询
                 payOrder.setOilName(oilName);                   //油品名称
                 StationInfo stationInfo = new StationInfo();
@@ -130,7 +129,8 @@ public class PayOrderController {
                 }else {
                     payOrder.setOilPersonnel("");
                 }
-                if(orderType.equals("3")){                                                  //订单类型是油品时计算
+                if(oilsType.equals("3")){                                                  //订单类型是油品时计算
+                    payOrder.setOrderType("2");
                     payOrder.setAmt(Double.valueOf(payOrderRequest.getReceivableAmt()));        //非油品金额
                     payOrder.setDiscountAmt(Double.valueOf(0));                                 //优惠金额
                     payOrder.setOilPirce(payOrderRequest.getReceivableAmt());        //非油品价格
@@ -148,6 +148,7 @@ public class PayOrderController {
                     payOrder.setOrderLiters(payOrderResultInfo.getOilLiters());
                     payOrder.setDiscountAmt(Double.valueOf(payOrderResultInfo.getDiscountAmt()));
                     payOrder.setAmt(Double.valueOf(payOrderResultInfo.getAmt()));
+                    payOrder.setOrderType("1");
                     resultMap.put("cardEnabledFlag", payOrderResultInfo.getCardEnabledFlag());
                     resultMap.put("oilsCardFlag", payOrderResultInfo.getOilsCardFlag());
                     resultMap.put("discountAmt", payOrderResultInfo.getDiscountAmt());                                          //优惠价格

+ 1 - 0
YijiaRestful/src/main/java/com/platform/yijia/pojo/CustomerCardSetting.java

@@ -23,6 +23,7 @@ public class CustomerCardSetting {
     private Date createTime;
     private String isMarket;            //是否叠加营销方案
     private String isGradeSetting;      //是否叠加等级优惠
+    private String delFlag;             //改充值规则是否删除
 
     private String orderBy;         //查询结果排序方式
     private List<CustomerCardSettingDetail> customerCardSettingDetailList;

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

@@ -97,7 +97,9 @@
         FROM
             customer_card_setting AS T1 LEFT JOIN customer_card_setting_detail AS T2 ON T1.id = T2.parent_id
         <where>
-                T2.del_flag ="0"
+            <if test="delFlag !=null and delFlag !=''">
+                T2.del_flag = #{delFlag}
+            </if>
             <if test="stationId !=null">
                 AND T1.station_id = #{stationId}
             </if>
@@ -111,7 +113,6 @@
         <if test="orderBy !=null and orderBy !=''">
             ORDER BY T2.discount_amt_start ${orderBy}
         </if>
-
     </select>
 
     <!--查询客户充值的订单信息-->

+ 1 - 0
YijiaRestful/src/main/resources/mapper/PayOrderMapper.xml

@@ -978,6 +978,7 @@
         A.pay_type				AS payType,
         A.oil_name 				AS oilName,
         A.oil_gun               AS oilGun,
+        A.oil_type              AS oilType,
         A.order_liters 			AS orderLiters,
         A.amt 					AS amt,
         A.order_type 			AS orderType,