Эх сурвалжийг харах

年月日收费统计报表

lzm 3 жил өмнө
parent
commit
b3f3375023

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

@@ -141,4 +141,15 @@ var menuList =	[
 			{id: 'tb-discount-add', name: '折扣管理-添加', url: 'sa-view/tb-discount/tb-discount-add.html'},
 		]
 	},
+	{
+		id: 'tb-fee-statistics',
+		name: '收费统计',
+		icon: 'el-icon-folder-opened',
+		info: '收费统计表表数据的维护',
+		childList: [
+			{id: 'tb-fee-statistics-list', name: '日统计', url: 'sa-view/tb-fee-statistics/tb-fee-statistics-list.html'},
+			{id: 'month-statistcs.html', name: '月统计', url: 'sa-view/tb-fee-statistics/month-statistcs.html'},
+			{id: 'year-statistcs.html', name: '年统计', url: 'sa-view/tb-fee-statistics/year-statistcs.html'},
+		]
+	},
 ]

+ 124 - 0
sp-admin/sa-view/tb-fee-statistics/month-statistcs.html

@@ -0,0 +1,124 @@
+<!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="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+    <link rel="stylesheet" href="../../static/sa.css">
+    <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
+    <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
+    <script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
+    <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
+    <script src="https://www.layuicdn.com/layer-v3.1.1/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-select>
+            </div>
+            <div class="c-item">
+                <label class="c-label">日期:</label>
+                <el-date-picker type="month" value-format="yyyy-MM" v-model="p.month"></el-date-picker>
+            </div>
+            <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+            <br/>
+        </el-form>
+        <!-- ------------- 快捷按钮 ------------- -->
+        <div class="fast-btn">
+            <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
+        </div>
+        <!-- ------------- 数据列表 ------------- -->
+        <el-table class="data-table" ref="data-table" :data="dataList">
+            <sa-td type="selection"></sa-td>
+            <sa-td name="收费类型" prop="feeType" type="enum"
+                   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费'}"></sa-td>
+            <sa-td name="月份" prop="month" ></sa-td>
+            <sa-td name="收入(元)" prop="statisticsMoney"></sa-td>
+            <!--					<el-table-column label="操作" fixed="right"  width="240px">-->
+            <!--						<template slot-scope="s">-->
+            <!--							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>-->
+            <!--							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>-->
+            <!--							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>-->
+            <!--						</template>-->
+            <!--					</el-table-column>-->
+        </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: 0		// 排序方式
+            },
+            dataCount: 0,
+            dataList: [], // 数据集合
+        },
+        methods: {
+            // 刷新
+            f5: function () {
+                sa.ajax('/TbFeeStatistics/getMonth', sa.removeNull(this.p), function (res) {
+                    this.dataList = res.data; // 数据
+                    this.dataCount = res.dataCount; // 数据总数
+                    sa.f5TableHeight();		// 刷新表格高度
+                }.bind(this));
+            },
+            // 查看
+            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>

+ 132 - 0
sp-admin/sa-view/tb-fee-statistics/tb-fee-statistics-list.html

@@ -0,0 +1,132 @@
+<!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="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
+		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
+		<script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
+		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
+		<script src="https://www.layuicdn.com/layer-v3.1.1/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>
+<!--					<sa-item type="enum" name="收费类型" v-model="p.feeType" -->
+<!--						:jv="{1: '核酸检测', 3: '装卸作业', 4: '停车费', 5: '过磅费'}" jtype="2" def="不限"></sa-item>-->
+					<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-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>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<br />
+				</el-form>
+				<!-- ------------- 快捷按钮 ------------- -->
+				<div class="fast-btn">
+					<el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
+				</div>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList" >
+					<sa-td type="selection"></sa-td>
+					<sa-td name="收费类型" prop="feeType" type="enum"
+						   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费'}"></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>
+					<sa-td name="税率" prop="taxRate" ></sa-td>
+					<sa-td name="不含税收入(元)" prop="noTaxMoney" ></sa-td>
+					<sa-td name="支付方式" prop="payType" type="enum" :jv="{3: '微信支付'}"></sa-td>
+<!--					<el-table-column label="操作" fixed="right"  width="240px">-->
+<!--						<template slot-scope="s">-->
+<!--							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>-->
+<!--							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>-->
+<!--							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>-->
+<!--						</template>-->
+<!--					</el-table-column>-->
+				</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: [], // 数据集合 
+				},
+				methods: {
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbFeeStatistics/getList', sa.removeNull(this.p), function(res) {
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight();		// 刷新表格高度 
+						}.bind(this));
+					},
+					// 查看
+					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>

+ 124 - 0
sp-admin/sa-view/tb-fee-statistics/year-statistcs.html

@@ -0,0 +1,124 @@
+<!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="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
+    <link rel="stylesheet" href="../../static/sa.css">
+    <script src="https://unpkg.com/vue@2.6.10/dist/vue.js"></script>
+    <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
+    <script src="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.js"></script>
+    <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
+    <script src="https://www.layuicdn.com/layer-v3.1.1/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-select>
+            </div>
+            <div class="c-item">
+                <label class="c-label">日期:</label>
+                <el-date-picker type="year" value-format="yyyy" v-model="p.year"></el-date-picker>
+            </div>
+            <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+            <br/>
+        </el-form>
+        <!-- ------------- 快捷按钮 ------------- -->
+        <div class="fast-btn">
+            <el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
+        </div>
+        <!-- ------------- 数据列表 ------------- -->
+        <el-table class="data-table" ref="data-table" :data="dataList">
+            <sa-td type="selection"></sa-td>
+            <sa-td name="收费类型" prop="feeType" type="enum"
+                   :jv="{1: '核酸检测',2: '消杀作业', 3: '装卸作业', 4: '停车费', 5: '过磅费', 6: '入场管理费'}"></sa-td>
+            <sa-td name="年份" prop="year"></sa-td>
+            <sa-td name="收入(元)" prop="statisticsMoney"></sa-td>
+                <!--					<el-table-column label="操作" fixed="right"  width="240px">-->
+                <!--						<template slot-scope="s">-->
+                <!--							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>-->
+                <!--							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>-->
+                <!--							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>-->
+                <!--						</template>-->
+                <!--					</el-table-column>-->
+        </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: 0		// 排序方式
+            },
+            dataCount: 0,
+            dataList: [], // 数据集合
+        },
+        methods: {
+            // 刷新
+            f5: function () {
+                sa.ajax('/TbFeeStatistics/getYear', sa.removeNull(this.p), function (res) {
+                    this.dataList = res.data; // 数据
+                    this.dataCount = res.dataCount; // 数据总数
+                    sa.f5TableHeight();		// 刷新表格高度
+                }.bind(this));
+            },
+            // 查看
+            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>

+ 0 - 1
sp-server/app.pid

@@ -1 +0,0 @@
-33632

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

@@ -24,6 +24,7 @@ import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_business_item.TbBusinessItemService;
 import com.pj.project.tb_costomer.TbCostomer;
 import com.pj.project.tb_costomer.TbCostomerService;
+import com.pj.project.tb_fee_statistics.TbFeeStatisticsService;
 import com.pj.project.tb_pay_record.TbPayRecord;
 import com.pj.project.tb_pay_record.TbPayRecordService;
 import com.pj.utils.cache.RedisUtil;
@@ -63,6 +64,8 @@ public class WxService {
     @Resource
     @Lazy
     TbBusinessItemService tbBusinessItemService;
+    @Resource
+    TbFeeStatisticsService tbFeeStatisticsService;
 
     /**
      * 统一下单接口
@@ -167,6 +170,7 @@ public class WxService {
         if (StrUtil.isNotEmpty(attachStr)) {
             Attach attach = JSONUtil.toBean(attachStr, Attach.class);
             List<PriceBO> cars = JSONUtil.toList(attach.getC(), PriceBO.class);
+            tbFeeStatisticsService.countParkFee(cars);
             for (PriceBO bo1 : cars) {
                 TbBusinessCar car = tbBusinessCarService.getById(bo1.getId());
                 BigDecimal price = bo1.getP();
@@ -180,6 +184,7 @@ public class WxService {
             String businessId = attach.getB();
             if (StrUtil.isNotEmpty(businessId)) {
                 List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(businessId);
+                tbFeeStatisticsService.countBusinessFee(items);
                 items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setPayTime(now));
                 tbBusinessItemService.updateBatchById(items);
                 TbBusiness tbBusiness = tbBusinessService.getById(businessId);

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCar.java

@@ -43,7 +43,7 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 	 *  
 	 */
 	@TableId(type = IdType.AUTO)
-	private Long id;
+	private String id;
 
 	/**
 	 *  

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

@@ -0,0 +1,127 @@
+package com.pj.project.tb_fee_statistics;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.Getter;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_fee_statistics -- 收费统计表
+ * @author lzm 
+ */
+@Data
+@Accessors(chain = true)
+public class TbFeeStatistics implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_fee_statistics";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-fee-statistics";	
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+    private String id;
+
+	/**
+	 * 收费类型(1=核酸检测,2消杀作业,3=装卸作业,4=停车费,5=过磅费) 
+	 */
+    private Integer feeType;
+
+
+	/**
+	 * 业务类型id 
+	 */
+    private String itemTypeId;
+
+	/**
+	 * 业务类型 
+	 */
+    private String itemTypeName;
+
+	/**
+	 * 年份 
+	 */
+    private String year;
+
+	/**
+     * 月份
+     */
+    private String month;
+
+    /**
+     * 天
+     */
+    private String day;
+
+	/**
+	 * 日期 
+	 */
+    private Date dayTime;
+
+	/**
+	 * 数量 
+	 */
+    private Integer num = 0;
+
+	/**
+	 * 税款 
+	 */
+	public BigDecimal taxMoney = new BigDecimal(0);
+
+	/**
+	 * 税率 
+	 */
+    private BigDecimal taxRate = new BigDecimal(0);
+
+	/**
+	 * 不含税款 
+	 */
+    private BigDecimal noTaxMoney = new BigDecimal(0);
+
+	/**
+	 * 支付方式(1=微信支付) 
+	 */
+    private Integer payType;
+
+    @TableField(exist = false)
+    private BigDecimal statisticsMoney = new BigDecimal(0);
+
+    @Getter
+    @AllArgsConstructor
+    //(1=核酸检测,2=消杀作业,3=装卸作业,4=停车费,5=过磅费)
+    public static enum feeType{
+        NUCLEIC_FEE(1,"核酸检测"),
+        DISINFECT_FEE(2,"消杀作业"),
+        STEVEDORE_FEE(3,"装卸作业"),
+        PARK_FEE(4,"停车费"),
+        WEIGHT_FEE(5,"过磅费"),
+        MANAGE_FEE(6, "入场管理费");
+        private int code;
+        private String desc;
+    }
+
+
+
+
+
+	
+
+
+}

+ 119 - 0
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsController.java

@@ -0,0 +1,119 @@
+package com.pj.project.tb_fee_statistics;
+
+import java.util.List;
+
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_fee_statistics -- 收费统计表
+ * @author lzm 
+ */
+@RestController
+@RequestMapping("/TbFeeStatistics/")
+public class TbFeeStatisticsController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbFeeStatisticsService tbFeeStatisticsService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbFeeStatistics.PERMISSION_CODE)
+	@Transactional(rollbackFor = Exception.class)
+	public AjaxJson add(TbFeeStatistics t){
+		tbFeeStatisticsService.add(t);
+		t = tbFeeStatisticsService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbFeeStatistics.PERMISSION_CODE)
+	public AjaxJson delete(Long id){
+		int line = tbFeeStatisticsService.delete(id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbFeeStatistics.PERMISSION_CODE)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbFeeStatistics.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbFeeStatistics.PERMISSION_CODE)
+	public AjaxJson update(TbFeeStatistics t){
+		int line = tbFeeStatisticsService.update(t);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbFeeStatistics t = tbFeeStatisticsService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbFeeStatistics> list = tbFeeStatisticsService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+    @RequestMapping("getMonth")
+    public AjaxJson getMonth() {
+        SoMap so = SoMap.getRequestSoMap();
+        List<TbFeeStatistics> list = tbFeeStatisticsService.getMonth(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+
+    @RequestMapping("getYear")
+    public AjaxJson getYear() {
+        SoMap so = SoMap.getRequestSoMap();
+        List<TbFeeStatistics> list = tbFeeStatisticsService.getYear(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+	
+	
+	
+	
+	// ------------------------- 前端接口 -------------------------
+	
+	
+	/** 改 - 不传不改 [G] */
+	@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(), "此数据您无权限修改");
+		// 开始修改 (请只保留需要修改的字段)
+		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);
+	}
+	
+	
+	
+	
+	
+	
+
+}

+ 62 - 0
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsMapper.java

@@ -0,0 +1,62 @@
+package com.pj.project.tb_fee_statistics;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: tb_fee_statistics -- 收费统计表
+ * @author lzm 
+ */
+
+@Mapper
+@Repository
+public interface TbFeeStatisticsMapper  extends BaseMapper<TbFeeStatistics> {
+
+	/**
+	 * 增  
+	 * @param t 实体对象 
+	 * @return 受影响行数 
+	 */
+	int add(TbFeeStatistics t);
+
+	/**
+	 * 删  
+	 * @param id 要删除的数据id  
+	 * @return 受影响行数 
+	 */
+	int delete(Long id);	 
+
+	/** 
+	 * 改  
+	 * @param t 实体对象 
+	 * @return 受影响行数 
+	 */
+	int update(TbFeeStatistics t);
+
+	/** 
+	 * 查 - 根据id  
+	 * @param id 要查询的数据id 
+	 * @return 实体对象 
+	 */
+	TbFeeStatistics getById(Long id);	 
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbFeeStatistics> getList(SoMap so);
+
+    List<TbFeeStatistics> getMonth(SoMap so);
+
+    List<TbFeeStatistics> getYear(SoMap so);
+
+
+    TbFeeStatistics getByDayAndFeeType(@Param("day") String day, @Param("feeType")Integer feeType);
+}

+ 136 - 0
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsMapper.xml

@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.project.tb_fee_statistics.TbFeeStatisticsMapper">
+
+	<!-- 增 [G] -->
+	<insert id="add">
+		insert into 
+		tb_fee_statistics (id, fee_type, item_type_id, item_type_name, year, month, day_time, num, tax_money, tax_rate, no_tax_money, pay_type)
+		values (#{id}, #{feeType}, #{itemTypeId}, #{itemTypeName}, #{year}, #{month}, #{dayTime}, #{num}, #{taxMoney}, #{taxRate}, #{noTaxMoney}, #{payType})
+	</insert>
+
+	<!-- 删 -->
+	<delete id="delete">
+		delete from tb_fee_statistics 
+		where id = #{id}
+	</delete>
+
+	<!-- 改 [G] -->
+	<update id="update">
+		update tb_fee_statistics set
+		id = #{id}, 
+		fee_type = #{feeType},
+		item_type_id = #{itemTypeId}, 
+		item_type_name = #{itemTypeName}, 
+		year = #{year}, 
+		month = #{month}, 
+		day_time = #{dayTime}, 
+		num = #{num}, 
+		tax_money = #{taxMoney}, 
+		tax_rate = #{taxRate}, 
+		no_tax_money = #{noTaxMoney}, 
+		pay_type = #{payType}
+		where id = #{id}
+	</update>
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, fee_type, fee_type_id, fee_type_name, item_type_id, item_type_name, year, month, day_time, num, tax_money, tax_rate, no_tax_money, pay_type from tb_fee_statistics  -->
+	
+	<!-- 通用映射:手动模式 -->
+	<resultMap id="model" type="com.pj.project.tb_fee_statistics.TbFeeStatistics">
+		<result property="id" column="id" />
+		<result property="feeType" column="fee_type" />
+		<result property="itemTypeId" column="item_type_id" />
+		<result property="itemTypeName" column="item_type_name" />
+		<result property="year" column="year" />
+		<result property="month" column="month" />
+		<result property="dayTime" column="day_time" />
+		<result property="num" column="num" />
+		<result property="taxMoney" column="tax_money" />
+		<result property="taxRate" column="tax_rate" />
+		<result property="noTaxMoney" column="no_tax_money" />
+		<result property="payType" column="pay_type" />
+        <result property="statisticsMoney" column="statistics_money" />
+	</resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_fee_statistics 
+	</sql>
+	
+	<!-- 查 - 根据id -->
+	<select id="getById" resultMap="model">
+		<include refid="select_sql"></include>
+		where id = #{id}
+	</select>
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("feeType") '> and fee_type = #{feeType} </if>
+			<if test=' this.has("itemTypeId") '> and item_type_id = #{itemTypeId} </if>
+			<if test=' this.has("itemTypeName") '> and item_type_name = #{itemTypeName} </if>
+			<if test=' this.has("year") '> and year = #{year} </if>
+			<if test=' this.has("month") '> and month = #{month} </if>
+			<if test=' this.has("dayTime") '> and day_time = #{dayTime} </if>
+			<if test=' this.has("num") '> and num = #{num} </if>
+			<if test=' this.has("taxMoney") '> and tax_money = #{taxMoney} </if>
+			<if test=' this.has("taxRate") '> and tax_rate = #{taxRate} </if>
+			<if test=' this.has("noTaxMoney") '> and no_tax_money = #{noTaxMoney} </if>
+			<if test=' this.has("payType") '> and pay_type = #{payType} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> fee_type desc </when>
+			<when test='sortType == 5'> item_type_id desc </when>
+			<when test='sortType == 6'> item_type_name desc </when>
+			<when test='sortType == 7'> year desc </when>
+			<when test='sortType == 8'> month desc </when>
+			<when test='sortType == 9'> day_time desc </when>
+			<when test='sortType == 10'> num desc </when>
+			<when test='sortType == 11'> tax_money desc </when>
+			<when test='sortType == 12'> tax_rate desc </when>
+			<when test='sortType == 13'> no_tax_money desc </when>
+			<when test='sortType == 14'> pay_type desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+
+    <select id="getMonth" resultMap="model">
+        select month, fee_type,  sum(num) as num, sum(tax_money) as statistics_money
+        from tb_fee_statistics
+        <where>
+            <if test=' this.has("feeType") '> and fee_type = #{feeType} </if>
+            <if test=' this.has("month") '> and month = #{month} </if>
+        </where>
+        group by month, fee_type
+        order by month desc
+    </select>
+
+    <select id="getYear" resultMap="model">
+        select year, fee_type,  sum(num) as num, sum(tax_money) as statistics_money
+        from tb_fee_statistics
+        <where>
+            <if test=' this.has("feeType") '> and fee_type = #{feeType} </if>
+            <if test=' this.has("year") '> and year = #{year} </if>
+        </where>
+        group by year, fee_type
+        order by year desc
+    </select>
+
+    <!-- 查 - 根据id -->
+    <select id="getByDayAndFeeType" resultMap="model">
+        <include refid="select_sql"></include>
+        where day_time = #{day} and fee_type = #{feeType}
+    </select>
+	
+	
+	
+	
+
+</mapper>

+ 136 - 0
sp-server/src/main/java/com/pj/project/tb_fee_statistics/TbFeeStatisticsService.java

@@ -0,0 +1,136 @@
+package com.pj.project.tb_fee_statistics;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.api.wx.bo.PriceBO;
+import com.pj.project.tb_business_item.TbBusinessItem;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+
+import com.pj.utils.sg.*;
+
+/**
+ * Service: tb_fee_statistics -- 收费统计表
+ * @author lzm 
+ */
+@Service
+public class TbFeeStatisticsService extends ServiceImpl<TbFeeStatisticsMapper, TbFeeStatistics> implements IService<TbFeeStatistics> {
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbFeeStatisticsMapper tbFeeStatisticsMapper;
+
+	/** 增 */
+	int add(TbFeeStatistics t){
+		return tbFeeStatisticsMapper.add(t);
+	}
+
+	/** 删 */
+	int delete(Long id){
+		return tbFeeStatisticsMapper.delete(id);
+	}
+
+	/** 改 */
+	int update(TbFeeStatistics t){
+		return tbFeeStatisticsMapper.update(t);
+	}
+
+	/** 查 */
+	TbFeeStatistics getById(Long id){
+		return tbFeeStatisticsMapper.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<TbFeeStatistics> getList(SoMap so) {
+        return tbFeeStatisticsMapper.getList(so);
+    }
+
+    List<TbFeeStatistics> getMonth(SoMap so) {
+        return tbFeeStatisticsMapper.getMonth(so);
+    }
+
+    List<TbFeeStatistics> getYear(SoMap so) {
+        return tbFeeStatisticsMapper.getYear(so);
+    }
+
+    public TbFeeStatistics getByDayAndFeeType(String day, Integer feeType){
+//        TbFeeStatistics Fee = tbFeeStatisticsMapper.getByDayAndFeeType(Day, feeType);
+        QueryWrapper<TbFeeStatistics> qw = new QueryWrapper<>();
+        qw.eq("day", day);
+        qw.eq("fee_type", feeType);
+        return getOne(qw);
+    }
+
+    @Async
+    public void countParkFee(List<PriceBO> cars){
+        Date now = new Date();
+        String toDay = DateUtil.format(now, "yyyy-MM-dd");
+        String thisYear = StrUtil.sub(toDay, 0, 4);
+        String thisMonth = StrUtil.sub(toDay, 0, 7);
+        TbFeeStatistics parkFee = this.getByDayAndFeeType(toDay, TbFeeStatistics.feeType.PARK_FEE.getCode());
+        if(parkFee == null){
+            parkFee = new TbFeeStatistics();
+            parkFee.setTaxRate(new BigDecimal(0.09));
+        }
+        for (PriceBO bo1 : cars) {
+            BigDecimal price = bo1.getP();
+            if(price.compareTo(new BigDecimal(30)) == 0){
+                parkFee.setNum(parkFee.getNum() + 1);
+            }
+            parkFee.setTaxMoney(parkFee.getTaxMoney().add(price));
+        }
+        BigDecimal noTaxMoney = parkFee.getTaxMoney().subtract(parkFee.getTaxMoney().multiply(parkFee.getTaxRate()));
+        parkFee.setNoTaxMoney(noTaxMoney);
+        parkFee.setDayTime(now).setMonth(thisMonth).setYear(thisYear).setDay(toDay)
+                .setFeeType(TbFeeStatistics.feeType.PARK_FEE.getCode()).setItemTypeName(TbFeeStatistics.feeType.PARK_FEE.getDesc())
+                .setPayType(3);
+        this.saveOrUpdate(parkFee);
+    }
+
+    @Async
+    public void countBusinessFee(List<TbBusinessItem> items){
+        Date now = new Date();
+        String toDay = DateUtil.format(now, "yyyy-MM-dd");
+        String thisYear = StrUtil.sub(toDay, 0, 4);
+        String thisMonth = StrUtil.sub(toDay, 0, 7);
+        int feeType = -1;
+        for (TbBusinessItem item : items) {
+            String itemType = item.getItemTypeName();
+            if(itemType.contains("核酸")){
+                feeType = TbFeeStatistics.feeType.NUCLEIC_FEE.getCode();
+            } else if(itemType.contains("消毒")){
+                feeType = TbFeeStatistics.feeType.DISINFECT_FEE.getCode();
+            } else if(itemType.contains("装卸")){
+                feeType = TbFeeStatistics.feeType.STEVEDORE_FEE.getCode();
+            } else if(StrUtil.equals(itemType, "特殊车辆") || StrUtil.equals(itemType, "充电打冷") || StrUtil.equals(itemType, "汽车吊" )){
+                feeType = TbFeeStatistics.feeType.STEVEDORE_FEE.getCode();
+            } else if(itemType.contains("入场管理")){
+                feeType = TbFeeStatistics.feeType.MANAGE_FEE.getCode();
+            }
+            TbFeeStatistics businessFee = this.getByDayAndFeeType(toDay, feeType);
+            if(businessFee == null){
+                businessFee = new TbFeeStatistics();
+                businessFee.setTaxRate(new BigDecimal(0.06));
+            }
+            businessFee.setTaxMoney(businessFee.getTaxMoney().add(item.getItemPrice()));
+            businessFee.setNum(businessFee.getNum() + 1);
+            BigDecimal noTaxMoney = businessFee.getTaxMoney().subtract(businessFee.getTaxMoney().multiply(businessFee.getTaxRate()));
+            businessFee.setNoTaxMoney(noTaxMoney);
+            businessFee.setDayTime(now).setMonth(thisMonth).setYear(thisYear).setDay(toDay)
+                    .setFeeType(feeType).setItemTypeName(itemType)
+                    .setPayType(3);
+            this.saveOrUpdate(businessFee);
+        }
+    }
+
+}