Przeglądaj źródła

系统日志下载页面

qzyReal 3 lat temu
rodzic
commit
128e25792e
58 zmienionych plików z 1403 dodań i 1073 usunięć
  1. 1 1
      app-ui/manifest.json
  2. 1 1
      app-ui/utils/request.js
  3. 13 6
      sp-admin/sa-frame/menu-list.js
  4. 85 20
      sp-admin/sa-view/tb-business-car/tb-business-car-info.html
  5. 13 1
      sp-admin/sa-view/tb-business-car/tb-business-car-list.html
  6. 214 0
      sp-admin/sa-view/tb-business-car/tb-business-car-print.html
  7. 0 5
      sp-admin/sa-view/tb-business/print.html
  8. 0 7
      sp-admin/sa-view/tb-business/tb-car-disincle-info.html
  9. 4 22
      sp-admin/sa-view/tb-business/tb-car-disincle-list.html
  10. 14 2
      sp-admin/sa-view/tb-business/tb-car-supplement-select.html
  11. 15 2
      sp-admin/sa-view/tb-business/tb-supplement-add.html
  12. 13 2
      sp-admin/sa-view/tb-business/tb-supplement-edit.html
  13. 15 14
      sp-admin/sa-view/tb-business/tb-supplement-list.html
  14. 1 0
      sp-admin/sa-view/tb-fee-statistics/tb-fee-details-list.html
  15. 163 0
      sp-admin/static/print/print.js
  16. 40 1
      sp-admin/static/sa.js
  17. 56 0
      sp-admin/sys-log.html
  18. 24 9
      sp-server/pom.xml
  19. 3 13
      sp-server/src/main/java/com/pj/api/jh/service/JhService.java
  20. 14 9
      sp-server/src/main/java/com/pj/api/open/service/OpenService.java
  21. 0 88
      sp-server/src/main/java/com/pj/api/pushfee/Demo.java
  22. 130 0
      sp-server/src/main/java/com/pj/api/pushfee/bo/SyncBillParam.java
  23. 16 0
      sp-server/src/main/java/com/pj/api/pushfee/bo/SyncBillRequest.java
  24. 17 0
      sp-server/src/main/java/com/pj/api/pushfee/bo/SyncBillResponse.java
  25. 98 148
      sp-server/src/main/java/com/pj/api/pushfee/task/FeeDetailSyncTask.java
  26. 0 185
      sp-server/src/main/java/com/pj/api/pushfee/tools/EncryptTools.java
  27. 6 3
      sp-server/src/main/java/com/pj/api/pushfee/tools/HttpUtils.java
  28. 0 30
      sp-server/src/main/java/com/pj/api/pushfee/tools/InterEnum.java
  29. 0 37
      sp-server/src/main/java/com/pj/api/pushfee/tools/message/CuMessage.java
  30. 0 89
      sp-server/src/main/java/com/pj/api/pushfee/tools/message/Header.java
  31. 0 10
      sp-server/src/main/java/com/pj/api/pushfee/tools/message/Inter.java
  32. 0 12
      sp-server/src/main/java/com/pj/api/pushfee/tools/message/MessageInter.java
  33. 0 120
      sp-server/src/main/java/com/pj/api/pushfee/tools/message/api/OdsOrderPayDetailDTO.java
  34. 0 23
      sp-server/src/main/java/com/pj/api/pushfee/tools/message/api/OrderPayDetailMessage.java
  35. 23 0
      sp-server/src/main/java/com/pj/api/pushfee/web/TestApi.java
  36. 1 0
      sp-server/src/main/java/com/pj/api/service/ApiService.java
  37. 2 0
      sp-server/src/main/java/com/pj/api/wx/bo/PriceBO.java
  38. 3 2
      sp-server/src/main/java/com/pj/api/wx/service/WxService.java
  39. 4 0
      sp-server/src/main/java/com/pj/current/config/MyConfig.java
  40. 1 0
      sp-server/src/main/java/com/pj/current/config/OAConfig.java
  41. 6 1
      sp-server/src/main/java/com/pj/current/satoken/SaTokenConfigure.java
  42. 0 1
      sp-server/src/main/java/com/pj/current/satoken/StpUserUtil.java
  43. 1 0
      sp-server/src/main/java/com/pj/project/tb_business/ErrorBusinessBO.java
  44. 7 27
      sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java
  45. 2 30
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java
  46. 1 1
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessMapper.xml
  47. 51 38
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java
  48. 2 0
      sp-server/src/main/java/com/pj/project/tb_business_car/ExportTbBusinessDTO.java
  49. 37 3
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCar.java
  50. 37 0
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarController.java
  51. 2 1
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.xml
  52. 66 13
      sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java
  53. 40 0
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetails.java
  54. 121 90
      sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java
  55. 34 2
      sp-server/src/main/java/com/pj/project4sp/apilog/SpApilogControlle.java
  56. 6 4
      sp-server/src/main/resources/application-dev.yml
  57. BIN
      sp-server/src/main/resources/lib/encrypt-base-1.0.3.jar
  58. BIN
      sp-server/src/main/resources/lib/encrypt-rsa-md5-1.0.3.jar

+ 1 - 1
app-ui/manifest.json

@@ -83,7 +83,7 @@
     "vueVersion" : "2",
     "h5" : {
         "router" : {
-            "base" : "/test/",
+            "base" : "/h5",
             "mode" : "history"
         },
         "devServer" : {

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

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

+ 13 - 6
sp-admin/sa-frame/menu-list.js

@@ -305,11 +305,7 @@ var menuList = [
 						name: '账单确认',
 						isShow: false
 					},
-					{
-						id: 'tb-business-judge',
-						name: '业务审核',
-						isShow: false
-					},
+					
 					{
 						id: 'tb-business-zx-print',
 						name: '装卸打印',
@@ -459,7 +455,8 @@ var menuList = [
 			id: 'tb-business-car-list',
 			name: '放行列表',
 			url: 'sa-view/tb-business-car/tb-business-car-list.html',
-			childList: [{
+			childList: [
+				{
 
 					id: 'tb-business-car-add',
 					name: '添加记录',
@@ -472,6 +469,16 @@ var menuList = [
 					isShow: false
 				},
 				{
+					id: 'tb-business-car-judge',
+					name: '审核',
+					isShow: false
+				},
+				{
+					id: 'tb-business-car-print',
+					name: '打印凭证',
+					isShow: false
+				},
+				{
 
 					id: 'tb-business-car-edit',
 					name: '修改记录',

+ 85 - 20
sp-admin/sa-view/tb-business-car/tb-business-car-info.html

@@ -11,13 +11,24 @@
 		<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/print/jquery-2.0.3.js" type="text/javascript"></script>
 		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
 		<style type="text/css">
+			.s-body {
+				margin: 0;
+			}
+
 			.c-panel .c-label {
 				width: 8em;
 			}
+
+			.title {
+				text-align: center;
+				font-size: 20px;
+				font-weight: bold;
+				padding: 0 0 20px 0px;
+			}
 		</style>
 	</head>
 	<body>
@@ -27,7 +38,7 @@
 				<div class="c-panel">
 					<el-form v-if="m">
 						<el-row>
-							<el-col span=12>
+							<el-col :span="m.businessType==1?8:12">
 								<sa-info name="车牌号" br>{{m.carNo}}</sa-info>
 								<sa-info name="车牌颜色" br>{{m.color}}</sa-info>
 								<sa-info name="入场时间" br>{{m.realInTime}}<label v-if="m.inTimeSupplement===1">(补)</label>
@@ -38,7 +49,7 @@
 								<sa-info name="备注" br v-if="m.remark">{{m.remark}}</sa-info>
 								<sa-info type="img" name="入场图片" :value="m.inImage" br></sa-info>
 							</el-col>
-							<el-col span=12>
+							<el-col :span="m.businessType==1?8:12">
 								<sa-info name="离场时间" br>{{m.realOutTime}}<label
 										v-if="m.outTimeSupplement===1">(补)</label></sa-info>
 								<sa-info name="补录时间" br v-if="m.outTimeSupplementTime">{{m.outTimeSupplementTime}}
@@ -49,6 +60,17 @@
 								<sa-info name="出场确认说明" br v-if="m.outRemark">{{m.outRemark}}</sa-info>
 								<sa-info type="img" name="离场图片" :value="m.outImage" br></sa-info>
 							</el-col>
+							<el-col span=8 v-if="m.businessType==1">
+								<sa-info  style="margin-top: 0;" type="enum" name="审核状态"
+									:value="m.confirmJudge" :jv="{0: '未审核', 1: '审核通过', 2: '审核驳回'}" br>
+								</sa-info>
+								<sa-info  style="margin-top: 0;" name="审核人" br>
+									{{m.confirmJudgeBy}}</sa-info>
+								<sa-info  name="审核时间" br>{{m.confirmJudgeTime}}</sa-info>
+								<sa-info  name="审核意见" br v-if="m.confirmJudgeContent">
+									{{m.confirmJudgeContent}}
+								</sa-info>
+							</el-col>
 						</el-row>
 						<el-row v-if="businessList.length>0">
 							<el-collapse value='1'>
@@ -57,16 +79,16 @@
 										业务列表
 									</div>
 									<el-table :data="businessList" style="width: 100%">
-										<sa-td name="业务单号" prop="no" width="160"></sa-td>
-										<sa-td name="客户名称" prop="customerName" width="190"></sa-td>
-										<sa-td name="货主" prop="owner" width="160"></sa-td>
+										<sa-td name="业务单号" prop="no" width="180"></sa-td>
+										<sa-td name="客户名称" prop="customerName" width="200"></sa-td>
+										<sa-td name="货主" prop="owner" width="170"></sa-td>
 										<sa-td name="业务项" prop="goodsName" width="160"></sa-td>
 										<sa-td name="作业时间" prop="operateTime" width="160"></sa-td>
 										<sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
-										<sa-td name="确认" prop="adminConfirmInput" type="enum"
-											:jv="{1: '已确认', 0: '未确认'}"></sa-td>
+										<sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"
+											width="130"></sa-td>
 										<sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
-										<sa-td width="160" name="创建时间" prop="createTime"></sa-td>
+										<sa-td width="160" name="创建时间" prop="createTime" width="140"></sa-td>
 									</el-table>
 								</el-collapse-item>
 							</el-collapse>
@@ -75,27 +97,27 @@
 							<el-collapse value='2'>
 								<el-collapse-item name="2">
 									<div slot="title">
-										具体业务项
+										具体业务项(<span style="color: red;">总费用{{totalMoney}}元</span>)
 									</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 prop="itemName" label="收费明细" width="200">
 										</el-table-column>
-										<el-table-column prop="itemPrice" label="单价">
+										<el-table-column prop="itemPrice" label="单价" width="170">
 										</el-table-column>
-										<el-table-column prop="unit" label="计费标准">
+										<el-table-column prop="unit" label="计费标准" width="160">
 										</el-table-column>
-										<el-table-column prop="num" label="数量">
+										<el-table-column prop="num" label="数量" width="160">
 										</el-table-column>
-										<el-table-column prop="total" label="合计">
+										<el-table-column prop="total" label="合计" width="120">
 										</el-table-column>
 										<sa-td width="120" name="支付状态" prop="payStatus" type="enum"
-											:jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}">
+											:jv="{0: '未支付[#ff0000]', 1: '已支付[#005500]'}" width="130">
 										</sa-td>
-										<el-table-column prop="payTime" label="支付时间" width="150">
+										<el-table-column prop="payTime" label="支付时间" width="140">
 										</el-table-column>
-										<el-table-column prop="remark" label="备注" width="150">
+										<el-table-column prop="remark" label="备注" width="140">
 										</el-table-column>
 									</el-table>
 								</el-collapse-item>
@@ -106,6 +128,11 @@
 			</div>
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
+				<el-button v-if="sa.isAuth('tb-business-car-judge')&&m.pay!==1&&m.businessType===1" class="c-btn"
+					type="success" icon="el-icon" @click="pass()">审核通过</el-button>
+				<el-button v-if="sa.isAuth('tb-business-car-judge')&&m.pay!==1&&m.businessType===1" class="c-btn"
+					type="warning" icon="el-icon" @click="callback()">审核驳回</el-button>
+				<el-button v-if="sa.isAuth('tb-business-car-print')&&m.pay===1&&m.businessType===1" type="success" @click="printFn()">打印</el-button>
 				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>
 			</div>
 		</div>
@@ -117,12 +144,50 @@
 				},
 				el: '.vue-box',
 				data: {
-					businessList:[],
+					businessList: [],
 					tableData: [],
 					id: sa.p('id', 0), // 获取数据ID
-					m: null
+					m: {}
+				},
+				computed:{
+					totalMoney(){
+						let businessList=this.businessList;
+						let money=0;
+						for(let i in businessList){
+							money+=parseFloat(businessList[i].itemPrice);
+						}
+						return money;
+					}
 				},
 				methods: {
+					pass() {
+						sa.ajax('/TbBusinessCar/confirmJudgePass', {
+							id: this.id
+						}, function(res) {
+							sa.alert('审核通过', this.clean);
+						}.bind(this))
+					},
+					callback() {
+						let that = this;
+						layer.prompt({
+							title: '填写审核意见'
+						}, function(content, index) {
+							layer.close(index);
+							sa.ajax('/TbBusinessCar/callback', {
+								id: that.id,
+								judgeContent: content
+							}, function(res) {
+								sa.alert('已驳回', that.clean);
+							})
+						});
+					},
+					clean() {
+						parent.app.f5();
+						sa.closeCurrIframe();
+					},
+					printFn() {
+						sa.showIframe('凭据打印', 'tb-business-car-print.html?businessCarId=' + this.id, '800px', '100%');
+					},
 					getItemsByCarId() {
 						sa.ajax('/TbBusinessItem/getByBusinessCarId', {
 							businessCarId: this.id

+ 13 - 1
sp-admin/sa-view/tb-business-car/tb-business-car-list.html

@@ -68,6 +68,16 @@
 							<el-option label="免费车" value="1"></el-option>
 						</el-select>
 					</div>
+					<div class="c-item">
+						<label class="c-label">审核状态:</label>
+						<el-select v-model="p.confirmJudge">
+							<el-option label="全部" value=""></el-option>
+							<el-option label="未审核" :value="0"></el-option>
+							<el-option label="审核通过" :value="1"></el-option>
+							<el-option label="审核驳回" :value="2"></el-option>
+							<el-option label="无需审核" :value="3"></el-option>
+						</el-select>
+					</div>
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<el-button size="mini" type="primary" @click="exportFn" v-if="sa.isAuth('tb-business-car-export')">
 						导出
@@ -118,6 +128,7 @@
 							</label>
 						</template>
 					</el-table-column>
+					<sa-td name="审核状态" prop="confirmJudge" type="enum" :jv="{0: '未审核', 1:'审核通过',2:'审核驳回',3:'无需审核'}"></sa-td>
 					<sa-td name="支付状态" prop="payType"></sa-td>
 					<sa-td name="出场确认说明" prop="outRemark" width="180"></sa-td>
 					<sa-td name="备注" prop="remark" width="180"></sa-td>
@@ -153,6 +164,7 @@
 					p: { // 查询参数
 						id: '', //
 						businessId: sa.p('id', ''), //
+						confirmJudge:'',
 						color: '',
 						carNo: '', //
 						leave: '1',
@@ -221,7 +233,7 @@
 					// 查看
 					get: function(data) {
 						sa.showIframe('数据详情', 'tb-business-car-info.html?id=' + data.id + '&businessId=' + this.p
-							.businessId, '1080px', '80%');
+							.businessId, '1080px', '90%');
 					},
 					// 修改
 					update: function(data) {

+ 214 - 0
sp-admin/sa-view/tb-business-car/tb-business-car-print.html

@@ -0,0 +1,214 @@
+<!DOCTYPE html
+	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<title>打印业务确认单</title>
+		<style type="text/css">
+			body {
+				left: 0px;
+				top: 0px;
+				right: 0px;
+				bottom: 0px;
+				margin: 0px;
+				font-family: Arial, Helvetica, sans-serif;
+				font-size: 12px;
+				overflow: hidden;
+				white-space: nowrap;
+			}
+
+			.footer {
+				position: fixed;
+				bottom: 10px;
+				right: 20px;
+			}
+
+			.print-btn {
+				background: #57C22A;
+				border: 1px solid #e2e2e2;
+				padding: 4px 20px;
+				border-radius: 4px;
+				color: white;
+				cursor: pointer;
+			}
+		</style>
+		<script src="../../static/print/jquery-2.0.3.js" type="text/javascript"></script>
+		<script src="../../static/print/jquery.jPrintArea.js" type="text/javascript"></script>
+		<script src="../../static/sa.js"></script>
+
+	</head>
+	<body>
+		<div>
+			<fieldset align="">
+				<div id="myPrintArea" style="height: 1500;">
+					<div align="center">
+						<SPAN style="font-size:15px">接驳区车辆缴费凭证</SPAN>
+						<br /><br />
+					</div>
+					<div style="text-align:center; font-size:15px;">
+						<table id="one" width="100%" style="border-collapse:collapse;border:none;">
+							<tr height="50">
+								<td style="border:solid #000 1px;text-align: left;" colspan="4">单位:广西东兴北投口岸投资有限公司</td>
+								<td style="border:solid #000 1px;text-align: left;" colspan="3">单证编号:
+									<span id="businessNo"></span>
+								</td>
+							</tr>
+							<tr height="50">
+								<td style="border:solid #000 1px;text-align: left;" colspan="7">支付时间:
+									<span id="payTime"></span>
+								</td>
+							</tr>
+
+						</table>
+						<table id="two" width="100%" style="border-collapse:collapse;border:none;">
+							<tr height="50">
+								<td style="border:solid #000 1px;text-align: left;" colspan="7"><b>车辆信息:</b></td>
+							</tr>
+							<tr height="50">
+								<td style="border:solid #000 1px;text-align: center;">车牌号</td>
+								<td style="border:solid #000 1px;text-align: center;">类型</td>
+								<td style="border:solid #000 1px;text-align: center;">载重(kg)</td>
+								<td style="border:solid #000 1px;text-align: center;">规格(米)</td>
+								<td style="border:solid #000 1px;text-align: center;">支付状态</td>
+								<td style="border:solid #000 1px;text-align: center;">车辆状态</td>
+								<td style="border:solid #000 1px;text-align: center;">停车费</td>
+							</tr>
+							<div id="carInfo"></div>
+						</table>
+						<table id="three" width="100%" style="border-collapse:collapse;border:none;">
+							<tr height="50">
+								<td style="border:solid #000 1px;text-align: left;" colspan="7"><b>具体业务项:</b></td>
+							</tr>
+							<tr height="50">
+								<td style="border:solid #000 1px;text-align: center;">收费项</td>
+								<td style="border:solid #000 1px;text-align: center;">收费明细项</td>
+								<td style="border:solid #000 1px;text-align: center;">单价</td>
+								<td style="border:solid #000 1px;text-align: center;">计费标准</td>
+								<td style="border:solid #000 1px;text-align: center;">数量</td>
+								<td style="border:solid #000 1px;text-align: center;">合计</td>
+								<td style="border:solid #000 1px;text-align: center;">支付状态</td>
+							</tr>
+						</table>
+						<table id="three" width="100%" style="border-collapse:collapse;border:none;">
+							<tr height="40">
+								<td style="border:solid #000 1px;text-align: left;" colspan="7">开单员:
+									<span id="createBy"></span>
+								</td>
+							</tr>
+						</table>
+						<br /><br />
+					</div>
+				</div>
+			</fieldset>
+			<div class="footer">
+				<input type="button" class="print-btn" id="print_button" value="打印" />
+				<input type="button" class="print-btn" id="close_button" value="关闭" />
+			</div>
+
+		</div>
+
+		<script type="text/javascript">
+			function getItemsByCarId(businessCarId) {
+				sa.ajaxNoLayer('/TbBusinessItem/getByBusinessCarId', {
+					businessCarId: businessCarId
+				}, function(resp) {
+					let itemList = resp.data;
+					$.each(itemList, function(index, item) {
+						let itemTypeName = item.itemTypeName;
+						let itemName = item.itemName;
+						let itemPrice = item.itemPrice;
+						let unit = item.unit;
+						let num = item.num
+						let total = item.total;
+						let payStatus = item.payStatus;
+						if (payStatus === 0) {
+							payStatus = "未支付"
+						} else if (payStatus === 1) {
+							payStatus = "已支付"
+						}
+						$('#three').append(
+							"<tr height=\"35\">" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" +
+							itemTypeName + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" +
+							itemName + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" +
+							itemPrice + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" +
+							unit + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" +
+							num + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" +
+							total + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" +
+							payStatus + "</td>" +
+							"<tr>"
+						);
+					})
+				})
+			};
+
+			function getByBusinessCarId(businessCarId) {
+				sa.ajaxNoLayer('/TbBusiness/getByBusinessCarId', {
+					businessCarId: businessCarId
+				}, function(resp) {
+					let list = resp.data;
+					let no = list.map(obj => obj.no).join('、');
+					let createBy = list.map(obj => obj.createBy).join('、');
+					$("#createBy").html(createBy);
+					$("#businessNo").html(no);
+					$('#payTime').html(list.length > 0 ? list[0].payTime : '')
+				})
+			};
+
+			function getListByCarId(businessCarId) {
+				sa.ajaxNoLayer('/TbBusinessCar/getListByCarId', {
+					businessCarId: businessCarId
+				}, function(resp) {
+					let carList = resp.data;
+					$.each(carList, function(index, item) {
+						let carNo = item.carNo;
+						let carType = item.carType;
+						let netWeight = item.netWeight;
+						let carSize = item.carSize;
+						let payType = item.payType
+						let isLock = item.isLock;
+						let money = item.money;
+						if (isLock === 0) {
+							isLock = "正常"
+						} else if (isLock === 1) {
+							isLock = "锁定"
+						}
+					 $('#two').append(
+							"<tr height=\"35\">" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" + carNo + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" + carType + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" + netWeight +
+							"</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" + carSize + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" + payType + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" + isLock + "</td>" +
+							"<td style=\"border:solid #000 1px;text-align: center;\">" + money + "</td>" +
+							"<tr>"
+						);
+					})
+				})
+			};
+			$(function() {
+				var id = sa.p('businessCarId', '-1');
+				$("#print_button").click(function() {
+					$("#myPrintArea").printArea();
+				});
+				
+				$("#close_button").click(function() {
+					sa.closeCurrIframe();
+				});
+				getItemsByCarId(id);
+				getByBusinessCarId(id);
+				getListByCarId(id);
+			});
+		</script>
+
+
+	</body>
+</html>

+ 0 - 5
sp-admin/sa-view/tb-business/print.html

@@ -89,11 +89,6 @@
                 </div>
 
             </div>
-            <!--            <div align="right">-->
-            <!--                <br/><br/>-->
-            <!--                <SPAN style=";font-size:15px">      &nbsp&nbsp&nbsp&nbsp  年  &nbsp&nbsp&nbsp&nbsp 月   &nbsp&nbsp&nbsp&nbsp 日</SPAN>-->
-
-            <!--            </div>-->
 
         </div>
     </fieldset>

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

@@ -41,10 +41,6 @@
 												</sa-info>
 												<sa-info name="业务项目" br>{{m.goodsName}}</sa-info>
 												<sa-info name="作业时间" br>{{m.operateTime}}</sa-info>
-												<sa-info style="margin-top: 0;" type="enum" name="审核状态" :value="m.confirmJudge"
-													:jv="{0: '未审核', 1: '审核通过', 2: '审核驳回'}" br>
-												</sa-info>
-												<sa-info style="margin-top: 0;" name="审核人" br>{{m.confirmJudgeBy}}</sa-info>
 												<sa-info name="业务费用" br>{{m.itemPrice}}(元)</sa-info>
 												<sa-info name="支付时间" br>{{m.payTime}}</sa-info>
 												<sa-info name="补录人" br v-if="m.supplementBy">{{m.supplementBy}}
@@ -61,9 +57,6 @@
 											<el-col span="12">
 												<sa-info name="货主" br>{{m.owner}}</sa-info>
 												<sa-info name="业务编号" br>{{m.no}}</sa-info>
-												<sa-info name="审核时间" br>{{m.confirmJudgeTime}}</sa-info>
-												<sa-info  name="审核意见" br v-if="m.confirmJudgeContent">
-													{{m.confirmJudgeContent}}</sa-info>
 												<sa-info name="录入时间" br>{{m.createTime}}</sa-info>
 												<sa-info name="录入人" br>{{m.createBy}}</sa-info>
 												<sa-info style="margin-top: 0;" type="enum" name="支付状态" :value="m.payStatus"

+ 4 - 22
sp-admin/sa-view/tb-business/tb-car-disincle-list.html

@@ -58,18 +58,10 @@
 							</el-option>
 						</el-select>
 					</div>
-					<div class="c-item">
-						<label class="c-label">审核状态:</label>
-						<el-select v-model="p.confirmJudge">
-							<el-option label="全部" value=""></el-option>
-							<el-option label="未审核" :value="0"></el-option>
-							<el-option label="审核通过" :value="1"></el-option>
-							<el-option label="审核驳回" :value="2"></el-option>
-						</el-select>
-					</div>
+			
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<el-button type="info" icon="el-icon-search"
-						@click="p.carNo = '';p.adminConfirmInput=-1;p.customerName='';p.owner='';p.no='';p.confirmJudge=''; f5()">重置
+						@click="p.carNo = '';p.adminConfirmInput=-1;p.customerName='';p.owner='';p.no=''; f5()">重置
 					</el-button>
 					<el-button v-if="sa.isAuth('tb-flex-business-add')" size="mini" type="primary" @click="add()">
 						新增
@@ -89,7 +81,7 @@
 						</template>
 					</el-table-column>
 					<sa-td name="作业时间" prop="operateTime" width="160"></sa-td>
-					<sa-td name="审核状态" prop="confirmJudge" type="enum" :jv="{0: '未审核', 1:'审核通过',2:'审核驳回'}"></sa-td>
+					
 					<sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"></sa-td>
 					<sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
 					<sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
@@ -97,9 +89,6 @@
 					</sa-td>
 					<el-table-column label="操作" width="415px" fixed="right">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-business-judge')
-								&&s.row.confirmJudge!==1&&s.row.payStatus!==3" @click="judgeFn(s.row)">业务审核
-							</el-button>
 							<el-button class="c-btn" type="primary" v-if="sa.isAuth('tb-flex-business-confirm')
 								&&currentCustomerId=='1'&&s.row.adminConfirmInput==0" @click="confirmFn(s.row)">账单确认
 							</el-button>
@@ -211,14 +200,7 @@
 						}
 					},
 					zxPrint(id) {
-						this.$confirm('    点击确定开始打印!', '提示', {
-							confirmButtonText: '确定',
-							cancelButtonText: '取消',
-						}).then(() => {
-							sa.showIframe('打印装卸业务确认单', 'print-zxbusiness.html?id=' + id, '1000px', '100%');
-						}).catch(() => {
-
-						});;
+						sa.showIframe('打印装卸业务确认单', 'print-zxbusiness.html?id=' + id, '1000px', '100%');
 					},
 					getGoodsList() {
 						sa.ajax('/TbGoods/getList', function(resp) {

+ 14 - 2
sp-admin/sa-view/tb-business/tb-car-supplement-select.html

@@ -17,11 +17,11 @@
 		<script src="../../static/kj/upload-util.js"></script>
 		<style type="text/css">
 			.c-panel .el-form .c-label {
-				width: 7em !important;
+				width: 8em !important;
 			}
 
 			.c-panel .el-form .c-panel .el-form {
-				width: 180px;
+				width: 200px;
 			}
 
 			.item-num .el-input__inner {
@@ -72,6 +72,7 @@
 													</el-option>
 												</el-select>
 											</div>
+											
 											<div class="c-item">
 												<label class="c-label"><span style="color: red;">*</span>业务项目:</label>
 												<el-select v-model="m.goodsId" placeholder="请选择" disabled>
@@ -128,6 +129,13 @@
 											
 										</el-col>
 									</el-row>
+									<div class="c-item" v-if="m.payStatus==3" >
+										<label class="c-label">
+											<span style="color: red;">*</span>
+											微信支付单号:</label>
+										<el-input v-model="m.transactionId" placeholder="微信支付单号">
+										</el-input>
+									</div>
 								</div>
 							</el-card>
 						</el-row>
@@ -702,6 +710,10 @@
 							sa.error('请填写补录原因');
 							return false;
 						}
+						if (m.payStatus == 3&&!m.transactionId) {
+							sa.error('请录入微信订单号');
+							return false;
+						}
 						let carList = this.car.list;
 						let needCarSize = goods.needCarSize;
 						for (let i in carList) {

+ 15 - 2
sp-admin/sa-view/tb-business/tb-supplement-add.html

@@ -17,11 +17,11 @@
 		<script src="../../static/kj/upload-util.js"></script>
 		<style type="text/css">
 			.c-panel .el-form .c-label {
-				width: 7em !important;
+				width: 8em !important;
 			}
 
 			.c-panel .el-form .c-panel .el-form {
-				width: 180px;
+				width: 200px;
 			}
 
 			.item-num .el-input__inner {
@@ -139,6 +139,13 @@
 											</div>
 										</el-col>
 									</el-row>
+									<div class="c-item" v-if="m.payStatus==3" >
+										<label class="c-label" >
+											<span style="color: red;">*</span>
+											微信支付单号:</label>
+										<el-input v-model="m.transactionId" placeholder="微信支付单号">
+										</el-input>
+									</div>
 								</div>
 							</el-card>
 						</el-row>
@@ -344,6 +351,7 @@
 					m: {
 						id: '', // 主键 
 						customerId: '', // 客户id 
+						transactionId:'',
 						customerName: '', // 客户名称 
 						operateTime: '',
 						payStatus:1,
@@ -702,6 +710,7 @@
 							sa.error('请填写货主');
 							return false;
 						}
+						
 						if (this.car.list.length == 0) {
 							sa.error('请录入车辆');
 							return false;
@@ -742,6 +751,10 @@
 							sa.error('请填写货主');
 							return false;
 						}
+						if (m.payStatus == 3&&!m.transactionId) {
+							sa.error('请录入微信订单号');
+							return false;
+						}
 						if (this.car.list.length == 0) {
 							sa.error('请录入车辆');
 							return false;

+ 13 - 2
sp-admin/sa-view/tb-business/tb-supplement-edit.html

@@ -17,11 +17,11 @@
     <script src="../../static/kj/upload-util.js"></script>
     <style type="text/css">
         .c-panel .el-form .c-label {
-            width: 7em !important;
+            width: 8em !important;
         }
 
         .c-panel .el-form .c-panel .el-form {
-            width: 180px;
+            width: 200px;
         }
 
         .item-num .el-input__inner {
@@ -132,6 +132,13 @@
                    				</div>
                    			</el-col>
                    		</el-row>
+						<div class="c-item" v-if="m.payStatus==3" >
+							<label class="c-label" >
+								<span style="color: red;">*</span>
+								微信支付单号:</label>
+							<el-input v-model="m.transactionId" placeholder="微信支付单号">
+							</el-input>
+						</div>
                    	</div>
                    </el-card>
                 </el-row>
@@ -734,6 +741,10 @@
                     sa.error('请填写货主');
                     return false;
                 }
+				if (m.payStatus == 3&&!m.transactionId) {
+					sa.error('请录入微信订单号');
+					return false;
+				}
                 if (this.car.list.length == 0) {
                     sa.error('请录入车辆');
                     return false;

+ 15 - 14
sp-admin/sa-view/tb-business/tb-supplement-list.html

@@ -74,6 +74,7 @@
 					<sa-td name="确认" prop="adminConfirmInput" type="enum" :jv="{1: '已确认', 0: '未确认'}"></sa-td>
 					<sa-td name="已支付(元)" prop="payMoney" width="140"></sa-td>
 					<sa-td name="业务费用(元)" prop="itemPrice" width="120"></sa-td>
+					<sa-td name="微信支付号" prop="transactionId" width="240"></sa-td>
 					<sa-td name="OA流程" prop="sendOa" type="enum" :jv="{1: '已发起', 0: '未发起'}"></sa-td>
 					<sa-td name="发起时间" prop="sendTime" width="140"></sa-td>
 					<sa-td name="发起人" prop="sendBy"></sa-td>
@@ -203,7 +204,7 @@
 							pageSize: 10,
 							pageNo: 1,
 							error: 1,
-							oaResult:''
+							oaResult: ''
 						}
 					},
 					value: '',
@@ -262,23 +263,23 @@
 						sa.showIframe('完善补录单', 'tb-car-supplement-select.html?id=' + data.id, '1280px', '90%');
 					},
 					businessFn(data) {
-					    sa.ajaxNoLoading('/TbBusinessCar/getOtherBusinessCarByBusinessId', {
-					        businessId: data.id
-					    }, function (resp) {
-					        let list = resp.data;
-					        let str = list.map(car => car.carNo).join('、');
-					        let businessCarIds = list.map(car => car.id).join(',');
-					        sa.showIframe('绑定车辆', 'tb-business-car-business.html?id=' + data.id +
-					            '&businessCarId=' + data.businessCarId + '&carNo=' + str +
-					            '&businessCarIds=' + businessCarIds, '90%', "90%");
-					    }.bind(this))
+						sa.ajaxNoLoading('/TbBusinessCar/getOtherBusinessCarByBusinessId', {
+							businessId: data.id
+						}, function(resp) {
+							let list = resp.data;
+							let str = list.map(car => car.carNo).join('、');
+							let businessCarIds = list.map(car => car.id).join(',');
+							sa.showIframe('绑定车辆', 'tb-business-car-business.html?id=' + data.id +
+								'&businessCarId=' + data.businessCarId + '&carNo=' + str +
+								'&businessCarIds=' + businessCarIds, '90%', "90%");
+						}.bind(this))
 					},
 					carFn(data) {
-					    sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
-					        .payStatus + '&confirm=' + data.adminConfirmInput, '1050px', '75%');
+						sa.showIframe('车辆管理', '../car/tb-business-car-list.html?id=' + data.id + '&payStatus=' + data
+							.payStatus + '&confirm=' + data.adminConfirmInput, '1050px', '75%');
 					},
 					handlerPay(data) {
-					    sa.showIframe('线下收费', 'tb-car-disincle-pay.html?id=' + data.id, '1050px', '95%');
+						sa.showIframe('线下收费', 'tb-car-disincle-pay.html?id=' + data.id, '1050px', '95%');
 					},
 					getGoodsList() {
 						sa.ajax('/TbGoods/getList', function(resp) {

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

@@ -133,6 +133,7 @@
 					<sa-td name="数量" prop="num"></sa-td>
 					<sa-td name="单价(元)" prop="unitPrice"></sa-td>
 					<sa-td name="总价(元)" prop="itemPrice"></sa-td>
+					<sa-td name="缴费方式" prop="module"></sa-td>
 					<sa-td name="结算状态" prop="isSettle" type="enum" :jv="{0: '未结算',1: '已结算'}"></sa-td>
 					<sa-td name="复核状态" prop=""></sa-td>
 					<!--					<sa-td name="税率(%)" prop="taxRate" ></sa-td>-->

+ 163 - 0
sp-admin/static/print/print.js

@@ -0,0 +1,163 @@
+// 打印类属性、方法定义
+/* eslint-disable */
+const Print = function (dom, options) {
+  if (!(this instanceof Print)) return new Print(dom, options);
+
+  this.options = this.extend({
+    'noPrint': '.no-print'
+  }, options);
+
+  if ((typeof dom) === "string") {
+    this.dom = document.querySelector(dom);
+  } else {
+    this.isDOM(dom)
+    this.dom = this.isDOM(dom) ? dom : dom.$el;
+  }
+
+  this.init();
+};
+Print.prototype = {
+  init: function () {
+    var content = this.getStyle() + this.getHtml();
+    this.writeIframe(content);
+  },
+  extend: function (obj, obj2) {
+    for (var k in obj2) {
+      obj[k] = obj2[k];
+    }
+    return obj;
+  },
+
+  getStyle: function () {
+    var str = "",
+      styles = document.querySelectorAll('style,link');
+    for (var i = 0; i < styles.length; i++) {
+      str += styles[i].outerHTML;
+    }
+    str += "<style>" + (this.options.noPrint ? this.options.noPrint : '.no-print') + "{display:none;}</style>";
+
+    return str;
+  },
+
+  getHtml: function () {
+    var inputs = document.querySelectorAll('input');
+    var textareas = document.querySelectorAll('textarea');
+    var selects = document.querySelectorAll('select');
+
+    for (var k = 0; k < inputs.length; k++) {
+      if (inputs[k].type == "checkbox" || inputs[k].type == "radio") {
+        if (inputs[k].checked == true) {
+          inputs[k].setAttribute('checked', "checked")
+        } else {
+          inputs[k].removeAttribute('checked')
+        }
+      } else if (inputs[k].type == "text") {
+        inputs[k].setAttribute('value', inputs[k].value)
+      } else {
+        inputs[k].setAttribute('value', inputs[k].value)
+      }
+    }
+
+    for (var k2 = 0; k2 < textareas.length; k2++) {
+      if (textareas[k2].type == 'textarea') {
+        textareas[k2].innerHTML = textareas[k2].value
+      }
+    }
+
+    for (var k3 = 0; k3 < selects.length; k3++) {
+      if (selects[k3].type == 'select-one') {
+        var child = selects[k3].children;
+        for (var i in child) {
+          if (child[i].tagName == 'OPTION') {
+            if (child[i].selected == true) {
+              child[i].setAttribute('selected', "selected")
+            } else {
+              child[i].removeAttribute('selected')
+            }
+          }
+        }
+      }
+    }
+    // 包裹要打印的元素
+    // fix: https://github.com/xyl66/vuePlugs_printjs/issues/36
+    let outerHTML = this.wrapperRefDom(this.dom).outerHTML
+    return outerHTML;
+  },
+  // 向父级元素循环,包裹当前需要打印的元素
+  // 防止根级别开头的 css 选择器不生效
+  wrapperRefDom: function (refDom) {
+    let prevDom = null
+    let currDom = refDom
+    // 判断当前元素是否在 body 中,不在文档中则直接返回该节点
+    if (!this.isInBody(currDom)) return currDom
+
+    while (currDom) {
+      if (prevDom) {
+        let element = currDom.cloneNode(false)
+        element.appendChild(prevDom)
+        prevDom = element
+      } else {
+        prevDom = currDom.cloneNode(true)
+      }
+
+      currDom = currDom.parentElement
+    }
+
+    return prevDom
+  },
+
+  writeIframe: function (content) {
+    var w, doc, iframe = document.createElement('iframe'),
+      f = document.body.appendChild(iframe);
+    iframe.id = "myIframe";
+    //iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;";
+    iframe.setAttribute('style', 'position:absolute;width:0;height:0;top:-10px;left:-10px;');
+    w = f.contentWindow || f.contentDocument;
+    doc = f.contentDocument || f.contentWindow.document;
+    doc.open();
+    doc.write(content);
+    doc.close();
+    var _this = this
+    iframe.onload = function(){
+      _this.toPrint(w);
+      setTimeout(function () {
+        document.body.removeChild(iframe)
+      }, 100)
+    }
+  },
+
+  toPrint: function (frameWindow) {
+    try {
+      setTimeout(function () {
+        frameWindow.focus();
+        try {
+          if (!frameWindow.document.execCommand('print', false, null)) {
+            frameWindow.print();
+          }
+        } catch (e) {
+          frameWindow.print();
+        }
+        frameWindow.close();
+      }, 10);
+    } catch (err) {
+      console.log('err', err);
+    }
+  },
+  // 检查一个元素是否是 body 元素的后代元素且非 body 元素本身
+  isInBody: function (node) {
+    return (node === document.body) ? false : document.body.contains(node);
+  },
+  isDOM: (typeof HTMLElement === 'object') ?
+    function (obj) {
+      return obj instanceof HTMLElement;
+    } :
+    function (obj) {
+      return obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string';
+    }
+};
+const MyPlugin = {}
+MyPlugin.install = function (Vue, options) {
+  // 4. 添加实例方法
+  Vue.prototype.$print = Print
+}
+//export default MyPlugin

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

@@ -29,6 +29,46 @@ var sa = {
 // ===========================  ajax的封装  ======================================= 
 (function() {
 
+	sa.ajaxNoLayer = function(url, data, success200, cfg) {
+
+		// 如果是简写模式(省略了data参数)
+		if (typeof data === 'function') {
+			cfg = success200;
+			success200 = data;
+			data = {};
+		}
+
+		// 默认配置
+		var defaultCfg = {
+			baseUrl: (url.indexOf('http') === 0 ? '' : sa.cfg.api_url), // 父url,拼接在url前面
+			sleep: 0, // 休眠n毫秒处理回调函数
+			type: 'post', // 默认请求类型
+			success200: success200, // code=200, 代表成功
+		}
+
+		// 将调用者的配置和默认配置合并
+		cfg = sa.extendJson(cfg, defaultCfg);
+		// 开始请求ajax
+		return $.ajax({
+			url: cfg.baseUrl + url,
+			type: cfg.type,
+			data: data,
+			dataType: 'json',
+			beforeSend: function(xhr) {
+				xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+				// 追加token
+				if (localStorage.tokenName) {
+					xhr.setRequestHeader(localStorage.tokenName, localStorage.tokenValue);
+				}
+			},
+			success: function(res) {
+				if (cfg['success' + res.code] != undefined) {
+					return cfg['success' + res.code](res);
+				}
+			},
+		});
+
+	};
 	sa.ajaxNoLoading = function(url, data, success200, cfg) {
 
 		// 如果是简写模式(省略了data参数)
@@ -46,7 +86,6 @@ var sa = {
 			success200: success200, // code=200, 代表成功
 			success500: function(res) { // code=500, 代表失败
 				let msg = res.msg;
-				console.log(msg);
 				if (msg === '操作超时') {
 					window.parent.location.href = '../../login.html';
 					return;

+ 56 - 0
sp-admin/sys-log.html

@@ -0,0 +1,56 @@
+<!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" style="height: 700px;overflow: auto; width: 500px;">
+					<div style="display: flex;line-height: 28px;" v-for="(item,index) in list">
+						<div>{{item.name}}</div>
+						<div style="margin-left: 5px;">{{item.time}}</div>
+						<div style="color: blue;cursor: pointer;margin-left: 8px;" @click="down(item.url)">下载</div>
+					</div>
+				</div>
+			</div>
+
+		</div>
+		<script>
+			var app = new Vue({
+				el: '.vue-box',
+				data: {
+					list: [],
+				},
+				methods: {
+					down(url){
+						window.location.href=url;
+					}
+				},
+				mounted: function() {
+					sa.ajax('/SgApilog/sys/log', function(res) {
+						this.list=res.data;
+					}.bind(this))
+				}
+			})
+		</script>
+	</body>
+</html>

+ 24 - 9
sp-server/pom.xml

@@ -175,6 +175,20 @@
             <artifactId>gson</artifactId>
             <version>2.9.0</version>
         </dependency>
+		<dependency>
+			<groupId>cn.com.btxc.micro.uni.openapi</groupId>
+			<artifactId>encrypt-rsa-md5</artifactId>
+			<version>1.0.3</version>
+			<scope>system</scope>
+			<systemPath>${project.basedir}/src/main/resources/lib/encrypt-rsa-md5-1.0.3.jar</systemPath>
+		</dependency>
+		<dependency>
+			<groupId>cn.com.btxc.micro.uni.openapi</groupId>
+			<artifactId>encrypt-base</artifactId>
+			<version>1.0.3</version>
+			<scope>system</scope>
+			<systemPath>${project.basedir}/src/main/resources/lib/encrypt-base-1.0.3.jar</systemPath>
+		</dependency>
 	</dependencies>
 
 	<!-- 构建配置 -->
@@ -198,17 +212,18 @@
 		<plugins>
 			<!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
 			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-jar-plugin</artifactId>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
 				<configuration>
-					<archive>
-						<manifest>
-							<addClasspath>true</addClasspath>
-							<classpathPrefix>lib/</classpathPrefix>
-							<mainClass>${java.run.main.class}</mainClass>
-						</manifest>
-					</archive>
+				<includeSystemScope>true</includeSystemScope>
 				</configuration>
+				<executions>
+					<execution>
+						<goals>
+							<goal>repackage</goal>
+						</goals>
+					</execution>
+				</executions>
 			</plugin>
 			<!-- 拷贝依赖的jar包到lib目录 -->
 			<plugin>

+ 3 - 13
sp-server/src/main/java/com/pj/api/jh/service/JhService.java

@@ -66,8 +66,7 @@ public class JhService {
     private TbOrderService tbOrderService;
     @Resource
     private TaskService taskService;
-    @Resource
-    private TbBusinessService tbBusinessService;
+
 
     public Map<String, ?> initPay(HttpServletRequest request) throws Exception {
         if (!jhConfig.isEnable()) {
@@ -80,14 +79,6 @@ public class JhService {
         String openid = request.getParameter("openid");
         String desc = handlerDesc(request.getParameter("desc"));
         String businessId = request.getParameter("b");
-        List<String> businessIds = StrUtil.splitTrim(businessId, ",");
-        List<TbBusiness>list=tbBusinessService.listByIds(businessIds);
-        //未审核的业务
-        long noJudgeCount = list.stream().filter(tbBusiness -> TbBusiness.ConfirmJudgeEnum.CALL_BACK.getCode() == tbBusiness.getConfirmJudge()
-                || TbBusiness.ConfirmJudgeEnum.NO_JUDGE.getCode() == tbBusiness.getConfirmJudge()).count();
-        if (noJudgeCount>0){
-            throw new Exception("存在未审核业务");
-        }
         String c = request.getParameter("c");
         String a = request.getParameter("a");
         String businessType = request.getParameter("businessType");
@@ -135,7 +126,6 @@ public class JhService {
             Map<String, String> r = wxService.getPayP(payMessage.getStr("timeStamp"), payMessage.getStr("nonceStr"), openid, p);
             StaticLog.info("re:{}", JSONUtil.toJsonStr(r));
             JSONObject object = JSONUtil.parseObj(payMessage);
-
             object.set("outTradeNo", out_trade_no);
             TbOrder tbOrder = new TbOrder();
             tbOrder.setAttach(attchStr)
@@ -150,13 +140,13 @@ public class JhService {
         //  return new HashMap<>();
     }
 
-    private String handlerDesc(String desc) {
+    private  String handlerDesc(String desc) {
         if (StrUtil.isEmpty(desc)) {
             return "";
         }
         if (desc.getBytes(Charset.forName("utf-8")).length > 128) {
             desc = StrUtil.sub(desc, 0, desc.lastIndexOf("-"));
-            handlerDesc(desc);
+            desc=  handlerDesc(desc);
         }
         return desc;
     }

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

@@ -8,6 +8,7 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
 import cn.hutool.log.StaticLog;
 import com.pj.api.open.ResultJson;
 import com.pj.api.open.bo.CheckCarNumberBO;
@@ -130,12 +131,12 @@ public class OpenService {
             tbBusinessCar.setCarNo(carNo).setPay(0).setCarSize(0D).setIsLock(0)
                     .setCarCompany(tbCar != null ? tbCar.getCustomerName() : "临时")
                     .setInChannel(channel).setRealInTime(now).setCarType(TbItem.ItemTypeEnum.EMPTY_TYPE.getType())
-                    .setBasePartMoney(new BigDecimal("0")).setTimeUpdate(now)
+                    .setBasePartMoney(new BigDecimal("0")).setTimeUpdate(now).setConfirmJudge(TbBusinessCar.ConfirmJudgeEnum.NO_NEED_JUDGE.getCode())
                     .setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
             tbBusinessCarService.save(tbBusinessCar);
             CoverBase64ToUrl(image, tbBusinessCar.getId(), carNo, 1);
             String msg = "无业务车辆";
-            log.error("入场返回:{}", msg);
+            log.error("入场返回:{}", JSONUtil.toJsonStr(ResultJson.success(msg, msg)));
             return ResultJson.success(msg, msg);
 
         }
@@ -178,6 +179,12 @@ public class OpenService {
             StaticLog.error("缓存离场图片,{}", carNo);
             IMAGE_CACHE.put(carNo, image);
         }
+        if (TbBusinessCar.BusinessTypeEnum.BUSINESS_CAR.getType().equals(tbBusinessCar.getBusinessType())) {
+            if (tbBusinessCar.getConfirmJudge() != TbBusinessCar.ConfirmJudgeEnum.JUDGE_PASS.getCode()) {
+                log.error("请求返回【业务未审核】:{}", carNo);
+                return ResultJson.error("业务未审核");
+            }
+        }
         //判断是否蓝色车牌===免停车费
         if (StrUtil.isNotEmpty(tbBusinessCar.getColor())) {
             List<TbCarNoColor> freeList = tbCarNoColorService.getFreeColor();
@@ -226,13 +233,6 @@ public class OpenService {
             //该车所有的业务都是到达卡口才进行扣费才会进入自动扣费
             int autoPayCount = 0;
             for (TbBusiness business : businessList) {
-                if (TbBusiness.ConfirmJudgeEnum.NO_JUDGE.getCode()== business.getConfirmJudge()){
-                    log.error("请求返回:业务未审核:{}", carNo);
-                    return ResultJson.error("业务未审核");
-                }else if (TbBusiness.ConfirmJudgeEnum.CALL_BACK.getCode()== business.getConfirmJudge()){
-                    log.error("请求返回:业务审核驳回:{}", carNo);
-                    return ResultJson.error("业务审核驳回");
-                }
                 TbGoods tbGoods = tbGoodsService.getById(business.getGoodsId());
                 if (TbGoods.DeductionTypeEnum.OUT_KK.getCode().equals(tbGoods.getAutoDeductionType())) {
                     autoPayCount++;
@@ -388,6 +388,11 @@ public class OpenService {
                     TbCar tbCar = tbCarService.findByCardNo(tbBusinessCar.getCarNo());
                     if (tbCar != null && !TbCar.CarTypeEnum.BUSINESS_CAR.getType().equals(tbCar.getCarType())) {
                         tbBusinessCar.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
+                        List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(tbBusinessCar.getId());
+                        if (businessList.isEmpty()) {
+                            //无业务&免费车===>无需审核
+                            tbBusinessCar.setConfirmJudge(TbBusinessCar.ConfirmJudgeEnum.NO_NEED_JUDGE.getCode());
+                        }
                     }
                     tbBusinessCar.setColor(color);
                     tbBusinessCarService.updateById(tbBusinessCar);

+ 0 - 88
sp-server/src/main/java/com/pj/api/pushfee/Demo.java

@@ -1,88 +0,0 @@
-package com.pj.api.pushfee;
-
-import cn.hutool.core.date.DateUtil;
-import com.pj.api.pushfee.tools.EncryptTools;
-import com.pj.api.pushfee.tools.http.HttpUtils;
-import com.pj.api.pushfee.tools.message.MessageInter;
-import com.pj.api.pushfee.tools.message.api.OdsOrderPayDetailDTO;
-import com.pj.api.pushfee.tools.message.api.OrderPayDetailMessage;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * 1. 生成公私钥的方法:EncryptTools.generateKeyPairs
- */
-public class Demo {
-
-    //客户端公私钥
-    public static final String f_remotePublicKeyBase6 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCb5yK85EKqwiQU+z1jyjOng6ecssQpEjC6STbCuSWN6KHLkijBxdqrCumXhbIyOVx4lHK9Rg5EjzlQxoaXQTgJdItaGjLC+UTE+NNAnnaFLg0x4jajNpLo473zdZxTYQaT3q/aKnTeXuKHw11PPUe4hmmfxPcdt9yJ0Iqo/XxV3QIDAQAB";
-    public static final String f_remotePrivateKeyBase64 = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJvnIrzkQqrCJBT7PWPKM6eDp5yyxCkSMLpJNsK5JY3oocuSKMHF2qsK6ZeFsjI5XHiUcr1GDkSPOVDGhpdBOAl0i1oaMsL5RMT400CedoUuDTHiNqM2kujjvfN1nFNhBpPer9oqdN5e4ofDXU89R7iGaZ/E9x233InQiqj9fFXdAgMBAAECgYASoeKgcaVYFCDM0yQIn5thy1XGYAUapX5mXSaqygbneWSQ2FR/qB5Ur9awEb30y682CAPYhB1jazyd30QpopVINvyhaWhgq1b/8KD92FqOg1eXxa7bTuTe8aMuKTB/ZJjEry0d5Mu3i6zYKtTSbnpnag5I3UE5awLDy7utYOoOHwJBAPtvz2ZBhtJvL3lsMgs7kGqrPqqI2LAX8J3oOCtE/6eQjQ0I5fBCybrwHp3baDrYul5KTL3kJvl4iWN/gHDi/nMCQQCeu3gzy0DVtM8M8bzFc/ZA753WRn4Z5axQa6lE7Tski8TUw4Bhbfan9E/C6l6Guo/+2hXPAE/RMcncClqeXXZvAkEAgf6FsO1x4fxABDvvB6Ws/ak5hfuoZCqMaWd1GtHah2yRsEqIbxZoq7CXc6/LDJmeiT9Ku+ZoTBSIm5uA8Vw6hwJALEbs872pmzMxYlH4Lzf2pAxzAbduK3kmhNRTRjfKfJpEUHksUYEkAZujuCI6NejKi/N3i+NxYFA8F5YHyw8VHwJAWoiYSYLSziHgDytoPKFvUp6EKLGDClhACJKc4LuaPNWICMxb5Dp88sY0NDYb4HzCyWIE5G4vbiF/K3kEEwCIVA==";
-
-    //服务端公私钥
-    public static final String f_localPublicKeyBase6 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCimSu5J8apt2YR/o9joOCNdFzO3rOHcdcqnSCm1Wt19VwskTVjkKHc/CXHUoskX5vMiMiv6xPnf/lDpMO6KnCrwlVQFtbPvmnkwyUs/haW8ggR865MqDcBpdMGnuV0YJ04UXxSrOX+eu+dl91Web4/ZiRKbObOa8WhFm/Ln2QKswIDAQAB";
-    public static final String f_localPrivateKeyBase6 = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKKZK7knxqm3ZhH+j2Og4I10XM7es4dx1yqdIKbVa3X1XCyRNWOQodz8JcdSiyRfm8yIyK/rE+d/+UOkw7oqcKvCVVAW1s++aeTDJSz+FpbyCBHzrkyoNwGl0wae5XRgnThRfFKs5f56752X3VZ5vj9mJEps5s5rxaEWb8ufZAqzAgMBAAECgYAmP/QaLXI9kIgxaXnfzQOmIx6GB7uh/DTKsIXy2TfbWunhDhPKJUb+jk5w0kkrOFaVSgQz5hAboG5J7GOi0sMINLb7H2WsOm3uGM/8HPZYsrNFnB8VUiD26LIZ6+HhPXfp/LN+k5eUnUlD6z/dZU1k6hJPOSFC3PyzfBWqaQMqGQJBAMVdQ9Uw+eC94qD1MSSEQZhqpfGE4vO7WrSACLFqyZrHvaIwZTjdUZRF1aMlJyT0afOkfSN/53QQEcejXMUrSBcCQQDS576SXkpdfrN2jmr9BAimi+6AP71GUgXL3O+2yRL2szLoU7GwtMREPBFw+ocnC4UN87NCYveJCzenQEt48JfFAkAqEIa0mYuoatAyng+rSMTyR0i3ASud5wCeF+vCZJAzfP7d4pKwW/tXLsspynFdXvp2A0jomAosooAnnJnZLDBhAkBzXoXm92Fip45wShPIeE5rHJzI1xUoxHGbRS50JKYVAY3VfQL0kM3ULa+0x7bq6uhL64WhyRVziAlXmlouvB2pAkEAuDvsjVhdo3uMGL7Tr+igPhajoWUTjPuAf+Od3SsqMTPFLBpbJM8ziXk39Me9S8wqgGwR3pnlC1Z6Rybgm+uy4g==";
-
-
-    public static void main(String[] args) {
-
-
-        testMessage();
-//        testEncrypt();
-
-
-    }
-
-    private static void testMessage(){
-        String msg = "{\"header\":{\"sysId\":\"hd\",\"encrypted\":\"Tt2mAxr7pXtIOiRl8zJ/+wXlvgxH21qhLjhNUsP44ZVXPQ+s7Vc10b9h2g6/eaChTve7omuCAni3Ug0Yhe+HlOBEjap4cpc0lzeFhHOqLJNJQgQ25VN17oy4zpLb4gzB7bs77pIygt1xO1Qh1yyMQC0w/cZs+9is0VQ4lITEaXP+q766/BXIOAuqszzdw1/Ca4dqs3lr5sajVSM4T7LQHo8bR565Rad4VY24KxLKLKEUzwQo86oM0C8KZATkL38UIWhzZlDzfh8twqX5gDpC7CzFRhdlNcxLUCMbLMUYUxdb3OTgeNw8VEN0OztxCJy5E2olrF6xbAxoNzLpi60lDQ==\",\"keyEncrypted\":\"jKqpkFxZPAv1kQGSvA2MbggEb962USnP6HBMrWBdVmydBUFNqrKJmoArqRG1VKuXEpkcfvzIatMqcw9Xr7RlZKmnJ+U4qkqyYwZV2wY85o3g6bqswIjF/z4TpaTrTJkaFs/5teWeG6X5bY4K+iu+as+ID8JvvGZlvGnn50+KDxw=\",\"timeStamp\":\"20220726015514\",\"interId\":\"orderPayDetail\"},\"signature\":\"13b95ffbe6be4bfa74d2de794e499be5\"}";
-
-        try {
-            String response = HttpUtils.doPost("http://117.141.148.233:8765/monolithic/uni/v1/sync", msg);
-            System.out.println(response);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    private static void testEncrypt(){
-
-        //1. 本地,用对方的公钥加密
-        EncryptTools client = new EncryptTools("hd", f_remotePublicKeyBase6);
-
-        OrderPayDetailMessage detail = new OrderPayDetailMessage();
-        detail.setDate(DateUtil.format(new Date(), "yyyyMMdd"));
-        detail.setBatch(1);
-
-        //构造数据
-        OdsOrderPayDetailDTO order = new OdsOrderPayDetailDTO();
-        order.setSysId("hd");
-        order.setSysName("华东场站系统");
-        order.setYieldId("hd-a1");
-        order.setYieldName("华东A1园区");
-        order.setSyncType("insert");
-        order.setBatch("1");
-        order.setDwDt("20220725");
-        order.setDwTm("163206");
-        order.setUniqId("YRTFHFHFHFEWWR43645757");
-
-        List list = new ArrayList();
-        list.add(order);
-
-        detail.setList(list);
-        detail.setCount(list.size());
-
-        String encryptMessage = client.encryptMessage(detail);
-
-        //http传输
-
-        //2. 远端,用自己的私钥解密
-        EncryptTools server = new EncryptTools(f_remotePrivateKeyBase64);
-
-        MessageInter inter = server.decryptMessage(encryptMessage);
-
-
-    }
-
-}

+ 130 - 0
sp-server/src/main/java/com/pj/api/pushfee/bo/SyncBillParam.java

@@ -0,0 +1,130 @@
+package com.pj.api.pushfee.bo;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@Accessors(chain = true)
+public class SyncBillParam implements Serializable {
+    /**
+     * 产品编号
+     */
+    private String prdNo;
+    /**
+     *产品名称
+     */
+    private String prdName;
+    /**
+     *商品编号
+     */
+    private String goodNo;
+    /**
+     *商品名称
+     */
+    private String goodName;
+    /**
+     * 缴费主体编号
+     */
+    private String subjectNo;
+    /**
+     * 缴费主体名称
+     */
+    private String subjectName;
+    /**
+     *父订单号
+     */
+    private String mainBillNo;
+    /**
+     *订单号
+     */
+    private String subBillNo;
+    /**
+     *业务类型编号(二级分类)
+     */
+    private String bizTypeNo;
+    /**
+     *业务类型名称
+     */
+    private String bizTypeName;
+    /**
+     *收费项目编号(一级分类)
+     */
+    private String chargeItemNo;
+    /**
+     *收费项目名称(一级分类)
+     */
+    private String chargeItemName;
+    /**
+     *渠道支付流水号
+     */
+    private String paidSerialNo;
+    /**
+     *支付金额
+     */
+    private String paidAmount;
+    /**
+     *退款金额
+     */
+    private String refundAmount;
+    /**
+     *退款流水号
+     */
+    private String refundSerialNo;
+    /**
+     *支付状态
+     */
+    private String payStatus;
+    /**
+     *订单日期
+     */
+    private Date billTime;
+    /**
+     *支付日期
+     */
+    private String payTime;
+    /**
+     *订单描述
+     */
+    private String billDesc;
+    /**
+     *订单状态
+     */
+    private String billStatus;
+    /**
+     * insert update delete
+     */
+    private String syncType="insert";
+    /**
+     *数量
+     */
+    private String quantity;
+    /**
+     * 金额元(两位小数)
+     */
+    private String price;
+    /**
+     *分类路径
+     */
+    private String classifyPath;
+    /**
+     * 合作伙伴ID
+     */
+    private String partnersId;
+    /**
+     *合作伙伴名称
+     */
+    private String partnersName;
+    /**
+     * 减免金额
+     */
+    private BigDecimal saleAmount;
+
+    /**
+     * 实际金额
+     */
+    private BigDecimal actPrice;
+}

+ 16 - 0
sp-server/src/main/java/com/pj/api/pushfee/bo/SyncBillRequest.java

@@ -0,0 +1,16 @@
+package com.pj.api.pushfee.bo;
+
+import cn.com.btxc.micro.uni.openapi.inter.OpenApi;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+@OpenApi(apiName = "REQ_001")
+public class SyncBillRequest implements Serializable {
+
+  private List<SyncBillParam> billList;
+
+}

+ 17 - 0
sp-server/src/main/java/com/pj/api/pushfee/bo/SyncBillResponse.java

@@ -0,0 +1,17 @@
+package com.pj.api.pushfee.bo;
+
+import cn.com.btxc.micro.uni.openapi.inter.OpenApi;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+
+@Data
+@NoArgsConstructor
+@OpenApi(apiName = "REQ_001")
+public class SyncBillResponse implements Serializable {
+
+    int state;
+
+}

+ 98 - 148
sp-server/src/main/java/com/pj/api/pushfee/task/FeeDetailSyncTask.java

@@ -1,176 +1,126 @@
 package com.pj.api.pushfee.task;
 
-import cn.hutool.core.date.DateUtil;
+import cn.com.btxc.micro.uni.openapi.api.DemoResponse;
+import cn.com.btxc.micro.uni.openapi.inject.ComposeOperation;
+import cn.com.btxc.micro.uni.openapi.inter.ErrorObj;
+import cn.com.btxc.micro.uni.openapi.inter.ResponseCallBack;
+import cn.com.btxc.micro.uni.openapi.inter.message.Message;
+import cn.com.btxc.micro.uni.openapi.keys.ApiKey;
+import cn.com.btxc.micro.uni.openapi.role.ClientRole;
+import cn.com.btxc.micro.uni.openapi.role.builder.ClientRoleBuilder;
+import cn.com.btxc.micro.uni.openapi.rsa.beans.BaseParsedMessage;
+import cn.com.btxc.micro.uni.openapi.rsa.operation.ComposeOperationImpl;
 import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONObject;
+import cn.hutool.extra.spring.SpringUtil;
+import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.pj.api.pushfee.tools.EncryptTools;
-import com.pj.api.pushfee.tools.http.HttpUtils;
-import com.pj.api.pushfee.tools.message.api.OdsOrderPayDetailDTO;
-import com.pj.api.pushfee.tools.message.api.OrderPayDetailMessage;
-import com.pj.current.config.PartConfig;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.pj.api.pushfee.bo.SyncBillParam;
+import com.pj.api.pushfee.bo.SyncBillRequest;
 import com.pj.current.config.PushfeeConfig;
+import com.pj.current.task.Task;
+import com.pj.project.tb_costomer.TbCostomer;
+import com.pj.project.tb_costomer.TbCostomerService;
 import com.pj.project.tb_fee_details.TbFeeDetails;
 import com.pj.project.tb_fee_details.TbFeeDetailsService;
-import com.pj.utils.cache.RedisUtil;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
-import java.io.IOException;
-import java.math.BigDecimal;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 
 /**
  * @Auther: lzm
  * @Date: 2022/07/25/9:11
  */
-@Component
 @Slf4j
-public class FeeDetailSyncTask {
-    @Resource
-    TbFeeDetailsService tbFeeDetailsService;
-    @Resource
-    PartConfig partConfig;
-    @Resource
-    PushfeeConfig pushfeeConfig;
+public class FeeDetailSyncTask extends Task {
+    //客户端公私钥
+    public static final String clientPublicKeyBase6 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCimSu5J8apt2YR/o9joOCNdFzO3rOHcdcqnSCm1Wt19VwskTVjkKHc/CXHUoskX5vMiMiv6xPnf/lDpMO6KnCrwlVQFtbPvmnkwyUs/haW8ggR865MqDcBpdMGnuV0YJ04UXxSrOX+eu+dl91Web4/ZiRKbObOa8WhFm/Ln2QKswIDAQAB";
+    public static final String clientPrivateKeyBase6 = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKKZK7knxqm3ZhH+j2Og4I10XM7es4dx1yqdIKbVa3X1XCyRNWOQodz8JcdSiyRfm8yIyK/rE+d/+UOkw7oqcKvCVVAW1s++aeTDJSz+FpbyCBHzrkyoNwGl0wae5XRgnThRfFKs5f56752X3VZ5vj9mJEps5s5rxaEWb8ufZAqzAgMBAAECgYAmP/QaLXI9kIgxaXnfzQOmIx6GB7uh/DTKsIXy2TfbWunhDhPKJUb+jk5w0kkrOFaVSgQz5hAboG5J7GOi0sMINLb7H2WsOm3uGM/8HPZYsrNFnB8VUiD26LIZ6+HhPXfp/LN+k5eUnUlD6z/dZU1k6hJPOSFC3PyzfBWqaQMqGQJBAMVdQ9Uw+eC94qD1MSSEQZhqpfGE4vO7WrSACLFqyZrHvaIwZTjdUZRF1aMlJyT0afOkfSN/53QQEcejXMUrSBcCQQDS576SXkpdfrN2jmr9BAimi+6AP71GUgXL3O+2yRL2szLoU7GwtMREPBFw+ocnC4UN87NCYveJCzenQEt48JfFAkAqEIa0mYuoatAyng+rSMTyR0i3ASud5wCeF+vCZJAzfP7d4pKwW/tXLsspynFdXvp2A0jomAosooAnnJnZLDBhAkBzXoXm92Fip45wShPIeE5rHJzI1xUoxHGbRS50JKYVAY3VfQL0kM3ULa+0x7bq6uhL64WhyRVziAlXmlouvB2pAkEAuDvsjVhdo3uMGL7Tr+igPhajoWUTjPuAf+Od3SsqMTPFLBpbJM8ziXk39Me9S8wqgGwR3pnlC1Z6Rybgm+uy4g==";
+    //服务端公私钥
+    public static final String serverPublicKeyBase6 = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCb5yK85EKqwiQU+z1jyjOng6ecssQpEjC6STbCuSWN6KHLkijBxdqrCumXhbIyOVx4lHK9Rg5EjzlQxoaXQTgJdItaGjLC+UTE+NNAnnaFLg0x4jajNpLo473zdZxTYQaT3q/aKnTeXuKHw11PPUe4hmmfxPcdt9yJ0Iqo/XxV3QIDAQAB";
+    public static final String serverPrivateKeyBase64 = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJvnIrzkQqrCJBT7PWPKM6eDp5yyxCkSMLpJNsK5JY3oocuSKMHF2qsK6ZeFsjI5XHiUcr1GDkSPOVDGhpdBOAl0i1oaMsL5RMT400CedoUuDTHiNqM2kujjvfN1nFNhBpPer9oqdN5e4ofDXU89R7iGaZ/E9x233InQiqj9fFXdAgMBAAECgYASoeKgcaVYFCDM0yQIn5thy1XGYAUapX5mXSaqygbneWSQ2FR/qB5Ur9awEb30y682CAPYhB1jazyd30QpopVINvyhaWhgq1b/8KD92FqOg1eXxa7bTuTe8aMuKTB/ZJjEry0d5Mu3i6zYKtTSbnpnag5I3UE5awLDy7utYOoOHwJBAPtvz2ZBhtJvL3lsMgs7kGqrPqqI2LAX8J3oOCtE/6eQjQ0I5fBCybrwHp3baDrYul5KTL3kJvl4iWN/gHDi/nMCQQCeu3gzy0DVtM8M8bzFc/ZA753WRn4Z5axQa6lE7Tski8TUw4Bhbfan9E/C6l6Guo/+2hXPAE/RMcncClqeXXZvAkEAgf6FsO1x4fxABDvvB6Ws/ak5hfuoZCqMaWd1GtHah2yRsEqIbxZoq7CXc6/LDJmeiT9Ku+ZoTBSIm5uA8Vw6hwJALEbs872pmzMxYlH4Lzf2pAxzAbduK3kmhNRTRjfKfJpEUHksUYEkAZujuCI6NejKi/N3i+NxYFA8F5YHyw8VHwJAWoiYSYLSziHgDytoPKFvUp6EKLGDClhACJKc4LuaPNWICMxb5Dp88sY0NDYb4HzCyWIE5G4vbiF/K3kEEwCIVA==";
+    private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
+    private String detailId;
+    private String syncType;
 
-    /**
-     * 10分钟执行一次
-     */
-    @Scheduled(fixedRate = 600000)
-    public void send() {
-        if (!pushfeeConfig.isEnable()){
-            log.info("pushfee_info:未启用推送");
-            return;
-        }
-        if(partConfig.isTestEnv()){
-            log.info("pushfee_info: 测试环境不推送");
-            return;
-        }
-        Date startTime;
-        Integer timeSpan;
-        //先从redis中获取startTime
-        if(StrUtil.isNotEmpty(RedisUtil.get("pushfee:start_time"))){
-            startTime = DateUtil.parse(RedisUtil.get("pushfee:start_time"), "yyyy-MM-dd HH:mm:ss");
-        }else{
-            startTime = DateUtil.parse(pushfeeConfig.getStartTime(), "yyyy-MM-dd HH:mm:ss");
-        }
-        //先从redis中获取timeSpan
-        if(StrUtil.isNotEmpty(RedisUtil.get("pushfee:time_span"))){
-            timeSpan = Integer.valueOf(RedisUtil.get("pushfee:time_span"));
-        }else{
-            timeSpan = pushfeeConfig.getTimeSpan();
-        }
+    public FeeDetailSyncTask(String taskId, long delayInMilliseconds, String detailId, String syncType) {
+        super(taskId, delayInMilliseconds);
+        this.detailId = detailId;
+        this.syncType = syncType;
+    }
 
-        Date now = new Date();
-        Date finishTime = DateUtil.offsetMillisecond(startTime, timeSpan);
-        //如果当前时间小于推送结束时间,则不执行下面代码,保证推送的时间间隔为设定间隔
-        if(DateUtil.compare(now, finishTime) < 0){
-            log.info("pushfee_warn: 当前时间小于结束时间,本次任务不进行推送,开始时间为" +
-                    DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss")
-                    + ",结束时间为" + DateUtil.format(finishTime, "yyyy-MM-dd HH:mm:ss")
-                    + ",当前时间为" + DateUtil.format(now, "yyyy-MM-dd HH:mm:ss"));
-            return;
+    private List<SyncBillParam> buildParams(TbFeeDetails tbFeeDetails) {
+        List<SyncBillParam> opdList = new ArrayList<>();
+        SyncBillParam opd = new SyncBillParam();
+        String itemTypeId = tbFeeDetails.getItemTypeId();
+        if (StrUtil.isEmpty(itemTypeId)) {
+            itemTypeId = TbFeeDetails.PartFeeEnum.getNoByDesc(tbFeeDetails.getItemTypeName());
         }
-
-        //构建数据
-        List<TbFeeDetails> fdList = getfeeDetails(startTime, finishTime);
-        if(fdList.size() > 0){
-            List<OdsOrderPayDetailDTO> opdList = convert(fdList, now);
-            //1. 本地,用对方的公钥加密
-            EncryptTools client = new EncryptTools(pushfeeConfig.getSysId(), pushfeeConfig.getRemotePublicKeyBase6());
-
-            OrderPayDetailMessage detail = new OrderPayDetailMessage();
-            detail.setDate(DateUtil.format(now, "yyyyMMdd"));
-            detail.setBatch(1);
-            detail.setList(opdList);
-            detail.setCount(opdList.size());
-
-            String encryptMessage = client.encryptMessage(detail);
-            log.info("pushfee_encryptMessage: " + encryptMessage);
-
-            //推送数据
-            //String response = "{\"msg\":\"测试\",\"code\":200,\"timestamp\":\"2022-07-27 18:13:17\"}";
-            String response = "{}";
-            try {
-                response = HttpUtils.doPost(pushfeeConfig.getSyncUrl(), encryptMessage);
-                log.info("pushfee_response: " + response);
-            } catch (IOException e) {
-                log.error("pushfee_error: " + e.getMessage());
-            }
-            JSONObject jsonObject = JSONUtil.parseObj(response);
-            String code = jsonObject.getStr("code");
-            if(StrUtil.equals("200", code)){
-                RedisUtil.set("pushfee:start_time", DateUtil.format(finishTime, "yyyy-MM-dd HH:mm:ss"));
-                log.info("pushfee_info: 推送成功,范围为"
-                        + DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss") + "至"
-                        + RedisUtil.get("pushfee:start_time"));
-            }
-        }else {
-            RedisUtil.set("pushfee:start_time", DateUtil.format(finishTime, "yyyy-MM-dd HH:mm:ss"));
-            log.info("pushfee_warn: "
-                    + DateUtil.format(startTime, "yyyy-MM-dd HH:mm:ss") + "至"
-                    + RedisUtil.get("pushfee:start_time") + "范围内没有数据,本次任务不进行推送" );
+        String itemId = tbFeeDetails.getItemId();
+        if (StrUtil.isEmpty(itemId)) {
+            itemId = itemTypeId;
         }
-    }
-
-    private List<TbFeeDetails> getfeeDetails(Date startTime, Date finishTime) {
-        QueryWrapper<TbFeeDetails> qw = new QueryWrapper<>();
-        qw.ge("update_time", startTime).le("update_time", finishTime);
-        return tbFeeDetailsService.list(qw);
-    }
-
-    private List<OdsOrderPayDetailDTO> convert(List<TbFeeDetails> fdList, Date now) {
-        List<OdsOrderPayDetailDTO> opdList = new ArrayList<>();
-        for (TbFeeDetails fd : fdList) {
-            OdsOrderPayDetailDTO opd = new OdsOrderPayDetailDTO();
-            opd.setSysId(pushfeeConfig.getSysId()).setSysName(pushfeeConfig.getSysName())
-            .setYieldId(pushfeeConfig.getYieldId()).setYieldName(pushfeeConfig.getYieldName())
-            .setBatch(DateUtil.current()+"")
-            .setDwDt(DateUtil.format(now, "yyyyMMdd")).setDwTm(DateUtil.format(now, "HH:mm:ss"));
-
-            String syncType = "insert";
-            if(DateUtil.compare(fd.getCreateTime(), fd.getUpdateTime()) < 0){
-                syncType = "update";
-            }
-            String bizNo = fd.getBusinessNo();
-            if(fd.getFeeType() == TbFeeDetails.fee.PARK_FEE.getCode()){
-                bizNo = fd.getBusinessCarNo();
+        String partnersName = tbFeeDetails.getPickCustomerName();
+        if (StrUtil.isNotEmpty(partnersName)) {
+            TbCostomerService tbCostomerService = SpringUtil.getBean(TbCostomerService.class);
+            TbCostomer tbCostomer = tbCostomerService.findByName(partnersName);
+            if (tbCostomer != null) {
+                opd.setPartnersId(tbCostomer.getId());
             }
-            opd.setUniqId(fd.getId()).setBizNo(bizNo)
-                .setChargeItemId(fd.getFeeType()+"").setChargeItemName(TbFeeDetails.fee.getDesc(fd.getFeeType()))
-                .setBizTypeId(fd.getItemTypeId()).setBizTypeName(fd.getItemTypeName())
-                .setCarTypId(fd.getItemId()).setCarTypName(fd.getItemName())
-                .setCarNo(fd.getCarNo())
-                .setWeight(fd.getWeight() != null ? fd.getWeight()+"": "0")
-                .setNum(fd.getNum()+"")
-                .setPrice(fd.getUnitPrice()).setTotalPrice(fd.getItemPrice())
-                .setSettleStatusName("已结算").setSettleStatusId(fd.getIsSettle()+"")
-                .setTaxRate(fd.getTaxRate().multiply(BigDecimal.valueOf(100)))
-                .setTaxPayment(fd.getTaxPrice())
-                .setTaxAmount(fd.getItemPrice()).setNoTaxAmount(fd.getNoTaxPrice())
-                .setPaymentWayName("微信支付").setPaymentWayId(fd.getPayType()+"")
-                .setSysSerialNo(fd.getOutTradeNo())
-                .setPayNo(fd.getTransactionId())
-                .setWorkNo(fd.getBusinessItemNo())
-                .setCustName(fd.getEntityName()).setPartnerName(fd.getPickCustomerName()).setAgentName(fd.getCustomerName())
-                .setInvoiceNo(fd.getInvoice())
-                .setCreateTime(DateUtil.format(fd.getCreateTime(), "yyyy-MM-dd HH:mm:ss"))
-                .setUpdateTime(DateUtil.format(fd.getUpdateTime(), "yyyy-MM-dd HH:mm:ss"))
-                .setPayTime(fd.getPayTime())
-                .setRemarks(fd.getRemark())
-                .setBillClerkName(fd.getKaiDanPerson()).setStatAuditorName(fd.getJiChaPerson()).setDispatcherName(fd.getDiaoDuPerson())
-                .setSyncType(syncType);
-
-            opdList.add(opd);
         }
+        String subBillNo = StrUtil.isEmpty(tbFeeDetails.getBusinessNo()) ? tbFeeDetails.getBusinessCarNo() : tbFeeDetails.getBusinessCarNo();
+        String classifyPath = tbFeeDetails.getFeeType() + "-" + itemTypeId + "-" + itemId;
+        opd.setSyncType(syncType).setQuantity(tbFeeDetails.getNum().toString())
+                .setSubjectName(tbFeeDetails.getCarNo()).setSubBillNo(subBillNo)
+                .setBizTypeNo(itemTypeId).setBizTypeName(tbFeeDetails.getItemTypeName())
+                .setChargeItemName(TbFeeDetails.fee.getDesc(tbFeeDetails.getFeeType())).setChargeItemNo(tbFeeDetails.getFeeType() + "")
+                .setClassifyPath(classifyPath).setPartnersName(partnersName)
+                .setPaidSerialNo(tbFeeDetails.getTransactionId())
+                .setPaidAmount(tbFeeDetails.getItemPrice().toString()).setRefundAmount("0").setPayStatus("支付成功")
+                .setPayTime(tbFeeDetails.getPayTime()).setBillTime(tbFeeDetails.getCreateTime())
+                .setPrice(tbFeeDetails.getItemPrice().toString()).setActPrice(tbFeeDetails.getItemPrice())
+                .setBillStatus("已完成");
+        log.info("基础数据:{}", JSONUtil.parseObj(opd));
+        opdList.add(opd);
         return opdList;
     }
 
 
+    @Override
+    public void run() {
+        PushfeeConfig pushfeeConfig = SpringUtil.getBean(PushfeeConfig.class);
+        if (!pushfeeConfig.isEnable()){
+            log.info("系统未启用同步功能");
+            return;
+        }
+        log.info("开始同步发票信息:{}", detailId);
+        TbFeeDetailsService tbFeeDetailsService = SpringUtil.getBean(TbFeeDetailsService.class);
+        TbFeeDetails tbFeeDetails = tbFeeDetailsService.getById(detailId);
+        if (tbFeeDetails == null || tbFeeDetails.getSyncStatus() == 1) {
+            log.info("停止同步:{}", JSONUtil.toJsonStr(tbFeeDetails));
+            return;
+        }
+        List<SyncBillParam> list = buildParams(tbFeeDetails);
+        String sysId = pushfeeConfig.getSysId();
+        ApiKey clientApiKey = new ApiKey(sysId, pushfeeConfig.getSysName(), serverPublicKeyBase6, clientPublicKeyBase6, clientPrivateKeyBase6);
+        ComposeOperation operation = new ComposeOperationImpl();
+        ClientRole clientHelper = ClientRoleBuilder.builder().operation(operation).build();
+        SyncBillRequest detail = new SyncBillRequest();
+        detail.setBillList(list);
+        Message message = clientHelper.requestPayloadObject(sysId, detail, clientApiKey);
+        String messageToBeSend = gson.toJson(message);
+        log.info("客户端发送报文:" + messageToBeSend);
+        String response = HttpUtil.createPost(pushfeeConfig.getSyncUrl())
+                .header("Authorization", "openApi")
+                .timeout(2000).setReadTimeout(3000).body(messageToBeSend).execute().body();
+        log.info("服务端返回响应:{}", response);
+        if (JSONUtil.parseObj(response).getInt("code") == 200) {
+            tbFeeDetails.setSyncStatus(1);
+        } else {
+            tbFeeDetails.setSyncStatus(2);
+        }
+        tbFeeDetailsService.updateById(tbFeeDetails);
+    }
 }

+ 0 - 185
sp-server/src/main/java/com/pj/api/pushfee/tools/EncryptTools.java

@@ -1,185 +0,0 @@
-package com.pj.api.pushfee.tools;
-
-import cn.hutool.core.codec.Base64;
-import cn.hutool.core.util.CharsetUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.crypto.SecureUtil;
-import cn.hutool.crypto.asymmetric.KeyType;
-import cn.hutool.crypto.asymmetric.RSA;
-import cn.hutool.crypto.digest.DigestUtil;
-import cn.hutool.crypto.symmetric.AES;
-import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.pj.api.pushfee.tools.message.CuMessage;
-import com.pj.api.pushfee.tools.message.Header;
-import com.pj.api.pushfee.tools.message.Inter;
-import com.pj.api.pushfee.tools.message.MessageInter;
-
-public class EncryptTools {
-
-    private String sysId;
-
-    private String remotePublicKey;
-
-    private String localPrivateKey;
-
-    private RSA rsaInstance;
-
-    private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
-
-    /**
-     * 构造加密工具
-     * @param sysId 系统Id,由统一计费系统分配
-     * @param remotePublicKey 对方的公钥
-     */
-    public EncryptTools(String sysId, String remotePublicKey) {
-        this.sysId = sysId;
-        this.remotePublicKey = remotePublicKey;
-        rsaInstance = SecureUtil.rsa(null, this.remotePublicKey);
-    }
-
-    /**
-     * 构造解密工具
-     * @param localPrivateKey 己方的私钥
-     */
-    public EncryptTools(String localPrivateKey) {
-        this.localPrivateKey = localPrivateKey;
-        rsaInstance = SecureUtil.rsa(this.localPrivateKey, null);
-    }
-
-    /**
-     * 生成RSA密钥对
-     */
-    public static void generateKeyPairs(){
-        RSA rsa = new RSA();
-        // 获取公钥
-        String pubKey = rsa.getPublicKeyBase64();
-        System.out.println("公钥:" + pubKey);
-        // 获取私钥
-        String priKey = rsa.getPrivateKeyBase64();
-        System.out.println("私钥:" + priKey);
-    }
-
-    /**
-     * md5签名
-     * @param text
-     * @return
-     */
-    private String md5(String text){
-        return DigestUtil.md5Hex(text);
-    }
-
-    /**
-     * RSA私钥解密
-     * @return
-     */
-    private String decryptStrByPrivateKey(String encrypt){
-        try {
-            return this.rsaInstance.decryptStr(encrypt, KeyType.PrivateKey);
-        } catch (Exception e) {
-            throw new RuntimeException("RSA私钥解密失败");
-        }
-    }
-
-    /**
-     * RSA公钥加密
-     * @param text
-     * @return
-     */
-    private String encryptByPublicKey(String text){
-        try {
-            return this.rsaInstance.encryptBase64(StrUtil.bytes(text,CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey);
-        } catch (Exception e) {
-            throw new RuntimeException("RSA公钥加密失败");
-        }
-    }
-
-    /**
-     * 生成随机秘钥
-     */
-    private String getRandomKey(){
-        return Base64.encode(SecureUtil.generateKey(SymmetricAlgorithm.AES.getValue()).getEncoded());
-    }
-
-    private String encodeByAES(String content, String randomKey){
-        try {
-            AES aes = SecureUtil.aes(Base64.decode(randomKey));
-            return aes.encryptBase64(content);
-        } catch (Exception e) {
-            throw new RuntimeException("AES加密报文失败");
-        }
-    }
-
-    private String decodeByAES(String sourceText, String randomKey){
-        try {
-            AES aes = SecureUtil.aes(Base64.decode(randomKey));
-            return aes.decryptStr(sourceText);
-        } catch (Exception e) {
-            throw new RuntimeException("AES解密报文失败");
-        }
-    }
-
-    private boolean verifySignature(CuMessage message){
-        String signature = message.getSignature();
-        return md5(gson.toJson(message.getHeader())).equals(signature);
-
-    }
-
-    /**
-     * 加密报文
-     */
-    public String encryptMessage(MessageInter payLoad){
-
-        //生成随机秘钥
-        String randomKey = getRandomKey();
-        //加密报文payLoad
-        String encrypted = encodeByAES(gson.toJson(payLoad), randomKey);
-        //加密随机秘钥
-        String keyEncrypted = encryptByPublicKey(randomKey);
-
-        Inter interAnnotation = payLoad.getClass().getAnnotation(Inter.class);
-        String interId = interAnnotation.name();
-
-        Header header = new Header(this.sysId, encrypted, keyEncrypted, interId);
-
-        //签名:md5提取摘要
-        String signature = md5(gson.toJson(header));
-
-        CuMessage cuMessage = new CuMessage(header, signature);
-
-        String msg = gson.toJson(cuMessage);
-
-        System.out.println("密文:" + msg);
-
-        return msg;
-
-    }
-
-    /**
-     * 解密报文
-     * @return
-     */
-    public MessageInter decryptMessage(String text){
-        CuMessage cuMessage = gson.fromJson(text, CuMessage.class);
-        return decryptMessage(cuMessage);
-    }
-
-    public MessageInter decryptMessage(CuMessage message){
-        //验签
-        if (!verifySignature(message)) {
-            throw new RuntimeException("验签失败");
-        }
-        //用公钥解密得到randomKey
-        String key = decryptStrByPrivateKey(message.getHeader().getKeyEncrypted());
-        //用randomKey解密报文
-        String originText = decodeByAES(message.getHeader().getEncrypted(), key);
-
-        MessageInter inter = gson.fromJson(originText, InterEnum.findClass(message.getHeader().getInterId()));
-
-        System.out.println("解密:" + originText);
-
-        return inter;
-    }
-
-}

+ 6 - 3
sp-server/src/main/java/com/pj/api/pushfee/tools/http/HttpUtils.java → sp-server/src/main/java/com/pj/api/pushfee/tools/HttpUtils.java

@@ -1,4 +1,4 @@
-package com.pj.api.pushfee.tools.http;
+package com.pj.api.pushfee.tools;
 
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
@@ -60,12 +60,12 @@ public class HttpUtils {
 
 
     /***
-         * 提交https或http Post请求
+         * 提交具有加密的https或http Post请求
          * @param url  请求url
          * @param jsonEntity 请求体
          * @throws IOException
          */
-    public static String doPost(String url, String jsonEntity) throws IOException {
+    public static String doPostWithOpenApi(String url, String jsonEntity) throws IOException {
 
         HttpClient httpClient = getClientNoSSL();
 
@@ -73,6 +73,7 @@ public class HttpUtils {
         try {
             HttpPost post = new HttpPost(url);
             post.setHeader("contentType", "application/json;charset=UTF-8");
+            post.setHeader("Authorization", "openApi");
 
             StringEntity entity = new StringEntity(jsonEntity);
             entity.setContentEncoding(DEFAULT_ENCODING);
@@ -92,6 +93,8 @@ public class HttpUtils {
         }
     }
 
+
+
     public static String doGet(String url) throws IOException {
 
         HttpClient httpClient = getClientNoSSL();

+ 0 - 30
sp-server/src/main/java/com/pj/api/pushfee/tools/InterEnum.java

@@ -1,30 +0,0 @@
-package com.pj.api.pushfee.tools;
-
-import com.pj.api.pushfee.tools.message.api.OrderPayDetailMessage;
-import com.pj.api.pushfee.tools.message.MessageInter;
-
-public enum InterEnum {
-
-    ORDER_PAY_DETAIL(OrderPayDetailMessage.class, "orderPayDetail");
-
-    private Class<MessageInter> clazz;
-    private String interId;
-
-    InterEnum(Class clazz, String interId) {
-        this.clazz = clazz;
-        this.interId = interId;
-    }
-
-    public static Class<MessageInter> findClass(String interId){
-
-        int length = values().length;
-        for (int i = 0; i < length; i++) {
-            InterEnum interEnum = values()[i];
-            if (interEnum.interId.equals(interId)) {
-                return interEnum.clazz;
-            }
-        }
-        return null;
-    }
-
-}

+ 0 - 37
sp-server/src/main/java/com/pj/api/pushfee/tools/message/CuMessage.java

@@ -1,37 +0,0 @@
-package com.pj.api.pushfee.tools.message;
-
-public class CuMessage {
-
-    /**
-     * 报文头,加密后的数据均在此
-     */
-    private Header header;
-
-    /**
-     * 签名。由MD5(encrypted+ keyEncrypted+appSecret)得到。
-     * 注意签名必须是@Transient,否则序列化会出错
-     */
-    private String signature;
-
-    public CuMessage(Header header, String signature) {
-        this.header = header;
-        this.signature = signature;
-    }
-
-    public Header getHeader() {
-        return header;
-    }
-
-    public void setHeader(Header header) {
-        this.header = header;
-    }
-
-    public String getSignature() {
-        return signature;
-    }
-
-    public void setSignature(String signature) {
-        this.signature = signature;
-    }
-
-}

+ 0 - 89
sp-server/src/main/java/com/pj/api/pushfee/tools/message/Header.java

@@ -1,89 +0,0 @@
-package com.pj.api.pushfee.tools.message;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-public class Header {
-
-    /**
-     * 场站系统Id(由统计计费系统预分配)
-     */
-    public String sysId;
-
-    /**
-     * 密文。由秘钥randomKey,加密payload后得到
-     */
-    public String encrypted;
-
-    /**
-     * 加密秘钥。由公钥B加密randomKey得到
-     */
-    public String keyEncrypted;
-
-    /**
-     * 时间戳
-     */
-    public String timeStamp;
-
-    /**
-     * 接口Id
-     */
-    public String interId;
-
-    public Header(String sysId, String encrypted, String keyEncrypted, String interId) {
-        this.sysId = sysId;
-        this.encrypted = encrypted;
-        this.keyEncrypted = keyEncrypted;
-        this.timeStamp = generateTimeStamp();
-        this.interId = interId;
-    }
-
-    public Header() {
-        this.timeStamp = generateTimeStamp();
-    }
-
-    private String generateTimeStamp(){
-        SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
-        return format.format(new Date());
-    }
-
-    public String getEncrypted() {
-        return encrypted;
-    }
-
-    public void setEncrypted(String encrypted) {
-        this.encrypted = encrypted;
-    }
-
-    public String getKeyEncrypted() {
-        return keyEncrypted;
-    }
-
-    public void setKeyEncrypted(String keyEncrypted) {
-        this.keyEncrypted = keyEncrypted;
-    }
-
-    public String getTimeStamp() {
-        return timeStamp;
-    }
-
-    public void setTimeStamp(String timeStamp) {
-        this.timeStamp = timeStamp;
-    }
-
-    public String getInterId() {
-        return interId;
-    }
-
-    public void setInterId(String interId) {
-        this.interId = interId;
-    }
-
-    public String getSysId() {
-        return sysId;
-    }
-
-    public void setSysId(String sysId) {
-        this.sysId = sysId;
-    }
-}

+ 0 - 10
sp-server/src/main/java/com/pj/api/pushfee/tools/message/Inter.java

@@ -1,10 +0,0 @@
-package com.pj.api.pushfee.tools.message;
-
-import java.lang.annotation.*;
-
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface Inter {
-    String name();
-}

+ 0 - 12
sp-server/src/main/java/com/pj/api/pushfee/tools/message/MessageInter.java

@@ -1,12 +0,0 @@
-package com.pj.api.pushfee.tools.message;
-
-import java.io.Serializable;
-
-public interface MessageInter extends Serializable {
-
-    default String getInterId(){
-        Inter interAnnotation = this.getClass().getAnnotation(Inter.class);
-        return interAnnotation.name();
-    }
-
-}

+ 0 - 120
sp-server/src/main/java/com/pj/api/pushfee/tools/message/api/OdsOrderPayDetailDTO.java

@@ -1,120 +0,0 @@
-package com.pj.api.pushfee.tools.message.api;
-
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-@Data
-@NoArgsConstructor
-@Accessors(chain = true)
-public class OdsOrderPayDetailDTO implements Serializable {
-
-    private String dwDt;
-
-    private String dwTm;
-    private String sysId;
-
-    private String sysName;
-
-    private String batch;
-
-    private String yieldId;
-
-    private String yieldName;
-
-    private String uniqId;
-
-    private String syncType;
-
-    private String bizNo;
-
-    private String chargeItemId;
-
-    private String chargeItemName;
-
-    private String bizTypeId;
-
-    private String bizTypeName;
-
-    private String carTypId;
-
-    private String carTypName;
-
-    private String carNo;
-
-    private String weight;
-
-    private String num;
-
-    private BigDecimal price;
-
-    private BigDecimal totalPrice;
-
-    private String settleStatusId;
-
-    private String settleStatusName;
-
-    private String checkStatusId;
-
-    private String checkStatusName;
-
-    private BigDecimal taxRate;
-
-    private BigDecimal taxPayment;
-
-    private BigDecimal taxAmount;
-
-    private BigDecimal noTaxAmount;
-
-    private String paymentWayId;
-
-    private String paymentWayName;
-
-    private String paymentCategoryId;
-
-    private String paymentCategoryName;
-
-    private String sysSerialNo;
-
-    private String payNo;
-
-    private String workNo;
-
-    private String custNo;
-
-    private String custName;
-
-    private String partnerId;
-
-    private String partnerName;
-
-    private String agentId;
-
-    private String agentName;
-
-    private String invoiceNo;
-
-    private String createTime;
-    private String updateTime;
-
-    private String payTime;
-
-    private String remarks;
-
-    private String billClerkId;
-
-    private String billClerkName;
-
-    private String statAuditorId;
-
-    private String statAuditorName;
-
-    private String dispatcherId;
-
-    private String dispatcherName;
-
-
-}

+ 0 - 23
sp-server/src/main/java/com/pj/api/pushfee/tools/message/api/OrderPayDetailMessage.java

@@ -1,23 +0,0 @@
-package com.pj.api.pushfee.tools.message.api;
-
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import com.pj.api.pushfee.tools.message.Inter;
-import com.pj.api.pushfee.tools.message.MessageInter;
-
-import java.util.List;
-
-@Data
-@NoArgsConstructor
-@Inter(name = "orderPayDetail")
-public class OrderPayDetailMessage implements MessageInter {
-
-    String date;
-
-    int batch;
-
-    int count;
-
-    List<OdsOrderPayDetailDTO> list;
-
-}

+ 23 - 0
sp-server/src/main/java/com/pj/api/pushfee/web/TestApi.java

@@ -0,0 +1,23 @@
+package com.pj.api.pushfee.web;
+
+import cn.hutool.core.util.RandomUtil;
+import com.pj.api.pushfee.task.FeeDetailSyncTask;
+import com.pj.current.task.TaskService;
+import com.pj.utils.sg.AjaxJson;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+@RequestMapping("/api")
+@RestController
+public class TestApi {
+    @Resource
+    TaskService taskService;
+
+    @RequestMapping("test")
+    public AjaxJson test(String id){
+        taskService.addTask(new FeeDetailSyncTask(RandomUtil.randomNumbers(5),2000,id,"insert"));
+        return AjaxJson.getSuccess();
+    }
+}

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

@@ -34,6 +34,7 @@ import com.pj.project.tb_pass_record.TbPassRecord;
 import com.pj.project.tb_pass_record.TbPassRecordService;
 import com.pj.project4sp.admin.SpAdmin;
 import com.pj.project4sp.admin.SpAdminService;
+import com.pj.project4sp.global.BusinessException;
 import com.pj.utils.cache.RedisUtil;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;

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

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

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

@@ -25,6 +25,7 @@ import com.pj.project.tb_business_car.TbBusinessCarService;
 import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_business_item.TbBusinessItemService;
 import com.pj.project.tb_charge_record.TbChargeRecord;
+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;
@@ -239,7 +240,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);//添加cars的收费明细
+            tbFeeDetailsService.chargeParkFee(cars, transactionId, outTradeNo, payTime,TbFeeDetails.ModuleEnum.ONLINE.getDesc());//添加cars的收费明细
             String businessId = attach.getB();
             Date finalPayTime = payTime;
             if (StrUtil.isNotEmpty(businessId)) {
@@ -264,7 +265,7 @@ public class WxService {
                         }
                     });
                 }
-                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime);//添加items的收费明细
+                tbFeeDetailsService.chargeBusinessFee(items, transactionId, outTradeNo, payTime, TbFeeDetails.ModuleEnum.ONLINE.getDesc());//添加items的收费明细
                 items.forEach(tbBusinessItem -> tbBusinessItem.setPayStatus(1).setPayTime(finalPayTime));
                 tbBusinessItemService.updateBatchById(items);
             }

+ 4 - 0
sp-server/src/main/java/com/pj/current/config/MyConfig.java

@@ -36,6 +36,10 @@ public class MyConfig {
      * 是否彩色SQL日志
      */
     private Boolean colorSql = true;
+    /**
+     * 系统日志路径
+     */
+    private String sysLogPath;
 
 
 }

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

@@ -8,6 +8,7 @@ import org.springframework.stereotype.Component;
 @Data
 @Component
 public class OAConfig {
+    private boolean enable;
     /**
      * 请求地址
      */

+ 6 - 1
sp-server/src/main/java/com/pj/current/satoken/SaTokenConfigure.java

@@ -45,7 +45,12 @@ public class SaTokenConfigure implements WebMvcConfigurer {
         add("/api/checkUserType");
         add("/wx/getRedirectUrl");
         add("/api/doLoginByOpenid");
+        add("/api/searchPartCar");
+        add("/api/searchPartCar");
         add("/api/doLogin");
+        add("/jh/init-pay");
+        add("/jh/init-pay");
+        add("/SgApilog/sys/log");
     }};
 
     /**
@@ -70,7 +75,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
                 .setAuth(obj -> {
                     // ...
                     String path = SaHolder.getRequest().getRequestPath();
-                    if (StpUtil.isLogin() && !NO_URL.contains(path)) {
+                    if (StpUtil.isLogin() && !NO_URL.contains(path)&&!StrUtil.contains(path,"api")) {
                         String key = StpUtil.getLoginIdAsString();
                         String time = RedisUtil.get(key);
                         String now = DateUtil.now();

+ 0 - 1
sp-server/src/main/java/com/pj/current/satoken/StpUserUtil.java

@@ -78,7 +78,6 @@ public class StpUserUtil {
     }
 
     public static String getCustomerId() {
-        SpAdmin admin = getAdmin();
         return getAdmin().getCustomerId();
     }
 

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

@@ -23,6 +23,7 @@ public class ErrorBusinessBO extends OtherBusinessBO implements Serializable {
      * 编号
      */
     private String no;
+    private String transactionId;
     /**
      * 创建时间
      */

+ 7 - 27
sp-server/src/main/java/com/pj/project/tb_business/TbBusiness.java

@@ -42,7 +42,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
      * 此模块对应的权限码
      */
     public static final String PERMISSION_CODE = "tb-business";
-    public static final String PERMISSION__JUDGE = "tb-business-judge";
+
     public static final String PERMISSION_LIST = "tb-business-list";
     public static final String PERMISSION_CONFIRM = "tb-business-confirm";
     public static final String PERMISSION_PAY = "tb-business-pay";
@@ -272,6 +272,8 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     private String oaFdId;
     //审批时间
     private Date oaJudgeTime;
+    //微信支付订单号
+    private String transactionId;
 
     private transient String itemJson;
     private transient String peopleJson;
@@ -283,22 +285,9 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
     private String confirmBy;
     private String confirmByAdminId;
 
-    /**
-     * 确认审核(0=未审核,1=审核通过,2=审核驳回)[j]
-     */
-    private Integer confirmJudge;
-    /**
-     * 审核时间
-     */
-    private Date confirmJudgeTime;
-    /**
-     * 审核意见
-     */
-    private String confirmJudgeContent;
-    /**
-     * 审核人
-     */
-    private String confirmJudgeBy;
+
+
+
 
 
     @TableField(exist = false)
@@ -354,16 +343,7 @@ public class TbBusiness extends Model<TbBusiness> implements Serializable {
         private int code;
         private String desc;
     }
-    @Getter
-    @AllArgsConstructor
-    public static enum ConfirmJudgeEnum {
-        NO_JUDGE(0, "未审核"),
-        JUDGE_PASS(1, "审核通过"),
-        CALL_BACK(2, "审核驳回"),
-        ;
-        private int code;
-        private String desc;
-    }
+
 
 
     public void setCardNo(String cardNo) {

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

@@ -5,6 +5,7 @@ import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 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_business_car.TbBusinessCar;
@@ -342,6 +343,7 @@ public class TbBusinessController {
         errorBusinessBO.setCars(cars);
         errorBusinessBO.setSupplementBy(StpUserUtil.getCreateBy());
         String currentCustomerId = StpUserUtil.getCustomerId();
+        StaticLog.info("currentCustomerId============= :{}",currentCustomerId);
         tbBusinessService.selectErrorBusiness(errorBusinessBO, currentCustomerId.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId()));
         return AjaxJson.getSuccess();
     }
@@ -410,35 +412,5 @@ public class TbBusinessController {
         return AjaxJson.getSuccessData(tbBusinessService.findOtherBusinessByCarId(businessCarId));
     }
 
-    /**
-     * 审核通过
-     *
-     * @return
-     */
-    @RequestMapping("confirmJudgePass")
-    @SaCheckPermission(TbBusiness.PERMISSION__JUDGE)
-    public AjaxJson confirmJudge() {
-        SoMap soMap = SoMap.getRequestSoMap();
-        String id = soMap.getString("id");
-        tbBusinessService.confirmJudgePass(id);
-        return AjaxJson.getSuccess();
-    }
-
-    /**
-     * 驳回
-     *
-     * @return
-     */
-    @RequestMapping("callback")
-    @SaCheckPermission(TbBusiness.PERMISSION__JUDGE)
-    public AjaxJson callback() {
-        SoMap soMap = SoMap.getRequestSoMap();
-        String id = soMap.getString("id");
-        String judgeContent = soMap.getString("judgeContent");
-        tbBusinessService.callback(id,judgeContent);
-        return AjaxJson.getSuccess();
-
-    }
-
 
 }

+ 1 - 1
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessMapper.xml

@@ -33,7 +33,7 @@
             <if test=' this.has("realInTime") '>and real_in_time = #{realInTime}</if>
             <if test=' this.has("payStatus") '>and pay_status = #{payStatus}</if>
             <if test=' this.has("payTime") '>and pay_time = #{payTime}</if>
-            <if test=' this.has("confirmJudge") '>and confirm_judge = #{confirmJudge}</if>
+
             <if test=' this.has("payType") '>and pay_type = #{payType}</if>
             <if test=' this.has("outDayTime") '>and out_day_time = #{outDayTime}</if>
             <if test=' this.has("partMoney") '>and part_money = #{partMoney}</if>

+ 51 - 38
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 import com.pj.api.pushfee.oa.CallbackBO;
 import com.pj.api.wx.bo.MsgDataBO;
+import com.pj.api.wx.bo.PriceBO;
 import com.pj.api.wx.service.WxService;
 import com.pj.constants.UserTypeEnum;
 import com.pj.current.config.*;
@@ -152,6 +153,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
     @Resource
     private OAConfig oaConfig;
 
+    @Resource
+    private PushfeeConfig pushfeeConfig;
 
     @Resource
     private TbFeeDetailsService tbFeeDetailsService;
@@ -498,9 +501,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         Map<String, Object> result = new HashMap<>();
         //对应的业务
         List<TbBusiness> businessList = this.findOtherBusinessByCarId(businessCarId);
-        //未审核的业务
-        long noJudgeCount = businessList.stream().filter(tbBusiness -> TbBusiness.ConfirmJudgeEnum.CALL_BACK.getCode() == tbBusiness.getConfirmJudge()
-                || TbBusiness.ConfirmJudgeEnum.NO_JUDGE.getCode() == tbBusiness.getConfirmJudge()).count();
         Set<TbBusinessCar> cars = new HashSet<>();
         //越南车是否需要支付
         int vietnamCarPay = businessList.stream().anyMatch(tbBusiness -> {
@@ -609,8 +609,14 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                 }
             }
         }
+        result.put("noJudgeCount", 0);
+        TbBusinessCar tbBusinessCar = tbBusinessCarService.getById(businessCarId);
+        if (TbBusinessCar.BusinessTypeEnum.BUSINESS_CAR.getType().equals(tbBusinessCar.getBusinessType())) {
+            if (tbBusinessCar.getConfirmJudge() != TbBusinessCar.ConfirmJudgeEnum.JUDGE_PASS.getCode()) {
+                result.put("noJudgeCount", 1);
+            }
+        }
         result.put("itemsPrice", itemsPrice);
-        result.put("noJudgeCount", noJudgeCount);
         result.put("itemList", itemList);
         result.put("businessNo", businessList.stream().map(TbBusiness::getNo).distinct().collect(Collectors.joining("、")));
         result.put("goodsName", businessList.stream().map(TbBusiness::getGoodsName).distinct().collect(Collectors.joining("、")));
@@ -790,6 +796,12 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             }
             //最新一条记录
             TbBusinessCar db = tbBusinessCarService.findTheLastRecord(carNo);
+            if (!tbGoods.getName().contains("整车")){
+                //记录不存在或者已离场
+                if (db==null||db.getRealOutTime()!=null){
+                    throw new BusinessException("车辆【"+carNo+"】未入场,无法录入业务");
+                }
+            }
             //不存在,或者已离场记录--->新建记录;
             if (db == null || db.getRealInTime() != null && db.getRealOutTime() != null) {
                 db = new TbBusinessCar();
@@ -809,8 +821,8 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     db.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
                 }
             }
-            db.setCarNo(carNo).setIsLock(0);
-            db.setCarSize(car.getCarSize())
+            db.setCarNo(carNo).setIsLock(0).setBusinessType(TbBusinessCar.BusinessTypeEnum.BUSINESS_CAR.getType());
+            db.setCarSize(car.getCarSize()).setConfirmJudge(TbBusinessCar.ConfirmJudgeEnum.NO_JUDGE.getCode())//业务车都是未审核状态
                     .setTimeUpdate(now).setCarType(car.getCarType())
                     .setNetWeight(car.getNetWeight())
                     .setCustomerId(customerId)
@@ -1056,6 +1068,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
      * @param isAdmin         是否管理员
      */
     public void selectErrorBusiness(ErrorBusinessBO errorBusinessBO, boolean isAdmin) {
+        log.info("is admin :{}",isAdmin);
         TbBusiness tbBusiness = getById(errorBusinessBO.getId());
         if (tbBusiness == null) {
             throw new AjaxError("业务已被删除");
@@ -1120,6 +1133,9 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
      * @param sendBy
      */
     private void sendOA(TbBusiness tbBusiness, List<TbBusinessItem> items, List<TbBusinessCar> tbBusinessCars, String sendBy) {
+        if (!oaConfig.isEnable()){
+            return;
+        }
         ParamsBO paramsBO = buildParams(tbBusiness, items, tbBusinessCars);
         String json = JSONUtil.toJsonStr(paramsBO);
         log.info("构建流程表单数据:{}", json);
@@ -1303,6 +1319,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             no = errorBusinessBO.getNo();
         }
         int index = 1;
+        //作业项目
         for (TbItem tbItem : tbItems) {
             TbItem db = tbItemService.getById(tbItem.getId());
             TbBusinessItem tbBusinessItem = new TbBusinessItem();
@@ -1325,7 +1342,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             index++;
         }
         String declareNo = errorBusinessBO.getDeclareNo();
-        tbBusiness.setCardSize(errorBusinessBO.getCarSize()).setNetWeight(errorBusinessBO.getNetWeight())
+        tbBusiness.setCardSize(errorBusinessBO.getCarSize()).setNetWeight(errorBusinessBO.getNetWeight()).setTransactionId(errorBusinessBO.getTransactionId())
                 .setOperator(errorBusinessBO.getOperator()).setOperateTime(errorBusinessBO.getOperateTime())
                 .setNo(no).setGoodsName(tbGoods.getName()).setGoodsId(errorBusinessBO.getGoodsId())
                 .setSupplementReason(errorBusinessBO.getSupplementReason()).setSupplementTime(now)
@@ -1342,6 +1359,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         Integer chinaCarPay = tbGoods.getChinaCarPay();
         Integer vietnamCarPay = tbGoods.getVietnamCarPay();
         String carBuseinssNo = DateUtil.format(now, "yyyyMMddHHmm");
+        //业务车
         for (TbBusinessCar car : cars) {
             String carNo = car.getCarNo().trim().toUpperCase();
             String carType = car.getCarType();
@@ -1391,6 +1409,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
      * @param id
      */
     public void applyOA(String id, String sendBy) {
+        log.info("发起流程:{},{}",id,sendBy);
         TbBusiness tbBusiness = this.getById(id);
         List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
         List<TbBusinessCar> tbBusinessCars = tbBusinessCarService.findOtherBusinessCar(id);
@@ -1440,9 +1459,34 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         if (tbBusiness == null) {
             throw new AjaxError("流程不存在");
         }
+        String result = callbackBO.getAuditResult();
         tbBusiness.setOaResult(callbackBO.getAuditResult()).setOaContent(callbackBO.getRefuseReason())
                 .setOaJudgeTime(new Date());
         this.updateById(tbBusiness);
+        String businessId = tbBusiness.getId();
+        if (StrUtil.contains(result, "通过") &&pushfeeConfig.isEnable()) {
+            //todo 审批通过-==>已支付的生成明细===>推送订单到计费系统
+            List<TbBusinessCar> cars = tbBusinessCarService.findOtherBusinessCar(businessId);
+            String transactionId = tbBusiness.getTransactionId();
+            Date payTime = tbBusiness.getPayTime();
+            String outTradeNo = "of" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) + RandomUtil.randomNumbers(4);
+            //已经支付了的
+            List<PriceBO> priceBOList = cars.stream().filter(tbBusinessCar -> tbBusinessCar.getPayTime() != null).
+                    map(tbBusinessCar -> {
+                        PriceBO priceBO = new PriceBO();
+                        priceBO.setId(tbBusinessCar.getId()).setP(tbBusinessCar.getMoney());
+                        return priceBO;
+                    }).
+                    collect(Collectors.toList());
+            if (!priceBOList.isEmpty()) {
+                tbFeeDetailsService.chargeParkFee(priceBOList, transactionId, outTradeNo, payTime,TbFeeDetails.ModuleEnum.OFFLINE.getDesc());//添加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的收费明细
+            }
+
+        }
     }
 
     /**
@@ -1463,36 +1507,5 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         return this.getOne(ew);
     }
 
-    /**
-     * 审核驳回
-     *
-     * @param id
-     * @param judgeContent
-     */
-    public void callback(String id, String judgeContent) {
-        TbBusiness tbBusiness = this.getById(id);
-        if (tbBusiness == null) {
-            throw new AjaxError("业务不存在");
-        }
-        tbBusiness.setConfirmJudge(TbBusiness.ConfirmJudgeEnum.CALL_BACK.getCode())
-                .setConfirmJudgeContent(judgeContent).setConfirmJudgeTime(new Date())
-                .setConfirmJudgeBy(StpUserUtil.getCreateBy());
-        this.updateById(tbBusiness);
-    }
 
-    /**
-     * 审核通
-     *
-     * @param id
-     */
-    public void confirmJudgePass(String id) {
-        TbBusiness tbBusiness = this.getById(id);
-        if (tbBusiness == null) {
-            throw new AjaxError("业务不存在");
-        }
-        tbBusiness.setConfirmJudge(TbBusiness.ConfirmJudgeEnum.JUDGE_PASS.getCode())
-                .setConfirmJudgeContent("审核通过").setConfirmJudgeTime(new Date())
-                .setConfirmJudgeBy(StpUserUtil.getCreateBy());
-        this.updateById(tbBusiness);
-    }
 }

+ 2 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/ExportTbBusinessDTO.java

@@ -36,6 +36,8 @@ public class ExportTbBusinessDTO {
     @ExcelProperty("支付状态")
     private String payType;
 
+
+
     @ExcelProperty("支付时间")
     private Date payTime;
     @ExcelProperty("出场确认说明")

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

@@ -44,7 +44,7 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
     public static final String PERMISSION_ADD = "tb-business-car-add";
     public static final String PERMISSION_EDIT = "tb-business-car-edit";
     public static final String PERMISSION_DEL = "tb-business-car-del";
-
+    public static final String PERMISSION__JUDGE = "tb-business-car-judge";
 
     // ---------- 表中字段 ----------
     /**
@@ -118,7 +118,7 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
 
     private Date timeUpdate;
 
-    //private Integer businessType=0;
+    private Integer businessType = 0;
     private String carType;
     private String netWeight;
     private Date createTime;
@@ -133,7 +133,22 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
     private String outRemark;
 
     private String payType;
-
+    /**
+     * 确认审核(0=未审核,1=审核通过,2=审核驳回)[j]
+     */
+    private Integer confirmJudge;
+    /**
+     * 审核时间
+     */
+    private Date confirmJudgeTime;
+    /**
+     * 审核意见
+     */
+    private String confirmJudgeContent;
+    /**
+     * 审核人
+     */
+    private String confirmJudgeBy;
 
     @Getter
     @AllArgsConstructor
@@ -144,5 +159,24 @@ public class TbBusinessCar extends Model<TbBusinessCar> implements Serializable
         private String type;
     }
 
+    @Getter
+    @AllArgsConstructor
+    public static enum BusinessTypeEnum {
+        NO_BUSINESS(0, "非业务车"),
+        BUSINESS_CAR(1, "业务车");
+        private Integer type;
+        private String typeDesc;
+    }
+    @Getter
+    @AllArgsConstructor
+    public static enum ConfirmJudgeEnum {
+        NO_JUDGE(0, "未审核"),
+        JUDGE_PASS(1, "审核通过"),
+        CALL_BACK(2, "审核驳回"),
+        NO_NEED_JUDGE(3, "无需审核"),
+        ;
+        private int code;
+        private String desc;
+    }
 
 }

+ 37 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarController.java

@@ -123,6 +123,8 @@ public class TbBusinessCarController {
             so.put("carNo", carNo.toUpperCase().trim());
             so.put("carNoList", StrUtil.splitTrim(carNo.toUpperCase(), "、"));
         }
+        //flag=1  ==>只显示有入场记录的
+        so.put("flag",1);
         List<TbBusinessCar> list = tbBusinessCarService.getList(so.startPage());
         return AjaxJson.getPageData(so.getDataCount(), list);
     }
@@ -171,6 +173,7 @@ public class TbBusinessCarController {
             soMap.put("carNo", carNo.toUpperCase().trim());
             soMap.put("carNoList", StrUtil.splitTrim(carNo.toUpperCase(), "、"));
         }
+        soMap.put("flag",1);
         return AjaxJson.getSuccessData(tbBusinessCarService.export(soMap));
     }
 
@@ -207,4 +210,38 @@ public class TbBusinessCarController {
     }
 
 
+    /**
+     * 审核通过
+     *
+     * @return
+     */
+    @RequestMapping("confirmJudgePass")
+    @SaCheckPermission(TbBusinessCar.PERMISSION__JUDGE)
+    public AjaxJson confirmJudge() {
+        SoMap soMap = SoMap.getRequestSoMap();
+        String id = soMap.getString("id");
+        tbBusinessCarService.confirmJudgePass(id);
+        return AjaxJson.getSuccess();
+    }
+
+    /**
+     * 驳回
+     *
+     * @return
+     */
+    @RequestMapping("callback")
+    @SaCheckPermission(TbBusinessCar.PERMISSION__JUDGE)
+    public AjaxJson callback() {
+        SoMap soMap = SoMap.getRequestSoMap();
+        String id = soMap.getString("id");
+        String judgeContent = soMap.getString("judgeContent");
+        tbBusinessCarService.callback(id,judgeContent);
+        return AjaxJson.getSuccess();
+
+    }
+    @RequestMapping("getListByCarId")
+    public AjaxJson getListByCarId(String businessCarId) {
+        return AjaxJson.getSuccessData( tbBusinessCarService.findByCarId(businessCarId));
+    }
+
 }

+ 2 - 1
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.xml

@@ -52,8 +52,9 @@
         <where>
             <if test=' this.has("id") '>and id = #{id}</if>
             <if test=' this.has("businessId") '>and business_id = #{businessId}</if>
+            <if test=' this.has("flag") '>and real_in_time is not null </if>
             <if test=' this.has("customerId") '>and customer_id = #{customerId}</if>
-
+            <if test=' this.has("confirmJudge") '>and confirm_judge = #{confirmJudge}</if>
             <if test=' this.has("carNoList") and carNoList.size>0'>
                 and (car_no like concat('%',#{carNo},'%') or car_no in
                 <foreach collection="carNoList" open="(" close=")" item="carNo" separator=",">

+ 66 - 13
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.current.config.SystemObject;
+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_account.AutomaticPay;
@@ -24,6 +25,7 @@ import com.pj.project.tb_fee_details.TbFeeDetails;
 import com.pj.project.tb_fee_details.TbFeeDetailsService;
 import com.pj.project.tb_item.TbItem;
 import com.pj.project4sp.uploadfile.UploadConfig;
+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;
@@ -179,31 +181,36 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
 
     public void addCarRecord(TbBusinessCar t) throws Exception {
         String carNo = t.getCarNo().toUpperCase();
-        TbBusinessCar db = this.check(carNo);
-        if (db != null) {
-            throw new Exception("该车有未完成业务");
+        String remark = t.getRemark();
+        String outRemark = t.getOutRemark();
+        if (t.getRealInTime() == null) {
+            throw new Exception("入场时间不能为空");
         }
-        String remark=t.getRemark();
-        String outRemark=t.getOutRemark();
-        if (StrUtil.isEmpty(remark)&&t.getRealInTime()!=null){
+        if (StrUtil.isEmpty(remark) && t.getRealInTime() != null) {
             throw new Exception("补录入场时间,备注必填");
         }
-        if (StrUtil.isEmpty(outRemark)&&t.getRealOutTime()!=null){
+        if (StrUtil.isEmpty(outRemark) && t.getRealOutTime() != null) {
             throw new Exception("补录离场时间,出场确认说明必填");
         }
-        t.setCarNo(carNo).setPay(0).setIsLock(0).setBasePartMoney(new BigDecimal("0")).setTimeUpdate(new Date())
+        TbBusinessCar db = this.check(carNo);
+        if (db != null) {
+            t.setId(db.getId()).setBusinessType(db.getBusinessType());
+        }
+        t.setCarNo(carNo).setPay(0).setIsLock(0)
+                .setBasePartMoney(new BigDecimal("0"))
+                .setTimeUpdate(new Date())
                 .setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
-        this.save(t);
+        this.saveOrUpdate(t);
         // automaticPay.unbindRun(carNo);
     }
 
     public void updateCarRecord(TbBusinessCar t) throws Exception {
-        String outRemark=t.getOutRemark();
+        String outRemark = t.getOutRemark();
         TbBusinessCar db = this.getById(t.getId());
-        if (StrUtil.isEmpty(outRemark)&& !Objects.equals(t.getRealOutTime(),db.getRealOutTime())){
+        if (StrUtil.isEmpty(outRemark) && !Objects.equals(t.getRealOutTime(), db.getRealOutTime())) {
             throw new Exception("补录离场时间,出场确认说明必填");
         }
-        if (t.getRealInTime()==null&&t.getRealOutTime()!=null){
+        if (t.getRealInTime() == null && t.getRealOutTime() != null) {
             throw new Exception("补录离场时间,请填写入场时间");
         }
         if (db.getRealOutTime() == null && t.getRealOutTime() != null) {
@@ -218,7 +225,7 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
             t.setInTimeSupplement(1).setInTimeSupplementTime(new Date());
         }
         if (t.getRealInTime() != null && t.getRealOutTime() != null
-                &&StrUtil.equals(db.getPayType(),TbBusinessCar.PayTypeEnum.NO_PAY_TYPE.getType())) {
+                && StrUtil.equals(db.getPayType(), TbBusinessCar.PayTypeEnum.NO_PAY_TYPE.getType())) {
             BigDecimal money = tbBusinessService.calculationPartMoney(t.getRealInTime(), t.getRealOutTime());
             t.setMoney(money);
             db.setMoney(money);
@@ -440,4 +447,50 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
         return list(ew);
     }
 
+    public List<TbBusinessCar>findByCarId(String carId){
+        List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(carId);
+        List<TbBusinessCar>list=new ArrayList<>();
+        businessList.forEach(tbBusiness -> {
+            List<TbBusinessCar> tbBusinessCars = this.findOtherBusinessCar(tbBusiness.getId());
+            list.addAll(tbBusinessCars);
+        });
+        return list.stream().distinct().collect(Collectors.toList());
+    }
+
+    /**
+     * 审核驳回
+     *
+     * @param id
+     * @param judgeContent
+     */
+    public void callback(String id, String judgeContent) {
+        List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(id);
+        businessList.forEach(tbBusiness -> {
+            List<TbBusinessCar> tbBusinessCars = this.findOtherBusinessCar(tbBusiness.getId());
+            tbBusinessCars.forEach(tbBusinessCar -> {
+                tbBusinessCar.setConfirmJudge(TbBusinessCar.ConfirmJudgeEnum.CALL_BACK.getCode())
+                        .setConfirmJudgeContent(judgeContent).setConfirmJudgeTime(new Date())
+                        .setConfirmJudgeBy(StpUserUtil.getCreateBy());
+                this.updateById(tbBusinessCar);
+            });
+        });
+    }
+
+    /**
+     * 审核通
+     *
+     * @param id
+     */
+    public void confirmJudgePass(String id) {
+        List<TbBusiness> businessList = tbBusinessService.findOtherBusinessByCarId(id);
+        businessList.forEach(tbBusiness -> {
+            List<TbBusinessCar> tbBusinessCars = this.findOtherBusinessCar(tbBusiness.getId());
+            tbBusinessCars.forEach(tbBusinessCar -> {
+                tbBusinessCar.setConfirmJudge(TbBusinessCar.ConfirmJudgeEnum.JUDGE_PASS.getCode())
+                        .setConfirmJudgeContent("审核通过").setConfirmJudgeTime(new Date())
+                        .setConfirmJudgeBy(StpUserUtil.getCreateBy());
+                this.updateById(tbBusinessCar);
+            });
+        });
+    }
 }

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

@@ -1,5 +1,6 @@
 package com.pj.project.tb_fee_details;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.AllArgsConstructor;
 import lombok.Data;
@@ -9,6 +10,7 @@ import lombok.experimental.Accessors;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Date;
 
 /**
@@ -218,6 +220,11 @@ public class TbFeeDetails implements Serializable {
      * 预存款自动收费订单号
      */
     private String preOrderNum;
+    /**
+     * 同步状态0未同步;1=成功;2失败
+     */
+    private Integer syncStatus=0;
+    private String module;
 
     @Getter
     @AllArgsConstructor
@@ -257,6 +264,39 @@ public class TbFeeDetails implements Serializable {
 
 
     }
+    @Getter
+    @AllArgsConstructor
+    //(1=核酸检测,2=消杀作业,3=装卸作业,4=停车费,5=过磅费)
+    public static enum SyncTypeEnum {
+        INSERT("insert", "新增"),
+        UPDATE("update", "更新"),
+        DELETE("delete", "删除");
+
+        private String code;
+        private String desc;
+    }
+    @Getter
+    @AllArgsConstructor
+    public static enum ModuleEnum {
+        ONLINE("线上"),
+        OFFLINE("线下");
+        private String desc;
+    }
+    @Getter
+    @AllArgsConstructor
+    //(1=核酸检测,2=消杀作业,3=装卸作业,4=停车费,5=过磅费)
+    public static enum PartFeeEnum {
+        DAY_PART("1", "白天停车"),
+        NIGHT_PART("2", "夜间停车"),
+        UNKNOW("-1", "未知"),
+        ;
+        private String no;
+        private String desc;
+        public static String getNoByDesc(String desc){
+           return Arrays.stream(PartFeeEnum.values()).filter(obj-> StrUtil.equals(desc,obj.getDesc()))
+                    .findAny().orElse(UNKNOW).getNo();
+        }
+    }
 
 
 }

+ 121 - 90
sp-server/src/main/java/com/pj/project/tb_fee_details/TbFeeDetailsService.java

@@ -8,6 +8,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.stream.Collectors;
 
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.RandomUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.excel.EasyExcel;
@@ -19,10 +20,12 @@ import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.api.pushfee.task.FeeDetailSyncTask;
 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.current.task.TaskService;
 import com.pj.project.relation_business_car.RelationBusinessCar;
 import com.pj.project.relation_business_car.RelationBusinessCarService;
 import com.pj.project.tb_business.TbBusiness;
@@ -93,6 +96,8 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
     TbCostomerService tbCostomerService;
     @Resource
     TbDeductionBindService tbDeductionBindService;
+    @Resource
+    TaskService taskService;
 
     /**
      * 增
@@ -131,7 +136,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     public List<TbFeeDetails> getByBusinessItemId(String businessItemId) {
         QueryWrapper<TbFeeDetails> qw = new QueryWrapper<>();
-        qw.lambda().eq(TbFeeDetails::getBusinessItemId,businessItemId);
+        qw.lambda().eq(TbFeeDetails::getBusinessItemId, businessItemId);
         return list(qw);
     }
 
@@ -160,6 +165,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     /**
      * 查找放行记录所有的收费明细
+     *
      * @param businessCarId
      * @param carNo
      * @param feeType
@@ -182,7 +188,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         return list(qw);
     }
 
-    public TbFeeDetails findBuCarIdAndCarNoAndFeeTypeAndItemTypeName(String businessCarId, String carNo, Integer feeType, String itemTypeName){
+    public TbFeeDetails findBuCarIdAndCarNoAndFeeTypeAndItemTypeName(String businessCarId, String carNo, Integer feeType, String itemTypeName) {
         QueryWrapper<TbFeeDetails> qw = new QueryWrapper<>();
         qw.eq("business_car_id", businessCarId);
         qw.eq("car_no", carNo);
@@ -199,14 +205,14 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     /**
      * 处理停车费收费明细
+     *
      * @param cars
      * @param transactionId
      * @param outTradeNo
      * @param now
      */
-    public void chargeParkFee(List<PriceBO> cars, String transactionId, String outTradeNo, Date now) {
+    public void chargeParkFee(List<PriceBO> cars, String transactionId, String outTradeNo, Date now,String module) {
         log.info("进入计算停车费:{}", JSONUtil.toJsonStr(cars));
-
         String payDay = DateUtil.format(now, "yyyy-MM-dd");
         for (PriceBO bo1 : cars) {
             if (bo1.getP().compareTo(BigDecimal.valueOf(0)) == 0) {
@@ -219,28 +225,30 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             //不是当前日期,当前放行记录的车辆在之前的日期付的钱
             BigDecimal notToDayMoney = new BigDecimal(0);
             for (TbFeeDetails d : thisCarAllFeeList) {
-                if(!StrUtil.equals(payDay, d.getPayDay())){
+                if (!StrUtil.equals(payDay, d.getPayDay())) {
                     notToDayMoney = notToDayMoney.add(d.getItemPrice());
                 }
             }
             //当前日期付的钱 = 改放行记录总的停车费-之前日前的钱
-            BigDecimal thisDayMoney  = car.getMoney().subtract(notToDayMoney);
+            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();
+            dayParkFee.setModule(module);
+            nightParkFee.setModule(module);
             String transactionIdStr = "";
             String outTradeNoStr = "";
             for (TbFeeDetails oldFee : oldFeeList) {
-                if(StrUtil.isNotEmpty(oldFee.getTransactionId())){
+                if (StrUtil.isNotEmpty(oldFee.getTransactionId())) {
                     transactionIdStr = oldFee.getTransactionId();
                     outTradeNoStr = oldFee.getOutTradeNo();
                 }
-                if(StrUtil.equals(oldFee.getItemTypeName(), "白天停车")){
+                if (StrUtil.equals(oldFee.getItemTypeName(), "白天停车")) {
                     dayParkFee = oldFee;
                 }
-                if(StrUtil.equals(oldFee.getItemTypeName(), "夜间停车")){
+                if (StrUtil.equals(oldFee.getItemTypeName(), "夜间停车")) {
                     nightParkFee = oldFee;
                 }
             }
@@ -249,29 +257,36 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             BigDecimal baseNightPrice = partConfig.getBasePrice().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));
-                    setFee(nightParkFee, car, transactionIdStr, outTradeNoStr, now);
-                    saveOrUpdate(nightParkFee);
-                    if(qr[1].compareTo(BigDecimal.valueOf(0)) == 0 && dayParkFee.getId() != null){
-                        delete(Long.valueOf(dayParkFee.getId()));
-                    }
+            if (nightFeeNum.compareTo(BigDecimal.valueOf(0)) > 0) {
+                nightParkFee.setNum(nightFeeNum.intValue()).setItemTypeName("夜间停车")
+                        .setUnitPrice(baseNightPrice).setItemPrice(baseNightPrice.multiply(nightFeeNum));
+                setFee(nightParkFee, car, transactionIdStr, outTradeNoStr, now);
+                String type = StrUtil.isEmpty(nightParkFee.getId()) ? TbFeeDetails.SyncTypeEnum.INSERT.getCode() : TbFeeDetails.SyncTypeEnum.UPDATE.getCode();
+                saveOrUpdate(nightParkFee);
+                taskService.addTask(new FeeDetailSyncTask(RandomUtil.randomNumbers(10), 1000, nightParkFee.getId(), type));
+                if (qr[1].compareTo(BigDecimal.valueOf(0)) == 0 && dayParkFee.getId() != null) {
+                    delete(Long.valueOf(dayParkFee.getId()));
+                    type = TbFeeDetails.SyncTypeEnum.DELETE.getCode();
+                    taskService.addTask(new FeeDetailSyncTask(RandomUtil.randomNumbers(10), 1000, dayParkFee.getId(), type));
+
+                }
             }
-            if(qr[1].compareTo(BigDecimal.valueOf(0)) > 0){
+            if (qr[1].compareTo(BigDecimal.valueOf(0)) > 0) {
                 dayParkFee.setNum(1).setItemTypeName("白天停车").setUnitPrice(qr[1]).setItemPrice(qr[1]);
                 setFee(dayParkFee, car, transactionIdStr, outTradeNoStr, now);
+                String type = StrUtil.isEmpty(dayParkFee.getId()) ? TbFeeDetails.SyncTypeEnum.INSERT.getCode() : TbFeeDetails.SyncTypeEnum.UPDATE.getCode();
                 saveOrUpdate(dayParkFee);
+                taskService.addTask(new FeeDetailSyncTask(RandomUtil.randomNumbers(10), 1000, dayParkFee.getId(), type));
             }
 
         }
     }
 
-    private void setFee(TbFeeDetails parkFee, TbBusinessCar car, String transactionId, String outTradeNo, Date now){
+    private void setFee(TbFeeDetails parkFee, TbBusinessCar car, 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");
         parkFee.setTaxRate(partConfig.getTaxRate());
-        BigDecimal taxPrice = parkFee.getItemPrice().divide(BigDecimal.valueOf(1).add(parkFee.getTaxRate()),2, BigDecimal.ROUND_HALF_UP).multiply(parkFee.getTaxRate());
+        BigDecimal taxPrice = parkFee.getItemPrice().divide(BigDecimal.valueOf(1).add(parkFee.getTaxRate()), 2, BigDecimal.ROUND_HALF_UP).multiply(parkFee.getTaxRate());
         taxPrice = taxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
         BigDecimal noTaxPrice = parkFee.getItemPrice().subtract(taxPrice);
         noTaxPrice = noTaxPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
@@ -283,15 +298,24 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                 .setIsSettle(1).setPayMode(1).setPayTime(nowStr)
                 .setTransactionId(transactionId).setOutTradeNo(outTradeNo)
                 .setBusinessCarNo(car.getNo());
-        if(StrUtil.isNotEmpty(car.getCustomerId())){
+        if (StrUtil.isNotEmpty(car.getCustomerId())) {
             TbCostomer costomer = tbCostomerService.getById(car.getCustomerId());
-            if(costomer != null){
+            if (costomer != null) {
                 parkFee.setCustomerName(costomer.getName());
             }
         }
     }
-    public void chargeBusinessFee(List<TbBusinessItem> items, String transactionId, String outTradeNo, Date now) {
 
+    /**
+     * 生成明细
+     *
+     * @param items
+     * @param transactionId
+     * @param outTradeNo
+     * @param now
+     * @param module        线上缴费/线下缴费
+     */
+    public void chargeBusinessFee(List<TbBusinessItem> items, String transactionId, String outTradeNo, Date now, String module) {
         String nowStr = DateUtil.format(now, "yyyy-MM-dd HH:mm:ss");
         String toDay = DateUtil.format(now, "yyyy-MM-dd");
         for (TbBusinessItem item : items) {
@@ -329,8 +353,8 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                 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() == 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 = "";
@@ -338,13 +362,13 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             List<RelationBusinessCar> relation = relationBusinessCarService.findByBusinessId(item.getBusinessId());
             for (RelationBusinessCar rela : relation) {
                 TbBusinessCar bt = tbBusinessCarService.getById(rela.getBusinessCarId());
-                if(StrUtil.contains(carNo, bt.getCarNo())){
+                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);
+            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)
@@ -358,8 +382,11 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                     .setCustomerName(business.getCustomerName())
                     .setIsSettle(1).setPayMode(1).setPayTime(nowStr).setWeight(business.getNetWeight())
                     .setTransactionId(transactionId).setOutTradeNo(outTradeNo)
-                    .setNum(Integer.valueOf(item.getNum()));
-            this.saveOrUpdate(businessFeeDetail);
+                    .setNum(Integer.valueOf(item.getNum()))
+                    .setModule(module);
+            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));
         }
     }
 
@@ -491,9 +518,9 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                     .setKaiDanPerson(feeDetails.getKaiDanPerson())
                     .setJiChaPerson(feeDetails.getJiChaPerson())
                     .setDiaoDuPerson(feeDetails.getDiaoDuPerson());
-            if(!StrUtil.isEmpty(feeDetails.getBusinessId())){
+            if (!StrUtil.isEmpty(feeDetails.getBusinessId())) {
                 detailDTO.setBusinessNo(feeDetails.getBusinessNo());
-            }else {
+            } else {
                 detailDTO.setBusinessNo(feeDetails.getBusinessCarNo());
             }
             exportList.add(detailDTO);
@@ -523,7 +550,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
         contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
         HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(
-                contentWriteCellStyle,contentWriteCellStyle);
+                contentWriteCellStyle, contentWriteCellStyle);
         ExcelWriter excelWriter = null;
         try {
             excelWriter = EasyExcel.write(savePath + fileName, ExportFeeDetailDTO.class)
@@ -538,33 +565,33 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             List<String> totalList1 = ListUtils.newArrayList();//倒数第1行
             totalListList.add(totalList2);
             totalListList.add(totalList1);
-            for (int i=0;i<22;i++){
-                if(i==0){
+            for (int i = 0; i < 22; i++) {
+                if (i == 0) {
                     totalList2.add("合计");
-                }else if(i==8){
+                } else if (i == 8) {
                     totalList2.add(allDayFee.toString());
-                }else if(i==11){
+                } else if (i == 11) {
                     totalList2.add(allDayTaxes.toString());
-                }else if(i==12){
+                } else if (i == 12) {
                     totalList2.add(allDayNoTaxFee.toString());
-                }else {
+                } else {
                     totalList2.add(null);
                 }
-                if(i==2){
+                if (i == 2) {
                     totalList1.add("收费核对员:");
-                }else if(i==10){
+                } else if (i == 10) {
                     totalList1.add("收费统计员:");
-                }else if(i==18){
+                } else if (i == 18) {
                     totalList1.add("收费员:");
-                }else {
+                } else {
                     totalList1.add(null);
                 }
             }
             excelWriter.write(totalListList, writeSheet);
         } catch (IOException e) {
             e.printStackTrace();
-        }finally {
-            if(excelWriter!=null){
+        } finally {
+            if (excelWriter != null) {
                 excelWriter.finish();
             }
         }
@@ -592,7 +619,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         return list != null ? list.size() : 0;
     }
 
-    private Integer getOutAndPayCarNum(Date now){
+    private Integer getOutAndPayCarNum(Date now) {
         Date beginOfDay = DateUtil.beginOfDay(now);
         Date endOfDay = DateUtil.endOfDay(now);
         QueryWrapper<TbBusinessCar> qw = new QueryWrapper();
@@ -604,7 +631,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         return list != null ? list.size() : 0;
     }
 
-    private Integer getNotOutCarNum(Date now){
+    private Integer getNotOutCarNum(Date now) {
         Date beginOfDay = DateUtil.beginOfDay(now);
         Date endOfDay = DateUtil.endOfDay(now);
         QueryWrapper<TbBusinessCar> qw = new QueryWrapper();
@@ -617,9 +644,9 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
     }
 
     public List<TbFeeDetails> findByBusinessCarId(String businessCarId, int feeType) {
-        QueryWrapper<TbFeeDetails>ew=new QueryWrapper<>();
-        ew.eq("business_car_id",businessCarId);
-        ew.eq("fee_type",feeType);
+        QueryWrapper<TbFeeDetails> ew = new QueryWrapper<>();
+        ew.eq("business_car_id", businessCarId);
+        ew.eq("fee_type", feeType);
         return list(ew);
     }
 
@@ -653,12 +680,12 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
                     .setTaxPrice(feeDetails.getTaxPrice()).setNoTaxPrice(feeDetails.getNoTaxPrice()).setPayTime(feeDetails.getPayTime())
                     .setPickCustomerName(feeDetails.getPickCustomerName())
                     .setCustomerName(feeDetails.getCustomerName())
-                    .setKaiDanPerson(feeDetails.getKaiDanPerson()!=null?feeDetails.getKaiDanPerson():"")
-                    .setJiChaPerson(feeDetails.getJiChaPerson()!=null?feeDetails.getJiChaPerson():"")
-                    .setDiaoDuPerson(feeDetails.getDiaoDuPerson()!=null?feeDetails.getDiaoDuPerson():"");
-            if(!StrUtil.isEmpty(feeDetails.getBusinessId())){
+                    .setKaiDanPerson(feeDetails.getKaiDanPerson() != null ? feeDetails.getKaiDanPerson() : "")
+                    .setJiChaPerson(feeDetails.getJiChaPerson() != null ? feeDetails.getJiChaPerson() : "")
+                    .setDiaoDuPerson(feeDetails.getDiaoDuPerson() != null ? feeDetails.getDiaoDuPerson() : "");
+            if (!StrUtil.isEmpty(feeDetails.getBusinessId())) {
                 detailDTO.setBusinessNo(feeDetails.getBusinessNo());
-            }else {
+            } else {
                 detailDTO.setBusinessNo(feeDetails.getBusinessCarNo());
             }
             printList.add(detailDTO);
@@ -674,20 +701,20 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
     }
 
     public List<FeeTypeStatics> getFeeTypeStatics(String startDay, String endDay) {
-        List<FeeTypeStatics> list=tbFeeDetailsMapper.getFeeTypeStatics(startDay,endDay);
-       Double totalPrice= list.stream().collect(Collectors.summarizingDouble(FeeTypeStatics::getPrice)).getSum();
-       Long total= list.stream().collect(Collectors.summarizingLong(FeeTypeStatics::getTotal)).getSum();
-        FeeTypeStatics feeTypeStatics=new FeeTypeStatics();
+        List<FeeTypeStatics> list = tbFeeDetailsMapper.getFeeTypeStatics(startDay, endDay);
+        Double totalPrice = list.stream().collect(Collectors.summarizingDouble(FeeTypeStatics::getPrice)).getSum();
+        Long total = list.stream().collect(Collectors.summarizingLong(FeeTypeStatics::getTotal)).getSum();
+        FeeTypeStatics feeTypeStatics = new FeeTypeStatics();
         feeTypeStatics.setName("总计").setPrice(totalPrice).setTotal(total);
         list.add(feeTypeStatics);
         return list;
     }
 
     public List<FeeTypeStatics> itemTypeStatics(String startDay, String endDay) {
-        List<FeeTypeStatics> list=tbFeeDetailsMapper.itemTypeStatics(startDay,endDay);
-        Double totalPrice= list.stream().collect(Collectors.summarizingDouble(FeeTypeStatics::getPrice)).getSum();
-        Long total= list.stream().collect(Collectors.summarizingLong(FeeTypeStatics::getTotal)).getSum();
-        FeeTypeStatics feeTypeStatics=new FeeTypeStatics();
+        List<FeeTypeStatics> list = tbFeeDetailsMapper.itemTypeStatics(startDay, endDay);
+        Double totalPrice = list.stream().collect(Collectors.summarizingDouble(FeeTypeStatics::getPrice)).getSum();
+        Long total = list.stream().collect(Collectors.summarizingLong(FeeTypeStatics::getTotal)).getSum();
+        FeeTypeStatics feeTypeStatics = new FeeTypeStatics();
         feeTypeStatics.setName("总计").setPrice(totalPrice).setTotal(total);
         list.add(feeTypeStatics);
         return list;
@@ -696,14 +723,14 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
     public void jiChaConfirm(List<Long> ids) {
         SpAdmin admin = StpUserUtil.getAdmin();
         SpRole role = spRoleMapper.getById(Long.valueOf(admin.getRoleId()));
-        if(!StrUtil.equals(TbFeeDetails.personEnum.JICHA.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())){
+        if (!StrUtil.equals(TbFeeDetails.personEnum.JICHA.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) {
             String name = admin.getName();
-            if(StrUtil.isNotEmpty(admin.getNickname())){
+            if (StrUtil.isNotEmpty(admin.getNickname())) {
                 name = admin.getNickname();
             }
             detail.setJiChaPerson(name).setUpdateTime(new Date());
@@ -717,14 +744,14 @@ 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())){
+        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) {
             String name = admin.getName();
-            if(StrUtil.isNotEmpty(admin.getNickname())){
+            if (StrUtil.isNotEmpty(admin.getNickname())) {
                 name = admin.getNickname();
             }
             detail.setKaiDanPerson(name).setUpdateTime(new Date());
@@ -737,21 +764,21 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     public void diaoDuConfirm(List<Long> ids) {
         SpAdmin admin = StpUserUtil.getAdmin();
-        AtomicBoolean hasPermission= new AtomicBoolean(false);
-        StrUtil.splitTrim(admin.getRoleId(),",").forEach(roleId->{
+        AtomicBoolean hasPermission = new AtomicBoolean(false);
+        StrUtil.splitTrim(admin.getRoleId(), ",").forEach(roleId -> {
             SpRole role = spRoleMapper.getById(Long.valueOf(roleId));
-            if(StrUtil.equals(TbFeeDetails.personEnum.FUHE.getDesc(), role.getName()) ||StrUtil.equals("admin", role.getType())){
-               hasPermission.set(true);
+            if (StrUtil.equals(TbFeeDetails.personEnum.FUHE.getDesc(), role.getName()) || StrUtil.equals("admin", role.getType())) {
+                hasPermission.set(true);
             }
         });
-        if (!hasPermission.get()){
+        if (!hasPermission.get()) {
             throw new BusinessException("无操作权限");
         }
         List<TbFeeDetails> detailsList = this.listByIds(ids);
         Set<String> days = new HashSet<>();
         for (TbFeeDetails detail : detailsList) {
             String name = admin.getName();
-            if(StrUtil.isNotEmpty(admin.getNickname())){
+            if (StrUtil.isNotEmpty(admin.getNickname())) {
                 name = admin.getNickname();
             }
             detail.setDiaoDuPerson(name).setUpdateTime(new Date());
@@ -764,11 +791,11 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     private void changeStats(Set<String> days, String personType) {
         String personColumn = "";
-        if(StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())){
+        if (StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())) {
             personColumn = "ji_cha_person";
-        }else if(StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())){
+        } else if (StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())) {
             personColumn = "kai_dan_person";
-        }else{
+        } else {
             personColumn = "diao_du_person";
         }
         for (String day : days) {
@@ -778,32 +805,32 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
             QueryWrapper<TbFeeDetails> ew2 = new QueryWrapper<>();
             ew2.like("create_time", day);
             Integer thisDayTotal = tbFeeDetailsMapper.selectCount(ew2);
-            if(confirmList.size() == thisDayTotal){
+            if (confirmList.size() == thisDayTotal) {
                 Set<String> names = new TreeSet<>();
                 for (TbFeeDetails detail : confirmList) {
-                    if(StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())){
+                    if (StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())) {
                         names.add(detail.getJiChaPerson());
-                    }else if(StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())){
+                    } else if (StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())) {
                         names.add(detail.getKaiDanPerson());
-                    }else{
+                    } else {
                         names.add(detail.getDiaoDuPerson());
                     }
                 }
                 String personName = StrUtil.join(",", names);
-                QueryWrapper<TbFeeStatistics> ew3= new QueryWrapper<>();
+                QueryWrapper<TbFeeStatistics> ew3 = new QueryWrapper<>();
                 ew3.eq("day_time", day);
                 List<TbFeeStatistics> statsList = tbFeeStatisticsService.list(ew3);
                 for (TbFeeStatistics thisDayStats : statsList) {
-                    if(StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())){
+                    if (StrUtil.equals(personType, TbFeeDetails.personEnum.JICHA.getDesc())) {
                         thisDayStats.setJiChaPerson(personName);
-                    }else if(StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())){
+                    } else if (StrUtil.equals(personType, TbFeeDetails.personEnum.KAIDAN.getDesc())) {
                         thisDayStats.setKaiDanPerson(personName);
-                    }else{
+                    } else {
                         thisDayStats.setDiaoDuPerson(personName);
                     }
                 }
                 tbFeeStatisticsService.updateBatchById(statsList);
-            }else{
+            } else {
                 continue;
             }
         }
@@ -812,7 +839,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
     public void jiChaCancel(List<Long> ids) {
         SpAdmin admin = StpUserUtil.getAdmin();
         SpRole role = spRoleMapper.getById(Long.valueOf(admin.getRoleId()));
-        if(!StrUtil.equals(TbFeeDetails.personEnum.JICHA.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())){
+        if (!StrUtil.equals(TbFeeDetails.personEnum.JICHA.getDesc(), role.getName()) && !StrUtil.equals("admin", role.getType())) {
             throw new BusinessException("该操作需要统计稽查员的权限");
         }
         List<TbFeeDetails> detailsList = this.listByIds(ids);
@@ -825,9 +852,10 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         this.updateBatchById(detailsList);
         changeStats(days);
     }
+
     private void changeStats(Set<String> days) {
         for (String day : days) {
-            QueryWrapper<TbFeeStatistics> ew3= new QueryWrapper<>();
+            QueryWrapper<TbFeeStatistics> ew3 = new QueryWrapper<>();
             ew3.eq("day_time", day);
             List<TbFeeStatistics> statsList = tbFeeStatisticsService.list(ew3);
             for (TbFeeStatistics thisDayStats : statsList) {
@@ -843,9 +871,9 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
     }
 
     public List<TbFeeDetails> findByBusinessNo(String businessNo) {
-        QueryWrapper<TbFeeDetails>ew=new QueryWrapper<>();
-        ew.eq("business_no",businessNo);
-       return list(ew);
+        QueryWrapper<TbFeeDetails> ew = new QueryWrapper<>();
+        ew.eq("business_no", businessNo);
+        return list(ew);
     }
 
     public List<TbFeeStatistics> getDayStatistics(String toDay) {
@@ -855,6 +883,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     /**
      * 预充值自动缴费-收费明细生成
+     *
      * @param items
      * @param transactionId
      * @param outTradeNo
@@ -938,6 +967,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
 
     /**
      * 预充值自动缴费-停车费明细生成
+     *
      * @param cars
      * @param transactionId
      * @param outTradeNo
@@ -1007,6 +1037,7 @@ public class TbFeeDetailsService extends ServiceImpl<TbFeeDetailsMapper, TbFeeDe
         }
         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");
         String toDay = DateUtil.format(now, "yyyy-MM-dd");

+ 34 - 2
sp-server/src/main/java/com/pj/project4sp/apilog/SpApilogControlle.java

@@ -1,15 +1,27 @@
 package com.pj.project4sp.apilog;
 
 import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import com.pj.current.config.SystemObject;
 import com.pj.current.satoken.AuthConst;
 import com.pj.project4sp.SP;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.List;
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.attribute.FileTime;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * Controller: api请求记录表
@@ -23,7 +35,7 @@ public class SpApilogControlle {
     /**
      * 底层 Mapper 对象
      */
-    @Autowired
+    @Resource
     SpApilogMapper spApilogMapper;
 
 
@@ -82,5 +94,25 @@ public class SpApilogControlle {
         return AjaxJson.getSuccessData(data);
     }
 
+    /**
+     * @return
+     */
+    @RequestMapping(value = "sys/log")
+    AjaxJson getSysLog() {
+        String path = SystemObject.config.getSysLogPath();
+        File file = new File(path);
+        List<Map<String, String>> list = new ArrayList<>();
+        Arrays.stream(Objects.requireNonNull(file.listFiles())).forEach(f -> {
+            String name = f.getName();
+            Map<String, String> map = new HashMap<>();
+            String time = DateUtil.format(new Date(f.lastModified()), "yyyy-MM-dd HH:mm:ss");
+            map.put("time", time);
+            map.put("name", name);
+            map.put("url", SystemObject.config.getDomain().replace("pro", "") + "sys-log/" + name);
+            list.add(map);
+        });
+        List<Map<String, String>>sortList = list.stream().sorted(Comparator.comparing(obj -> obj.get("time"))).collect(Collectors.toList());
+        return AjaxJson.getSuccessData(sortList);
+    }
 
 }

+ 6 - 4
sp-server/src/main/resources/application-dev.yml

@@ -6,9 +6,9 @@ spring:
     # 数据源配置
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
-        url: jdbc:mysql://47.101.143.145:3306/pco0815?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
         username: root
-        password: 1qaz@WSX
+        password: 123456
         # 是否打开sql监控台  (生产环境请务必关闭此选项)
         druid:
             stat-view-servlet:
@@ -48,6 +48,7 @@ spring:
         domain: http://127.0.0.1:8099/pro
         web-domain: https://127.0.0.1:8080
         login-out-minute: 10
+        sys-log-path: D:\project\pco\sp-server\logs\pco\debug
 part-config:
     base-price: 30 #基础费用
     extra-price: 10 #过夜额外收费
@@ -94,8 +95,8 @@ ocr-config:
 pushfee-config:
     enable: true
     remote-public-key-base6: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCb5yK85EKqwiQU+z1jyjOng6ecssQpEjC6STbCuSWN6KHLkijBxdqrCumXhbIyOVx4lHK9Rg5EjzlQxoaXQTgJdItaGjLC+UTE+NNAnnaFLg0x4jajNpLo473zdZxTYQaT3q/aKnTeXuKHw11PPUe4hmmfxPcdt9yJ0Iqo/XxV3QIDAQAB
-    sync-url: http://117.141.148.233:8765/monolithic/uni/v1/sync
-    sys-id: "0001"
+    sync-url: http://117.141.148.233:8000/accounting/sync/bill
+    sys-id: "0101"
     sys-name: 东兴口岸场站系统
     yield-id: 0001-a1
     yield-name: 东兴口岸场站系统-A1园区
@@ -103,6 +104,7 @@ pushfee-config:
     #默认时间间隔为一小时
     time-span: 3600000
 oa:
+    enable: true
     url: http://117.141.148.233:18766/bpm/operational/addReview/
     system-code: "0101" #来源编码
     template-id: 183212c0a9bec6f20f33cba41ffa4391 #模板id

BIN
sp-server/src/main/resources/lib/encrypt-base-1.0.3.jar


BIN
sp-server/src/main/resources/lib/encrypt-rsa-md5-1.0.3.jar