qzyReal 2 vuotta sitten
vanhempi
commit
088053899c

+ 15 - 4
sp-admin/sa-view/tb-business/tb-car-disincle-add.html

@@ -43,7 +43,7 @@
 							</div>
 							<el-row>
 								<el-col :span='12'>
-									<div class="c-item">
+									<div class="c-item" v-if="currentCustomerId=='1'">
 										<label class="c-label"><span style="color: red;">*</span>客户:</label>
 										<el-select v-model="m.customerId" placeholder="请选择">
 											<el-option v-for="item in customerList" :key="item.id" :label="item.name"
@@ -148,7 +148,8 @@
 					items: [],
 					checkList: [],
 					customerList: [],
-					carTypeList: []
+					carTypeList: [],
+					currentCustomerId:'1'
 				},
 				computed: {
 					totalPrice() {
@@ -163,6 +164,15 @@
 					}
 				},
 				methods: {
+					getCustomer() {
+						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
+							let id = resp.data;
+							if (id == 1) {} else {
+								this.m.customerId = id;
+							}
+							this.currentCustomerId = id;
+						}.bind(this));
+					},
 					carTypeChange(v){
 						this.getItems();
 					},
@@ -180,8 +190,8 @@
 						sa.ajax('/TbCostomer/getList', {
 							pageNo: 1,
 							pageSize: 30,
-							type: 0,
-							judgeStatus: 2
+							judgeStatus: 2,
+							sortType:20
 						}, function(res) {
 							let list = res.data;
 							if (list.length > 0) {
@@ -233,6 +243,7 @@
 					}
 				},
 				mounted: function() {
+					this.getCustomer();
 					this.getCustomerList();
 					this.getItemTypeList();
 					this.getItemType();

+ 14 - 3
sp-admin/sa-view/tb-business/tb-car-disincle-edit.html

@@ -43,7 +43,7 @@
 							</div>
 							<el-row>
 								<el-col :span='12'>
-									<div class="c-item">
+									<div class="c-item" v-if="currentCustomerId=='1'">
 										<label class="c-label"><span style="color: red;">*</span>客户:</label>
 										<el-select v-model="m.customerId" placeholder="请选择">
 											<el-option v-for="item in customerList" :key="item.id" :label="item.name"
@@ -147,7 +147,8 @@
 					businessItems:[],
 					checkList: [],
 					customerList:[],
-					carTypeList:[]
+					carTypeList:[],
+					currentCustomerId:''
 				},
 				computed: {
 					totalPrice() {
@@ -163,6 +164,15 @@
 					}
 				},
 				methods: {
+					getCustomer() {
+						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
+							let id = resp.data;
+							if (id == 1) {} else {
+								this.m.customerId = id;
+							}
+							this.currentCustomerId = id;
+						}.bind(this));
+					},
 					carTypeChange(v){
 						this.getItems();
 					},
@@ -175,7 +185,7 @@
 						sa.ajax('/TbCostomer/getList', {
 							pageNo: 1,
 							pageSize: 30,
-							type: 0,
+							sortType:20
 							judgeStatus: 2
 						}, function(res) {
 							this.customerList = res.data; // 数据
@@ -240,6 +250,7 @@
 					}
 				},
 				mounted: function() {
+					this.getCustomer();
 					this.getOtherBusinessById();
 					this.getCustomerList();
 				}

+ 2 - 3
sp-admin/sa-view/tb-business/tb-car-disincle-info.html

@@ -38,7 +38,6 @@
 										<el-row>
 											<el-col span="12">
 												<sa-info name="客户名称" br v-if="m.customerName">{{m.customerName}}</sa-info>
-												<sa-info name="业务编号" br>{{m.no}}</sa-info>
 												<sa-info name="车规格" br>{{m.cardSize}}(米)</sa-info>
 												<sa-info name="业务类型" br>{{m.goodsName}}</sa-info>
 												<sa-info name="载重" br v-if="m.goodsName!=='空车'">{{m.netWeight}}(kg)</sa-info>
@@ -46,13 +45,13 @@
 													:jv="{1: '未支付', 2: '已支付未确认', 3: '已支付已确认'}" br></sa-info>
 											</el-col>
 											<el-col span="12">
+												<sa-info name="业务编号" br>{{m.no}}</sa-info>
 												<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
-												<sa-info name="录入人" br>{{m.createBy}}</sa-info>
 												<sa-info name="车牌" br>
 													<label v-if="m.chinaCarNo">{{m.chinaCarNo}}</label>
 													<label v-else>{{m.cardNo}}</label>
 												</sa-info>
-												<sa-info name="合计费用" br>{{m.totalMoney}}(元)</sa-info>
+												<sa-info name="业务费用" br>{{m.itemPrice}}(元)</sa-info>
 												<sa-info name="支付时间" br>{{m.payTime}}</sa-info>
 											</el-col>
 										</el-row>

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

@@ -29,7 +29,7 @@
 				<!-- ------------- 检索参数 ------------- -->
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
-					<sa-item type="text" name="车牌号" placeholder="越南车牌" v-model="p.cardNo"></sa-item>
+					<sa-item type="text" name="车牌号" placeholder="车牌" v-model="p.carNo"></sa-item>
 					<div class="c-item">
 						<label class="c-label">确认状态:</label>
 						<el-select v-model="p.adminConfirmInput" placeholder="请选择" @change="f5()">
@@ -123,7 +123,7 @@
 						no: '', // 编号 
 						isCar: 1,
 						adminConfirmInput: -1,
-						cardNo: '', // 车牌号 
+						carNo: '', // 车牌号 
 						outDayTime: '', // 离境时间 
 						partMoney: '', // 停车费用 
 						partTime: '', // 停车时常(分) 

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-19272
+24088

+ 1 - 2
sp-server/src/main/java/com/pj/api/h5/ApiController.java

@@ -110,8 +110,7 @@ public class ApiController {
     @GetMapping(value = "searchPartCar")
     public AjaxJson searchPartCar(String carNo) {
         carNo = carNo.toUpperCase();
-        List<TbBusinessCar> list = apiService.searchPartCar(carNo);
-        return AjaxJson.getSuccessData(list);
+        return AjaxJson.getSuccessData(apiService.searchPartCar(carNo));
     }
 
     @GetMapping(value = "getBusinessMoney")

+ 1 - 1
sp-server/src/main/java/com/pj/api/jh/service/JhService.java

@@ -128,7 +128,7 @@ public class JhService {
             taskService.addTask(new CheckPayStatusTask(RandomUtil.randomNumbers(12), 2000, out_trade_no));
             return BeanUtil.beanToMap(object);
         }
-        throw new Exception("支付信息有误");
+        throw new Exception("生成订单失败");
     }
 
     public Map<String, Object> buildCheckParams(String outTradeNo) {

+ 29 - 25
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -31,6 +31,7 @@ import com.pj.project.tb_car_no_color.TbCarNoColorService;
 import com.pj.project4sp.uploadfile.UploadConfig;
 import com.pj.utils.cache.RedisUtil;
 import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -45,6 +46,7 @@ import java.io.OutputStream;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.Objects;
@@ -52,6 +54,7 @@ import java.util.stream.Collectors;
 
 @Service
 @Transactional
+@Slf4j
 public class OpenService {
     @Resource
     @Lazy
@@ -127,9 +130,12 @@ public class OpenService {
         carNo = carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(carNo);
         if (tbBusinessCar == null || tbBusinessCar.getRealInTime() == null) {
+            log.error("请求返回【未查询到入场记录】:{}", carNo);
             return ResultJson.error("未查询到入场记录");
         }
         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());
@@ -139,65 +145,63 @@ public class OpenService {
                 tbBusinessCarService.updateById(tbBusinessCar);
                 CoverBase64ToUrl(image, tbBusinessCar.getId(), 2);
                 RedisUtil.del(channel);
+                log.error("请求返回【放行】:{}", carNo);
                 return ResultJson.success();
             }
         }
-
+        //是否行政车辆=====
         if (checkFree(carNo, 2, now)) {
             tbBusinessCar.setRealOutTime(now).setTimeUpdate(now).setOutChannel(channel);
             tbBusinessCarService.updateById(tbBusinessCar);
             CoverBase64ToUrl(image, tbBusinessCar.getId(), 2);
             RedisUtil.del(channel);
+            log.error("请求返回【放行】:{}", carNo);
             return ResultJson.success();
         }
         if (tbBusinessCar.getIsLock() == 1) {
             RedisUtil.setByMINUTES(channel, carNo, 2);
+            log.error("请求返回:车辆已锁定:{}", carNo);
             return ResultJson.error("车辆已锁定");
         }
-        String businessId = tbBusinessCar.getBusinessId();
         String carNoStr = carNo.substring(0, 1);
         Date inTime = tbBusinessCar.getRealInTime();
         if (tbBusinessCar.getPay() == 1) {
             inTime = tbBusinessCar.getPayTime();
         }
         BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now);
-        if (!CAR_LIST.contains(carNoStr)) {
-            TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-            //整车业务免停车费
-            if (tbBusiness != null && Objects.equals(tbBusiness.getBusinessType(), TbBusiness.BusinessType.HOLD_CAR.getCode())) {
-                price = new BigDecimal("0");
-            }
+        //越南车牌,整车业务免停车费
+        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 (StrUtil.isEmpty(businessId)) {
+        //无业务费用车辆===
+        if (TbBusiness.BusinessType.NO_BUSINESS.getCode().equals(businessType)) {
             tbBusinessCar.setRealOutTime(now).setOutChannel(channel).setTimeUpdate(now);
             tbBusinessCarService.updateById(tbBusinessCar);
             CoverBase64ToUrl(image, tbBusinessCar.getId(), 2);
             RedisUtil.del(channel);
+            log.error("请求返回【放行】:{}", carNo);
             return ResultJson.success();
         }
-        TbBusiness business = tbBusinessService.getById(businessId);
-        List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(businessId)
-                .stream().filter(tbBusinessItem -> tbBusinessItem.getPayStatus() == 1).collect(Collectors.toList());
-        BigDecimal itemPayPrice = new BigDecimal("0");
-        for (TbBusinessItem tbBusinessItem : items) {
-            itemPayPrice = itemPayPrice.add(tbBusinessItem.getItemPrice().multiply(new BigDecimal(tbBusinessItem.getNum())));
-        }
-
 
-        if (!CAR_LIST.contains(StrUtil.sub(carNo, 0, 1))) {
-            if (!business.getItemPrice().equals(itemPayPrice) && business.getCustomerType() != 2) {
-                RedisUtil.setByMINUTES(channel, carNo, 2);
-                return ResultJson.error("请缴纳业务费用");
-            }
-        }
-
-        if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(business.getBusinessType()) && !business.getItemPrice().equals(itemPayPrice)) {
+        //============业务费计算是否交完
+        String businessId = tbBusinessCar.getBusinessId();
+        List<TbBusinessItem> items;
+        if (TbBusiness.BusinessType.HOLD_CAR.getCode().equals(businessType)) {
+            items = tbBusinessItemService.findByBusinessId(businessId);
+        } else {
+            List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(tbBusinessCar.getId());
+            items = tbBusinessItemService.findByBusinessIdList(businessList.stream().map(TbBusiness::getId).collect(Collectors.toList()));
+        }
+        long count = items.stream().filter(tbBusinessItem -> tbBusinessItem.getPayStatus() == 0).count();
+        if (count > 0) {
             RedisUtil.setByMINUTES(channel, carNo, 1);
+            log.error("请求返回:请缴纳业务费用:{}", carNo);
             return ResultJson.error("请缴纳业务费用");
         }
         tbBusinessCar.setRealOutTime(now).setOutChannel(channel).setTimeUpdate(now);

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

@@ -132,9 +132,8 @@ public class ApiService {
         }
     }
 
-    public List<TbBusinessCar> searchPartCar(String carNo) {
+    public Set<TbBusinessCar> searchPartCar(String carNo) {
         List<TbBusinessCar> list = tbBusinessCarService.searchPartCar(carNo);
-
         list = list.stream().filter(tbBusinessCar -> {
             String businessId = tbBusinessCar.getBusinessId();
             if (StrUtil.isEmpty(businessId)) {
@@ -153,7 +152,7 @@ public class ApiService {
         //过滤掉不用缴费的车
         list.addAll(cars);
         list.addAll(otherBusinessCarList);
-        return list;
+        return new HashSet<>(list);
     }
 
     public void confirm(List<String> ids) {

+ 19 - 8
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -202,7 +202,7 @@ public class WxService {
         String outTradeNo = notifyBO.getOutTradeNo();
         TbOrder tbOrder = tbOrderService.findByOutTradeNo(outTradeNo);
         if (tbOrder == null) {
-            log.error("========订单不存在==========:{}",outTradeNo);
+            log.error("========订单不存在==========:{}", outTradeNo);
             return;
         }
         String total_fee = notifyBO.getTotalFee();
@@ -233,16 +233,27 @@ public class WxService {
             tbFeeDetailsService.chargeParkFee(cars, transactionId, outTradeNo);//添加cars的收费明细
             String businessId = attach.getB();
             if (StrUtil.isNotEmpty(businessId)) {
-                List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(businessId);
+                List<TbBusinessItem> items;
+                List<TbBusiness> businessList = new ArrayList<>();
+                if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(tbOrder.getBusinessType())) {
+                    List<String> businessIds = StrUtil.splitTrim(",", businessId);
+                    items = tbBusinessItemService.findByBusinessIdList(businessIds);
+                    businessList = tbBusinessService.listByIds(businessIds);
+                } else {
+                    items = tbBusinessItemService.findByBusinessId(businessId);
+                    TbBusiness tbBusiness = tbBusinessService.getById(businessId);
+                    businessList.add(tbBusiness);
+                }
                 tbFeeStatisticsService.countBusinessFee(items, transactionId, outTradeNo);//业务费日统计
                 items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setPayTime(now));
                 tbBusinessItemService.updateBatchById(items);
-                TbBusiness tbBusiness = tbBusinessService.getById(businessId);
-                tbBusiness.setPayTime(now).setPayType(3).setConfirmInput(1).setConfirmInputTime(now)
-                        .setPayMoney(tbBusiness.getPayMoney().add(tbBusiness.getItemPrice()))
-                        .setPayNo(transactionId);
-                tbBusiness.setPayStatus(tbBusiness.getPayMoney().equals(tbBusiness.getTotalMoney()) ? 3 : 4);
-                tbBusinessService.updateById(tbBusiness);
+                businessList.forEach(tbBusiness -> {
+                    tbBusiness.setPayTime(now).setPayType(3).setConfirmInput(1).setConfirmInputTime(now)
+                            .setPayMoney(tbBusiness.getPayMoney().add(tbBusiness.getItemPrice()))
+                            .setPayNo(transactionId);
+                    tbBusiness.setPayStatus(tbBusiness.getPayMoney().equals(tbBusiness.getTotalMoney()) ? 3 : 4);
+                    tbBusinessService.updateById(tbBusiness);
+                });
             }
             String a = attach.getA();
             if (StrUtil.isNotEmpty(a)) {

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java

@@ -241,6 +241,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     @Getter
     @AllArgsConstructor
     public static enum BusinessType{
+        NO_BUSINESS(0,"无业务车辆"),
         CAR_DISINCLE(1,"其他业务"),
         HOLD_CAR(2,"整车业务"),
         ;

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

@@ -1,5 +1,6 @@
 package com.pj.project.tb_business;
 
+import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 
@@ -162,11 +163,17 @@ public class TbBusinessController {
         List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
         items.forEach(tbBusinessItem -> tbBusinessItem.setGoodsName(t.getGoodsName()).setCardNo(t.getCardNo()).setChinaCarNo(t.getChinaCarNo()));
         t.setItems(items);
-        List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(id);
-        t.setCars(cars);
+        if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(t.getBusinessType())){
+           t.setCars(Collections.singletonList( tbBusinessCarService.getById(t.getBusinessCarId())));
+        }else {
+            List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(id);
+            t.setCars(cars);
+        }
         return AjaxJson.getSuccessData(t);
     }
 
+
+
     /**
      * 查集合 - 根据条件(参数为空时代表忽略指定条件)
      */

+ 3 - 0
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessMapper.xml

@@ -86,6 +86,9 @@
         <if test="customerId !=null and customerId !=''">
             and a.customer_id=#{customerId}
         </if>
+        <if test="carNo !=null and carNo !=''">
+            and b.car_no like concat ('%',#{carNo},'%')
+        </if>
         ORDER BY a.create_time desc
 	</select>
 

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

@@ -59,6 +59,7 @@ import com.pj.project.tb_pass_record.TbPassRecordService;
 import com.pj.project.tb_unit.TbUnit;
 import com.pj.project.tb_unit.TbUnitService;
 import com.pj.project4sp.admin.SpAdmin;
+import com.pj.project4sp.admin.SpAdminService;
 import com.pj.project4sp.global.BusinessException;
 import com.pj.project4sp.role.SpRoleUtil;
 import com.pj.project4sp.role4permission.SpRolePermissionService;
@@ -131,6 +132,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     WxService wxService;
     @Resource
     MyConfig myConfig;
+
+    @Resource
+    private SpAdminService spAdminService;
+
+
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
 
@@ -344,31 +350,53 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     .setConfirmInputTime(new Date())
                     .setConfirmInputBy(StpUserUtil.getAdmin().getName());
             this.updateById(business);
+            List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(business.getId());
+            if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(business.getBusinessType())) {
+                cars = Collections.singletonList(tbBusinessCarService.getById(business.getBusinessCarId()));
+            }
+            String carNoStr = cars.stream().map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
             storeMsg(business.getCustomerId(), "业务订单【" + business.getNo() + "】已确认" + DateUtil.now() + "。");
             List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
             items.forEach(item -> {
                 String businessType = item.getBusinessType();
                 if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
-                    String remark = "车牌:";
-                    String carNo = business.getCardNo();
-                    String chinaCarNo = business.getChinaCarNo();
-                    if (StrUtil.isNotEmpty(carNo) && StrUtil.isNotEmpty(chinaCarNo)) {
-                        remark += carNo + "、" + chinaCarNo;
-                    }
-                    if (StrUtil.isEmpty(carNo) && StrUtil.isNotEmpty(chinaCarNo)) {
-                        remark += chinaCarNo;
-                    }
-                    if (StrUtil.isNotEmpty(carNo) && StrUtil.isEmpty(chinaCarNo)) {
-                        remark += carNo;
-                    }
-                    MsgDataBO msgDataBO = new MsgDataBO("订单号:" + item.getNo(), item.getItemTypeName(), item.getItemName(), business.getGoodsName(), DateUtil.now(), remark);
-                    StrUtil.splitTrim(businessType, ",").forEach(type -> {
-                        List<String> openidList = tbCostomerService.findByBusinessTypeOpenid(type);
+                    String customerId = business.getCustomerId();
+                    TbCostomer tbCostomer = tbCostomerService.getById(customerId);
+                    String customerType = tbCostomer.getType();
+                    if (StrUtil.equals(businessType, customerType)) {
+                        MsgDataBO msgDataBO = new MsgDataBO("订单号:" + item.getNo(), "系统自动确认",
+                                DateUtil.now(),
+                                business.getGoodsName() + "(" + item.getItemTypeName() + item.getItemName() + "-" + carNoStr + ")");
+                        List<SpAdmin> spAdminList = spAdminService.findByCustomerId(customerId);
+                        Date now = new Date();
+                        item.setPickCustomerId(customerId).setPickCustomerName(tbCostomer.getName()).setPickTime(now)
+                                .setConfirm(1).setConfirmTime(now);
+                        tbBusinessItemService.updateById(item);
+                        spAdminList.stream().map(SpAdmin::getOpenid).forEach(openId -> {
+                            String detailUrl = myConfig.getWebDomain() + "/pages/business-item/item-detail?itemId=" + item.getId() + "&openid=" + openId;
+                            wxService.sendTemplateMsg(wxConfig.getBusinessConfirmTemplate(), openId, msgDataBO, detailUrl);
+                        });
+                    } else {
+                        String remark = "车牌:";
+                        String carNo = business.getCardNo();
+                        String chinaCarNo = business.getChinaCarNo();
+                        if (StrUtil.isNotEmpty(carNo) && StrUtil.isNotEmpty(chinaCarNo)) {
+                            remark += carNo + "、" + chinaCarNo;
+                        }
+                        if (StrUtil.isEmpty(carNo) && StrUtil.isNotEmpty(chinaCarNo)) {
+                            remark += chinaCarNo;
+                        }
+                        if (StrUtil.isNotEmpty(carNo) && StrUtil.isEmpty(chinaCarNo)) {
+                            remark += carNo;
+                        }
+                        MsgDataBO msgDataBO = new MsgDataBO("订单号:" + item.getNo(), item.getItemTypeName(),
+                                item.getItemName(), business.getGoodsName(), DateUtil.now(), remark);
+                        List<String> openidList = tbCostomerService.findByBusinessTypeOpenid(businessType);
                         openidList.forEach(openid -> {
                             String detailUrl = myConfig.getWebDomain() + "/pages/business-item/item-detail?itemId=" + item.getId() + "&openid=" + openid;
                             wxService.sendTemplateMsg(wxConfig.getBusinessNoticeTemplate(), openid, msgDataBO, detailUrl);
                         });
-                    });
+                    }
                 }
             });
         });
@@ -497,22 +525,23 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         Map<String, Object> result = new HashMap<>();
         TbBusinessCar car = tbBusinessCarService.getById(carId);
         String businessId = car.getBusinessId();
-        result.put("type", car.getBusinessType());
+        Integer businessType=car.getBusinessType();
+        result.put("type",businessType);
         List<TbBusinessCar> cars = new ArrayList<>();
         List<TbBusinessItem> items = new ArrayList<>();
         cars.add(car);
         //其他业务
-        if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(car.getBusinessType())) {
+        if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(businessType)) {
             List<TbBusiness> businesses = this.findOtherBusinessByCarId(carId);
-            businesses=businesses.stream()
-                    .filter(tbBusiness -> tbBusiness.getAdminConfirmInput()==1&&tbBusiness.getPayMoney().doubleValue()<tbBusiness.getTotalMoney().doubleValue())
+            businesses = businesses.stream()
+                    .filter(tbBusiness -> tbBusiness.getAdminConfirmInput() == 1 && tbBusiness.getPayMoney().doubleValue() < tbBusiness.getTotalMoney().doubleValue())
                     .collect(Collectors.toList());
             List<String> businessIdList = businesses.stream().map(TbBusiness::getId).collect(Collectors.toList());
-            if (!businessIdList.isEmpty()){
+            if (!businessIdList.isEmpty()) {
                 items = tbBusinessItemService.findByBusinessIdList(businessIdList);
                 businessId = String.join(",", businessIdList);
             }
-        } else if (TbBusiness.BusinessType.HOLD_CAR.getCode().equals(car.getBusinessType())) {
+        } else if (TbBusiness.BusinessType.HOLD_CAR.getCode().equals(businessType)) {
             cars = tbBusinessCarService.findByBusinessId(businessId);
             TbBusiness tbBusiness = this.getById(businessId);
             if (tbBusiness.getPayStatus() != TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode()) {
@@ -540,13 +569,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     partMoney = new BigDecimal("0");
                 }
             }
-            //越南车
-            if (!CAR_LIST.contains(carNo)) {
-                TbBusiness tbBusiness = this.getById(businessId);
-                //整车业务免费
-                if (tbBusiness != null && Objects.equals(tbBusiness.getBusinessType(), TbBusiness.BusinessType.HOLD_CAR.getCode())) {
-                    partMoney = new BigDecimal("0");
-                }
+            //越南车牌,整车业务免停车费
+            if (!CAR_LIST.contains(carNo)&&TbBusiness.BusinessType.HOLD_CAR.getCode().equals(businessType)) {
+                partMoney = new BigDecimal("0");
             }
             Map<String, Object> carMap = new HashMap<>();
             carMap.put("price", partMoney);

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerMapper.xml

@@ -99,6 +99,7 @@
             <when test='sortType == 9'>judge_status desc</when>
             <when test='sortType == 10'>judge_time desc</when>
             <when test='sortType == 11'>judge_content desc</when>
+            <when test='sortType == 20'>type asc</when>
             <otherwise>id desc</otherwise>
         </choose>
     </select>

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java

@@ -140,7 +140,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         return getOne(qw);
     }
 
-
+    @Async
     public void chargeParkFee(List<PriceBO> cars, String transactionId, String outTradeNo) {
         for (PriceBO bo1 : cars) {
             if(bo1.getP().compareTo(BigDecimal.valueOf(0)) == 0){