Browse Source

线下收费

qzyReal 2 years ago
parent
commit
005cc1fc03
32 changed files with 980 additions and 908 deletions
  1. 20 7
      sp-admin/sa-frame/menu-list-sp.js
  2. 1 1
      sp-admin/sa-view/tb-account/tb-account-add.html
  3. 5 28
      sp-admin/sa-view/tb-account/tb-account-list.html
  4. 0 7
      sp-admin/sa-view/tb-business/tb-car-disincle-info.html
  5. 208 147
      sp-admin/sa-view/tb-business/tb-car-disincle-pay.html
  6. 1 1
      sp-admin/sa-view/tb-deduction-record/tb-deduction-record-list.html
  7. 5 2
      sp-admin/sa-view/tb-fee-statistics/dayStatsPrint.html
  8. 99 0
      sp-admin/sa-view/tb-fee-statistics/tb-fee-details-info.html
  9. 7 13
      sp-admin/sa-view/tb-fee-statistics/tb-fee-details-list.html
  10. 333 327
      sp-admin/sa-view/tb-fee-statistics/tb-fee-statistics-list.html
  11. 4 1
      sp-admin/sa-view/tb-partner/tb-business-item-list.html
  12. 4 0
      sp-server/src/main/java/com/pj/api/wx/bo/PriceBO.java
  13. 2 2
      sp-server/src/main/java/com/pj/api/wx/service/WxService.java
  14. 35 39
      sp-server/src/main/java/com/pj/project/tb_account/AutomaticPay.java
  15. 16 15
      sp-server/src/main/java/com/pj/project/tb_account/TbAccountService.java
  16. 22 2
      sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java
  17. 9 2
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java
  18. 102 35
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java
  19. 4 2
      sp-server/src/main/java/com/pj/project/tb_business_item/PayTask.java
  20. 2 0
      sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemMapper.xml
  21. 0 9
      sp-server/src/main/java/com/pj/project/tb_charge_record/TbChargeRecord.java
  22. 0 17
      sp-server/src/main/java/com/pj/project/tb_charge_record/TbChargeRecordController.java
  23. 27 9
      sp-server/src/main/java/com/pj/project/tb_charge_record/TbChargeRecordService.java
  24. 6 0
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetails.java
  25. 6 1
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsController.java
  26. 26 123
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java
  27. 3 0
      sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatistics.java
  28. 10 15
      sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsController.java
  29. 12 103
      sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java
  30. 4 0
      sp-server/src/main/java/com/pj/project/tb_fee_statistics/dto/ExportDayStatsDTO.java
  31. 3 0
      sp-server/src/main/java/com/pj/project/tb_goods/TbGoods.java
  32. 4 0
      sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeService.java

+ 20 - 7
sp-admin/sa-frame/menu-list-sp.js

@@ -29,6 +29,7 @@ window.menuList.unshift({
 		id: 'console',
 		name: '监控中心',
 		icon: 'el-icon-view',
+		parent:true,
 		info: '对本系统的各种监控',
 		childList: [{
 				id: 'sql-console',
@@ -48,17 +49,13 @@ window.menuList.unshift({
 				url: 'sa-view-sp/sp-apilog/api-log-list.html',
 				info: '记录本系统所有的api请求'
 			},
-			{
-				id: 'form-generator',
-				name: '在线表单构建',
-				url: 'https://mrhj.gitee.io/form-generator/#/'
-			},
 		]
 	},
 
 	{
 		id: 'sp-cfg',
 		name: '系统配置',
+			parent:true,
 		icon: 'el-icon-setting',
 		info: '有关系统的一些配置',
 		childList: [{
@@ -767,7 +764,18 @@ window.menuList.unshift({
 				id: 'tb-fee-details-list',
 				name: '收费明细',
 				url: 'sa-view/tb-fee-statistics/tb-fee-details-list.html',
-				childList: [{
+				childList: [
+					{
+						id: 'tb-statistics-print',
+						name: '打印',
+						isShow: false
+					},
+					{
+						id: 'tb-statistics-export',
+						name: '导出',
+						isShow: false
+					},
+					{
 						id: 'tb-kaidan-confirm',
 						name: '开单确认',
 						isShow: false
@@ -793,7 +801,12 @@ window.menuList.unshift({
 			{
 				id: 'tb-fee-statistics-list',
 				name: '日统计',
-				url: 'sa-view/tb-fee-statistics/tb-fee-statistics-list.html'
+				url: 'sa-view/tb-fee-statistics/tb-fee-statistics-list.html',
+				childList:[{
+					id: 'tb-fee-statistics-judge',
+					name: '审核',
+					isShow: false
+				}]
 			},
 			{
 				id: 'month-statistcs-list',

+ 1 - 1
sp-admin/sa-view/tb-account/tb-account-add.html

@@ -110,7 +110,7 @@
 						let m = {
 							...this.m
 						};
-						sa.checkNull(m.preTopupMoney, '预存金额不能为空!');
+						sa.checkNull(m.preTopupMoney, '充值金额不能为空!');
 						if (!this.computeChange()) {
 							return;
 						}

+ 5 - 28
sp-admin/sa-view/tb-account/tb-account-list.html

@@ -43,12 +43,12 @@
             <sa-td name="银行账户" prop="bankAccount"></sa-td>
             <sa-td name="地址" prop="address"></sa-td>
             <sa-td name="余额(元)" prop="totalMoney"></sa-td>
-           <el-table-column label="操作" fixed="right" width="240px">
+           <el-table-column label="操作" fixed="right" width="140px">
               <template slot-scope="s">
                   <el-button class="c-btn" type="success" icon="el-icon-view" 
                              @click="add(s.row)" v-if="sa.isAuth('tb-account-list-add')">充值</el-button>
-                  <el-button class="c-btn" type="primary" icon="el-icon-edit" v-if="sa.isAuth('tb-account-list-update')"
-                             @click="update(s.row)">修改</el-button>
+                  <!-- <el-button class="c-btn" type="primary" icon="el-icon-edit" v-if="sa.isAuth('tb-account-list-update')"
+                             @click="update(s.row)">修改</el-button> -->
               </template>
            </el-table-column>
         </el-table>
@@ -107,39 +107,16 @@
                     sa.f5TableHeight();		// 刷新表格高度
                 }.bind(this));
             },
-            // 查看
-            // get: function (data) {
-            //     sa.showIframe('数据详情', 'tb-account-info.html?id=' + data.id, '1050px', '90%');
-            // },
-            // 查看 - 根据选中的
-            // getBySelect: function (data) {
-            //     var selection = this.$refs['data-table'].selection;
-            //     if (selection.length == 0) {
-            //         return sa.msg('请选择一条数据')
-            //     }
-            //     this.get(selection[0]);
-            // },
-            // 修改
+           
             update: function (data) {
                 sa.showIframe('修改数据', 'tb-account-update.html?customerId=' + data.customerId +
                     '&id='+data.id, '1000px', '90%');
             },
             // 新增
             add: function (data) {
-                sa.showIframe('新增数据', 'tb-account-add.html?customerId=' + data.customerId +
+                sa.showIframe('充值账户', 'tb-account-add.html?customerId=' + data.customerId +
                     '&id='+data.id, '700px', '70%');
             },
-            // 删除
-            // del: function (data) {
-            //     sa.confirm('是否删除,此操作不可撤销', function () {
-            //         sa.ajax('/TbAccount/delete?id=' + data.id, function (res) {
-            //             sa.arrayDelete(this.dataList, data);
-            //             sa.ok('删除成功');
-            //             sa.f5TableHeight();		// 刷新表格高度
-            //         }.bind(this))
-            //     }.bind(this));
-            // },
-
             encrypt(word, keyStr) { // word, keyStr第一个参数是加密的字段名字  第二个是key值(16位)
                 if(!word){
                     return;

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

@@ -132,13 +132,6 @@
 										</el-table-column>
 										<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>
 								</el-collapse-item>
 							</el-collapse>

+ 208 - 147
sp-admin/sa-view/tb-business/tb-car-disincle-pay.html

@@ -1,152 +1,213 @@
 <!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.goodsName}}</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.payTime}}</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-divider content-position="left"><label
-                                    style="font-weight: bold;">收费项:{{item.itemTypeName}}</label></el-divider>
-                            <el-col span="12">
-                                <sa-info name="收费明细" br>{{item.itemName}}</sa-info>
-                            </el-col>
-                            <el-col span="12">
-                                <sa-info name="计价" br>{{item.itemPrice}}/{{item.unit}}</sa-info>
-                            </el-col>
-                        </el-row>
-                        <el-row v-for="(item,index) in m.cars">
-                            <el-divider content-position="left"><label
-                                    style="font-weight: bold;">车牌号:{{item.carNo}}</label></el-divider>
-                            <el-col span="12">
-                                <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-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>
+	<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><span style="font-weight: bold;">{{m.goodsName}}</span>
+										</sa-info>
+										</sa-info>
+										<sa-info name="业务编号" br>{{m.no}}</sa-info>
+										<sa-info name="客户名称" br>
+											<span v-if="m.customerName">{{m.customerName}}</span>
+											<span>-</span>
+										</sa-info>
+									</el-col>
+									<el-col span="12">
+										<sa-info name="作业时间" br>{{m.operateTime}}</sa-info>
+										<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
+										<sa-info name="业务费用" br>{{m.itemPrice}}(元)</sa-info>
+									</el-col>
+								</el-row>
+								<el-row>
+									
+									<el-col span="12">
+										<div class="c-item">
+											<label class="c-label"><span style="color: red;">*</span>收费方式:</label>
+											<el-select v-model="m.payType">
+											  <el-option label="现场收费" :value="1"></el-option>
+											    <el-option label="扣预存款" :value="5"></el-option>
+											</el-select>
+										</div>
+										<div class="c-item">
+											<label class="c-label"><span style="color: red;">*</span>收费时间:</label>
+											<el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
+												v-model="m.payTime"></el-date-picker>
+										</div>
+										<div class="c-item">
+											<label class="c-label">备注:</label>
+											<el-input   placeholder="请输入内容" v-model="m.remark">
+											</el-input>
+										</div>
+									</el-col>
+									<el-col span="12">
+									<div class="c-item">
+										<label class="c-label"><span style="color: red;">*</span>收费种类:</label>
+										<el-select v-model="m.payChannelType">
+										  <el-option label="微信系统收款" :value="1"></el-option>
+										    <el-option label="微信门店收款" :value="2"></el-option>
+										</el-select>
+									</div>
+									<div class="c-item">
+										<label class="c-label"><span style="color: red;" v-if="m.payType==1">*</span>微信支付号:</label>
+										<el-input   placeholder="微信支付号" v-model="m.transactionId">
+										</el-input>
+									</div>
+									</el-col>
+								</el-row>
 
+								<el-row v-for="(item,index) in m.cars">
+									<el-divider content-position="left"><label
+											style="font-weight: bold;">车牌号:{{item.carNo}}</label></el-divider>
+									<el-col span="12">
+										<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-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>
 
-</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 cars = m.cars;
-                let obj = {
-                    id: m.id,
-                    cars: JSON.stringify(cars),
-                    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/getOtherBusinessById?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>
+								<el-row style="margin-top: 10px;">
+									<el-collapse value='1'>
+										<el-collapse-item name="1">
+											<div slot="title">
+												具体业务项
+												<label
+													style="color: red; font-weight: bold;margin-left: 20px;">合计:({{m.itemPrice}}元)</label>
+											</div>
+											<el-table :data="tableData" style="width: 100%">
+												<el-table-column prop="itemTypeName" label="收费项" width="180">
+												</el-table-column>
+												<el-table-column prop="itemName" label="收费明细" width="180">
+												</el-table-column>
+												<el-table-column prop="itemPrice" label="单价">
+												</el-table-column>
+												<el-table-column prop="unit" label="计费标准">
+												</el-table-column>
+												<el-table-column prop="num" label="数量">
+												</el-table-column>
+												<el-table-column prop="total" label="合计">
+												</el-table-column>
+											</el-table>
+										</el-collapse-item>
+									</el-collapse>
+								</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: {
+						payType:1
+					},
+					tableData: [],
+					upload: {
+						visible: false,
+						form: {
+							id: '',
+							ticket: ''
+						}
+					}
+				},
+				methods: {
+					confirmFn() {
+						let m = this.m;
+						if(!m.payTime){
+							sa.error('收费时间必填')
+							return;
+						}
+						if(m.payType==1&&!m.transactionId){
+							sa.error('线下收费支付微信号必填')
+							return;
+						}
+						let cars = m.cars;
+						let obj = {
+							id: m.id,
+							cars: JSON.stringify(cars),
+							remark: m.remark,
+							payType:m.payType,
+							payChannelType:m.payChannelType,
+							payTime:m.payTime,
+							transactionId:m.transactionId
+						}
+						sa.confirm('是否确认该业务已线下收费?', function() {
+							sa.ajax('/TbBusiness/manualConfirm', obj, function(res) {
+								parent.app.f5(); // 刷新父页面列表
+								sa.closeCurrIframe(); // 关闭本页
+							}.bind(this))
+						}.bind(this));
+					},
+					getInfo() {
+						sa.ajax('/TbBusiness/getOtherBusinessById?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/sa-view/tb-deduction-record/tb-deduction-record-list.html

@@ -78,7 +78,7 @@
 					<sa-td name="业务单号" prop="businessNo" width="150"></sa-td>
 					<sa-td name="车牌号" prop="carNo" width="100"></sa-td>
 					<sa-td name="收费项目" prop="feeType" type="enum"
-						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
+						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车业务', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 					<sa-td name="业务类型id" prop="itemTypeId" v-if="false"></sa-td>
 					<sa-td name="业务类型" prop="itemTypeName" width="150"></sa-td>
 <!--					<sa-td name="业务项" prop="itemName" ></sa-td>-->

+ 5 - 2
sp-admin/sa-view/tb-fee-statistics/dayStatsPrint.html

@@ -43,7 +43,7 @@
                         <td id="company" style="border:solid #000 1px;text-align: left;" colspan="3">单位:广西东兴北投口岸投资有限公司
                         </td>
                         <td id="unit" style="border:solid #000 1px;text-align: center;" colspan="7">金额单位:元</td>
-                        <td id="td_time" style="border:solid #000 1px;text-align: right;" colspan="4">
+                        <td id="td_time" style="border:solid #000 1px;text-align: right;" colspan="6">
                             <div id="time" align="right"></div>
                         </td>
                     </tr>
@@ -59,6 +59,7 @@
                         <td id="person1" style="border:solid #000 1px; " rowspan="2">开单员</td>
                         <td id="person2" style="border:solid #000 1px; " rowspan="2">复核员</td>
                         <td id="person3" style="border:solid #000 1px; " rowspan="2">统计稽查员</td>
+						 <td id="person3" style="border:solid #000 1px; " rowspan="2">审核员</td>
                     </tr>
                     <tr height="80">
                         <td style="border:solid #000 1px; ">微信</td>
@@ -188,7 +189,9 @@
                         html.push(
                             "</td><td style=\"border:solid #000 1px; \">" + list[i]['kaiDanPerson'] +
                             "</td><td style=\"border:solid #000 1px; \">" + list[i]['diaoDuPerson'] +
-                            "</td><td style=\"border:solid #000 1px; \">" + list[i]['jiChaPerson'] + "</td></tr>"
+                            "</td><td style=\"border:solid #000 1px; \">" + list[i]['jiChaPerson'] + 
+							 "</td><td style=\"border:solid #000 1px; \">" + list[i]['judgeBy'] + 
+							"</td></tr>"
                         )
                     } else {
                         html.push("</td></tr>")

+ 99 - 0
sp-admin/sa-view/tb-fee-statistics/tb-fee-details-info.html

@@ -0,0 +1,99 @@
+<!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>
+		<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>
+							<el-col :span="12">
+								<sa-info name="日期" br>{{sa.forDate(m.dayTime)}}</sa-info>
+								<sa-info name="收费项" br>
+									<span v-if="m.feeType==1">核酸检测</span>
+									<span v-if="m.feeType==2">消杀作业</span>
+									<span v-if="m.feeType==3">装卸作业</span>
+									<span v-if="m.feeType==4">停车业务</span>
+									<span v-if="m.feeType==5">过磅费</span>
+									<span v-if="m.feeType==6">入场管理费</span>
+									<span v-if="m.feeType==7">充电打冷作业</span>
+								</sa-info>
+								<sa-info name="含税收入(元)" br>{{Number(m.taxMoney).toFixed(2)}}</sa-info>
+								<sa-info name="税率(%)" br>{{m.taxRate * 100}}</sa-info>
+								<sa-info name="税款(元)" br>{{Number(m.taxes).toFixed(2)}}</sa-info>
+								<sa-info name="不含税收入" br>{{Number(m.noTaxMoney).toFixed(2)}}</sa-info>
+							</el-col>
+							<el-col :span="12">
+								<sa-info name="数量" br>{{m.num}}</sa-info>
+								<sa-info name="支付方式" br>
+									<span v-if="m.payType==3">微信支付</span>
+									<span v-if="m.feeType==1">线下支付</span>
+									<span v-if="m.feeType==5">预扣款支付</span>
+								</sa-info>
+								<sa-info name="开单员" br>{{m.kaiDanPerson}}</sa-info>
+								<sa-info name="复核员" br>{{m.diaoDuPerson}}</sa-info>
+								<sa-info name="稽查员" br>{{m.jiChaPerson}}</sa-info>
+								<sa-info name="审核员" br>{{m.judgeBy}}</sa-info>
+								<sa-info name="审核时间" br>{{m.judgeTime}}</sa-info>
+							</el-col>
+						</el-row>
+
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="success" @click="confirmFn()" v-if="!m.judgeTime">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">关闭</el-button>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取数据ID
+					m: {}
+				},
+				methods: {
+					confirmFn() {
+						sa.ajax('/TbFeeStatistics/judge?id=' + this.id, function(res) {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe();
+						}.bind(this))
+					}
+				},
+				mounted: function() {
+					sa.ajax('/TbFeeStatistics/getById?id=' + this.id, function(res) {
+						this.m = res.data;
+						if (res.data == null) {
+							sa.alert('未能查找到 id=' + this.id + " 详细数据");
+						}
+					}.bind(this))
+				}
+			})
+		</script>
+	</body>
+</html>

+ 7 - 13
sp-admin/sa-view/tb-fee-statistics/tb-fee-details-list.html

@@ -95,16 +95,11 @@
 					<sa-item type="text" name="微信支付号" v-model="p.transactionId"></sa-item>
 					<sa-item type="text" name="作业公司" v-model="p.pickCustomerName"></sa-item>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
-					<br />
-				</el-form>
-				<!-- ------------- 快捷按钮 ------------- -->
-				<div class="fast-btn">
 					<el-button type="info" @click="sa.f5()">刷新</el-button>
-					<el-button type="warning" @click="exportFn()">导出</el-button>
-					<el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印</el-button>
-					<slot></slot>
-				</div>
-				<div class="fast-btn">
+					<el-button type="warning" v-if="sa.isAuth('tb-statistics-export')" 
+						@click="exportFn()">导出</el-button>
+					<el-button class="c-btn" type="success" icon="el-icon" v-if="sa.isAuth('tb-statistics-print')" 
+						@click="print()">打印</el-button>
 					<el-button class="c-btn" type="success" icon="el-icon" v-if="sa.isAuth('tb-kaidan-confirm')"
 						@click="kaiDanConfirm()">开单确认</el-button>
 					<el-button class="c-btn" type="success" icon="el-icon" v-if="sa.isAuth('tb-diaodu-confirm')"
@@ -119,12 +114,11 @@
 							style="color: #ff6600">&nbsp&nbsp{{dataCount}}&nbsp&nbsp</span>条&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
 						总金额<span style="color: #ff6600">&nbsp&nbsp{{totalPrice}}&nbsp&nbsp</span>元
 					</div>
-				</div>
+					<br />
+				</el-form>
 				<!-- ------------- 数据列表 ------------- -->
-				<el-table class="data-table" ref="data-table" :data="dataList" show-summary :summary-method="getSumRol">
+				<el-table class="data-table" ref="data-table" :data="dataList" show-summary :summary-method="getSumRol" style="margin-top: 10px;">
 					<sa-td type="selection"></sa-td>
-					<!--					<sa-td name="作业类型" prop="feeType" type="enum"-->
-					<!--						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>-->
 					<sa-td name="收费项目" prop="feeType" type="enum"
 						:jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车业务', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
 					<sa-td name="业务类型" prop="itemTypeName"></sa-td>

+ 333 - 327
sp-admin/sa-view/tb-fee-statistics/tb-fee-statistics-list.html

@@ -1,344 +1,350 @@
 <!DOCTYPE html>
 <html>
-<head>
-    <title>日统计</title>
-    <meta 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>
-</head>
-<body>
-<div class="vue-box" style="display: none;" :style="'display: block;'">
-    <div class="c-panel">
-        <!-- ------------- 检索参数 ------------- -->
-        <div class="c-title">检索参数</div>
-        <el-form ref="form" :model='p' @submit.native.prevent>
-            <!--					<div class="c-item">-->
-            <!--						<label class="c-label">类型:</label>-->
-            <!--						<el-select v-model="p.type" placeholder="请选择" filterable>-->
-            <!--							<el-option label="停车费" value="4"></el-option>-->
-            <!--							<el-option label="业务费" value="1,2,3,5,6,7"></el-option>-->
-            <!--						</el-select>-->
-            <!--					</div>-->
-            <div class="c-item">
-                <label class="c-label">收费项目:</label>
-                <el-select v-model="p.feeType" placeholder="请选择" filterable>
-                    <el-option label="-全部-" value=""></el-option>
-                    <el-option label="核酸检测" value="1"></el-option>
-                    <el-option label="消杀作业" value="2"></el-option>
-                    <el-option label="装卸作业" value="3"></el-option>
-                    <el-option label="停车业务" value="4"></el-option>
-                    <el-option label="过磅费" value="5"></el-option>
-                    <el-option label="入场管理费" value="6"></el-option>
-                    <el-option label="充电打冷作业" value="7"></el-option>
-                </el-select>
-            </div>
-            <!--					<div class="c-item">-->
-            <!--						<label class="c-label">日期:</label>-->
-            <!--						<el-date-picker type="date" value-format="yyyy-MM-dd" v-model="p.dayTime"></el-date-picker>-->
-            <!--					</div>-->
-            <div class="c-item">
-                <label class="c-label">日期范围:</label>
-                <el-date-picker size="mini" v-model="selectDay" type="daterange" unlink-panels="false"
-                                range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
-                                format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
-                </el-date-picker>
-            </div>
-            <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+	<head>
+		<title>日统计</title>
+		<meta 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>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<div class="c-title">检索参数</div>
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<div class="c-item">
+						<label class="c-label">收费项目:</label>
+						<el-select v-model="p.feeType" placeholder="请选择" filterable>
+							<el-option label="-全部-" value=""></el-option>
+							<el-option label="核酸检测" value="1"></el-option>
+							<el-option label="消杀作业" value="2"></el-option>
+							<el-option label="装卸作业" value="3"></el-option>
+							<el-option label="停车业务" value="4"></el-option>
+							<el-option label="过磅费" value="5"></el-option>
+							<el-option label="入场管理费" value="6"></el-option>
+							<el-option label="充电打冷作业" value="7"></el-option>
+						</el-select>
+					</div>
 
-            <br/>
-        </el-form>
-        <!-- ------------- 快捷按钮 ------------- -->
-        <div class="fast-btn">
-            <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
-            <el-button class="c-btn" type="warning" icon="el-icon" @click="exportStats()">导出</el-button>
-            <el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印</el-button>
-        </div>
-        <!-- ------------- 数据列表 ------------- -->
-        <el-table class="data-table" ref="data-table" :data="dataList" show-summary :summary-method="getSumRol">
-            <!--					<sa-td type="selection"></sa-td>-->
-            <sa-td name="收费项目" prop="feeType" type="enum"
-                   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车业务', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
-            <!--					<sa-td name="业务类型" prop="itemTypeName" ></sa-td>-->
-            <sa-td name="日期" type="date" prop="dayTime"></sa-td>
-            <sa-td name="数量" prop="num"></sa-td>
-            <!--					<sa-td name="含税收入(元)" prop="taxMoney" ></sa-td>-->
-            <el-table-column label="含税收入(元)">
-                <template slot-scope="s">
-                    <span>{{Number(s.row.taxMoney).toFixed(2)}}</span>
-                </template>
-            </el-table-column>
-            <!--					<sa-td name="税率" prop="taxRate" ></sa-td>-->
-            <el-table-column label="税率(%)">
-                <template slot-scope="s">
-                    <span>{{s.row.taxRate * 100}}</span>
-                </template>
-            </el-table-column>
-            <!--					<sa-td name="税款(元)" prop="taxes" ></sa-td>-->
-            <el-table-column label="税款(元)">
-                <template slot-scope="s">
-                    <span v-if="s.row.taxes != null">{{Number(s.row.taxes).toFixed(2)}}</span>
-                    <span v-else>{{Number(s.row.taxMoney - s.row.noTaxMoney).toFixed(2)}}</span>
-                </template>
-            </el-table-column>
-            <!--					<sa-td name="不含税收入(元)" prop="noTaxMoney" ></sa-td>-->
-            <el-table-column label="不含税收入(元)">
-                <template slot-scope="s">
-                    <span>{{Number(s.row.noTaxMoney).toFixed(2)}}</span>
-                </template>
-            </el-table-column>
-            <sa-td name="支付方式" prop="payType" type="enum" :jv="{3: '微信支付'}"></sa-td>
+					<div class="c-item">
+						<label class="c-label">日期范围:</label>
+						<el-date-picker size="mini" v-model="selectDay" type="daterange" unlink-panels="false"
+							range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
+							format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
+						</el-date-picker>
+					</div>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 
-            <sa-td name="开单员" prop="kaiDanPerson"></sa-td>
-            <sa-td name="复核员" prop="diaoDuPerson"></sa-td>
-            <sa-td name="统计稽查员" prop="jiChaPerson"></sa-td>
+					<br />
+				</el-form>
+				<!-- ------------- 快捷按钮 ------------- -->
+				<div class="fast-btn">
+					<el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
+					<el-button class="c-btn" type="warning" icon="el-icon" @click="exportStats()">导出</el-button>
+					<el-button class="c-btn" type="success" icon="el-icon" @click="print()">打印</el-button>
+				</div>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList" show-summary :summary-method="getSumRol">
+					<!--					<sa-td type="selection"></sa-td>-->
+					<sa-td name="收费项目" prop="feeType" type="enum"
+						:jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车业务', 5: '过磅费', 6: '入场管理费', 7: '充电打冷作业'}"></sa-td>
+					<!--					<sa-td name="业务类型" prop="itemTypeName" ></sa-td>-->
+					<sa-td name="日期" type="date" prop="dayTime"></sa-td>
+					<sa-td name="数量" prop="num"></sa-td>
+					<!--					<sa-td name="含税收入(元)" prop="taxMoney" ></sa-td>-->
+					<el-table-column label="含税收入(元)">
+						<template slot-scope="s">
+							<span>{{Number(s.row.taxMoney).toFixed(2)}}</span>
+						</template>
+					</el-table-column>
+					<!--					<sa-td name="税率" prop="taxRate" ></sa-td>-->
+					<el-table-column label="税率(%)">
+						<template slot-scope="s">
+							<span>{{s.row.taxRate * 100}}</span>
+						</template>
+					</el-table-column>
+					<!--					<sa-td name="税款(元)" prop="taxes" ></sa-td>-->
+					<el-table-column label="税款(元)">
+						<template slot-scope="s">
+							<span v-if="s.row.taxes != null">{{Number(s.row.taxes).toFixed(2)}}</span>
+							<span v-else>{{Number(s.row.taxMoney - s.row.noTaxMoney).toFixed(2)}}</span>
+						</template>
+					</el-table-column>
+					<el-table-column label="不含税收入(元)">
+						<template slot-scope="s">
+							<span>{{Number(s.row.noTaxMoney).toFixed(2)}}</span>
+						</template>
+					</el-table-column>
+					<sa-td name="支付方式" prop="payType" type="enum" :jv="{3: '微信支付'}"></sa-td>
 
-        </el-table>
-        <!-- ------------- 分页 ------------- -->
-        <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
-    </div>
-</div>
-<script>
-    var app = new Vue({
-        components: {
-            "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
-            "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
-        },
-        el: '.vue-box',
-        data: {
-            p: { // 查询参数
-                id: '',		// 主键
-                feeType: '',		// 收费类型(1=核酸检测,2消杀作业,3=装卸作业,4=停车费,5=过磅费)
-                feeTypeId: '',		// 收费类型id
-                feeTypeName: '',		// 收费类型
-                itemTypeId: '',		// 业务类型id
-                itemTypeName: '',		// 业务类型
-                year: '',		// 年份
-                month: '',		// 月份
-                dayTime: '',		// 日期
-                num: '',		// 数量
-                taxMoney: '',		// 税款
-                taxRate: '',		// 税率
-                noTaxMoney: '',		// 不含税款
-                payType: '',		// 支付方式(1=微信支付)
-                pageNo: 1,		// 当前页
-                pageSize: 10,	// 页大小
-                sortType: 9		// 排序方式
-            },
-            dataCount: 0,
-            dataList: [], // 数据集合
-            selectDay: [],
-            selectDayRange: {
-                beginDay: '', //查询开始时间
-                endDay: '', //查询结束时间
-            },
-            tableSum: {
-                taxMoneySum: 0,
-                taxesSum: 0,
-                noTaxMoneySum: 0,
-            },
-        },
-        methods: {
-            getSumRol(param) {
-                console.log("执行了getSumRol")
-                const columns = param.columns;
-                const sums = [];
-                columns.forEach((column, index) => {
-                    if (index === 0) {
-                        sums[index] = "合计";
-                        return;
-                    }
-                    //根据当前列绑定的字段名进行判断,根据字段名决定展示什么内容
-                    switch (column.label) {
-                        //金额;
-                        case "含税收入(元)":
-                            //在这里你就可以根据需要对数据进行一些处理(保留小数位数,加上单位等)
-                            sums[index] = this.tableSum.taxMoneySum;
-                            break;
-                        //人数
-                        case "税款(元)":
-                            sums[index] = this.tableSum.taxesSum;
-                            break;
-                        //件数;
-                        case "不含税收入(元)":
-                            sums[index] = this.tableSum.noTaxMoneySum;
-                            break;
-                        //不需要计算合计的列就展示‘--’
-                        default:
-                            sums[index] = "";
-                            break;
-                    }
-                });
-                return sums;
-            },
-            calcuSum() {
-                var taxMoneySum = 0;
-                var taxesSum = 0;
-                var noTaxMoneySum = 0;
-                var len = this.dataList.length;
-                for (var i = 0; i < len; i++) {
-                    taxMoneySum = (taxMoneySum * 100 + this.dataList[i].taxMoney * 100) / 100;
-                    taxesSum = (taxesSum * 100 + this.dataList[i].taxes * 100) / 100;
-                    noTaxMoneySum = (noTaxMoneySum * 100 + this.dataList[i].noTaxMoney * 100) / 100;
-                }
-                this.tableSum.taxMoneySum = Number(taxMoneySum).toFixed(2);
-                this.tableSum.taxesSum = Number(taxesSum).toFixed(2);
-                this.tableSum.noTaxMoneySum = Number(noTaxMoneySum).toFixed(2);
+					<sa-td name="开单员" prop="kaiDanPerson"></sa-td>
+					<sa-td name="复核员" prop="diaoDuPerson"></sa-td>
+					<sa-td name="统计稽查员" prop="jiChaPerson"></sa-td>
+					<sa-td name="审核员" prop="judgeBy"></sa-td>
+					<sa-td name="审核时间" prop="judgeTime" width="140"></sa-td>
+					<el-table-column label="操作" fixed="right" width="120px" v-if="sa.isAuth('tb-fee-statistics-judge')">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="judgeFn(s.row)">审核
+							</el-button>
+						</template>
+					</el-table-column>
 
-            },
-            getTotalMoney() {
-                if (this.selectDay != null && this.selectDay.length != 0) {
-                    this.selectDayRange.beginDay = this.selectDay[0];
-                    this.selectDayRange.endDay = this.selectDay[1];
-                }
-                sa.ajax('/TbFeeStatistics/getSum?beginDay=' + this.selectDayRange.beginDay + "&endDay=" + this.selectDayRange.endDay,
-                    sa.removeNull(this.p), function (res) {
-                        this.tableSum.taxMoneySum = res.data.taxMoneySum;
-                        this.tableSum.taxesSum = res.data.taxesSum;
-                        this.tableSum.noTaxMoneySum = res.data.noTaxMoneySum;
-                    }.bind(this));
-            },
-            print: function () {
-                if (this.selectDay != null && this.selectDay.length != 0) {
-                    this.selectDayRange.beginDay = this.selectDay[0];
-                    this.selectDayRange.endDay = this.selectDay[1];
-                }
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					p: { // 查询参数
+						id: '', // 主键
+						feeType: '', // 收费类型(1=核酸检测,2消杀作业,3=装卸作业,4=停车费,5=过磅费)
+						feeTypeId: '', // 收费类型id
+						feeTypeName: '', // 收费类型
+						itemTypeId: '', // 业务类型id
+						itemTypeName: '', // 业务类型
+						year: '', // 年份
+						month: '', // 月份
+						dayTime: '', // 日期
+						num: '', // 数量
+						taxMoney: '', // 税款
+						taxRate: '', // 税率
+						noTaxMoney: '', // 不含税款
+						payType: '', // 支付方式(1=微信支付)
+						pageNo: 1, // 当前页
+						pageSize: 10, // 页大小
+						sortType: 9 // 排序方式
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合
+					selectDay: [],
+					selectDayRange: {
+						beginDay: '', //查询开始时间
+						endDay: '', //查询结束时间
+					},
+					tableSum: {
+						taxMoneySum: 0,
+						taxesSum: 0,
+						noTaxMoneySum: 0,
+					},
+				},
+				methods: {
+					judgeFn(data) {
+						sa.showIframe('统计审核', 'tb-fee-details-info.html?id=' + data.id, '600px', '60%');
+					},
+					getSumRol(param) {
+						const columns = param.columns;
+						const sums = [];
+						columns.forEach((column, index) => {
+							if (index === 0) {
+								sums[index] = "合计";
+								return;
+							}
+							//根据当前列绑定的字段名进行判断,根据字段名决定展示什么内容
+							switch (column.label) {
+								//金额;
+								case "含税收入(元)":
+									//在这里你就可以根据需要对数据进行一些处理(保留小数位数,加上单位等)
+									sums[index] = this.tableSum.taxMoneySum;
+									break;
+									//人数
+								case "税款(元)":
+									sums[index] = this.tableSum.taxesSum;
+									break;
+									//件数;
+								case "不含税收入(元)":
+									sums[index] = this.tableSum.noTaxMoneySum;
+									break;
+									//不需要计算合计的列就展示‘--’
+								default:
+									sums[index] = "";
+									break;
+							}
+						});
+						return sums;
+					},
+					calcuSum() {
+						var taxMoneySum = 0;
+						var taxesSum = 0;
+						var noTaxMoneySum = 0;
+						var len = this.dataList.length;
+						for (var i = 0; i < len; i++) {
+							taxMoneySum = (taxMoneySum * 100 + this.dataList[i].taxMoney * 100) / 100;
+							taxesSum = (taxesSum * 100 + this.dataList[i].taxes * 100) / 100;
+							noTaxMoneySum = (noTaxMoneySum * 100 + this.dataList[i].noTaxMoney * 100) / 100;
+						}
+						this.tableSum.taxMoneySum = Number(taxMoneySum).toFixed(2);
+						this.tableSum.taxesSum = Number(taxesSum).toFixed(2);
+						this.tableSum.noTaxMoneySum = Number(noTaxMoneySum).toFixed(2);
 
-                var beginDay = this.selectDayRange.beginDay;
-                var endDay = this.selectDayRange.endDay;
-                var feeType = this.p.feeType;
+					},
+					getTotalMoney() {
+						if (this.selectDay != null && this.selectDay.length != 0) {
+							this.selectDayRange.beginDay = this.selectDay[0];
+							this.selectDayRange.endDay = this.selectDay[1];
+						}
+						sa.ajax('/TbFeeStatistics/getSum?beginDay=' + this.selectDayRange.beginDay + "&endDay=" + this
+							.selectDayRange.endDay,
+							sa.removeNull(this.p),
+							function(res) {
+								this.tableSum.taxMoneySum = res.data.taxMoneySum;
+								this.tableSum.taxesSum = res.data.taxesSum;
+								this.tableSum.noTaxMoneySum = res.data.noTaxMoneySum;
+							}.bind(this));
+					},
+					print: function() {
+						if (this.selectDay != null && this.selectDay.length != 0) {
+							this.selectDayRange.beginDay = this.selectDay[0];
+							this.selectDayRange.endDay = this.selectDay[1];
+						}
 
-                var str = '';
-                if (beginDay === '' && endDay === '') {
-                    str += '所有时间';
-                } else {
-                    str += beginDay + "至" + endDay
-                }
-                if (feeType === '') {
-                    str += "、所有收费项目";
-                } else {
-                    var feeTypeName = '';
-                    if (feeType == 1) {
-                        feeTypeName = "核酸检测";
-                    } else if (feeType == 2) {
-                        feeTypeName = "消杀作业";
-                    } else if (feeType == 3) {
-                        feeTypeName = "装卸作业";
-                    } else if (feeType == 4) {
-                        feeTypeName = "停车费";
-                    } else if (feeType == 5) {
-                        feeTypeName = "过磅费";
-                    } else if (feeType == 6) {
-                        feeTypeName = "入场管理费";
-                    } else if (feeType == 7) {
-                        feeTypeName = "充电打冷作业";
-                    }
-                    str += "、收费项目为" + feeTypeName;
-                }
+						var beginDay = this.selectDayRange.beginDay;
+						var endDay = this.selectDayRange.endDay;
+						var feeType = this.p.feeType;
 
-                this.$confirm('确定打印' + str + '的数据?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
+						var str = '';
+						if (beginDay === '' && endDay === '') {
+							str += '所有时间';
+						} else {
+							str += beginDay + "至" + endDay
+						}
+						if (feeType === '') {
+							str += "、所有收费项目";
+						} else {
+							var feeTypeName = '';
+							if (feeType == 1) {
+								feeTypeName = "核酸检测";
+							} else if (feeType == 2) {
+								feeTypeName = "消杀作业";
+							} else if (feeType == 3) {
+								feeTypeName = "装卸作业";
+							} else if (feeType == 4) {
+								feeTypeName = "停车费";
+							} else if (feeType == 5) {
+								feeTypeName = "过磅费";
+							} else if (feeType == 6) {
+								feeTypeName = "入场管理费";
+							} else if (feeType == 7) {
+								feeTypeName = "充电打冷作业";
+							}
+							str += "、收费项目为" + feeTypeName;
+						}
 
-                    sa.showIframe('打印日报表', 'dayStatsPrint.html?beginDay=' + beginDay + "&endDay=" + endDay + "&feeType=" + feeType, '1000px', '100%');
-                }).catch(() => {
+						this.$confirm('确定打印' + str + '的数据?', '提示', {
+							confirmButtonText: '确定',
+							cancelButtonText: '取消',
+							type: 'warning'
+						}).then(() => {
 
-                });
-            },
-            exportStats() {
-                if (this.selectDay != null && this.selectDay.length != 0) {
-                    this.selectDayRange.beginDay = this.selectDay[0];
-                    this.selectDayRange.endDay = this.selectDay[1];
-                }
+							sa.showIframe('打印日报表', 'dayStatsPrint.html?beginDay=' + beginDay + "&endDay=" +
+								endDay + "&feeType=" + feeType, '1000px', '100%');
+						}).catch(() => {
 
-                var beginDay = this.selectDayRange.beginDay;
-                var endDay = this.selectDayRange.endDay;
-                var feeType = this.p.feeType;
+						});
+					},
+					exportStats() {
+						if (this.selectDay != null && this.selectDay.length != 0) {
+							this.selectDayRange.beginDay = this.selectDay[0];
+							this.selectDayRange.endDay = this.selectDay[1];
+						}
 
-                var str = '';
-                if (beginDay === '' && endDay === '') {
-                    str += '所有时间';
-                } else {
-                    str += beginDay + "至" + endDay
-                }
-                if (feeType === '') {
-                    str += "、所有收费项目";
-                } else {
-                    var feeTypeName = '';
-                    if (feeType == 1) {
-                        feeTypeName = "核酸检测";
-                    } else if (feeType == 2) {
-                        feeTypeName = "消杀作业";
-                    } else if (feeType == 3) {
-                        feeTypeName = "装卸作业";
-                    } else if (feeType == 4) {
-                        feeTypeName = "停车费";
-                    } else if (feeType == 5) {
-                        feeTypeName = "过磅费";
-                    } else if (feeType == 6) {
-                        feeTypeName = "入场管理费";
-                    } else if (feeType == 7) {
-                        feeTypeName = "充电打冷作业";
-                    }
-                    str += "、收费项目为" + feeTypeName;
-                }
-                this.$confirm('确定导出' + str + '的数据?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    sa.ajax('/TbFeeStatistics/export/stats?beginDay=' + beginDay + '&endDay=' + endDay
-                        , sa.removeNull(this.p), function (resp) {
-                            window.open(resp.data);
-                        }.bind(this));
-                }).catch(() => {
+						var beginDay = this.selectDayRange.beginDay;
+						var endDay = this.selectDayRange.endDay;
+						var feeType = this.p.feeType;
 
-                });
-            },
-            // 刷新
-            f5: function () {
-                if (this.selectDay != null && this.selectDay.length != 0) {
-                    this.selectDayRange.beginDay = this.selectDay[0];
-                    this.selectDayRange.endDay = this.selectDay[1];
-                }
-                sa.ajax('/TbFeeStatistics/getList?beginDay=' + this.selectDayRange.beginDay + "&endDay=" + this.selectDayRange.endDay,
-                    sa.removeNull(this.p), function (res) {
-                        this.dataList = res.data; // 数据
-                        this.dataCount = res.dataCount; // 数据总数
-                        sa.f5TableHeight();		// 刷新表格高度
+						var str = '';
+						if (beginDay === '' && endDay === '') {
+							str += '所有时间';
+						} else {
+							str += beginDay + "至" + endDay
+						}
+						if (feeType === '') {
+							str += "、所有收费项目";
+						} else {
+							var feeTypeName = '';
+							if (feeType == 1) {
+								feeTypeName = "核酸检测";
+							} else if (feeType == 2) {
+								feeTypeName = "消杀作业";
+							} else if (feeType == 3) {
+								feeTypeName = "装卸作业";
+							} else if (feeType == 4) {
+								feeTypeName = "停车费";
+							} else if (feeType == 5) {
+								feeTypeName = "过磅费";
+							} else if (feeType == 6) {
+								feeTypeName = "入场管理费";
+							} else if (feeType == 7) {
+								feeTypeName = "充电打冷作业";
+							}
+							str += "、收费项目为" + feeTypeName;
+						}
+						this.$confirm('确定导出' + str + '的数据?', '提示', {
+							confirmButtonText: '确定',
+							cancelButtonText: '取消',
+							type: 'warning'
+						}).then(() => {
+							sa.ajax('/TbFeeStatistics/export/stats?beginDay=' + beginDay + '&endDay=' + endDay,
+								sa.removeNull(this.p),
+								function(resp) {
+									window.open(resp.data);
+								}.bind(this));
+						}).catch(() => {
 
-                    }.bind(this));
-                this.getTotalMoney();
-            },
-            // 查看
-            get: function (data) {
-                sa.showIframe('数据详情', 'tb-fee-statistics-info.html?id=' + data.id, '1050px', '90%');
-            },
-            // 查看 - 根据选中的
-            getBySelect: function (data) {
-                var selection = this.$refs['data-table'].selection;
-                if (selection.length == 0) {
-                    return sa.msg('请选择一条数据')
-                }
-                this.get(selection[0]);
-            },
+						});
+					},
+					// 刷新
+					f5: function() {
+						if (this.selectDay != null && this.selectDay.length != 0) {
+							this.selectDayRange.beginDay = this.selectDay[0];
+							this.selectDayRange.endDay = this.selectDay[1];
+						}
+						sa.ajax('/TbFeeStatistics/getList?beginDay=' + this.selectDayRange.beginDay + "&endDay=" +
+							this.selectDayRange.endDay,
+							sa.removeNull(this.p),
+							function(res) {
+								this.dataList = res.data; // 数据
+								this.dataCount = res.dataCount; // 数据总数
+								sa.f5TableHeight(); // 刷新表格高度
 
-        },
-        created: function () {
-            this.f5();
-            sa.onInputEnter();
-        }
-    })
-</script>
-</body>
+							}.bind(this));
+						this.getTotalMoney();
+					},
+					// 查看
+					get: function(data) {
+						sa.showIframe('数据详情', 'tb-fee-statistics-info.html?id=' + data.id, '1050px', '90%');
+					},
+					// 查看 - 根据选中的
+					getBySelect: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if (selection.length == 0) {
+							return sa.msg('请选择一条数据')
+						}
+						this.get(selection[0]);
+					},
+
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
 </html>

+ 4 - 1
sp-admin/sa-view/tb-partner/tb-business-item-list.html

@@ -25,7 +25,8 @@
 					<sa-item type="text" name="项目名称" v-model="p.itemName"></sa-item>
 					<sa-item type="text" name="越南车" v-model="p.cardNo"></sa-item>
 					<sa-item type="text" name="中国车" v-model="p.chinaCarNo"></sa-item>
-					<sa-item type="text" name="货物" v-model="p.goodsName"></sa-item>
+					<sa-item type="text" name="作业公司" v-model="p.pickCustomerName"></sa-item>
+					<sa-item type="date" name="创建日期" v-model="p.createTime"></sa-item>
 					<div class="c-item">
 						<label class="c-label">业务项:</label>
 						<el-select v-model="p.goodsId" placeholder="请选择" filterable>
@@ -114,6 +115,8 @@
 						businessType: '',
 						goodsId: '',
 						goodsName: '',
+						pickCustomerName:'',
+						createTime:'',
 						businessNo: '',
 						pageNo: 1, // 当前页
 						pageSize: 10, // 页大小 

+ 4 - 0
sp-server/src/main/java/com/pj/api/wx/bo/PriceBO.java

@@ -1,12 +1,16 @@
 package com.pj.api.wx.bo;
 
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 
 import java.math.BigDecimal;
 
 @Data
 @Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
 public class PriceBO {
     private String id;
     private BigDecimal p;

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

@@ -241,7 +241,7 @@ public class WxService {
                 car.setPay(1).setMoney(car.getMoney().add(price)).setPayTime(payTime).setPayType(TbBusinessCar.PayTypeEnum.HAS_PAY_TYPE.getType());
                 tbBusinessCarService.updateById(car);
             }
-            tbFeeDetailsService.chargeParkFee(cars, transactionId, outTradeNo, payTime, TbFeeDetails.ModuleEnum.ONLINE.getDesc());//添加cars的收费明细
+            tbFeeDetailsService.chargeParkFee(cars, transactionId, outTradeNo, payTime, TbBusiness.PayType.WX_PAY);//添加cars的收费明细
             String businessId = attach.getB();
             Date finalPayTime = payTime;
             if (StrUtil.isNotEmpty(businessId)) {
@@ -268,7 +268,7 @@ public class WxService {
                         }
                     });
                 }
-                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, TbFeeDetails.ModuleEnum.ONLINE.getDesc());//添加items的收费明细
+                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, TbBusiness.PayType.WX_PAY);//添加items的收费明细
                 items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setPayTime(finalPayTime));
                 tbBusinessItemService.updateBatchById(items);
             }

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

@@ -8,6 +8,7 @@ import cn.hutool.extra.spring.SpringUtil;
 import cn.hutool.log.StaticLog;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.pj.api.open.ResultJson;
+import com.pj.api.wx.bo.PriceBO;
 import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_business.TbBusinessService;
 import com.pj.project.tb_business_car.TbBusinessCar;
@@ -79,7 +80,6 @@ public class AutomaticPay {
      * @param feeType    收费类型,1-只收停车费、2-只收业务费,3-停车和业务费
      */
     //TODO 不要在此方法写逻辑
-
     public void run(String businessId, String plate, Integer feeType) {
         this.feeType = feeType;
         task(businessId, plate, feeType);
@@ -92,11 +92,11 @@ public class AutomaticPay {
      */
     @Async
     public void unbindRun(String plate) {
-        if(isExistTask(null,plate)){
+        if (isExistTask(null, plate)) {
             return;
         }
         autoUnbindCarByPlate(plate);
-        delRedisTask(null,plate);
+        delRedisTask(null, plate);
 //        TbBusinessCar tbBusinessCar = tbBusinessCarService.findTheLastRecord(plate);
 //        TbDeductionBind bind = tbDeductionBindService.findTheLastUnBindCar(plate);
 
@@ -191,15 +191,20 @@ public class AutomaticPay {
         List<TbFeeDetails> tbFeeDetailsList = tbFeeDetailsService.autoChargeBusinessFee(
                 businessItems, null, null, now);
         //生成扣费记录
-        createTbDeductionRecord(tbFeeDetailsList, tbAccount, totalMoneyBig, plate, bind.getCustomerName(), no);
+        createTbDeductionRecord(tbFeeDetailsList, tbAccount,  plate, bind.getCustomerName(), no);
         //生成开票信息
         createTbInvoiceOrder(tbBusiness, cars, parkingMoneyBig, plate, bind.getCustomerId(), no, isOut);
         if (isOut) {//离场缴费
+            List<PriceBO> priceBOList = new ArrayList<>();
+            cars.forEach(tbBusinessCar -> {
+                PriceBO bo = new PriceBO();
+                bo.setId(tbBusinessCar.getId()).setP(tbBusinessCar.getMoney());
+                priceBOList.add(bo);
+            });
             deductionBindService.setDeductMoney(bind.getCustomerId(), plate, parkingMoneyBig);
-            List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.autoChargeParkFee(
-                    cars, null, null, now);
-            createTbDeductionRecord(parkFeeDetailsList, tbAccount,
-                    totalMoneyBig.subtract(tbBusiness.getItemPrice()), plate, bind.getCustomerName(), no);
+            List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
+                    priceBOList, null, null, now, TbBusiness.PayType.PER_PAY);
+            createTbDeductionRecord(parkFeeDetailsList, tbAccount, plate, bind.getCustomerName(), no);
 
         }
         StaticLog.info("预充值自动缴费成功!,退出收费程序:{}{}", businessId, tbAccount.getCustomerId());
@@ -287,9 +292,13 @@ public class AutomaticPay {
         deductionBindService.setDeductMoney(bind.getCustomerId(), plate, parkFeeBig);
         List<TbBusinessCar> cars = new ArrayList<TbBusinessCar>();
         cars.add(car);
-        List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.autoChargeParkFee(
-                cars, null, null, new Date());
-        createTbDeductionRecord(parkFeeDetailsList, account, totalBig, plate, bind.getCustomerName(), no);
+        List<PriceBO> priceBOList = new ArrayList<>();
+        PriceBO bo = new PriceBO();
+        bo.setId(car.getId()).setP(car.getMoney());
+        priceBOList.add(bo);
+        List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
+                priceBOList, null, null, new Date(), TbBusiness.PayType.PER_PAY);
+        createTbDeductionRecord(parkFeeDetailsList, account, plate, bind.getCustomerName(), no);
         createTbInvoiceOrderPark(car, account.getCustomerId(), no);
         deductionBindService.autoUnbindCar(cars);
         StaticLog.info("停车费自动缴费成功!,退出收费程序:{}", car.getCarNo());
@@ -300,42 +309,29 @@ public class AutomaticPay {
      *
      * @param tbFeeDetailsList
      * @param tbAccount
-     * @param totalMoneyBig
      */
-    private void createTbDeductionRecord(List<TbFeeDetails> tbFeeDetailsList, TbAccount tbAccount,
-                                         BigDecimal totalMoneyBig, String plate, String customerName, String no) {
-        if (tbFeeDetailsList == null) return;
-        int i = 0;
-        String tempMoney = null;
+    public void createTbDeductionRecord(List<TbFeeDetails> tbFeeDetailsList, TbAccount tbAccount, String plate, String customerName, String no) {
         String bindIdStr = deductionBindService.getBindId(plate);
+        BigDecimal banlanc = new BigDecimal(AesUtil.decryptECB(tbAccount.getTotalMoney(),AesUtil.reverse(tbAccount.getAccSalt())));
         for (TbFeeDetails feeDetails : tbFeeDetailsList) {
             TbDeductionRecord deductionRecord = BeanUtil.toBean(feeDetails, TbDeductionRecord.class);
-            String totalStr = null;
-            if (totalMoneyBig != null && feeDetails.getNoTaxPrice() != null) {
-                if (i != 0) {
-                    totalMoneyBig = new BigDecimal(tempMoney);
-                }
-                totalStr = totalMoneyBig.subtract(feeDetails.getItemPrice()).toString();
-                tempMoney = totalStr;
-            }
-            deductionRecord.setId(null);
-            deductionRecord.setDeductionBindId(bindIdStr);
-            deductionRecord.setCustomerId(tbAccount.getCustomerId());
-            deductionRecord.setCustomerName(customerName);
-            deductionRecord.setFeeDetailsId(feeDetails.getId());
-            deductionRecord.setOriginalMoney(totalMoneyBig.toString());
-            deductionRecord.setDeductMoney(feeDetails.getItemPrice());
-            deductionRecord.setTotalMoney(totalStr);
-            deductionRecord.setReviewStatus(0);
-            deductionRecord.setCarNo(plate);
-            deductionRecord.setPreOrderNum(no);
+            BigDecimal itemPrice = feeDetails.getItemPrice();
+            deductionRecord.setDeductionBindId(bindIdStr)
+                    .setCustomerId(tbAccount.getCustomerId())
+                    .setCustomerName(customerName)
+                    .setOriginalMoney(banlanc.toString())
+                    .setDeductMoney(itemPrice)
+                    .setFeeDetailsId(feeDetails.getId())
+                    .setReviewStatus(0)
+                    .setCarNo(plate)
+                    .setPreOrderNum(no);
+            banlanc = banlanc.subtract(itemPrice);
+            deductionRecord.setTotalMoney(banlanc.toString());
             deductionRecord.insert();
             feeDetails.setCarNo(plate);
             feeDetails.setPreOrderNum(no);
-            feeDetails.setCustomerId(tbAccount.getCustomerId());
             feeDetails.setCustomerName(customerName);
             tbFeeDetailsService.updateById(feeDetails);
-            i++;
         }
     }
 
@@ -432,7 +428,7 @@ public class AutomaticPay {
         if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getRealOutTime() == null && tbBusinessCar.getPayTime() != null) {
             inTime = tbBusinessCar.getPayTime();
         }
-        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now,tbBusinessCar.getCarSize());
+        BigDecimal price = tbBusinessService.calculationPartMoney(inTime, now, tbBusinessCar.getCarSize());
         tbBusinessCar.setMoney(price);
         return price;
     }

+ 16 - 15
sp-server/src/main/java/com/pj/project/tb_account/TbAccountService.java

@@ -99,6 +99,7 @@ public class TbAccountService extends ServiceImpl<TbAccountMapper, TbAccount> im
     public void recharge(SoMap so){
         String salt = so.getString("salt");
         String preTopupMoney = so.getString("preTopupMoney");//充值金额
+        String discountMoney = so.getString("discountMoney");//优惠金额
         String key = AesUtil.reverse(salt);
         String decTotalTopup = AesUtil.decryptECB(preTopupMoney,key);
         if(!NumberUtil.isNumber(decTotalTopup)){
@@ -108,7 +109,7 @@ public class TbAccountService extends ServiceImpl<TbAccountMapper, TbAccount> im
             throw new AjaxError("总计充值金额不得小于零元!");
         }
         String beforeBalance = preTopupMoney;
-        TbAccount account = null;
+        TbAccount account;
         String accIdStr = so.getString("id");
         if(!NumberUtil.isNumber(accIdStr)){
             account = getTbAccountByMap(so);
@@ -130,20 +131,20 @@ public class TbAccountService extends ServiceImpl<TbAccountMapper, TbAccount> im
         account.insertOrUpdate();
         //保存充值记录
         TbChargeRecord record = BeanUtil.fillBeanWithMap(so, new TbChargeRecord(),false);
-        record.setId(null);
-        record.setStatus(1);
-        record.setAccountId(account.getId());
-        record.setTotalTopupMoney(preTopupMoney);
-       record.setPreTopupMoney(preTopupMoney);
-        record.setDiscountMoney(so.getString("discountMoney"));
-        record.setTotalMoney(account.getTotalMoney());
-        record.setBeforeBalance(beforeBalance);
-        record.setChargeChannel(TbChargeRecord.Ch.PC.getType());
-        record.setCreateTime(new Date());
-        record.setSalt(salt);
-        record.setChargePeople(StpUserUtil.getLoginName());
-        record.setNo(getIdByNow());
-        record.insert();
+        record.setStatus(1)
+                .setId(null)
+                .setAccountId(account.getId())
+                .setTotalTopupMoney(preTopupMoney)
+                .setPreTopupMoney(preTopupMoney)
+                .setDiscountMoney(discountMoney)
+                .setTotalMoney(account.getTotalMoney())
+                .setBeforeBalance(beforeBalance)
+                .setChargeChannel(TbChargeRecord.Ch.PC.getType())
+                .setCreateTime(new Date())
+                .setSalt(salt)
+                .setChargePeople(StpUserUtil.getLoginName())
+                .setNo(getIdByNow());
+      tbChargeRecordService.save(record);
     }
 
     /**

+ 22 - 2
sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java

@@ -170,7 +170,11 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     /**
      * 支付方式(1=线下支付,2现金支付,3=微信支付,4=支付宝支付,5=预充值自动支付)
      */
-    private Integer payType = 1;
+    private Integer payType = 5;
+    /**
+     * 收费总类 1 微信系统收款 2 微信门店收款
+     */
+    private Integer payChannelType = 1;
     /**
      * 支付订单号
      */
@@ -210,7 +214,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     private String confirmInputBy;
 
 
-    private Integer adminConfirmInput;
+    private Integer adminConfirmInput=0;
     private Integer adminConfirmPay;
     private Date adminConfirmPayTime;
     private String adminConfirmPayBy;
@@ -344,6 +348,22 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
         private String desc;
     }
 
+  @Getter
+    @AllArgsConstructor
+    public static enum PayType {
+      /**
+       * (1=线下支付,2现金支付,3=微信支付,4=支付宝支付,5=预充值自动支付)
+       */
+      OFF_LINE_PAY(1, "线下支付"),
+        CASH_PAY(2, "现金支付"),
+        WX_PAY(3, "微信支付"),
+        ALI_PAY(4, "支付宝支付"),
+        PER_PAY(5, "预充值支付"),
+        ;
+        private int code;
+        private String desc;
+    }
+
 
 
     public void setCardNo(String cardNo) {

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

@@ -8,6 +8,7 @@ import cn.hutool.json.JSONUtil;
 import cn.hutool.log.StaticLog;
 import com.pj.constants.UserTypeEnum;
 import com.pj.current.satoken.StpUserUtil;
+import com.pj.project.tb_account.AutomaticPay;
 import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_business_car.TbBusinessCarService;
 import com.pj.project.tb_business_item.TbBusinessItem;
@@ -20,6 +21,7 @@ import com.pj.utils.sg.AjaxError;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -53,6 +55,7 @@ public class TbBusinessController {
     private TbBusinessCarService tbBusinessCarService;
 
 
+
     @RequestMapping(value = "getMsg")
     public AjaxJson getMsg() {
         return AjaxJson.getSuccessData(BusinessMessageManager.get(StpUserUtil.getCustomerId()));
@@ -285,8 +288,12 @@ public class TbBusinessController {
         String id = so.getString("id");
         String remark = so.getString("remark");
         String cars = so.getString("cars");
+        Date payTime = so.getDateTime("payTime");
+        int payChannelType = so.getInt("payChannelType");
+        int payType = so.getInt("payType");
+        String transactionId = so.getString("transactionId");
         List<TbBusinessCar> carList = JSONUtil.toList(cars, TbBusinessCar.class);
-        tbBusinessService.manualConfirmPay(id, carList, remark);
+        tbBusinessService.manualConfirmPay(id, carList, remark,payTime,payChannelType,payType,transactionId);
         return AjaxJson.getSuccess();
     }
 
@@ -343,7 +350,7 @@ public class TbBusinessController {
         errorBusinessBO.setCars(cars);
         errorBusinessBO.setSupplementBy(StpUserUtil.getCreateBy());
         String currentCustomerId = StpUserUtil.getCustomerId();
-        StaticLog.info("currentCustomerId============= :{}",currentCustomerId);
+        StaticLog.info("currentCustomerId============= :{}", currentCustomerId);
         tbBusinessService.selectErrorBusiness(errorBusinessBO, currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId()));
         return AjaxJson.getSuccess();
     }

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

@@ -8,6 +8,7 @@ import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import cn.com.btxc.micro.uni.openapi.util.AESUtils;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.RandomUtil;
@@ -34,6 +35,8 @@ import com.pj.project.relation_business_car.RelationBusinessCar;
 import com.pj.project.relation_business_car.RelationBusinessCarService;
 
 import com.pj.project.tb_account.AutomaticPay;
+import com.pj.project.tb_account.TbAccount;
+import com.pj.project.tb_account.TbAccountService;
 import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_business_car.TbBusinessCarService;
 import com.pj.project.tb_business_item.TbBusinessItem;
@@ -50,10 +53,13 @@ import com.pj.project.tb_costomer.TbCostomer;
 import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.project.tb_declare.TbDeclare;
 import com.pj.project.tb_declare.TbDeclareService;
+import com.pj.project.tb_deduction_bind.TbDeductionBind;
+import com.pj.project.tb_deduction_bind.TbDeductionBindService;
 import com.pj.project.tb_driver.TbDriver;
 import com.pj.project.tb_driver.TbDriverService;
 import com.pj.project.tb_fee_details.TbFeeDetails;
 import com.pj.project.tb_fee_details.TbFeeDetailsService;
+import com.pj.project.tb_fee_statistics.TbFeeStatisticsService;
 import com.pj.project.tb_goods.TbGoods;
 import com.pj.project.tb_goods.TbGoodsService;
 import com.pj.project.tb_item.TbItem;
@@ -70,6 +76,7 @@ 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.utils.AesUtil;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import lombok.extern.slf4j.Slf4j;
@@ -124,7 +131,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     private TbNoticesService tbNoticesService;
 
     @Resource
-    private TbCarNoColorService tbCarNoColorService;
+    private TbAccountService tbAccountService;
 
     @Resource
     TbBusinessCarService tbBusinessCarService;
@@ -152,6 +159,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     @Resource
     private RelationBusinessCarService relationBusinessCarService;
     @Autowired
+    @Lazy
     private AutomaticPay automaticPay;
     @Resource
     private OAConfig oaConfig;
@@ -163,7 +171,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     private TbFeeDetailsService tbFeeDetailsService;
 
     @Resource
-    private TbMildCarService tbMildCarService;
+    private TbDeductionBindService tbDeductionBindService;
+    @Resource
+    @Lazy
+    private TbFeeStatisticsService tbFeeStatisticsService;
 
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
@@ -320,21 +331,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
 
     }
 
-    private TbCar createCar(TbBusiness business) {
-        String cardNo = business.getCardNo();
-        TbCar tbCar = tbCarService.findByCardNo(cardNo);
-        if (tbCar == null) {
-            tbCar = new TbCar();
-        }
-        tbCar.setCardNo(cardNo)
-                .setCardSize(business.getCardSize())
-                .setCountryName(business.getCountryName())
-                .setLastGoodsName(business.getGoodsName())
-                .setLastNetWeight(business.getNetWeight());
-        tbCarService.saveOrUpdate(tbCar);
-        return tbCar;
-    }
-
 
     /**
      * 查集合 - 根据条件(参数为空时代表忽略指定条件)
@@ -709,32 +705,103 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         return tbBusinessMapper.checkCarBusinessTypeByTime(typeId, carNo, timeStart, timeEnd, businessId);
     }
 
-    public void manualConfirmPay(String id, List<TbBusinessCar> cars, String remark) {
+    /**
+     * 线下收费
+     *
+     * @param id
+     * @param cars
+     * @param remark
+     * @param payTime
+     * @param payChannelType
+     * @param payType
+     * @param transactionId
+     */
+    public void manualConfirmPay(String id, List<TbBusinessCar> cars, String remark, Date payTime, int payChannelType, int payType, String transactionId) {
         TbBusiness db = this.getById(id);
         if (db == null) {
             throw new BusinessException("业务不存在");
         }
-        Date now = new Date();
-        db.setPayStatus(TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode())
-                .setPayMoney(db.getItemPrice()).setPayTime(now);
-        this.updateById(db);
-        cars.forEach(tbBusinessCar -> {
-            Date realInTime = tbBusinessCar.getRealInTime();
-            Date realOutTime = tbBusinessCar.getRealOutTime();
-            if (realInTime != null && realOutTime != null) {
-                BigDecimal price = calculationPartMoney(realInTime, realOutTime, tbBusinessCar.getCarSize());
-                tbBusinessCar.setMoney(price);
+        List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
+        TbDeductionBind bind = null;
+        BigDecimal partMoney = new BigDecimal(0);
+        String plate = null;
+        List<PriceBO> priceBOList = new ArrayList<>();
+        TbGoods tbGoods = tbGoodsService.getById(db.getGoodsId());
+        //该确认确未确认
+        if (tbGoods.getPayStep().equals(TbGoods.PayStep.AFTER_CONFIRM.getCode()) &&db.getAdminConfirmInput()==0) {
+            throw new AjaxError("该业务需要确认后才能收费");
+        }
+        for (TbBusinessCar tbBusinessCar : cars) {
+            String carNo = tbBusinessCar.getCarNo().toUpperCase();
+            String prefix=StrUtil.sub(carNo,0,1);
+            if (CAR_LIST.contains(prefix)&&tbGoods.getChinaCarPay()==1
+                    ||!CAR_LIST.contains(prefix)&&tbGoods.getVietnamCarPay()==1) {
+                Date realInTime = tbBusinessCar.getRealInTime();
+                Date realOutTime = tbBusinessCar.getRealOutTime();
+                if (realInTime != null && realOutTime != null) {
+                    BigDecimal price = calculationPartMoney(realInTime, realOutTime, tbBusinessCar.getCarSize());
+                    if (price.doubleValue() > 0) {
+                        PriceBO priceBO = new PriceBO();
+                        priceBO.setId(tbBusinessCar.getId()).setP(price);
+                        priceBOList.add(priceBO);
+                    }
+                    partMoney = partMoney.add(price);
+                    tbBusinessCar.setMoney(price);
+                }
             }
-            tbBusinessCar.setPay(1).setPayTime(now)
+            tbBusinessCar.setPay(1).setPayTime(payTime)
                     .setPayType(TbBusinessCar.PayTypeEnum.HAS_PAY_TYPE.getType());
-            tbBusinessCarService.updateById(tbBusinessCar);
-        });
-        List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
+            if (payType == TbBusiness.PayType.PER_PAY.getCode()) {
+                TbDeductionBind deductionBind = tbDeductionBindService.getBindCarByPlate(carNo);
+                if (deductionBind != null) {
+                    plate = carNo;
+                    bind = deductionBind;
+                }
+            }
+        }
+        BigDecimal itemPrice = db.getItemPrice();
+        BigDecimal money = itemPrice.add(partMoney);
+        if (payType == TbBusiness.PayType.PER_PAY.getCode()) {
+            if (bind == null) {
+                throw new AjaxError("车辆未绑定预支付款,无法完成收费");
+            }
+            TbAccount tbAccount = tbAccountService.getByCustomerId(bind.getCustomerId());
+            String key = AesUtil.reverse(tbAccount.getAccSalt());
+            BigDecimal balance = new BigDecimal(tbAccount.getTotalMoney());
+            if (balance.compareTo(money) < 0) {
+                throw new AjaxError("车辆绑定账户余额不足,无法完成收费");
+            }
+            balance = balance.subtract(money);
+            tbAccount.setTotalMoney(AesUtil.encryptECB(balance.toString(), key));
+            tbAccountService.updateById(tbAccount);
+            //生成扣款记录
+            String no = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + RandomUtil.randomNumbers(4);
+            if (partMoney.doubleValue() > 0 && !priceBOList.isEmpty()) {
+                //车辆的扣费记录
+                List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
+                        priceBOList, null, null, payTime, TbBusiness.PayType.PER_PAY);
+                automaticPay.createTbDeductionRecord(parkFeeDetailsList, tbAccount, plate, bind.getCustomerName(), no);
+            }
+            //生成收费明细
+            List<TbFeeDetails> tbFeeDetailsList = tbFeeDetailsService.chargeBusinessFee(
+                    items, null, null, payTime, TbBusiness.PayType.PER_PAY);
+            //生成扣费记录
+            automaticPay.createTbDeductionRecord(tbFeeDetailsList, tbAccount, plate, bind.getCustomerName(), no);
+        }
+        db.setPayStatus(TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode())
+                .setPayMoney(db.getItemPrice())
+                .setPayType(payType).setPayChannelType(payChannelType)
+                .setTransactionId(transactionId)
+                .setPayTime(payTime);
         items.forEach(tbBusinessItem -> tbBusinessItem
-                .setPayStatus(1).setPayTime(now)
+                .setPayStatus(1).setPayTime(payTime)
                 .setRemark(StrUtil.isEmpty(remark) ? "手动确认" : remark)
         );
+        this.updateById(db);
+        tbBusinessCarService.updateBatchById(cars);
         tbBusinessItemService.updateBatchById(items);
+        tbFeeStatisticsService.addOrUpdateStatistic(payTime);//更新当前日期的日统计
+        automaticPay.unbindRun(plate);
     }
 
     public void unBindCar(String id, String businessCarId) {
@@ -1518,11 +1585,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     }).
                     collect(Collectors.toList());
             if (!priceBOList.isEmpty()) {
-                tbFeeDetailsService.chargeParkFee(priceBOList, transactionId, outTradeNo, payTime, TbFeeDetails.ModuleEnum.OFFLINE.getDesc());//添加cars的收费明细
+                tbFeeDetailsService.chargeParkFee(priceBOList, transactionId, outTradeNo, payTime, TbBusiness.PayType.OFF_LINE_PAY);//添加cars的收费明细
             }
             if (tbBusiness.getPayStatus() == TbBusiness.PayStatus.HAS_PAY_CONFIRM.getCode()) {
                 List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(businessId);
-                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, TbFeeDetails.ModuleEnum.OFFLINE.getDesc());//添加items的收费明细
+                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, TbBusiness.PayType.OFF_LINE_PAY);//添加items的收费明细
             }
 
         }

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

@@ -10,6 +10,7 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.spring.SpringUtil;
 import cn.hutool.log.StaticLog;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.pj.api.wx.bo.PriceBO;
 import com.pj.current.task.Task;
 import com.pj.project.tb_account.TbAccount;
 import com.pj.project.tb_account.TbAccountService;
@@ -214,8 +215,9 @@ public class PayTask extends Task {
         //生成开票信息
         createTbInvoiceOrder(tbBusiness,cars,parkingMoneyBig);
         if(isOut){
-            List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.autoChargeParkFee(
-                    cars,null,null,now);
+            List<PriceBO> priceBOList=cars.stream().map(tbBusinessCar -> new PriceBO(tbBusinessCar.getId(),tbBusinessCar.getMoney())).collect(Collectors.toList());
+            List<TbFeeDetails> parkFeeDetailsList = tbFeeDetailsService.chargeParkFee(
+                    priceBOList,null,null,now,TbBusiness.PayType.PER_PAY);
             createTbDeductionRecord(parkFeeDetailsList,deductionBindService,tbFeeDetailsService,tbAccount,
                     tbBusiness,totalMoneyBig,plate);
             deductionBindService.autoUnbindCar(cars);

+ 2 - 0
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemMapper.xml

@@ -63,10 +63,12 @@
         <if test=' this.has("businessNo") '>and b.no = #{businessNo}</if>
         <if test=' this.has("businessId") '>and a.business_id = #{businessId}</if>
         <if test=' this.has("pickCustomerId") '>and a.pick_customer_id = #{pickCustomerId}</if>
+        <if test=' this.has("pickCustomerName") '>and a.pick_customer_name like concat('%', #{pickCustomerName},'%')</if>
         <if test=' this.has("itemCode") '>and a.item_code = #{itemCode}</if>
         <if test=' this.has("itemPrice") '>and a.item_price = #{itemPrice}</if>
         <if test=' this.has("itemName") '>and a.item_name like concat('%',#{itemName},'%')</if>
         <if test=' this.has("status") '>and a.status = #{status}</if>
+        <if test=' this.has("createTime") '>and date_format(a.create_time,'%Y-%m-%d') = #{createTime}</if>
         <if test=' this.has("operateTime") '>and a.operate_time = #{operateTime}</if>
         <if test=' this.has("operaror") '>and a.operaror = #{operaror}</if>
         <if test=' this.has("typeFlag") '>and a.business_type !='0'</if>

+ 0 - 9
sp-server/src/main/java/com/pj/project/tb_charge_record/TbChargeRecord.java

@@ -101,15 +101,6 @@ public class TbChargeRecord extends Model<TbChargeRecord> implements Serializabl
      */
     private Date createTime;
 
-//    /**
-//     * 联系号码
-//     */
-//    private String phone;
-//
-//    /**
-//     * 联系人
-//     */
-//    private String dutyPeople;
 
     /**
      * 充值人

+ 0 - 17
sp-server/src/main/java/com/pj/project/tb_charge_record/TbChargeRecordController.java

@@ -102,26 +102,9 @@ public class TbChargeRecordController {
     }
 
 
-    // ------------------------- 前端接口 -------------------------
 
 
     /**
-     * 改 - 不传不改 [G]
-     */
-    @RequestMapping("updateByNotNull")
-    public AjaxJson updateByNotNull(Long id) {
-        AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
-        // 鉴别身份,是否为数据创建者
-        long userId = SP.publicMapper.getColumnByIdToLong(TbChargeRecord.TABLE_NAME, "user_id", id);
-        AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
-        // 开始修改 (请只保留需要修改的字段)
-        SoMap so = SoMap.getRequestSoMap();
-        so.clearNotIn("id", "customerId", "customerName", "money", "chargeChannel", "createTime", "chargePeople", "no").clearNull().humpToLineCase();
-        int line = SP.publicMapper.updateBySoMapById(TbChargeRecord.TABLE_NAME, so, id);
-        return AjaxJson.getByLine(line);
-    }
-
-    /**
      * 获取打印单据信息
      * @param id
      * @return

+ 27 - 9
sp-server/src/main/java/com/pj/project/tb_charge_record/TbChargeRecordService.java

@@ -8,11 +8,16 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.constants.UserTypeEnum;
 import com.pj.current.satoken.StpUserUtil;
+import com.pj.project.tb_account.TbAccount;
+import com.pj.project.tb_account.TbAccountService;
+import com.pj.utils.AesUtil;
 import com.pj.utils.sg.NbUtil;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -30,6 +35,8 @@ public class TbChargeRecordService extends ServiceImpl<TbChargeRecordMapper, TbC
      */
     @Autowired
     TbChargeRecordMapper tbChargeRecordMapper;
+    @Resource
+    private TbAccountService tbAccountService;
 
     /**
      * 增
@@ -43,6 +50,16 @@ public class TbChargeRecordService extends ServiceImpl<TbChargeRecordMapper, TbC
      */
     int delete(Long id) {
         TbChargeRecord chargeRecord = tbChargeRecordMapper.selectById(id);
+        String key = AesUtil.reverse(chargeRecord.getSalt());
+        String preTopupMoney = chargeRecord.getPreTopupMoney();//充值金额
+        BigDecimal divMoney = new BigDecimal(AesUtil.decryptECB(preTopupMoney, key));
+        TbAccount tbAccount = tbAccountService.getById(chargeRecord.getAccountId());
+        String accountKey = AesUtil.reverse(tbAccount.getAccSalt());
+        BigDecimal totalMoney = new BigDecimal(AesUtil.decryptECB(tbAccount.getTotalMoney(), accountKey));
+        BigDecimal balance = totalMoney.subtract(divMoney);
+        String balanceMoney = AesUtil.encryptECB(balance.toString(), accountKey);
+        tbAccount.setTotalMoney(balanceMoney);
+        tbAccountService.updateById(tbAccount);
         chargeRecord.setStatus(0);
         chargeRecord.setUpdateBy(StpUserUtil.getLoginName());
         chargeRecord.setUpdateTime(new Date());
@@ -50,7 +67,7 @@ public class TbChargeRecordService extends ServiceImpl<TbChargeRecordMapper, TbC
     }
 
     /**
-     *  复审
+     * 复审
      */
     int review(Long id) {
         TbChargeRecord chargeRecord = tbChargeRecordMapper.selectById(id);
@@ -79,14 +96,14 @@ public class TbChargeRecordService extends ServiceImpl<TbChargeRecordMapper, TbC
      */
     List<TbChargeRecord> getList(SoMap so) {
         String customerId = StpUserUtil.getCustomerId();
-        if(!UserTypeEnum.PLATFORM_ADMIN.getCustomerId().equals(customerId)){
-            so.put("customerId",customerId);
+        if (!UserTypeEnum.PLATFORM_ADMIN.getCustomerId().equals(customerId)) {
+            so.put("customerId", customerId);
         }
-        if(ObjectUtil.isNotEmpty(so.get("createTime[]"))){
+        if (ObjectUtil.isNotEmpty(so.get("createTime[]"))) {
             JSONArray jsonArray = JSONUtil.parseArray(so.getString("createTime[]"));
-            if(jsonArray.size()==2){
-                so.put("startTime",jsonArray.get(0));
-                so.put("endTime",jsonArray.get(1));
+            if (jsonArray.size() == 2) {
+                so.put("startTime", jsonArray.get(0));
+                so.put("endTime", jsonArray.get(1));
             }
         }
         return tbChargeRecordMapper.getList(so);
@@ -94,11 +111,12 @@ public class TbChargeRecordService extends ServiceImpl<TbChargeRecordMapper, TbC
 
     /**
      * 根据 TbChargeRecord主键Id,获取打印单据信息集合
+     *
      * @param id
      * @return
      */
-    Map getPrintReceiptInfo(Long id){
-        if(id==null) return null;
+    Map getPrintReceiptInfo(Long id) {
+        if (id == null) return null;
         return tbChargeRecordMapper.getPrintReceiptInfo(id);
     }
 }

+ 6 - 0
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetails.java

@@ -37,6 +37,12 @@ public class TbFeeDetails implements Serializable {
      * 此模块对应的权限码
      */
     public static final String PERMISSION_CODE = "tb-fee-details";
+    public static final String TB_KAIDAN_CONFIRM = "tb-kaidan-confirm";
+    public static final String TB_DIAODU_CONFIRM = "tb-diaodu-confirm";
+    public static final String TB_JICHA_CONFIRM = "tb-jicha-confirm";
+    public static final String TB_JICHA_CANCEL = "tb-jicha-cancel";
+    public static final String TB_STATISTICS_PRINT = "tb-statistics-print";
+    public static final String TB_STATISTICS_EXPORT = "tb-statistics-export";
 
 
     // ---------- 表中字段 ----------

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

@@ -98,7 +98,8 @@ public class TbFeeDetailsController {
      * 导出日收费明细excel
      */
     @RequestMapping("export/details")
-    public AjaxJson exportDetails() throws Exception {
+    @SaCheckPermission(value = TbFeeDetails.TB_STATISTICS_EXPORT)
+    public AjaxJson exportDetails() {
         SoMap so = SoMap.getRequestSoMap();
         return AjaxJson.getSuccessData(tbFeeDetailsService.export(so));
     }
@@ -107,6 +108,7 @@ public class TbFeeDetailsController {
      * 准备打印的数据
      */
     @RequestMapping("prePrint")
+    @SaCheckPermission(value = TbFeeDetails.TB_STATISTICS_PRINT)
     public AjaxJson prePrint() {
         SoMap so = SoMap.getRequestSoMap();
         return AjaxJson.getSuccessData(tbFeeDetailsService.prePrint(so));
@@ -116,6 +118,7 @@ public class TbFeeDetailsController {
      * 开单员员确认
      */
     @RequestMapping("kaiDanConfirm")
+    @SaCheckPermission(value = TbFeeDetails.TB_KAIDAN_CONFIRM)
     public AjaxJson kaiDanConfirm() {
         List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
         tbFeeDetailsService.kaiDanConfirm(ids);
@@ -136,6 +139,7 @@ public class TbFeeDetailsController {
      * 统计稽查员确认
      */
     @RequestMapping("jiChaConfirm")
+    @SaCheckPermission(value = TbFeeDetails.TB_JICHA_CONFIRM)
     public AjaxJson jiChaConfirm() {
         List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
         tbFeeDetailsService.jiChaConfirm(ids);
@@ -146,6 +150,7 @@ public class TbFeeDetailsController {
      * 统计稽查员取消确认
      */
     @RequestMapping("jiChaCancel")
+    @SaCheckPermission(value = TbFeeDetails.TB_JICHA_CANCEL)
     public AjaxJson jiChaCancel() {
         List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
         tbFeeDetailsService.jiChaCancel(ids);

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

@@ -49,7 +49,9 @@ import com.pj.project4sp.global.BusinessException;
 import com.pj.project4sp.role.SpRole;
 import com.pj.project4sp.role.SpRoleMapper;
 import com.pj.project4sp.uploadfile.UploadUtil;
+import com.pj.utils.sg.AjaxError;
 import com.pj.utils.so.SoMap;
+import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.ss.usermodel.BorderStyle;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -211,7 +213,8 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
      * @param outTradeNo
      * @param now
      */
-    public void chargeParkFee(List<PriceBO> cars, String transactionId, String outTradeNo, Date now, String module) {
+    public List<TbFeeDetails> chargeParkFee(List<PriceBO> cars, String transactionId, String outTradeNo, Date now, TbBusiness.PayType payType) {
+        List<TbFeeDetails> details = new ArrayList<>();
         for (PriceBO bo1 : cars) {
             //本次支付的停车费金额
             BigDecimal payPrice = bo1.getP();
@@ -219,6 +222,10 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                 continue;
             }
             TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
+            String bindIdStr = "";
+            if (payType.getCode() == TbBusiness.PayType.PER_PAY.getCode()) {
+                bindIdStr = tbDeductionBindService.getBindId(car.getCarNo());
+            }
             //24小时内的停车费
             BigDecimal in24Price = partConfig.getBasePrice();
             TbFeeDetails in24Detail = new TbFeeDetails();
@@ -233,25 +240,27 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             }
             //24小时内的停车费
             in24Detail.setNum(1).setItemTypeName(TbFeeDetails.PartFeeEnum.IN_24_HOURS.getDesc())
-                    .setUnitPrice(in24Price).setItemPrice(in24Price);
+                    .setUnitPrice(in24Price).setItemPrice(in24Price).setModule(payType.getDesc()).setBusinessId(bindIdStr);
             setFee(in24Detail, car, transactionId, outTradeNo, now);
             String type = StrUtil.isEmpty(in24Detail.getId()) ? TbFeeDetails.SyncTypeEnum.INSERT.getCode() : TbFeeDetails.SyncTypeEnum.UPDATE.getCode();
             saveOrUpdate(in24Detail);
+            details.add(in24Detail);
             taskService.addTask(new FeeDetailSyncTask(RandomUtil.randomNumbers(10), 1000, in24Detail.getId(), type));
             //24小时外的停车费
             BigDecimal out24Price = payPrice.subtract(in24Price);
             if (out24Price.compareTo(BigDecimal.valueOf(0)) > 0) {
-
                 BigDecimal unitPrice = in24Price.add(partConfig.getExtraPrice());
                 int num = out24Price.divide(unitPrice, BigDecimal.ROUND_UP, 0).intValue();
                 out24Details.setNum(num).setItemTypeName(TbFeeDetails.PartFeeEnum.OUT_24_HOURS.getDesc())
-                        .setUnitPrice(unitPrice).setItemPrice(out24Price);
+                        .setUnitPrice(unitPrice).setItemPrice(out24Price).setModule(payType.getDesc()).setBusinessId(bindIdStr);
                 setFee(out24Details, car, transactionId, outTradeNo, now);
                 type = StrUtil.isEmpty(out24Details.getId()) ? TbFeeDetails.SyncTypeEnum.INSERT.getCode() : TbFeeDetails.SyncTypeEnum.UPDATE.getCode();
                 saveOrUpdate(out24Details);
                 taskService.addTask(new FeeDetailSyncTask(RandomUtil.randomNumbers(10), 1000, out24Details.getId(), type));
+                details.add(out24Details);
             }
         }
+        return details;
     }
 
     private void setFee(TbFeeDetails parkFee, TbBusinessCar car, String transactionId, String outTradeNo, Date now) {
@@ -287,27 +296,13 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
      * @param now
      * @param module        线上缴费/线下缴费
      */
-    public void chargeBusinessFee(List<TbBusinessItem> items, String transactionId, String outTradeNo, Date now, String module) {
+    public List<TbFeeDetails> chargeBusinessFee(List<TbBusinessItem> items, String transactionId, String outTradeNo, Date now, TbBusiness.PayType payType) {
+        String module = payType.getDesc();
         String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
         String toDay = DateUtil.format(now, "yyyy-MM-dd");
+        List<TbFeeDetails> feeDetails = new ArrayList<>();
         for (TbBusinessItem item : items) {
             Integer feeType = item.getPayType();
-//            String itemType = item.getItemTypeName();
-//            if (StrUtil.isNotEmpty(itemType)) {
-//                if (itemType.contains("核酸")) {
-//                    feeType = TbFeeStatistics.FeeTypeEnum.NUCLEIC_FEE.getCode();
-//                } else if (itemType.contains("消毒") || itemType.contains("消杀")) {
-//                    feeType = TbFeeStatistics.FeeTypeEnum.DISINFECT_FEE.getCode();
-//                } else if (itemType.contains("装卸")) {
-//                    feeType = TbFeeStatistics.FeeTypeEnum.STEVEDORE_FEE.getCode();
-//                } else if (StrUtil.equals(itemType, "特殊车辆") || StrUtil.equals(itemType, "汽车吊")) {
-//                    feeType = TbFeeStatistics.FeeTypeEnum.STEVEDORE_FEE.getCode();
-//                } else if (itemType.contains("入场管理")) {
-//                    feeType = TbFeeStatistics.FeeTypeEnum.MANAGE_FEE.getCode();
-//                } else if (StrUtil.equals(itemType, "充电打冷")) {
-//                    feeType = TbFeeStatistics.FeeTypeEnum.CHARGE_FEE.getCode();
-//                }
-//            }
             Double taxRate = item.getTaxRate();
             //添加此item的收费明细
             TbBusiness business = tbBusinessService.getById(item.getBusinessId());
@@ -319,14 +314,13 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             taxPrice = taxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
             BigDecimal noTaxPrice = item.getTotal().subtract(taxPrice);
             noTaxPrice = noTaxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
-
             String carNo = business.getCardNo();
             if (StrUtil.isEmpty(business.getCardNo())) {
                 carNo = business.getChinaCarNo();
             }
             TbGoods businessCfg = tbGoodsService.getById(business.getGoodsId());
-            if ((TbGoods.LeaveEnum.BUSINESS_MONEY.getCode() == businessCfg.getChinaCarLeave() || TbGoods.LeaveEnum.APART_BUSINESS.getCode() == businessCfg.getChinaCarLeave())
-                    && TbGoods.LeaveEnum.BUSINESS_MONEY.getCode() != businessCfg.getVietnamCarLeave() && TbGoods.LeaveEnum.APART_BUSINESS.getCode() != businessCfg.getVietnamCarLeave()) {
+            if ((TbGoods.LeaveEnum.BUSINESS_MONEY.getCode().equals(businessCfg.getChinaCarLeave())
+                    || TbGoods.LeaveEnum.APART_BUSINESS.getCode().equals(businessCfg.getChinaCarLeave()))) {
                 carNo = business.getChinaCarNo();
             }
             String businessCarIds = "";
@@ -359,7 +353,9 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             String type = StrUtil.isEmpty(businessFeeDetail.getId()) ? TbFeeDetails.SyncTypeEnum.INSERT.getCode() : TbFeeDetails.SyncTypeEnum.UPDATE.getCode();
             saveOrUpdate(businessFeeDetail);
             taskService.addTask(new FeeDetailSyncTask(RandomUtil.randomNumbers(10), 1000, businessFeeDetail.getId(), type));
+            feeDetails.add(businessFeeDetail);
         }
+        return feeDetails;
     }
 
     /*public String export(SoMap so) throws Exception{
@@ -472,7 +468,10 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         BigDecimal allDayNoTaxFee = new BigDecimal(0);
         List<ExportFeeDetailDTO> exportList = new ArrayList<>();
         List<TbFeeDetails> list = this.getList(so);
-        Integer index = 1;
+        if (list.size() > 10000) {
+            throw new AjaxError("导出数据量过大,请筛选");
+        }
+        int index = 1;
         for (TbFeeDetails feeDetails : list) {
             String feeType = TbFeeDetails.fee.getDesc(feeDetails.getFeeType());
             ExportFeeDetailDTO detailDTO = new ExportFeeDetailDTO();
@@ -715,10 +714,6 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     public void kaiDanConfirm(List<Long> ids) {
         SpAdmin admin = StpUserUtil.getAdmin();
-        SpRole role = spRoleMapper.getById(Long.valueOf(admin.getRoleId()));
-        if (!StrUtil.equals(TbFeeDetails.personEnum.KAIDAN.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())) {
-            throw new BusinessException("无操作权限");
-        }
         List<TbFeeDetails> detailsList = this.listByIds(ids);
         Set<String> days = new HashSet<>();
         for (TbFeeDetails detail : detailsList) {
@@ -868,22 +863,6 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         String toDay = DateUtil.format(now, "yyyy-MM-dd");
         for (TbBusinessItem item : items) {
             Integer feeType = item.getPayType();
-            String itemType = item.getItemTypeName();
-            if (StrUtil.isNotEmpty(itemType)) {
-                if (itemType.contains("核酸")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.NUCLEIC_FEE.getCode();
-                } else if (itemType.contains("消毒") || itemType.contains("消杀")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.DISINFECT_FEE.getCode();
-                } else if (itemType.contains("装卸")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.STEVEDORE_FEE.getCode();
-                } else if (StrUtil.equals(itemType, "特殊车辆") || StrUtil.equals(itemType, "汽车吊")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.STEVEDORE_FEE.getCode();
-                } else if (itemType.contains("入场管理")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.MANAGE_FEE.getCode();
-                } else if (StrUtil.equals(itemType, "充电打冷")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.CHARGE_FEE.getCode();
-                }
-            }
             Double taxRate = item.getTaxRate();
             //添加此item的收费明细
             TbBusiness business = tbBusinessService.getById(item.getBusinessId());
@@ -919,12 +898,12 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             businessCarNos = StrUtil.sub(businessCarNos, 0, businessCarNos.length() - 1);
             businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
                     .setBusinessItemNo(item.getNo()).setBusinessCarId(businessCarIds).setBusinessCarNo(businessCarNos)
-                    .setCarNo(carNo)
+                    .setCarNo(carNo).setModule(TbBusiness.PayType.PER_PAY.getDesc())
                     .setItemPrice(item.getTotal()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
                     .setFeeType(feeType)
                     .setItemTypeId(item.getItemTypeId()).setItemTypeName(item.getItemTypeName())
                     .setItemId(item.getItemId()).setItemName(item.getItemName())
-                    .setPayDay(toDay).setPayType(5).setCreateTime(now).setUpdateTime(now)
+                    .setPayDay(toDay).setPayType(TbBusiness.PayType.PER_PAY.getCode()).setCreateTime(now).setUpdateTime(now)
                     .setBusinessItemId(item.getId() + "")
                     .setPickCustomerName(item.getPickCustomerName())
                     .setCustomerName(business.getCustomerName())
@@ -937,82 +916,6 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         return feeDetails;
     }
 
-    /**
-     * 预充值自动缴费-停车费明细生成
-     *
-     * @param cars
-     * @param transactionId
-     * @param outTradeNo
-     * @param now
-     */
-    public List<TbFeeDetails> autoChargeParkFee(List<TbBusinessCar> cars, String transactionId, String outTradeNo, Date now) {
-        log.info("进入计算停车费:{}", JSONUtil.toJsonStr(cars));
-        List<TbFeeDetails> feeDetails = new ArrayList<TbFeeDetails>();
-        String payDay = DateUtil.format(now, "yyyy-MM-dd");
-        for (TbBusinessCar car : cars) {
-
-            //TbBusinessCar car = bo1;
-            String bindIdStr = tbDeductionBindService.getBindId(car.getCarNo());
-            //thisCarAllFeeList是当前放行记录的车辆的所有日期的白天停车和夜间停车明细
-            List<TbFeeDetails> thisCarAllFeeList = getByBusinessCarIdAndCarNoAndFeeType(car.getId(), car.getCarNo(), TbFeeDetails.fee.PARK_FEE.getCode());
-            //不是当前日期,当前放行记录的车辆在之前的日期付的钱
-            BigDecimal notToDayMoney = new BigDecimal(0);
-            for (TbFeeDetails d : thisCarAllFeeList) {
-                if (!StrUtil.equals(payDay, d.getPayDay())) {
-                    notToDayMoney = notToDayMoney.add(d.getItemPrice());
-                }
-            }
-            //当前日期付的钱 = 改放行记录总的停车费-之前日前的钱
-            BigDecimal thisDayMoney = car.getMoney().subtract(notToDayMoney);
-
-            //oldFeeList是当前日期的白天停车和夜间停车明细
-            List<TbFeeDetails> oldFeeList = getByBusinessCarIdAndCarNoAndFeeTypeAndPayDay(car.getId(), car.getCarNo(), TbFeeDetails.fee.PARK_FEE.getCode(), payDay);
-            TbFeeDetails nightParkFee = new TbFeeDetails();
-            TbFeeDetails dayParkFee = new TbFeeDetails();
-            String transactionIdStr = "";
-            String outTradeNoStr = "";
-            for (TbFeeDetails oldFee : oldFeeList) {
-                if (!StrUtil.isEmpty(oldFee.getTransactionId())) {
-                    transactionIdStr = oldFee.getTransactionId();
-                    outTradeNoStr = oldFee.getOutTradeNo();
-                }
-                if (StrUtil.equals(oldFee.getItemTypeName(), "白天停车")) {
-                    dayParkFee = oldFee;
-                }
-                if (StrUtil.equals(oldFee.getItemTypeName(), "夜间停车")) {
-                    nightParkFee = oldFee;
-                }
-            }
-            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) {
-                nightParkFee.setNum(nightFeeNum.intValue()).setItemTypeName("夜间停车")
-                        .setUnitPrice(baseNightPrice).setItemPrice(baseNightPrice.multiply(nightFeeNum));
-                setFeeAuto(nightParkFee, car, transactionIdStr, outTradeNoStr, now);
-                nightParkFee.setDeductionBindId(bindIdStr);
-                saveOrUpdate(nightParkFee);
-                feeDetails.add(nightParkFee);
-                if (qr[1].compareTo(BigDecimal.valueOf(0)) == 0 && dayParkFee.getId() != null) {
-                    delete(Long.valueOf(dayParkFee.getId()));
-                }
-            }
-            if (qr[1].compareTo(BigDecimal.valueOf(0)) > 0) {
-                dayParkFee.setNum(1).setItemTypeName("白天停车").setUnitPrice(qr[1]).setItemPrice(qr[1]);
-                setFeeAuto(dayParkFee, car, transactionIdStr, outTradeNoStr, now);
-                dayParkFee.setDeductionBindId(bindIdStr);
-                saveOrUpdate(dayParkFee);
-                feeDetails.add(dayParkFee);
-            }
-        }
-        return feeDetails;
-    }
 
     private void setFeeAuto(TbFeeDetails parkFee, TbBusinessCar car, String transactionId, String outTradeNo, Date now) {
         String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");

+ 3 - 0
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatistics.java

@@ -36,6 +36,7 @@ public class TbFeeStatistics implements Serializable {
      * 此模块对应的权限码
      */
     public static final String PERMISSION_CODE = "tb-fee-statistics";
+    public static final String PERMISSION_CODE_JUDGE = "tb-fee-statistics-judge";
 
 
     // ---------- 表中字段 ----------
@@ -122,6 +123,8 @@ public class TbFeeStatistics implements Serializable {
      * 现场调度
      */
     private String diaoDuPerson;
+    private String judgeBy="";
+    private Date judgeTime;
 
     @TableField(exist = false)
     private BigDecimal statisticsMoney = new BigDecimal(0);

+ 10 - 15
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsController.java

@@ -153,27 +153,22 @@ public class TbFeeStatisticsController {
         return AjaxJson.getSuccess();
     }
 
-
-    // ------------------------- 前端接口 -------------------------
-
-
     /**
-     * 改 - 不传不改 [G]
+     * 审核
+     * @return
      */
-    @RequestMapping("updateByNotNull")
-    public AjaxJson updateByNotNull(Long id) {
-        AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
-        // 鉴别身份,是否为数据创建者
-        long userId = SP.publicMapper.getColumnByIdToLong(TbFeeStatistics.TABLE_NAME, "user_id", id);
-        AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
-        // 开始修改 (请只保留需要修改的字段)
+    @RequestMapping("judge")
+    @SaCheckPermission(value = TbFeeStatistics.PERMISSION_CODE_JUDGE)
+    public AjaxJson judge() {
         SoMap so = SoMap.getRequestSoMap();
-        so.clearNotIn("id", "feeType", "feeTypeId", "feeTypeName", "itemTypeId", "itemTypeName", "year", "month", "dayTime", "num", "taxMoney", "taxRate", "noTaxMoney", "payType").clearNull().humpToLineCase();
-        int line = SP.publicMapper.updateBySoMapById(TbFeeStatistics.TABLE_NAME, so, id);
-        return AjaxJson.getByLine(line);
+        Long id=so.getLong("id");
+       tbFeeStatisticsService.judge(id);
+        return AjaxJson.getSuccess();
     }
 
 
+
+
     @RequestMapping(value = "getFeeType")
     public AjaxJson getFeeType() {
         return AjaxJson.getSuccessData(TbFeeStatistics.getList());

+ 12 - 103
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java

@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.api.wx.bo.PriceBO;
 import com.pj.current.config.MyConfig;
 import com.pj.current.config.PartConfig;
+import com.pj.current.satoken.StpUserUtil;
 import com.pj.project.relation_business_car.RelationBusinessCar;
 import com.pj.project.relation_business_car.RelationBusinessCarService;
 import com.pj.project.tb_business.TbBusiness;
@@ -197,107 +198,6 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
 
 
     /**
-     * 弃用
-     */
-    public void countBusinessFee(List<TbBusinessItem> items, String transactionId, String outTradeNo, Date now) {
-
-        String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
-        String toDay = DateUtil.format(now, "yyyy-MM-dd");
-        String thisYear = StrUtil.sub(toDay, 0, 4);
-        String thisMonth = StrUtil.sub(toDay, 0, 7);
-        for (TbBusinessItem item : items) {
-            Integer feeType = item.getPayType();
-            String itemType = item.getItemTypeName();
-            if (StrUtil.isNotEmpty(itemType)) {
-                if (itemType.contains("核酸")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.NUCLEIC_FEE.getCode();
-                } else if (itemType.contains("消毒") || itemType.contains("消杀")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.DISINFECT_FEE.getCode();
-                } else if (itemType.contains("装卸")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.STEVEDORE_FEE.getCode();
-                } else if (StrUtil.equals(itemType, "特殊车辆") || StrUtil.equals(itemType, "汽车吊")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.STEVEDORE_FEE.getCode();
-                } else if (itemType.contains("入场管理")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.MANAGE_FEE.getCode();
-                } else if (StrUtil.equals(itemType, "充电打冷")) {
-                    feeType = TbFeeStatistics.FeeTypeEnum.CHARGE_FEE.getCode();
-                }
-            }
-
-            Double taxRate = item.getTaxRate();
-
-            TbFeeStatistics businessFee = this.getByDayAndFeeType(toDay, feeType);
-            if (businessFee == null) {
-                businessFee = new TbFeeStatistics();
-                businessFee.setTaxRate(BigDecimal.valueOf(taxRate));
-            }
-            businessFee.setTaxMoney(businessFee.getTaxMoney().add(item.getTotal()));//含税收入
-            businessFee.setNum(businessFee.getNum() + Integer.valueOf(item.getNum()));
-            BigDecimal taxes = item.getTotal()
-                    .divide(BigDecimal.valueOf(1).add(businessFee.getTaxRate()), 2, BigDecimal.ROUND_HALF_UP)
-                    .multiply(businessFee.getTaxRate());
-            taxes = taxes.setScale(2, BigDecimal.ROUND_HALF_UP);
-            BigDecimal noTaxMoney = item.getTotal().subtract(taxes);
-            noTaxMoney = noTaxMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
-
-            businessFee.setNoTaxMoney(businessFee.getNoTaxMoney().add(noTaxMoney))
-                    .setTaxes(businessFee.getTaxes().add(taxes));
-            businessFee.setDayTime(now).setMonth(thisMonth).setYear(thisYear).setDay(toDay)
-                    .setFeeType(feeType)
-                    //.setItemTypeName(itemType)
-                    .setPayType(3);
-            this.saveOrUpdate(businessFee);
-            /*-----------------分割线------------------*/
-            //添加此item的收费明细
-            TbBusiness business = tbBusinessService.getById(item.getBusinessId());
-            TbFeeDetails businessFeeDetail = new TbFeeDetails();
-            businessFeeDetail.setTaxRate(BigDecimal.valueOf(taxRate));
-            BigDecimal taxPrice = item.getTotal()
-                    .divide(BigDecimal.valueOf(1).add(businessFeeDetail.getTaxRate()), 2, BigDecimal.ROUND_HALF_UP)
-                    .multiply(businessFeeDetail.getTaxRate());
-            taxPrice = taxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
-            BigDecimal noTaxPrice = item.getTotal().subtract(taxPrice);
-            noTaxPrice = noTaxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
-
-            String carNo = business.getCardNo();
-            if (StrUtil.isEmpty(business.getCardNo())) {
-                carNo = business.getChinaCarNo();
-            }
-            TbGoods businessCfg = tbGoodsService.getById(business.getGoodsId());
-            if ((TbGoods.LeaveEnum.BUSINESS_MONEY.getCode() == businessCfg.getChinaCarLeave() || TbGoods.LeaveEnum.APART_BUSINESS.getCode() == businessCfg.getChinaCarLeave())
-                    && TbGoods.LeaveEnum.BUSINESS_MONEY.getCode() != businessCfg.getVietnamCarLeave() && TbGoods.LeaveEnum.APART_BUSINESS.getCode() != businessCfg.getVietnamCarLeave()) {
-                carNo = business.getChinaCarNo();
-            }
-            String businessCarIds = "";
-            String businessCarNos = "";
-            List<RelationBusinessCar> relation = relationBusinessCarService.findByBusinessId(item.getBusinessId());
-            for (RelationBusinessCar rela : relation) {
-                TbBusinessCar bt = tbBusinessCarService.getById(rela.getBusinessCarId());
-                if (StrUtil.contains(carNo, bt.getCarNo())) {
-                    businessCarIds += bt.getId() + ",";
-                    businessCarNos += bt.getNo() + ",";
-                }
-            }
-            businessCarIds = StrUtil.sub(businessCarIds, 0, businessCarIds.length() - 1);
-            businessCarNos = StrUtil.sub(businessCarNos, 0, businessCarNos.length() - 1);
-            businessFeeDetail.setBusinessId(item.getBusinessId()).setBusinessNo(business.getNo())
-                    .setBusinessItemNo(item.getNo()).setBusinessCarId(businessCarIds).setBusinessCarNo(businessCarNos)
-                    .setCarNo(carNo)
-                    .setItemPrice(item.getTotal()).setUnitPrice(item.getItemPrice()).setNoTaxPrice(noTaxPrice).setTaxPrice(taxPrice)
-                    .setFeeType(feeType)
-                    .setItemTypeId(item.getItemTypeId()).setItemTypeName(item.getItemTypeName())
-                    .setItemId(item.getItemId()).setItemName(item.getItemName())
-                    .setPayDay(toDay).setPayType(3).setCreateTime(now)
-                    .setBusinessItemId(item.getId() + "")
-                    .setPickCustomerName(item.getPickCustomerName())
-                    .setIsSettle(1).setPayMode(1).setPayTime(nowStr).setWeight(business.getNetWeight())
-                    .setTransactionId(transactionId).setOutTradeNo(outTradeNo)
-                    .setNum(Integer.valueOf(item.getNum()));
-            tbFeeDetailsService.saveOrUpdate(businessFeeDetail);
-        }
-    }
-
-    /**
      * 照搬收费明细到日统计
      */
     public void addOrUpdateStatistic(Date now) {
@@ -447,7 +347,6 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
 
     public PrintDayStatsDTO prePrint(SoMap so) {
         so.clearNull();
-
         String beginTimeStr = "";
         String endTimeStr = "";
         String isMonth = so.getString("isMonth");
@@ -494,7 +393,8 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
                     .setWxPrice(stats.getTaxMoney())
                     .setKaiDanPerson(stats.getKaiDanPerson() != null ? stats.getKaiDanPerson() : "")
                     .setJiChaPerson(stats.getJiChaPerson() != null ? stats.getJiChaPerson() : "")
-                    .setDiaoDuPerson(stats.getDiaoDuPerson() != null ? stats.getDiaoDuPerson() : "");
+                    .setDiaoDuPerson(stats.getDiaoDuPerson() != null ? stats.getDiaoDuPerson() : "")
+                    .setJudgeBy(stats.getJudgeBy()==null?"":stats.getJudgeBy());
             if (StrUtil.isNotEmpty(isMonth)) {
                 dayStatsDTO.setDayTime(stats.getMonth());
             }
@@ -628,4 +528,13 @@ public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, T
         return tbFeeStatisticsMapper.getSum(so);
     }
 
+    /**
+     * 审核
+     * @param id
+     */
+    public void judge(Long id) {
+      TbFeeStatistics tbFeeStatistics=  this.getById(id);
+        tbFeeStatistics.setJudgeTime(new Date()).setJudgeBy(StpUserUtil.getCreateBy());
+        this.updateById(tbFeeStatistics);
+    }
 }

+ 4 - 0
sp-server/src/main/java/com/pj/project/tb_fee_statistics/dto/ExportDayStatsDTO.java

@@ -74,5 +74,9 @@ public class ExportDayStatsDTO {
      * 复核员
      */
     private String diaoDuPerson;
+    /**
+     * 审核员
+     */
+    private String judgeBy;
 
 }

+ 3 - 0
sp-server/src/main/java/com/pj/project/tb_goods/TbGoods.java

@@ -88,6 +88,9 @@ public class TbGoods extends Model<TbGoods> implements Serializable {
      * 申报时间是否必填(1=是,0=否)
      */
     private Integer needOperateTime = 1;
+    /**
+     * 1: '下单后', 2: '确认后'
+     */
     private Integer payStep = 2;
     private Integer chinaCarPay = 1;
     private Integer vietnamCarPay = 1;

+ 4 - 0
sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeService.java

@@ -16,6 +16,7 @@ import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.project.tb_item.TbItem;
 import com.pj.project.tb_item.TbItemService;
 import com.pj.utils.so.SoMap;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -122,6 +123,9 @@ public class TbItemTypeService extends ServiceImpl<TbItemTypeMapper, TbItemType>
             List<String> itemIds = list.stream().map(RelationTypeItem::getItemId).collect(Collectors.toList());
 
             TbItemType tbItemType = this.getById(typeId);
+            if (tbItemType==null) {
+                continue;
+            }
             tbItemType.setNeed(relationGoodsType.getNeedSelect());
             List<TbItem> items = new ArrayList<>();
             if (!itemIds.isEmpty()) {