Эх сурвалжийг харах

去掉自动拉出通道车牌费用

qzyReal 2 жил өмнө
parent
commit
ba92e4cc2e

+ 1 - 1
app-ui/pages/wx/pay.vue

@@ -175,7 +175,7 @@
 		},
 		created() {},
 		mounted() {
-			this.getChannelCar();
+			//this.getChannelCar();
 			this.getWxConfig();
 
 		},

+ 1 - 1
app-ui/utils/request.js

@@ -28,7 +28,7 @@ function get(url, data) {
 				common.to('/pages/login/login');
 				return ;
 			}
-f			return res.data
+			return res.data
 		}
 	})
 }

+ 0 - 10
sp-admin/sa-view/tb-business/tb-abinet-record.html

@@ -47,16 +47,6 @@
 					<sa-td name="支付状态" prop="payStatus" type="enum" :jv="{0: '未支付', 1:'已支付'}">
 					</sa-td>
 					<sa-td name="支付时间" prop="payTime" width="150"></sa-td>
-					<!-- 	<el-table-column label="操作" fixed="right" width="240px">
-						<template slot-scope="s">
-							<el-button class="c-btn" type="success" icon="el-icon-view"
-								@click="get(s.row)">查看</el-button>
-							<el-button class="c-btn" type="primary" icon="el-icon-edit"
-								@click="update(s.row)">修改</el-button>
-							<el-button class="c-btn" type="danger" icon="el-icon-delete"
-								@click="del(s.row)">删除</el-button>
-						</template>
-					</el-table-column> -->
 				</el-table>
 				<!-- ------------- 分页 ------------- -->
 				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount"

+ 2 - 1
sp-admin/sa-view/tb-charge-record/print-receipt.html

@@ -97,7 +97,7 @@
 								<td style="min-width: 30px;">优惠金额(元)</td>
 								<td>{{form.discountMoney}}</td>
 								<td style="min-width: 30px;">充值金额(元)</td>
-								<td>{{form.preTopupMoney}}</td>
+								<td>{{form.preTopupMoney||form.refundMoney}}</td>
 							</tr>
 							<tr style="height: 60px;font-size:10px;">
 								<td style="min-width: 30px;">实际收款(元)</td>
@@ -138,6 +138,7 @@
 					getData() {
 						sa.ajax('/TbChargeRecord/getPrintReceiptInfo?id='+this.p.id,this.p,function(resp){
 							this.form=resp.data;
+							console.log(this.form);
 						}.bind(this))
 						
 					},

+ 2 - 2
sp-admin/sa-view/tb-invoice-order/tb-invoice-order-add.html

@@ -83,8 +83,8 @@
 						// 开始增加或修改
 						if(this.id <= 0) {	// 添加
 							sa.ajax('/TbInvoiceOrder/add', m, function(res){
-								if(res.msg === 'ok'){
-									sa.alert('增加成功', this.clean);
+								if(res.msg === '操作成功'){
+									sa.alert('识别成功', this.clean);
 								}else if(res.msg === 'fail'){
 									this.idShow = 1;
 									if(this.m.transactionId === ''){

+ 40 - 41
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -167,7 +167,14 @@ public class OpenService {
 
     final TimedCache<String, String> IMAGE_CACHE = CacheUtil.newTimedCache(30 * 60 * 1000);
 
-
+    /**
+     * 离场处理逻辑
+     *
+     * @param carNo
+     * @param channel
+     * @param image
+     * @return
+     */
     private ResultJson handlerOut(String carNo, String channel, String image) {
         carNo = carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(carNo);
@@ -192,6 +199,19 @@ public class OpenService {
             //4蓝色车辆
             if (tbBusinessCar.getColor().contains(freeColor)) {
                 log.error("请求返回【蓝牌未备案车辆,放行】:{},{}", carNo, ResultJson.success());
+                List<TbCarWeight> carWeights = tbCarWeightService.findByBusinessCarId(tbBusinessCar.getId());
+                carWeights = carWeights.stream().filter(tbCarWeight -> tbCarWeight.getPayStatus() == 0).collect(Collectors.toList());
+                BigDecimal weightMoney = BigDecimal.ZERO;
+                if (!carWeights.isEmpty()) {
+                    for (TbCarWeight carWeight : carWeights) {
+                        weightMoney = carWeight.getWeightPrice().add(weightMoney);
+                    }
+                }
+                double wMoney = weightMoney.doubleValue();
+                if (wMoney > 0) {
+                    log.info("请求返回【蓝牌车过磅费】,{},{}", carNo, wMoney);
+                    return ResultJson.error("过磅费" + wMoney);
+                }
                 freeOut(tbBusinessCar, now, channel, image);
                 return ResultJson.success();
             }
@@ -228,45 +248,33 @@ public class OpenService {
             //无业务车辆===>计算停车费
             //如果已经支付过,则从支付时间算起,重新计算停车费
             Date inTime = tbBusinessCar.getRealInTime();
-            if (CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType().equals(tbBusinessCar.getPayType())&&tbBusinessCar.getPayTime()!=null) {
+            if (CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType().equals(tbBusinessCar.getPayType()) && tbBusinessCar.getPayTime() != null) {
                 inTime = tbBusinessCar.getPayTime();
             }
             IOrderPriceRes res = tbBusinessService.getPartMoney(inTime, now, carNo, tbBusinessCar.getColor());
             double dif = res.getTotalOrderPrice().subtract(tbBusinessCar.getMoney()).doubleValue();
-            if (dif > 0) {
-                String desc = "请缴停车费" + dif + "元";
-                RedisUtil.setByMINUTES(channel, carNo, 5);
-                log.error("请求返回:请缴停车费,过磅费:{},{},{}元", carNo, dif, wMoney);
-                if (wMoney > 0) {
-                    desc += "过磅费:" + wMoney + "元";
-                }
-                //是否可以预充值缴费 true扣款成功 false否
+            double total = NumberUtil.add(dif, wMoney);
+            if (total > 0) {
+                String desc = "请缴费用" + total + "元";
+                log.error("请求返回:{},{}", carNo, desc);
                 return ResultJson.error(desc);
-            } else {
-                if (wMoney > 0) {
-                    log.error("请求返回:过磅费:{},{},{}元", carNo, dif, wMoney);
-                    String desc = "过磅费:" + wMoney + "元";
-                    RedisUtil.setByMINUTES(channel, carNo, 5);
-                    return ResultJson.error(desc);
-                }
-                //无需交停车费,又没有支付的--->设置成免费车辆
-                if (tbBusinessCar.getPayTime() == null) {
-                    tbBusinessCar.setPayType(CarEnum.PayTypeEnum.FEE_TYPE.getType()).setPay(1);
-                }
-                freeOut(tbBusinessCar, now, channel, image);
-                return ResultJson.success();
             }
+            //无需交停车费,又没有支付的--->设置成免费车辆
+            if (tbBusinessCar.getPayTime() == null) {
+                tbBusinessCar.setPayType(CarEnum.PayTypeEnum.FEE_TYPE.getType()).setPay(1);
+            }
+            freeOut(tbBusinessCar, now, channel, image);
+            return ResultJson.success();
         } else {
             //有业务的车--->都要交停车费====>除了大头车,拦车
             //该车所有的业务都是到达卡口才进行扣费才会进入自动扣费
             Date inTime = tbBusinessCar.getRealInTime();
-            if (CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType().equals(tbBusinessCar.getPayType())&&tbBusinessCar.getPayTime()!=null) {
+            if (CarEnum.PayTypeEnum.HAS_PAY_TYPE.getType().equals(tbBusinessCar.getPayType()) && tbBusinessCar.getPayTime() != null) {
                 inTime = tbBusinessCar.getPayTime();
             }
             partMoneyRes = tbBusinessService.getPartMoney(inTime, now, carNo, tbBusinessCar.getColor());
             double dif = partMoneyRes.getTotalOrderPrice().doubleValue();
             if (dif > 0) {
-                RedisUtil.setByMINUTES(channel, carNo, 5);
                 log.error("停车费:{},{}元", carNo, dif);
             } else {
                 if (tbBusinessCar.getPayTime() == null) {
@@ -323,17 +331,7 @@ public class OpenService {
             total = total.add(weightMoney);
         }
         if (total.doubleValue() > 0) {
-            String desc = "请缴";
-            if (businessMoney.doubleValue() > 0) {
-                desc += "业务费" + businessMoney.toString() + "元";
-            }
-            if (weightMoney.doubleValue() > 0) {
-                desc += "过磅费" + weightMoney.toString() + "元 ";
-            }
-            if (carMoney.doubleValue() > 0) {
-                desc += " 停车费" + carMoney.toString() + "元";
-            }
-            RedisUtil.setByMINUTES(channel, carNo, 5);
+            String desc = "请缴"+total+"费用";
             boolean flag = automaticPay.payBusinessAndPartMoney(businessList, tbBusinessCar, partMoneyRes, businessRes, carWeights);
             if (flag) {
                 log.error("预存款扣款成功,返回:{},{}", carNo, desc);
@@ -417,7 +415,7 @@ public class OpenService {
         String carNo = checkCarNumberBO.getCarNumber();
         String channel = checkCarNumberBO.getChannelName();
         TbChannelConfig tbChannelConfig = tbChannelConfigService.findByName(channel);
-        if (tbChannelConfig==null){
+        if (tbChannelConfig == null) {
             StaticLog.error("通道未配置,{}", channel);
             return ResultJson.error("通道未配置");
         }
@@ -442,7 +440,7 @@ public class OpenService {
             log.error("未找到有效入场记录:{},{}", channel, carNo);
             return ResultJson.error("未找到有效入场记录");
         }
-        REQ_CACHE.put(carNo, 1);
+
         Date now = new Date();
         double weighbridge = NumberUtil.div(Double.valueOf(weight).doubleValue(), 1000, 2);
         tbBusinessCar.setNetWeight(weighbridge + "");
@@ -462,10 +460,11 @@ public class OpenService {
         tbCarWeightService.save(carWeight);
         taskService.addTask(new CoverWeightBase64ToImageTask("=======" + carWeight.getId() + "", 2000, carWeight.getId(), WEIGHT_IMAGE_CACHE.get(carNo)));
         WEIGHT_CACHE.remove(carNo);
-        if (tbChannelConfig.getHandlerUp()==1){
+        REQ_CACHE.put(carNo, 1);
+        if (tbChannelConfig.getHandlerUp() == 1) {
             return ResultJson.success(tbBusinessCar.getNetWeight());
-        }else {
-            return ResultJson.error("过磅完成"+tbBusinessCar.getNetWeight());
+        } else {
+            return ResultJson.error("过磅完成" + tbBusinessCar.getNetWeight());
         }
 
     }

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemMapper.xml

@@ -80,7 +80,7 @@
         </choose>
     </select>
     <select id="getCabinetRecord" resultType="com.pj.project.tb_business_item.TbBusinessItem">
-        select a.* ,b.goods_name,b.card_no,b.customer_name
+        select a.* ,b.goods_name,concat(b.card_no,b.china_car_no) as cardNo,b.customer_name
         from tb_business_item a,tb_business b where a.business_id=b.id
         and a.cabinet_type !=-1
         <if test="cabinetNo !=null and cabinetNo !=''">

+ 6 - 8
sp-server/src/main/resources/application-dev.yml

@@ -6,9 +6,9 @@ spring:
     # 数据源配置
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
-        url: jdbc:mysql://47.101.143.145:3306/pco?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://127.0.0.1:3306/pco_system?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
         username: root
-        password: 1qaz@WSX
+        password: 123456
         # 是否打开sql监控台  (生产环境请务必关闭此选项)
         druid:
             stat-view-servlet:
@@ -41,12 +41,10 @@ spring:
                 max-idle: 10
                 # 连接池中的最小空闲连接
                 min-idle: 0
-# mybatis-plus配置
-mybatis-plus:
-    # 一些配置
-    configuration:
-        # 控制打印sql
-        log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    # mybatis-plus配置
+    mybatis-plus:
+        configuration:
+            log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 
     # 项目自定义配置
     myconfig: