Browse Source

手动缴费,搜索车牌bug

qzyReal 2 years ago
parent
commit
80fee8a539

+ 13 - 16
app/pages/wx/pay.vue

@@ -145,7 +145,7 @@
 			}
 		},
 		methods: {
-			showMsg(){
+			showMsg() {
 				this.$common.toast('请先完善相关业务录入');
 			},
 			businessChange(value) {
@@ -306,22 +306,19 @@
 				})
 			},
 			searchFn() {
-				if (!this.p.carNo) {
-					this.list = [];
-					this.cars = [];
-					this.carsSelect = [];
-					this.itemSelect = [];
-					this.businessSelect = []
-					this.item = {
-						itemsPrice: '',
-						businessId: '',
-						list: []
-					}
-				} else {
-					this.$api.searchPartCar(this.p).then(resp => {
-						this.list = resp.data;
-					})
+				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;
+				})
 			}
 
 		}

+ 2 - 2
app/utils/request.js

@@ -1,6 +1,6 @@
-// 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.bgigc.com/pro';
+// const server = 'https://dxkaa1.bgigc.com/pro';
 
 import common from '../common/js/common.js';
 

+ 5 - 0
sp-admin/sa-frame/menu-list.js

@@ -334,6 +334,11 @@ var menuList = [{
 						isShow: false
 					},
 					{
+						id: 'tb-flex-business-pay',
+						name: '手工缴费',
+						isShow: false
+					},
+					{
 						id: 'tb-flex-business-confirm',
 						name: '账单确认',
 						isShow: false

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

@@ -114,15 +114,17 @@
 										<sa-td width="120" name="支付状态" prop="payStatus" type="enum"
 											:jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
 										</sa-td>
-										<el-table-column prop="payTime" label="支付时间">
+										<el-table-column prop="payTime" label="支付时间" width="150">
 										</el-table-column>
-										<sa-td type="img-list" name="凭据" prop="ticket"></sa-td>
+										<el-table-column prop="remark" label="备注" width="150">
+										</el-table-column>
+										<!-- <sa-td type="img-list" name="凭据" prop="ticket"></sa-td>
 										<el-table-column label="其他凭据">
 											<template slot-scope="s">
 												<el-button class="c-btn" type="primary" @click="uploadFn(s.row)">上传
 												</el-button>
 											</template>
-										</el-table-column>
+										</el-table-column> -->
 									</el-table>
 								</el-collapse-item>
 							</el-collapse>

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

@@ -69,6 +69,11 @@
 							<el-button class="c-btn" type="primary" v-if="currentCustomerId=='1'||(s.row.adminConfirmInput==0&&sa.isAuth('tb-flex-business-edit'))"
 								@click="update(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>
 							<el-button class="c-btn" type="danger"
 								v-if="sa.isAuth('tb-flex-business-del')&&s.row.adminConfirmInput==0&&s.row.payMoney==0"
 								@click="del(s.row)">删除
@@ -141,6 +146,9 @@
 					}
 				},
 				methods: {
+					handlerPay(data){
+						sa.showIframe('人工收费', 'tb-car-disincle-pay.html?id=' + data.id, '1050px', '90%');
+					},
 					getCurrendCustomer() {
 						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
 							this.currentCustomerId = resp.data;

+ 152 - 0
sp-admin/sa-view/tb-business/tb-car-disincle-pay.html

@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>入境登记-详情</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<script src="../../static/sa.js"></script>
+		<script src="../../static/kj/upload-util.js"></script>
+		<style type="text/css">
+			.c-panel .c-label {
+				width: 8em;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box sbot" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<el-form v-if="m">
+						<el-row>
+							<div>
+								<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.operateTime}}</sa-info>
+									</el-col>
+									<el-col span="12">
+										<sa-info type="enum" name="支付状态" :value="m.payStatus"
+											:jv="{1: '未支付', 2: '已支付未确认', 3: '已支付已确认'}" br></sa-info>
+										<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
+
+										<sa-info name="业务费用" br>{{m.itemPrice}}(元)</sa-info>
+									</el-col>
+								</el-row>
+								<el-row v-for="(item,index) in tableData">
+									<el-col span="12">
+										<sa-info name="业务分类" br>{{item.itemTypeName}}</sa-info>
+									</el-col>
+									<el-col span="12">
+										<sa-info name="业务明细" br>{{item.itemName}}</sa-info>
+									</el-col>
+								</el-row>
+								<el-row v-for="(item,index) in m.cars">
+									<el-col span="12">
+										<sa-info name="车牌号" br>{{item.carNo}}</sa-info>
+										<div class="c-item">
+											<label class="c-label">入场时间:</label>
+											<el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
+												v-model="item.realInTime"></el-date-picker>
+										</div>
+										<div class="c-item">
+											<label class="c-label">离场时间:</label>
+											<el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
+												v-model="item.realOutTime"></el-date-picker>
+										</div>
+									</el-col>
+									<el-col span="12">
+										<sa-info name="车牌颜色" br>{{item.color}}</sa-info>
+										<sa-item name="入场通道" placeholder="请输入入场通道" v-model="item.inChannel" br>
+										</sa-item>
+										<sa-item name="离场通道" placeholder="请输入离场通道" v-model="item.outChannel" br>
+										</sa-item>
+									</el-col>
+								</el-row>
+								<el-row>
+									<el-col span="14" style="margin-left: 60px;">
+										<label class="c-label">备注:</label>
+										<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="m.remark">
+										</el-input>
+									</el-col>
+								</el-row>
+							</div>
+						</el-row>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<!-- <el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印单据</el-button> -->
+				<el-button type="success" @click="confirmFn">确认线下收费</el-button>
+			</div>
+
+
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue'),
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取数据ID 
+					m: null,
+					tableData: [],
+					upload: {
+						visible: false,
+						form: {
+							id: '',
+							ticket: ''
+						}
+					}
+				},
+				methods: {
+					confirmFn() {
+						let m=this.m;
+						let car=m.cars[0];
+						let obj={
+							id:m.id,
+							inChannel:car.inChannel,
+							outChannel:car.outChannel,
+							realInTime:car.realInTime,
+							realOutTime:car.realOutTime,
+							remark:m.remark
+						}
+						sa.confirm('是否确认该业务已线下收费?', function() {
+							sa.ajax('/TbBusiness/manualConfirm',obj, function(res) {
+								parent.app.f5(); // 刷新父页面列表
+								sa.closeCurrIframe(); // 关闭本页 
+								}.bind(this))
+						}.bind(this));
+					},
+					getInfo() {
+						sa.ajax('/TbBusiness/getById?id=' + this.id, function(res) {
+							let data=res.data;
+							data.remark='线下收费'
+							this.m=data;
+							this.tableData = res.data.items;
+						}.bind(this))
+					}
+				},
+				mounted: function() {
+					this.getInfo()
+				}
+			})
+		</script>
+	</body>
+</html>

+ 1 - 1
sp-admin/static/sa.js

@@ -22,7 +22,7 @@ var sa = {
 		api_url: 'https://dxkaa1.bgigc.com/pro',
 		web_url: 'http://www.baidu.com'
 	}
-	sa.cfg = cfg_test; // 最终环境 , 上线前请选择正确的环境
+	sa.cfg = cfg_dev; // 最终环境 , 上线前请选择正确的环境
 })();
 
 

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-26532
+4976

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

@@ -165,7 +165,7 @@ public class OpenService {
         }
         String carNoStr = carNo.substring(0, 1);
         Date inTime = tbBusinessCar.getRealInTime();
-        if (tbBusinessCar.getPay() == 1&&tbBusinessCar.getRealOutTime()==null) {
+        if (tbBusinessCar.getPay() == 1&&tbBusinessCar.getRealOutTime()==null&&tbBusinessCar.getPayTime()!=null) {
             inTime = tbBusinessCar.getPayTime();
         }
         BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now);

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

@@ -144,6 +144,9 @@ public class ApiService {
     }
 
     public Set<TbBusinessCar> searchPartCar(String carNo) {
+        if (StrUtil.isEmpty(carNo) || StrUtil.length(carNo) < 3) {
+            return new HashSet<>();
+        }
         List<TbBusinessCar> list = tbBusinessCarService.searchPartCar(carNo);
         list = list.stream().filter(tbBusinessCar -> {
             String businessId = tbBusinessCar.getBusinessId();

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

@@ -257,12 +257,11 @@ public class WxService {
                         String carNo = tbBusinessCar.getCarNo();
                         String carNoStr = StrUtil.sub(carNo, 0, 1);
                         if (!CAR_LIST.contains(carNoStr)) {
-                            tbBusinessCar.setPay(1);
+                            tbBusinessCar.setPay(1).setPayTime(new Date());
                             tbBusinessCarService.updateById(tbBusinessCar);
                         }
                     });
                 }
-                log.error("items size:{},{}", items.size(), JSONUtil.toJsonStr(items));
                 tbFeeStatisticsService.countBusinessFee(items, transactionId, outTradeNo);//业务费日统计
                 items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setPayTime(now));
                 tbBusinessItemService.updateBatchById(items);

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

@@ -46,6 +46,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     public static final String PERMISSION_CONFIRM = "tb-business-confirm";
     public static final String PERMISSION_PAY = "tb-business-pay";
     public static final String PERMISSION_INPUT = "tb-business-add";
+    public static final String PERMISSION_MANUAL_PAY = "tb-flex-business-pay";
 
 
 

+ 13 - 0
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java

@@ -323,6 +323,19 @@ public class TbBusinessController {
         tbBusinessService.deleteOtherBusiness(id);
         return AjaxJson.getSuccess();
     }
+    @RequestMapping("manualConfirm")
+    @SaCheckPermission(TbBusiness.PERMISSION_MANUAL_PAY)
+    public AjaxJson manualConfirm() {
+        SoMap so = SoMap.getRequestSoMap();
+       String id= so.getString("id");
+      String remark=  so.getString("remark");
+        String inChannel=   so.getString("inChannel");
+        String outChannel=    so.getString("outChannel");
+        Date realInTime=    so.getDateTime("realInTime");
+        Date realOutTime=    so.getDateTime("realOutTime");
+        tbBusinessService.manualConfirmPay(id,inChannel,realInTime,outChannel,realOutTime,remark);
+        return AjaxJson.getSuccess();
+    }
 
 
 

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

@@ -582,7 +582,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         if (TbBusiness.BusinessType.CAR_DISINCLE.getCode().equals(businessType) && StrUtil.isNotEmpty(itemTypeId)) {
             TbBusinessSort tbBusinessSort = tbBusinessSortService.findByItemTypeId(itemTypeId);
             TbSortGroup sortGroup = tbSortGroupService.getById(tbBusinessSort.getGroupId());
-            if (sortGroup.getCompletePay().equals(1)&&sortGroup.getStatus().equals(1)) {
+            if (sortGroup.getCompletePay().equals(1) && sortGroup.getStatus().equals(1)) {
                 List<TbBusinessSort> sorts = tbBusinessSortService.findByGroupId(sortGroup.getId());
                 if (sorts.size() > items.size()) {
                     result.put("showPay", false);
@@ -644,4 +644,26 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     public int checkCarBusinessType(String typeId, String carNo, String timeStart, String timeEnd, String businessId) {
         return tbBusinessMapper.checkCarBusinessTypeByTime(typeId, carNo, timeStart, timeEnd, businessId);
     }
+
+    public void manualConfirmPay(String id, String inChannel, Date realInTime, String outChannel, Date realOutTime, String remark) {
+        TbBusiness db = this.getById(id);
+        if (db==null){
+            throw new BusinessException("业务不存在");
+        }
+        db.setPayStatus(3).setPayMoney(db.getItemPrice());
+        this.updateById(db);
+       TbBusinessCar tbBusinessCar= tbBusinessCarService.getById(db.getBusinessCarId());
+       if (realInTime!=null&&realOutTime!=null){
+         BigDecimal price=  calculationPartMoney(realInTime,realOutTime);
+         tbBusinessCar.setMoney(price).setPay(1);
+       }
+        tbBusinessCar.setInChannel(inChannel)
+                .setOutChannel(outChannel)
+                .setRealOutTime(realOutTime)
+                .setRealInTime(realInTime);
+        tbBusinessCarService.updateById(tbBusinessCar);
+        List<TbBusinessItem>items=tbBusinessItemService.findByBusinessId(id);
+        items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setRemark(StrUtil.isEmpty(remark)?"手动确认":remark));
+        tbBusinessItemService.updateBatchById(items);
+    }
 }

+ 1 - 4
sp-server/src/main/java/com/pj/project4sp/role4permission/SpRolePermissionService.java

@@ -23,10 +23,7 @@ public class SpRolePermissionService {
 	SpRolePermissionMapper spRolePermissionMapper;
 	
 	
-	/**
-	 * 获取指定角色的所有权限码 【增加缓存】
-	 */
-    @Cacheable(value="api_pcode_list", key="#roleIds")
+
     public List<String> getPcodeByRid(String roleIds){
     	return spRolePermissionMapper.getPcodeByRoleId(StrUtil.splitTrim(roleIds,","));
     }