Sfoglia il codice sorgente

不通规格计费问题

qzyReal 2 anni fa
parent
commit
a9ce05d486

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

@@ -1,461 +1,461 @@
 <template>
-  <view>
-    <view class="box">
-      <view class="top" style="padding-top: 50rpx;">
-        <text class="title">缴纳费用</text>
-      </view>
-      <u-search placeholder="输入车牌号查询" shape="square" v-model="p.carNo" @search="searchFn()" @change="searchFn"
-                :height="80" style="margin: 30rpx;">
-      </u-search>
-    </view>
-    <view class="list" v-show="list.length>0">
-      <u-radio-group placement="column" @change="groupChange">
-        <u-radio :customStyle="{marginBottom: '6px',borderBottom: '1px solid #e5e5e5',paddingBottom:'5px'}"
-                 v-for="(item, index) in list" :key="index" :label="item.carNo" :name="item.id">
-        </u-radio>
-      </u-radio-group>
-    </view>
-    <view class="car-list" v-show="cars.length>0">
-      <view class="card">
-        <view class="title">
-          停车费:
-        </view>
-        <u-checkbox-group v-model="carsSelect" placement="column">
-          <view v-for="(item,index) in cars" :key="index">
-            <label class="c-item">
-              <view class="l">
-                <u-checkbox :customStyle="{marginBottom: '8px'}" :name="item.id"
-                            :disabled="item.price==0">
-                </u-checkbox>
-              </view>
-              <view class="c">{{ item.carNo }}</view>
-              <view class="r" v-if="item.price>0">{{ item.price }}元</view>
-              <view class="r" v-else>无需缴费</view>
-            </label>
-          </view>
-        </u-checkbox-group>
-      </view>
+	<view>
+		<view class="box">
+			<view class="top" style="padding-top: 50rpx;">
+				<text class="title">缴纳费用</text>
+			</view>
+			<u-search placeholder="输入车牌号查询" shape="square" v-model="p.carNo" @search="searchFn()" @change="searchFn"
+				:height="80" style="margin: 30rpx;">
+			</u-search>
+		</view>
+		<view class="list" v-show="list.length>0">
+			<u-radio-group placement="column" @change="groupChange">
+				<u-radio :customStyle="{marginBottom: '6px',borderBottom: '1px solid #e5e5e5',paddingBottom:'5px'}"
+					v-for="(item, index) in list" :key="index" :label="item.carNo" :name="item.id">
+				</u-radio>
+			</u-radio-group>
+		</view>
+		<view class="car-list" v-show="cars.length>0">
+			<view class="card">
+				<view class="title">
+					停车费:
+				</view>
+				<u-checkbox-group v-model="carsSelect" placement="column">
+					<view v-for="(item,index) in cars" :key="index">
+						<label class="c-item">
+							<view class="l">
+								<u-checkbox :customStyle="{marginBottom: '8px'}" :name="item.id"
+									:disabled="item.price==0">
+								</u-checkbox>
+							</view>
+							<view class="c">{{ item.carNo }}</view>
+							<view class="r" v-if="item.price>0">{{ item.price }}元</view>
+							<view class="r" v-else>无需缴费</view>
+						</label>
+					</view>
+				</u-checkbox-group>
+			</view>
 
-      <view class="card" v-if="item.itemsPrice">
-        <view class="title">
-          <u-checkbox-group placement="column" v-model="businessSelect" @change="businessChange">
-            <u-checkbox :disabled="businessAble" :customStyle="{color: 'black'}"
-                        :label="'业务费:'+item.itemsPrice+'元'" :name='1'>
-            </u-checkbox>
-          </u-checkbox-group>
-        </view>
-        <view style="height: 600rpx;overflow-y: auto;">
-          <u-checkbox-group placement="column" v-model="itemSelect">
-            <view v-for="(item,index) in item.list" :key="index">
-              <label class="c-item">
-                <view class="l">
-                  <u-checkbox :customStyle="{marginBottom: '8px'}" disabled :name="item.id">
-                  </u-checkbox>
-                </view>
-                <view class="c">{{ item.name }}</view>
-                <view class="r">¥{{ item.price }}</view>
-              </label>
-            </view>
-          </u-checkbox-group>
-        </view>
+			<view class="card" v-if="item.itemsPrice">
+				<view class="title">
+					<u-checkbox-group placement="column" v-model="businessSelect" @change="businessChange">
+						<u-checkbox :disabled="businessAble" :customStyle="{color: 'black'}"
+							:label="'业务费:'+item.itemsPrice+'元'" :name='1'>
+						</u-checkbox>
+					</u-checkbox-group>
+				</view>
+				<view style="height: 600rpx;overflow-y: auto;">
+					<u-checkbox-group placement="column" v-model="itemSelect">
+						<view v-for="(item,index) in item.list" :key="index">
+							<label class="c-item">
+								<view class="l">
+									<u-checkbox :customStyle="{marginBottom: '8px'}" disabled :name="item.id">
+									</u-checkbox>
+								</view>
+								<view class="c">{{ item.name }}</view>
+								<view class="r">¥{{ item.price }}</view>
+							</label>
+						</view>
+					</u-checkbox-group>
+				</view>
 
-      </view>
-      <view style="height: 60rpx;">
+			</view>
+			<view style="height: 60rpx;">
 
-      </view>
-    </view>
-    <view v-if="showTips">
-      <view class="tips">
-        <view>
-          未查询到相关费用,可能原因:
-        </view>
-        <view>
-          1、车辆无需缴费。
-        </view>
-		<view>
-		  2、业务订单未审核。
-		</view>
-        <view>
-          3、业务订单需管理员确认后方可缴费。
-        </view>
-      </view>
-    </view>
-    <view class="bottom bgc-f bottom-safety" v-if="total>0">
-      <view class="box">
-        <view class="l">
-          <text class="t1">金额:</text>
-          <text class="t2">¥{{ total }}元</text>
-        </view>
-		<view v-if="judge">
-			<view class="r" v-if="showPay">
-			  <view class="btn" @click="confirmPayFn()">立即支付</view>
 			</view>
-			<view class="r" v-else>
-			  <view class="btn" @click="showMsg">存在待录入业务</view>
+		</view>
+		<view v-if="showTips">
+			<view class="tips">
+				<view>
+					未查询到相关费用,可能原因:
+				</view>
+				<view>
+					1、车辆无需缴费。
+				</view>
+				<view>
+					2、业务订单未审核。
+				</view>
+				<view>
+					3、业务订单需管理员确认后方可缴费。
+				</view>
 			</view>
 		</view>
-		<view v-else>
-			<view class="r">
-			  <view class="btn">业务未审核</view>
+		<view class="bottom bgc-f bottom-safety" v-if="total>0">
+			<view class="box">
+				<view class="l">
+					<text class="t1">金额:</text>
+					<text class="t2">¥{{ total }}元</text>
+				</view>
+				<view v-if="judge">
+					<view class="r" v-if="showPay">
+						<view class="btn" @click="confirmPayFn()">立即支付</view>
+					</view>
+					<view class="r" v-else>
+						<view class="btn" @click="showMsg">存在待录入业务</view>
+					</view>
+				</view>
+				<view v-else>
+					<view class="r">
+						<view class="btn">业务未审核</view>
+					</view>
+				</view>
 			</view>
 		</view>
-      </view>
-    </view>
-  </view>
+	</view>
 
 </template>
 
 <script>
-var jweixin = require('@/components/jweixin-module/index.js');
-export default {
-  data() {
-    return {
-      p: {
-        carNo: ''
-      },
-      code: '',
-      selectNo: '',
-      openid: '',
-      carsSelect: [],
-      itemSelect: [],
-      businessSelect: [],
-      goodsName: '',
-      businessNos: '',
-      state: '',
-      list: [],
-      cars: [],
-      type: 0,
-      businessAble: true,
-      showPay: false,
-	  judge:false,
-      item: {
-        itemsPrice: 0,
-        businessId: '',
-        list: []
-      },
-      payTypeList: [{
-        name: '微信支付',
-        value: 3
-      }],
-      form: {
-        partMoney: 0,
-        payType: 3
-      },
-      showTips: false,
+	var jweixin = require('@/components/jweixin-module/index.js');
+	export default {
+		data() {
+			return {
+				p: {
+					carNo: ''
+				},
+				code: '',
+				selectNo: '',
+				openid: '',
+				carsSelect: [],
+				itemSelect: [],
+				businessSelect: [],
+				goodsName: '',
+				businessNos: '',
+				state: '',
+				list: [],
+				cars: [],
+				type: 0,
+				businessAble: true,
+				showPay: false,
+				judge: false,
+				item: {
+					itemsPrice: 0,
+					businessId: '',
+					list: []
+				},
+				payTypeList: [{
+					name: '微信支付',
+					value: 3
+				}],
+				form: {
+					partMoney: 0,
+					payType: 3
+				},
+				showTips: false,
 
-    }
-  },
-  onLoad(options) {
-    this.code = options.code;
-    this.state = options.state;
-    this.getOpenidByCode();
-  },
-  onShow() {
-    this.$common.hidingLoading();
-  },
-  created() {
-  },
-  mounted() {
-    this.getChannelCar();
-    this.getWxConfig();
-  },
-  beforeDestroy() {
-    this.$common.hidingLoading()
-  },
-  computed: {
-    total() {
-      let carIds = this.carsSelect;
-      let carMoney = this.cars.filter(obj => carIds.indexOf(obj.id) !== -1)
-          .map(obj => obj.price).reduce(function (pre, cur) {
-            return pre + cur;
-          }, 0);
-      let itemIds = this.itemSelect;
-      let itemMoney = this.item.list ? this.item.list.filter(obj => itemIds.indexOf(obj.id) !== -1)
-          .map(obj => obj.price).reduce(function (pre, cur) {
-            return pre + cur;
-          }, 0) : 0;
-      return (carMoney + itemMoney).toFixed(2);
-    }
-  },
-  methods: {
-    showMsg() {
-      this.$common.toast('请先完善相关业务录入');
-    },
-    businessChange(value) {
-      this.itemSelect = value.length == 0 ? this.itemSelect = [] : this.item.list.map(obj => obj.id)
-    },
-    getChannelCar() {
-      if (this.state !== 'STATE') {
-        this.$api.getPartCarByChannel({
-          channel: this.state
-        }).then(resp => {
-          let data = resp.data;
-          if (data.cars && data.cars.length > 0) {
-            this.cars = data.cars;
-            let carId = [data.cars[0].id];
-            this.carsSelect = carId;
-            this.groupChange(carId)
-          }
-        })
-      }
-    },
-    getWxConfig() {
-      let url = window.location.href;
-      this.$api.getWxConfig({
-        url: url
-      }).then(resp => {
-        jweixin.config({
-          // debug: true,
-          appId: resp.data.appId,
-          timestamp: resp.data.timestamp, // 必填,生成签名的时间戳
-          nonceStr: resp.data.noncestr, // 必填,生成签名的随机串
-          signature: resp.data.sign, // 必填,签名
-          jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表
-        });
-        jweixin.ready(function () {
+			}
+		},
+		onLoad(options) {
+			this.code = options.code;
+			this.state = options.state;
+			this.getOpenidByCode();
+		},
+		onShow() {
+			this.$common.hidingLoading();
+		},
+		created() {},
+		mounted() {
+			this.getChannelCar();
+			this.getWxConfig();
+			
+		},
+		beforeDestroy() {
+			this.$common.hidingLoading()
+		},
+		computed: {
+			total() {
+				let carIds = this.carsSelect;
+				let carMoney = this.cars.filter(obj => carIds.indexOf(obj.id) !== -1)
+					.map(obj => obj.price).reduce(function(pre, cur) {
+						return pre + cur;
+					}, 0);
+				let itemIds = this.itemSelect;
+				let itemMoney = this.item.list ? this.item.list.filter(obj => itemIds.indexOf(obj.id) !== -1)
+					.map(obj => obj.price).reduce(function(pre, cur) {
+						return pre + cur;
+					}, 0) : 0;
+				return (carMoney + itemMoney).toFixed(2);
+			}
+		},
+		methods: {
+			showMsg() {
+				this.$common.toast('请先完善相关业务录入');
+			},
+			businessChange(value) {
+				this.itemSelect = value.length == 0 ? this.itemSelect = [] : this.item.list.map(obj => obj.id)
+			},
+			getChannelCar() {
+				if (this.state !== 'STATE') {
+					this.$api.getPartCarByChannel({
+						channel: this.state
+					}).then(resp => {
+						let data = resp.data;
+						if (data.cars && data.cars.length > 0) {
+							this.cars = data.cars;
+							let carId = [data.cars[0].id];
+							this.carsSelect = carId;
+							this.groupChange(carId)
+						}
+					})
+				}
+			},
+			getWxConfig() {
+				let url = window.location.href;
+				this.$api.getWxConfig({
+					url: url
+				}).then(resp => {
+					jweixin.config({
+						// debug: true,
+						appId: resp.data.appId,
+						timestamp: resp.data.timestamp, // 必填,生成签名的时间戳
+						nonceStr: resp.data.noncestr, // 必填,生成签名的随机串
+						signature: resp.data.sign, // 必填,签名
+						jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表
+					});
+					jweixin.ready(function() {
 
-        });
-        jweixin.error(function (res) {
-          console.log(res)
-        });
-      })
-    },
-    confirmPayFn() {
-      let carIds = this.carsSelect
-      let cars = this.cars.filter(obj => carIds.indexOf(obj.id) !== -1);
-      let carNos = this.cars.map(obj => obj.carNo).join('、');
-      let carBusinessNo = this.cars.map(obj => obj.no).join('、');
-      let businessSelect = this.businessSelect;
-      let p = {
-        b: businessSelect.length > 0 ? this.item.businessId : '',
-        c: JSON.stringify(cars.map(obj => {
-          return {
-            id: obj.id,
-            p: obj.price
-          }
-        })),
-        money: this.total,
-        tradeType: "JSAPI",
-        openid: this.openid
-      }
-      let con = 'A1-停车费-' + carBusinessNo;
-      let tradeType = 'PORT_PARKING_FEE';
-      if (carIds.length == 0 || businessSelect.length > 0) {//交业务费
-        con = 'A1-' + this.goodsName + '-' + this.businessNos;
-        tradeType = 'PORT_OPERATION_FEE';
-      }
-      p.desc = con + '-' + carNos;
-      p.businessType = tradeType;
-      this.$common.showLoading('正在请求...');
-      let that = this;
-      that.$api.getPrePay(that.$common.removeNull(p)).then(resp => {
-        let data = resp.data;
-        if (resp.code !== 200) {
-          that.$common.toast(resp.msg);
-          return;
-        }
-        jweixin.chooseWXPay({
-          timestamp: data
-              .timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
-          nonceStr: data.nonceStr, // 支付签名随机串,不长于 32 位
-          package: data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
-          signType: data.signType, // 微信支付V3的传入RSA,微信支付V2的传入格式与V2统一下单的签名格式保持一致
-          paySign: data.paySign, // 支付签名
-          success: function (res) {
-            if (res.errMsg === "chooseWXPay:ok") {
-              that.$common.toast('支付成功')
-              //that.checkPayResult(data.outTradeNo);
-              that.cars = [];
-              that.item.list = [];
-              that.total = 0
-            }
-          },
-          complete: function (res) {
-            //that.checkPayResult(data.outTradeNo);
-          }
-        });
-      })
-    },
-    checkPayResult(outTradeNo) {
-      this.$common.showLoading('正在查询结果...')
-      this.$api.checkPayResult({
-        outTradeNo: outTradeNo
-      }).then(resp => {
-        let data = resp.data;
-        if (data.orderStatus == 'SUCCESS' || data.orderStatus == 'FINISH') {
-          this.$common.toast('支付成功')
-        } else {
-          this.$common.toast('支付失败')
-        }
-      })
-    },
-    payTypeChange(value) {
+					});
+					jweixin.error(function(res) {
+						console.log(res)
+					});
+				})
+			},
+			confirmPayFn() {
+				let carIds = this.carsSelect
+				let cars = this.cars.filter(obj => carIds.indexOf(obj.id) !== -1);
+				let carNos = this.cars.map(obj => obj.carNo).join('、');
+				let carBusinessNo = this.cars.map(obj => obj.no).join('、');
+				let businessSelect = this.businessSelect;
+				let openid=this.openid?this.openid:uni.getStorageSync('openid')
+				let p = {
+					b: businessSelect.length > 0 ? this.item.businessId : '',
+					c: JSON.stringify(cars.map(obj => {
+						return {
+							id: obj.id,
+							p: obj.price
+						}
+					})),
+					money: this.total,
+					tradeType: "JSAPI",
+					openid: openid
+				}
+				let con = 'A1-停车费-' + carBusinessNo;
+				let tradeType = 'PORT_PARKING_FEE';
+				if (carIds.length == 0 || businessSelect.length > 0) { //交业务费
+					con = 'A1-' + this.goodsName + '-' + this.businessNos;
+					tradeType = 'PORT_OPERATION_FEE';
+				}
+				p.desc = con + '-' + carNos;
+				p.businessType = tradeType;
+				this.$common.showLoading('正在请求...');
+				let that = this;
+				that.$api.getPrePay(that.$common.removeNull(p)).then(resp => {
+					let data = resp.data;
+					if (resp.code !== 200) {
+						that.$common.toast(resp.msg);
+						return;
+					}
+					jweixin.chooseWXPay({
+						timestamp: data
+							.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
+						nonceStr: data.nonceStr, // 支付签名随机串,不长于 32 位
+						package: data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
+						signType: data.signType, // 微信支付V3的传入RSA,微信支付V2的传入格式与V2统一下单的签名格式保持一致
+						paySign: data.paySign, // 支付签名
+						success: function(res) {
+							if (res.errMsg === "chooseWXPay:ok") {
+								that.$common.toast('支付成功')
+								//that.checkPayResult(data.outTradeNo);
+								that.cars = [];
+								that.item.list = [];
+								that.total = 0
+							}
+						},
+						complete: function(res) {
+							//that.checkPayResult(data.outTradeNo);
+						}
+					});
+				})
+			},
+			checkPayResult(outTradeNo) {
+				this.$common.showLoading('正在查询结果...')
+				this.$api.checkPayResult({
+					outTradeNo: outTradeNo
+				}).then(resp => {
+					let data = resp.data;
+					if (data.orderStatus == 'SUCCESS' || data.orderStatus == 'FINISH') {
+						this.$common.toast('支付成功')
+					} else {
+						this.$common.toast('支付失败')
+					}
+				})
+			},
+			payTypeChange(value) {
 
-    },
-    getOpenidByCode() {
-      let storeOpenid = uni.getStorageSync('openid');
-      this.$api.getOpenidByCode({
-        code: this.code,
-        openid: storeOpenid
-      }).then(resp => {
-        let openid = resp.data;
-        this.openid = openid;
-        if (openid) {
-          uni.setStorageSync('openid', openid)
-        }
+			},
+			getOpenidByCode() {
+				let storeOpenid = uni.getStorageSync('openid');
+				this.$api.getOpenidByCode({
+					code: this.code,
+					openid: storeOpenid
+				}).then(resp => {
+					let openid = resp.data;
+					if (openid) {
+						this.openid = openid;
+						uni.setStorageSync('openid', openid)
+					}
 
-      })
-    },
-    groupChange(carId) {
-      this.$api.getBusinessMoney({
-        carId: carId,
-        state: this.state
-      }).then(resp => {
-        let data = resp.data;
-        this.cars = data.carList;
-        this.goodsName = data.goodsName;
-        this.showPay = data.showPay;
-		this.judge=data.noJudgeCount==0;
-        this.businessNos = data.businessNo;
-        this.type = data.type;
-        let list = data.itemList;
-        this.carsSelect = this.cars.filter(obj => obj.id == carId && obj.price > 0).map(obj => obj.id)
-        Object.assign(this.item, {
-          itemsPrice: data.itemsPrice,
-          businessId: data.businessId,
-          list: list
-        })
-        this.businessAble = list.filter(obj => obj.pay == 1).length == list.length;
-        let selectCar = this.list.filter(obj => obj.id == carId).pop();
-        let carNo = selectCar.carNo;
-        this.itemSelect = data.itemList.filter(obj => obj.pay == 0).map(obj => obj.id)
-        this.businessSelect = this.itemSelect.length == 0 ? [] : [1]
-        this.list = [];
-        this.showTips = this.cars.length == 0 && data.itemsPrice == 0;
-      })
-    },
-    searchFn() {
-      this.showTips = false;
-      this.list = [];
-      this.cars = [];
-      this.carsSelect = [];
-      this.itemSelect = [];
-      this.businessSelect = []
-      this.item = {
-        itemsPrice: '',
-        businessId: '',
-        list: []
-      }
-      this.$api.searchPartCar(this.p).then(resp => {
-        this.list = resp.data;
-      })
-    }
+				})
+			},
+			groupChange(carId) {
+				this.$api.getBusinessMoney({
+					carId: carId,
+					state: this.state
+				}).then(resp => {
+					let data = resp.data;
+					this.cars = data.carList;
+					this.goodsName = data.goodsName;
+					this.showPay = data.showPay;
+					this.judge = data.noJudgeCount == 0;
+					this.businessNos = data.businessNo;
+					this.type = data.type;
+					let list = data.itemList;
+					this.carsSelect = this.cars.filter(obj => obj.id == carId && obj.price > 0).map(obj => obj.id)
+					Object.assign(this.item, {
+						itemsPrice: data.itemsPrice,
+						businessId: data.businessId,
+						list: list
+					})
+					this.businessAble = list.filter(obj => obj.pay == 1).length == list.length;
+					let selectCar = this.list.filter(obj => obj.id == carId).pop();
+					let carNo = selectCar.carNo;
+					this.itemSelect = data.itemList.filter(obj => obj.pay == 0).map(obj => obj.id)
+					this.businessSelect = this.itemSelect.length == 0 ? [] : [1]
+					this.list = [];
+					this.showTips = this.cars.length == 0 && data.itemsPrice == 0;
+				})
+			},
+			searchFn() {
+				this.showTips = false;
+				this.list = [];
+				this.cars = [];
+				this.carsSelect = [];
+				this.itemSelect = [];
+				this.businessSelect = []
+				this.item = {
+					itemsPrice: '',
+					businessId: '',
+					list: []
+				}
+				this.$api.searchPartCar(this.p).then(resp => {
+					this.list = resp.data;
+				})
+			}
 
-  }
-}
+		}
+	}
 </script>
 
 <style lang="scss">
-page {
-  background-color: #fff;
-}
+	page {
+		background-color: #fff;
+	}
 
-.list {
-  margin: 40rpx;
-}
+	.list {
+		margin: 40rpx;
+	}
 
-.card {
-  .title {
-    padding: 30rpx;
-    box-sizing: border-box;
-    font-size: 34rpx;
-    font-weight: bold;
-  }
-}
+	.card {
+		.title {
+			padding: 30rpx;
+			box-sizing: border-box;
+			font-size: 34rpx;
+			font-weight: bold;
+		}
+	}
 
-.tips {
-  margin: 140rpx 0 0 80rpx;
-  line-height: 60rpx;
-}
+	.tips {
+		margin: 140rpx 0 0 80rpx;
+		line-height: 60rpx;
+	}
 
-.content {
-  display: flex;
-  flex-direction: column;
-  padding: 30rpx;
-  box-sizing: border-box;
-  color: #999;
-}
+	.content {
+		display: flex;
+		flex-direction: column;
+		padding: 30rpx;
+		box-sizing: border-box;
+		color: #999;
+	}
 
-.c-item {
-  display: flex;
-  align-items: center;
-  margin: 5rpx 30rpx;
-  padding: 10rpx 30rpx;
-  border-radius: 10rpx;
-  background-color: #fff;
-  border: 1rpx solid #f5f5f5;
+	.c-item {
+		display: flex;
+		align-items: center;
+		margin: 5rpx 30rpx;
+		padding: 10rpx 30rpx;
+		border-radius: 10rpx;
+		background-color: #fff;
+		border: 1rpx solid #f5f5f5;
 
-  .l {
-  }
+		.l {}
 
-  .c {
-    font-size: 30rpx;
-    color: #191919;
-    font-weight: bold;
-    margin-left: 20rpx;
-  }
+		.c {
+			font-size: 30rpx;
+			color: #191919;
+			font-weight: bold;
+			margin-left: 20rpx;
+		}
 
-  .r {
-    font-size: 30rpx;
-    color: #ff4200;
-    font-weight: bold;
-    margin-left: auto;
-  }
-}
+		.r {
+			font-size: 30rpx;
+			color: #ff4200;
+			font-weight: bold;
+			margin-left: auto;
+		}
+	}
 
-.bottom {
-  min-height: 100rpx;
-  position: fixed;
-  left: 0;
-  right: 0;
-  bottom: 0;
+	.bottom {
+		min-height: 100rpx;
+		position: fixed;
+		left: 0;
+		right: 0;
+		bottom: 0;
 
-  .box {
-    display: flex;
-    width: 100%;
-    min-height: 100rpx;
-    align-items: center;
+		.box {
+			display: flex;
+			width: 100%;
+			min-height: 100rpx;
+			align-items: center;
 
-    .l {
-      padding-left: 30rpx;
-      flex: 2;
+			.l {
+				padding-left: 30rpx;
+				flex: 2;
 
-      .t1 {
-        color: #333;
-      }
+				.t1 {
+					color: #333;
+				}
 
-      .t2 {
-        color: #ff4200;
-        font-size: 38rpx;
-        font-weight: bold;
-      }
-    }
+				.t2 {
+					color: #ff4200;
+					font-size: 38rpx;
+					font-weight: bold;
+				}
+			}
 
-    .r {
-      flex: 1;
+			.r {
+				flex: 1;
 
-      .btn {
-        background-color: #ff4200;
-        min-height: 100rpx;
-        display: flex;
-        color: #fff;
-        font-size: 30rpx;
-        align-items: center;
-        justify-content: center;
-      }
-    }
-  }
-}
+				.btn {
+					background-color: #ff4200;
+					min-height: 100rpx;
+					display: flex;
+					color: #fff;
+					font-size: 30rpx;
+					align-items: center;
+					justify-content: center;
+				}
+			}
+		}
+	}
 
-@import '@/common/common.scss'
+	@import '@/common/common.scss'
 </style>

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

@@ -1,8 +1,8 @@
-const server = 'http://127.0.0.1:8099/pro';
+// const server = 'http://127.0.0.1:8099/pro';
 // const server = 'https://pco.aseanbusiness.cn/pro';
 
 
-// const server = 'https://dxkaa1.gxbtka.com/pro';
+const server = 'https://dxkaa1.gxbtka.com/pro';
 
 
 import common from '../common/js/common.js';

+ 7 - 5
sp-admin/sa-view/tb-business-car/tb-business-car-add.html

@@ -77,7 +77,8 @@
 							<label class="c-label">
 								<span style="color: red;" v-if="m.realOutTime">*</span>出场确认说明:</label>
 							<div style="display: inline-block;">
-								<el-input type="textarea" v-model="m.outRemark" placeholder="出场确认说明" :disabled="!m.realOutTime"></el-input>
+								<el-input type="textarea" v-model="m.outRemark" placeholder="出场确认说明"
+									:disabled="!m.realOutTime"></el-input>
 							</div>
 						</div>
 					</el-form>
@@ -112,8 +113,8 @@
 						isLock: '',
 						inImage: '',
 						outImage: '',
-						remark:'',
-						outRemark:''
+						remark: '',
+						outRemark: ''
 					}, // 实体对象
 				},
 				methods: {
@@ -127,6 +128,7 @@
 						// 表单校验
 						let m = this.m;
 						sa.checkNull(m.carNo, '请输入 [车牌号]');
+						sa.checkNull(m.color, '请选择 [车牌颜色]');
 						let realInTime = m.realInTime;
 						if (realInTime && !m.remark) {
 							sa.error('入场补录备注必填');
@@ -138,8 +140,8 @@
 							return;
 						}
 						// 开始增加或修改
-						sa.ajax('/TbBusinessCar/addCarRecord', m, function (res) {
-						    sa.alert('增加成功', this.clean);
+						sa.ajax('/TbBusinessCar/addCarRecord', m, function(res) {
+							sa.alert('增加成功', this.clean);
 						}.bind(this));
 					},
 					// 添加/修改 完成后的动作

+ 1 - 0
sp-admin/sa-view/tb-business-car/tb-business-car-info.html

@@ -41,6 +41,7 @@
 							<el-col :span="m.businessType==1?8:12">
 								<sa-info name="车牌号" br>{{m.carNo}}</sa-info>
 								<sa-info name="车牌颜色" br>{{m.color}}</sa-info>
+								<sa-info name="车牌规格(米)" br>{{m.carSize}}</sa-info>
 								<sa-info name="入场时间" br>{{m.realInTime}}<label v-if="m.inTimeSupplement===1">(补)</label>
 								</sa-info>
 								<sa-info name="补录时间" br v-if="m.inTimeSupplementTime">{{m.inTimeSupplementTime}}

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

@@ -152,6 +152,8 @@ public class JhService {
     }
 
 
+
+
     public Map<String, Object> buildCheckParams(String outTradeNo) {
         Map<String, Object> params = new HashMap<>();
         params.put("businessMerchantNo", jhConfig.getBusinessMerchantNo());

+ 20 - 14
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -36,6 +36,8 @@ import com.pj.project.tb_goods.TbGoods;
 import com.pj.project.tb_goods.TbGoodsService;
 import com.pj.project.tb_item.TbItem;
 import com.pj.project.tb_item_type.TbItemType;
+import com.pj.project.tb_mild_car.TbMildCar;
+import com.pj.project.tb_mild_car.TbMildCarService;
 import com.pj.project4sp.global.BusinessException;
 import com.pj.project4sp.uploadfile.UploadConfig;
 import com.pj.utils.AesUtil;
@@ -92,7 +94,8 @@ public class OpenService {
     private TbDeductionBindService tbDeductionBindService;
     @Resource
     private PartConfig partConfig;
-
+    @Resource
+    private TbMildCarService tbMildCarService;
 
     public ResultJson checkCarNumber(CheckCarNumberBO checkCarNumberBO) {
         String carNo = checkCarNumberBO.getCarNumber();
@@ -187,12 +190,14 @@ public class OpenService {
         }
         //判断是否蓝色车牌===免停车费
         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)) {
-                freeOut(tbBusinessCar, now, channel, image);
-                return ResultJson.success();
+            String freeColor = partConfig.getFreeColor();
+            if (tbBusinessCar.getColor().contains(freeColor)){
+               TbMildCar tbMildCar= tbMildCarService.findByCarNo(tbBusinessCar.getCarNo());
+               if (tbMildCar==null){
+                   log.error("请求返回【蓝牌未备案车辆,放行】:{},{}", carNo,ResultJson.success());
+                   freeOut(tbBusinessCar, now, channel, image);
+                   return ResultJson.success();
+               }
             }
         }
         //是否行政车辆=====
@@ -335,13 +340,13 @@ public class OpenService {
         if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getRealOutTime() == null && tbBusinessCar.getPayTime() != null) {
             inTime = tbBusinessCar.getPayTime();
         }
-        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now);
+        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now, tbBusinessCar.getCarSize());
         return price.doubleValue();
     }
 
     private void freeOut(TbBusinessCar tbBusinessCar, Date now, String outChannel, String base64Image) {
         if (StrUtil.equals(tbBusinessCar.getPayType(), TbBusinessCar.PayTypeEnum.NO_PAY_TYPE.getType())) {
-            BigDecimal partMoney = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now);
+            BigDecimal partMoney = tbBusinessService.calculationPartMoney(tbBusinessCar.getRealInTime(), now, tbBusinessCar.getCarSize());
             if (partMoney.doubleValue() <= 0) {
                 tbBusinessCar.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
             }
@@ -373,17 +378,18 @@ public class OpenService {
 
     @Async
     public void handlerInRecord(InRecordBO inRecordBO) {
-        List<TbCarNoColor> carNoColorList = tbCarNoColorService.getFreeColor();
-        String freeColors = carNoColorList.stream().map(TbCarNoColor::getCarNoColor).collect(Collectors.joining(","));
         String carNo = inRecordBO.getCarNumber().trim().toUpperCase();
         // 入场==>取车牌颜色
         List<TbBusinessCar> cars = tbBusinessCarService.findByCarNo(carNo);
         cars.stream().filter(obj -> StrUtil.isEmpty(obj.getColor()))
                 .forEach(tbBusinessCar -> {
                     String color = inRecordBO.getCarColor();
-                    String prefixColor = StrUtil.sub(color, 0, 1);
-                    if (StrUtil.contains(freeColors, prefixColor)) {
-                        tbBusinessCar.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
+                    //蓝牌 4.2米以及以下
+                    if (color.contains(partConfig.getFreeColor())) {
+                        TbMildCar tbMildCar = tbMildCarService.findByCarNo(carNo);
+                        if (tbMildCar == null) {
+                            tbBusinessCar.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType()).setPay(1);
+                        }
                     }
                     TbCar tbCar = tbCarService.findByCardNo(tbBusinessCar.getCarNo());
                     if (tbCar != null && !TbCar.CarTypeEnum.BUSINESS_CAR.getType().equals(tbCar.getCarType())) {

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

@@ -160,7 +160,7 @@ public class ApiService {
         if (tbBusinessCar.getPayTime() != null) {
             startTime = tbBusinessCar.getPayTime();
         }
-        BigDecimal price = tbBusinessService.calculationPartMoney(startTime, now);
+        BigDecimal price = tbBusinessService.calculationPartMoney(startTime, now,tbBusinessCar.getCarSize());
         Map<String, Object> car = new HashMap<>();
         car.put("id", tbBusinessCar.getId());
         car.put("carNo", tbBusinessCar.getCarNo());

+ 3 - 0
sp-server/src/main/java/com/pj/current/config/PartConfig.java

@@ -11,6 +11,7 @@ import java.math.BigDecimal;
 @ConfigurationProperties(prefix = "part-config")
 public class PartConfig {
     private Double freeCarLength;
+    private Double mildCarLength;
     private BigDecimal basePrice;
     /**
      * 4.2-9.6米车使用
@@ -21,5 +22,7 @@ public class PartConfig {
     private boolean testEnv;
     private long freeMinutes;
     private int minSeconds;
+    //免费车牌颜色
+    private String freeColor;
 
 }

+ 27 - 21
sp-server/src/main/java/com/pj/current/task/TokenTask.java

@@ -7,6 +7,7 @@ import cn.hutool.json.JSONUtil;
 import com.pj.current.config.WxConfig;
 import com.pj.utils.cache.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -18,27 +19,32 @@ public class TokenTask implements Runnable {
     WxConfig wxConfig;
 
     @Override
+    @Async
     public void run() {
-        String tokenKey = wxConfig.getAccessTokenKey();
-        String ticketKey = wxConfig.getJsApiTicketKey();
-        String tokenUrl = wxConfig.getAccessTokenUrl();
-        String resp = HttpUtil.get(tokenUrl);
-        JSONObject result = JSONUtil.parseObj(resp);
-        String accessToken = result.getStr("access_token");
-        log.info("获取公众号token返回:{}",JSONUtil.toJsonStr(result));
-        if (StrUtil.isEmpty(accessToken)) {
-            log.error("get access token fail:{}", resp);
-            return;
-        }
-        RedisUtil.set(tokenKey, accessToken);
-        String jsUrl = wxConfig.getJsApiTokenUrl().replaceAll("ACCESS_TOKEN", accessToken);
-        String jsResp = HttpUtil.get(jsUrl);
-        JSONObject jsResult = JSONUtil.parseObj(jsResp);
-        String ticket = jsResult.getStr("ticket");
-        if (StrUtil.isEmpty(ticket)) {
-            log.error("=======ticket=====fail======");
-            return;
-        }
-        RedisUtil.set(ticketKey, accessToken);
+       try {
+           String tokenKey = wxConfig.getAccessTokenKey();
+           String ticketKey = wxConfig.getJsApiTicketKey();
+           String tokenUrl = wxConfig.getAccessTokenUrl();
+           String resp = HttpUtil.get(tokenUrl);
+           JSONObject result = JSONUtil.parseObj(resp);
+           String accessToken = result.getStr("access_token");
+           log.info("获取公众号token返回:{}",JSONUtil.toJsonStr(result));
+           if (StrUtil.isEmpty(accessToken)) {
+               log.error("get access token fail:{}", resp);
+               return;
+           }
+           RedisUtil.set(tokenKey, accessToken);
+           String jsUrl = wxConfig.getJsApiTokenUrl().replaceAll("ACCESS_TOKEN", accessToken);
+           String jsResp = HttpUtil.get(jsUrl);
+           JSONObject jsResult = JSONUtil.parseObj(jsResp);
+           String ticket = jsResult.getStr("ticket");
+           if (StrUtil.isEmpty(ticket)) {
+               log.error("=======ticket=====fail======");
+               return;
+           }
+           RedisUtil.set(ticketKey, accessToken);
+       }catch (Exception e){
+
+       }
     }
 }

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_account/AutomaticPay.java

@@ -432,7 +432,7 @@ public class AutomaticPay {
         if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getRealOutTime() == null && tbBusinessCar.getPayTime() != null) {
             inTime = tbBusinessCar.getPayTime();
         }
-        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now);
+        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now,tbBusinessCar.getCarSize());
         tbBusinessCar.setMoney(price);
         return price;
     }

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

@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import com.pj.api.open.ResultJson;
 import com.pj.api.pushfee.oa.CallbackBO;
 import com.pj.api.wx.bo.MsgDataBO;
 import com.pj.api.wx.bo.PriceBO;
@@ -59,6 +60,8 @@ import com.pj.project.tb_item.TbItem;
 import com.pj.project.tb_item.TbItemService;
 import com.pj.project.tb_item_type.TbItemType;
 import com.pj.project.tb_item_type.TbItemTypeService;
+import com.pj.project.tb_mild_car.TbMildCar;
+import com.pj.project.tb_mild_car.TbMildCarService;
 import com.pj.project.tb_notices.TbNoticesService;
 import com.pj.project.tb_sort_group.TbSortGroup;
 import com.pj.project.tb_sort_group.TbSortGroupService;
@@ -159,6 +162,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     @Resource
     private TbFeeDetailsService tbFeeDetailsService;
 
+    @Resource
+    private TbMildCarService tbMildCarService;
+
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
 
@@ -469,7 +475,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     }
 
 
-    public BigDecimal calculationPartMoney(Date iTime, Date oTime) {
+    public BigDecimal calculationPartMoney(Date iTime, Date oTime,double carSize) {
         BigDecimal zero = new BigDecimal("0");
         if (iTime == null || oTime == null) {
             return zero;
@@ -482,6 +488,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         }
         long days = ChronoUnit.DAYS.between(inDayTime.toLocalDate(), outDayTime.toLocalDate());
         BigDecimal p = partConfig.getBasePrice();//乘积因子
+        //4.2~9.6
+        if (carSize<partConfig.getMildCarLength()&&carSize>=partConfig.getFreeCarLength()){
+            p=partConfig.getMildCarBasePrice();
+        }
         BigDecimal extraPrice = partConfig.getExtraPrice();
         int unit = (int) Math.ceil(NumberUtil.div(minutes, 24 * 60));
         if (minutes < partConfig.getFreeMinutes()) {
@@ -549,14 +559,15 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getPayTime() != null) {
                     inTime = tbBusinessCar.getPayTime();
                 }
-                partMoney = this.calculationPartMoney(inTime, now);
+                partMoney = this.calculationPartMoney(inTime, now,tbBusinessCar.getCarSize());
             }
             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)) {
-                    partMoney = new BigDecimal("0");
+                String freeColor = partConfig.getFreeColor();
+                if (tbBusinessCar.getColor().contains(freeColor)){
+                    TbMildCar tbMildCar= tbMildCarService.findByCarNo(tbBusinessCar.getCarNo());
+                    if (tbMildCar==null){
+                        partMoney = new BigDecimal("0");
+                    }
                 }
             }
 
@@ -705,7 +716,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             Date realInTime = tbBusinessCar.getRealInTime();
             Date realOutTime = tbBusinessCar.getRealOutTime();
             if (realInTime != null && realOutTime != null) {
-                BigDecimal price = calculationPartMoney(realInTime, realOutTime);
+                BigDecimal price = calculationPartMoney(realInTime, realOutTime,tbBusinessCar.getCarSize());
                 tbBusinessCar.setMoney(price);
             }
             tbBusinessCar.setPay(1).setPayTime(now)
@@ -787,6 +798,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         for (TbBusinessCar car : cars) {
             String carNo = car.getCarNo().trim().toUpperCase();
             String carType = car.getCarType();
+            if (car.getCarSize()==null||car.getCarSize()<=0) {
+                throw new AjaxError(carNo + "规格不正确");
+            }
             if (StrUtil.isEmpty(carType)) {
                 throw new BusinessException(carNo + "类型不能为空");
             }
@@ -817,7 +831,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 }
             }
             db.setPayType(TbBusinessCar.PayTypeEnum.NO_PAY_TYPE.getType());
-            if ((TbItem.ItemTypeEnum.EMPTY_TYPE.getType().equals(carType) && chinaCarPay == 0) || (TbItem.ItemTypeEnum.WEIGHT_TYPE.getType().equals(carType) && vietnamCarPay == 0)) {
+            if ((TbItem.ItemTypeEnum.EMPTY_TYPE.getType().equals(carType) && chinaCarPay == 0)
+                    || (TbItem.ItemTypeEnum.WEIGHT_TYPE.getType().equals(carType) && vietnamCarPay == 0)) {
                 db.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
             }
             TbCar tbCar = tbCarService.findByCardNo(carNo);
@@ -830,7 +845,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             db.setCarNo(carNo).setIsLock(0).setBusinessType(TbBusinessCar.BusinessTypeEnum.BUSINESS_CAR.getType());
             db.setCarSize(car.getCarSize()).setConfirmJudge(TbBusinessCar.ConfirmJudgeEnum.NO_JUDGE.getCode())//业务车都是未审核状态
                     .setTimeUpdate(now).setCarType(car.getCarType())
-                    .setNetWeight(car.getNetWeight())
+                    .setNetWeight(car.getNetWeight()).setColor(car.getColor())
                     .setCustomerId(customerId)
                     .setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
             tbBusinessCarService.saveOrUpdate(db);
@@ -1138,7 +1153,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             outTime = payTime;
         }
         //计算停车费
-        BigDecimal parkMoney = this.calculationPartMoney(inTime, outTime);
+        BigDecimal parkMoney = this.calculationPartMoney(inTime, outTime,tbBusinessCar.getCarSize());
         tbBusinessCar.setMoney(parkMoney);
     }
 

+ 28 - 5
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -9,6 +9,7 @@ import com.alibaba.excel.EasyExcel;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.current.config.PartConfig;
 import com.pj.current.config.SystemObject;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.project.relation_business_car.RelationBusinessCar;
@@ -24,6 +25,8 @@ import com.pj.project.tb_deduction_bind.TbDeductionBindService;
 import com.pj.project.tb_fee_details.TbFeeDetails;
 import com.pj.project.tb_fee_details.TbFeeDetailsService;
 import com.pj.project.tb_item.TbItem;
+import com.pj.project.tb_mild_car.TbMildCar;
+import com.pj.project.tb_mild_car.TbMildCarService;
 import com.pj.project4sp.global.BusinessException;
 import com.pj.project4sp.uploadfile.UploadConfig;
 import com.pj.utils.sg.AjaxError;
@@ -68,6 +71,8 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     @Resource
     private UploadConfig uploadConfig;
+    @Resource
+    private TbMildCarService tbMildCarService;
 
 
     @Resource
@@ -76,6 +81,8 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     @Resource
     @Lazy
     TbDeductionBindService tbDeductionBindService;
+    @Resource
+    private PartConfig partConfig;
 
 
     /**
@@ -187,6 +194,9 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         if (t.getRealInTime() == null) {
             throw new Exception("入场时间不能为空");
         }
+        if (StrUtil.isEmpty(t.getColor())) {
+            throw new Exception("车牌颜色不能为空");
+        }
         if (StrUtil.isEmpty(remark) && t.getRealInTime() != null) {
             throw new Exception("补录入场时间,备注必填");
         }
@@ -201,6 +211,12 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
                 .setBasePartMoney(new BigDecimal("0"))
                 .setTimeUpdate(new Date())
                 .setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
+        if (t.getColor().contains(partConfig.getFreeColor())) {
+            TbMildCar tbMildCar = tbMildCarService.findByCarNo(carNo);
+            if (tbMildCar == null) {
+                t.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType()).setPay(1);
+            }
+        }
         this.saveOrUpdate(t);
         // automaticPay.unbindRun(carNo);
     }
@@ -208,8 +224,8 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     public void updateCarRecord(TbBusinessCar t) throws Exception {
         String outRemark = t.getOutRemark();
         TbBusinessCar db = this.getById(t.getId());
-        if (db.getConfirmJudge()==TbBusinessCar.ConfirmJudgeEnum.JUDGE_PASS.getCode()){
-            throw new BusinessException("车辆【"+db.getCarNo()+"】已审核,请驳回再录入业务");
+        if (db.getConfirmJudge() == TbBusinessCar.ConfirmJudgeEnum.JUDGE_PASS.getCode()) {
+            throw new BusinessException("车辆【" + db.getCarNo() + "】已审核,请驳回再录入业务");
         }
         if (StrUtil.isEmpty(outRemark) && !Objects.equals(t.getRealOutTime(), db.getRealOutTime())) {
             throw new Exception("补录离场时间,出场确认说明必填");
@@ -217,6 +233,13 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         if (t.getRealInTime() == null && t.getRealOutTime() != null) {
             throw new Exception("补录离场时间,请填写入场时间");
         }
+        String carNo = t.getCarNo();
+        if (t.getColor().contains(partConfig.getFreeColor())) {
+            TbMildCar tbMildCar = tbMildCarService.findByCarNo(carNo);
+            if (tbMildCar == null) {
+                t.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType()).setPay(1);
+            }
+        }
         if (db.getRealOutTime() == null && t.getRealOutTime() != null) {
             //补录放行记录,解绑扣费绑定
             tbDeductionBindService.autoUnbindCar(db.getCarNo());
@@ -230,7 +253,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         }
         if (t.getRealInTime() != null && t.getRealOutTime() != null
                 && StrUtil.equals(db.getPayType(), TbBusinessCar.PayTypeEnum.NO_PAY_TYPE.getType())) {
-            BigDecimal money = tbBusinessService.calculationPartMoney(t.getRealInTime(), t.getRealOutTime());
+            BigDecimal money = tbBusinessService.calculationPartMoney(t.getRealInTime(), t.getRealOutTime(), t.getCarSize());
             t.setMoney(money);
             db.setMoney(money);
         }
@@ -451,9 +474,9 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         return list(ew);
     }
 
-    public List<TbBusinessCar>findByCarId(String carId){
+    public List<TbBusinessCar> findByCarId(String carId) {
         List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(carId);
-        List<TbBusinessCar>list=new ArrayList<>();
+        List<TbBusinessCar> list = new ArrayList<>();
         businessList.forEach(tbBusiness -> {
             List<TbBusinessCar> tbBusinessCars = this.findOtherBusinessCar(tbBusiness.getId());
             list.addAll(tbBusinessCars);

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

@@ -405,7 +405,7 @@ public class PayTask extends Task {
         if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getRealOutTime() == null && tbBusinessCar.getPayTime() != null) {
             inTime = tbBusinessCar.getPayTime();
         }
-        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now);
+        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now,tbBusinessCar.getCarSize());
         return price;
     }
 

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

@@ -255,6 +255,10 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             transactionIdStr = transactionIdStr.equals("") ? transactionId : transactionIdStr + "," + transactionId;
             outTradeNoStr = outTradeNoStr.equals("") ? outTradeNo : outTradeNoStr + "," + outTradeNo;
             BigDecimal baseNightPrice = partConfig.getBasePrice().add(partConfig.getExtraPrice());
+            //4.2~9.6
+            if (car.getCarSize()<partConfig.getMildCarLength()&&car.getCarSize()>=partConfig.getFreeCarLength()){
+                baseNightPrice = partConfig.getMildCarBasePrice().add(partConfig.getExtraPrice());
+            }
             BigDecimal[] qr = thisDayMoney.divideAndRemainder(baseNightPrice);//商和余数的数组,商为夜间停车次数,余数为白天停车费用。
             BigDecimal nightFeeNum = qr[0];
             if (nightFeeNum.compareTo(BigDecimal.valueOf(0)) > 0) {
@@ -1014,6 +1018,10 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             transactionIdStr = transactionIdStr.equals("") ? transactionId : transactionIdStr + "," + transactionId;
             outTradeNoStr = outTradeNoStr.equals("") ? outTradeNo : outTradeNoStr + "," + outTradeNo;
             BigDecimal baseNightPrice = partConfig.getBasePrice().add(partConfig.getExtraPrice());
+            //4.2~9.6
+            if (car.getCarSize()<partConfig.getMildCarLength()&&car.getCarSize()>=partConfig.getFreeCarLength()){
+                baseNightPrice = partConfig.getMildCarBasePrice().add(partConfig.getExtraPrice());
+            }
             BigDecimal[] qr = thisDayMoney.divideAndRemainder(baseNightPrice);//商和余数的数组,商为夜间停车次数,余数为白天停车费用。
             BigDecimal nightFeeNum = qr[0];
             if (nightFeeNum.compareTo(BigDecimal.valueOf(0)) > 0) {

+ 6 - 2
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java

@@ -152,7 +152,7 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
             if (price.compareTo(BigDecimal.valueOf(0)) != 0) {
                 totalPrice = totalPrice.add(price);
                 TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
-                Integer addNum = calcuAddNum(car.getMoney(), price);
+                Integer addNum = calcuAddNum(car.getMoney(), price,car.getCarSize());
                 totalNum += addNum;
             }
         }
@@ -175,8 +175,12 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
         this.saveOrUpdate(parkFee);
     }
 
-    public Integer calcuAddNum(BigDecimal money, BigDecimal p) {
+    public Integer calcuAddNum(BigDecimal money, BigDecimal p, Double carSize) {
         BigDecimal baseNightPrice = partConfig.getBasePrice().add(partConfig.getExtraPrice());
+        //4.2~9.6
+        if (carSize < partConfig.getMildCarLength() && carSize >= partConfig.getFreeCarLength()) {
+            baseNightPrice = partConfig.getMildCarBasePrice().add(partConfig.getExtraPrice());
+        }
         BigDecimal[] qrOld = money.divideAndRemainder(baseNightPrice);
         Integer oldNightNum = qrOld[0].intValue();
         if (qrOld[1].compareTo(BigDecimal.valueOf(0)) > 0) {

+ 12 - 0
sp-server/src/main/java/com/pj/project/tb_mild_car/TbMildCarService.java

@@ -10,6 +10,7 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.excel.EasyExcel;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.current.config.SystemObject;
@@ -89,4 +90,15 @@ public class TbMildCarService extends ServiceImpl<TbMildCarMapper, TbMildCar> im
 				.doWrite(() -> cars);
 		return SystemObject.config.getDomain() + uploadConfig.httpPrefix + flieTypeFolder + currDateFolder + "/" + fileName;
 	}
+
+	/**
+	 * 根据车牌查询
+	 * @param carNo
+	 * @return
+	 */
+	public TbMildCar findByCarNo(String carNo) {
+		QueryWrapper<TbMildCar>ew=new QueryWrapper<>();
+		ew.lambda().eq(TbMildCar::getCarNo,carNo);
+		return getOne(ew);
+	}
 }

+ 2 - 0
sp-server/src/main/java/com/pj/project/wx_send_msg/WxMsgTask.java

@@ -4,6 +4,7 @@ import cn.hutool.json.JSONUtil;
 import com.pj.api.wx.bo.MsgDataBO;
 import com.pj.api.wx.service.WxService;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -22,6 +23,7 @@ public class WxMsgTask {
      * 3分钟执行一次
      */
     @Scheduled(fixedRate = 600000)
+    @Async
     public void check() {
         List<WxSendMsg> list = wxSendMsgService.list();
         list.forEach(wxSendMsg -> {

+ 2 - 1
sp-server/src/main/java/com/pj/project4sp/apilog/Task.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 
 @Component
 @Slf4j
@@ -17,6 +18,6 @@ public class Task {
     public void cleanLog() {
         log.info("start clean api log");
         LocalDate today = LocalDate.now();
-        //spApilogMapper.cleanHistoryLog(today.minusDays(-2).toString());
+        spApilogMapper.cleanHistoryLog(today.minusDays(90).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
     }
 }

+ 2 - 0
sp-server/src/main/resources/application-dev.yml

@@ -58,6 +58,8 @@ part-config:
     test-env: true
     min-seconds: 5
     mild-car-base-price: 20
+    mild-car-length: 9.6
+    free-color: 蓝
 car:
     max-length: 20
     max-weight: 990000