qzyReal 2 years ago
parent
commit
c5e4baacba

+ 28 - 38
sp-admin/sa-view/car/tb-business-car-list.html

@@ -43,11 +43,11 @@
 							<label v-else>-</label>
 						</template>
 					</el-table-column>
-					<sa-td name="联系人" prop="driverName"></sa-td>
-					<sa-td name="联系号码" prop="driverPhone"></sa-td>
-					<sa-td name="入场时间" prop="realInTime" width=180></sa-td>
-					<sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
-					<el-table-column label="操作" width="200px">
+					<sa-td name="入场时间" prop="realInTime" width=160></sa-td>
+					<sa-td name="入场通道" prop="inChannel" width=180></sa-td>
+					<sa-td name="离场时间" prop="realOutTime" width=160></sa-td>
+					<sa-td name="离场通道" prop="outChannel" width=180></sa-td>
+					<el-table-column label="操作" width="120px" fixed="right">
 						<template slot-scope="s">
 							<el-button v-if="sa.isAuth('tb-business-car-change')&&s.row.realInTime==null" class="c-btn"
 								type="primary" @click="inFn(s.row)">确认入场
@@ -56,14 +56,6 @@
 								v-if="sa.isAuth('tb-business-car-change')&&s.row.realInTime!=null&&s.row.realOutTime==null"
 								class="c-btn" type="primary" @click="outFn(s.row)">确认离场
 							</el-button>
-							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
-							</el-button>
-							<el-button v-if="confirm==0&&sa.isAuth('tb-business-edit')" class="c-btn" type="primary"
-								icon="el-icon-edit" @click="update(s.row)">修改
-							</el-button>
-							<el-button v-if="confirm==0&&sa.isAuth('tb-business-edit')" class="c-btn" type="danger"
-								icon="el-icon-delete" @click="del(s.row)">删除
-							</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -105,23 +97,23 @@
 			</el-dialog>
 			<el-dialog title="证明" :visible.sync="report.visible" width="500px">
 				<div>
-					<el-form >
-					<el-row>
-						<el-col span="12">
-							<sa-info name="核酸报告" :value="report.business.nucleicReport" type="img"></sa-info>
-						</el-col>
-						<el-col span="12">
-							<sa-info name="出仓证明" :value="report.business.outReport" type="img"></sa-info>
-						</el-col>
-					</el-row>
-					<el-row style="margin-top: 20px;">
-						<el-col span="12">
-							<sa-info name="消杀证明" :value="report.business.disinfectReport" type="img"></sa-info>
-						</el-col>
-						<el-col span="12">
-							<sa-info name="检验检疫证" :value="report.business.checkReport" type="img"></sa-info>
-						</el-col>
-					</el-row>
+					<el-form>
+						<el-row>
+							<el-col span="12">
+								<sa-info name="核酸报告" :value="report.business.nucleicReport" type="img"></sa-info>
+							</el-col>
+							<el-col span="12">
+								<sa-info name="出仓证明" :value="report.business.outReport" type="img"></sa-info>
+							</el-col>
+						</el-row>
+						<el-row style="margin-top: 20px;">
+							<el-col span="12">
+								<sa-info name="消杀证明" :value="report.business.disinfectReport" type="img"></sa-info>
+							</el-col>
+							<el-col span="12">
+								<sa-info name="检验检疫证" :value="report.business.checkReport" type="img"></sa-info>
+							</el-col>
+						</el-row>
 					</el-form>
 				</div>
 			</el-dialog>
@@ -175,12 +167,12 @@
 				methods: {
 					checkFn(data) {
 						sa.ajax('/TbBusiness/getById?id=' + data.businessId, function(resp) {
-							let business=resp.data;
-							if(!business.outReport){
+							let business = resp.data;
+							if (!business.outReport) {
 								//sa.error('未上传')
 							}
-							this.report.visible=true;
-							this.report.business=business;
+							this.report.visible = true;
+							this.report.business = business;
 						}.bind(this))
 					},
 					inFn(data) {
@@ -198,8 +190,7 @@
 							sa.error('请填写入场通道')
 							return;
 						}
-						this.out.form.timeUpdate=sa.forDatetime(new Date());
-						sa.ajax('/TbBusinessCar/update', this.rc.form, function(res) {
+						sa.ajax('/TbBusinessCar/inCar', this.rc.form, function(res) {
 							sa.alert('操作成功');
 							this.rc.visible = false;
 							this.f5();
@@ -220,8 +211,7 @@
 							sa.error('请填写离场通道')
 							return;
 						}
-						this.out.form.timeUpdate=sa.forDatetime(new Date());
-						sa.ajax('/TbBusinessCar/update', this.out.form, function(res) {
+						sa.ajax('/TbBusinessCar/outCar', this.out.form, function(res) {
 							sa.alert('操作成功');
 							this.out.visible = false;
 							this.f5();

+ 7 - 0
sp-admin/sa-view/tb-business/tb-car-disincle-list.html

@@ -75,6 +75,9 @@
 								v-if="currentCustomerId=='1'||(s.row.adminConfirmInput==0&&sa.isAuth('tb-flex-business-edit'))"
 								@click="update(s.row)">
 								修改</el-button>
+								<el-button v-if="sa.isAuth('tb-flex-business-edit')" class="c-btn" type="primary"
+									@click="carFn(s.row)">车辆管理
+								</el-button>
 							<el-button class="c-btn" type="primary" v-if="(currentCustomerId=='1'||(sa.isAuth('tb-flex-business-pay')))
 								&&s.row.payStatus!=='3'" @click="handlerPay(s.row)">
 								线下收费</el-button>
@@ -163,6 +166,10 @@
 								'&businessCarId=' + data.businessCarId + '&carNo=' + str+'&businessCarIds='+businessCarIds, '90%', "90%");
 						}.bind(this))
 					},
+					carFn(data) {
+						sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
+							.payStatus + '&confirm=' + data.adminConfirmInput, '1050px', '75%');
+					},
 					handlerPay(data) {
 						sa.showIframe('线下收费', 'tb-car-disincle-pay.html?id=' + data.id, '1050px', '95%');
 					},

+ 82 - 37
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -29,6 +29,8 @@ import com.pj.project.tb_car.TbCar;
 import com.pj.project.tb_car.TbCarService;
 import com.pj.project.tb_car_no_color.TbCarNoColor;
 import com.pj.project.tb_car_no_color.TbCarNoColorService;
+import com.pj.project.tb_goods.TbGoods;
+import com.pj.project.tb_goods.TbGoodsService;
 import com.pj.project4sp.uploadfile.UploadConfig;
 import com.pj.utils.cache.RedisUtil;
 import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
@@ -75,6 +77,9 @@ public class OpenService {
     @Resource
     TbCarNoColorService tbCarNoColorService;
 
+    @Resource
+    private TbGoodsService tbGoodsService;
+
 
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
@@ -153,28 +158,19 @@ public class OpenService {
             IMAGE_CACHE.put(carNo, image);
         }
         Date now = new Date();
-        Integer businessType = tbBusinessCar.getBusinessType();
         //判断是否蓝色车牌===免停车费
         if (StrUtil.isNotEmpty(tbBusinessCar.getColor())) {
             List<TbCarNoColor> freeList = tbCarNoColorService.getFreeColor();
             List<String> colorList = freeList.stream().map(f -> f.getCarNoColor().substring(0, 1)).collect(Collectors.toList());
             String color = tbBusinessCar.getColor().substring(0, 1);
             if (colorList.contains(color)) {
-                tbBusinessCar.setRealOutTime(now).setTimeUpdate(now).setOutChannel(channel);
-                tbBusinessCarService.updateById(tbBusinessCar);
-                CoverBase64ToUrl(image, tbBusinessCar.getId(), carNo, 2);
-                RedisUtil.del(channel);
-                log.error("请求返回【放行】:{}", carNo);
+                freeOut(tbBusinessCar,now,channel,image);
                 return ResultJson.success();
             }
         }
         //是否行政车辆=====
         if (checkFree(carNo, 2, now)) {
-            tbBusinessCar.setRealOutTime(now).setTimeUpdate(now).setOutChannel(channel);
-            tbBusinessCarService.updateById(tbBusinessCar);
-            CoverBase64ToUrl(image, tbBusinessCar.getId(), carNo, 2);
-            RedisUtil.del(channel);
-            log.error("请求返回【放行】:{}", carNo);
+            freeOut(tbBusinessCar,now,channel,image);
             return ResultJson.success();
         }
         if (tbBusinessCar.getIsLock() == 1) {
@@ -182,34 +178,65 @@ public class OpenService {
             log.error("请求返回:车辆已锁定:{}", carNo);
             return ResultJson.error("车辆已锁定");
         }
-        String carNoStr = carNo.substring(0, 1);
-        Date inTime = tbBusinessCar.getRealInTime();
-        if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getRealOutTime() == null && tbBusinessCar.getPayTime() != null) {
-            inTime = tbBusinessCar.getPayTime();
-        }
-        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now);
-        //越南车牌,整车业务免停车费
-        if (!CAR_LIST.contains(carNoStr) && TbBusiness.BusinessType.HOLD_CAR.getCode().equals(businessType)) {
-            price = new BigDecimal("0");
-        }
-        double dif = price.doubleValue();
-        if (dif > 0) {
-            RedisUtil.setByMINUTES(channel, carNo, 1);
-            log.error("请求返回:请缴停车费:{},{}元", carNo, dif);
-            return ResultJson.error("请缴停车费" + dif + "元");
-        }
-        //无业务费用车辆===
-        if (TbBusiness.BusinessType.NO_BUSINESS.getCode().equals(businessType)) {
-            tbBusinessCar.setRealOutTime(now).setOutChannel(channel).setTimeUpdate(now);
-            tbBusinessCarService.updateById(tbBusinessCar);
-            CoverBase64ToUrl(image, tbBusinessCar.getId(), carNo, 2);
-            RedisUtil.del(channel);
-            log.error("请求返回【放行】:{}", carNo);
-            return ResultJson.success();
+        String businessCarId = tbBusinessCar.getId();
+        List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(businessCarId);
+        if (businessList.isEmpty()) {//无业务车辆===>计算停车费
+            //如果已经支付过,则从支付时间算起,重新计算停车费
+            double dif=caulatePrice(tbBusinessCar,now);
+            if (dif > 0) {
+                RedisUtil.setByMINUTES(channel, carNo, 1);
+                log.error("请求返回:请缴停车费:{},{}元", carNo, dif);
+                return ResultJson.error("请缴停车费" + dif + "元");
+            }else {
+                freeOut(tbBusinessCar,now,channel,image);
+                return ResultJson.success();
+            }
+        } else {
+            //有业务的车
+            //1、分越南车和中国车
+            String carNoPrefix = StrUtil.sub(carNo, 0, 1);
+            //中国车是否收费
+            if (CAR_LIST.contains(carNoPrefix)){
+                boolean chinaCarPay = businessList.stream().anyMatch(tbBusiness -> {
+                    TbGoods tbGoods = tbGoodsService.getById(tbBusiness.getGoodsId());
+                    return tbGoods.getChinaCarPay() == 1;
+                });
+                if (!chinaCarPay){
+                    freeOut(tbBusinessCar,now,channel,image);
+                    return ResultJson.success();
+                }else {
+                    double dif=caulatePrice(tbBusinessCar,now);
+                    if (dif > 0) {
+                        RedisUtil.setByMINUTES(channel, carNo, 1);
+                        log.error("请求返回:请缴停车费:{},{}元", carNo, dif);
+                        return ResultJson.error("请缴停车费" + dif + "元");
+                    }else {
+                        freeOut(tbBusinessCar,now,channel,image);
+                        return ResultJson.success();
+                    }
+                }
+            }else {//越南车
+                boolean vietnamCarPay = businessList.stream().anyMatch(tbBusiness -> {
+                    TbGoods tbGoods = tbGoodsService.getById(tbBusiness.getGoodsId());
+                    return tbGoods.getVietnamCarPay() == 1;
+                });
+                if (!vietnamCarPay){
+                    freeOut(tbBusinessCar,now,channel,image);
+                    return ResultJson.success();
+                }else {
+                    double dif=caulatePrice(tbBusinessCar,now);
+                    if (dif > 0) {
+                        RedisUtil.setByMINUTES(channel, carNo, 1);
+                        log.error("请求返回:请缴停车费:{},{}元", carNo, dif);
+                        return ResultJson.error("请缴停车费" + dif + "元");
+                    }else {
+                        freeOut(tbBusinessCar,now,channel,image);
+                        return ResultJson.success();
+                    }
+                }
+            }
         }
-
         //============业务费计算是否交完
-        String businessId = tbBusinessCar.getBusinessId();
         List<TbBusinessItem> items;
         if (TbBusiness.BusinessType.HOLD_CAR.getCode().equals(businessType)) {
             items = tbBusinessItemService.findByBusinessId(businessId);
@@ -230,6 +257,24 @@ public class OpenService {
         return ResultJson.success();
     }
 
+
+    private double caulatePrice(TbBusinessCar tbBusinessCar,Date now){
+        Date inTime=tbBusinessCar.getRealInTime();
+        if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getRealOutTime() == null && tbBusinessCar.getPayTime() != null) {
+            inTime = tbBusinessCar.getPayTime();
+        }
+        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now);
+        return price.doubleValue();
+    }
+    private void freeOut(TbBusinessCar tbBusinessCar,Date now,String outChannel,String base64Image){
+        tbBusinessCar.setRealOutTime(now).setTimeUpdate(now).setOutChannel(outChannel);
+        tbBusinessCarService.updateById(tbBusinessCar);
+        String carNo=tbBusinessCar.getCarNo();
+        CoverBase64ToUrl(base64Image, tbBusinessCar.getId(), carNo, 2);
+        RedisUtil.del(outChannel);
+        log.error("请求返回【放行】:{}", carNo);
+    }
+
     private boolean checkFree(String carNo, int inOrOut, Date now) {
         TbCar tbCar = tbCarService.findByCardNo(carNo);
         if (tbCar != null) {

+ 3 - 2
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -259,8 +259,9 @@ public class WxService {
                     carList.forEach(tbBusinessCar -> {
                         String carNo = tbBusinessCar.getCarNo();
                         String carNoStr = StrUtil.sub(carNo, 0, 1);
-                        if (CAR_LIST.contains(carNoStr)&&tbGoods.getChinaCarPay()==1
-                                ||!CAR_LIST.contains(carNoStr)&&tbGoods.getVietnamCarPay()==1){
+                        //
+                        if (CAR_LIST.contains(carNoStr)&&tbGoods.getChinaCarPay()==0
+                                ||!CAR_LIST.contains(carNoStr)&&tbGoods.getVietnamCarPay()==0){
                             tbBusinessCar.setPay(1).setPayTime(now);
                             tbBusinessCarService.updateById(tbBusinessCar);
                         }

+ 9 - 9
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -220,9 +220,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             tbBusinessCar.setIsLock(0);
             String carNo = tbBusinessCar.getCarNo().toUpperCase();
             TbBusinessCar db = tbBusinessCarService.findByBusinessIdAndCarNo(t.getId(), carNo);
-            if (db != null && TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(db.getBusinessType())) {
-                throw new BusinessException("该车存在其他业务");
-            }
             if (db != null) {
                 tbBusinessCar.setId(db.getId()).setIsLock(db.getIsLock());
             }
@@ -231,7 +228,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 tbBusinessCar.setId(car.getId()).setRealInTime(car.getRealInTime()).setIsLock(car.getIsLock());
             }
             TbCar tbCar = tbCarService.findByCardNo(carNo);
-            tbBusinessCar.setBusinessId(t.getId()).setBusinessType(TbBusiness.BusinessType.HOLD_CAR.getCode());
+            tbBusinessCar.setBusinessId(t.getId());
             tbBusinessCar.setCarNo(carNo).setCarCompany(tbCar != null ? tbCar.getCustomerName() : "临时");
             tbBusinessCar.setBusinessId(t.getId()).setCustomerId(t.getCustomerId());
             if (StrUtil.isEmpty(tbBusinessCar.getNo())) {
@@ -252,7 +249,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         if (StrUtil.isEmpty(yueCar.getNo())) {
             yueCar.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
         }
-        yueCar.setBusinessType(TbBusiness.BusinessType.HOLD_CAR.getCode());
         carList.add(yueCar);
         tbBusinessCarService.saveOrUpdateBatch(carList);
         t.setItemPrice(price)
@@ -754,13 +750,17 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             for (TbBusinessItem item : itemList) {
                 checkOtherBusiness(item.getItemTypeId(), otherBusinessBO.getOperateTime(), tbBusiness.getId(), carNo);
             }
-            if ((CAR_LIST.contains(carPrefix) && chinaCarPay == 1) || (!CAR_LIST.contains(carPrefix) && vietnamCarPay == 1)) {
+            if ((CAR_LIST.contains(carPrefix) && chinaCarPay == 0) || (!CAR_LIST.contains(carPrefix) && vietnamCarPay == 0)) {
                 db.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
             }
-            db.setBusinessType(TbBusiness.BusinessType.CAR_DISINCLE.getCode());
             TbCar tbCar = tbCarService.findByCardNo(carNo);
-            db.setCarNo(carNo).setBusinessType(TbBusiness.BusinessType.CAR_DISINCLE.getCode())
-                    .setIsLock(0).setCarCompany(tbCar != null ? tbCar.getCustomerName() : "临时");
+            if (tbCar!=null){
+                db.setCarCompany(tbCar.getCustomerName());
+                if (!TbCar.CarTypeEnum.BUSINESS_CAR.getType().equals(tbCar.getCarType())){
+                    db.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
+                }
+            }
+            db.setCarNo(carNo).setIsLock(0);
             db.setCarSize(car.getCarSize())
                     .setTimeUpdate(now).setCarType(car.getCarType())
                     .setNetWeight(car.getNetWeight())

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCar.java

@@ -124,7 +124,7 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 
     private Date timeUpdate;
 
-    private Integer businessType=0;
+    //private Integer businessType=0;
     private String carType;
     private String netWeight;
     private Date createTime;

+ 20 - 1
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarController.java

@@ -2,6 +2,7 @@ package com.pj.project.tb_business_car;
 
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
+import java.util.Date;
 import java.util.List;
 
 import cn.hutool.core.util.StrUtil;
@@ -115,7 +116,7 @@ public class TbBusinessCarController {
         }
         String carNo=so.getString("carNo");
         if (StrUtil.isNotEmpty(carNo)){
-            so.put("carNoList",carNo.split("、"));
+            so.put("carNoList",StrUtil.splitTrim(carNo,"、"));
         }
         List<TbBusinessCar> list = tbBusinessCarService.getList(so.startPage());
         return AjaxJson.getPageData(so.getDataCount(), list);
@@ -162,6 +163,24 @@ public class TbBusinessCarController {
         String carNo = soMap.getString("carNo");
         return AjaxJson.getSuccessData(tbBusinessCarService.findNotOutCarLike(carNo));
     }
+    @RequestMapping("outCar")
+    public AjaxJson outCar() {
+        SoMap soMap = SoMap.getRequestSoMap();
+        String id = soMap.getString("id");
+        String outChannel = soMap.getString("outChannel");
+        Date realOutTime = soMap.getDateTime("realOutTime");
+        tbBusinessCarService.outCar(id,outChannel,realOutTime);
+        return AjaxJson.getSuccess();
+    }
+    @RequestMapping("inCar")
+    public AjaxJson inCar() {
+        SoMap soMap = SoMap.getRequestSoMap();
+        String id = soMap.getString("id");
+        String inChannel = soMap.getString("inChannel");
+        Date realInTime = soMap.getDateTime("realInTime");
+        tbBusinessCarService.inCar(id,inChannel,realInTime);
+        return AjaxJson.getSuccess();
+    }
 
 
 }

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.xml

@@ -36,7 +36,7 @@
             <if test=' this.has("carNo") and carNo.indexOf("、")==-1'>
                 and car_no like concat('%',#{carNo},'%')
             </if>
-            <if test=' this.has("carNoList") and carNoList.length>0'>
+            <if test=' this.has("carNoList") and carNoList.size>0'>
                 and car_no in
                 <foreach collection="carNoList" open="(" close=")" item="carNo" separator=",">
                     #{carNo}

+ 15 - 14
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -86,19 +86,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
      */
     List<TbBusinessCar> getList(SoMap so) {
         List<TbBusinessCar> list = tbBusinessCarMapper.getList(so);
-        List<TbCarNoColor> carNoColors = tbCarNoColorService.getFreeColor();
-        String colorStr = carNoColors.stream().map(TbCarNoColor::getCarNoColor).collect(Collectors.joining(""));
         for (TbBusinessCar tbBusinessCar : list) {
-            String color = tbBusinessCar.getColor();
-            TbCar tbCar = tbCarService.findByCardNo(tbBusinessCar.getCarNo());
-            if (tbCar != null && !TbCar.CarTypeEnum.BUSINESS_CAR.getType().equals(tbCar.getCarType())) {
-                tbBusinessCar.setPayType("免费");
-                continue;
-            }
-            if (StrUtil.isNotEmpty(color) && colorStr.contains(color.substring(0, 1))) {
-                tbBusinessCar.setPayType("免费");
-                continue;
-            }
             Date inTime = tbBusinessCar.getRealInTime();
             Date outTime = tbBusinessCar.getRealOutTime();
             if (inTime != null && outTime != null) {
@@ -106,8 +94,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
                 LocalDateTime outDayTime = outTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
                 long minutes = ChronoUnit.MINUTES.between(inDayTime, outDayTime);
                 PartConfig partConfig = SpringUtil.getBean(PartConfig.class);
-                if (minutes < partConfig.getFreeMinutes()
-                        || (!CAR_LIST.contains(tbBusinessCar.getCarNo().substring(0, 1)) && TbBusiness.BusinessType.HOLD_CAR.getCode().equals(tbBusinessCar.getBusinessType()))) {
+                if (minutes < partConfig.getFreeMinutes()) {
                     tbBusinessCar.setPayType("免费");
                     continue;
                 }
@@ -416,4 +403,18 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     public List<TbBusinessCar> searchForPayCar(String carNo) {
         return tbBusinessCarMapper.searchForPayCar(carNo);
     }
+
+    public void outCar(String id, String outChannel, Date realOutTime) {
+        Date now=new Date();
+        TbBusinessCar db=  this.getById(id);
+        db.setOutChannel(outChannel).setRealOutTime(realOutTime).setTimeUpdate(now);
+        this.updateById(db);
+    }
+
+    public void inCar(String id, String inChannel, Date realInTime) {
+        TbBusinessCar db=  this.getById(id);
+        Date now=new Date();
+        db.setInChannel(inChannel).setRealInTime(realInTime).setTimeUpdate(now);
+        this.updateById(db);
+    }
 }

+ 2 - 2
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: