jk-GitHub-coder 4 年 前
コミット
f7f6add233

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

@@ -470,14 +470,21 @@ public class ElectronicMembershipCardController {
                         calculateIntegral.setOpenId(minaOpenid);   //小程序openId
                         //计算积分且推送积分
                         integral = calculateIntegralAndPushIntegral(calculateIntegral, customerManage);
+                        payOrder.setIntegral(String.valueOf(integral));
                     }
                     resultData = ResultData.success(CodeMsg.SUCCESS);
-                    //打印小票
-                    this.printReceipt(payOrder);
                     //pos机打印小票
-                    payOrder.setIntegral(String.valueOf(integral));
                     payOrder.setTransactionId(ordNo);
-                    this.posPrintReceipt(payOrder);
+                    if(stationPayManageInfo.getPrintDeviceType().equals("1")){
+                        //打印小票
+                        this.printReceipt(payOrder);
+                    }else {
+                        //pos机打印小票
+                        this.posPrintReceipt(payOrder);
+                    }
+                    //打印小票
+//                    this.printReceipt(payOrder);
+//                    this.posPrintReceipt(payOrder);
                 }else {
                     resultData=ResultData.error(CodeMsg.BALANCE_NOT_EENOUGH);
                 }

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

@@ -555,7 +555,7 @@ public class PayController {
                     int count = payOrderService.getUpdatePayOrder(payOrder);
                     if(count == 1){
                         req.put("code","success");
-                        req.put("msg","修改订单状态成功");
+                        req.put("msg","成功");
                         logger.info(req.toString());
 
                         //将用户消费的信息插入顾客表: 以手机号 油品名称 油站id为条件插入且存入 加油升数、实收金额、油站名称  根据订单号查询用户手机号
@@ -590,13 +590,15 @@ public class PayController {
                                 calculateIntegral.setReceivableAmt(new BigDecimal(infoMap.get("receivableAmt").toString()));
                                 //计算积分并推送
                                 integral = calculateIntegralAndPushIntegral(calculateIntegral, customerManage);
+                                payOrder.setIntegral(String.valueOf(integral));
+                            }
+                            if(stationPayManageInfo.getPrintDeviceType().equals("1")){
+                                //打印小票
+                                this.printReceipt(infoMap);
+                            }else {
+                                //pos机打印小票
+                                this.posPrintReceipt(payOrder);
                             }
-                            //打印小票
-                            //this.printReceipt(infoMap);
-
-                            //pos机打印小票
-                            payOrder.setIntegral(String.valueOf(integral));
-                            this.posPrintReceipt(payOrder);
                         }else{
                             logger.info("该用户无手机号!");
                         }

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

@@ -22,6 +22,7 @@ public class StationPayManage {
     private String notice;          //油站公告信息
     private String integralFlag;    //是否开启积分
     private String integralPrintFlag;       //是否打印小票
+    private String printDeviceType;         //打印机设备选择
 
 
 }

+ 2 - 1
YijiaRestful/src/main/resources/mapper/StationPayManageMapper.xml

@@ -20,13 +20,14 @@
     <result column="notice"                           jdbcType="VARCHAR"       property="notice" />
     <result column="integral_flag"                    jdbcType="VARCHAR"       property="integralFlag" />
     <result column="integral_print_flag"              jdbcType="VARCHAR"       property="integralPrintFlag" />
+    <result column="print_device_type"                jdbcType="VARCHAR"       property="printDeviceType" />
   </resultMap>
 
 
   <sql id="Base_Column_List">
     pay_id, pay_mode, station_id, station_name, image_photos_flag,activity_pic, card_enabled_flag,
     preferential_way_share_flag, other_preferential_way, pay_print_num, pay_callback_page,
-    ws_print_flag, print_setting, discount_setting, is_no_oil, notice, integral_flag, integral_print_flag
+    ws_print_flag, print_setting, discount_setting, is_no_oil, notice, integral_flag, integral_print_flag, print_device_type
   </sql>
     <!--查询油站配置信息-->
   <select id="selectStationPayManage" parameterType="com.platform.yijia.pojo.StationPayManage" resultMap="BaseResultMap">