Browse Source

车辆管理+订单描述

qzyReal 2 years ago
parent
commit
ab9ee5a3e2

+ 1 - 0
app/pages/wx/account-pay.vue

@@ -158,6 +158,7 @@
 					tradeType: "JSAPI",
 					openid: this.openid
 				}
+				p.desc="A1-账户充值";
 				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;
 					let that = this;

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

@@ -189,6 +189,7 @@
 					tradeType: "JSAPI",
 					openid: this.openid
 				}
+				p.desc=p.b?'A1-业务费用':'A1-停车费';
 				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;
 					console.log(data);

+ 1 - 0
app/pages/wx/payOrder.vue

@@ -176,6 +176,7 @@
 					tradeType: "JSAPI",
 					openid: this.wx.openid
 				}
+				p.desc="A1-业务费用"
 				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
 					let data = resp.data;
 					let that = this;

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

@@ -32,6 +32,7 @@
 								<sa-info name="入场时间" br>{{m.realInTime}}</sa-info>
 								<sa-info name="离场时间" br>{{m.realOutTime}}</sa-info>
 								<sa-info name="停车费" br>{{m.money}}元</sa-info>
+									<sa-info type="img" name="入场图片" :value="m.inImage" br></sa-info>
 							</el-col>
 							<el-col span=12>
 								<sa-info name="联系人" br>{{m.driverName}}</sa-info>
@@ -40,6 +41,7 @@
 									<label v-if="m.isLock==1">锁定</label>
 									<label v-else>正常</label>
 								</sa-info>
+									<sa-info type="img" name="离场图片" :value="m.outImage" br></sa-info>
 							</el-col>
 						</el-row>
 					</el-form>

+ 1 - 1
sp-admin/sa-view/tb-car/tb-car-edit.html

@@ -83,7 +83,7 @@
 			</div>
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
-				<el-button type="primary" @click="ok()" v-if="sa.isAuth('tb-car-add')">确定</el-button>
+				<el-button type="primary" @click="ok()" v-if="sa.isAuth('tb-car-edit')">确定</el-button>
 				<el-button @click="sa.closeCurrIframe()">取消</el-button>
 			</div>
 		</div>

+ 17 - 8
sp-admin/sa-view/tb-car/tb-car-list.html

@@ -34,6 +34,7 @@
 						</el-select>
 					</div>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
 				<el-button type="primary" icon="el-icon-plus" @click="add()" v-if="sa.isAuth('tb-car-add')">新增
@@ -45,7 +46,7 @@
 				<!--				<el-button type="success" icon="el-icon-view" @click="getBySelect()">查看</el-button>-->
 				<el-button type="danger" icon="el-icon-delete" @click="deleteByIds()" v-if="sa.isAuth('tb-car-del')">删除
 				</el-button>
-				<el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
+				
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 10px;">
 					<sa-td type="selection"></sa-td>
@@ -71,7 +72,7 @@
 			</div>
 			<el-dialog title="批量导入任务" :visible="modal.visible" width="300px">
 				<div style="text-align: center;">
-					<el-upload class="upload-demo" accept=".xlsx,.xls" :before-upload="beforeUpload"
+					<el-upload class="upload-demo" :headers="header" accept=".xlsx,.xls" :before-upload="beforeUpload"
 						:on-success="successFn" :on-error="errorFn" :action="sa.cfg.api_url+'/TbCar/importExcel'">
 						<i class="el-icon-upload"></i>
 						<div class="el-upload__text">选择excel文档</em></div>
@@ -98,6 +99,9 @@
 						pageSize: 10, // 页大小 
 						sortType: 0 // 排序方式 
 					},
+					header: {
+						'satoken': localStorage.tokenValue
+					},
 					dataCount: 0,
 					dataList: [], // 数据集合 
 					modal: {
@@ -107,8 +111,8 @@
 					}
 				},
 				methods: {
-					importTemplate(){
-						window.location.href='../../static/excel/批量导入车辆.xlsx';
+					importTemplate() {
+						window.location.href = '../../static/excel/批量导入车辆.xlsx';
 					},
 					importFn() {
 						Object.assign(this.modal, {
@@ -120,10 +124,15 @@
 						sa.loading('正在上传..')
 					},
 					successFn(res) {
-							sa.hideLoading();
-						if(res.code==200){
-							sa.alert('导入成功')	
-						}else{
+						sa.hideLoading();
+						if (res.code == 200) {
+							sa.alert('导入成功')
+							setTimeout(() => {
+								this.modal.visible = false;
+								this.f5();
+							}, 1000)
+
+						} else {
 							sa.error(res.msg);
 						}
 					},

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-16728
+32340

+ 10 - 7
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -16,6 +16,7 @@ import com.pj.api.wx.WxUtils;
 import com.pj.api.wx.bo.*;
 import com.pj.api.wx.vo.PrePayVO;
 import com.pj.current.config.MyConfig;
+import com.pj.current.config.PartConfig;
 import com.pj.current.config.WxConfig;
 import com.pj.project.tb_account.TbAccountService;
 import com.pj.project.tb_business.TbBusiness;
@@ -57,6 +58,8 @@ public class WxService {
     WxConfig wxConfig;
     @Resource
     MyConfig myConfig;
+    @Resource
+    PartConfig partConfig;
 
     @Resource
     WxUtils wxUtils;
@@ -83,6 +86,7 @@ public class WxService {
         String tradeType = request.getParameter("tradeType");
         String money = request.getParameter("money");
         String openid = request.getParameter("openid");
+        String desc = request.getParameter("desc");
 //        String openid = "oDWvn5w-hVkzUuKeY7OBXBV_l1rU";
         String businessId = request.getParameter("b");
         String c = request.getParameter("c");
@@ -95,11 +99,10 @@ public class WxService {
         params.put("mch_id", wxConfig.getMachId());
         params.put("openid", openid);
         params.put("nonce_str", RandomUtil.randomString(32));
-        params.put("body", "支付中心-业务订单支付");
+        params.put("body", desc);
         params.put("out_trade_no", out_trade_no);
         params.put("attach", JSONUtil.toJsonStr(atchMap));
-        String total_free = NumberUtil.mul(money, 100 + "").intValue() + "";
-//        String total_free = "1";
+        String total_free = partConfig.isTestEnv() ? "1" : NumberUtil.mul(money, 100 + "").intValue() + "";
         log.info("pay free:{}", total_free);
         params.put("total_fee", total_free);
 //        params.put("total_fee", "1");
@@ -132,7 +135,6 @@ public class WxService {
     }
 
 
-
     public Map<String, String> getPayParams(String openid, String prePayId) {
         Map<String, String> signMap = new HashMap<>(10);
         signMap.put("appId", wxConfig.getAppId());
@@ -145,7 +147,8 @@ public class WxService {
         signMap.put("openId", openid);
         return signMap;
     }
-    public Map<String, String> getPayP(String timeStamp,String nonceStr,String openid, String pack) {
+
+    public Map<String, String> getPayP(String timeStamp, String nonceStr, String openid, String pack) {
         Map<String, String> signMap = new HashMap<>(10);
         signMap.put("appId", wxConfig.getAppId());
         signMap.put("timeStamp", timeStamp);
@@ -203,7 +206,7 @@ public class WxService {
                 car.setPay(1).setMoney(car.getMoney().add(price));
                 tbBusinessCarService.updateById(car);
                 TbBusiness business = tbBusinessService.getById(car.getBusinessId());
-                if (business!=null){
+                if (business != null) {
                     business.setPayMoney(business.getPayMoney().add(price));
                     business.setPayStatus(business.getPayMoney().equals(business.getTotalMoney()) ? 3 : 4);
                     tbBusinessService.updateById(business);
@@ -228,7 +231,7 @@ public class WxService {
                         .setOutTradeNo(tradeNo)
                         .setTransactionId(transactionId)
                         .setPayMoney(money);
-                if (tbCostomer!=null){
+                if (tbCostomer != null) {
                     payRecord.setCustomerId(tbCostomer.getId()).setCustomerName(tbCostomer.getName());
                 }
                 tbPayRecordService.save(payRecord);

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

@@ -16,6 +16,7 @@ public class PartConfig {
     private BigDecimal extraPrice;
     private BigDecimal taxRate;
     private String  nightEnd;
+    private boolean  testEnv;
     private long freeMinutes;
 
 }

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

@@ -54,6 +54,7 @@ part-config:
     free-minutes: 30
     free-car-length: 4.2
     tax-rate: 0.09
+    test-env: true
 car:
     max-length: 20
     max-weight: 50