Explorar el Código

加油员,计算优惠修改

jk-GitHub-coder hace 3 años
padre
commit
1568b48f0b

+ 55 - 17
YijiaRestful/src/main/java/com/platform/yijia/controller/PayOrderController.java

@@ -188,6 +188,7 @@ public class PayOrderController {
                         if (list != null && list.size() > 0) {
                             if(list.get(0).containsKey("personnelName") && list.get(0).get("personnelName") !=null && list.get(0).get("personnelName").toString() !=""){
                                 payOrder.setOilPersonnel(list.get(0).get("personnelName").toString());
+                                payOrder.setOilPersonnelId(list.get(0).get("personnelId").toString());
                                 payOrderMapper.insertSelective(payOrder);
                                 resultData = ResultData.success(resultMap);
                             }else {
@@ -205,14 +206,19 @@ public class PayOrderController {
                         logger.info("加油员信息:"+ mapResultList.toString());
                         if(mapResultList != null && mapResultList.size() > 0){
                             String oilPersonnel = "";
+                            String oilPersonnelId ="";
                             for (Map per : mapResultList){
                                 if(per.containsKey("personnelName") && per.get("personnelName").toString() !=null && per.get("personnelName").toString() !=""){
                                     oilPersonnel += per.get("personnelName").toString() +",";
+                                    oilPersonnelId += per.get("personnelId").toString() +",";
                                 }
                             }
                             if(oilPersonnel !=""){
                                 payOrder.setOilPersonnel(oilPersonnel.substring(0, oilPersonnel.length()-1));   //加油员
+                                payOrder.setOilPersonnelId(oilPersonnelId.substring(0, oilPersonnelId.length()-1));
                             }
+//                            payOrder.setOilPersonnel(mapResultList.get(0).get("").toString());   //加油员
+//                            payOrder.setOilPersonnelId(oilPersonnelId.substring(0, oilPersonnelId.length()-1));
                             payOrderMapper.insertSelective(payOrder);
                             resultData = ResultData.success(resultMap);
                         }else {
@@ -436,7 +442,7 @@ public class PayOrderController {
         BigDecimal oilLiters = new BigDecimal("0.00");  //加油升数
         BigDecimal discountAmt = new BigDecimal(0);     //标签方案优惠金额
         BigDecimal dzkDiscountAmt = new BigDecimal(0);  //电子卡优惠金额
-        BigDecimal amt = new BigDecimal(0);
+        BigDecimal amt = receivableAmt;
         BigDecimal discountPrice = oilPrice;
 
         //加油升数
@@ -470,14 +476,18 @@ public class PayOrderController {
                         case "1":   //按加油升数
                             if(oilLiters.compareTo(discountAmt_B) ==1 || oilLiters.compareTo(discountAmt_B) ==0 ){
                                 discountPrice = oilPrice.subtract(new BigDecimal(labelRuleDetailList.get(0).getDiscountLitersAmt()));
-                                discountAmt = oilLiters.multiply(new BigDecimal(labelRuleDetailList.get(0).getDiscountLitersAmt()));
+                                amt = discountPrice.multiply(oilLiters);
+                                discountAmt = receivableAmt.subtract(amt);
+                                //discountAmt = oilLiters.multiply(new BigDecimal(labelRuleDetailList.get(0).getDiscountLitersAmt()));
                                 discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                             }
                             break;
                         case "2":   //按加油金额
                             if(receivableAmt.compareTo(discountAmt_B) ==1 || receivableAmt.compareTo(discountAmt_B) ==0 ){
                                 discountPrice = oilPrice.subtract(new BigDecimal(labelRuleDetailList.get(0).getDiscountLitersAmt()));
-                                discountAmt = oilLiters.multiply(new BigDecimal(labelRuleDetailList.get(0).getDiscountLitersAmt()));
+                                amt = discountPrice.multiply(oilLiters);
+                                discountAmt = receivableAmt.subtract(amt);
+                                //discountAmt = oilLiters.multiply(new BigDecimal(labelRuleDetailList.get(0).getDiscountLitersAmt()));
                                 discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                             }
                             break;
@@ -486,7 +496,12 @@ public class PayOrderController {
                 }
             }
         }
-        amt = receivableAmt.subtract(discountAmt);  //应收金额
+
+        //amt = receivableAmt.subtract(discountAmt);  //应收金额
+        amt = amt.setScale(2, BigDecimal.ROUND_HALF_UP);
+        if(amt.toString().equals("0.00")){
+            amt = new BigDecimal("0.01");
+        }
         amt =amt.signum() == -1 ? new BigDecimal("0.01"): amt;
         //discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? discountPrice : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);  //优惠价格
         payOrderResultInfo.setAmt(amt.toString());
@@ -558,7 +573,7 @@ public class PayOrderController {
         BigDecimal receivableAmt = new BigDecimal(params.get("receivableAmt").toString());   //应收金额
         BigDecimal oilLiters = new BigDecimal("0.00");  //加油升数
         BigDecimal discountAmt = new BigDecimal(0);  //营销方案优惠金额
-        BigDecimal amt = new BigDecimal(0);
+        BigDecimal amt = receivableAmt;
         BigDecimal discountPrice = oilPrice;
         BigDecimal gradeDiscountAmt = new BigDecimal(0);    //等级优惠金额
         BigDecimal gradeDiscountPriceAmt = new BigDecimal(0);    //等级优惠价格
@@ -586,7 +601,9 @@ public class PayOrderController {
                 if(discountTerm.equals("1")){
                     if(oilLiters.compareTo(discountAmt_b) ==1 || oilLiters.compareTo(discountAmt_b) ==0){
                         discountPrice = oilPrice.subtract(gasoilDiscountAmt_b);
-                        discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
+                        amt = discountPrice.multiply(oilLiters);
+                        discountAmt = receivableAmt.subtract(amt);
+                        //discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
                         discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                         dzkDiscountAmt = discountAmt;       //赋值电子卡优惠金额
                         String vipDiscountyPlus = m.get("vipDiscountyPlus").toString();
@@ -595,13 +612,16 @@ public class PayOrderController {
                             //如果叠加等级优惠
                             discountPrice = discountPrice.subtract(gradeDiscountPriceAmt);
                             discountAmt = discountAmt.add(gradeDiscountAmt);
+                            amt = receivableAmt.subtract(discountAmt);
                         }
                         break;
                     }
                 }else if(discountTerm.equals("2")){
                     if(receivableAmt.compareTo(discountAmt_b) ==1 || receivableAmt.compareTo(discountAmt_b) ==0){
                         discountPrice = oilPrice.subtract(gasoilDiscountAmt_b);
-                        discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
+                        amt = discountPrice.multiply(oilLiters);
+                        discountAmt = receivableAmt.subtract(amt);
+                        //discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
                         discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                         dzkDiscountAmt = discountAmt;       //赋值电子卡优惠金额
                         String vipDiscountyPlus = m.get("vipDiscountyPlus").toString();
@@ -610,13 +630,18 @@ public class PayOrderController {
                             //如果叠加等级优惠
                             discountPrice = discountPrice.subtract(gradeDiscountPriceAmt);
                             discountAmt = discountAmt.add(gradeDiscountAmt);
+                            amt = receivableAmt.subtract(discountAmt);
                         }
                         break;
                     }
                 }
             }
         }
-        amt = receivableAmt.subtract(discountAmt);  //应收金额
+        //amt = receivableAmt.subtract(discountAmt);  //应收金额
+        amt = amt.setScale(2, BigDecimal.ROUND_HALF_UP);
+        if(amt.toString().equals("0.00")){
+            amt = new BigDecimal("0.01");
+        }
         amt =amt.signum() == -1 ? new BigDecimal("0.01"): amt;
         //discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? discountPrice : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);  //优惠价格
         payOrderResultInfo.setAmt(amt.toString());
@@ -702,7 +727,7 @@ public class PayOrderController {
         BigDecimal receivableAmt = new BigDecimal(params.get("receivableAmt").toString());   //应收金额
         BigDecimal oilLiters = new BigDecimal("0.00");  //加油升数
         BigDecimal discountAmt = new BigDecimal(0);  //营销方案优惠金额
-        BigDecimal amt = new BigDecimal(0);
+        BigDecimal amt = receivableAmt;
         BigDecimal discountPrice = oilPrice;
         BigDecimal gradeDiscountAmt = new BigDecimal(0);    //等级优惠金额
         BigDecimal gradeDiscountPriceAmt = new BigDecimal("0");
@@ -732,7 +757,9 @@ public class PayOrderController {
                 case "1":   //按加油升数
                     if(oilLiters.compareTo(discountAmt_b) ==1 || oilLiters.compareTo(discountAmt_b) ==0){
                         discountPrice = oilPrice.subtract(gasoilDiscountAmt_b);
-                        discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
+                        amt = discountPrice.multiply(oilLiters);
+                        discountAmt = receivableAmt.subtract(amt);
+//                        discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
                         discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                         //会员活动是否开启:1是;0否'
                         if(customerMarkertPlanList.get(0).containsKey("discountSettingFlag") && customerMarkertPlanList.get(0).get("discountSettingFlag").toString() !="") {
@@ -746,7 +773,9 @@ public class PayOrderController {
                                     boolean b = isActivityDay(discountType, discountDate);
                                     if (b) {
                                         discountPrice = oilPrice.subtract(new BigDecimal(discountActivityAmt));
-                                        discountAmt = oilLiters.multiply(new BigDecimal(discountActivityAmt));
+                                        amt = discountPrice.multiply(oilLiters);
+                                        discountAmt = receivableAmt.subtract(amt);
+                                        //discountAmt = oilLiters.multiply(new BigDecimal(discountActivityAmt));
                                         discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                                     }
                                 }
@@ -757,7 +786,9 @@ public class PayOrderController {
                 case "2":   //按加油金额
                     if(receivableAmt.compareTo(discountAmt_b) ==1 || receivableAmt.compareTo(discountAmt_b) ==0){
                         discountPrice = oilPrice.subtract(gasoilDiscountAmt_b);
-                        discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
+                        amt = discountPrice.multiply(oilLiters);
+                        discountAmt = receivableAmt.subtract(amt);
+                        //discountAmt = oilLiters.multiply(gasoilDiscountAmt_b);
                         discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                         //会员活动是否开启:1是;0否'
                         if(customerMarkertPlanList.get(0).containsKey("discountSettingFlag") && customerMarkertPlanList.get(0).get("discountSettingFlag").toString() !="") {
@@ -771,7 +802,9 @@ public class PayOrderController {
                                     boolean b = isActivityDay(discountType, discountDate);
                                     if (b) {
                                         discountPrice = oilPrice.subtract(new BigDecimal(discountActivityAmt));
-                                        discountAmt = oilLiters.multiply(new BigDecimal(discountActivityAmt));
+                                        amt = discountPrice.multiply(oilLiters);
+                                        discountAmt = receivableAmt.subtract(amt);
+                                        //discountAmt = oilLiters.multiply(new BigDecimal(discountActivityAmt));
                                         discountAmt = discountAmt.setScale(2, BigDecimal.ROUND_HALF_UP);
                                     }
 
@@ -788,9 +821,14 @@ public class PayOrderController {
                 //如果叠加等级优惠
                 discountPrice = discountPrice.subtract(gradeDiscountPriceAmt);
                 discountAmt = discountAmt.add(gradeDiscountAmt);
+                amt = receivableAmt.subtract(discountAmt);
             }
         }
-        amt = receivableAmt.subtract(discountAmt);  //应收金额
+//        amt = receivableAmt.subtract(discountAmt);  //应收金额
+        amt = amt.setScale(2, BigDecimal.ROUND_HALF_UP);
+        if(amt.toString().equals("0.00")){
+            amt = new BigDecimal("0.01");
+        }
         amt =amt.signum() == -1 ? new BigDecimal("0.01"): amt;
         //discountPrice = oilLiters.equals(new BigDecimal("0.00")) ? discountPrice : amt.divide(oilLiters, 2, BigDecimal.ROUND_HALF_UP);  //优惠价格
         payOrderResultInfo.setAmt(amt.toString());
@@ -878,7 +916,7 @@ public class PayOrderController {
         BigDecimal receivableAmt = new BigDecimal(params.get("receivableAmt").toString());   //应收金额
         BigDecimal oilLiters = new BigDecimal("0.00");  //加油升数
         BigDecimal discountAmt = new BigDecimal(0);  //优惠金额
-        BigDecimal amt = new BigDecimal(0);
+        BigDecimal amt = receivableAmt;
         BigDecimal discountPrice = oilPrice;
         BigDecimal gradeDiscountAmt = new BigDecimal(0);    //等级优惠金额
         BigDecimal dzkGradeDiscountAmt = new BigDecimal(0);    //计算电子卡金额时所需等级优惠金额值
@@ -1012,7 +1050,7 @@ public class PayOrderController {
         BigDecimal receivableAmt = new BigDecimal(params.get("receivableAmt").toString());   //应收金额
         BigDecimal oilLiters = new BigDecimal("0.00");  //加油升数
         BigDecimal discountAmt = new BigDecimal(0);  //优惠金额
-        BigDecimal amt = new BigDecimal(0);
+        BigDecimal amt = receivableAmt;
         BigDecimal discountPrice = oilPrice;
         BigDecimal gradeDiscountAmt = new BigDecimal(0);    //等级优惠金额
         BigDecimal dzkGradeDiscountAmt = new BigDecimal(0);    //计算电子卡金额时所需等级优惠金额值
@@ -1153,7 +1191,7 @@ public class PayOrderController {
         BigDecimal oilLiters = new BigDecimal("0.00");  //加油升数
         BigDecimal discountAmt = new BigDecimal(0);  //优惠金额
         BigDecimal dzkDiscountAmt = discountAmt;  //优惠金额
-        BigDecimal amt = new BigDecimal(0);
+        BigDecimal amt = receivableAmt;
         BigDecimal discountPrice = oilPrice;
         BigDecimal gradeDiscountPriceAmt = new BigDecimal("0");  //价格优惠金额
         PayOrderResultInfo payOrderResultInfo = new PayOrderResultInfo();

+ 2 - 0
YijiaRestful/src/main/java/com/platform/yijia/controller/PosMachineController.java

@@ -535,6 +535,7 @@ public class PosMachineController {
                 stationclass.setPayType(payOrder.getPayType());
                 stationclass.setPayDate(payOrder.getPayDate());
                 stationclass.setOilPersonnel(payOrder.getOilPersonnel());
+                stationclass.setOilPersonnelId(payOrder.getOilPersonnelId());
                 stationclass.setOrderType(payOrder.getOrderType());
                 if(payOrder.getPrintCount()!=null){
                     stationclass.setPrintNum(payOrder.getPrintCount());
@@ -645,6 +646,7 @@ public class PosMachineController {
                 stationclass.setPayType(payOrder.getPayType());
                 stationclass.setPayDate(payOrder.getPayDate());
                 stationclass.setOilPersonnel(payOrder.getOilPersonnel());
+                stationclass.setOilPersonnelId(payOrder.getOilPersonnelId());
                 stationclass.setOrderType(payOrder.getOrderType());
                 if(payOrder.getPrintCount()!=null){
                     stationclass.setPrintNum(payOrder.getPrintCount());

+ 2 - 0
YijiaRestful/src/main/java/com/platform/yijia/pojo/PayOrder.java

@@ -29,6 +29,8 @@ public class PayOrder implements Serializable {
     //@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
     private Timestamp payDate;
     private String oilPersonnel;
+    private String oilPersonnelId;
+
     //@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
     private Timestamp createdDate;

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

@@ -67,6 +67,7 @@ public class StationClassStructure {
 
     /** 加油员人名 */
     private String oilPersonnel;
+    private String oilPersonnelId;
 
     /** 订单类型订单类型(1.柴油,2.汽油,积分:3.现金+积分4.现金,5.积分) */
     private String orderType;

+ 9 - 2
YijiaRestful/src/main/resources/mapper/PayOrderMapper.xml

@@ -26,6 +26,7 @@
     <result column="pay_way"                jdbcType="VARCHAR"   property="payWay" />
     <result column="pay_date"               jdbcType="TIMESTAMP" property="payDate" />
     <result column="oil_personnel"          jdbcType="VARCHAR"   property="oilPersonnel" />
+    <result column="oil_personnel_id"       jdbcType="VARCHAR"   property="oilPersonnelId" />
     <result column="created_date"           jdbcType="TIMESTAMP" property="createdDate" />
     <result column="order_type"             jdbcType="CHAR"      property="orderType" />
     <result column="station_name"           jdbcType="CHAR"      property="stationName" />
@@ -121,7 +122,7 @@
   <sql id="Base_Column_List_PayTypeName_Status">
     T1.order_id, T1.order_no, T1.oil_gun, T1.oil_name, T1.oil_pirce, T1.consumer_id, T1.consumer, T1.amt, T1.station_id,
     CASE T1.status WHEN "1" THEN "已支付" ELSE "未支付" END AS status,
-    T1.order_liters, T1.pay_type, T1.pay_way, T1.pay_date, T1.oil_personnel, T1.created_date, T1.order_type, T1.station_name,
+    T1.order_liters, T1.pay_type, T1.pay_way, T1.pay_date, T1.oil_personnel, T1.oil_personnel_id, T1.created_date, T1.order_type, T1.station_name,
     T1.receivable_amt, T1.received_amt, T1.discount_amt, T1.discount_coupon_amt, T1.discount_coupon, T1.wx_amt,
     T1.zfb_amt, T1.pos_amt, T1.xj_amt, T1.didi_app_amt, T1.ty_app_amt, T1.other_amt, T1.dzk_amt, T1.score, T1.member_no, T1.member_amt,
     T1.print_count, T1.car_no, T1.customer_phone, T1.customer_grade, T1.oil_type,
@@ -130,7 +131,7 @@
   </sql>
   <sql id="Base_Column_List">
     order_id, order_no, oil_gun, oil_name, oil_pirce, consumer_id, consumer, amt, station_id, status,
-    order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type, station_name,
+    order_liters, pay_type, pay_way, pay_date, oil_personnel, oil_personnel_id, created_date, order_type, station_name,
     receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt,
     zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt,
     print_count, car_no, customer_phone, customer_grade, oil_type
@@ -644,6 +645,9 @@
       <if test="oilPersonnel != null">
         oil_personnel,
       </if>
+        <if test="oilPersonnelId != null">
+            oil_personnel_id,
+        </if>
       <if test="createdDate != null">
         created_date,
       </if>
@@ -784,6 +788,9 @@
       <if test="oilPersonnel != null">
         #{oilPersonnel,jdbcType=VARCHAR},
       </if>
+        <if test="oilPersonnelId != null">
+            #{oilPersonnelId,jdbcType=VARCHAR},
+        </if>
       <if test="createdDate != null">
         #{createdDate,jdbcType=TIMESTAMP},
       </if>

+ 6 - 1
YijiaRestful/src/main/resources/mapper/StationClassStructureMapper.xml

@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="payWay"    column="pay_way"    />
         <result property="payDate"    column="pay_date"    />
         <result property="oilPersonnel"    column="oil_personnel"    />
+        <result property="oilPersonnelId"    column="oil_personnel_id"    />
         <result property="orderType"    column="order_type"    />
         <result property="printNum"    column="print_num"    />
         <result property="classStructureNo"    column="class_structure_no"    />
@@ -151,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <sql id="selectStationClassStructureVo">
-        select id, order_no, station_id, station_name, oil_gun, oil_name, oil_pirce, oil_type, consumer_id, consumer, amt, order_liters, pay_type, pay_way, pay_date, oil_personnel, order_type, print_num, class_structure_no, class_start_date, class_structure_date, class_structure_man, oils, receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt, car_no, customer_phone, customer_grade from station_class_structure
+        select id, order_no, station_id, station_name, oil_gun, oil_name, oil_pirce, oil_type, consumer_id, consumer, amt, order_liters, pay_type, pay_way, pay_date, oil_personnel, oil_personnel_id, order_type, print_num, class_structure_no, class_start_date, class_structure_date, class_structure_man, oils, receivable_amt, received_amt, discount_amt, discount_coupon_amt, discount_coupon, wx_amt, zfb_amt, pos_amt, xj_amt, didi_app_amt, ty_app_amt, other_amt, dzk_amt, score, member_no, member_amt, car_no, customer_phone, customer_grade from station_class_structure
     </sql>
 
     <select id="selectStationClassStructureList" parameterType="com.platform.yijia.pojo.StationClassStructure" resultMap="StationClassStructureResult">
@@ -172,6 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payWay != null  and payWay != ''"> and pay_way = #{payWay}</if>
             <if test="payDate != null "> and pay_date = #{payDate}</if>
             <if test="oilPersonnel != null  and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
+            <if test="oilPersonnelId != null  and oilPersonnelId != ''"> and oil_personnel_id = #{oilPersonnelId}</if>
             <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
             <if test="printNum != null "> and print_num = #{printNum}</if>
             <if test="classStructureNo != null  and classStructureNo != ''"> and class_structure_no = #{classStructureNo}</if>
@@ -410,6 +412,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payWay != null">pay_way,</if>
             <if test="payDate != null">pay_date,</if>
             <if test="oilPersonnel != null">oil_personnel,</if>
+            <if test="oilPersonnelId != null">oil_personnel_id,</if>
             <if test="orderType != null">order_type,</if>
             <if test="printNum != null">print_num,</if>
             <if test="classStructureNo != null">class_structure_no,</if>
@@ -453,6 +456,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payWay != null">#{payWay},</if>
             <if test="payDate != null">#{payDate},</if>
             <if test="oilPersonnel != null">#{oilPersonnel},</if>
+            <if test="oilPersonnelId != null">#{oilPersonnelId},</if>
             <if test="orderType != null">#{orderType},</if>
             <if test="printNum != null">#{printNum},</if>
             <if test="classStructureNo != null">#{classStructureNo},</if>
@@ -500,6 +504,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payWay != null">pay_way = #{payWay},</if>
             <if test="payDate != null">pay_date = #{payDate},</if>
             <if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
+            <if test="oilPersonnelId != null">oil_personnel_id = #{oilPersonnelId},</if>
             <if test="orderType != null">order_type = #{orderType},</if>
             <if test="printNum != null">print_num = #{printNum},</if>
             <if test="classStructureNo != null">class_structure_no = #{classStructureNo},</if>

+ 6 - 3
YijiaRestful/src/test/java/com/palatform/yijia/test.java

@@ -17,12 +17,15 @@ public class test {
 
     public static void main(String[] args) throws ParseException {
 
-        BigDecimal sellDiscountAmt = new BigDecimal("20");
+        BigDecimal discountPrice = new BigDecimal("5.52");
+        BigDecimal oilLiters = new BigDecimal("35.59");
 
+        BigDecimal amt = discountPrice.multiply(oilLiters);
+        System.out.println(amt);
 
 
-        BigDecimal driverDiscountAmt = sellDiscountAmt.multiply(new BigDecimal("1").subtract(new BigDecimal("97").divide(new BigDecimal("100"))));
-        System.out.println(driverDiscountAmt);
+//        BigDecimal driverDiscountAmt = sellDiscountAmt.multiply(new BigDecimal("1").subtract(new BigDecimal("97").divide(new BigDecimal("100"))));
+//        System.out.println(driverDiscountAmt);
 
 
 //        Date parse = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse("2021-04-24 22:22:22");