jk-GitHub-coder vor 4 Jahren
Ursprung
Commit
587b7e4e4e

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

@@ -815,6 +815,7 @@ public class ElectronicMembershipCardController {
         content1 += "<BR>";
         content1 += "--------------------------------<BR>";
         content1 += "<BR>";
+        content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
         content1 += "订单号:"+orderNoP+"  <BR>";
         content1 += "支付方式: "+payWayP+" <BR>";
         content1 += "下单时间:"+createdDateP+" <BR>";
@@ -826,7 +827,6 @@ public class ElectronicMembershipCardController {
             content1 += "油量: "+orderLitersP+"  升<BR>";
             content1 += "单价: "+oilPirceP+" L/元<BR>";
         }
-        content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
         if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content1 += "优惠: "+discountAmtP+" 元<BR>";
         }
@@ -839,7 +839,8 @@ public class ElectronicMembershipCardController {
         content2 = "<CB>"+receiptNameP+"--商户联</CB><BR>";
         content2 += "<BR>";
         content2 += "--------------------------------<BR>";
-        content1 += "<BR>";
+        content2 += "<BR>";
+        content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
         content2 += "订单号:"+orderNoP+"  <BR>";
         content2 += "支付方式: "+payWayP+" <BR>";
         content2 += "下单时间:"+createdDateP+" <BR>";
@@ -851,7 +852,6 @@ public class ElectronicMembershipCardController {
             content2 += "油量: "+orderLitersP+" 升<BR>";
             content2 += "单价: "+oilPirceP+" L/元<BR>";
         }
-        content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
         if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content2 += "优惠: "+discountAmtP+" 元<BR>";
         }

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

@@ -597,7 +597,7 @@ public class PayController {
                                 StationBalanceChange stationBalanceChange = new StationBalanceChange();
                                 stationBalanceChange.setStationId(stationInfos.getStationId());
                                 stationBalanceChange.setAmt(Double.valueOf(infoMap.get("sellAmt").toString()));
-                                stationBalanceChange.setCreateTime(new SimpleDateFormat("yyyy-MM-dd hh-mm-ss").parse(infoMap.get("payDate").toString()));
+                                stationBalanceChange.setCreateTime(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(infoMap.get("payDate").toString()));
                                 stationBalanceChange.setType("-");
                                 stationBalanceChange.setOrderNo(ordNo);
                                 //生成记录
@@ -605,8 +605,10 @@ public class PayController {
                                 StationInfo s = new StationInfo();
                                 BigDecimal subtract = new BigDecimal(String.valueOf(stationInfos.getBalance())).subtract(new BigDecimal(infoMap.get("sellAmt").toString()));
                                 s.setBalance(subtract.doubleValue());
+                                s.setStationId(stationInfos.getStationId());
                                 //更新油站余额
                                 stationService.updateStationBalance(s);
+                                logger.info("LNG加气平台支付更新余额完成!");
                             }else {
                                 //当前系统主要业务逻辑
                                 CustomerManage customerManage = this.insertCustomerManage(infoMap);                              //插入客户积分返回要插入客户的信息
@@ -726,8 +728,6 @@ public class PayController {
                     }else {
                         logger.info("更新订单状态失败!");
                     }
-                }else {
-                    logger.info("该订单状态不为0!");
                 }
             }else {
                 logger.info("该订单不存在!");
@@ -1033,6 +1033,7 @@ public class PayController {
         content1 += "<BR>";
         content1 += "--------------------------------<BR>";
         content1 += "<BR>";
+        content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
         content1 += "订单号:"+orderNoP+"  <BR>";
         content1 += "支付方式: "+payWayP+" <BR>";
         content1 += "下单时间:"+createdDateP+" <BR>";
@@ -1044,7 +1045,6 @@ public class PayController {
             content1 += "油量: "+orderLitersP+"  升<BR>";
             content1 += "单价: "+oilPirceP+" L/元<BR>";
         }
-        content1 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
         if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content1 += "优惠: "+discountAmtP+" 元<BR>";
         }
@@ -1057,7 +1057,8 @@ public class PayController {
         content2 = "<CB>"+receiptNameP+"--商户联</CB><BR>";
         content2 += "<BR>";
         content2 += "--------------------------------<BR>";
-        content1 += "<BR>";
+        content2 += "<BR>";
+        content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
         content2 += "订单号:"+orderNoP+"  <BR>";
         content2 += "支付方式: "+payWayP+" <BR>";
         content2 += "下单时间:"+createdDateP+" <BR>";
@@ -1069,7 +1070,6 @@ public class PayController {
             content2 += "油量: "+orderLitersP+" 升<BR>";
             content2 += "单价: "+oilPirceP+" L/元<BR>";
         }
-        content2 += "<BOLD><B>原价: "+receivableAmtP+" 元</B></BOLD><BR>";
         if(infoMap.containsKey("oilType") && !infoMap.get("oilType").toString().equals("3")){
             content2 += "优惠: "+discountAmtP+" 元<BR>";
         }

+ 3 - 1
YijiaRestful/src/main/java/com/platform/yijia/controller/PayOrderController.java

@@ -339,7 +339,9 @@ public class PayOrderController {
         if(params.containsKey("driverPrice") && params.get("driverPrice").toString() !=null && params.get("driverPrice").toString() !=""){
             //司机价
             discountPrice = sellPrice.multiply(new BigDecimal(params.get("driverPrice").toString())).divide(new BigDecimal("100"));
-            amt = discountPrice.multiply(oilLiters);    //二次折扣优惠金额
+            amt = oilLiters.toString().equals("0.00")? new BigDecimal("0.01") : discountPrice.multiply(oilLiters);
+            //amt = discountPrice.multiply(oilLiters);    //二次折扣优惠金额
+            //amt.setScale(2, BigDecimal.ROUND_HALF_UP);
             discountAmt = receivableAmt.subtract(amt);
             discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
             discountPrice = discountPrice.setScale(2, BigDecimal.ROUND_HALF_UP);

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

@@ -694,12 +694,12 @@
     UPDATE sys_dept
     <set>
       <if test="balance !=null ">
-        balance = #{balance},
+        balance = #{balance}
       </if>
     </set>
     <where>
       <if test="stationId != null and stationId !='' ">
-        station_id = #{stationId}
+        dept_id = #{stationId}
       </if>
     </where>
 

+ 9 - 4
YijiaRestful/src/test/java/com/palatform/yijia/test.java

@@ -10,16 +10,21 @@ import org.apache.commons.codec.digest.DigestUtils;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.text.Bidi;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
 public class test {
 
-    public static void main(String[] args) {
+    public static void main(String[] args) throws ParseException {
 
-        BigDecimal discountPrice = new BigDecimal("5.36");
-        BigDecimal sellPrice = discountPrice.multiply(new BigDecimal("98")).divide(new BigDecimal("100"));
-        System.out.println(sellPrice.toString());
+
+        Date parse = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse("2021-04-24 22:22:22");
+        System.out.println(parse);
+
+//        BigDecimal discountPrice = new BigDecimal("5.36");
+//        BigDecimal sellPrice = discountPrice.multiply(new BigDecimal("98")).divide(new BigDecimal("100"));
+//        System.out.println(sellPrice.toString());
 
 
         //QRcodeUtils.encode();