yanghb
2023-04-21 75a2623173bcc4a235aa1f99f7ef28519186160b
代码调整
111个文件已修改
124个文件已删除
22个文件已添加
21139 ■■■■ 已修改文件
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/config/RedisConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/config/SwaggerConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/ShiroConfig.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/core/intercept/GunsUserFilter.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/core/util/Contrast.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/core/util/GetMobile.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/dao/mapping/OrderCharteredCarMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/model/OrderCharteredCar.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/server/IOrderCharteredCarService.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/server/impl/OrderCharteredCarServiceImpl.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AdvertisementController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AgreementController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/BankCardController.java 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/InvoiceController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/MerchantController.java 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/NettyController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java 1015 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/ServerCarModelController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/TaxiCardController.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserCallbackController.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java 176 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserUserController.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/WithdrawalController.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/dao/OrderCallMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/dao/mapping/OrderCallMapper.xml 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/model/OrderCall.java 1056 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/server/IOrderCallService.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/server/impl/OrderCallServiceImpl.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/controller/SiteController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/SiteMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/LineSiteMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/OrderCrossCityMapper.xml 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/SiteMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/model/OrderCrossCity.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/model/Site.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/IOrderCrossCityService.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/ISiteService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineSiteServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java 1053 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/SiteServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/warpper/OrderCrossCityWarpper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/newlyAdded/NewlyAddedController.java 868 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/dao/OrderLogisticsMapper.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/dao/mapping/OrderLogisticsMapper.xml 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/model/OrderLogistics.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/IOrderLogisticsService.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java 825 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/controller/OrderPrivateCarController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/dao/OrderPrivateCarMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/dao/mapping/OrderPrivateCarMapper.xml 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/model/OrderPrivateCar.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/IOrderPrivateCarService.java 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java 1348 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/LoginController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/AdditionalFeeMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/BankCardMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/CouponRecordMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverServiceMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MerchantActivityMapper.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MerchantActivitySlaveMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MerchantCouponMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MerchantMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/OfflineTravelPaymentMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/OrderAdditionalFeeMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCarBrandMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TaxiCardMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TaxiCardPaymentMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbCarRentalMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbCommentMapper.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbMessNumMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbRecruitMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbSellingCarMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbShowModularMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbSpellOrderRuleMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserMerchantCouponMapper.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserTaxiCardMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserUserMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AdditionalFeeMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/BankCardMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CouponRecordMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverMapper.xml 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverServiceMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/InvoiceMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MerchantActivityMapper.xml 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MerchantActivitySlaveMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MerchantCouponMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MerchantMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OfflineTravelPaymentMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OrderAdditionalFeeMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OrderCancelMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceMapper.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarBrandMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaxiCardMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaxiCardPaymentMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbCarRentalMapper.xml 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbCommentMapper.xml 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbMessNumMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbRecruitMapper.xml 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbSellingCarMapper.xml 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbShowModularMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbSpellOrderRuleMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserInfoMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMerchantCouponMapper.xml 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserTaxiCardMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserUserMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/WithdrawalMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/AdditionalFee.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/BankCard.java 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Company.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Complaint.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/CouponRecord.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Driver.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Merchant.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/MerchantActivity.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/MerchantActivitySlave.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/MerchantCoupon.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OfflineTravelPayment.java 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OpenCityBusiness.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OrderAdditionalFee.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OrderCancel.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OrderEvaluate.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SystemNotice.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCarBrand.java 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TaxiCard.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TaxiCardPayment.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbCarRental.java 428 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbComment.java 285 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbMessNum.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbRecruit.java 397 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbSellingCar.java 625 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbShowModular.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbSpellOrderRule.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserCouponRecord.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserMerchantCoupon.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserTaxiCard.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserUser.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Withdrawal.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IAdditionalFeeService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IBankCardService.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ICouponRecordService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverServiceService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMerchantActivityService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMerchantActivitySlaveService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMerchantCouponService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMerchantService.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOfflineTravelPaymentService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOpenCityService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOrderAdditionalFeeService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOrderService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IRegionService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISysIntegralService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCarBrandService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITaxiCardPaymentService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITaxiCardService.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbCarRentalService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbCommentService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbMessNumService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbRecruitService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbSellingCarService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbShowModularService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbSpellOrderRuleService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserInfoService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserMerchantCouponService.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserTaxiCardService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserUserService.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IWithdrawalService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/AdditionalFeeServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/BankCardServiceImpl.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CompanyCityServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ComplaintServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CouponRecordServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/InvoiceServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MerchantActivityServiceImpl.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MerchantActivitySlaveServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MerchantCouponServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MerchantServiceImpl.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OfflineTravelPaymentServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OpenCityBusinessServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OpenCityServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderAdditionalFeeServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RegionServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ServerCarModelServiceImpl.java 223 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SysIntegralServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCarBrandServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TaxiCardPaymentServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TaxiCardServiceImpl.java 727 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbCarRentalServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbCommentServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbMessNumServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbRecruitServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbSellingCarServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbShowModularServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbSpellOrderRuleServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserCouponRecordServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserMerchantCouponServiceImpl.java 255 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserTaxiCardServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserUserServiceImpl.java 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/VerifiedServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/WithdrawalServiceImpl.java 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AESUtil.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ALiApiUtil.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ALiSendSms.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ChinaMobileUtil.java 162 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DESUtil.java 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDFalconUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDMapElectricFenceUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDMapGeocodingUtil.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/HttpClientUtil.java 346 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ICBCPayUtil.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/JuHeUtil.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/LiuZhouBank/Config.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/LiuZhouBank/PayUtil.java 390 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/LiuZhouBank/ProtocolSignUtil.java 543 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/LiuZhouBank/ResultNotification.java 215 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MinistryOfTransport.java 226 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PayMoneyUtil.java 457 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RedisUtil.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/UUIDUtil.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/VerifyCodeUtils.java 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/httpClinet/HttpClientUtil.java 265 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/httpClinet/HttpResult.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/BankCardWarpper.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/CouponWarpper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/CouponsListVo.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MerchantCouponListWarpper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MerchantCouponWarpper.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MerchantWapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderAdditionalFeeWarpper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderCrossCityInfoWrapper.java 251 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderInfoWarpper.java 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderRuleWarpper.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderWarpper.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/PreferentialDataVo.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/ServerCarModelWarpper.java 218 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/SmartScreenOrderVo.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/TaxiCardWapper.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserInfoWarpper.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserMerchantCouponWapper.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/dao/mapping/OrderTaxiMapper.xml 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/dao/mapping/PaymentRecordMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/model/OrderTaxi.java 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/model/PaymentRecord.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/IOrderTaxiService.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java 991 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/resources/application.yml 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/config/RedisConfig.java
@@ -40,7 +40,7 @@
        jedisPoolConfig.setBlockWhenExhausted(blockWhenExhausted);
        // 是否启用pool的jmx管理功能, 默认true
        jedisPoolConfig.setJmxEnabled(true);
        JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout);
        JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout, password);
        return jedisPool;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/config/SwaggerConfig.java
@@ -36,7 +36,7 @@
    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("天马出租 Doc")
                .title("OK出行 Doc")
                .description("所有接口前需要加 /user 前缀,例如:/user/base/agreement/queryByType <br>" +
                        "所有以 /api/*** 路径的接口需要上传签名参数sign")
//                .termsOfServiceUrl("http://git.oschina.net/naan1993/guns")
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/ShiroConfig.java
@@ -102,7 +102,7 @@
    @Bean
    public CookieRememberMeManager rememberMeManager(SimpleCookie rememberMeCookie) {
        CookieRememberMeManager manager = new CookieRememberMeManager();
        manager.setCipherKey(Base64.decode("Z3VucwAAAAAAAAAAAAAAAA=="));
        manager.setCipherKey(Base64.decode(""));
        manager.setCookie(rememberMeCookie);
        return manager;
    }
@@ -112,7 +112,7 @@
     */
    @Bean
    public SimpleCookie rememberMeCookie() {
        SimpleCookie simpleCookie = new SimpleCookie("rememberMe");
        SimpleCookie simpleCookie = new SimpleCookie("");
        simpleCookie.setHttpOnly(true);
        simpleCookie.setMaxAge(7 * 24 * 60 * 60);//7天
        return simpleCookie;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/core/intercept/GunsUserFilter.java
@@ -41,13 +41,13 @@
    /**
     * Returns <code>true</code> if the request is a
     * {@link #isLoginRequest(javax.servlet.ServletRequest, javax.servlet.ServletResponse) loginRequest} or
     * if the current {@link #getSubject(javax.servlet.ServletRequest, javax.servlet.ServletResponse) subject}
     * {@link #isLoginRequest(ServletRequest, ServletResponse) loginRequest} or
     * if the current {@link #getSubject(ServletRequest, ServletResponse) subject}
     * is not <code>null</code>, <code>false</code> otherwise.
     *
     * @return <code>true</code> if the request is a
     * {@link #isLoginRequest(javax.servlet.ServletRequest, javax.servlet.ServletResponse) loginRequest} or
     * if the current {@link #getSubject(javax.servlet.ServletRequest, javax.servlet.ServletResponse) subject}
     * {@link #isLoginRequest(ServletRequest, ServletResponse) loginRequest} or
     * if the current {@link #getSubject(ServletRequest, ServletResponse) subject}
     * is not <code>null</code>, <code>false</code> otherwise.
     */
    protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) {
@@ -62,7 +62,7 @@
    /**
     * This default implementation simply calls
     * {@link #saveRequestAndRedirectToLogin(javax.servlet.ServletRequest, javax.servlet.ServletResponse) saveRequestAndRedirectToLogin}
     * {@link #saveRequestAndRedirectToLogin(ServletRequest, ServletResponse) saveRequestAndRedirectToLogin}
     * and then immediately returns <code>false</code>, thereby preventing the chain from continuing so the redirect may
     * execute.
     */
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/core/util/Contrast.java
@@ -138,7 +138,7 @@
                Method getMethod = null;
                try {
                    getMethod = clazz.getDeclaredMethod(prefix + StrKit.firstCharToUpperCase(field.getName()));
                } catch (java.lang.NoSuchMethodException e) {
                } catch (NoSuchMethodException e) {
                    System.err.println("this className:" + clazz.getName() + " is not methodName: " + e.getMessage());
                    continue;
                }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/core/util/GetMobile.java
@@ -46,7 +46,7 @@
             */
            HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
            System.out.println(response.toString());
            System.err.println(response.toString());
            return  EntityUtils.toString(response.getEntity());
            //获取response的body
            //System.out.println(EntityUtils.toString(response.getEntity()));
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/dao/mapping/OrderCharteredCarMapper.xml
@@ -15,7 +15,6 @@
        <result column="peopleNumber" property="peopleNumber"/>
        <result column="contactPerson" property="contactPerson"/>
        <result column="contactPhone" property="contactPhone"/>
        <result column="thankYouFee" property="thankYouFee"/>
        <result column="state" property="state"/>
        <result column="remark" property="remark"/>
        <result column="isDelete" property="isDelete"/>
@@ -54,8 +53,7 @@
        carTime as carTime,
        (select name from t_server_carmodel where state = 1 and type = 3 and id = a.serverCarModelId) as serverCarModel,
        (6) as orderType,
        state as state,
        thankYouFee
        state as state
        from t_order_chartered_car as a where userId = #{uid} order by insertTime desc limit #{pageNum}, #{size}
    </select>
</mapper>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/model/OrderCharteredCar.java
@@ -68,9 +68,6 @@
     */
    @TableField("contactPhone")
    private String contactPhone;
    //感谢费
    @TableField("thankYouFee")
    private Double thankYouFee;
    /**
     * 状态(1=待处理,2=已处理,3=已取消)
     */
@@ -178,14 +175,6 @@
    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }
    public Double getThankYouFee() {
        return thankYouFee;
    }
    public void setThankYouFee(Double thankYouFee) {
        this.thankYouFee = thankYouFee;
    }
    public Integer getState() {
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/server/IOrderCharteredCarService.java
@@ -3,7 +3,6 @@
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.modular.CharteredCar.model.OrderCharteredCar;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo;
import java.util.Date;
import java.util.List;
@@ -14,6 +13,7 @@
    /**
     * 下单
     * @param traveltime
     * @param carTime
     * @param serverCarModelId
     * @param modelUse
@@ -54,33 +54,5 @@
    ResultUtil addCancle(Integer id, String reason, String remark, Integer uid) throws Exception;
    /**
     * 支付感谢费
     * @param uid
     * @param orderId
     * @param money
     * @param payType
     * @return
     * @throws Exception
     */
    ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception;
    /**
     * 感谢费支付回调处理
     * @param orderId
     * @param order_id
     * @throws Exception
     */
    void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception;
    /**
     * 获取余额
     * @param orderId
     * @param uid
     * @return
     * @throws Exception
     */
    PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception;
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/server/impl/OrderCharteredCarServiceImpl.java
@@ -1,33 +1,24 @@
package com.stylefeng.guns.modular.CharteredCar.server.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.CharteredCar.dao.OrderCharteredCarMapper;
import com.stylefeng.guns.modular.CharteredCar.model.OrderCharteredCar;
import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService;
import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.model.Company;
import com.stylefeng.guns.modular.system.model.OrderCancel;
import com.stylefeng.guns.modular.system.model.SensitiveWords;
import com.stylefeng.guns.modular.system.model.UserInfo;
import com.stylefeng.guns.modular.system.service.ICompanyCityService;
import com.stylefeng.guns.modular.system.service.IOrderCancelService;
import com.stylefeng.guns.modular.system.service.ISystemNoticeService;
import com.stylefeng.guns.modular.system.util.DateUtil;
import com.stylefeng.guns.modular.system.util.PayMoneyUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.UUIDUtil;
import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo;
import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -55,33 +46,6 @@
    @Autowired
    private ISystemNoticeService systemNoticeService;
    @Resource
    private OrderPrivateCarMapper orderPrivateCarMapper;
    @Resource
    private OrderTaxiMapper orderTaxiMapper;
    @Resource
    private OrderCrossCityMapper orderCrossCityMapper;
    @Autowired
    private IUserInfoService userInfoService;
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Autowired
    private IPaymentRecordService paymentRecordService;
    @Autowired
    private IIncomeService incomeService;
    @Autowired
    private ITransactionDetailsService transactionDetailsService;
    @Autowired
    private ISysIntegralService sysIntegralService;
    /**
@@ -99,26 +63,6 @@
    @Override
    public ResultUtil orderCharteredCar(Date travelTime, Integer carTime, Integer serverCarModelId, String modelUse, Integer peopleNumber,
                                        String contactPerson, String contactPhone, String placeLonLat, Integer uid) throws Exception {
        /**
         * 1.出租车、专车、跨城有待支付的订单不能叫车
         * 2.小件物流有未完成的订单可以下跨城、专车、出租车
         * 3.出租车、专车、跨城有预约单可以下即时单
         */
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, null, 1, 7, 12);
        if(orderPrivateCars.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, null, 1, 7, 12);
        if(list.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(uid, 7, 12);
        if(orderCrossCities1.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        OrderCharteredCar orderCharteredCar = new OrderCharteredCar();
        orderCharteredCar.setUserId(uid);
        Company query = companyCityService.query(placeLonLat.split(",")[0], placeLonLat.split(",")[1]);
@@ -170,6 +114,9 @@
        }
        OrderCharteredCar orderCharteredCar = this.selectById(id);
        if(null == uid){
            uid = orderCharteredCar.getUserId();
        }
        if(null == orderCharteredCar){
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
@@ -202,74 +149,5 @@
    public synchronized String getOrderNum() throws Exception{
        int size = this.selectCount(null);
        return "CHARTERED" + String.valueOf(1000000 + size + 1).substring(1);
    }
    @Override
    public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        OrderCharteredCar orderCharteredCar = this.selectById(orderId);
        ResultUtil resultUtil = ResultUtil.success();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_6_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(3, uid, 1, orderId, 6, 1, money, "", 1);//添加预支付数据
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_6_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee");
            paymentRecordService.saveData(1, uid, 1, orderId, 6, 2, money, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < money){
                return ResultUtil.error("余额不足,无法完成支付", "");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("companyId", orderCharteredCar.getCompanyId()));
            userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "包车-感谢费", money, 2, 1, 1, 6, orderId);
            userInfoService.updateById(userInfo);
            orderCharteredCar.setThankYouFee(money);
            this.updateById(orderCharteredCar);
            //添加已收入明细
            incomeService.saveData(1, 1, 6, orderCharteredCar.getId(), 6, money);
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成感谢费支付,谢谢使用!", uid, 1);
        }
        return resultUtil;
    }
    @Override
    public void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception {
        OrderCharteredCar orderCharteredCar = this.selectById(orderId);
        PaymentRecord query = paymentRecordService.query(3, orderCharteredCar.getUserId(), 1, orderId, 6, payType, 1);
        query.setState(2);
        query.setCode(order_id);
        paymentRecordService.updateById(query);
        UserInfo userInfo = userInfoService.selectById(orderCharteredCar.getUserId());
        SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("companyId", orderCharteredCar.getCompanyId()));
        userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分
        //添加交易明细
        transactionDetailsService.saveData(userInfo.getId(), "包车-感谢费", query.getAmount(), 2, 1, 1, 6, orderId);
        userInfoService.updateById(userInfo);
        orderCharteredCar.setThankYouFee(query.getAmount());
        this.updateById(orderCharteredCar);
        //添加已收入明细
        incomeService.saveData(1, 1, 6, orderCharteredCar.getId(), 6, query.getAmount());
        systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : "支付宝") + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1);
    }
    @Override
    public PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception {
        PreferentialDataVo preferentialDataVo = new PreferentialDataVo();
        UserInfo userInfo = userInfoService.selectById(uid);
        preferentialDataVo.setBalance(userInfo.getBalance());
        return preferentialDataVo;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AdvertisementController.java
@@ -30,9 +30,9 @@
    @ResponseBody
    @PostMapping("/queryByType")
    @ApiOperation(value = "1.0-获取广告列表", tags = {"用户端-首页"}, notes = "")
    @ApiOperation(value = "获取广告列表", tags = {"用户端-首页"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "数据类型(1=弹窗,2=首页底部,3=订单结束弹窗)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "数据类型(1:弹窗广告,2:底部广告)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "当前定位城市code(510100)", name = "code", required = true, dataType = "string")
    })
    public ResultUtil<List<AdvertisementWarpper>> queryAdvertisement(String code, Integer type){
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/AgreementController.java
@@ -32,7 +32,7 @@
    @PostMapping("/queryByType")
    @ApiOperation(value = "获取各种协议及H5页面", tags = {"用户端-协议"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置,9=司机注册协议,10=改派说明,11=跨城出行乘车须知,12:常见问题,13:计价规则,14:包车协议,15:小件物流协议,16:亲密账户协议,19:汽车出租协议,20:汽车售卖协议)", name = "type", required = true, dataType = "int")
            @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置,9=司机注册协议,10=改派说明,11=跨城出行乘车须知,12:常见问题,13:计价规则,14:包车协议)", name = "type", required = true, dataType = "int")
    })
    public ResultUtil<BaseWarpper> queryByType(Integer type){
        try {
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/BankCardController.java
New file
@@ -0,0 +1,127 @@
package com.stylefeng.guns.modular.api;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.service.IBankCardService;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.service.IUserService;
import com.stylefeng.guns.modular.system.util.LiuZhouBank.ProtocolSignUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.BankCardWarpper;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@RestController
@RequestMapping("")
public class BankCardController {
    @Autowired
    private IBankCardService bankCardService;
    @Autowired
    private IUserInfoService userInfoService;
    @ResponseBody
    @PostMapping("/api/bankCard/getSignSendSms")
    @ApiOperation(value = "发送签约银行验证短信", tags = {"司机端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "身份证号码", name = "IdNum", required = true, dataType = "String"),
            @ApiImplicitParam(value = "银行预留电话", name = "phone", required = true, dataType = "String"),
            @ApiImplicitParam(value = "开户姓名", name = "acctName", required = true, dataType = "String"),
            @ApiImplicitParam(value = "银行卡号", name = "acctNum", required = true, dataType = "String"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil getSignSendSms(String IdNum, String phone, String acctName, String acctNum){
        try {
            ResultUtil<String> stringResultUtil = ProtocolSignUtil.protocolSignSendSms(IdNum, phone, acctName, acctNum);
            if(200 != stringResultUtil.getCode()){
                return stringResultUtil;
            }
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/api/bankCard/addBankCard")
    @ApiOperation(value = "添加银行卡", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "卡号", name = "bankNum", required = true, dataType = "string"),
            @ApiImplicitParam(value = "银行名称", name = "bankName", required = true, dataType = "string"),
            @ApiImplicitParam(value = "银行账户", name = "name", required = true, dataType = "string"),
            @ApiImplicitParam(value = "银行预留手机号", name = "phone", required = true, dataType = "string"),
            @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "string"),
            @ApiImplicitParam(value = "身份证号", name = "IdNum", required = true, dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil addBankCard(String bankNum, String bankName, String name, String phone, String code, String IdNum, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(ToolUtil.isEmpty(uid)){
                return ResultUtil.tokenErr();
            }
            return bankCardService.addBankCard(uid, bankNum, bankName, name, phone, code, IdNum);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/api/bankCard/queryBankCardList")
    @ApiOperation(value = "获取银行卡列表", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<BankCardWarpper>> queryBankCardList(HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(ToolUtil.isEmpty(uid)){
                return ResultUtil.tokenErr();
            }
            return ResultUtil.success(bankCardService.queryBankCardList(uid));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/api/bankCard/delBankCard")
    @ApiOperation(value = "删除银行卡", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "卡id", name = "id", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil delBankCard(Integer id, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(ToolUtil.isEmpty(uid)){
                return ResultUtil.tokenErr();
            }
            return bankCardService.delBankCard(uid, id);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -42,14 +42,14 @@
    /**
     * 获取5公里范围内空闲司机数量
     * @param type 业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)
     * @param type 业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
     * @return
     */
    @ResponseBody
    @PostMapping("/base/driver/queryIdleDriver")
    @ApiOperation(value = "获取5公里范围内空闲司机数量", tags = {"用户端-首页"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "乘客当前定位经度", name = "lon", required = true, dataType = "double"),
            @ApiImplicitParam(value = "乘客当前定位纬度", name = "lat", required = true, dataType = "double")
    })
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/InvoiceController.java
@@ -84,7 +84,7 @@
    @ApiOperation(value = "获取开票历史", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"),
            @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"),
            @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "inr"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<InvoiceWarpper>> queryMyInvoice(Integer pageNum, Integer size, HttpServletRequest request){
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/MerchantController.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/NettyController.java
@@ -44,7 +44,7 @@
    @ApiOperation(value = "获取没有司机接单的提醒数据", tags = {"用户端-仿socket接口"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<EndPushWarpper> queryEndPush(Integer orderId, Integer orderType, HttpServletRequest request){
@@ -73,7 +73,7 @@
    @ApiOperation(value = "获取服务中的及时数据", tags = {"用户端-仿socket接口"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<OrderServerWarpper> queryOrderServer(Integer orderId, Integer orderType, HttpServletRequest request){
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -1,24 +1,23 @@
package com.stylefeng.guns.modular.api;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService;
import com.stylefeng.guns.modular.call.server.IOrderCallService;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.dao.SystemPriceMapper;
import com.stylefeng.guns.modular.system.model.AdditionalFee;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.OrderAdditionalFee;
import com.stylefeng.guns.modular.system.model.OfflineTravelPayment;
import com.stylefeng.guns.modular.system.model.OrderEvaluate;
import com.stylefeng.guns.modular.system.model.UserInfo;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.util.LiuZhouBank.PayUtil;
import com.stylefeng.guns.modular.system.util.LiuZhouBank.ResultNotification;
import com.stylefeng.guns.modular.system.warpper.*;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
@@ -34,7 +33,6 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
@@ -45,7 +43,6 @@
 * 订单控制器(综合)
 */
@Api
//@CrossOrigin
@RestController
@RequestMapping("")
public class OrderController {
@@ -84,6 +81,9 @@
    private IOrderCrossCityService orderCrossCityService;
    @Autowired
    private ICBCPayUtil icbcPayUtil;
    @Autowired
    private IOrderLogisticsService orderLogisticsService;
    @Autowired
@@ -99,22 +99,16 @@
    private IOrderCancelService orderCancelService;
    @Autowired
    private IOfflineTravelPaymentService offlineTravelPaymentService;
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Autowired
    private IPaymentRecordService paymentRecordService;
    @Autowired
    private ITaxiCardService taxiCardService;
    @Autowired
    private IOrderCallService orderCallService;
    @Autowired
    private IOrderAdditionalFeeService orderAdditionalFeeService;
    @Autowired
    private IAdditionalFeeService additionalFeeService;
    @Value("${callbackPath}")
    private String callbackPath;
    @Value("${pushMinistryOfTransport}")
    private boolean pushMinistryOfTransport;
@@ -196,7 +190,7 @@
    @PostMapping("/api/order/queryMyOrderList")
    @ApiOperation(value = "获取个人中心订单列表", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
        @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城出行,4=小件物流,5=包车)", name = "type", required = true, dataType = "int"),
        @ApiImplicitParam(value = "页码(首页1)", name = "pageNum", required = true, dataType = "int"),
        @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"),
        @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
@@ -219,16 +213,10 @@
                    list = orderCrossCityService.queryMyOrderList(uid, pageNum, size);
                    break;
                case 4:
                    list = orderLogisticsService.queryMyOrderList(uid, type, pageNum, size);
                    list = orderLogisticsService.queryMyOrderList(uid, pageNum, size);
                    break;
                case 5:
                    list = orderLogisticsService.queryMyOrderList(uid, type, pageNum, size);
                    break;
                case 6:
                    list = orderCharteredCarService.queryMyOrderList(uid, pageNum, size);
                    break;
                case 7:
//                    list = orderCallService.queryMyOrderList(uid, pageNum, size);
                    break;
            }
            return ResultUtil.success(OrderWarpper.getOrderWarpper(list));
@@ -261,20 +249,39 @@
            }
            Integer page = pageNum;
            pageNum = (pageNum - 1) * size;
            List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>()
                    .eq("type", 1).eq("userType", 1).eq("userId", uid).orderBy("insertTime desc limit " + pageNum + ", " + size));
            List<Map<String, Object>> list = new ArrayList<>();
            List<Map<String, Object>> maps = orderCancelService.queryCancel(uid, 2);
            List<Map<String, Object>> list = orderPrivateCarService.queryMyTravelRecord(uid);//专车
            List<Map<String, Object>> list1 = orderTaxiService.queryMyTravelRecord(uid);//出租车
            List<Map<String, Object>> list2 = orderCrossCityService.queryMyTravelRecord(uid);//跨城车
            List<Map<String, Object>> list3 = orderLogisticsService.queryMyTravelRecord(uid);//小件物流
            List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>().eq("state", 1)
                    .eq("type", 1).eq("userType", 1).eq("userId", uid));
            List<Map<String, Object>> list4 = new ArrayList<>();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
            for(TransactionDetails t : transactionDetails){
            for(TransactionDetails transactionDetails1 : transactionDetails){
                Map<String, Object> map = new HashMap<>();
                map.put("money", t.getState() == 1 ? t.getMoney() : -1 * t.getMoney());
                map.put("time", sdf.format(t.getInsertTime()));
                map.put("name", t.getRemark());
                map.put("insertTime", Double.valueOf(t.getInsertTime().getTime() / 1000).intValue());
                list.add(map);
                map.put("money", transactionDetails1.getMoney());
                map.put("time", sdf.format(transactionDetails1.getInsertTime()));
                map.put("name", transactionDetails1.getOrderType() == 3 ? "跨城订单取消退款" : transactionDetails1.getOrderType() == 4 ? "小件物流订单取消退款" : "");
                map.put("insertTime", Double.valueOf(transactionDetails1.getInsertTime().getTime() / 1000).intValue());
                list4.add(map);
            }
            list.addAll(maps);
            list.addAll(list1);
            list.addAll(list2);
            list.addAll(list3);
            list.addAll(list4);
            List<TravelRecordWarpper> orderWarpper = TravelRecordWarpper.getTravelRecordWarpper(list);
            //分页
            if(orderWarpper.size() >= page * size){
                orderWarpper = orderWarpper.subList(pageNum, pageNum + size);
            }else if(pageNum < orderWarpper.size() && orderWarpper.size() < page * size){
                orderWarpper = orderWarpper.subList(pageNum, orderWarpper.size());
            }else{
                orderWarpper = new ArrayList<>();
            }
            return ResultUtil.success(orderWarpper);
        }catch (Exception e){
            e.printStackTrace();
@@ -301,7 +308,7 @@
    @ApiOperation(value = "发票页获取订单列表", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单开票状态(1=未开票,2=其他)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = false, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城出行,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = false, dataType = "int"),
            @ApiImplicitParam(value = "开始日期", name = "startTime", required = false, dataType = "string"),
            @ApiImplicitParam(value = "结束日期", name = "endTime", required = false, dataType = "string"),
            @ApiImplicitParam(value = "开始金额", name = "startMoney", required = false, dataType = "double"),
@@ -405,11 +412,6 @@
    @Autowired
    private RedisUtil redisUtil;
    @Resource
    private SystemPriceMapper systemPriceMapper;
    /**
     * 获取服务中的详情数据
@@ -419,7 +421,7 @@
     */
    @ResponseBody
    @PostMapping("/api/order/queryOrderInfo")
    @ApiOperation(value = "获取服务中的详情数据", tags = {"用户端-服务中"}, notes = "",response = OrderInfoWarpper.class)
    @ApiOperation(value = "获取服务中的详情数据", tags = {"用户端-服务中"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"),
@@ -428,7 +430,6 @@
    public ResultUtil<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType){
        try {
            Map<String, Object> map = null;
            List<OrderAdditionalFeeWarpper> list = new ArrayList<>();
            switch (orderType){
                case 1://专车
                    map = orderPrivateCarService.queryOrderInfo(orderId);
@@ -443,117 +444,7 @@
            if(map.get("telX") != null){
                map.put("driverPhone", map.get("telX"));
            }
            List<OrderAdditionalFee> orderAdditionalFees = orderAdditionalFeeService.selectList(new EntityWrapper<OrderAdditionalFee>().eq("orderType", orderType).eq("orderId", orderId));
            orderAdditionalFees.forEach(orderAdditionalFee -> {
                AdditionalFee additionalFee = additionalFeeService.selectById(orderAdditionalFee.getAdditionalFeeId());
                OrderAdditionalFeeWarpper orderAdditionalFeeWarpper = new OrderAdditionalFeeWarpper();
                orderAdditionalFeeWarpper.setName(additionalFee.getName());
                orderAdditionalFeeWarpper.setAdditionalFee(orderAdditionalFee.getAmount());
                list.add(orderAdditionalFeeWarpper);
            });
            OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map, list);
            if(orderType==1){
                if(orderInfoWarpper.getPid()!=0){
                    orderId=orderInfoWarpper.getPid();
                }
                List<Map<String, Object>> orderList= orderPrivateCarService.queryOrderInfo2(orderId,4,null,null);
                if(!orderList.isEmpty()){
                    orderInfoWarpper.setMeetOrderList(JSON.parseArray(JSON.toJSONString(orderList), OrderCrossCityInfoWrapper.class));
                }else{
                    orderInfoWarpper.setMeetOrderList(new ArrayList<>());
                }
                orderList= orderPrivateCarService.queryOrderInfo2(orderId,6,null,null);
                if(orderInfoWarpper.getState()>1 && orderInfoWarpper.getDriverId()!=0){
                    String value = redisUtil.getValue("DRIVER" + String.valueOf(orderInfoWarpper.getDriverId()));
                    if(value==null || value.equals("")){
                        if(orderList.isEmpty()){
                            orderList= orderPrivateCarService.queryOrderInfo2(orderId,5,"0","0");
                        }else{
                            List<Map<String, Object>> orderList1 = orderPrivateCarService.queryOrderInfo2(orderId,5,"0","0");
                            if(!orderList1.isEmpty()){
                                orderList.addAll(orderList1);
                            }
                        }
                    }else{
                        if(orderList.isEmpty()){
                            orderList= orderPrivateCarService.queryOrderInfo2(orderId,5,value.split(",")[0],value.split(",")[1]);
                        }else{
                            List<Map<String, Object>> orderList1 = orderPrivateCarService.queryOrderInfo2(orderId,5,value.split(",")[0],value.split(",")[1]);
                            if(!orderList1.isEmpty()){
                                orderList.addAll(orderList1);
                            }
                        }
                    }
                }
                if(!orderList.isEmpty()){
                    orderInfoWarpper.setGiveOrderList(JSON.parseArray(JSON.toJSONString(orderList), OrderCrossCityInfoWrapper.class));
                }else{
                    orderInfoWarpper.setGiveOrderList(new ArrayList<>());
                }
                OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                if(orderPrivateCar.getState()>1){
                    Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId());
                    //开始根据不同的方式计算金额
                    JSONObject jsonObject = JSON.parseObject(query1.get("content").toString());//等待费
                    JSONObject contentPutOne = JSON.parseObject(query1.get("contentPutOne").toString());//一人拼成
                    JSONObject contentNotOne = JSON.parseObject(query1.get("contentNotOne").toString());//一人未拼成
                    JSONObject contentPutTwo = JSON.parseObject(query1.get("contentPutTwo").toString());//2人拼成
                    JSONObject contentNotTwo = JSON.parseObject(query1.get("contentNotTwo").toString());//2人未拼成
                    JSONObject contentPutThree = JSON.parseObject(query1.get("contentPutThree").toString());//3人拼成
                    JSONObject contentNotThree = JSON.parseObject(query1.get("contentNotThree").toString());//3人未拼成
                    JSONObject contentExclusive = JSON.parseObject(query1.get("contentExclusive").toString());//独享
                    JSONObject contentPrice = JSON.parseObject(query1.get("contentPrice").toString());//一口价
                    //一口价
                    orderInfoWarpper.setFareTypeNote1(query1.get("fareTypeNote1").toString());
                    orderInfoWarpper.setFareTypeNote2(query1.get("fareTypeNote2").toString());
                    orderInfoWarpper.setFareTypeNote3(query1.get("fareTypeNote3").toString());
                    orderInfoWarpper.setContentPutOne(contentPutOne);
                    orderInfoWarpper.setContentNotOne(contentNotOne);
                    orderInfoWarpper.setContentPutTwo(contentPutTwo);
                    orderInfoWarpper.setContentNotTwo(contentNotTwo);
                    orderInfoWarpper.setContentPutThree(contentPutThree);
                    orderInfoWarpper.setContentNotThree(contentNotThree);
                    orderInfoWarpper.setContentExclusive(contentExclusive);
                    orderInfoWarpper.setContentPrice(contentPrice);
                }else{
                    orderInfoWarpper.setContentPutOne(new JSONObject());
                    orderInfoWarpper.setContentNotOne(new JSONObject());
                    orderInfoWarpper.setContentPutTwo(new JSONObject());
                    orderInfoWarpper.setContentNotTwo(new JSONObject());
                    orderInfoWarpper.setContentPutThree(new JSONObject());
                    orderInfoWarpper.setContentNotThree(new JSONObject());
                    orderInfoWarpper.setContentExclusive(new JSONObject());
                    orderInfoWarpper.setContentPrice(new JSONObject());
                }
            }else{
                orderInfoWarpper.setContentPutOne(new JSONObject());
                orderInfoWarpper.setContentNotOne(new JSONObject());
                orderInfoWarpper.setContentPutTwo(new JSONObject());
                orderInfoWarpper.setContentNotTwo(new JSONObject());
                orderInfoWarpper.setContentPutThree(new JSONObject());
                orderInfoWarpper.setContentNotThree(new JSONObject());
                orderInfoWarpper.setContentExclusive(new JSONObject());
                orderInfoWarpper.setContentPrice(new JSONObject());
            }
            return ResultUtil.success(orderInfoWarpper);
            return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -570,7 +461,7 @@
     */
    @ResponseBody
    @PostMapping("/base/order/queryOrderInfo_")
    @ApiOperation(value = "获取服务中的详情数据", tags = {"分享专用"}, notes = "")
    @ApiOperation(value = "获取服务中的详情数据", tags = {"分享专用", "智慧屏"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"),
@@ -578,7 +469,6 @@
    public ResultUtil<OrderInfoWarpper> queryOrderInfo_(Integer orderId, Integer orderType){
        try {
            Map<String, Object> map = null;
            List<OrderAdditionalFeeWarpper> list = new ArrayList<>();
            switch (orderType){
                case 1://专车
                    map = orderPrivateCarService.queryOrderInfo(orderId);
@@ -593,15 +483,8 @@
            if(null != map.get("telX")){
                map.put("driverPhone", map.get("telX"));
            }
            List<OrderAdditionalFee> orderAdditionalFees = orderAdditionalFeeService.selectList(new EntityWrapper<OrderAdditionalFee>().eq("orderType", orderType).eq("orderId", orderId));
            orderAdditionalFees.forEach(orderAdditionalFee -> {
                AdditionalFee additionalFee = additionalFeeService.selectById(orderAdditionalFee.getAdditionalFeeId());
                OrderAdditionalFeeWarpper orderAdditionalFeeWarpper = new OrderAdditionalFeeWarpper();
                orderAdditionalFeeWarpper.setName(additionalFee.getName());
                orderAdditionalFeeWarpper.setAdditionalFee(orderAdditionalFee.getAmount());
                list.add(orderAdditionalFeeWarpper);
            });
            return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map, list));
            return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -628,7 +511,6 @@
    public ResultUtil<OrderInfoWarpper> queryCancelPage(Integer orderId, Integer orderType){
        try {
            Map<String, Object> map = null;
            List<OrderAdditionalFeeWarpper> list = new ArrayList<>();
            switch (orderType) {
                case 1://专车
                    map = orderPrivateCarService.queryOrderInfo(orderId);
@@ -646,18 +528,7 @@
                    map.put("cancelPayMoney", r.getData().getAmount());
                    break;
            }
            if(null != map.get("telX")){
                map.put("driverPhone", map.get("telX"));
            }
            List<OrderAdditionalFee> orderAdditionalFees = orderAdditionalFeeService.selectList(new EntityWrapper<OrderAdditionalFee>().eq("orderType", orderType).eq("orderId", orderId));
            orderAdditionalFees.forEach(orderAdditionalFee -> {
                AdditionalFee additionalFee = additionalFeeService.selectById(orderAdditionalFee.getAdditionalFeeId());
                OrderAdditionalFeeWarpper orderAdditionalFeeWarpper = new OrderAdditionalFeeWarpper();
                orderAdditionalFeeWarpper.setName(additionalFee.getName());
                orderAdditionalFeeWarpper.setAdditionalFee(orderAdditionalFee.getAmount());
                list.add(orderAdditionalFeeWarpper);
            });
            return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map, list));
            return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -974,6 +845,49 @@
    /**
     * 添加取消记录
     * @param id
     * @param reason
     * @param remark
     * @return
     */
    @ResponseBody
    @PostMapping("/base/taxi/addCancle1")
    @ApiOperation(value = "添加取消记录", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "智慧屏"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "取消原因", name = "reason", required = true, dataType = "string"),
            @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil addCancle1(Integer id, Integer orderType, String reason, String remark){
        try {
            switch (orderType){
                case 1:
                    return orderPrivateCarService.addCancle(id, reason, remark, null);
                case 2:
                    return orderTaxiService.addCancle(id, reason, remark, null);
                case 3:
                    return orderCrossCityService.addCancle(id, reason, remark, null);
                case 4:
                    return orderLogisticsService.addCancle(id, reason, remark, null);
                case 5:
                    return orderLogisticsService.addCancle(id, reason, remark, null);
                case 6:
                    return orderCharteredCarService.addCancle(id, reason, remark, null);
            }
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 取消操作支付
     * @param id
     * @param payType
@@ -1094,60 +1008,6 @@
    /**
     * 支付页面获取余额和优惠数据
     * @param orderId
     * @param request
     * @return
     */
    @ResponseBody
    @PostMapping("/api/taxi/queryBalance1")
    @ApiOperation(value = "1.0-支付页面获取余额和优惠数据", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城","用户端-小件物流"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<PreferentialDataVo> queryBalance1(Integer orderId, Integer orderType, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            PreferentialDataVo map = new PreferentialDataVo();
            switch (orderType){
                case 1:
                    map = orderPrivateCarService.queryBalance1(orderId, uid);
                    break;
                case 2:
                    map = orderTaxiService.queryBalance1(orderId, uid);
                    break;
                case 3:
                    map = orderCrossCityService.queryBalance1(orderId, uid);
                    break;
                case 4:
                    map = orderLogisticsService.queryBalance1(orderId, uid);
                    break;
                case 5:
                    map = orderLogisticsService.queryBalance1(orderId, uid);
                    break;
                case 6:
                    map = orderCharteredCarService.queryBalance1(orderId, uid);
                    break;
                case 7:
//                    map = orde.queryBalance1(orderId, uid);
                    break;
            }
            return ResultUtil.success(map);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 获取支付页面的优惠券列表
     * @param orderId
     * @param pageNum
@@ -1193,49 +1053,6 @@
    @ResponseBody
    @PostMapping("/api/taxi/queryCouponList")
    @ApiOperation(value = "1.0-获取支付页面的优惠券和打车卡列表", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城","用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"),
            @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<List<CouponsListVo>> queryCouponList(Integer orderId, Integer orderType, Integer pageNum, Integer size, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            List<CouponsListVo> list = new ArrayList<>();
            switch (orderType){
                case 1:
                    list = orderPrivateCarService.queryCouponList(orderId, uid, pageNum, size);
                    break;
                case 2:
                    list = orderTaxiService.queryCouponList(orderId, uid, pageNum, size);
                    break;
                case 3:
                    list = orderCrossCityService.queryCouponList(orderId, uid, pageNum, size);
                    break;
                case 4:
                    list = orderLogisticsService.queryCouponList(orderId, uid, pageNum, size);
                    break;
                case 5:
                    list = orderLogisticsService.queryCouponList(orderId, uid, pageNum, size);
                    break;
            }
            return ResultUtil.success(list);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 订单完成支付订单操作
     * @param payType
@@ -1278,46 +1095,6 @@
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/api/taxi/payTaxiOrder1")
    @ApiOperation(value = "1.0-订单完成支付订单操作", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=小件物流)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "优惠数据id", name = "objectId", required = false, dataType = "int"),
            @ApiImplicitParam(value = "数据类型(1=优惠券,2=打车卡)", name = "objectType", required = false, dataType = "int"),
            @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil payTaxiOrder1(Integer payType, Integer orderId, Integer orderType, Integer objectId, Integer objectType, Integer type, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            switch (orderType){
                case 1:
                    return orderPrivateCarService.payPrivateCarOrder1(payType, orderId, objectId, objectType, type);
                case 2:
                    return orderTaxiService.payTaxiOrder1(payType, orderId, objectId, objectType, type);
                case 3:
                    return orderCrossCityService.payCrossCityOrder1(payType, orderId, objectId, objectType, type);
                case 4:
                    return orderLogisticsService.payLogisticsOrder1(payType, orderId, objectId, objectType, type);
                case 5:
                    return orderLogisticsService.payLogisticsOrder1(payType, orderId, objectId, objectType, type);
            }
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
@@ -1454,31 +1231,29 @@
        try {
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            if(null != map){
                String order_id = map.get("transaction_id");
                String out_trade_no = map.get("out_trade_no");
                String result = map.get("result");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    PrintWriter out = response.getWriter();
                    out.write(result);
                    out.flush();
                    out.close();
                String transaction_id = map.get("transaction_id");
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                String substring = out_trade_no.substring(17);
                Integer type = Integer.valueOf(substring.substring(0, 1));
                Integer id = Integer.valueOf(substring.substring(1));
                    switch (type){
                        case 1:
                            orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 1);
                        orderPrivateCarService.payCancelOrderPrivateCar(id, transaction_id, 1);
                            break;
                        case 2:
                            orderTaxiService.payCancelOrderTaxi(id, order_id, 1);
                        orderTaxiService.payCancelOrderTaxi(id, transaction_id, 1);
                            break;
                        case 3:
                            orderCrossCityService.payCancelOrderCrossCity(id, order_id, 1);
                        orderCrossCityService.payCancelOrderCrossCity(id, transaction_id, 1);
                            break;
                    }
                }
                String result = map.get("result");
                PrintWriter out = response.getWriter();
                out.print(result);
                out.flush();
                out.close();
            }
        }catch (Exception e){
            e.printStackTrace();
@@ -1497,24 +1272,26 @@
            Map<String, String> map = payMoneyUtil.alipayCallback(request);
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String order_id = map.get("trade_no");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                String trade_no = map.get("trade_no");
                String substring = out_trade_no.substring(17);
                Integer type = Integer.valueOf(substring.substring(0, 1));
                Integer id = Integer.valueOf(substring.substring(1));
                    switch (type){
                        case 1:
                            orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 2);
                        orderPrivateCarService.payCancelOrderPrivateCar(id, trade_no, 2);
                            break;
                        case 2:
                            orderTaxiService.payCancelOrderTaxi(id, order_id, 2);
                        orderTaxiService.payCancelOrderTaxi(id, trade_no, 2);
                            break;
                        case 3:
                            orderCrossCityService.payCancelOrderCrossCity(id, order_id, 2);
                        orderCrossCityService.payCancelOrderCrossCity(id, trade_no, 2);
                            break;
                    }
                }
                PrintWriter out = response.getWriter();
                out.print("success");
                out.flush();
                out.close();
            }
        }catch (Exception e){
            e.printStackTrace();
@@ -1532,36 +1309,35 @@
        try {
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            if(null != map){
                String order_id = map.get("transaction_id");
                String out_trade_no = map.get("out_trade_no");
                String result = map.get("result");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    PrintWriter out = response.getWriter();
                    out.write(result);
                    out.flush();
                    out.close();
                String transaction_id = map.get("transaction_id");
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                String substring = out_trade_no.substring(17);
                Integer type = Integer.valueOf(substring.substring(0, 1));
                Integer id = Integer.valueOf(substring.substring(1));
                    switch (type){
                        case 1:
                            orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 1);
                        orderPrivateCarService.payOrderPrivateCarCallback(id, transaction_id, 1);
                            break;
                        case 2:
                            orderTaxiService.payOrderTaxiCallback(id, order_id, 1);
                        orderTaxiService.payOrderTaxiCallback(id, transaction_id, 1);
                            break;
                        case 3:
                            orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1);
                        orderCrossCityService.payOrderCrossCityCallback(id, transaction_id, 1);
                            break;
                        case 4:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1);
                        orderLogisticsService.payOrderLogisticsCallback(id, transaction_id, 1);
                            break;
                        case 5:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 1);
                        orderLogisticsService.payOrderLogisticsCallback(id, transaction_id, 1);
                            break;
                    }
                }
                String result = map.get("result");
                PrintWriter out = response.getWriter();
                out.print(result);
                out.flush();
                out.close();
            }
        }catch (Exception e){
            e.printStackTrace();
@@ -1580,30 +1356,32 @@
            Map<String, String> map = payMoneyUtil.alipayCallback(request);
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String order_id = map.get("trade_no");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                String trade_no = map.get("trade_no");
                String substring = out_trade_no.substring(17);
                Integer type = Integer.valueOf(substring.substring(0, 1));
                Integer id = Integer.valueOf(substring.substring(1));
                    switch (type){
                        case 1:
                            orderPrivateCarService.payOrderPrivateCarCallback(id, order_id, 2);
                        orderPrivateCarService.payOrderPrivateCarCallback(id, trade_no, 2);
                            break;
                        case 2:
                            orderTaxiService.payOrderTaxiCallback(id, order_id, 2);
                        orderTaxiService.payOrderTaxiCallback(id, trade_no, 2);
                            break;
                        case 3:
                            orderCrossCityService.payOrderCrossCityCallback(id, order_id, 2);
                        orderCrossCityService.payOrderCrossCityCallback(id, trade_no, 2);
                            break;
                        case 4:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 2);
                        orderLogisticsService.payOrderLogisticsCallback(id, trade_no, 2);
                            break;
                        case 5:
                            orderLogisticsService.payOrderLogisticsCallback(id, order_id, 2);
                        orderLogisticsService.payOrderLogisticsCallback(id, trade_no, 2);
                            break;
                    }
                }
                PrintWriter out = response.getWriter();
                out.print("success");
                out.flush();
                out.close();
            }
        }catch (Exception e){
            e.printStackTrace();
@@ -1623,20 +1401,20 @@
        try {
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            if(null != map){
                String order_id = map.get("transaction_id");
                String out_trade_no = map.get("out_trade_no");
                String transaction_id = map.get("transaction_id");
                String substring = out_trade_no.substring(17);
                Integer type = Integer.valueOf(substring.substring(0, 1));
                Integer id = Integer.valueOf(substring.substring(1));
                orderLogisticsService.payOrderLogisticsSpreadCallback(id, transaction_id, 1);
                String result = map.get("result");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    PrintWriter out = response.getWriter();
                    out.write(result);
                out.print(result);
                    out.flush();
                    out.close();
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                    orderLogisticsService.payOrderLogisticsSpreadCallback(id, order_id, 1);
                }
            }
        }catch (Exception e){
            e.printStackTrace();
@@ -1655,111 +1433,17 @@
            Map<String, String> map = payMoneyUtil.alipayCallback(request);
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String order_id = map.get("trade_no");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    String[] split = out_trade_no.split("_");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                    orderLogisticsService.payOrderLogisticsSpreadCallback(id, order_id, 2);
                }
                String trade_no = map.get("trade_no");
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
                String substring = out_trade_no.substring(17);
                Integer type = Integer.valueOf(substring.substring(0, 1));
                Integer id = Integer.valueOf(substring.substring(1));
                orderLogisticsService.payOrderLogisticsSpreadCallback(id, trade_no, 2);
    /**
     * 取消订单微信退款成功回调
     * @param request
     * @param response
     */
    @ResponseBody
    @PostMapping("/base/cancleOrderWXPay")
    public void cancleOrderWXPay(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = payMoneyUtil.wxRefundCallback(request);
            if(null != map){
                String order_id = map.get("refund_id");
                String out_refund_no = map.get("out_refund_no");
                String result = map.get("result");
                if(ToolUtil.isNotEmpty(out_refund_no) && ToolUtil.isNotEmpty(order_id)){
                    PrintWriter out = response.getWriter();
                    out.write(result);
                out.print("success");
                    out.flush();
                    out.close();
                    String[] split = out_refund_no.split(",");
                    Integer id = Integer.valueOf(split[0]);
                    Integer type = Integer.valueOf(split[1]);
                    switch (type){
                        case 1:
                            break;
                        case 2:
                            break;
                        case 3:
                            OrderCrossCity orderCrossCity = orderCrossCityService.selectById(id);
                            PaymentRecord query = paymentRecordService.query(1, orderCrossCity.getUserId(), 1, id, 3, orderCrossCity.getPayType(), 2);
                            //添加交易明细
                            transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城出行取消退款", query.getAmount(), 1, 1, 1, 3, id);
                            break;
                        case 4:
                            break;
                        case 5:
                            break;
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    /**
     * 购买出行卡微信支付回调
     * @param request
     * @param response
     */
    @ResponseBody
    @PostMapping("/base/wxPayTaxiCardPaymentSpread")
    public void wxPayTaxiCardPaymentSpread(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            if(null != map){
                String order_id = map.get("transaction_id");
                String out_trade_no = map.get("out_trade_no");
                String result = map.get("result");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    PrintWriter out = response.getWriter();
                    out.write(result);
                    out.flush();
                    out.close();
                    taxiCardService.payTaxiCardPaymentSpread(Integer.valueOf(out_trade_no), order_id);
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    /**
     * 购买出行卡支付宝支付回调
     * @param request
     * @param response
     */
    @ResponseBody
    @PostMapping("/base/aliPayTaxiCardPaymentSpread")
    public void aliPayTaxiCardPaymentSpread(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = payMoneyUtil.alipayCallback(request);
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String order_id = map.get("trade_no");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    taxiCardService.payTaxiCardPaymentSpread(Integer.valueOf(out_trade_no), order_id);
                }
            }
        }catch (Exception e){
            e.printStackTrace();
@@ -1768,83 +1452,131 @@
    @ResponseBody
    @PostMapping("/api/taxi/payThankYouFee")
    @ApiOperation(value = "1.0-支付感谢费", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流", "用户端-包车", "用户端-助老模式"}, notes = "")
    @PostMapping("/base/order/queryDriverInfo")
    @ApiOperation(value = "获取司机信息", tags = {"线下收款"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流,5=跨城小件物流,6=包车,7=助老模式)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "支付金额", name = "money", required = true, dataType = "double"),
            @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
            @ApiImplicitParam(value = "司机id", name = "driverId", required = true, dataType = "int"),
    })
    public ResultUtil payThankYouFee(Integer orderId, Integer orderType, Double money, Integer payType, Integer type, HttpServletRequest request){
    public ResultUtil<Map<String, Object>> queryDriverInfo(Integer driverId){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            Driver driver = driverService.selectById(driverId);
            String phone = AESUtil.decrypt(driver.getPhone());
            Map<String, Object> map = new HashMap<>();
            map.put("name", driver.getName());
            map.put("phone", phone.substring(0, 3) + "****" + phone.substring(7));
            map.put("headImg", driver.getHeadImgUrl());
            return ResultUtil.success(map);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
            }
            switch (orderType){
                case 1:
                    return orderPrivateCarService.payThankYouFee(uid, orderId, money, payType, type);
                case 2:
                    return orderTaxiService.payThankYouFee(uid, orderId, money, payType, type);
                case 3:
                    return orderCrossCityService.payThankYouFee(uid, orderId, money, payType, type);
                case 4:
                    return orderLogisticsService.payThankYouFee(uid, orderId, money, payType, type);
                case 5:
                    return orderLogisticsService.payThankYouFee(uid, orderId, money, payType, type);
                case 6:
                    return orderCharteredCarService.payThankYouFee(uid, orderId, money, payType, type);
                case 7:
                    return orderCallService.payThankYouFee(uid, orderId, money, payType, type);
    }
    @ResponseBody
    @PostMapping("/base/order/driverQrCodePaymentCollection")
    @ApiOperation(value = "扫码司机收款码调起支付", tags = {"线下收款"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "司机id", name = "driverId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "支付金额", name = "money", required = true, dataType = "double"),
            @ApiImplicitParam(value = "支付方式(1=微信,2=支付宝)", name = "payType", required = true, dataType = "int"),
    })
    public ResultUtil<Map<String, String>> driverQrCodePaymentCollection(Integer driverId, Double money, Integer payType){
        try {
            return orderService.driverQrCodePaymentCollection(driverId, money, payType);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/base/order/queryDriverQrCodePaymentStatus")
    @ApiOperation(value = "获取线下收款支付状态", tags = {"线下收款"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "支付id", name = "id", required = true, dataType = "string"),
    })
    public ResultUtil<Integer> queryDriverQrCodePaymentStatus(String id){
        try {
            OfflineTravelPayment offlineTravelPayment = offlineTravelPaymentService.selectOne(new EntityWrapper<OfflineTravelPayment>().eq("orderId", id));
            if(null != offlineTravelPayment){
                return ResultUtil.success(offlineTravelPayment.getStatus());
            }
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
        return ResultUtil.success();
        return ResultUtil.success(0);
    }
    @ResponseBody
    @PostMapping("/base/order/evaluateDriver")
    @ApiOperation(value = "支付完成后的评价操作", tags = {"线下收款"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "司机id", name = "driverId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "评分", name = "score", required = true, dataType = "double"),
            @ApiImplicitParam(value = "评价内容", name = "content", required = true, dataType = "string"),
    })
    public ResultUtil evaluateDriver(Integer driverId, Integer score, String content){
        try {
            OrderEvaluate orderEvaluate = new OrderEvaluate();
            orderEvaluate.setDriverId(driverId);
            orderEvaluate.setFraction(score);
            orderEvaluate.setContent(content);
            orderEvaluate.setInsertTime(new Date());
            orderEvaluateService.insert(orderEvaluate);
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 感谢费支付回调
     * 扫码司机收款码支付回调
     * @param request
     * @param response
     */
    @ResponseBody
    @PostMapping("/base/wxPayThankYouFee")
    public void wxPayThankYouFee(HttpServletRequest request, HttpServletResponse response){
    @PostMapping("/base/offlineTravelPaymentCallback")
    public void offlineTravelPaymentCallback(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            if(null != map){
                String order_id = map.get("transaction_id");
                String out_trade_no = map.get("out_trade_no");
                String result = map.get("result");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
            System.err.println("线下收款开始回调-------------------");
            ResultNotification resultNotification = PayUtil.payResultNotification(request);
            System.err.println("支付回调:" + JSON.toJSONString(resultNotification));
            if(null != resultNotification){
                if("000000".equals(resultNotification.getReturnCode())){
                    if("00".equals(resultNotification.getResultCode())){
                        String chnlSeq = resultNotification.getChnlSeq();
                        String txnSeq = resultNotification.getTxnSeq();
                        OfflineTravelPayment offlineTravelPayment = offlineTravelPaymentService.selectOne(new EntityWrapper<OfflineTravelPayment>().eq("orderId", chnlSeq));
                        if(null != offlineTravelPayment && offlineTravelPayment.getStatus() == 1){
                            offlineTravelPayment.setStatus(2);
                            offlineTravelPayment.setPayTime(new Date());
                            offlineTravelPayment.setPayNumber(txnSeq);
                            offlineTravelPaymentService.updateById(offlineTravelPayment);
                    PrintWriter out = response.getWriter();
                    out.write(result);
                            out.print(resultNotification.getResponseStr());
                    out.flush();
                    out.close();
                    String[] s = out_trade_no.split("_");
                    switch (Integer.valueOf(s[1])){
                        case 1:
                            orderPrivateCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1);
                        case 2:
                            orderTaxiService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1);
                        case 3:
                            orderCrossCityService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1);
                        case 4:
                            orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1);
                        case 5:
                            orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1);
                        case 6:
                            orderCharteredCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1);
                        case 7:
                            orderCallService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1);
                    }
                    }else{
                        System.err.println(resultNotification.getResultMsg());
                    }
                }else{
                    System.err.println(resultNotification.getReturnMessage());
                }
            }
        }catch (Exception e){
@@ -1854,37 +1586,46 @@
    /**
     * 感谢费支付宝支付回调
     * 微信支付退款回调
     * @param request
     * @param response
     */
    @ResponseBody
    @PostMapping("/base/aliPayThankYouFee")
    public void aliPayThankYouFee(HttpServletRequest request, HttpServletResponse response){
    @PostMapping("/base/wxRefundCallback")
    public void wxRefundCallback(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = payMoneyUtil.alipayCallback(request);
            Map<String, String> map = payMoneyUtil.wxRefundCallback(request);
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String order_id = map.get("trade_no");
                if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){
                    String[] s = out_trade_no.split("_");
                    switch (Integer.valueOf(s[1])){
                        case 1:
                            orderPrivateCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2);
                        case 2:
                            orderTaxiService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2);
                        case 3:
                            orderCrossCityService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2);
                        case 4:
                            orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2);
                        case 5:
                            orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2);
                        case 6:
                            orderCharteredCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2);
                        case 7:
                            orderCallService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2);
                String out_refund_no = map.get("out_refund_no");
                String refund_id = map.get("refund_id");
                String result = map.get("result");
                String substring = out_refund_no.substring(17);
                Integer type = Integer.valueOf(substring.substring(0, 1));
                Integer id = Integer.valueOf(substring.substring(1));
                PaymentRecord paymentRecord = paymentRecordService.selectById(id);
                if(paymentRecord.getRefundState() == 2){
                    return;
                    }
                if(type == 3){
                    paymentRecord.setRefundCode(refund_id);
                    paymentRecord.setRefundState(2);
                    paymentRecordService.updateById(paymentRecord);
                    OrderCrossCity orderCrossCity = orderCrossCityService.selectById(paymentRecord.getOrderId());
                    transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城订单取消退款", orderCrossCity.getPayMoney(), 1, 1, 1, 3, id);
                }
                if(type == 4 || type == 5){
                    paymentRecord.setRefundCode(refund_id);
                    paymentRecord.setRefundState(2);
                    paymentRecordService.updateById(paymentRecord);
                    OrderLogistics orderLogistics = orderLogisticsService.selectById(paymentRecord.getOrderId());
                    transactionDetailsService.saveData(orderLogistics.getUserId(), "小件物流取消退款", orderLogistics.getPayMoney(), 1, 1, 1, orderLogistics.getType(), orderLogistics.getId());
                }
                PrintWriter out = response.getWriter();
                out.print(result);
                out.flush();
                out.close();
            }
        }catch (Exception e){
            e.printStackTrace();
@@ -1892,4 +1633,170 @@
    }
    /**
     * 管理后台取消订单回退支付金额
     * @param orderId
     * @param orderType
     * @return
     */
    @ResponseBody
    @PostMapping("/base/order/cancelOrderRollbackAmount")
    public String cancelOrderRollbackAmount(Integer orderId, Integer orderType){
        try {
            switch (orderType){
                case 3:
                    OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId);
                    if(orderCrossCity.getPayType() == 3){//余额支付
                        UserInfo userInfo = userInfoService.selectById(orderCrossCity.getUserId());
                        userInfo.setBalance(userInfo.getBalance() + orderCrossCity.getPayMoney());
                        userInfoService.updateById(userInfo);
                        //添加交易明细
                        transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城订单取消退款", orderCrossCity.getPayMoney(), 1, 1, 1, 3, orderId);
                    }else{
                        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
                        List<PaymentRecord> paymentRecords = paymentRecordService.selectList(new EntityWrapper<PaymentRecord>().eq("category", 1).eq("orderId", orderId)
                                .eq("orderType", orderType).eq("state", 2).isNull("refundState"));
                        for (PaymentRecord paymentRecord : paymentRecords) {
                            String out_trade_no = sdf.format(new Date()) + orderType + paymentRecord.getId();
                            if(paymentRecord.getPayType() == 1){//微信
                                payMoneyUtil.wxRefund(paymentRecord.getCode(), out_trade_no, paymentRecord.getAmount().toString(), paymentRecord.getAmount().toString(), callbackPath + "/base/wxRefundCallback");
                            }
                            if(paymentRecord.getPayType() == 2){//支付宝
                                Map<String, String> map = payMoneyUtil.aliRefund(paymentRecord.getCode(), paymentRecord.getAmount().toString());
                                String code = map.get("code");
                                if(!"10000".equals(code)){
                                    return JSON.toJSONString(ResultUtil.error(map.get("msg")));
                                }
                                paymentRecord.setRefundState(2);
                                paymentRecord.setRefundCode(map.get("trade_no"));
                                paymentRecordService.updateById(paymentRecord);
                                //添加交易明细
                                transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城订单取消退款", orderCrossCity.getPayMoney(), 1, 1, 1, 3, orderId);
                            }
                        }
                    }
                    break;
                case 4:
                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
                    if(orderLogistics.getPayType() == 3){//余额支付
                        UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId());
                        userInfo.setBalance(userInfo.getBalance() + orderLogistics.getPayMoney());
                        userInfoService.updateById(userInfo);
                        //添加交易明细
                        transactionDetailsService.saveData(orderLogistics.getUserId(), "小件物流取消退款", orderLogistics.getPayMoney(), 1, 1, 1, orderLogistics.getType(), orderLogistics.getId());
                    }else{
                        //调用回退接口
                        List<PaymentRecord> paymentRecords = paymentRecordService.selectList(new EntityWrapper<PaymentRecord>().eq("category", 1).eq("orderId", orderId)
                                .eq("orderType", orderType).eq("state", 2).isNull("refundState"));
                        for (PaymentRecord paymentRecord : paymentRecords) {
                            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
                            String out_trade_no = sdf.format(new Date()) + orderLogistics.getType() + paymentRecord.getId();
                            if(paymentRecord.getPayType() == 1){//微信
                                Map<String, String> map = payMoneyUtil.wxRefund(paymentRecord.getCode(), out_trade_no, paymentRecord.getAmount().toString(), paymentRecord.getAmount().toString(), callbackPath + "/base/wxRefundCallback");
                                String return_code = map.get("return_code");
                                if(!"SUCCESS".equals(return_code)){
                                    return JSON.toJSONString(ResultUtil.error(map.get("return_msg")));
                                }
                            }
                            if(paymentRecord.getPayType() == 2){//支付宝
                                Map<String, String> map = payMoneyUtil.aliRefund(paymentRecord.getCode(), paymentRecord.getAmount().toString());
                                String code = map.get("code");
                                if(!"10000".equals(code)){
                                    return JSON.toJSONString(ResultUtil.error(map.get("msg")));
                                }
                                paymentRecord.setRefundState(2);
                                paymentRecord.setRefundCode(map.get("trade_no"));
                                paymentRecordService.updateById(paymentRecord);
                                //添加交易明细
                                transactionDetailsService.saveData(orderLogistics.getUserId(), "小件物流取消退款", orderLogistics.getPayMoney(), 1, 1, 1, orderLogistics.getType(), orderLogistics.getId());
                            }
                        }
                    }
                    break;
                case 5:
                    OrderLogistics orderLogistics1 = orderLogisticsService.selectById(orderId);
                    if(orderLogistics1.getPayType() == 3){//余额支付
                        UserInfo userInfo = userInfoService.selectById(orderLogistics1.getUserId());
                        userInfo.setBalance(userInfo.getBalance() + orderLogistics1.getPayMoney());
                        userInfoService.updateById(userInfo);
                        //添加交易明细
                        transactionDetailsService.saveData(orderLogistics1.getUserId(), "小件物流取消退款", orderLogistics1.getPayMoney(), 1, 1, 1, orderLogistics1.getType(), orderLogistics1.getId());
                    }else{
                        //调用回退接口
                        List<PaymentRecord> paymentRecords = paymentRecordService.selectList(new EntityWrapper<PaymentRecord>().eq("category", 1).eq("orderId", orderId)
                                .eq("orderType", orderType).eq("state", 2).isNull("refundState"));
                        for (PaymentRecord paymentRecord : paymentRecords) {
                            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
                            String out_trade_no = sdf.format(new Date()) + orderLogistics1.getType() + paymentRecord.getId();
                            if(paymentRecord.getPayType() == 1){//微信
                                Map<String, String> map = payMoneyUtil.wxRefund(paymentRecord.getCode(), out_trade_no, paymentRecord.getAmount().toString(), paymentRecord.getAmount().toString(), callbackPath + "/base/wxRefundCallback");
                                String return_code = map.get("return_code");
                                if(!"SUCCESS".equals(return_code)){
                                    return JSON.toJSONString(ResultUtil.error(map.get("return_msg")));
                                }
                            }
                            if(paymentRecord.getPayType() == 2){//支付宝
                                Map<String, String> map = payMoneyUtil.aliRefund(paymentRecord.getCode(), paymentRecord.getAmount().toString());
                                String code = map.get("code");
                                if(!"10000".equals(code)){
                                    return JSON.toJSONString(ResultUtil.error(map.get("msg")));
                                }
                                paymentRecord.setRefundState(2);
                                paymentRecord.setRefundCode(map.get("trade_no"));
                                paymentRecordService.updateById(paymentRecord);
                                //添加交易明细
                                transactionDetailsService.saveData(orderLogistics1.getUserId(), "小件物流取消退款", orderLogistics1.getPayMoney(), 1, 1, 1, orderLogistics1.getType(), orderLogistics1.getId());
                            }
                        }
                    }
                    break;
            }
        }catch (Exception e){
            e.printStackTrace();
            return JSON.toJSONString(ResultUtil.runErr());
        }
        return JSON.toJSONString(ResultUtil.success());
    }
    @ResponseBody
    @PostMapping("/base/orderPrivateCar/directCallCar")
    @ApiOperation(value = "智慧屏一键叫车", tags = {"智慧屏"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "下单手机号", name = "phone", required = true, dataType = "string"),
            @ApiImplicitParam(value = "下单地点经度", name = "placementLon", required = true, dataType = "string"),
            @ApiImplicitParam(value = "下单地点纬度", name = "placementLat", required = true, dataType = "string"),
            @ApiImplicitParam(value = "起点经度", name = "startLon", required = true, dataType = "string"),
            @ApiImplicitParam(value = "起点纬度", name = "startLat", required = true, dataType = "string"),
            @ApiImplicitParam(value = "起点地址", name = "startAddress", required = true, dataType = "string"),
            @ApiImplicitParam(value = "设备号", name = "deviceCode", required = true, dataType = "string"),
    })
    public ResultUtil<BaseWarpper> directCallCar(String phone, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String deviceCode){
        try {
            return orderPrivateCarService.directCallCar(phone, placementLon, placementLat, startLon, startLat, startAddress, deviceCode);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/base/orderPrivateCar/querySmartScreenOrder")
    @ApiOperation(value = "获取智慧屏订单列表", tags = {"智慧屏"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "设备号", name = "deviceCode", required = true, dataType = "string"),
            @ApiImplicitParam(value = "经纬度(103.2222,30.23554)", name = "lonLat", required = true, dataType = "string"),
    })
    public ResultUtil<List<SmartScreenOrderVo>> querySmartScreenOrder(String deviceCode, String lonLat){
        try {
            List<SmartScreenOrderVo> orderVos = orderPrivateCarService.querySmartScreenOrder(deviceCode, lonLat);
            return ResultUtil.success(orderVos);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/ServerCarModelController.java
@@ -1,7 +1,6 @@
package com.stylefeng.guns.modular.api;
import com.alibaba.fastjson.JSON;
import com.stylefeng.guns.modular.system.service.IServerCarModelService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.ServerCarModelWarpper;
@@ -41,11 +40,10 @@
    @ApiImplicitParams({
            @ApiImplicitParam(value = "起点经纬度(103.22121,,30.26123)", name = "startLonLat", required = true, dataType = "string"),
            @ApiImplicitParam(value = "终点经纬度(103.22121,,30.26123)", name = "endLonLat", required = true, dataType = "string"),
            @ApiImplicitParam(value = "业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "type", required = true, dataType = "int")
            @ApiImplicitParam(value = "业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "type", required = true, dataType = "int")
    })
    public ResultUtil<List<ServerCarModelWarpper>> queryServerCarModel(String startLonLat, String endLonLat, Integer type) {
        try {
            System.out.println("【选择起点终点后获取车型和预估价格】,startLonLat:" + startLonLat + ",endLonLat:" + endLonLat + ",type:" + type);
            return serverCarModelService.queryServerCarModel(startLonLat, endLonLat, type);
        } catch (Exception e) {
            e.printStackTrace();
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/TaxiCardController.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserCallbackController.java
@@ -45,15 +45,20 @@
    public void wxCancelUserBalance(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = payMoneyUtil.weixinpayCallback(request);
            String id = map.get("out_trade_no");
            String order_id = map.get("transaction_id");
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String transaction_id = map.get("transaction_id");
            String uid = map.get("attach");
                String id = out_trade_no.substring(17);
                userInfoService.payCancelUserBalance(Integer.valueOf(uid), transaction_id, Integer.valueOf(id), 1);
            String result = map.get("result");
            userInfoService.payCancelUserBalance(Integer.valueOf(uid), order_id, Integer.valueOf(id), 1);
            PrintWriter out = response.getWriter();
            out.write(result);
                out.print(result);
            out.flush();
            out.close();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
@@ -69,10 +74,18 @@
    public void aliCancelUserBalance(HttpServletRequest request, HttpServletResponse response){
        try {
            Map<String, String> map = payMoneyUtil.alipayCallback(request);
            String id = map.get("out_trade_no");
            String order_id = map.get("trade_no");
            String uid = map.get("passback_params");
            userInfoService.payCancelUserBalance(Integer.valueOf(uid), order_id, Integer.valueOf(id), 2);
            if(null != map){
                String out_trade_no = map.get("out_trade_no");
                String trade_no = map.get("trade_no");
                String uid = map.get("subject");
                String id = out_trade_no.substring(17);
                userInfoService.payCancelUserBalance(Integer.valueOf(uid), trade_no, Integer.valueOf(id), 2);
                PrintWriter out = response.getWriter();
                out.print("success");
                out.flush();
                out.close();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
@@ -1,15 +1,16 @@
package com.stylefeng.guns.modular.api;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.common.constant.JwtConstants;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.UserInfo;
import com.stylefeng.guns.modular.system.service.IDriverService;
import com.stylefeng.guns.modular.system.service.ISmsrecordService;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.service.IVerifiedService;
import com.stylefeng.guns.modular.system.util.RedisUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.WeChatUtil;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.warpper.LoginWarpper;
import com.stylefeng.guns.modular.system.warpper.UserInfoWarpper;
import com.stylefeng.guns.modular.system.warpper.VerifiedWarpper;
@@ -21,9 +22,12 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.util.*;
/**
 * 用户控制器
@@ -48,6 +52,9 @@
    @Autowired
    private WeChatUtil weChatUtil;
    @Autowired
    private IDriverService driverService;
@@ -67,6 +74,8 @@
    public ResultUtil queryCaptcha(String phone, Integer type){
        if(ToolUtil.isNotEmpty(phone)){
            try {
                phone = AESUtil.decrypt(phone);//对电话号码进行解密
                return userInfoService.queryCaptcha(phone, type);
            }catch (Exception e){
                e.printStackTrace();
@@ -75,6 +84,41 @@
        }else{
            return ResultUtil.paranErr();
        }
    }
    /**
     * 获取图形验证码
     */
    @ResponseBody
    @GetMapping("/base/getVerifyCodeUtils")
    @ApiOperation(value = "获取图形验证码", tags = {"用户端-登录"}, notes = "")
    @ApiImplicitParams({
    })
    public Object getVerifyCodeUtils(){
        try {
            String s = VerifyCodeUtils.generateVerifyCode(4);
            File file = new File("/usr/local/server/VerifyCode/" + s + ".jpg");
            if(!file.exists()){
                file.createNewFile();
                FileOutputStream out = new FileOutputStream(file);
                VerifyCodeUtils.outputImage(100, 40, out, s);
                file = new File("/usr/local/server/VerifyCode/" + s + ".jpg");
                FileInputStream inputStream = new FileInputStream(file);
                byte[] data = new byte[inputStream.available()];
                inputStream.read(data);
                inputStream.close();
                String string = Base64.getEncoder().encodeToString(data);
                Map<String, Object> map = new HashMap<>();
                map.put("code", MD5AndKL.MD5(s.toLowerCase()));
                map.put("img", string);
                file.delete();
                return ResultUtil.success(map);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return ResultUtil.success();
    }
@@ -166,11 +210,17 @@
    @ApiImplicitParams({
            @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"),
            @ApiImplicitParam(value = "登录端口-小程序传Applets", name = "loginType", required = false, dataType = "String"),
            @ApiImplicitParam(value = "登录密码", name = "password", required = true, dataType = "String")
            @ApiImplicitParam(value = "登录密码", name = "password", required = true, dataType = "String"),
            @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"),
    })
    public ResultUtil<LoginWarpper> userLogin(String phone, String password,String loginType){
    public ResultUtil<LoginWarpper> userLogin(String phone, String password,String loginType, String code){
        if(ToolUtil.isNotEmpty(phone) && ToolUtil.isNotEmpty(password)){
            try {
                phone = AESUtil.decrypt(phone);//解密电话号码
                boolean b = userInfoService.checkCaptcha(phone, code);
                if(!b){
                    return ResultUtil.error("验证码无效");
                }
                return userInfoService.userLogin(phone, password,loginType);
            }catch (Exception e){
                e.printStackTrace();
@@ -457,7 +507,9 @@
                return ResultUtil.tokenErr();
            }
            UserInfo userInfo = userInfoService.selectById(uid);
            smsrecordService.saveData(4, userInfo.getPhone(), code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!");
            String phone1 = AESUtil.decrypt(userInfo.getPhone());//解密
            smsrecordService.saveData(4, phone1, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!");
            phone = AESUtil.decrypt(phone);//解密
            boolean b = userInfoService.checkCaptcha(phone, code);
            Map<String, Object> map = new HashMap<>();
            map.put("ok", b ? 1 : 0);
@@ -698,4 +750,110 @@
            return ResultUtil.runErr();
        }
    }
    /**
     * 对数据库数据进行加密
     * @param type
     * @return
     */
    @ResponseBody
    @PostMapping("/base/encryptedData")
    public ResultUtil encryptedData(Integer type, Integer id){
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.err.println("执行加密任务开始");
                if(type == 1){//用户
                    EntityWrapper<UserInfo> userInfoEntityWrapper = new EntityWrapper<>();
                    if(null != id){
                        userInfoEntityWrapper.eq("id", id);
                    }
                    List<UserInfo> userInfos = userInfoService.selectList(userInfoEntityWrapper);
                    for (UserInfo userInfo : userInfos) {
                        if(ToolUtil.isNotEmpty(userInfo.getPhone())){
                            userInfo.setPhone(AESUtil.encrypt(userInfo.getPhone()));
                        }
                        if(ToolUtil.isNotEmpty(userInfo.getIdCard())){
                            userInfo.setIdCard(AESUtil.encrypt(userInfo.getIdCard()));
                        }
                        userInfoService.updateById(userInfo);
                    }
                }else{
                    EntityWrapper<Driver> userInfoEntityWrapper = new EntityWrapper<>();
                    if(null != id){
                        userInfoEntityWrapper.eq("id", id);
                    }
                    List<Driver> drivers = driverService.selectList(userInfoEntityWrapper);
                    for (Driver driver : drivers) {
                        if(ToolUtil.isNotEmpty(driver.getAccount())){
                            driver.setAccount(AESUtil.encrypt(driver.getAccount()));
                        }
                        if(ToolUtil.isNotEmpty(driver.getPhone())){
                            driver.setPhone(AESUtil.encrypt(driver.getPhone()));
                        }
                        if(ToolUtil.isNotEmpty(driver.getIdCard())){
                            driver.setIdCard(AESUtil.encrypt(driver.getIdCard()));
                        }
                        driverService.updateById(driver);
                    }
                }
                System.err.println("执行加密任务结束");
            }
        }).start();
        return ResultUtil.success();
    }
    /**
     * 解密数据
     * @param type
     * @return
     */
    @ResponseBody
    @PostMapping("/base/decryptData")
    public ResultUtil decryptData(Integer type, Integer id){
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.err.println("执行解密任务开始");
                if(type == 1){//用户
                    EntityWrapper<UserInfo> userInfoEntityWrapper = new EntityWrapper<>();
                    if(null != id){
                        userInfoEntityWrapper.eq("id", id);
                    }
                    List<UserInfo> userInfos = userInfoService.selectList(userInfoEntityWrapper);
                    for (UserInfo userInfo : userInfos) {
                        if(ToolUtil.isNotEmpty(userInfo.getPhone())){
                            userInfo.setPhone(AESUtil.decrypt(userInfo.getPhone()));
                        }
                        if(ToolUtil.isNotEmpty(userInfo.getIdCard())){
                            userInfo.setIdCard(AESUtil.decrypt(userInfo.getIdCard()));
                        }
                        userInfoService.updateById(userInfo);
                    }
                }else{
                    EntityWrapper<Driver> userInfoEntityWrapper = new EntityWrapper<>();
                    if(null != id){
                        userInfoEntityWrapper.eq("id", id);
                    }
                    List<Driver> drivers = driverService.selectList(userInfoEntityWrapper);
                    for (Driver driver : drivers) {
                        if(ToolUtil.isNotEmpty(driver.getAccount())){
                            driver.setAccount(AESUtil.decrypt(driver.getAccount()));
                        }
                        if(ToolUtil.isNotEmpty(driver.getPhone())){
                            driver.setPhone(AESUtil.decrypt(driver.getPhone()));
                        }
                        if(ToolUtil.isNotEmpty(driver.getIdCard())){
                            driver.setIdCard(AESUtil.decrypt(driver.getIdCard()));
                        }
                        driverService.updateById(driver);
                    }
                }
                System.err.println("执行解密任务结束");
            }
        }).start();
        return ResultUtil.success();
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserUserController.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/WithdrawalController.java
@@ -47,18 +47,17 @@
    @ApiOperation(value = "账户余额提现", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "提现金额", name = "money", required = true, dataType = "double"),
            @ApiImplicitParam(value = "银行名称", name = "bankName", required = true, dataType = "string"),
            @ApiImplicitParam(value = "银行卡号", name = "code", required = true, dataType = "string"),
            @ApiImplicitParam(value = "银行卡只有人姓名", name = "name", required = true, dataType = "string"),
            @ApiImplicitParam(value = "银行卡持有人姓名", name = "name", required = true, dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil withdrawal(Double money, String bankName, String code, String name, HttpServletRequest request){
    public ResultUtil withdrawal(Double money, String code, String name, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return withdrawalService.withdrawal(money, bankName, code, name, uid);
            return withdrawalService.withdrawal(money, code, name, uid);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -66,6 +65,31 @@
    }
    @ResponseBody
    @PostMapping("/api/withdrawal/withdrawal1")
    @ApiOperation(value = "账户余额提现【新】", tags = {"用户端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "金额", name = "money", required = true, dataType = "String"),
            @ApiImplicitParam(value = "开户姓名", name = "acctName", required = true, dataType = "String"),
            @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = true, dataType = "String"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil withdrawal1(Double money, String acctName, Integer bankCardId, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return withdrawalService.withdrawal1(money, acctName, bankCardId, uid);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 获取历史提现数据
     * @param pageNum
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/dao/OrderCallMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/dao/mapping/OrderCallMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/model/OrderCall.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/server/IOrderCallService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/server/impl/OrderCallServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/controller/SiteController.java
@@ -9,6 +9,7 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import javafx.scene.chart.ValueAxis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -35,18 +36,11 @@
    @RequestMapping(value = "/base/site/querySite", method = RequestMethod.POST)
    @ApiOperation(value = "获取起点和终点的站点", tags = {"用户端-跨城"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "起点站点id", name = "startSiteId", required = false, dataType = "int"),
            @ApiImplicitParam(value = "类型", name = "startSiteId", required = false, dataType = "int")
            @ApiImplicitParam(value = "起点站点id", name = "startSiteId", required = false, dataType = "int")
    })
    public ResultUtil<List<SiteWarpper>> querySite(Integer startSiteId,Integer type) {
    public ResultUtil<List<SiteWarpper>> querySite(Integer startSiteId){
        try {
            if(type == 7){
                type = 1;
            }
            if(type == 8){
                type = 2;
            }
            List<SiteWarpper> list = siteService.querySite(startSiteId, type);
            List<SiteWarpper> list = siteService.querySite(startSiteId);
            return ResultUtil.success(list);
        } catch (Exception e) {
            e.printStackTrace();
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/SiteMapper.java
@@ -12,9 +12,8 @@
    /**
     * 根据起点站点获取线路相关的终点站点
     *
     * @param startSiteId
     * @return
     */
    List<Map<String, Object>> querySite(@Param("startSiteId") Integer startSiteId, @Param("type") Integer type);
    List<Map<String, Object>> querySite(@Param("startSiteId") Integer startSiteId);
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/LineSiteMapper.xml
@@ -19,7 +19,7 @@
        a.id as id,
        b.id as lineShiftDriverId,
        b.driverId as driverId,
        CONCAT(a.startTime, '-', a.endTime) as startTime,
        a.startTime as startTime,
        c.headImgUrl as headImgUrl,
        CONCAT(left(c.`name`, 1), '师傅') as `name`,
        d.carLicensePlate as carLicensePlate,
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/OrderCrossCityMapper.xml
@@ -32,7 +32,6 @@
        <result column="mileage" property="mileage"/>
        <result column="payManner" property="payManner"/>
        <result column="payType" property="payType"/>
        <result column="holidayFee" property="holidayFee"/>
        <result column="orderMoney" property="orderMoney"/>
        <result column="redPacketMoney" property="redPacketMoney"/>
        <result column="couponMoney" property="couponMoney"/>
@@ -44,11 +43,7 @@
        <result column="seatNumber" property="seatNumber" />
        <result column="activityId" property="activityId"/>
        <result column="companyId" property="companyId"/>
        <result column="taxiCardId" property="taxiCardId"/>
        <result column="userTaxiCardId" property="userTaxiCardId"/>
        <result column="discountAmount" property="discountAmount"/>
        <result column="payMoney" property="payMoney"/>
        <result column="thankYouFee" property="thankYouFee"/>
        <result column="passengers" property="passengers"/>
        <result column="passengersPhone" property="passengersPhone"/>
        <result column="sort" property="sort"/>
@@ -346,9 +341,7 @@
        h.money as cancelMoney,
        h.reason as cancelReason,
        h.remark as cancelRemark,
        CONCAT(j.startTime, '-', j.endTime) as lineShiftTime,
        a.holidayFee,
        a.discountAmount as taxiCardMoney
        CONCAT(j.startTime, '-', j.endTime) as lineShiftTime
        from t_order_cross_city a
        left join t_driver b on (a.driverId = b.id)
        left join t_car c on (a.carId = c.id)
@@ -375,8 +368,7 @@
        state as state,
        oldState as oldState,
        remark as remark,
        peopleNumber as num,
        thankYouFee
        peopleNumber as num
        from t_order_cross_city where userId = #{uid} order by insertTime desc limit #{pageNum}, #{size}
    </select>
@@ -395,7 +387,7 @@
    <select id="queryInvoiceOrder" resultType="map">
        select
        id as orderId,
        id as id,
        DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i') as time,
        startAddress as startAddress,
        endAddress as endAddress,
@@ -406,22 +398,16 @@
        (3) as orderType
        from t_order_cross_city where state in (8, 9)
        <if test="type == 1">
            and (invoiceId is null or invoiceId in (select id from t_invoice where state = 3))
            and invoiceId is null and invoiceId in (select id from t_invoice where state != 2)
        </if>
        <if test="type == 2">
            and invoiceId in (select id from t_invoice where state = 2)
        </if>
        <if test="null != startTime">
            and travelTime >= #{startTime}
        <if test="null != startTime and null != endTime">
            and travelTime between #{startTime} and #{endTime}
        </if>
        <if test="null != startMoney">
            and payMoney >= #{startMoney}
        </if>
        <if test="null != endTime">
            and  #{endTime}>= travelTime
        </if>
        <if test="null != endMoney">
            and   #{endMoney}>=payMoney
        <if test="null != startMoney and null != endMoney">
            and payMoney between #{startMoney} and #{endMoney}
        </if>
        <if test="null !=uid">
            and userId = #{uid}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/SiteMapper.xml
@@ -23,11 +23,10 @@
    <select id="querySite" resultType="map">
        select * from
        (
        select id as id, `name` as `name`, provinceCode as cityCode, province as cityName,type from t_site where province like '%市' and state = 1
        select id as id, `name` as `name`, provinceCode as cityCode, province as cityName from t_site where province like '%市' and state = 1
        UNION ALL
        select id as id, `name` as `name`, cityCode as cityCode, city as cityName,type from t_site where province not like '%市' and state = 1
        select id as id, `name` as `name`, cityCode as cityCode, city as cityName from t_site where province not like '%市' and state = 1
        ) as a where 1 = 1
        and type = ${type}
        <if test="null != startSiteId">
            and a.id in(select siteId from t_line_site where lineId in(select lineId from t_line_site where siteId = #{startSiteId} and type = 1) and type = 2)
        </if>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/model/OrderCrossCity.java
@@ -153,9 +153,6 @@
     */
    @TableField("payType")
    private Integer payType;
    //节假费
    @TableField("holidayFee")
    private Double holidayFee;
    /**
     * 订单金额
     */
@@ -197,21 +194,6 @@
    @TableField("activityId")
    private Integer activityId;
    /**
     * 打折卡id
     */
    @TableField("taxiCardId")
    private Integer taxiCardId;
    /**
     * 打车卡购买记录id
     */
    @TableField("userTaxiCardId")
    private Integer userTaxiCardId;
    /**
     * 优惠金额
     */
    @TableField("discountAmount")
    private Double discountAmount;
    /**
     * 公司id
     */
    @TableField("companyId")
@@ -221,9 +203,6 @@
     */
    @TableField("payMoney")
    private Double payMoney;
    //感谢费
    @TableField("thankYouFee")
    private Double thankYouFee;
    /**
     * 乘车人姓名
     */
@@ -574,14 +553,6 @@
        this.payType = payType;
    }
    public Double getHolidayFee() {
        return holidayFee;
    }
    public void setHolidayFee(Double holidayFee) {
        this.holidayFee = holidayFee;
    }
    public Double getOrderMoney() {
        return orderMoney;
    }
@@ -646,30 +617,6 @@
        this.activityId = activityId;
    }
    public Integer getTaxiCardId() {
        return taxiCardId;
    }
    public void setTaxiCardId(Integer taxiCardId) {
        this.taxiCardId = taxiCardId;
    }
    public Integer getUserTaxiCardId() {
        return userTaxiCardId;
    }
    public void setUserTaxiCardId(Integer userTaxiCardId) {
        this.userTaxiCardId = userTaxiCardId;
    }
    public Double getDiscountAmount() {
        return discountAmount;
    }
    public void setDiscountAmount(Double discountAmount) {
        this.discountAmount = discountAmount;
    }
    public Integer getCompanyId() {
        return companyId;
    }
@@ -684,14 +631,6 @@
    public void setPayMoney(Double payMoney) {
        this.payMoney = payMoney;
    }
    public Double getThankYouFee() {
        return thankYouFee;
    }
    public void setThankYouFee(Double thankYouFee) {
        this.thankYouFee = thankYouFee;
    }
    public String getPassengers() {
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/model/Site.java
@@ -69,17 +69,6 @@
    @TableField("insertUserId")
    private Integer insertUserId;
    @TableField("type")
    private Integer type;
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public Integer getId() {
        return id;
    }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/IOrderCrossCityService.java
@@ -6,9 +6,7 @@
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.system.warpper.CouponsListVo;
import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper;
import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
@@ -44,15 +42,6 @@
    Map<String, Object> queryBalance(Integer orderId, Integer uid) throws Exception;
    /**
     * 获取用户余额和优惠数据
     * @param uid
     * @return
     * @throws Exception
     */
    PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception;
    /**
@@ -64,18 +53,6 @@
    List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception;
    /**
     * 获取优惠券和打车卡列表
     * @param orderId
     * @param uid
     * @param pageNum
     * @param size
     * @return
     * @throws Exception
     */
    List<CouponsListVo> queryCouponList(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception;
    /**
     * 订单完成支付订单操作
@@ -85,17 +62,6 @@
     * @throws Exception
     */
    ResultUtil payCrossCityOrder(Integer payType, Integer orderId, Integer couponId, Integer type)throws Exception;
    /**
     * 订单完成支付订单操作
     * @param payType
     * @param orderId
     * @return
     * @throws Exception
     */
    ResultUtil payCrossCityOrder1(Integer payType, Integer orderId, Integer objectId, Integer objectType, Integer type)throws Exception;
@@ -292,27 +258,4 @@
    List<OrderCrossCity> queryListOrder(Integer driverId, Integer lineShiftId, List<Integer> state, String day) throws Exception;
    /**
     * 支付感谢费
     * @param uid
     * @param orderId
     * @param money
     * @param payType
     * @return
     * @throws Exception
     */
    ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception;
    /**
     * 感谢费支付回调处理
     * @param orderId
     * @param order_id
     * @throws Exception
     */
    void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception;
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/ISiteService.java
@@ -15,7 +15,7 @@
     * @return
     * @throws Exception
     */
    List<SiteWarpper> querySite(Integer startSiteId,Integer type) throws Exception;
    List<SiteWarpper> querySite(Integer startSiteId) throws Exception;
    /**
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineSiteServiceImpl.java
@@ -132,7 +132,7 @@
            }
            if(b){
                data.put("id", lineShift.getId());
                data.put("startTime", lineShift.getStartTime() + "-" + lineShift.getEndTime());
                data.put("startTime", lineShift.getStartTime());
                list.add(data);
            }
        }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java
@@ -1,7 +1,6 @@
package com.stylefeng.guns.modular.crossCity.server.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
@@ -16,9 +15,6 @@
import com.stylefeng.guns.modular.crossCity.server.ILineService;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper;
import com.stylefeng.guns.modular.smallLogistics.dao.OrderLogisticsMapper;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
@@ -28,9 +24,7 @@
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.system.warpper.CouponsListVo;
import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper;
import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo;
import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
@@ -59,7 +53,6 @@
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import static com.stylefeng.guns.modular.taxi.service.impl.OrderTaxiServiceImpl.orderIds;
@@ -179,28 +172,6 @@
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Autowired
    private IOrderLogisticsService orderLogisticsService;
    @Autowired
    private ITaxiCardPaymentService taxiCardPaymentService;
    @Autowired
    private ICompanyService companyService;
    @Autowired
    private ITaxiCardService taxiCardService;
    @Autowired
    private IUserUserService userUserService;
    @Autowired
    private IUserTaxiCardService userTaxiCardService;
    @Autowired
    private IRegionService regionService;
    @Value("${callbackPath}")
    private String callbackPath;
@@ -255,197 +226,6 @@
    }
    @Override
    public PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        PreferentialDataVo preferentialDataVo = new PreferentialDataVo();
        preferentialDataVo.setBalance(userInfo.getBalance());
        OrderCrossCity orderCrossCity = this.selectById(orderId);
        //获取优惠券中最优数据
        List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("companyId", orderCrossCity.getCompanyId()).eq("state", 1).in("couponUseType", Arrays.asList(0, 3)).eq("userId", uid).where("now() < expirationTime"));
        Integer id = null;
        Double price = 0d;
        Integer type = 0;
        for (UserCouponRecord userCouponRecord : list){
            if(userCouponRecord.getCouponType() == 1){//抵扣券
                if(price.compareTo(userCouponRecord.getMoney()) < 0){
                    price = userCouponRecord.getMoney();
                    id = userCouponRecord.getId();
                    type = 1;
                }
            }else{//满减券
                if(orderCrossCity.getOrderMoney().compareTo(userCouponRecord.getFullMoney()) >= 0 && price.compareTo(userCouponRecord.getMoney()) < 0){
                    price = userCouponRecord.getMoney();
                    id = userCouponRecord.getId();
                    type = 1;
                }
            }
        }
        //获取打车卡中最优数
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString());
        CompanyCity companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderCrossCity.getCompanyId()).eq("areaCode", geocode.get("districtCode")).eq("state", 1));
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderCrossCity.getCompanyId()).eq("cityCode", geocode.get("cityCode")).eq("state", 1));
        }
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderCrossCity.getCompanyId()).eq("provinceCode", geocode.get("provinceCode")).eq("state", 1));
        }
        List<UserTaxiCard> userTaxiCards = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().like("companyCityId", "%" + companyCity.getId() + "%")
                .in("type", Arrays.asList(1, 2, 3, 4)).eq("userId", uid).where("now() between startTime and endTime"));
        //全国卡
        List<TaxiCard> taxiCards = taxiCardService.selectList(new EntityWrapper<TaxiCard>().eq("taxiCardType", 2).in("type", Arrays.asList(1, 2, 3, 4)).eq("state", 1));
        if(taxiCards.size() > 0) {
            List<UserTaxiCard> userTaxiCards2 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                    .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
            userTaxiCards.addAll(userTaxiCards2);
        }
        Map<String, Object> map = getOptimalTaxiCards(orderCrossCity, price, id, type, userTaxiCards);
        price = Double.valueOf(map.get("price").toString());
        id = null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : null;
        type = Integer.valueOf(map.get("type").toString());
        //亲密账户
        List<UserTaxiCard> userTaxiCards_ = new ArrayList<>();
        List<UserUser> bindUserId = userUserService.selectList(new EntityWrapper<UserUser>().eq("bindUserId", uid));
        CompanyCity finalCompanyCity = companyCity;
        bindUserId.forEach(userUser -> {
            List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().in("type", Arrays.asList(1, 2, 3, 4))
                    .like("companyCityId", "%" + finalCompanyCity.getId() + "%").eq("userId", userUser.getUserId()).where("now() between startTime and endTime"));
            userTaxiCards_.addAll(userTaxiCards1);
            //全国卡
            if(taxiCards.size() > 0) {
                List<UserTaxiCard> userTaxiCards2 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", userUser.getUserId())
                        .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
                userTaxiCards_.addAll(userTaxiCards2);
            }
        });
        map = getOptimalTaxiCards(orderCrossCity, price, id, type, userTaxiCards_);
        price = Double.valueOf(map.get("price").toString());
        id = null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : null;
        type = Integer.valueOf(map.get("type").toString());
        preferentialDataVo.setObjectId(id);
        preferentialDataVo.setDiscountAmount(price);
        preferentialDataVo.setType(type);
        return preferentialDataVo;
    }
    public Map<String, Object> getOptimalTaxiCards(OrderCrossCity orderCrossCity, Double price, Integer id, Integer type, List<UserTaxiCard> userTaxiCards) throws Exception{
        Map<String, Object> map = new HashMap<>();
        for(UserTaxiCard t : userTaxiCards){
            JSONObject jsonObject = JSON.parseObject(t.getContent());
            List<Integer> integers = jsonObject.getJSONArray("businessTypes").toJavaList(Integer.class);
            if(!integers.contains(3)){
                continue;
            }
            if(t.getType() == 1){//打折次数卡{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                Integer time = jsonObject.getInteger("time");
                if(time == 0){
                    continue;
                }
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discount = jsonObject.getDouble("discount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        double v = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        if(price.compareTo(v) < 0){
                            price = v;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
            if(t.getType() == 2){//优惠卡{"businessTypes":[1,2,3],"fullReduction":[[50,3],[100,5],[150,10]]}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        for(int j = fullReduction.size() - 1; j >= 0; j--){
                            JSONArray jsonArray = fullReduction.getJSONArray(j);
                            Double p = jsonArray.getDouble(0);//满金额
                            Double y = jsonArray.getDouble(1);//优惠金额
                            if(orderCrossCity.getOrderMoney().compareTo(p) >= 0 && price.compareTo(y) < 0){
                                price = y;
                                id = t.getId();
                                type = 2;
                            }
                        }
                    }
                }
            }
            if(t.getType() == 3){//次数卡{"businessTypes":[1,2,3],"time":1,"discountAmount":10}
                Integer time = jsonObject.getInteger("time");
                if(time == 0){
                    continue;
                }
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discountAmount = jsonObject.getDouble("discountAmount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        if(price.compareTo(discountAmount) < 0){
                            price = discountAmount;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
            if(t.getType() == 4){//打折天数卡{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                Double discount = jsonObject.getDouble("discount");//折扣
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");//使用时间段
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        double v = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        if(price.compareTo(v) < 0){
                            price = v;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
        }
        map.put("price", price);
        map.put("id", id);
        map.put("type", type);
        return map;
    }
    /**
     * 获取支付页面的优惠券列表
     * @param orderId
@@ -465,238 +245,6 @@
    }
    @Override
    public List<CouponsListVo> queryCouponList(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception {
        pageNum = (pageNum - 1) * size;
        OrderCrossCity orderCrossCity = this.selectById(orderId);
        List<CouponsListVo> rows = new ArrayList<>();
        List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("companyId", orderCrossCity.getCompanyId())
                .eq("state", 1).in("couponUseType", Arrays.asList(0, 3)).eq("userId", uid).where("expirationTime >= now()"));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        for (UserCouponRecord userCouponRecord : list){
            if(userCouponRecord.getCouponType() == 2){//满减券
                if(orderCrossCity.getOrderMoney().compareTo(userCouponRecord.getFullMoney()) < 0){
                    continue;
                }
            }
            CouponsListVo couponsListVo = new CouponsListVo();
            couponsListVo.setId(userCouponRecord.getId());
            couponsListVo.setDataType(1);
            couponsListVo.setMoney(userCouponRecord.getMoney());
            couponsListVo.setUserType(userCouponRecord.getCouponUseType());
            couponsListVo.setTime(sdf.format(userCouponRecord.getExpirationTime()));
            couponsListVo.setType(userCouponRecord.getCouponType());
            couponsListVo.setFullMoney(userCouponRecord.getFullMoney());
            couponsListVo.setState(userCouponRecord.getState());
            Company company = companyService.selectById(userCouponRecord.getCompanyId());
            couponsListVo.setCompany(company.getName());
            rows.add(couponsListVo);
        }
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString());
        CompanyCity companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderCrossCity.getCompanyId()).eq("areaCode", geocode.get("districtCode")).eq("state", 1));
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderCrossCity.getCompanyId()).eq("cityCode", geocode.get("cityCode")).eq("state", 1));
        }
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderCrossCity.getCompanyId()).eq("provinceCode", geocode.get("provinceCode")).eq("state", 1));
        }
        List<UserTaxiCard> userTaxiCards = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                .in("type", Arrays.asList(1, 2, 3, 4)).like("companyCityId", "%" + companyCity.getId() + "%").where("now() between startTime and endTime"));
        //全国卡
        List<TaxiCard> taxiCards = taxiCardService.selectList(new EntityWrapper<TaxiCard>().eq("taxiCardType", 2).in("type", Arrays.asList(1, 2, 3, 4)).eq("state", 1));
        if(taxiCards.size() > 0){
            List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                    .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
            userTaxiCards.addAll(userTaxiCards1);
        }
        //亲密账户
        List<UserUser> bindUserId = userUserService.selectList(new EntityWrapper<UserUser>().eq("bindUserId", uid));
        CompanyCity finalCompanyCity = companyCity;
        bindUserId.forEach(userUser -> {
            List<UserTaxiCard> taxiCardPayments1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().in("type", Arrays.asList(1, 2, 3, 4))
                    .like("companyCityId", "%" + finalCompanyCity.getId() + "%").eq("userId", userUser.getUserId()).where("now() between startTime and endTime"));
            userTaxiCards.addAll(taxiCardPayments1);
            //全国卡
            if(taxiCards.size() > 0){
                List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", userUser.getUserId())
                        .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
                userTaxiCards.addAll(userTaxiCards1);
            }
        });
        for(UserTaxiCard t : userTaxiCards){
            try {
                CouponsListVo couponsListVo = new CouponsListVo();
                couponsListVo.setId(t.getId());
                couponsListVo.setDataType(2);
                couponsListVo.setUserType(1);
                couponsListVo.setTaxiCardType(t.getType());
                couponsListVo.setTime(sdf.format(t.getEndTime()));
                couponsListVo.setState(1);
                Company company = companyService.selectById(t.getCompanyId());
                couponsListVo.setCompany(company.getName());
                couponsListVo.setName(taxiCardService.selectById(t.getTaxiCardId()).getName());
                JSONObject jsonObject = JSON.parseObject(t.getContent());
                JSONArray businessTypes = jsonObject.getJSONArray("businessTypes");
                if(!businessTypes.toJavaList(Integer.class).contains(3)){
                    continue;
                }
                if(t.getType() == 1){//{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                    Integer time = jsonObject.getInteger("time");
                    if(time == 0){
                        continue;
                    }
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setMoney(jsonObject.getDouble("discount"));
                    couponsListVo.setType(1);
                }
                if(t.getType() == 2){//{"businessTypes":[1,2,3],"fullReduction":[[50,3],[100,5],[150,10]]}
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                    b = true;
                    for(int i = fullReduction.size() - 1; i >= 0; i--){
                        Double m = fullReduction.getJSONArray(i).getDouble(0);
                        Double y = fullReduction.getJSONArray(i).getDouble(1);
                        if(m.compareTo(orderCrossCity.getOrderMoney()) <= 0){
                            couponsListVo.setMoney(y);
                            couponsListVo.setFullMoney(m);
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setType(2);
                }
                if(t.getType() == 3){//{"businessTypes":[1,2,3],"time":1,"discountAmount":10}
                    Integer time = jsonObject.getInteger("time");
                    if(time == 0){
                        continue;
                    }
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setMoney(jsonObject.getDouble("discountAmount"));
                    couponsListVo.setType(2);
                }
                if(t.getType() == 4){//{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setMoney(jsonObject.getDouble("discount"));
                    couponsListVo.setType(1);
                }
                String str = "";
                TaxiCard taxiCard = taxiCardService.selectById(t.getTaxiCardId());
                if(taxiCard.getTaxiCardType() == 1){
                    String[] split = taxiCard.getCompanyCityId().split(";");
                    for(String c : split){
                        CompanyCity companyCity1 = companyCityService.selectById(c);
                        if(ToolUtil.isNotEmpty(companyCity1.getAreaCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getAreaCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                        if(ToolUtil.isNotEmpty(companyCity1.getCityCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getCityCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                        if(ToolUtil.isNotEmpty(companyCity1.getProvinceCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getProvinceCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                    }
                }else{
                    str = "全国;";
                }
                couponsListVo.setCity(str.substring(0, str.length() - 1));
                rows.add(couponsListVo);
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        Collections.sort(rows, new Comparator<CouponsListVo>() {
            public int compare(CouponsListVo s1, CouponsListVo s2) {
                return Integer.compare(s1.getId(), s2.getId());
            }
        });
        if(rows.size() >= (pageNum + 1) * size){
            rows = rows.subList(pageNum, pageNum + size);
        }else if(pageNum < rows.size() && rows.size() < (pageNum + 1) * size){
            rows = rows.subList(pageNum, rows.size());
        }else{
            rows = new ArrayList<>();
        }
        return rows;
    }
    /**
     * 订单支付
     * @param payType
@@ -710,12 +258,12 @@
    public ResultUtil payCrossCityOrder(Integer payType, Integer orderId, Integer couponId, Integer type) throws Exception {
        OrderCrossCity orderCrossCity = this.selectById(orderId);
        if(orderCrossCity.getState() != 7){
            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
            return ResultUtil.error("订单已完成支付,不允许重复支付");
        }
        Integer uid = orderCrossCity.getUserId();
        Double orderMoney = orderCrossCity.getOrderMoney();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        ResultUtil resultUtil = ResultUtil.success();
        orderCrossCity.setCouponMoney(0D);//初始化历史数据
        orderCrossCity.setCouponId(null);
@@ -723,27 +271,25 @@
        UserCouponRecord userCouponRecord = null;
        if(null != couponId){
            userCouponRecord = userCouponRecordService.selectById(couponId);
            if(null != userCouponRecord){
                if(userCouponRecord.getCompanyId() != orderCrossCity.getCompanyId()){
                    return ResultUtil.error("优惠券不能用于此订单", "");
                return ResultUtil.error("优惠券不能用于此订单");
                }
                if(userCouponRecord.getState() == 2){
                    return ResultUtil.error("优惠券已使用", "");
                return ResultUtil.error("优惠券已使用");
                }
                if(userCouponRecord.getState() == 3){
                    return ResultUtil.error("优惠券已过期", "");
                return ResultUtil.error("优惠券已过期");
                }
                if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 3){
                    return ResultUtil.error("优惠券不能用于此类型订单", "");
                return ResultUtil.error("优惠券不能用于此类型订单");
                }
                if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){
                    return ResultUtil.error("优惠券不能用于此订单", "");
                return ResultUtil.error("优惠券不能用于此订单");
                }
                orderMoney = orderMoney - userCouponRecord.getMoney();
                orderCrossCity.setCouponMoney(userCouponRecord.getMoney());
                orderCrossCity.setCouponId(couponId);
            }
        }
        //计算红包
        UserRedPacketRecord query = userRedPacketRecordService.query(uid, orderCrossCity.getCompanyId(), 1, 3, orderMoney);
@@ -766,18 +312,33 @@
            }
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String out_trade_no = sdf.format(new Date()) + 3 + orderCrossCity.getId();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId());
            String appletsOpenId = "";
            String tradeType = "APP";
            if(type == 3){
                appletsOpenId = userInfo.getAppletsOpenId();
                tradeType = "JSAPI";
                if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                    return ResultUtil.error("支付异常,请重新授权登录小程序");
                }
            }
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", out_trade_no, orderMoney.toString(), callbackPath + "/base/wxPayOrderTaxi", tradeType, appletsOpenId);
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 1, orderMoney, "", 1);//添加预支付数据
        }
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi");
            resultUtil = payMoneyUtil.alipay("订单完成支付", "支付订单", out_trade_no, orderMoney.toString(), callbackPath + "/base/aliPayOrderTaxi");
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 2, orderMoney, "", 1);//添加预支付数据
            }
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
                return ResultUtil.error("余额不足,无法完成支付");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
@@ -786,7 +347,7 @@
            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "跨城出行订单", orderMoney, 2, 1, 1, 3, orderId);
            transactionDetailsService.saveData(uid, "完成订单", orderMoney, 2, 1, 1, 3, orderId);
            userInfoService.updateById(userInfo);
            orderCrossCity.setState(2);//跨城支付完成后才开始服务
@@ -805,19 +366,6 @@
                userRedPacketRecordService.updateById(query);
            }
            //添加已收入明细
            Line line = lineService.selectById(orderCrossCity.getLineId());
            Double speMoney = Double.valueOf(line.getRakeRate());
            BigDecimal d = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);//企业收入
            BigDecimal c = new BigDecimal(orderCrossCity.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);//司机收入
            incomeService.saveData(1, orderCrossCity.getCompanyId(), 2, orderCrossCity.getId(), 3, d.doubleValue());
            incomeService.saveData(2, orderCrossCity.getDriverId(), 2, orderCrossCity.getId(), 3, c.doubleValue());
            Driver driver = driverService.selectById(orderCrossCity.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
                @Override
@@ -835,252 +383,6 @@
        return resultUtil;
    }
    @Override
    public ResultUtil payCrossCityOrder1(Integer payType, Integer orderId, Integer objectId, Integer objectType, Integer type) throws Exception {
        OrderCrossCity orderCrossCity = this.selectById(orderId);
        if(orderCrossCity.getState() != 7){
            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
        }
        Integer uid = orderCrossCity.getUserId();
        Double orderMoney = orderCrossCity.getOrderMoney();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        orderCrossCity.setCouponMoney(0D);//初始化历史数据
        orderCrossCity.setCouponId(null);
        //计算优惠券
        UserCouponRecord userCouponRecord = null;
        if(null != objectId && 1 == objectType){
            userCouponRecord = userCouponRecordService.selectById(objectId);
            if(userCouponRecord.getCompanyId() != orderCrossCity.getCompanyId()){
                return ResultUtil.error("优惠券不能用于此订单", "");
            }
            if(userCouponRecord.getState() == 2){
                return ResultUtil.error("优惠券已使用", "");
            }
            if(userCouponRecord.getState() == 3){
                return ResultUtil.error("优惠券已过期", "");
            }
            if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 3){
                return ResultUtil.error("优惠券不能用于此类型订单", "");
            }
            if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){
                return ResultUtil.error("优惠券不能用于此订单", "");
            }
            orderMoney = orderMoney - userCouponRecord.getMoney();
            orderCrossCity.setCouponMoney(userCouponRecord.getMoney());
            orderCrossCity.setCouponId(objectId);
        }
        //打车卡
        UserTaxiCard userTaxiCard = null;
        if(null != objectId && objectType == 2){
            userTaxiCard = userTaxiCardService.selectById(objectId);
            TaxiCard taxiCard = taxiCardService.selectById(userTaxiCard.getTaxiCardId());
            if(taxiCard.getTaxiCardType() == 1 && userTaxiCard.getCompanyId() != orderCrossCity.getCompanyId()){
                return ResultUtil.error("打车卡不能用于此订单", "");
            }
            if(System.currentTimeMillis() > userTaxiCard.getEndTime().getTime()){
                return ResultUtil.error("打车卡已过期", "");
            }
            if(userTaxiCard.getType() == 1 || userTaxiCard.getType() == 3){
                Integer time = JSON.parseObject(userTaxiCard.getContent()).getInteger("time");
                if(0 == time){
                    return ResultUtil.error("打车卡已使用完", "");
                }
            }
            List<Integer> integers = JSON.parseObject(userTaxiCard.getContent()).getJSONArray("businessTypes").toJavaList(Integer.class);
            if(!integers.contains(3)){
                return ResultUtil.error("打车卡不能用于此类型订单", "");
            }
            Double yh = 0D;
            JSONObject jsonObject = JSON.parseObject(userTaxiCard.getContent());
            if(userTaxiCard.getType() == 1){//打折次数卡{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discount = jsonObject.getDouble("discount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        jsonObject.put("time", jsonObject.getInteger("time") - 1);
                        userTaxiCard.setContent(jsonObject.toJSONString());
                        break;
                    }
                }
            }
            if(userTaxiCard.getType() == 2){//优惠卡{"businessTypes":[1,2,3],"fullReduction":[[50,3],[100,5],[150,10]]}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        for(int j = fullReduction.size() - 1; j >= 0 ; j--){
                            JSONArray jsonArray = fullReduction.getJSONArray(j);
                            Double p = jsonArray.getDouble(0);//满金额
                            if(orderCrossCity.getOrderMoney().compareTo(p) >= 0){
                                yh = jsonArray.getDouble(1);//优惠金额
                                break;
                            }
                        }
                    }
                }
            }
            if(userTaxiCard.getType() == 3){//次数卡{"businessTypes":[1,2,3],"time":1,"discountAmount":10}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = jsonObject.getDouble("discountAmount");
                        jsonObject.put("time", jsonObject.getInteger("time") - 1);
                        userTaxiCard.setContent(jsonObject.toJSONString());
                    }
                }
            }
            if(userTaxiCard.getType() == 4){//打折天数卡{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                Double discount = jsonObject.getDouble("discount");//折扣
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");//使用时间段
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        break;
                    }
                }
            }
            orderMoney = orderMoney - yh;
            orderCrossCity.setTaxiCardId(userTaxiCard.getTaxiCardId());
            orderCrossCity.setUserTaxiCardId(objectId);
            orderCrossCity.setDiscountAmount(yh);
        }
        //计算红包
        UserRedPacketRecord query = userRedPacketRecordService.query(uid, orderCrossCity.getCompanyId(), 1, 3, orderMoney);
        if(null != query && orderMoney.compareTo(query.getMoney()) > 0){
            orderMoney = orderMoney - query.getMoney();
            orderCrossCity.setRedPacketMoney(query.getMoney());
            orderCrossCity.setRedPacketId(query.getId());
        }
        //计算折扣
        UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderCrossCity.getCompanyId());
        if(null != query2){
            Double special = query2.getSpecial();
            orderCrossCity.setDiscount(special);
            double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
            if(orderMoney.compareTo(v) > 0){
                orderCrossCity.setDiscountMoney(orderMoney - v);
                orderCrossCity.setActivityId(query2.getId());
                orderMoney = v;
            }
        }
        orderMoney = orderMoney < 0 ? 0 : orderMoney;
        if(payType == 1){//微信支付
            if(orderMoney == 0){
                return ResultUtil.error("请使用余额支付");
            }
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 1, orderMoney, "", 1);//添加预支付数据
        }
        if(payType == 2){//支付宝支付
            if(orderMoney == 0){
                return ResultUtil.error("请使用余额支付");
            }
            resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi");
            paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 2, orderMoney, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId());
            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "跨城出行订单", orderMoney, 2, 1, 1, 3, orderId);
            userInfoService.updateById(userInfo);
            orderCrossCity.setState(2);//跨城支付完成后才开始服务
            orderCrossCity.setPayType(3);
            orderCrossCity.setPayMoney(orderMoney);
            //处理优惠券和红包
            if(null != userCouponRecord){
                userCouponRecord.setState(2);
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            //处理打车卡
            if(null != userTaxiCard){
                userTaxiCardService.updateById(userTaxiCard);
            }
            if(null != query){
                query.setState(2);
                query.setEndTime(new Date());
                userRedPacketRecordService.updateById(query);
            }
            //添加已收入明细
            // TODO: 2022/3/19  抽成按照订单金额计算,优先保证司机的收入,用户支付金额不够,则在平台收入中补贴司机收入
            //例如:订单金额10元,优惠3元,司机收入比例80%,平台收入比例20%。
            //司机收入:10 * 0.8 = 8
            //平台收入:7 - 8 = -1
            Line line = lineService.selectById(orderCrossCity.getLineId());
            Double speMoney = Double.valueOf(line.getRakeRate());
            BigDecimal c = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal(1 - (speMoney / 100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);//企业收入
            BigDecimal d = new BigDecimal(orderCrossCity.getPayMoney()).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN);//司机收入
            incomeService.saveData(1, orderCrossCity.getCompanyId(), 2, orderCrossCity.getId(), 3, d.doubleValue());
            incomeService.saveData(2, orderCrossCity.getDriverId(), 2, orderCrossCity.getId(), 3, c.doubleValue());
            Driver driver = driverService.selectById(orderCrossCity.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
                @Override
                public void run() {
                    pushUtil.pushOrderState(1, orderCrossCity.getUserId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0);
                    pushUtil.pushOrderState(2, orderCrossCity.getDriverId(), orderCrossCity.getId(), 3, orderCrossCity.getState(), 0);
                    pushUtil.pushDriverPosition(orderCrossCity.getId(), 3);
                }
            }).start();
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成出行订单支付,谢谢使用!", uid, 1);
        }
        this.updateAllColumnById(orderCrossCity);
        return resultUtil;
    }
    /**
     * 支付成功后的回调操作
@@ -1093,9 +395,9 @@
    public void payOrderCrossCityCallback(Integer id, String order_id, Integer type) throws Exception {
        OrderCrossCity orderCrossCity = this.selectById(id);
        PaymentRecord query = paymentRecordService.query(1, orderCrossCity.getUserId(), 1, Integer.valueOf(id), 3, type, 1);
        if(null != query && query.getState() == 1){
        if(null != query){
            //添加交易明细
            transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城出行订单", query.getAmount(), 2, 1, 1, 3, query.getOrderId());
            transactionDetailsService.saveData(orderCrossCity.getUserId(), "完成订单", query.getAmount(), 2, 1, 1, 3, query.getOrderId());
            orderCrossCity.setState(2);//先支付再服务
            orderCrossCity.setPayType(type);
            orderCrossCity.setPayMoney(query.getAmount());
@@ -1113,15 +415,6 @@
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            if(null != orderCrossCity.getUserTaxiCardId()){
                UserTaxiCard userTaxiCard = userTaxiCardService.selectById(orderCrossCity.getUserTaxiCardId());
                if(userTaxiCard.getType() == 1 || userTaxiCard.getType() == 3){
                    JSONObject jsonObject = JSON.parseObject(userTaxiCard.getContent());
                    jsonObject.put("time", jsonObject.getInteger("time") - 1);
                    userTaxiCard.setContent(jsonObject.toJSONString());
                    userTaxiCardService.updateById(userTaxiCard);
                }
            }
            if(null != orderCrossCity.getRedPacketId()){
                UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(orderCrossCity.getRedPacketId());
                userRedPacketRecord.setState(2);
@@ -1134,23 +427,6 @@
            query.setCode(order_id);
            paymentRecordService.updateById(query);
            //添加已收入明细
            // TODO: 2022/3/19  抽成按照订单金额计算,优先保证司机的收入,用户支付金额不够,则在平台收入中补贴司机收入
            //例如:订单金额10元,优惠3元,司机收入比例80%,平台收入比例20%。
            //司机收入:10 * 0.8 = 8
            //平台收入:7 - 8 = -1
            Line line = lineService.selectById(orderCrossCity.getLineId());
            Double speMoney = Double.valueOf(line.getRakeRate());
            BigDecimal c = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal(1 - (speMoney / 100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);//企业收入
            BigDecimal d = new BigDecimal(orderCrossCity.getPayMoney()).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN);//司机收入
            incomeService.saveData(1, orderCrossCity.getCompanyId(), 2, orderCrossCity.getId(), 3, d.doubleValue());
            incomeService.saveData(2, orderCrossCity.getDriverId(), 2, orderCrossCity.getId(), 3, c.doubleValue());
            Driver driver = driverService.selectById(orderCrossCity.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
                @Override
@@ -1160,8 +436,6 @@
                    pushUtil.pushDriverPosition(orderCrossCity.getId(), 3);
                }
            }).start();
            systemNoticeService.addSystemNotice(1, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功完成出行订单支付,谢谢使用!", orderCrossCity.getUserId(), 1);
        }else{
            System.err.println("预支付数据异常(orderId = "  + id + ")");
@@ -1179,16 +453,19 @@
    @Override
    public synchronized ResultUtil<BaseWarpper> orderCrossCity(OrderCrossCityWarpper orderCrossCityWarpper, Integer uid) throws Exception {
        /**
         * 1.出租车、专车、跨城有待支付的订单不能叫车
         * 2.小件物流有未完成的订单可以下跨城、专车、出租车
         * 3.出租车、专车、跨城有预约单可以下即时单
         * 1.下了即时单就不能下预约单和即时单
         * 2.下了预约单和再下一张即时单不能再下预约单
         */
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, null, 1, 7, 12);
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11);
        if(orderPrivateCars.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, null, 1, 7, 12);
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, 1, 1, 1, 2, 3, 4, 5, 6, 11);
        if(list.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(uid, 1, 2, 3, 4, 5, 7, 11);
        if(orderCrossCities1.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
@@ -1266,17 +543,19 @@
        orderCrossCity.setIsDelete(1);
        orderCrossCity.setRemark(orderCrossCityWarpper.getRemark());
        orderCrossCity.setIsReassign(1);
//        //调用高德创建轨迹
//        String s = gdFalconUtil.selectTerminal(driver.getPhone());
//        String track = gdFalconUtil.createTrack(s);
//        orderCrossCity.setTrackId(track);
        //调用高德创建轨迹
        String s = gdFalconUtil.selectTerminal(driver.getPhone());
        String track = gdFalconUtil.createTrack(s);
        orderCrossCity.setTrackId(track);
        if(orderCrossCity.getTravelMode() == 2){//包车
//            orderCrossCity.setSeatNumber(lineShiftDriver.getLaveSeatNumber());
//            orderCrossCity.setPeopleNumber(lineShiftDriver.getLaveSeat());
            orderCrossCity.setSeatNumber(lineShiftDriver.getLaveSeatNumber());
            orderCrossCity.setPeopleNumber(lineShiftDriver.getLaveSeat());
        }
        //调用移动的小号接口
        Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000));
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString());
        Region region = regionMapper.query(geocode.get("districtCode"));
        Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1)));
        if(String.valueOf(map.get("code")).equals("200")){
            orderCrossCity.setTelX(map.get("telX"));
            orderCrossCity.setBindId(map.get("bindId"));
@@ -1424,7 +703,6 @@
    @Override
    public ResultUtil<BaseWarpper> queryCancleAmount(Integer id) throws Exception {
        OrderCrossCity orderCrossCity = this.selectById(id);
        BaseWarpper baseWarpper = new BaseWarpper();
        if(null == orderCrossCity){
            return ResultUtil.error("获取数据失败,订单信息有误");
        }
@@ -1436,6 +714,7 @@
                amount += query.getMoney();
            }
        }
        BaseWarpper baseWarpper = new BaseWarpper();
        baseWarpper.setAmount(amount);
        return ResultUtil.success(baseWarpper);
    }
@@ -1455,13 +734,13 @@
        OrderCrossCity orderCrossCity = this.selectById(id);
        Integer uid = orderCrossCity.getUserId();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        ResultUtil resultUtil = ResultUtil.success();
        if(null == orderCrossCity){
            return ResultUtil.error("取消订单失败,订单信息有误", "");
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
        if(orderCrossCity.getState() != 12){
            return ResultUtil.error("取消订单失败,不合法的操作", "");
            return ResultUtil.error("取消订单失败,不合法的操作");
        }
        OrderCancel orderCancel = null;
        if(null == cancleId){
@@ -1472,58 +751,42 @@
        CancleOrder query = cancleOrderService.query(1, 3, orderCrossCity.getCompanyId());
        if(null != query){
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String out_trade_no = sdf.format(new Date()) + 3 + id;
            if(payType == 1){//微信支付
                String value = redisUtil.getValue("appletOpenId");
                String appletsOpenId = null;
                if(ToolUtil.isNotEmpty(value)){
                    JSONObject jsonObject = JSON.parseObject(value);
                    appletsOpenId = jsonObject.getString(uid.toString());
                }else{
                String appletsOpenId = "";
                String tradeType = "APP";
                if(type == 3){
                    appletsOpenId = userInfo.getAppletsOpenId();
                    tradeType = "JSAPI";
                    if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                        return ResultUtil.error("支付异常,请重新授权登录小程序");
                }
                orderCancel.setPayType(1);
                orderCancelService.updateById(orderCancel);
                String app = type == 1 ? "APP" : "JSAPI";
                resultUtil = payMoneyUtil.weixinpay("订单取消", "", id + "_3_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/wxCancelOrderTaxi", app, userInfo.getAppletsOpenId());
                }
                resultUtil = payMoneyUtil.weixinpay("订单取消", "", out_trade_no,  query.getMoney().toString(), callbackPath + "/base/wxCancelOrderTaxi", tradeType, appletsOpenId);
                if(resultUtil.getCode() == 200){
                paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, id, 3, 1, query.getMoney(), "", 1);//添加预支付数据
//                Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",3", 9, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/wxCancelOrderTaxi", "", type, appletsOpenId);
//                if(map.get("code").equals("200")){
//                    paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, id, 3, 1, query.getMoney(), map.get("order_id"), 1);//添加预支付数据
//                    resultUtil = ResultUtil.success(map.get("data"));
//                }else{
//                    resultUtil = ResultUtil.error(map.get("msg"), "");
//                }
                }
            }
            if(payType == 2){//支付宝支付
                orderCancel.setPayType(2);
                orderCancelService.updateById(orderCancel);
                resultUtil = payMoneyUtil.alipay("订单取消", "订单取消", "", id + "_3_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/aliCancelOrderTaxi");
                resultUtil = payMoneyUtil.alipay("取消订单支付", "取消订单", out_trade_no, query.getMoney().toString(), callbackPath + "/base/aliCancelOrderTaxi");
                if(resultUtil.getCode() == 200){
                paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, id, 3, 2, query.getMoney(), "", 1);//添加预支付数据
//                Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",3", 10, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/aliCancelOrderTaxi", "", type, null);
//                if(map.get("code").equals("200")){
//                    paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, id, 3, 2, query.getMoney(), map.get("order_id"), 1);//添加预支付数据
//                    resultUtil = ResultUtil.success(map.get("data"));
//                }else{
//                    resultUtil = ResultUtil.error(map.get("msg"), "");
//                }
                }
            }
            if(payType == 3){//余额支付
                if(userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()){
                    return ResultUtil.error("余额不足,无法完成支付", "");
                    return ResultUtil.error("余额不足,无法完成支付");
                }
                userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(query.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                //添加交易明细
                transactionDetailsService.saveData(uid, "跨城出行取消订单", query.getMoney(), 2, 1, 1, 3, id);
                transactionDetailsService.saveData(uid, "取消订单", query.getMoney(), 2, 1, 1, 3, id);
                userInfoService.updateById(userInfo);
                //解除小号绑定
                if(orderCrossCity.getBindId() != null){
                    chinaMobileUtil.midAxbUnBindSend(orderCrossCity.getBindId(), orderCrossCity.getTelX(), (System.currentTimeMillis() + 600000));
                    chinaMobileUtil.midAxbUnBindSend(orderCrossCity.getBindId());
                }
                orderCrossCity.setState(10);
@@ -1616,34 +879,15 @@
        }else{//浮动计费
            //计算公式:实际历程 * 基础单价 * (参考费用 / (参考里程 * 基础单价)) + (实际历程 - 参考里程) * 基础单价 * 优惠系数
            double num1 = Double.valueOf(jsonObject.getString("num1")).doubleValue();//参考价格
            double num1 = Double.valueOf(jsonObject.getString("num1")).doubleValue();//参考费用
            double num2 = Double.valueOf(jsonObject.getString("num2")).doubleValue();//参考里程
            double num3 = Double.valueOf(jsonObject.getString("num3")).doubleValue();//保底价
            double num4 = Double.valueOf(jsonObject.getString("num4")).doubleValue();//超出参考里程优惠系数
            double num5 = Double.valueOf(jsonObject.getString("num5")).doubleValue();//低于参考里程优惠系数
            double num6 = Double.valueOf(jsonObject.getString("num6")).doubleValue();//包车系数
            double num7 = Double.valueOf(jsonObject.getString("num7")).doubleValue();//五座系数
            double num8 = Double.valueOf(jsonObject.getString("num8")).doubleValue();//七座系数
            /**
             * 1、实际里程>=参考里程
             *    参考价+((实际里程-参考里程)*(参考价/参考里程)*超出参考里程优惠系数)
             *
             * 2、实际里程<参考里程
             *    参考价-(参考里程-实际路程)*(参考价/参考里程)*低于参考里程优惠系数
             */
            double unitPrice = 0d;
            if(distance1 > num2){//1
                unitPrice = num1 + ((distance1 - num2) * (num1 / num2) * num4);
            }
            if(distance1 < num2){//2
                unitPrice = num1 - ((num2 - distance1) * (num1 / num2) * num5);
            }
            if(distance1 == num2){
                unitPrice = num1;
            }
            double num3 = Double.valueOf(jsonObject.getString("num3")).doubleValue();//基础单价
            double num4 = Double.valueOf(jsonObject.getString("num4")).doubleValue();//优惠系数
            double num5 = Double.valueOf(jsonObject.getString("num5")).doubleValue();//包车系数
            double num6 = Double.valueOf(jsonObject.getString("num6")).doubleValue();//五座系数
            double num7 = Double.valueOf(jsonObject.getString("num7")).doubleValue();//七座系数
            if(travelMode == 1){//拼车
                double unitPrice = (distance1 * num3 * (num1 / (num2 * num3))) + ((distance1 - num2) * num3 * num4);
                String[] split = seatNumber.split(",");
                boolean b = false;
                for(String s : split){
@@ -1654,14 +898,15 @@
                }
                double price1 = 0D;
                if(b){
                    price1 = unitPrice * (totalSeat == 4 ? num7 : num8);
                    price1 = unitPrice * (totalSeat == 4 ? num6 : num7);
                    peopleNumber -= 1;
                }
                double price = (unitPrice * peopleNumber) + price1;
                map.put("price", new BigDecimal(num3 > price ? num3 : price).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                map.put("price", new BigDecimal(price).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            }else{
                double price = unitPrice * totalSeat * num6;
                map.put("price", new BigDecimal(num3 > price ? num3 : price).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                double unitPrice = (distance1 * num3 * (num1 / (num2 * num3))) + ((distance1 - num2) * num3 * num5);
                double price = unitPrice * totalSeat;
                map.put("price", new BigDecimal(price).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            }
        }
        return ResultUtil.success(map);
@@ -1793,11 +1038,11 @@
        PaymentRecord query = paymentRecordService.query(1, orderCrossCity.getUserId(), 1, Integer.valueOf(id), 3, type, 1);
        if(null != query){
            //添加交易明细
            transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城出行取消订单", query.getAmount(), 2, 1, 1, 3, query.getOrderId());
            transactionDetailsService.saveData(orderCrossCity.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 3, query.getOrderId());
            orderCrossCity.setState(10);
            //解除小号绑定
            if(orderCrossCity.getBindId() != null){
                chinaMobileUtil.midAxbUnBindSend(orderCrossCity.getBindId(), orderCrossCity.getTelX(), (System.currentTimeMillis() + 600000));
                chinaMobileUtil.midAxbUnBindSend(orderCrossCity.getBindId());
            }
            orderCrossCity.setBindId("");
            orderCrossCity.setTelX("");
@@ -1899,24 +1144,22 @@
        }
        OrderCrossCity orderCrossCity = this.selectById(id);
        if(null == uid){
            uid = orderCrossCity.getUserId();
        }
        Integer integer = null;
        if(null == orderCrossCity){
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
        if(orderCrossCity.getState() >= 5 && orderCrossCity.getState() != 7 && orderCrossCity.getState() != 11){
        if(orderCrossCity.getState() > 5 && orderCrossCity.getState() != 7 && orderCrossCity.getState() != 11){
            return ResultUtil.error("取消订单失败,不合法的操作");
        }
        //还原座位
        CancleOrder query1 = cancleOrderService.query(1, 3, orderCrossCity.getCompanyId());
        if (null != query1) {
            if((orderCrossCity.getSnatchOrderTime().getTime() + query1.getMinuteNum() * 60 * 1000) < new Date().getTime()  && query1.getMoney().compareTo(0D) > 0){//需要付费的情况
                integer = orderCancelService.saveData(id, 3, reason, remark, null, query1.getMoney(), 1, 1, uid);
                orderCrossCity.setState(12);
            }else{
                integer = orderCancelService.saveData(id, 3, reason, remark, null, null, 2, 1, uid);
                orderCrossCity.setState(10);
            }
            this.updateById(orderCrossCity);
            if(orderCrossCity.getState() != 7){//已经支付的情况推送给司机提醒
@@ -1953,45 +1196,41 @@
                userInfo.setBalance(userInfo.getBalance() + orderCrossCity.getPayMoney());
                userInfoService.updateById(userInfo);
                //添加交易明细
                transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城出行取消退款", orderCrossCity.getPayMoney(), 1, 1, 1, 3, id);
                transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城订单取消退款", orderCrossCity.getPayMoney(), 1, 1, 1, 3, id);
            }else{
                PaymentRecord query = paymentRecordService.query(1, orderCrossCity.getUserId(), 1, id, 3, orderCrossCity.getPayType(), 2);
                if(null == query){
                    query = paymentRecordService.query(1, orderCrossCity.getDriverId(), 2, id, 3, orderCrossCity.getPayType(), 2);
                    if(null == query){
                    return ResultUtil.error("订单还未进行支付");
                }
                }
                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
                String out_trade_no = sdf.format(new Date()) + 3 + query.getId();
                if(query.getPayType() == 1){//微信
                    Map<String, String> map = payMoneyUtil.wxRefund(query.getCode(), id + "_3", query.getAmount().toString(), query.getAmount().toString(), "/base/cancleOrderWXPay");
                    if(!"SUCCESS".equals(map.get("return_code"))){
                    Map<String, String> map = payMoneyUtil.wxRefund(query.getCode(), out_trade_no, query.getAmount().toString(), query.getAmount().toString(), callbackPath + "/base/wxRefundCallback");
                    String return_code = map.get("return_code");
                    if(!"SUCCESS".equals(return_code)){
                        return ResultUtil.error(map.get("return_msg"));
                    }
                }else{//支付宝
                }
                if(query.getPayType() == 2){//支付宝
                    Map<String, String> map = payMoneyUtil.aliRefund(query.getCode(), query.getAmount().toString());
                    if(!"10000".equals(map.get("code"))){
                    String code = map.get("code");
                    if(!"10000".equals(code)){
                        return ResultUtil.error(map.get("msg"));
                    }
                    query.setRefundState(2);
                    query.setRefundCode(map.get("trade_no"));
                    paymentRecordService.updateById(query);
                    //添加交易明细
                    transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城出行取消退款", query.getAmount(), 1, 1, 1, 3, id);
                    transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城订单取消退款", orderCrossCity.getPayMoney(), 1, 1, 1, 3, id);
                }
            }
            //添加负的收入明细
            List<Income> incomes = incomeService.selectList(new EntityWrapper<Income>().eq("type", 2).eq("incomeId", id).eq("orderType", 3));
            for(Income income : incomes){
                if(income.getUserType() == 2){//处理司机的收入
                    Driver driver = driverService.selectById(income.getObjectId());
                    driver.setBalance(driver.getBalance() - income.getMoney());
                    driver.setBusinessMoney(driver.getBusinessMoney() - income.getMoney());
                    driver.setLaveBusinessMoney(driver.getLaveBusinessMoney() - income.getMoney());
                    driverService.updateById(driver);
                }
                Income income1 = new Income();
                BeanUtils.copyProperties(income, income1);
                income1.setMoney(income.getMoney() * -1);
                income1.setId(null);
                income1.setInsertTime(new Date());
                incomeService.insert(income1);
            }
        }
        //添加消息
@@ -2030,8 +1269,8 @@
        if(null == distance){
            System.err.println("查询距离出错了");
        }else{
            d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
            t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
            d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
            t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
        }
        OrderServerWarpper orderServerWarpper = new OrderServerWarpper();
        orderServerWarpper.setOrderId(orderCrossCity.getId());
@@ -2053,8 +1292,8 @@
            if(null == distance){
                System.err.println("查询距离出错了");
            }else{
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
            }
            orderServerWarpper.setReservationMileage("0");
            orderServerWarpper.setReservationTime("0");
@@ -2287,7 +1526,7 @@
        orderPrivateCarMapper.insert(orderPrivateCar);
        //添加消息
        systemNoticeService.addSystemNotice(1, "您的快车订单已下单成功,我们正在为您指派司机,请稍后!", orderPrivateCar.getUserId(), 1);
        systemNoticeService.addSystemNotice(1, "您的专车订单已下单成功,我们正在为您指派司机,请稍后!", orderPrivateCar.getUserId(), 1);
        BaseWarpper baseWarpper = new BaseWarpper();
        baseWarpper.setId(orderPrivateCar.getId());
@@ -2487,77 +1726,5 @@
            size++;
        }
    }
    @Override
    public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        OrderCrossCity orderCrossCity = this.selectById(orderId);
        ResultUtil resultUtil = ResultUtil.success();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(3, uid, 1, orderId, 3, 1, money, "", 1);//添加预支付数据
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee");
            paymentRecordService.saveData(1, uid, 1, orderId, 3, 2, money, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < money){
                return ResultUtil.error("余额不足,无法完成支付", "");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId());
            userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "跨城出行-感谢费", money, 2, 1, 1, 3, orderId);
            userInfoService.updateById(userInfo);
            orderCrossCity.setThankYouFee(money);
            this.updateById(orderCrossCity);
            //添加已收入明细
            incomeService.saveData(2, orderCrossCity.getDriverId(), 6, orderCrossCity.getId(), 3, money);
            Driver driver = driverService.selectById(orderCrossCity.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成感谢费支付,谢谢使用!", uid, 1);
        }
        return resultUtil;
    }
    @Override
    public void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception {
        OrderCrossCity orderCrossCity = this.selectById(orderId);
        UserInfo userInfo = userInfoService.selectById(orderCrossCity.getUserId());
        PaymentRecord query = paymentRecordService.query(3, userInfo.getId(), 1, orderId, 3, payType, 1);
        query.setState(2);
        query.setCode(order_id);
        paymentRecordService.updateById(query);
        SysIntegral query1 = sysIntegralMapper.query(orderCrossCity.getCompanyId());
        userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分
        //添加交易明细
        transactionDetailsService.saveData(userInfo.getId(), "跨城出行-感谢费", query.getAmount(), 2, 1, 1, 3, orderId);
        userInfoService.updateById(userInfo);
        orderCrossCity.setThankYouFee(query.getAmount());
        this.updateById(orderCrossCity);
        //添加已收入明细
        incomeService.saveData(2, orderCrossCity.getDriverId(), 6, orderCrossCity.getId(), 3, query.getAmount());
        Driver driver = driverService.selectById(orderCrossCity.getDriverId());
        driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driverService.updateById(driver);
        systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : "支付宝") + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1);
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/SiteServiceImpl.java
@@ -34,12 +34,12 @@
     * @throws Exception
     */
    @Override
    public List<SiteWarpper> querySite(Integer startSiteId,Integer type) throws Exception {
    public List<SiteWarpper> querySite(Integer startSiteId) throws Exception {
        List<Map<String, Object>> sites = null;
        if(null == startSiteId){
            sites = siteMapper.querySite(null,type);
            sites = siteMapper.querySite(null);
        }else{
            sites = siteMapper.querySite(startSiteId,type);
            sites = siteMapper.querySite(startSiteId);
        }
        Set<String> set = new HashSet<>();
        for(Map<String, Object> site : sites) {
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/warpper/OrderCrossCityWarpper.java
@@ -1,7 +1,12 @@
package com.stylefeng.guns.modular.crossCity.warpper;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javafx.scene.chart.ValueAxis;
import java.util.Date;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/newlyAdded/NewlyAddedController.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java
@@ -156,49 +156,6 @@
        }
    }
    @ResponseBody
    @PostMapping("/api/orderLogistics/smallLogistics1")
    @ApiOperation(value = "1.0-小件物流下单操作(同城/跨城)", tags = {"用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "业务类型(4=同城小件物流,5=跨城小件物流)", name = "type", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "货物类型(1=普通货物,2=贵重货物)", name = "cargoType", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "货物数量", name = "cargoNumber", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "备注", name = "remark", required = false, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "下单点经度(103.23265,30.2312)", name = "placementLon", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "下单点纬度(103.23265,30.2312)", name = "placementLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "预约取货点经度(103.23265,30.2312)", name = "startLon", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "预约取货点纬度(103.23265,30.2312)", name = "startLat", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "预约取货点详细地址", name = "startAddress", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货人姓名", name = "recipient", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货人电话", name = "recipientPhone", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "收货详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "是否加急(1=否,2=是)", name = "urgent", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "加急费用", name = "tipMoney", required = true, paramType = "query", dataType = "double"),
            @ApiImplicitParam(value = "送达时间(2020-09-17 21:00:00)", name = "arriveTime", required = false, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "预约收货时间(2020-09-17 21:00:00)", name = "travelTime", required = true, paramType = "query", dataType = "string"),
            @ApiImplicitParam(value = "下单方式(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)", name = "orderSource", required = true, paramType = "query", dataType = "int"),
            @ApiImplicitParam(value = "用户上传的图片,多个以英文分号分隔", name = "userImg", required = false, paramType = "query", dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<BaseWarpper> smallLogistics1(String arriveTime, Integer type, Integer cargoType, Integer cargoNumber, String remark, String placementLon, String placementLat, String startLon, String startLat, String startAddress,
                                                  String recipient, String recipientPhone, String endAddress, Integer urgent, Double tipMoney, Date travelTime, Integer orderSource, String userImg, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderLogisticsService.smallLogistics1(arriveTime, type, cargoType, cargoNumber, remark, placementLon, placementLat, startLon, startLat, startAddress, recipient, recipientPhone, endAddress, urgent, tipMoney, travelTime, orderSource, userImg, uid);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    @ResponseBody
    @PostMapping("/api/orderLogistics/queryLogisticsNumber")
    @ApiOperation(value = "获取首页小件物流订单数量", tags = {"用户端-小件物流"}, notes = "")
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/dao/OrderLogisticsMapper.java
@@ -30,8 +30,8 @@
     * @param size
     * @return
     */
    List<Map<String, Object>> queryMyOrderList(@Param("uid") Integer uid, @Param("type") Integer type,
                                               @Param("pageNum") Integer pageNum, @Param("size") Integer size);
    List<Map<String, Object>> queryMyOrderList(@Param("uid") Integer uid, @Param("pageNum") Integer pageNum,
                                               @Param("size") Integer size);
@@ -57,8 +57,5 @@
                                                @Param("endTime") Date endTime, @Param("startMoney") Double startMoney,
                                                @Param("endMoney") Double endMoney, @Param("uid") Integer uid,
                                                @Param("orderType") Integer orderType);
    List<OrderLogistics> queryByState(@Param("uid") Integer uid, @Param("state") Integer... state);
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/dao/mapping/OrderLogisticsMapper.xml
@@ -13,8 +13,6 @@
        <result column="cargoType" property="cargoType"/>
        <result column="urgent" property="urgent"/>
        <result column="cargoNumber" property="cargoNumber"/>
        <result column="userImg" property="userImg"/>
        <result column="driverImg" property="driverImg"/>
        <result column="remark" property="remark"/>
        <result column="placementLon" property="placementLon"/>
        <result column="placementLat" property="placementLat"/>
@@ -41,7 +39,6 @@
        <result column="orderMoney" property="orderMoney"/>
        <result column="travelMoney" property="travelMoney"/>
        <result column="tipMoney" property="tipMoney"/>
        <result column="holidayFee" property="holidayFee"/>
        <result column="redPacketMoney" property="redPacketMoney"/>
        <result column="couponMoney" property="couponMoney"/>
        <result column="redPacketId" property="redPacketId"/>
@@ -49,12 +46,8 @@
        <result column="discount" property="discount"/>
        <result column="discountMoney" property="discountMoney"/>
        <result column="activityId" property="activityId"/>
        <result column="taxiCardId" property="taxiCardId"/>
        <result column="userTaxiCardId" property="userTaxiCardId"/>
        <result column="discountAmount" property="discountAmount"/>
        <result column="companyId" property="companyId"/>
        <result column="payMoney" property="payMoney"/>
        <result column="thankYouFee" property="thankYouFee"/>
        <result column="state" property="state"/>
        <result column="insertTime" property="insertTime"/>
        <result column="travelTime" property="travelTime"/>
@@ -163,14 +156,8 @@
        state as state,
        orderMoney as orderMoney,
        payMoney as payMoney,
        (select price from t_order_logistics_spread where orderLogisticsId = a.id) as differenceMoney,
        userImg,
        driverImg,
        thankYouFee,
        DATE_FORMAT(arriveTimeExpect, '%Y-%m-%d %H:%i') as arriveTimeExpect,
        IF(endServiceTime is not null,DATE_FORMAT(endServiceTime, '%Y-%m-%d %H:%i'),'') as endServiceTime,
        pickUpCode
        from t_order_logistics as a where userId = #{uid} and a.type = #{type} order by insertTime desc limit #{pageNum}, #{size}
        (select price from t_order_logistics_spread where orderLogisticsId = a.id) as differenceMoney
        from t_order_logistics as a where userId = #{uid} order by insertTime desc limit #{pageNum}, #{size}
    </select>
@@ -187,7 +174,7 @@
    <select id="queryInvoiceOrder" resultType="map">
        select
        id as orderId,
        id as id,
        DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i') as time,
        startAddress as startAddress,
        endAddress as endAddress,
@@ -198,39 +185,22 @@
        `type` as orderType
        from t_order_logistics where state in (9)
        <if test="type == 1">
            and (invoiceId is null or invoiceId in (select id from t_invoice where state = 3))
            and invoiceId is null and invoiceId in (select id from t_invoice where state != 2)
        </if>
        <if test="type == 2">
            and invoiceId in (select id from t_invoice where state = 2)
        </if>
        <if test="null != startTime">
            and travelTime >= #{startTime}
        <if test="null != startTime and null != endTime">
            and travelTime between #{startTime} and #{endTime}
        </if>
        <if test="null != startMoney">
            and payMoney >= #{startMoney}
        </if>
        <if test="null != endTime">
            and  #{endTime}>= travelTime
        </if>
        <if test="null != endMoney">
            and   #{endMoney}>=payMoney
        <if test="null != startMoney and null != endMoney">
            and payMoney between #{startMoney} and #{endMoney}
        </if>
        <if test="null !=uid">
            and userId = #{uid}
        </if>
        <if test="null != orderType">
            and `type` = #{orderType}
        </if>
    </select>
    <select id="queryByState" resultType="com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics">
        select * from t_order_logistics where isDelete = 1 and userId = #{uid}
        <if test="null != state">
            and state in
            <foreach collection="state" item="item" index="index" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
    </select>
</mapper>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/model/OrderLogistics.java
@@ -58,12 +58,6 @@
     */
    @TableField("cargoNumber")
    private Integer cargoNumber;
    //用户上传的图片,多个英文分号分隔
    @TableField("userImg")
    private String userImg;
    //司机上传的图片,多个英文分号分隔
    @TableField("driverImg")
    private String driverImg;
    /**
     * 备注信息
     */
@@ -194,9 +188,6 @@
     */
    @TableField("tipMoney")
    private Double tipMoney;
    //节假费
    @TableField("holidayFee")
    private Double holidayFee;
    /**
     * 红包抵扣金额
     */
@@ -233,21 +224,6 @@
    @TableField("activityId")
    private Integer activityId;
    /**
     * 打折卡id
     */
    @TableField("taxiCardId")
    private Integer taxiCardId;
    /**
     * 打车卡记录id
     */
    @TableField("userTaxiCardId")
    private Integer userTaxiCardId;
    /**
     * 优惠金额
     */
    @TableField("discountAmount")
    private Double discountAmount;
    /**
     * 公司id
     */
    @TableField("companyId")
@@ -257,9 +233,6 @@
     */
    @TableField("payMoney")
    private Double payMoney;
    //感谢费
    @TableField("thankYouFee")
    private Double thankYouFee;
    /**
     * 状态(1=待接单,2=待出发,3=待到达预约地点,4=待取货,5=送货中,6=已送达,7=待支付,8=需补差价,9=已取货,10=已取消,11=已支付差价)
     */
@@ -350,19 +323,6 @@
     */
    @TableField("reassignNotice")
    private Integer reassignNotice;
    /**
     * 需要送达时间(用户端)
     */
    @TableField("arriveTimeExpect")
    private Date arriveTimeExpect;
    public Date getArriveTimeExpect() {
        return arriveTimeExpect;
    }
    public void setArriveTimeExpect(Date arriveTimeExpect) {
        this.arriveTimeExpect = arriveTimeExpect;
    }
    public Integer getId() {
        return id;
@@ -434,22 +394,6 @@
    public void setCargoNumber(Integer cargoNumber) {
        this.cargoNumber = cargoNumber;
    }
    public String getUserImg() {
        return userImg;
    }
    public void setUserImg(String userImg) {
        this.userImg = userImg;
    }
    public String getDriverImg() {
        return driverImg;
    }
    public void setDriverImg(String driverImg) {
        this.driverImg = driverImg;
    }
    public String getRemark() {
@@ -652,14 +596,6 @@
        this.tipMoney = tipMoney;
    }
    public Double getHolidayFee() {
        return holidayFee;
    }
    public void setHolidayFee(Double holidayFee) {
        this.holidayFee = holidayFee;
    }
    public Double getRedPacketMoney() {
        return redPacketMoney;
    }
@@ -692,30 +628,6 @@
        this.couponId = couponId;
    }
    public Integer getTaxiCardId() {
        return taxiCardId;
    }
    public void setTaxiCardId(Integer taxiCardId) {
        this.taxiCardId = taxiCardId;
    }
    public Integer getUserTaxiCardId() {
        return userTaxiCardId;
    }
    public void setUserTaxiCardId(Integer userTaxiCardId) {
        this.userTaxiCardId = userTaxiCardId;
    }
    public Double getDiscountAmount() {
        return discountAmount;
    }
    public void setDiscountAmount(Double discountAmount) {
        this.discountAmount = discountAmount;
    }
    public Integer getCompanyId() {
        return companyId;
    }
@@ -730,14 +642,6 @@
    public void setPayMoney(Double payMoney) {
        this.payMoney = payMoney;
    }
    public Double getThankYouFee() {
        return thankYouFee;
    }
    public void setThankYouFee(Double thankYouFee) {
        this.thankYouFee = thankYouFee;
    }
    public Integer getState() {
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/IOrderLogisticsService.java
@@ -4,8 +4,6 @@
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.system.model.Region;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.CouponsListVo;
import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
@@ -70,10 +68,6 @@
                   String recipient, String recipientPhone, String endAddress, Integer urgent, Double tipMoney, Date travelTime, Integer orderSource, Integer uid) throws Exception;
    ResultUtil smallLogistics1(String arriveTime, Integer type, Integer cargoType, Integer cargoNumber, String remark, String placementLon, String placementLat, String startLon, String startLat, String startAddress,
                              String recipient, String recipientPhone, String endAddress, Integer urgent, Double tipMoney, Date travelTime, Integer orderSource, String userImg, Integer uid) throws Exception;
    /**
@@ -84,17 +78,6 @@
     * @throws Exception
     */
    ResultUtil payLogisticsOrder(Integer payType, Integer orderId, Integer type)throws Exception;
    /**
     * 订单完成支付订单操作
     * @param payType
     * @param orderId
     * @return
     * @throws Exception
     */
    ResultUtil payLogisticsOrder1(Integer payType, Integer orderId, Integer objectId, Integer objectType, Integer type)throws Exception;
    /**
@@ -148,7 +131,7 @@
     * @return
     * @throws Exception
     */
    List<Map<String, Object>> queryMyOrderList(Integer uid, Integer type, Integer pageNum, Integer size) throws Exception;
    List<Map<String, Object>> queryMyOrderList(Integer uid, Integer pageNum, Integer size) throws Exception;
@@ -212,58 +195,4 @@
     * @throws Exception
     */
    Map<String, Object> queryBalance(Integer orderId, Integer uid) throws Exception;
    /**
     * 获取用户余额和优惠数据
     * @param uid
     * @return
     * @throws Exception
     */
    PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception;
    /**
     * 根据状态获取用户订单数据
     * @param uid
     * @param state
     * @return
     * @throws Exception
     */
    List<OrderLogistics> queryByState(Integer uid, Integer...state) throws Exception;
    /**
     * 获取优惠券和打车卡列表
     * @param orderId
     * @param uid
     * @param pageNum
     * @param size
     * @return
     * @throws Exception
     */
    List<CouponsListVo> queryCouponList(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception;
    /**
     * 支付感谢费
     * @param uid
     * @param orderId
     * @param money
     * @param payType
     * @return
     * @throws Exception
     */
    ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception;
    /**
     * 感谢费支付回调处理
     * @param orderId
     * @param order_id
     * @throws Exception
     */
    void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception;
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -1,22 +1,15 @@
package com.stylefeng.guns.modular.smallLogistics.server.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.smallLogistics.dao.OrderLogisticsMapper;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService;
import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.dao.RegionMapper;
import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper;
import com.stylefeng.guns.modular.system.dao.SysIntegralMapper;
@@ -25,12 +18,7 @@
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.system.warpper.CouponsListVo;
import com.stylefeng.guns.modular.system.warpper.PreferentialDataVo;
import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
import org.springframework.beans.BeanUtils;
@@ -40,10 +28,8 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
@@ -117,36 +103,6 @@
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Resource
    private OrderPrivateCarMapper orderPrivateCarMapper;
    @Resource
    private OrderCrossCityMapper orderCrossCityMapper;
    @Resource
    private OrderTaxiMapper orderTaxiMapper;
    @Autowired
    private IOpenCityService openCityService;
    @Autowired
    private ITaxiCardPaymentService taxiCardPaymentService;
    @Autowired
    private IUserCouponRecordService userCouponRecordService;
    @Autowired
    private ITaxiCardService taxiCardService;
    @Autowired
    private IUserUserService userUserService;
    @Autowired
    private IUserTaxiCardService userTaxiCardService;
    @Autowired
    private IRegionService regionService;
    @Value("${callbackPath}")
    private String callbackPath;
@@ -272,24 +228,6 @@
    @Override
    public ResultUtil smallLogistics(Integer type, Integer cargoType, Integer cargoNumber, String remark, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String recipient,
                                     String recipientPhone, String endAddress, Integer urgent, Double tipMoney, Date travelTime, Integer orderSource, Integer uid) throws Exception {
        /**
         * 1.出租车、专车、跨城有待支付的订单不能叫车
         * 2.小件物流有未完成的订单可以下跨城、专车、出租车
         * 3.出租车、专车、跨城有预约单可以下即时单
         */
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, null, 1, 7, 12);
        if(orderPrivateCars.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, null, 1, 7, 12);
        if(list.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(uid, 7, 12);
        if(orderCrossCities1.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        startAddress = startAddress.replaceAll("& #40;", "(");
        startAddress = startAddress.replaceAll("& #41;", ")");
        endAddress = endAddress.replaceAll("& #40;", "(");
@@ -357,106 +295,6 @@
        return ResultUtil.success(baseWarpper);
    }
    @Override
    public ResultUtil smallLogistics1(String arriveTime, Integer type, Integer cargoType, Integer cargoNumber, String remark, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String recipient, String recipientPhone, String endAddress, Integer urgent, Double tipMoney, Date travelTime, Integer orderSource, String userImg, Integer uid) throws Exception {
        /**
         * 1.出租车、专车、跨城有待支付的订单不能叫车
         * 2.小件物流有未完成的订单可以下跨城、专车、出租车
         * 3.出租车、专车、跨城有预约单可以下即时单
         */
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, null, 1, 7, 12);
        if(orderPrivateCars.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, null, 1, 7, 12);
        if(list.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(uid, 7, 12);
        if(orderCrossCities1.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        startAddress = startAddress.replaceAll("& #40;", "(");
        startAddress = startAddress.replaceAll("& #41;", ")");
        endAddress = endAddress.replaceAll("& #40;", "(");
        endAddress = endAddress.replaceAll("& #41;", ")");
        OrderLogistics orderLogistics = new OrderLogistics();
        Company query = companyCityService.query(placementLon, placementLat);
        if(null == query){
            return ResultUtil.error("该地点暂无企业服务");
        }
        orderLogistics.setCompanyId(query.getId());
        orderLogistics.setType(type);
        orderLogistics.setUserId(uid);
        orderLogistics.setOrderNum(this.getOrderNum());
        orderLogistics.setCargoType(cargoType);
        orderLogistics.setCargoNumber(cargoNumber);
        orderLogistics.setUserImg(userImg);
        orderLogistics.setRemark(remark);
        orderLogistics.setPlacementLon(Double.valueOf(placementLon));
        orderLogistics.setPlacementLat(Double.valueOf(placementLat));
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(placementLon, placementLat);
        orderLogistics.setPlacementAddress(geocode.get("address"));
        orderLogistics.setStartLon(Double.valueOf(startLon));
        orderLogistics.setStartLat(Double.valueOf(startLat));
        orderLogistics.setStartAddress(startAddress);
        Map<String, Object> geocoding = gdMapGeocodingUtil.geocoding(endAddress);
        if(Integer.valueOf(geocoding.get("status").toString()) != 0){
            return ResultUtil.error("收货地址有误,无法查询具体地址信息");
        }
        if(((List<String>)geocoding.get("data")).size() == 0){
            return ResultUtil.error("无法查询具体地址信息");
        }
        String location = ((List<String>)geocoding.get("data")).get(0);
        orderLogistics.setEndLon(Double.valueOf(location.split(",")[0]));
        orderLogistics.setEndLat(Double.valueOf(location.split(",")[1]));
        orderLogistics.setEndAddress(endAddress);
        orderLogistics.setUrgent(urgent);
        orderLogistics.setRecipient(recipient);
        orderLogistics.setRecipientPhone(recipientPhone);
        orderLogistics.setMileage(0D);
        orderLogistics.setIsReassign(1);
        orderLogistics.setReassignNotice(0);
        ResultUtil<Map<String, Double>> price = this.getPrice(type, String.valueOf(startLon), String.valueOf(startLat), location.split(",")[0], location.split(",")[1]);
        if(price.getCode() != 200){
            return price;
        }
        Map<String, Double> data = price.getData();
        orderLogistics.setOrderMoney((cargoType == 1 ? data.get("ordinary") : data.get("precious")) + tipMoney);
        orderLogistics.setTravelMoney(cargoType == 1 ? data.get("ordinary") : data.get("precious"));
        if(type == 5){
            orderLogistics.setOrderMoney(((cargoType == 1 ? data.get("ordinary") : data.get("precious")) * cargoNumber) + tipMoney);
            orderLogistics.setTravelMoney((cargoType == 1 ? data.get("ordinary") : data.get("precious")) * cargoNumber);
        }
        orderLogistics.setTipMoney(tipMoney);
        orderLogistics.setState(7);//待支付
        orderLogistics.setInsertTime(new Date());
        orderLogistics.setTravelTime(travelTime);
        orderLogistics.setOrderSource(orderSource);
        orderLogistics.setIsDelete(1);
        ///   新增预计送达时间
        if (ToolUtil.isNotEmpty(arriveTime)){
            orderLogistics.setArriveTimeExpect(com.stylefeng.guns.core.util.DateUtil.parseTime(arriveTime));
        }
        ///   生成取件码
        String random = "";
        for(int i = 0; i < 6; i++){
            random += Double.valueOf(Math.random() * 10).intValue();
        }
        orderLogistics.setPickUpCode(random);
        this.insert(orderLogistics);
        //添加消息
        systemNoticeService.addSystemNotice(1, "您的"+ (type == 4 ? "同城" : "跨城") + "小件物流订单已下单成功,我们正在为您指派司机,请稍后!", orderLogistics.getUserId(), 1);
        BaseWarpper baseWarpper = new BaseWarpper();
        baseWarpper.setId(orderLogistics.getId());
        return ResultUtil.success(baseWarpper);
    }
    /**
     * 获取价格
@@ -540,12 +378,11 @@
                    List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//用专车的推单配置
                    for(int i = 1; i <= querys.size(); i++){
                        PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0);
                        //获取匹配的司机
                        List<Driver> list = driverService.queryIdleDriver1(orderLogistics.getType(), orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
                        //获取空闲司机
                        List<Driver> list = driverService.queryIdleDriver(orderLogistics.getType(), null, orderLogistics.getStartLon(), orderLogistics.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
                        if(list.size() > 0){
                            double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数
                            int lastIndex = Double.valueOf(list.size() * driverProportion).intValue();//计算占比转成整数(下标截取)
                            lastIndex = lastIndex == 0 ? list.size() : lastIndex;
                            list = list.subList(0, lastIndex);//获取空闲司机中占比数据
                            for(Driver driver : list){//开始进行推送
                                boolean bo = false;
@@ -567,6 +404,7 @@
                            break;
                        }
                        if(i == querys.size() && state == 1){
//                            pushUtil.pushEndPush(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType());
                            orderIds.remove(orderLogistics.getId());
                        }
                    }
@@ -592,25 +430,40 @@
    public ResultUtil payLogisticsOrder(Integer payType, Integer orderId, Integer type) throws Exception {
        OrderLogistics orderLogistics = this.selectById(orderId);
        if(orderLogistics.getState() != 7){
            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
            return ResultUtil.error("订单已完成支付,不允许重复支付");
        }
        Integer uid = orderLogistics.getUserId();
        Double orderMoney = orderLogistics.getOrderMoney();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        ResultUtil resultUtil = ResultUtil.success();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String out_trade_no = sdf.format(new Date()) + orderLogistics.getType() + orderLogistics.getId();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("小件物流下单支付", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), callbackPath + "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId());
            String appletsOpenId = "";
            String tradeType = "APP";
            if(type == 3){
                appletsOpenId = userInfo.getAppletsOpenId();
                tradeType = "JSAPI";
                if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                    return ResultUtil.error("支付异常,请重新授权登录小程序");
                }
            }
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", out_trade_no, orderMoney.toString(), callbackPath + "/base/wxPayOrderTaxi", tradeType, appletsOpenId);
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 1, orderMoney, "", 1);//添加预支付数据
        }
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("小件物流下单支付", "小件物流下单支付", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi");
            resultUtil = payMoneyUtil.alipay("订单完成支付", "支付订单", out_trade_no, orderMoney.toString(), callbackPath + "/base/aliPayOrderTaxi");
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 2, orderMoney, "", 1);//添加预支付数据
            }
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
                return ResultUtil.error("余额不足,无法完成支付");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
@@ -619,7 +472,7 @@
            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, (orderLogistics.getType() == 4 ? "同城" : "跨城") + "小件物流下单", orderMoney, 2, 1, 1, 4, orderId);
            transactionDetailsService.saveData(uid, "小件物流下单支付", orderMoney, 2, 1, 1, 4, orderId);
            userInfoService.updateById(userInfo);
            orderLogistics.setState(1);//小件物流先支付后司机抢单
@@ -643,135 +496,8 @@
        return resultUtil;
    }
    @Override
    public ResultUtil payLogisticsOrder1(Integer payType, Integer orderId, Integer objectId, Integer objectType, Integer type) throws Exception {
        OrderLogistics orderLogistics = this.selectById(orderId);
        if(orderLogistics.getState() != 7){
            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
        }
        Integer uid = orderLogistics.getUserId();
        Double orderMoney = orderLogistics.getOrderMoney();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        orderLogistics.setCouponMoney(0D);//初始化历史数据
        orderLogistics.setCouponId(null);
        //计算优惠券
        UserCouponRecord userCouponRecord = null;
        if(null != objectId && objectType == 1){
            userCouponRecord = userCouponRecordService.selectById(objectId);
            if(userCouponRecord.getCompanyId() != orderLogistics.getCompanyId()){
                return ResultUtil.error("优惠券不能用于此订单", "");
            }
            if(userCouponRecord.getState() == 2){
                return ResultUtil.error("优惠券已使用", "");
            }
            if(userCouponRecord.getState() == 3){
                return ResultUtil.error("优惠券已过期", "");
            }
            if(userCouponRecord.getCouponUseType() != 0){
                return ResultUtil.error("优惠券不能用于此类型订单", "");
            }
            if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){
                return ResultUtil.error("优惠券不能用于此订单", "");
            }
            orderMoney = orderMoney - userCouponRecord.getMoney();
            orderLogistics.setCouponMoney(userCouponRecord.getMoney());
            orderLogistics.setCouponId(objectId);
        }
        //打车卡
        UserTaxiCard userTaxiCard = null;
        if(null != objectId && objectType == 2){
            userTaxiCard = userTaxiCardService.selectById(objectId);
            TaxiCard taxiCard = taxiCardService.selectById(userTaxiCard.getTaxiCardId());
            if(taxiCard.getTaxiCardType() == 1 && userTaxiCard.getCompanyId() != orderLogistics.getCompanyId()){
                return ResultUtil.error("打车卡不能用于此订单", "");
            }
            if(System.currentTimeMillis() > userTaxiCard.getEndTime().getTime()){
                return ResultUtil.error("打车卡已过期", "");
            }
            List<Integer> integers = JSON.parseObject(userTaxiCard.getContent()).getJSONArray("businessTypes").toJavaList(Integer.class);
            if(!integers.contains(orderLogistics.getType())){
                return ResultUtil.error("打车卡不能用于此类型订单", "");
            }
            Double yh = 0D;
            JSONObject jsonObject = JSON.parseObject(userTaxiCard.getContent());
            if(userTaxiCard.getType() == 5){//{"businessTypes":[4,5],"discount":5}
                Double discount = jsonObject.getDouble("discount");
                yh = new BigDecimal(orderLogistics.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
            }
            orderMoney = orderMoney - yh;
            orderLogistics.setTaxiCardId(userTaxiCard.getTaxiCardId());
            orderLogistics.setUserTaxiCardId(objectId);
            orderLogistics.setDiscountAmount(yh);
        }
        orderMoney = orderMoney < 0 ? 0 : orderMoney;
        if(payType == 1){//微信支付
            if(orderMoney == 0){
                return ResultUtil.error("请使用余额支付");
            }
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("小件物流下单支付", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), callbackPath + "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 1, orderMoney, "", 1);//添加预支付数据
        }
        if(payType == 2){//支付宝支付
            if(orderMoney == 0){
                return ResultUtil.error("请使用余额支付");
            }
            resultUtil = payMoneyUtil.alipay("小件物流下单支付", "小件物流下单支付", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi");
            paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 2, orderMoney, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId());
            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, (orderLogistics.getType() == 4 ? "同城" : "跨城") + "小件物流下单", orderMoney, 2, 1, 1, 4, orderId);
            userInfoService.updateById(userInfo);
            orderLogistics.setState(1);//小件物流先支付后司机抢单
            orderLogistics.setPayType(3);
            orderLogistics.setPayMoney(orderMoney);
            //处理优惠券和红包
            if(null != userCouponRecord){
                userCouponRecord.setState(2);
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            //处理打车卡
            if(null != userTaxiCard){
                userTaxiCardService.updateById(userTaxiCard);
            }
            //添加已收入明细(司机端完成后添加)
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
                @Override
                public void run() {
                    pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0);
                }
            }).start();
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成小件物流订单支付,谢谢使用!", uid, 1);
            this.pushOrder(orderLogistics);//推单
        }
        this.updateById(orderLogistics);
        return resultUtil;
    }
    /**
     * 补差价支付
@@ -788,20 +514,35 @@
        OrderLogisticsSpread orderLogisticsSpread = orderLogisticsSpreadService.selectOne(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderId));
        Double orderMoney = orderLogisticsSpread.getPrice();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        ResultUtil resultUtil = ResultUtil.success();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String out_trade_no = sdf.format(new Date()) + orderLogistics.getType() + orderId;
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("小件物流补差价", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), callbackPath + "/base/wxPayOrderLogisticsSpread", app, userInfo.getAppletsOpenId());
            String appletsOpenId = "";
            String tradeType = "APP";
            if(type == 3){
                appletsOpenId = userInfo.getAppletsOpenId();
                tradeType = "JSAPI";
                if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                    return ResultUtil.error("支付异常,请重新授权登录小程序");
                }
            }
            resultUtil = payMoneyUtil.weixinpay("小件物流补差价", "", out_trade_no,  orderMoney.toString(), callbackPath + "/base/wxPayOrderLogisticsSpread", tradeType, appletsOpenId);
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 1, orderMoney, "", 1);//添加预支付数据
        }
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("小件物流补差价", "小件物流补差价", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderLogisticsSpread");
            resultUtil = payMoneyUtil.alipay("小件物流补差价", "支付差价", out_trade_no, orderMoney.toString(), callbackPath + "/base/aliPayOrderLogisticsSpread");
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 2, orderMoney, "", 1);//添加预支付数据
            }
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
                return ResultUtil.error("余额不足,无法完成支付");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
@@ -810,7 +551,7 @@
            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, (orderLogistics.getType() == 4 ? "同城" : "跨城") + "小件物流补差价", orderMoney, 2, 1, 1, 4, orderId);
            transactionDetailsService.saveData(uid, "小件物流补差价", orderMoney, 2, 1, 1, 4, orderId);
            userInfoService.updateById(userInfo);
            orderLogistics.setState(12);//已支付差价
@@ -824,32 +565,6 @@
            orderLogisticsSpread.setPayTime(new Date());
            orderLogisticsSpread.setPayType(3);
            orderLogisticsSpreadService.updateById(orderLogisticsSpread);
            //添加已收入明细
            Company company = companyService.selectById(orderLogistics.getCompanyId());
            Double speMoney =  orderLogistics.getType() == 4 ? company.getSameLogisticsMoney() : company.getCrossLogisticsMoney();
            BigDecimal d = null;
            BigDecimal c = null;
            if(company.getIsSpeFixedOrProportional() == 2){//固定
                d = new BigDecimal(speMoney.compareTo(orderMoney) > 0 ? orderMoney : speMoney);
                c = new BigDecimal(orderMoney).subtract(d);
            }
            if(company.getIsSpeFixedOrProportional() == 1){//比例
                d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                c = new BigDecimal(orderMoney).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType()));
            income.setMoney(income.getMoney() + d.doubleValue());
            incomeService.updateById(income);
            income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getDriverId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType()));
            income.setMoney(income.getMoney() + c.doubleValue());
            incomeService.updateById(income);
            Driver driver = driverService.selectById(orderLogistics.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
@@ -875,7 +590,7 @@
        PaymentRecord query = paymentRecordService.query(1, orderLogistics.getUserId(), 1, Integer.valueOf(id), orderLogistics.getType(), type, 1);
        if(null != query){
            //添加交易明细
            transactionDetailsService.saveData(orderLogistics.getUserId(), (orderLogistics.getType() == 4 ? "同城" : "跨城") + "小件物流下单", query.getAmount(), 2, 1, 1, orderLogistics.getType(), query.getOrderId());
            transactionDetailsService.saveData(orderLogistics.getUserId(), "完成订单", query.getAmount(), 2, 1, 1, orderLogistics.getType(), query.getOrderId());
            orderLogistics.setState(1);//先支付后抢单
            orderLogistics.setPayType(type);
            orderLogistics.setPayMoney(query.getAmount());
@@ -886,26 +601,9 @@
            userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分
            userInfoService.updateById(userInfo);
            //处理优惠券和红包
            if(null != orderLogistics.getCouponId()){
                UserCouponRecord userCouponRecord = userCouponRecordService.selectById(orderLogistics.getCouponId());
                userCouponRecord.setState(2);
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            //处理打车卡
            if(null != orderLogistics.getUserTaxiCardId()){
                UserTaxiCard userTaxiCard = userTaxiCardService.selectById(orderLogistics.getUserTaxiCardId());
            }
            query.setState(2);
            query.setCode(order_id);
            paymentRecordService.updateById(query);
            //添加已收入明细(司机端完成后添加)
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
@@ -933,7 +631,7 @@
        PaymentRecord query = paymentRecordService.query(1, orderLogistics.getUserId(), 1, Integer.valueOf(id), orderLogistics.getType(), type, 1);
        if(null != query){
            //添加交易明细
            transactionDetailsService.saveData(orderLogistics.getUserId(), (orderLogistics.getType() == 4 ? "同城" : "跨城") + "小件物流补差价", query.getAmount(), 2, 1, 1, 4, query.getOrderId());
            transactionDetailsService.saveData(orderLogistics.getUserId(), "小件物流补差价", query.getAmount(), 2, 1, 1, 4, query.getOrderId());
            orderLogistics.setState(4);//待取货
            orderLogistics.setOrderMoney(orderLogistics.getOrderMoney() + query.getAmount());
@@ -954,31 +652,6 @@
            query.setCode(order_id);
            paymentRecordService.updateById(query);
            //添加已收入明细
            Company company = companyService.selectById(orderLogistics.getCompanyId());
            Double speMoney =  orderLogistics.getType() == 4 ? company.getSameLogisticsMoney() : company.getCrossLogisticsMoney();
            BigDecimal d = null;
            BigDecimal c = null;
            if(company.getIsSpeFixedOrProportional() == 2){//固定
                d = new BigDecimal(speMoney);
                c = new BigDecimal(query.getAmount()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            if(company.getIsSpeFixedOrProportional() == 1){//比例
                d = new BigDecimal(query.getAmount()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                c = new BigDecimal(query.getAmount()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType()));
            income.setMoney(income.getMoney() + d.doubleValue());
            incomeService.updateById(income);
            income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getDriverId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType()));
            income.setMoney(income.getMoney() + c.doubleValue());
            incomeService.updateById(income);
            Driver driver = driverService.selectById(orderLogistics.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
                @Override
@@ -987,8 +660,6 @@
                    pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0);
                }
            }).start();
            systemNoticeService.addSystemNotice(1, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功完成小件物流订单差价支付,谢谢使用!", orderLogistics.getUserId(), 1);
            this.updateById(orderLogistics);
        }else{
@@ -1021,9 +692,9 @@
     * @throws Exception
     */
    @Override
    public List<Map<String, Object>> queryMyOrderList(Integer uid, Integer type, Integer pageNum, Integer size) throws Exception {
    public List<Map<String, Object>> queryMyOrderList(Integer uid, Integer pageNum, Integer size) throws Exception {
        pageNum = (pageNum - 1) * size;
        List<Map<String, Object>> maps = orderLogisticsMapper.queryMyOrderList(uid, type, pageNum, size);
        List<Map<String, Object>> maps = orderLogisticsMapper.queryMyOrderList(uid, pageNum, size);
        return maps;
    }
@@ -1060,11 +731,14 @@
        }
        OrderLogistics orderLogistics = this.selectById(id);
        if(null == uid){
            uid = orderLogistics.getUserId();
        }
        Integer integer = null;
        if(null == orderLogistics){
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
        if(orderLogistics.getState() >= 5 && orderLogistics.getState() != 7 && orderLogistics.getState() != 8  && orderLogistics.getState() != 11){
        if(orderLogistics.getState() > 5 && orderLogistics.getState() != 7 && orderLogistics.getState() != 8  && orderLogistics.getState() != 11){
            return ResultUtil.error("取消订单失败,不合法的操作");
        }
@@ -1079,74 +753,49 @@
            return ResultUtil.success(map);
        }
        //回退支付金额
        if(null != orderLogistics.getPayType() && null != orderLogistics.getPayMoney()) {//已支付
            if(orderLogistics.getPayType() == 3){//余额支付
                UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId());
                userInfo.setBalance(userInfo.getBalance() + orderLogistics.getPayMoney());
                userInfoService.updateById(userInfo);
                //添加交易明细
                transactionDetailsService.saveData(orderLogistics.getUserId(), "小件物流取消退款", orderLogistics.getPayMoney(), 1, 1, 1, orderLogistics.getType(), orderLogistics.getId());
            }else{
                //调用回退接口
                PaymentRecord query = paymentRecordService.query(1, orderLogistics.getUserId(), 1, orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getPayType(), 2);
                boolean b = false;
                if(null == query){
                    return ResultUtil.error("订单还未进行支付");
                }
                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
                String out_trade_no = sdf.format(new Date()) + orderLogistics.getType() + query.getId();
                if(query.getPayType() == 1){//微信
                    Map<String, String> map = payMoneyUtil.wxRefund(query.getCode(), orderLogistics.getId() + "_" + orderLogistics.getType(), query.getAmount().toString(), query.getAmount().toString(), "/base/cancleOrderWXPay");
                    if(!"SUCCESS".equals(map.get("return_code"))){
                    Map<String, String> map = payMoneyUtil.wxRefund(query.getCode(), out_trade_no, query.getAmount().toString(), query.getAmount().toString(), callbackPath + "/base/wxRefundCallback");
                    String return_code = map.get("return_code");
                    if(!"SUCCESS".equals(return_code)){
                        return ResultUtil.error(map.get("return_msg"));
                    }
                }else{//支付宝
                }
                if(query.getPayType() == 2){//支付宝
                    Map<String, String> map = payMoneyUtil.aliRefund(query.getCode(), query.getAmount().toString());
                    if(!"10000".equals(map.get("code"))){
                    String code = map.get("code");
                    if(!"10000".equals(code)){
                        return ResultUtil.error(map.get("msg"));
                    }
                }
//                Map<String, Object> merrefund = icbcPayUtil.merrefund(query.getCode(), "", query.getAmount(), orderLogistics.getId() + "_" + orderLogistics.getType(), orderLogistics.getOrderNum());
//                if (Integer.valueOf(merrefund.get("code").toString()) == 0) {
//                    Map<String, Object> refundqry = icbcPayUtil.refundqry("", query.getCode(), orderLogistics.getOrderNum());
//                    if (Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 0) {//成功
//                        b = true;
//                    }
//                    if (Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 1) {//失败
//                        return ResultUtil.error("订单取消失败(退款不成功)");
//                    }
//                    if (Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 2) {//未知
//                        return ResultUtil.error("退款返回未知异常");
//
//                    }
//                }
                if(b){
                }
            }
                    query.setRefundState(2);
                    query.setRefundCode(map.get("trade_no"));
                    paymentRecordService.updateById(query);
            //添加交易明细
            transactionDetailsService.saveData(orderLogistics.getUserId(), (orderLogistics.getType() == 4 ? "同城" : "跨城") + "小件物流取消退款", orderLogistics.getPayMoney(), 1, 1, 1, 4, orderLogistics.getId());
                    transactionDetailsService.saveData(orderLogistics.getUserId(), "小件物流取消退款", orderLogistics.getPayMoney(), 1, 1, 1, orderLogistics.getType(), orderLogistics.getId());
                }
            }
            integer = orderCancelService.saveData(orderLogistics.getId(), orderLogistics.getType(), reason, remark, null, null, 2, 1, orderLogistics.getUserId());
            orderLogistics.setState(10);
            this.updateById(orderLogistics);
            //添加负的收入明细
            List<Income> incomes = incomeService.selectList(new EntityWrapper<Income>().eq("type", 2).eq("incomeId", id).eq("orderType", orderLogistics.getType()));
            for(Income income : incomes){
                if(income.getUserType() == 2){//处理司机的收入
                    Driver driver = driverService.selectById(income.getObjectId());
                    driver.setBalance(driver.getBalance() - income.getMoney());
                    driver.setBusinessMoney(driver.getBusinessMoney() - income.getMoney());
                    driver.setLaveBusinessMoney(driver.getLaveBusinessMoney() - income.getMoney());
                    driverService.updateById(driver);
                }
                Income income1 = new Income();
                BeanUtils.copyProperties(income, income1);
                income1.setMoney(income.getMoney() * -1);
                income1.setId(null);
                income1.setInsertTime(new Date());
                incomeService.insert(income1);
            }
        }
        if(null != orderLogistics.getDriverId()){
@@ -1219,331 +868,9 @@
    }
    @Override
    public PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        PreferentialDataVo preferentialDataVo = new PreferentialDataVo();
        preferentialDataVo.setBalance(userInfo.getBalance());
        OrderLogistics orderLogistics = this.selectById(orderId);
        //获取优惠券中最优数据
        List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("companyId", orderLogistics.getCompanyId()).eq("state", 1).in("couponUseType", Arrays.asList(0)).eq("userId", uid).where("now() < expirationTime"));
        Integer id = null;
        Double price = 0d;
        Integer type = 0;
        for (UserCouponRecord userCouponRecord : list){
            if(userCouponRecord.getCouponType() == 1){//抵扣券
                if(price.compareTo(userCouponRecord.getMoney()) < 0){
                    price = userCouponRecord.getMoney();
                    id = userCouponRecord.getId();
                    type = 1;
                }
            }else{//满减券
                if(orderLogistics.getOrderMoney().compareTo(userCouponRecord.getFullMoney()) >= 0 && price.compareTo(userCouponRecord.getMoney()) < 0){
                    price = userCouponRecord.getMoney();
                    id = userCouponRecord.getId();
                    type = 1;
                }
            }
        }
        //获取打车卡中最优数
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString());
        CompanyCity companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderLogistics.getCompanyId()).eq("areaCode", geocode.get("districtCode")).eq("state", 1));
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderLogistics.getCompanyId()).eq("cityCode", geocode.get("cityCode")).eq("state", 1));
        }
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderLogistics.getCompanyId()).eq("provinceCode", geocode.get("provinceCode")).eq("state", 1));
        }
        List<UserTaxiCard> userTaxiCards = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().like("companyCityId", "%" + companyCity.getId() + "%")
                .in("type", Arrays.asList(5)).eq("userId", uid).where("now() between startTime and endTime"));
        //全国卡
        List<TaxiCard> taxiCards = taxiCardService.selectList(new EntityWrapper<TaxiCard>().eq("taxiCardType", 2).in("type", Arrays.asList(1, 2, 3, 4)).eq("state", 1));
        if(taxiCards.size() > 0) {
            List<UserTaxiCard> userTaxiCards2 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                    .in("type", Arrays.asList(5)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
            userTaxiCards.addAll(userTaxiCards2);
        }
        Map<String, Object> map = getOptimalTaxiCards(orderLogistics, price, id, type, userTaxiCards);
        price = Double.valueOf(map.get("price").toString());
        id = null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : null;
        type = Integer.valueOf(map.get("type").toString());
        //亲密账户
        List<UserTaxiCard> userTaxiCards_ = new ArrayList<>();
        List<UserUser> bindUserId = userUserService.selectList(new EntityWrapper<UserUser>().eq("bindUserId", uid));
        CompanyCity finalCompanyCity = companyCity;
        bindUserId.forEach(userUser -> {
            List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().in("type", Arrays.asList(5))
                    .like("companyCityId", "%" + finalCompanyCity.getId() + "%").eq("userId", userUser.getUserId()).where("now() between startTime and endTime"));
            userTaxiCards_.addAll(userTaxiCards1);
            //全国卡
            if(taxiCards.size() > 0) {
                List<UserTaxiCard> userTaxiCards2 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", userUser.getUserId())
                        .in("type", Arrays.asList(5)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
                userTaxiCards_.addAll(userTaxiCards2);
            }
        });
        map = getOptimalTaxiCards(orderLogistics, price, id, type, userTaxiCards_);
        price = Double.valueOf(map.get("price").toString());
        id = null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : null;
        type = Integer.valueOf(map.get("type").toString());
        preferentialDataVo.setObjectId(id);
        preferentialDataVo.setDiscountAmount(price);
        preferentialDataVo.setType(type);
        return preferentialDataVo;
    }
    public Map<String, Object> getOptimalTaxiCards(OrderLogistics orderLogistics, Double price, Integer id, Integer type, List<UserTaxiCard> userTaxiCards) throws Exception{
        Map<String, Object> map = new HashMap<>();
        for(UserTaxiCard t : userTaxiCards){
            if(t.getType() != 5){//物流打折卡{"businessTypes":[4,5],"discount":5}
                continue;
            }
            JSONObject jsonObject = JSON.parseObject(t.getContent());
            List<Integer> integers = jsonObject.getJSONArray("businessTypes").toJavaList(Integer.class);
            if(!integers.contains(orderLogistics.getType())){
                continue;
            }
            Double discount = jsonObject.getDouble("discount");
            double v = new BigDecimal(orderLogistics.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
            if(price.compareTo(v) < 0){
                price = v;
                id = t.getId();
                type = 2;
            }
        }
        map.put("price", price);
        map.put("id", id);
        map.put("type", type);
        return map;
    }
    @Override
    public List<OrderLogistics> queryByState(Integer uid, Integer... state) throws Exception {
        return this.baseMapper.queryByState(uid, state);
    }
    @Override
    public List<CouponsListVo> queryCouponList(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception {
        pageNum = (pageNum - 1) * size;
        OrderLogistics orderLogistics = this.selectById(orderId);
        List<CouponsListVo> rows = new ArrayList<>();
        List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("companyId", orderLogistics.getCompanyId())
                .eq("state", 1).in("couponUseType", Arrays.asList(0)).eq("userId", uid).where("expirationTime >= now()"));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        for (UserCouponRecord userCouponRecord : list){
            if(userCouponRecord.getCouponType() == 2){//满减券
                if(orderLogistics.getOrderMoney().compareTo(userCouponRecord.getFullMoney()) < 0){
                    continue;
                }
            }
            CouponsListVo couponsListVo = new CouponsListVo();
            couponsListVo.setId(userCouponRecord.getId());
            couponsListVo.setDataType(1);
            couponsListVo.setMoney(userCouponRecord.getMoney());
            couponsListVo.setUserType(userCouponRecord.getCouponUseType());
            couponsListVo.setTime(sdf.format(userCouponRecord.getExpirationTime()));
            couponsListVo.setType(userCouponRecord.getCouponType());
            couponsListVo.setFullMoney(userCouponRecord.getFullMoney());
            couponsListVo.setState(userCouponRecord.getState());
            Company company = companyService.selectById(userCouponRecord.getCompanyId());
            couponsListVo.setCompany(company.getName());
            rows.add(couponsListVo);
        }
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString());
        CompanyCity companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderLogistics.getCompanyId()).eq("areaCode", geocode.get("districtCode")).eq("state", 1));
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderLogistics.getCompanyId()).eq("cityCode", geocode.get("cityCode")).eq("state", 1));
        }
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderLogistics.getCompanyId()).eq("provinceCode", geocode.get("provinceCode")).eq("state", 1));
        }
        List<UserTaxiCard> userTaxiCards = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                .in("type", Arrays.asList(5)).like("companyCityId", "%" + companyCity.getId() + "%").where("now() between startTime and endTime"));
        //全国卡
        List<TaxiCard> taxiCards = taxiCardService.selectList(new EntityWrapper<TaxiCard>().eq("taxiCardType", 2).in("type", Arrays.asList(5)).eq("state", 1));
        if(taxiCards.size() > 0) {
            List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                    .in("type", Arrays.asList(5)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
            userTaxiCards.addAll(userTaxiCards1);
        }
        //亲密账户
        List<UserUser> bindUserId = userUserService.selectList(new EntityWrapper<UserUser>().eq("bindUserId", uid));
        CompanyCity finalCompanyCity = companyCity;
        bindUserId.forEach(userUser -> {
            List<UserTaxiCard> taxiCardPayments1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().in("type", Arrays.asList(5))
                    .like("companyCityId", "%" + finalCompanyCity.getId() + "%").eq("userId", userUser.getUserId()).where("now() between startTime and endTime"));
            userTaxiCards.addAll(taxiCardPayments1);
            //全国卡
            if(taxiCards.size() > 0) {
                List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", userUser.getUserId())
                        .in("type", Arrays.asList(5)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
                userTaxiCards.addAll(userTaxiCards1);
            }
        });
        for(UserTaxiCard t : userTaxiCards){
            try {
                CouponsListVo couponsListVo = new CouponsListVo();
                couponsListVo.setId(t.getId());
                couponsListVo.setDataType(2);
                couponsListVo.setUserType(1);
                couponsListVo.setTime(sdf.format(t.getEndTime()));
                couponsListVo.setState(1);
                couponsListVo.setTaxiCardType(t.getType());
                Company company = companyService.selectById(t.getCompanyId());
                couponsListVo.setCompany(company.getName());
                couponsListVo.setName(taxiCardService.selectById(t.getTaxiCardId()).getName());
                JSONObject jsonObject = JSON.parseObject(t.getContent());
                JSONArray businessTypes = jsonObject.getJSONArray("businessTypes");
                if(!businessTypes.toJavaList(Integer.class).contains(orderLogistics.getType())){
                    continue;
                }
                if(t.getType() == 5){//{"businessTypes":[4,5],"discount":5}
                    couponsListVo.setMoney(jsonObject.getDouble("discount"));
                    couponsListVo.setType(1);
                }
                String str = "";
                TaxiCard taxiCard = taxiCardService.selectById(t.getTaxiCardId());
                if(taxiCard.getTaxiCardType() == 1){
                    String[] split = taxiCard.getCompanyCityId().split(";");
                    for(String c : split){
                        CompanyCity companyCity1 = companyCityService.selectById(c);
                        if(ToolUtil.isNotEmpty(companyCity1.getAreaCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getAreaCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                        if(ToolUtil.isNotEmpty(companyCity1.getCityCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getCityCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                        if(ToolUtil.isNotEmpty(companyCity1.getProvinceCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getProvinceCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                    }
                }else{
                    str = "全国;";
                }
                couponsListVo.setCity(str.substring(0, str.length() - 1));
                rows.add(couponsListVo);
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        Collections.sort(rows, new Comparator<CouponsListVo>() {
            public int compare(CouponsListVo s1, CouponsListVo s2) {
                return Integer.compare(s1.getId(), s2.getId());
            }
        });
        if(rows.size() >= (pageNum + 1) * size){
            rows = rows.subList(pageNum, pageNum + size);
        }else if(pageNum < rows.size() && rows.size() < (pageNum + 1) * size){
            rows = rows.subList(pageNum, rows.size());
        }else{
            rows = new ArrayList<>();
        }
        return rows;
    }
    public synchronized String getOrderNum() throws Exception{
        int size = this.selectCount(null);
        return "LOGISTICS" + String.valueOf(1000000 + size + 1).substring(1);
    }
    @Override
    public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        OrderLogistics orderLogistics = this.selectById(orderId);
        ResultUtil resultUtil = ResultUtil.success();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(3, uid, 1, orderId, orderLogistics.getType(), 1, money, "", 1);//添加预支付数据
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee");
            paymentRecordService.saveData(1, uid, 1, orderId, orderLogistics.getType(), 2, money, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < money){
                return ResultUtil.error("余额不足,无法完成支付", "");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId());
            userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, (orderLogistics.getType() == 4 ? "同城小件物流-" : "跨城小件物流-") + "感谢费", money, 2, 1, 1, orderLogistics.getType(), orderId);
            userInfoService.updateById(userInfo);
            orderLogistics.setThankYouFee(money);
            this.updateById(orderLogistics);
            //添加已收入明细
            incomeService.saveData(2, orderLogistics.getDriverId(), 6, orderLogistics.getId(), orderLogistics.getType(), money);
            Driver driver = driverService.selectById(orderLogistics.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成感谢费支付,谢谢使用!", uid, 1);
        }
        return resultUtil;
    }
    @Override
    public void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception {
        OrderLogistics orderLogistics = this.selectById(orderId);
        UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId());
        PaymentRecord query = paymentRecordService.query(3, userInfo.getId(), 1, orderId, orderLogistics.getType(), payType, 1);
        query.setState(2);
        query.setCode(order_id);
        paymentRecordService.updateById(query);
        SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId());
        userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分
        //添加交易明细
        transactionDetailsService.saveData(userInfo.getId(), (orderLogistics.getType() == 4 ? "同城小件物流-" : "跨城小件物流-") + "感谢费", query.getAmount(), 2, 1, 1, orderLogistics.getType(), orderId);
        userInfoService.updateById(userInfo);
        orderLogistics.setThankYouFee(query.getAmount());
        this.updateById(orderLogistics);
        //添加已收入明细
        incomeService.saveData(2, orderLogistics.getDriverId(), 6, orderLogistics.getId(), orderLogistics.getType(), query.getAmount());
        Driver driver = driverService.selectById(orderLogistics.getDriverId());
        driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driverService.updateById(driver);
        systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : "支付宝") + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1);
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/controller/OrderPrivateCarController.java
@@ -5,6 +5,7 @@
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.sun.org.apache.regexp.internal.RE;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -73,23 +74,18 @@
            @ApiImplicitParam(value = "司机id(扫码下单必传)", name = "driverId", required = false, dataType = "int"),
            @ApiImplicitParam(value = "乘客姓名(代下单必传)", name = "passengers", required = false, dataType = "string"),
            @ApiImplicitParam(value = "乘客电话(代下单必传)", name = "passengersPhone", required = false, dataType = "string"),
            @ApiImplicitParam(value = "乘车人数", name = "peopleNum", required = true, dataType = "int"),
            @ApiImplicitParam(value = "乘车类型(1=独享,2=一口价,3=拼车)", name = "rideType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<BaseWarpper> saveOrderPrivateCar(Integer serverCarModelId, Date travelTime, Integer orderType, Integer substitute, String placementLon, String placementLat, String startLon, String startLat,
                                                       String startAddress, String endLon, String endLat, String endAddress, String passengers, String passengersPhone, Integer orderSource, Integer driverId,
                                                       Integer type, HttpServletRequest request,Integer peopleNum,Integer rideType){
                                                       Integer type, HttpServletRequest request){
        try {
            Integer uid = userInfoService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            return orderPrivateCarService.saveOrderPrivateCar(serverCarModelId, travelTime, orderType, substitute, placementLon, placementLat,
                    startLon, startLat, startAddress, endLon, endLat, endAddress, passengers, passengersPhone, orderSource, driverId, type, uid,peopleNum,rideType);
                    startLon, startLat, startAddress, endLon, endLat, endAddress, passengers, passengersPhone, orderSource, driverId, type, uid, null);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/dao/OrderPrivateCarMapper.java
@@ -87,15 +87,4 @@
    List<OrderPrivateCar> queryByDriver(@Param("driverId") Integer driverId, @Param("state") Integer...state);
    /**
     * 获取订单详情页(服务中的页面)
     * @param orderId
     * @return
     */
    List<Map<String, Object>> queryOrderInfo2(@Param("orderId") Integer orderId,
                                             @Param("state") Integer state,
                                             @Param("lon") String lon,
                                             @Param("lat") String lat);
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/dao/mapping/OrderPrivateCarMapper.xml
@@ -46,7 +46,6 @@
        <result column="longDistanceMoney" property="longDistanceMoney"/>
        <result column="parkMoney" property="parkMoney"/>
        <result column="roadTollMoney" property="roadTollMoney"/>
        <result column="holidayFee" property="holidayFee"/>
        <result column="redPacketMoney" property="redPacketMoney"/>
        <result column="couponMoney" property="couponMoney"/>
        <result column="redPacketId" property="redPacketId"/>
@@ -54,12 +53,8 @@
        <result column="discount" property="discount"/>
        <result column="discountMoney" property="discountMoney"/>
        <result column="activityId" property="activityId"/>
        <result column="taxiCardId" property="taxiCardId"/>
        <result column="userTaxiCardId" property="userTaxiCardId"/>
        <result column="discountAmount" property="discountAmount"/>
        <result column="companyId" property="companyId"/>
        <result column="payMoney" property="payMoney"/>
        <result column="thankYouFee" property="thankYouFee"/>
        <result column="substitute" property="substitute"/>
        <result column="passengers" property="passengers"/>
        <result column="passengersPhone" property="passengersPhone"/>
@@ -340,7 +335,6 @@
    <select id="queryMyOrderList" resultType="map">
        select
        id as orderId,
        rideType as rideType,
        DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as orderTime,
        DATE_FORMAT(travelTime, '%m月%d日 %H:%i') as time,
        startAddress as startAddress,
@@ -348,15 +342,14 @@
        driverId as driverId,
        (1) as orderType,
        state as state,
        oldState as oldState,
        thankYouFee
        oldState as oldState
        from t_order_private_car where userId = #{uid} order by insertTime desc limit #{pageNum}, #{size}
    </select>
    <select id="queryInvoiceOrder" resultType="map">
        select
        id as orderId,
        id as id,
        DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i') as time,
        startAddress as startAddress,
        endAddress as endAddress,
@@ -367,22 +360,16 @@
        (1) as orderType
        from t_order_private_car where state in (8, 9)
        <if test="type == 1">
            and (invoiceId is null or invoiceId in (select id from t_invoice where state = 3))
            and invoiceId is null and invoiceId in (select id from t_invoice where state != 2)
        </if>
        <if test="type == 2">
            and invoiceId in (select id from t_invoice where state = 2)
        </if>
        <if test="null != startTime">
            and travelTime >= #{startTime}
        <if test="null != startTime and null != endTime">
            and travelTime between #{startTime} and #{endTime}
        </if>
        <if test="null != startMoney">
            and payMoney >= #{startMoney}
        </if>
        <if test="null != endTime">
            and  #{endTime}>= travelTime
        </if>
        <if test="null != endMoney">
            and   #{endMoney}>=payMoney
        <if test="null != startMoney and null != endMoney">
            and payMoney between #{startMoney} and #{endMoney}
        </if>
        <if test="null !=uid">
            and userId = #{uid}
@@ -426,12 +413,9 @@
        a.payMoney as payMoney,
        a.reassignNotice as reassignNotice,
        a.oldState as oldState,
        a.rideType as rideType,
        a.pid as pid,
        b.headImgUrl as driverAvatar,
        b.`name` as driverName,
        c.carLicensePlate as licensePlate,
        a.peopleNum peopleNumber,a.driverCancle,
        c.carColor as carColor,
        CONCAT(f.`name`, d.`name`) as brand,
        ((select sum(fraction) from t_order_evaluate where driverId = a.driverId) / (select count(id) from t_order_evaluate where driverId = a.driverId)) as score,
@@ -449,13 +433,7 @@
        h.userType as cancelUserType,
        h.money as cancelMoney,
        h.reason as cancelReason,
        h.remark as cancelRemark,
        a.holidayFee,
        a.spellSuccess,
        a.waitRule,
        a.chargeRule,
        a.chargeRules,
        a.discountAmount as taxiCardMoney
        h.remark as cancelRemark
        from t_order_private_car a
        left join t_driver b on (a.driverId = b.id)
        left join t_car c on (a.carId = c.id)
@@ -564,85 +542,5 @@
        <foreach collection="state" item="item" index="index" open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>
    <select id="queryOrderInfo2" resultType="map">
        select
        a.id as orderId,
        a.userId as userId,
        a.driverId as driverId,
        a.state as orderState,
        DATE_FORMAT(a.travelTime, '%m月%d日 %H:%i') as travelTime_,
        DATE_FORMAT(a.travelTime, '%Y-%m-%d %H:%i:%s') as travelTime,
        <choose>
            <when test="state==4">
                DATE_FORMAT(a.boardingTime, '%Y-%m-%d %H:%i:%s') as arriveTime,
            </when>
            <otherwise>
                DATE_FORMAT(a.getoffTime, '%Y-%m-%d %H:%i:%s') as arriveTime,
            </otherwise>
        </choose>
        a.startAddress as startAddress,
        a.endAddress as endAddress,
        a.startLon as startLon,
        a.startLat as startLat,
        a.endLon as endLon,
        a.endLat as endLat,
        a.orderMoney as orderMoney,
        a.payManner as payManner,
        a.thankYouFee,
        a.trackId as trackId,
        b.nickName as nickName,
        a.passengersPhone as phone,
        a.orderType as reservation,
        a.telX as telX,
        a.peopleNum as peopleNumber,
        a.bindId as bindId,
        (
        (select count(id) from t_order_private_car where userId = b.id and state in (8, 9)) +
        (select count(id) from t_order_taxi where userId = b.id and state in (8, 9)) +
        (select count(id) from t_order_cross_city where userId = b.id and state in (8, 9))
        ) as historyNum,
        (select phone from t_phone where companyId = a.companyId and `type` = 1) as emergencyCall,
        c.reason as cancelReason,
        c.remark as cancelRemark,
        c.money as cancelPayMoney,
        if(c.userType = 1, '用户取消', '平台取消') as cancelUser,
        (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign
        from t_order_private_car a
        left join t_user b on (a.userId = b.id)
        left join t_order_cancel c on (a.id = c.orderId and c.orderType = 1 and c.state = 2)
        where (a.id = #{orderId} or a.pid=#{orderId}) and a.state!=10
        <if test="state==4">
            order by a.insertTime
        </if>
        <if test="state==5">
            and 5>=a.state
            order by ROUND(
            6378.138 * 2 * ASIN(
            SQRT(
            POW(
            SIN((
            #{lat} * PI()/ 180-endLat * PI()/ 180
            )/ 2
            ),
            2
            )+ COS( #{lat} * PI()/ 180 )* COS( endLat * PI()/ 180 )* POW(
            SIN((
            #{lon} * PI()/ 180-endLon * PI()/ 180
            )/ 2
            ),
            2
            )))* 1000
            ) asc
        </if>
        <if test="state!=4 and state!=5">
            and a.state!=2
            and a.state!=3
            and a.state!=4
            and a.state!=5
            order by a.endServiceTime
        </if>
    </select>
</mapper>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/model/OrderPrivateCar.java
@@ -223,9 +223,6 @@
     */
    @TableField("roadTollMoney")
    private Double roadTollMoney;
    //节假费
    @TableField("holidayFee")
    private Double holidayFee;
    /**
     * 红包抵扣金额
     */
@@ -262,21 +259,6 @@
    @TableField("activityId")
    private Integer activityId;
    /**
     * 打折卡id
     */
    @TableField("taxiCardId")
    private Integer taxiCardId;
    /**
     * 打车卡记录id
     */
    @TableField("userTaxiCardId")
    private Integer userTaxiCardId;
    /**
     * 优惠金额
     */
    @TableField("discountAmount")
    private Double discountAmount;
    /**
     * 公司id
     */
    @TableField("companyId")
@@ -286,9 +268,6 @@
     */
    @TableField("payMoney")
    private Double payMoney;
    //感谢费
    @TableField("thankYouFee")
    private Double thankYouFee;
    /**
     * 是否是代下单(0:否,1:是)
     */
@@ -350,7 +329,7 @@
    @TableField("orderType")
    private Integer orderType;
    /**
     * 订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单)
     * 订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单,6:智慧屏)
     */
    @TableField("orderSource")
    private Integer orderSource;
@@ -399,85 +378,6 @@
     */
    @TableField("bindId")
    private String bindId;
    /**
     * 乘车人数
     */
    @TableField("peopleNum")
    private Integer peopleNum;
    /**
     * 乘车类型(1=独享,2=一口价,3=拼车)
     */
    @TableField("rideType")
    private Integer rideType;
    @TableField("pid")
    private Integer pid;
    private Integer totalPeopleNum;
    /**
     * 预估里程(米)
     */
    private Double estimateMileage;
    private Double estimateTime;
    private Integer spellSuccess;
    public Integer getSpellSuccess() {
        return spellSuccess;
    }
    public void setSpellSuccess(Integer spellSuccess) {
        this.spellSuccess = spellSuccess;
    }
    public Double getEstimateTime() {
        return estimateTime;
    }
    public void setEstimateTime(Double estimateTime) {
        this.estimateTime = estimateTime;
    }
    public Double getEstimateMileage() {
        return estimateMileage;
    }
    public void setEstimateMileage(Double estimateMileage) {
        this.estimateMileage = estimateMileage;
    }
    public Integer getTotalPeopleNum() {
        return totalPeopleNum;
    }
    public void setTotalPeopleNum(Integer totalPeopleNum) {
        this.totalPeopleNum = totalPeopleNum;
    }
    public Integer getPid() {
        return pid;
    }
    public void setPid(Integer pid) {
        this.pid = pid;
    }
    public Integer getPeopleNum() {
        return peopleNum;
    }
    public void setPeopleNum(Integer peopleNum) {
        this.peopleNum = peopleNum;
    }
    public Integer getRideType() {
        return rideType;
    }
    public void setRideType(Integer rideType) {
        this.rideType = rideType;
    }
    public Integer getId() {
        return id;
@@ -815,14 +715,6 @@
        this.roadTollMoney = roadTollMoney;
    }
    public Double getHolidayFee() {
        return holidayFee;
    }
    public void setHolidayFee(Double holidayFee) {
        this.holidayFee = holidayFee;
    }
    public Double getRedPacketMoney() {
        return redPacketMoney;
    }
@@ -879,30 +771,6 @@
        this.activityId = activityId;
    }
    public Integer getTaxiCardId() {
        return taxiCardId;
    }
    public void setTaxiCardId(Integer taxiCardId) {
        this.taxiCardId = taxiCardId;
    }
    public Integer getUserTaxiCardId() {
        return userTaxiCardId;
    }
    public void setUserTaxiCardId(Integer userTaxiCardId) {
        this.userTaxiCardId = userTaxiCardId;
    }
    public Double getDiscountAmount() {
        return discountAmount;
    }
    public void setDiscountAmount(Double discountAmount) {
        this.discountAmount = discountAmount;
    }
    public Integer getCompanyId() {
        return companyId;
    }
@@ -917,14 +785,6 @@
    public void setPayMoney(Double payMoney) {
        this.payMoney = payMoney;
    }
    public Double getThankYouFee() {
        return thankYouFee;
    }
    public void setThankYouFee(Double thankYouFee) {
        this.thankYouFee = thankYouFee;
    }
    public Integer getSubstitute() {
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/IOrderPrivateCarService.java
@@ -3,9 +3,11 @@
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.*;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.system.warpper.EndPushWarpper;
import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper;
import com.stylefeng.guns.modular.system.warpper.SmartScreenOrderVo;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@@ -30,11 +32,13 @@
     * @param endAddress        终点详细地址
     * @param name              乘客姓名
     * @param phone             乘客电话
     * @param deviceCode        设备号
     * @return
     * @throws Exception
     */
    ResultUtil<BaseWarpper> saveOrderPrivateCar(Integer serverCarModelId, Date travelTime, Integer reservation, Integer instead, String placementLon, String placementLat,
                                                String startLon, String startLat, String startAddress, String endLon, String endLat, String endAddress, String name, String phone, Integer orderSource, Integer driverId, Integer type, Integer uid,Integer peopleNum,Integer rideType) throws Exception;
                                                String startLon, String startLat, String startAddress, String endLon, String endLat, String endAddress, String name, String phone,
                                                Integer orderSource, Integer driverId, Integer type, Integer uid, String deviceCode) throws Exception;
    /**
@@ -95,15 +99,6 @@
    Map<String, Object> queryBalance(Integer orderId, Integer uid) throws Exception;
    /**
     * 获取用户余额和优惠数据
     * @param uid
     * @return
     * @throws Exception
     */
    PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception;
    /**
     * 获取优惠券列表
@@ -112,18 +107,6 @@
     * @throws Exception
     */
    List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception;
    /**
     * 获取优惠券和打车卡列表
     * @param orderId
     * @param uid
     * @param pageNum
     * @param size
     * @return
     * @throws Exception
     */
    List<CouponsListVo> queryCouponList(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception;
@@ -136,16 +119,6 @@
     * @throws Exception
     */
    ResultUtil payPrivateCarOrder(Integer payType, Integer orderId, Integer couponId, Integer type)throws Exception;
    /**
     * 订单完成支付订单操作
     * @param payType
     * @param orderId
     * @return
     * @throws Exception
     */
    ResultUtil payPrivateCarOrder1(Integer payType, Integer orderId, Integer objectId, Integer objectType, Integer type)throws Exception;
@@ -282,32 +255,24 @@
    /**
     * 支付感谢费
     * @param uid
     * @param orderId
     * @param money
     * @param payType
     * 智慧屏一键叫车
     * @param phone
     * @param placementLon
     * @param placementLat
     * @param startLon
     * @param startLat
     * @param startAddress
     * @return
     * @throws Exception
     */
    ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception;
    ResultUtil<BaseWarpper> directCallCar(String phone, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String deviceCode) throws Exception;
    /**
     * 感谢费支付回调处理
     * @param orderId
     * @param order_id
     * 获取智慧屏待上车订单列表
     * @param deviceCode
     * @return
     * @throws Exception
     */
    void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception;
    /**
     * 获取订单详情页(服务中的页面)
     * @param orderId
     * @return
     */
    List<Map<String, Object>> queryOrderInfo2(@Param("orderId") Integer orderId,
                                              @Param("state") Integer state,
                                              @Param("lon") String lon,
                                              @Param("lat") String lat);
    List<SmartScreenOrderVo> querySmartScreenOrder(String deviceCode, String lonLat) throws Exception;
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -1,16 +1,16 @@
package com.stylefeng.guns.modular.specialTrain.server.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.domain.CarModel;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.shiro.ShiroKit;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.crossCity.server.impl.OrderCrossCityServiceImpl;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
@@ -18,13 +18,18 @@
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.warpper.*;
import com.stylefeng.guns.modular.system.util.LiuZhouBank.PayUtil;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.system.warpper.EndPushWarpper;
import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper;
import com.stylefeng.guns.modular.system.warpper.SmartScreenOrderVo;
import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
import com.stylefeng.guns.modular.taxi.warpper.OrderTaxiWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
@@ -37,10 +42,11 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
@@ -69,6 +75,9 @@
    @Resource
    private RegionMapper regionMapper;
    @Resource
    private UserInfoMapper userInfoMapper;
    @Autowired
    private DateUtil dateUtil;
@@ -154,30 +163,14 @@
    @Autowired
    private IOrderTaxiService orderTaxiService;
    @Resource
    private ServerCarModelMapper serverCarModelMapper;
    @Resource
    private CarMapper carMapper;
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    @Autowired
    private IOrderLogisticsService orderLogisticsService;
    @Autowired
    private ITaxiCardPaymentService taxiCardPaymentService;
    @Autowired
    private ITaxiCardService taxiCardService;
    @Autowired
    private IOpenCityService openCityService;
    @Autowired
    private IUserUserService userUserService;
    @Autowired
    private IUserTaxiCardService userTaxiCardService;
    @Autowired
    private IRegionService regionService;
    public static List<Integer> orderIds = new ArrayList<>();
@@ -186,9 +179,6 @@
    @Value("${pushMinistryOfTransport}")
    private boolean pushMinistryOfTransport;
    @Autowired
    private ITbSpellOrderRuleService spellOrderRuleService;
@@ -211,7 +201,7 @@
     */
    @Override
    public synchronized ResultUtil<BaseWarpper> saveOrderPrivateCar(Integer serverCarModelId, Date travelTime, Integer reservation, Integer instead, String placementLon, String placementLat, String startLon, String startLat,
                                          String startAddress, String endLon, String endLat, String endAddress, String name, String phone, Integer orderSource, Integer driverId, Integer type, Integer uid,Integer peopleNum,Integer rideType) throws Exception {
                                          String startAddress, String endLon, String endLat, String endAddress, String name, String phone, Integer orderSource, Integer driverId, Integer type, Integer uid, String deviceCode) throws Exception {
        //如果出行时间大于当前10分钟则默认为预约单
        if(travelTime.getTime() > (System.currentTimeMillis() + 600000)){
@@ -219,35 +209,26 @@
        }
        /**
         * 1.出租车、专车、跨城有待支付的订单不能叫车
         * 2.小件物流有未完成的订单可以下跨城、专车、出租车
         * 3.出租车、专车、跨城有预约单可以下即时单
         * 1.下了即时单就不能下预约单和即时单
         * 2.下了预约单和再下一张即时单不能再下预约单
         */
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, null, 1, 7, 12);
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11);
        if(orderPrivateCars.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, null, 1, 7, 12);
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, 1, 1, 1, 2, 3, 4, 5, 6, 11);
        if(list.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(uid, 7, 12);
        if(orderCrossCities1.size() > 0){
        orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 2, 1, 1, 2, 3, 4, 5, 6, 7, 11);
        if(orderPrivateCars.size() > 0 && reservation == 2){
            return ResultUtil.error("有未完成的订单");
        }
        if(reservation == 1){
            orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12);
            if(orderPrivateCars.size() > 0){
        list = orderTaxiMapper.queryByState_(uid, 2, 1, 1, 2, 3, 4, 5, 6, 11);
        if(list.size() > 0 && reservation == 2){
                return ResultUtil.error("有未完成的订单");
            }
            list = orderTaxiMapper.queryByState_(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12);
            if(list.size() > 0){
                return ResultUtil.error("有未完成的订单");
            }
        }
        startAddress = startAddress.replaceAll("& #40;", "(");
        startAddress = startAddress.replaceAll("& #41;", ")");
@@ -258,8 +239,6 @@
        }
        OrderPrivateCar orderPrivateCar = new OrderPrivateCar();
        orderPrivateCar.setPeopleNum(peopleNum);
        orderPrivateCar.setRideType(rideType);
        orderPrivateCar.setType(type);
        orderPrivateCar.setUserId(uid);
        orderPrivateCar.setServerCarModelId(serverCarModelId);
@@ -271,15 +250,18 @@
        orderPrivateCar.setStartLon(Double.valueOf(startLon));
        orderPrivateCar.setStartLat(Double.valueOf(startLat));
        orderPrivateCar.setStartAddress(startAddress);
        if(ToolUtil.isNotEmpty(endLon)){
        orderPrivateCar.setEndLon(Double.valueOf(endLon));
        }
        if(ToolUtil.isNotEmpty(endLat)){
        orderPrivateCar.setEndLat(Double.valueOf(endLat));
        }
        if(ToolUtil.isNotEmpty(endAddress)){
        orderPrivateCar.setEndAddress(endAddress);
        }
        orderPrivateCar.setSubstitute(instead);
        orderPrivateCar.setPassengers(name);
        orderPrivateCar.setPassengersPhone(phone);
        Map<String,String> distanceMap = gdMapElectricFenceUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), orderPrivateCar.getEndLon() + "," + orderPrivateCar.getEndLat(), 1);
        orderPrivateCar.setEstimateMileage(Double.valueOf(distanceMap.get("distance").toString()));
        orderPrivateCar.setEstimateTime(Double.valueOf(distanceMap.get("duration").toString())/60);
        if(instead == 0 || ToolUtil.isEmpty(orderPrivateCar.getPassengers())){
            UserInfo userInfo = userInfoService.selectById(uid);
            if(ToolUtil.isEmpty(userInfo.getPhone())){
@@ -313,9 +295,7 @@
            if(driver.getState() == 3){
                return ResultUtil.error("司机正在服务中,无法提供服务");
            }
            Integer orderType = orderPrivateCar.getRideType()==1?1:orderPrivateCar.getRideType()==2?9:8;
            //List<DriverService> query = driverServiceService.query(driverId, orderType);
            List<Integer> query = driverServiceService.getDriverService(driverId, orderType);
            List<DriverService> query = driverServiceService.query(driverId, 1);
            if(query.size() == 0){
                return ResultUtil.error("该司机不能服务此业务");
            }
@@ -329,13 +309,15 @@
            orderPrivateCar.setServerCarModelId(query1.getServerCarModelId());
            orderPrivateCar.setSnatchOrderTime(new Date());
//            //调用高德创建轨迹
//            String s = gdFalconUtil.selectTerminal(driver.getPhone());
//            String track = gdFalconUtil.createTrack(s);
//            orderPrivateCar.setTrackId(track);
//
            //调用高德创建轨迹
            String s = gdFalconUtil.selectTerminal(driver.getPhone());
            String track = gdFalconUtil.createTrack(s);
            orderPrivateCar.setTrackId(track);
            //调用移动的小号接口
            Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000));
            Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString());
            Region region = regionMapper.query(geocode1.get("districtCode"));
            Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1)));
            if(String.valueOf(map.get("code")).equals("200")){
                orderPrivateCar.setTelX(map.get("telX"));
                orderPrivateCar.setBindId(map.get("bindId"));
@@ -344,9 +326,7 @@
            driver.setState(3);
            driverService.updateById(driver);
        }
        //判断独享,一口价,拼车
        if(orderPrivateCar.getRideType()!=3){
            orderPrivateCar.setTotalPeopleNum(peopleNum);
            orderPrivateCar.setIsReassign(1);
            orderPrivateCar.setIsDelete(1);
            this.insert(orderPrivateCar);
@@ -362,108 +342,13 @@
                }).start();
            }
            //推单操作-独享
        //推单操作
            if(orderPrivateCar.getState() == 1){
                this.pushOrder(orderPrivateCar);
            }
        }else{
            OrderPrivateCar orderPrivateCar1 = null;
            //判断是否有相同线路的拼车-有直接拼成功,或者推送拼车订单
            List<OrderPrivateCar> orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).in("state","2,3,4").le("totalPeopleNum",4-peopleNum));
            for(OrderPrivateCar order:orderList){
                TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId()));
                if(spellOrderRule!=null){
                    JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent());
                    //判断时间
                    if(travelTime.getTime()>=order.getTravelTime().getTime()-jsonObject.getInteger("num5")*60000L && travelTime.getTime()<=order.getTravelTime().getTime()+jsonObject.getInteger("num6")*60000L){
                        Double dis1 = Double.valueOf(gdMapElectricFenceUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), order.getStartLon() + "," + order.getStartLat(), 1).get("distance").toString());
                        Double dis2 = Double.valueOf(gdMapElectricFenceUtil.getDistance(orderPrivateCar.getEndLon() + "," + orderPrivateCar.getEndLat(), order.getEndLon() + "," + order.getEndLat(), 1).get("distance").toString());
                        //判断距离
                        if(dis1<=jsonObject.getInteger("num1")*1000 && dis2<=jsonObject.getInteger("num2")*1000){
                            orderPrivateCar1=order;
                            break;
                        }
                    }
                }
            }
            if(orderPrivateCar1==null){
                orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).eq("state",5).le("totalPeopleNum",4-peopleNum));
                for(OrderPrivateCar order:orderList){
                    TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId()));
                    if(spellOrderRule!=null){
                        JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent());
                        //判断时间
                        if(travelTime.getTime()>=order.getTravelTime().getTime()-jsonObject.getInteger("num5")*60000L && travelTime.getTime()<=order.getTravelTime().getTime()+jsonObject.getInteger("num6")*60000L){
                            String value = redisUtil.getValue("DRIVER" + String.valueOf(order.getDriverId()));
                            Double dis1 = Double.valueOf(gdMapElectricFenceUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), value, 1).get("distance").toString());
                            Double dis2 = Double.valueOf(gdMapElectricFenceUtil.getDistance(orderPrivateCar.getEndLon() + "," + orderPrivateCar.getEndLat(), order.getEndLon() + "," + order.getEndLat(), 1).get("distance").toString());
                            //判断距离
                            if(dis1<=jsonObject.getInteger("num3")*1000 && dis2<=jsonObject.getInteger("num4")*1000){
                                orderPrivateCar1=order;
                                break;
                            }
                        }
                    }
                }
            }
            if(orderPrivateCar1==null){
                orderPrivateCar.setTotalPeopleNum(peopleNum);
                orderPrivateCar.setIsReassign(1);
                orderPrivateCar.setIsDelete(1);
                this.insert(orderPrivateCar);
                this.pushOrder(orderPrivateCar);
            }else{
                Driver driver = driverService.selectById(orderPrivateCar1.getDriverId());
                orderPrivateCar.setDriverId(driverId);
                orderPrivateCar.setCompanyId(driver.getFranchiseeId() != null && driver.getFranchiseeId() != 0 ? driver.getFranchiseeId() : (
                        driver.getCompanyId() != null && driver.getCompanyId() != 0 ? driver.getCompanyId() : 1));
                orderPrivateCar.setState(2);
                orderPrivateCar.setDriverId(driver.getId());
                orderPrivateCar.setCarId(driver.getCarId());
                CarService query1 = carServiceMapper.query(1, driver.getCarId());
                orderPrivateCar.setServerCarModelId(query1.getServerCarModelId());
                orderPrivateCar.setSnatchOrderTime(new Date());
                orderPrivateCar.setTotalPeopleNum(peopleNum+orderPrivateCar1.getTotalPeopleNum());
                orderPrivateCar.setIsReassign(1);
                orderPrivateCar.setIsDelete(1);
                orderPrivateCar.setPid(orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid());
                this.insert(orderPrivateCar);
                //修改总订单人数
                OrderPrivateCar orderPrivateCar2 = new OrderPrivateCar();
                orderPrivateCar2.setSpellSuccess(1);
                orderPrivateCar2.setTotalPeopleNum(peopleNum+orderPrivateCar1.getTotalPeopleNum());
                this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid()).lt("state",6));
                this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid()).lt("state",6));
//
                //调用移动的小号接口
                Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000));
                if(String.valueOf(map.get("code")).equals("200")){
                    orderPrivateCar.setTelX(map.get("telX"));
                    orderPrivateCar.setBindId(map.get("bindId"));
                }
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        pushUtil.pushOrderState(1, uid, orderPrivateCar.getId(), 1, 2, 0);
                        pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, 100, 0);
                        pushUtil.pushDriverPosition(orderPrivateCar.getId(), 1);
                    }
                }).start();
                List<OrderPrivateCar> orderList1 = this.selectList(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()));
                for(OrderPrivateCar orderPrivateCar3:orderList1){
                    pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13, 0);
                }
                OrderPrivateCar orderPrivateCar3 = this.selectById(orderPrivateCar.getPid());
                pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13, 0);
            }
        }
        //添加消息
        systemNoticeService.addSystemNotice(1, "您的快车订单已下单成功,我们正在为您指派司机,请稍后!", orderPrivateCar.getUserId(), 1);
        systemNoticeService.addSystemNotice(1, "您的专车订单已下单成功,我们正在为您指派司机,请稍后!", orderPrivateCar.getUserId(), 1);
        BaseWarpper baseWarpper = new BaseWarpper();
        baseWarpper.setId(orderPrivateCar.getId());
@@ -514,98 +399,7 @@
            orderCrossCityService.pushOrder(orders);
        }else{
            //判断独享,一口价,拼车
            if(orderPrivateCar.getRideType()!=3){
                this.pushOrder(orderPrivateCar);
            }else{
                OrderPrivateCar orderPrivateCar1 = null;
                //判断是否有相同线路的拼车-有直接拼成功,或者推送拼车订单
                List<OrderPrivateCar> orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).in("state","2,3,4").le("totalPeopleNum",4-orderPrivateCar.getPeopleNum()));
                for(OrderPrivateCar order:orderList){
                    TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId()));
                    if(spellOrderRule!=null){
                        JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent());
                        //判断时间
                        if(orderPrivateCar.getTravelTime().getTime()>=order.getTravelTime().getTime()-jsonObject.getInteger("num5")*60000L && orderPrivateCar.getTravelTime().getTime()<=order.getTravelTime().getTime()+jsonObject.getInteger("num6")*60000L){
                            Double dis1 = Double.valueOf(gdMapElectricFenceUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), order.getStartLon() + "," + order.getStartLat(), 1).get("distance").toString());
                            Double dis2 = Double.valueOf(gdMapElectricFenceUtil.getDistance(orderPrivateCar.getEndLon() + "," + orderPrivateCar.getEndLat(), order.getEndLon() + "," + order.getEndLat(), 1).get("distance").toString());
                            //判断距离
                            if(dis1<=jsonObject.getInteger("num1")*1000 && dis2<=jsonObject.getInteger("num2")*1000){
                                orderPrivateCar1=orderPrivateCar;
                                break;
                            }
                        }
                    }
                }
                if(orderPrivateCar1==null){
                    orderList = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("rideType",3).eq("state",5).le("totalPeopleNum",4-orderPrivateCar.getPeopleNum()));
                    for(OrderPrivateCar order:orderList){
                        TbSpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<TbSpellOrderRule>().eq("companyId",order.getCompanyId()));
                        if(spellOrderRule!=null){
                            JSONObject jsonObject = JSONObject.parseObject(spellOrderRule.getContent());
                            //判断时间
                            if(orderPrivateCar.getTravelTime().getTime()>=order.getTravelTime().getTime()-jsonObject.getInteger("num5")*60000L && orderPrivateCar.getTravelTime().getTime()<=order.getTravelTime().getTime()+jsonObject.getInteger("num6")*60000L){
                                String value = redisUtil.getValue("DRIVER" + String.valueOf(order.getDriverId()));
                                Double dis1 = Double.valueOf(gdMapElectricFenceUtil.getDistance(orderPrivateCar.getStartLon() + "," + orderPrivateCar.getStartLat(), value, 1).get("distance").toString());
                                Double dis2 = Double.valueOf(gdMapElectricFenceUtil.getDistance(orderPrivateCar.getEndLon() + "," + orderPrivateCar.getEndLat(), order.getEndLon() + "," + order.getEndLat(), 1).get("distance").toString());
                                //判断距离
                                if(dis1<=jsonObject.getInteger("num3")*1000 && dis2<=jsonObject.getInteger("num4")*1000){
                                    orderPrivateCar1=order;
                                    break;
                                }
                            }
                        }
                    }
                }
                if(orderPrivateCar1==null){
                    this.pushOrder(orderPrivateCar);
                }else{
                    Driver driver = driverService.selectById(orderPrivateCar1.getDriverId());
                    orderPrivateCar.setDriverId(orderPrivateCar1.getDriverId());
                    orderPrivateCar.setCompanyId(driver.getFranchiseeId() != null && driver.getFranchiseeId() != 0 ? driver.getFranchiseeId() : (
                            driver.getCompanyId() != null && driver.getCompanyId() != 0 ? driver.getCompanyId() : 1));
                    orderPrivateCar.setState(2);
                    orderPrivateCar.setCarId(driver.getCarId());
                    orderPrivateCar.setDriverId(driver.getId());
                    CarService query1 = carServiceMapper.query(1, driver.getCarId());
                    orderPrivateCar.setServerCarModelId(query1.getServerCarModelId());
                    orderPrivateCar.setSnatchOrderTime(new Date());
                    orderPrivateCar.setTotalPeopleNum(orderPrivateCar.getPeopleNum()+orderPrivateCar1.getTotalPeopleNum());
                    orderPrivateCar.setPid(orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid());
                    orderPrivateCar.setIsReassign(1);
                    orderPrivateCar.setIsDelete(1);
                    this.updateById(orderPrivateCar);
//
                    //修改总订单人数
                    OrderPrivateCar orderPrivateCar2 = new OrderPrivateCar();
                    orderPrivateCar2.setTotalPeopleNum(orderPrivateCar.getPeopleNum()+orderPrivateCar1.getTotalPeopleNum());
                    this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid()).lt("state",6));
                    this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar1.getPid()==null?orderPrivateCar1.getId():orderPrivateCar1.getPid()).lt("state",6));
//
                    //调用移动的小号接口
                    Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000));
                    if(String.valueOf(map.get("code")).equals("200")){
                        orderPrivateCar.setTelX(map.get("telX"));
                        orderPrivateCar.setBindId(map.get("bindId"));
                    }
                    new Thread(new Runnable() {
                        @Override
                        public void run() {
                            pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, 2, 0);
                            pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, 100, 0);
                            pushUtil.pushDriverPosition(orderPrivateCar.getId(), 1);
                        }
                    }).start();
                    List<OrderPrivateCar> orderList1 = this.selectList(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()));
                    for(OrderPrivateCar orderPrivateCar3:orderList1){
                        pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13, 0);
                    }
                    OrderPrivateCar orderPrivateCar3 = this.selectById(orderPrivateCar.getPid());
                    pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13, 0);
                }
            }
        }
        return ResultUtil.success();
    }
@@ -641,30 +435,16 @@
        }
        OrderPrivateCar orderPrivateCar = this.selectById(id);
        if(null == uid){
            uid = orderPrivateCar.getUserId();
        }
        Integer integer = null;
        if(null == orderPrivateCar){
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
//        if(orderPrivateCar.getState() == 4){
//            return ResultUtil.error("司机已到达预约点,取消会产生一定的费用");
//        }
        if(orderPrivateCar.getState() >= 5 && orderPrivateCar.getState() != 11){
        if(orderPrivateCar.getState() > 5 && orderPrivateCar.getState() != 11){
            return ResultUtil.error("取消订单失败,不合法的操作");
        }
        Integer number1 = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6));
        Integer number2 = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6));
        if(number1+number2<=2){
            OrderPrivateCar orderPrivateCar2 = new OrderPrivateCar();
            orderPrivateCar2.setTotalPeopleNum(orderPrivateCar.getTotalPeopleNum()-orderPrivateCar.getPeopleNum());
            orderPrivateCar2.setSpellSuccess(0);
            this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6));
            this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6));
        }else{
            OrderPrivateCar orderPrivateCar2 = new OrderPrivateCar();
            orderPrivateCar2.setTotalPeopleNum(orderPrivateCar.getTotalPeopleNum()-orderPrivateCar.getPeopleNum());
            this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6));
            this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6));
        }
        if(null == orderPrivateCar.getDriverId()){//没有接单的情况
            if(orderPrivateCar.getType() == 2){//摆渡车
@@ -748,13 +528,13 @@
        OrderPrivateCar orderPrivateCar = this.selectById(id);
        Integer uid = orderPrivateCar.getUserId();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        ResultUtil resultUtil = ResultUtil.success();
        if(null == orderPrivateCar){
            return ResultUtil.error("取消订单失败,订单信息有误", "");
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
        if(orderPrivateCar.getState() != 12){
            return ResultUtil.error("取消订单失败,不合法的操作", "");
            return ResultUtil.error("取消订单失败,不合法的操作");
        }
        OrderCancel orderCancel = null;
        if(null == cancleId){
@@ -764,58 +544,45 @@
        }
        CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId());
        if(null != query){
            if(payType == 1){//微信支付
                String value = redisUtil.getValue("appletOpenId");
                String appletsOpenId = null;
                if(ToolUtil.isNotEmpty(value)){
                    JSONObject jsonObject = JSON.parseObject(value);
                    appletsOpenId = jsonObject.getString(uid.toString());
                }else{
                    appletsOpenId = userInfo.getAppletsOpenId();
                }
                orderCancel.setPayType(1);
                orderCancelService.updateById(orderCancel);
                String app = type == 1 ? "APP" : "JSAPI";
                resultUtil = payMoneyUtil.weixinpay("订单取消", "", id + "_1_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/wxCancelOrderTaxi", app, userInfo.getAppletsOpenId());
                paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, id, 1, 1, query.getMoney(), "", 1);//添加预支付数据
//                Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",1", 9, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/wxCancelOrderTaxi", "", type, appletsOpenId);
//                if(map.get("code").equals("200")){
//                    paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, id, 1, 1, query.getMoney(), map.get("order_id"), 1);//添加预支付数据
//                    resultUtil = ResultUtil.success(map.get("data"));
//                }else{
//                    resultUtil = ResultUtil.error(map.get("msg"), "");
//                }
        if(null != query){
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String out_trade_no = sdf.format(new Date()) + 1 + id;
            if(payType == 1){//微信支付
                String appletsOpenId = "";
                String tradeType = "APP";
                if(type == 3){
                    appletsOpenId = userInfo.getAppletsOpenId();
                    tradeType = "JSAPI";
                    if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                        return ResultUtil.error("支付异常,请重新授权登录小程序");
                    }
                }
                resultUtil = payMoneyUtil.weixinpay("订单取消", "", out_trade_no,  query.getMoney().toString(), callbackPath + "/base/wxCancelOrderTaxi", tradeType, appletsOpenId);
                if(resultUtil.getCode() == 200){
                    paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, id, 1, 1, query.getMoney(), "", 1);//添加预支付数据
                }
            }
            if(payType == 2){//支付宝支付
                orderCancel.setPayType(2);
                orderCancelService.updateById(orderCancel);
                resultUtil = payMoneyUtil.alipay("订单取消", "订单取消", "", id + "_1_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/aliCancelOrderTaxi");
                resultUtil = payMoneyUtil.alipay("取消订单支付", "取消订单", out_trade_no, query.getMoney().toString(), callbackPath + "/base/aliCancelOrderTaxi");
                if(resultUtil.getCode() == 200){
                paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, id, 1, 2, query.getMoney(), "", 1);//添加预支付数据
//                Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",1", 10, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/aliCancelOrderTaxi", "", type, null);
//                if(map.get("code").equals("200")){
//                    paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, id, 1, 2, query.getMoney(), map.get("order_id"), 1);//添加预支付数据
//                    resultUtil = ResultUtil.success(map.get("data"));
//                }else{
//                    resultUtil = ResultUtil.error(map.get("msg"), "");
//                }
                }
            }
            if(payType == 3){//余额支付
                if(userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()){
                    return ResultUtil.error("余额不足,无法完成支付", "");
                    return ResultUtil.error("余额不足,无法完成支付");
                }
                userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(query.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                //添加交易明细
                transactionDetailsService.saveData(uid, "快车取消订单", query.getMoney(), 2, 1, 1, 1, id);
                transactionDetailsService.saveData(uid, "取消订单", query.getMoney(), 2, 1, 1, 1, id);
                userInfoService.updateById(userInfo);
                //解除小号绑定
                if(orderPrivateCar.getBindId() != null){
                    chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(), orderPrivateCar.getTelX(), (System.currentTimeMillis() + 600000));
                    chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId());
                }
                orderPrivateCar.setState(10);
@@ -857,7 +624,6 @@
            @Override
            public void run() {
                try {
                    Integer orderType = orderPrivateCar.getRideType()==1?1:orderPrivateCar.getRideType()==2?9:8;
                    orderIds.add(orderPrivateCar.getId());//添加记录,防止调用接口重复提醒无人接单
                    String vehicle = redisUtil.getValue("VEHICLE");
                    List<Integer> integers = new ArrayList<>();
@@ -868,12 +634,11 @@
                    List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数
                    for(int i = 1; i <= querys.size(); i++){
                        PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0);
                        //获取空闲司机
                        List<Driver> list = driverService.queryIdleDriver(orderType, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
                        //获取空闲司机(智慧屏下单不需要判断车型)
                        List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getOrderSource() == 6 ? null : orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
                        if(list.size() > 0){
                            double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数
                            int lastIndex = Double.valueOf(list.size() * driverProportion).intValue();//计算占比转成整数(下标截取)
                            lastIndex = lastIndex == 0 ? list.size() : lastIndex;
                            list = list.subList(0, lastIndex);//获取空闲司机中占比数据
                            for(Driver driver : list){//开始进行推送
                                boolean bo = false;
@@ -947,212 +712,6 @@
    }
    @Override
    public PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        PreferentialDataVo preferentialDataVo = new PreferentialDataVo();
        preferentialDataVo.setBalance(userInfo.getBalance());
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        //获取优惠券中最优数据
        List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("companyId", orderPrivateCar.getCompanyId()).eq("state", 1).in("couponUseType", Arrays.asList(0, 1)).eq("userId", uid).where("now() < expirationTime"));
        Integer id = null;
        Double price = 0d;
        Integer type = 0;
        for (UserCouponRecord userCouponRecord : list){
            if(userCouponRecord.getCouponType() == 1){//抵扣券
                if(price.compareTo(userCouponRecord.getMoney()) < 0){
                    price = userCouponRecord.getMoney();
                    id = userCouponRecord.getId();
                    type = 1;
                }
            }else{//满减券
                if(orderPrivateCar.getOrderMoney().compareTo(userCouponRecord.getFullMoney()) >= 0 && price.compareTo(userCouponRecord.getMoney()) < 0){
                    price = userCouponRecord.getMoney();
                    id = userCouponRecord.getId();
                    type = 1;
                }
            }
        }
        //获取打车卡中最优数
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString());
        CompanyCity companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderPrivateCar.getCompanyId()).eq("areaCode", geocode.get("districtCode")).eq("state", 1));
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderPrivateCar.getCompanyId()).eq("cityCode", geocode.get("cityCode")).eq("state", 1));
        }
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderPrivateCar.getCompanyId()).eq("provinceCode", geocode.get("provinceCode")).eq("state", 1));
        }
        List<UserTaxiCard> userTaxiCards = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().like("companyCityId", "%" + companyCity.getId() + "%")
                .in("type", Arrays.asList(1, 2, 3, 4)).eq("userId", uid).where("now() between startTime and endTime"));
        //全国卡
        List<TaxiCard> taxiCards = taxiCardService.selectList(new EntityWrapper<TaxiCard>().eq("taxiCardType", 2).in("type", Arrays.asList(1, 2, 3, 4)).eq("state", 1));
        if(taxiCards.size() > 0) {
            List<UserTaxiCard> userTaxiCards2 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                    .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
            userTaxiCards.addAll(userTaxiCards2);
        }
        //亲密账户中有相同的卡优先使用自己的
        // 因为比对中只有优惠金额最高的才会被替换,所以先查找自己的数据再查找亲密账户的数据
        Map<String, Object> map = getOptimalTaxiCards(orderPrivateCar, price, id, type, userTaxiCards);
        price = Double.valueOf(map.get("price").toString());
        id = null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : null;
        type = Integer.valueOf(map.get("type").toString());
        //亲密账户
        List<UserTaxiCard> userTaxiCards_ = new ArrayList<>();
        List<UserUser> bindUserId = userUserService.selectList(new EntityWrapper<UserUser>().eq("bindUserId", uid));
        CompanyCity finalCompanyCity = companyCity;
        bindUserId.forEach(userUser -> {
            List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().in("type", Arrays.asList(1, 2, 3, 4))
                    .like("companyCityId", "%" + finalCompanyCity.getId() + "%").eq("userId", userUser.getUserId()).where("now() between startTime and endTime"));
            userTaxiCards_.addAll(userTaxiCards1);
            //全国卡
            if(taxiCards.size() > 0) {
                List<UserTaxiCard> userTaxiCards2 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", userUser.getUserId())
                        .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
                userTaxiCards_.addAll(userTaxiCards2);
            }
        });
        map = getOptimalTaxiCards(orderPrivateCar, price, id, type, userTaxiCards_);
        price = Double.valueOf(map.get("price").toString());
        id = null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : null;
        type = Integer.valueOf(map.get("type").toString());
        preferentialDataVo.setObjectId(id);
        preferentialDataVo.setDiscountAmount(price);
        preferentialDataVo.setType(type);
        return preferentialDataVo;
    }
    /**
     * 获取最优打车卡数据
     * @param orderPrivateCar
     * @param price
     * @param id
     * @param type
     * @param userTaxiCards
     * @throws Exception
     */
    public Map<String, Object> getOptimalTaxiCards(OrderPrivateCar orderPrivateCar, Double price, Integer id, Integer type, List<UserTaxiCard> userTaxiCards) throws Exception{
        Map<String, Object> map = new HashMap<>();
        for(UserTaxiCard t : userTaxiCards){
            JSONObject jsonObject = JSON.parseObject(t.getContent());
            List<Integer> integers = jsonObject.getJSONArray("businessTypes").toJavaList(Integer.class);
            if(!integers.contains(1)){
                continue;
            }
            if(t.getType() == 1){//打折次数卡{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                Integer time = jsonObject.getInteger("time");
                if(time == 0){
                    continue;
                }
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discount = jsonObject.getDouble("discount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        double v = new BigDecimal(orderPrivateCar.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        if(price.compareTo(v) < 0){
                            price = v;
                            id = t.getId();
                            type = 2;
                        }
                        if(price.compareTo(v) < 0){
                            price = v;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
            if(t.getType() == 2){//优惠卡{"businessTypes":[1,2,3],"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"fullReduction":[[50,3],[100,5],[150,10]]}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        for(int j = fullReduction.size() - 1; j >= 0; j--){
                            JSONArray jsonArray = fullReduction.getJSONArray(j);
                            Double p = jsonArray.getDouble(0);//满金额
                            Double y = jsonArray.getDouble(1);//优惠金额
                            if(orderPrivateCar.getOrderMoney().compareTo(p) >= 0 && price.compareTo(y) < 0){
                                price = y;
                                id = t.getId();
                                type = 2;
                            }
                        }
                    }
                }
            }
            if(t.getType() == 3){//次数卡{"businessTypes":[1,2,3],"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"time":1,"discountAmount":10}
                Integer time = jsonObject.getInteger("time");
                if(time == 0){
                    continue;
                }
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discountAmount = jsonObject.getDouble("discountAmount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        if(price.compareTo(discountAmount) < 0){
                            price = discountAmount;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
            if(t.getType() == 4){//打折天数卡{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                Double discount = jsonObject.getDouble("discount");//折扣
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");//使用时间段
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        double v = new BigDecimal(orderPrivateCar.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        if(price.compareTo(v) < 0){
                            price = v;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
        }
        map.put("price", price);
        map.put("id", id);
        map.put("type", type);
        return map;
    }
    @Override
    public List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        List<Map<String, Object>> list = userCouponRecordService.queryCoupon(uid, orderPrivateCar.getCompanyId(), 1, 1, orderPrivateCar.getOrderMoney(), pageNum, size);
@@ -1162,252 +721,18 @@
    }
    @Override
    public List<CouponsListVo> queryCouponList(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception {
        pageNum = (pageNum - 1) * size;
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        List<CouponsListVo> rows = new ArrayList<>();
        List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("companyId", orderPrivateCar.getCompanyId())
                .eq("state", 1).in("couponUseType", Arrays.asList(0, 1)).eq("userId", uid).where("expirationTime >= now()"));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        for (UserCouponRecord userCouponRecord : list){
            if(userCouponRecord.getCouponType() == 2){//满减券
                if(orderPrivateCar.getOrderMoney().compareTo(userCouponRecord.getFullMoney()) < 0){
                    continue;
                }
            }
            CouponsListVo couponsListVo = new CouponsListVo();
            couponsListVo.setId(userCouponRecord.getId());
            couponsListVo.setDataType(1);
            couponsListVo.setMoney(userCouponRecord.getMoney());
            couponsListVo.setUserType(userCouponRecord.getCouponUseType());
            couponsListVo.setTime(sdf.format(userCouponRecord.getExpirationTime()));
            couponsListVo.setType(userCouponRecord.getCouponType());
            couponsListVo.setFullMoney(userCouponRecord.getFullMoney());
            couponsListVo.setState(userCouponRecord.getState());
            Company company = companyService.selectById(userCouponRecord.getCompanyId());
            couponsListVo.setCompany(company.getName());
            rows.add(couponsListVo);
        }
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString());
        CompanyCity companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderPrivateCar.getCompanyId()).eq("areaCode", geocode.get("districtCode")).eq("state", 1));
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderPrivateCar.getCompanyId()).eq("cityCode", geocode.get("cityCode")).eq("state", 1));
        }
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderPrivateCar.getCompanyId()).eq("provinceCode", geocode.get("provinceCode")).eq("state", 1));
        }
        List<UserTaxiCard> userTaxiCards = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                .in("type", Arrays.asList(1, 2, 3, 4)).like("companyCityId", "%" + companyCity.getId() + "%").where("now() between startTime and endTime"));
        //全国卡
        List<TaxiCard> taxiCards = taxiCardService.selectList(new EntityWrapper<TaxiCard>().eq("taxiCardType", 2).in("type", Arrays.asList(1, 2, 3, 4)).eq("state", 1));
        if(taxiCards.size() > 0) {
            List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                    .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
            userTaxiCards.addAll(userTaxiCards1);
        }
        //亲密账户
        List<UserUser> bindUserId = userUserService.selectList(new EntityWrapper<UserUser>().eq("bindUserId", uid));
        CompanyCity finalCompanyCity = companyCity;
        bindUserId.forEach(userUser -> {
            List<UserTaxiCard> taxiCardPayments1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().in("type", Arrays.asList(1, 2, 3, 4))
                    .like("companyCityId", "%" + finalCompanyCity.getId() + "%").eq("userId", userUser.getUserId()).where("now() between startTime and endTime"));
            userTaxiCards.addAll(taxiCardPayments1);
            //全国卡
            if(taxiCards.size() > 0) {
                List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", userUser.getUserId())
                        .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
                userTaxiCards.addAll(userTaxiCards1);
            }
        });
        for(UserTaxiCard t : userTaxiCards){
            try {
                CouponsListVo couponsListVo = new CouponsListVo();
                couponsListVo.setId(t.getId());
                couponsListVo.setDataType(2);
                couponsListVo.setUserType(1);
                couponsListVo.setTime(sdf.format(t.getEndTime()));
                couponsListVo.setState(1);
                couponsListVo.setTaxiCardType(t.getType());
                Company company = companyService.selectById(t.getCompanyId());
                couponsListVo.setCompany(company.getName());
                couponsListVo.setName(taxiCardService.selectById(t.getTaxiCardId()).getName());
                JSONObject jsonObject = JSON.parseObject(t.getContent());
                JSONArray businessTypes = jsonObject.getJSONArray("businessTypes");
                if(!businessTypes.toJavaList(Integer.class).contains(1)){
                    continue;
                }
                if(t.getType() == 1){//{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                    Integer time = jsonObject.getInteger("time");
                    if(time == 0){
                        continue;
                    }
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setMoney(jsonObject.getDouble("discount"));
                    couponsListVo.setType(1);
                }
                if(t.getType() == 2){//{"businessTypes":[1,2,3],"fullReduction":[[50,3],[100,5],[150,10]]}
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                    b = true;
                    for(int i = fullReduction.size() - 1; i >= 0; i--){
                        JSONArray jsonArray = fullReduction.getJSONArray(i);
                        Double m = jsonArray.getDouble(0);
                        Double j = jsonArray.getDouble(1);
                        if(orderPrivateCar.getOrderMoney().compareTo(m) >= 0){
                            couponsListVo.setFullMoney(m);
                            couponsListVo.setMoney(j);
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setType(2);
                }
                if(t.getType() == 3){//{"businessTypes":[1,2,3],"time":1,"discountAmount":10}
                    Integer time = jsonObject.getInteger("time");
                    if(time == 0){
                        continue;
                    }
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setFullMoney(0D);
                    couponsListVo.setMoney(jsonObject.getDouble("discountAmount"));
                    couponsListVo.setType(2);
                }
                if(t.getType() == 4){//{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setMoney(jsonObject.getDouble("discount"));
                    couponsListVo.setType(1);
                }
                String str = "";
                TaxiCard taxiCard = taxiCardService.selectById(t.getTaxiCardId());
                if(taxiCard.getTaxiCardType() == 1){
                    String[] split = taxiCard.getCompanyCityId().split(";");
                    for(String c : split){
                        CompanyCity companyCity1 = companyCityService.selectById(c);
                        if(ToolUtil.isNotEmpty(companyCity1.getAreaCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getAreaCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                        if(ToolUtil.isNotEmpty(companyCity1.getCityCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getCityCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                        if(ToolUtil.isNotEmpty(companyCity1.getProvinceCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getProvinceCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                    }
                }else{
                    str = "全国;";
                }
                couponsListVo.setCity(str.substring(0, str.length() - 1));
                rows.add(couponsListVo);
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        Collections.sort(rows, new Comparator<CouponsListVo>() {
            public int compare(CouponsListVo s1, CouponsListVo s2) {
                return Integer.compare(s1.getId(), s2.getId());
            }
        });
        if(rows.size() >= (pageNum + 1) * size){
            rows = rows.subList(pageNum, pageNum + size);
        }else if(pageNum < rows.size() && rows.size() < (pageNum + 1) * size){
            rows = rows.subList(pageNum, rows.size());
        }else{
            rows = new ArrayList<>();
        }
        return rows;
    }
    @Override
    public ResultUtil payPrivateCarOrder(Integer payType, Integer orderId, Integer couponId, Integer type) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        if(orderPrivateCar.getState() == 8 || orderPrivateCar.getState() == 9){
            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
            return ResultUtil.error("订单已完成支付,不允许重复支付");
        }
        if(orderPrivateCar.getState() != 7){
            return ResultUtil.error("订单不在待支付状态,不允许支付", "");
            return ResultUtil.error("订单不在待支付状态,不允许支付");
        }
        Integer uid = orderPrivateCar.getUserId();
        Double orderMoney = orderPrivateCar.getOrderMoney();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        ResultUtil resultUtil = ResultUtil.success();
        orderPrivateCar.setCouponMoney(0D);//初始化历史数据
        orderPrivateCar.setCouponId(null);
@@ -1416,19 +741,19 @@
        if(null != couponId){
            userCouponRecord = userCouponRecordService.selectById(couponId);
            if(userCouponRecord.getCompanyId() != orderPrivateCar.getCompanyId()){
                return ResultUtil.error("优惠券不能用于此订单", "");
                return ResultUtil.error("优惠券不能用于此订单");
            }
            if(userCouponRecord.getState() == 2){
                return ResultUtil.error("优惠券已使用", "");
                return ResultUtil.error("优惠券已使用");
            }
            if(userCouponRecord.getState() == 3){
                return ResultUtil.error("优惠券已过期", "");
                return ResultUtil.error("优惠券已过期");
            }
            if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 1){
                return ResultUtil.error("优惠券不能用于此类型订单", "");
                return ResultUtil.error("优惠券不能用于此类型订单");
            }
            if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){
                return ResultUtil.error("优惠券不能用于此订单", "");
                return ResultUtil.error("优惠券不能用于此订单");
            }
            orderMoney = orderMoney - userCouponRecord.getMoney();
            orderPrivateCar.setCouponMoney(userCouponRecord.getMoney());
@@ -1456,19 +781,34 @@
                orderMoney = v;
            }
        }
        orderMoney = orderMoney < 0 ? 0 : orderMoney;
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String out_trade_no = sdf.format(new Date()) + 1 + orderPrivateCar.getId();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId());
            String appletsOpenId = "";
            String tradeType = "APP";
            if(type == 3){
                appletsOpenId = userInfo.getAppletsOpenId();
                tradeType = "JSAPI";
                if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                    return ResultUtil.error("支付异常,请重新授权登录小程序");
                }
            }
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", out_trade_no, orderMoney.toString(), callbackPath + "/base/wxPayOrderTaxi", tradeType, appletsOpenId);
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 1, orderMoney, "", 1);//添加预支付数据
        }
        }
        if(payType == 2) {//支付宝支付
            resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi");
            resultUtil = payMoneyUtil.alipay("订单完成支付", "支付订单", out_trade_no, orderMoney.toString(), callbackPath + "/base/aliPayOrderTaxi");
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 2, orderMoney, "", 1);//添加预支付数据
            }
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
                return ResultUtil.error("余额不足,无法完成支付");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
@@ -1477,7 +817,7 @@
            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "快车订单", orderMoney, 2, 1, 1, 1, orderId);
            transactionDetailsService.saveData(uid, "完成订单", orderMoney, 2, 1, 1, 1, orderId);
            userInfoService.updateById(userInfo);
            orderPrivateCar.setState(8);
@@ -1509,277 +849,6 @@
                Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
                d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());
            incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue());
            Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
                @Override
                public void run() {
                    pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0);
                    pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0);
                }
            }).start();
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成出行订单支付,谢谢使用!", uid, 1);
            new Thread(new Runnable() {
                @Override
                public void run() {
                    if(pushMinistryOfTransport){//上传数据
                        pushMinistryOfTransportUtil.operatePay(orderId);
                    }
                }
            }).start();
        }
        this.updateAllColumnById(orderPrivateCar);
        return resultUtil;
    }
    @Override
    public ResultUtil payPrivateCarOrder1(Integer payType, Integer orderId, Integer objectId, Integer objectType, Integer type) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        if(orderPrivateCar.getState() == 8 || orderPrivateCar.getState() == 9){
            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
        }
        if(orderPrivateCar.getState() != 7){
            return ResultUtil.error("订单不在待支付状态,不允许支付", "");
        }
        Integer uid = orderPrivateCar.getUserId();
        Double orderMoney = orderPrivateCar.getOrderMoney();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        orderPrivateCar.setCouponMoney(0D);//初始化历史数据
        orderPrivateCar.setCouponId(null);
        //计算优惠券
        UserCouponRecord userCouponRecord = null;
        if(null != objectId && objectType == 1){
            userCouponRecord = userCouponRecordService.selectById(objectId);
            if(userCouponRecord.getCompanyId() != orderPrivateCar.getCompanyId()){
                return ResultUtil.error("优惠券不能用于此订单", "");
            }
            if(userCouponRecord.getState() == 2){
                return ResultUtil.error("优惠券已使用", "");
            }
            if(userCouponRecord.getState() == 3){
                return ResultUtil.error("优惠券已过期", "");
            }
            if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 1){
                return ResultUtil.error("优惠券不能用于此类型订单", "");
            }
            if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){
                return ResultUtil.error("优惠券不能用于此订单", "");
            }
            orderMoney = orderMoney - userCouponRecord.getMoney();
            orderPrivateCar.setCouponMoney(userCouponRecord.getMoney());
            orderPrivateCar.setCouponId(objectId);
        }
        //打车卡
        UserTaxiCard userTaxiCard = null;
        if(null != objectId && objectType == 2){
            userTaxiCard = userTaxiCardService.selectById(objectId);
            TaxiCard taxiCard = taxiCardService.selectById(userTaxiCard.getTaxiCardId());
            if(taxiCard.getTaxiCardType() == 1 && userTaxiCard.getCompanyId() != orderPrivateCar.getCompanyId()){
                return ResultUtil.error("打车卡不能用于此订单", "");
            }
            if(System.currentTimeMillis() > userTaxiCard.getEndTime().getTime()){
                return ResultUtil.error("打车卡已过期", "");
            }
            if(userTaxiCard.getType() == 1 || userTaxiCard.getType() == 3){
                Integer time = JSON.parseObject(userTaxiCard.getContent()).getInteger("time");
                if(0 == time){
                    return ResultUtil.error("打车卡已使用完", "");
                }
            }
            List<Integer> integers = JSON.parseObject(userTaxiCard.getContent()).getJSONArray("businessTypes").toJavaList(Integer.class);
            if(!integers.contains(1)){
                return ResultUtil.error("打车卡不能用于此类型订单", "");
            }
            Double yh = 0D;
            JSONObject jsonObject = JSON.parseObject(userTaxiCard.getContent());
            if(userTaxiCard.getType() == 1){//打折次数卡{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discount = jsonObject.getDouble("discount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = new BigDecimal(orderPrivateCar.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        jsonObject.put("time", jsonObject.getInteger("time") - 1);
                        userTaxiCard.setContent(jsonObject.toJSONString());
                        break;
                    }
                }
            }
            if(userTaxiCard.getType() == 2){//优惠卡{"businessTypes":[1,2,3],"fullReduction":[[50,3],[100,5],[150,10]]}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        for(int j = fullReduction.size() - 1; j >= 0; j--){
                            JSONArray jsonArray = fullReduction.getJSONArray(j);
                            Double p = jsonArray.getDouble(0);//满金额
                            if(orderPrivateCar.getOrderMoney().compareTo(p) >= 0){
                                yh = jsonArray.getDouble(1);//优惠金额
                                break;
                            }
                        }
                    }
                }
            }
            if(userTaxiCard.getType() == 3){//次数卡{"businessTypes":[1,2,3],"time":1,"discountAmount":10}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = jsonObject.getDouble("discountAmount");
                        jsonObject.put("time", jsonObject.getInteger("time") - 1);
                        userTaxiCard.setContent(jsonObject.toJSONString());
                    }
                }
            }
            if(userTaxiCard.getType() == 4){//打折天数卡{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                Double discount = jsonObject.getDouble("discount");//折扣
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");//使用时间段
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = new BigDecimal(orderPrivateCar.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        break;
                    }
                }
            }
            orderMoney = orderMoney - yh;
            orderPrivateCar.setTaxiCardId(userTaxiCard.getTaxiCardId());
            orderPrivateCar.setUserTaxiCardId(objectId);
            orderPrivateCar.setDiscountAmount(yh);
        }
        //计算红包
        UserRedPacketRecord query = userRedPacketRecordService.query(uid, orderPrivateCar.getCompanyId(), 1, 1, orderMoney);
        if(null != query && query.getMoney().compareTo(orderMoney) < 0){
            orderMoney = orderMoney - query.getMoney();
            orderPrivateCar.setRedPacketMoney(query.getMoney());
            orderPrivateCar.setRedPacketId(query.getId());
        }
        //计算折扣
        UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderPrivateCar.getCompanyId());
        if(null != query2){
            Double special = query2.getSpecial();
            orderPrivateCar.setDiscount(special);
            double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
            if(orderMoney.compareTo(v) > 0){
                orderPrivateCar.setDiscountMoney(orderMoney - v);
                orderPrivateCar.setActivityId(query2.getId());
                orderMoney = v;
            }
        }
        orderMoney = orderMoney < 0 ? 0 : orderMoney;
        if(payType == 1){//微信支付
            if(orderMoney == 0){
                return ResultUtil.error("请使用余额支付");
            }
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 1, orderMoney, "", 1);//添加预支付数据
        }
        if(payType == 2) {//支付宝支付
            if(orderMoney == 0){
                return ResultUtil.error("请使用余额支付");
            }
            resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi");
            paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 2, orderMoney, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId());
            if(null != query1){
                userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            }
            //添加交易明细
            transactionDetailsService.saveData(uid, "快车订单", orderMoney, 2, 1, 1, 1, orderId);
            userInfoService.updateById(userInfo);
            orderPrivateCar.setState(8);
            orderPrivateCar.setPayType(3);
            orderPrivateCar.setPayMoney(orderMoney);
            //处理优惠券和红包
            if(null != userCouponRecord){
                userCouponRecord.setState(2);
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            //处理打车卡
            if(null != userTaxiCard){
                userTaxiCardService.updateById(userTaxiCard);
            }
            if(null != query){
                query.setState(2);
                query.setEndTime(new Date());
                userRedPacketRecordService.updateById(query);
            }
            //添加已收入明细
            Company company = companyService.selectById(orderPrivateCar.getCompanyId());
            Double speMoney = company.getSpeMoney();
            BigDecimal d = null;//企业收入
            BigDecimal c = null;//司机收入
            // TODO: 2022/3/19  抽成按照订单金额计算,优先保证司机的收入,用户支付金额不够,则在平台收入中补贴司机收入
            //例如:订单金额10元,优惠3元,司机收入比例80%,平台收入比例20%。
            //司机收入:10 * 0.8 = 8
            //平台收入:7 - 8 = -1
            if(company.getIsSpeFixedOrProportional() == 2){//固定
                d = new BigDecimal(speMoney.compareTo(orderPrivateCar.getOrderMoney()) > 0 ? orderPrivateCar.getOrderMoney() : speMoney);
                c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
            }
            if(company.getIsSpeFixedOrProportional() == 1){//比例
                c = new BigDecimal(orderPrivateCar.getOrderMoney()).multiply(new BigDecimal(1 - (speMoney / 100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                d = new BigDecimal(orderPrivateCar.getPayMoney()).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());
            incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue());
@@ -1905,11 +974,11 @@
        PaymentRecord query = paymentRecordService.query(1, orderPrivateCar.getUserId(), 1, Integer.valueOf(id), 1, type, 1);
        if(null != query){
            //添加交易明细
            transactionDetailsService.saveData(orderPrivateCar.getUserId(), "快车取消订单", query.getAmount(), 2, 1, 1, 1, query.getOrderId());
            transactionDetailsService.saveData(orderPrivateCar.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 1, query.getOrderId());
            orderPrivateCar.setState(10);
            //解除小号绑定
            if(orderPrivateCar.getBindId() != null){
                chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(), orderPrivateCar.getTelX(), (System.currentTimeMillis() + 600000));
                chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId());
            }
            orderPrivateCar.setBindId("");
            orderPrivateCar.setTelX("");
@@ -1949,9 +1018,9 @@
    public void payOrderPrivateCarCallback(Integer id, String order_id, Integer type) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(id);
        PaymentRecord query = paymentRecordService.query(1, orderPrivateCar.getUserId(), 1, Integer.valueOf(id), 1, type, 1);
        if(null != query && query.getState() == 1){
        if(null != query){
            //添加交易明细
            transactionDetailsService.saveData(orderPrivateCar.getUserId(), "快车订单", query.getAmount(), 2, 1, 1, 1, query.getOrderId());
            transactionDetailsService.saveData(orderPrivateCar.getUserId(), "完成订单", query.getAmount(), 2, 1, 1, 1, query.getOrderId());
            orderPrivateCar.setState(8);
            orderPrivateCar.setPayType(type);
            orderPrivateCar.setPayMoney(query.getAmount());
@@ -1968,15 +1037,6 @@
                userCouponRecord.setState(2);
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            if(null != orderPrivateCar.getUserTaxiCardId()){
                UserTaxiCard userTaxiCard = userTaxiCardService.selectById(orderPrivateCar.getUserTaxiCardId());
                if(userTaxiCard.getType() == 1 || userTaxiCard.getType() == 3){
                    JSONObject jsonObject = JSON.parseObject(userTaxiCard.getContent());
                    jsonObject.put("time", jsonObject.getInteger("time") - 1);
                    userTaxiCard.setContent(jsonObject.toJSONString());
                    userTaxiCardService.updateById(userTaxiCard);
                }
            }
            if(null != orderPrivateCar.getRedPacketId()){
                UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(orderPrivateCar.getRedPacketId());
@@ -1995,17 +1055,14 @@
            Double taxi = company.getSpeMoney();
            BigDecimal d = null;//企业收入
            BigDecimal c = null;//司机收入
            // TODO: 2022/3/19  抽成按照订单金额计算,优先保证司机的收入,用户支付金额不够,则在平台收入中补贴司机收入
            //例如:订单金额10元,优惠3元,司机收入比例80%,平台收入比例20%。
            //司机收入:10 * 0.8 = 8
            //平台收入:7 - 8 = -1
            if(company.getIsSpeFixedOrProportional() == 2){//固定
                d = new BigDecimal(taxi.compareTo(orderPrivateCar.getOrderMoney()) > 0 ? orderPrivateCar.getOrderMoney() : taxi);
                d = new BigDecimal(taxi);
                c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            if(company.getIsSpeFixedOrProportional() == 1){//比例
                c = new BigDecimal(orderPrivateCar.getOrderMoney()).multiply(new BigDecimal(1 - (taxi / 100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                d = new BigDecimal(orderPrivateCar.getPayMoney()).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
                d = new BigDecimal(price).multiply(new BigDecimal(taxi).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());
            incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue());
@@ -2121,8 +1178,8 @@
        if(null == distance){
            System.err.println("查询距离出错了");
        }else{
            d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
            t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
            d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
            t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
        }
        OrderServerWarpper orderServerWarpper = new OrderServerWarpper();
        orderServerWarpper.setOrderId(orderPrivateCar.getId());
@@ -2144,8 +1201,8 @@
            if(null == distance){
                System.err.println("查询距离出错了");
            }else{
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
            }
            orderServerWarpper.setReservationMileage("0");
            orderServerWarpper.setReservationTime("0");
@@ -2200,81 +1257,112 @@
        return endPushWarpper;
    }
    @Override
    public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        ResultUtil resultUtil = ResultUtil.success();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(3, uid, 1, orderId, 1, 1, money, "", 1);//添加预支付数据
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee");
            paymentRecordService.saveData(1, uid, 1, orderId, 1, 2, money, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < money){
                return ResultUtil.error("余额不足,无法完成支付", "");
    public ResultUtil<BaseWarpper> directCallCar(String phone, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String deviceCode) throws Exception {
        //查找与起点匹配的企业(经营范围)
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(startLon, startLat);
        Company query = companyCityService.query(geocode.get("districtCode"));
        if(null == query){
            return ResultUtil.error("起点暂无企业提供服务");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        UserInfo userInfo = userInfoMapper.queryByPhone(phone);
        if(null == userInfo){
            userInfo = new UserInfo();
            userInfo.setPhone(phone);
            userInfo.setPassWord(ShiroKit.md5("", "&a.s"));
            userInfo.setNickName(userInfoService.getDefaultName());
            userInfo.setIsAuth(1);
            userInfo.setConsumption(0D);
            userInfo.setBalance(0D);
            userInfo.setState(1);
            SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId());
            userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "快车订单-感谢费", money, 2, 1, 1, 1, orderId);
            userInfoService.updateById(userInfo);
            orderPrivateCar.setThankYouFee(money);
            this.updateById(orderPrivateCar);
            //添加已收入明细
            incomeService.saveData(2, orderPrivateCar.getDriverId(), 6, orderPrivateCar.getId(), 1, money);
            Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成感谢费支付,谢谢使用!", uid, 1);
            //用户所属企业
            if(null != geocode){
                userInfo.setCompanyId(null != query ? query.getId() : null);
                userInfo.setRegistAreaCode(geocode.get("districtCode"));
        }
            userInfoService.insert(userInfo);
            userInfoService.addCoupon(userInfo);//添加优惠券
            UserInfo finalUserInfo = userInfo;
            new Thread(new Runnable() {
                @Override
                public void run() {
                    if(pushMinistryOfTransport){
                        //上传数据
                        pushMinistryOfTransportUtil.baseInfoPassenger(finalUserInfo.getId());
                    }
                }
            }).start();
        }
        List<Map<String, Object>> list = serverCarModelMapper.queryServerCarModel(1);
        if(list.size() == 0){
            return ResultUtil.error("暂无可用的车型");
        }
        Date travelTime = new Date(System.currentTimeMillis() + 300000);
        OrderTaxi orderTaxi = new OrderTaxi();
        orderTaxi.setType(1);
        orderTaxi.setUserId(userInfo.getId());
        orderTaxi.setOrderNum(this.getOrderNum());
        orderTaxi.setPlacementLon(Double.valueOf(placementLon));
        orderTaxi.setPlacementLat(Double.valueOf(placementLat));
        orderTaxi.setStartLon(Double.valueOf(startLon));
        orderTaxi.setStartLat(Double.valueOf(startLat));
        orderTaxi.setStartAddress(startAddress);
        orderTaxi.setSubstitute(0);
        orderTaxi.setPassengers(userInfo.getNickName());
        orderTaxi.setPassengersPhone(phone);
        orderTaxi.setState(1);
        orderTaxi.setInsertTime(new Date());
        orderTaxi.setTravelTime(travelTime);
        orderTaxi.setOrderType(1);
        orderTaxi.setOrderSource(7);
        orderTaxi.setIsReassign(1);
        orderTaxi.setDeviceCode(deviceCode);
        orderTaxi.setIsDelete(1);
        ResultUtil<BaseWarpper> resultUtil = orderTaxiService.taxiOrder(orderTaxi, userInfo.getId());
        return resultUtil;
    }
    @Override
    public void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        UserInfo userInfo = userInfoService.selectById(orderPrivateCar.getUserId());
        PaymentRecord query = paymentRecordService.query(3, userInfo.getId(), 1, orderId, 1, payType, 1);
        query.setState(2);
        query.setCode(order_id);
        paymentRecordService.updateById(query);
        SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId());
        userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分
        //添加交易明细
        transactionDetailsService.saveData(userInfo.getId(), "快车订单-感谢费", query.getAmount(), 2, 1, 1, 1, orderId);
        userInfoService.updateById(userInfo);
        orderPrivateCar.setThankYouFee(query.getAmount());
        this.updateById(orderPrivateCar);
        //添加已收入明细
        incomeService.saveData(2, orderPrivateCar.getDriverId(), 6, orderPrivateCar.getId(), 1, query.getAmount());
        Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
        driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driverService.updateById(driver);
        systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : "支付宝") + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1);
    public List<SmartScreenOrderVo> querySmartScreenOrder(String deviceCode, String lonLat) throws Exception {
        List<OrderTaxi> list = orderTaxiService.selectList(new EntityWrapper<OrderTaxi>().eq("orderSource", 7).eq("deviceCode", deviceCode).eq("isDelete", 1).in("state", Arrays.asList(1, 2, 3, 4)));
        List<SmartScreenOrderVo> orderVos = new ArrayList<>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        for (OrderTaxi orderTaxi : list) {
            SmartScreenOrderVo smartScreenOrderVo = new SmartScreenOrderVo();
            smartScreenOrderVo.setId(orderTaxi.getId());
            smartScreenOrderVo.setUserPhone(orderTaxi.getPassengersPhone());
            smartScreenOrderVo.setInsertTime(sdf.format(orderTaxi.getInsertTime()));
            smartScreenOrderVo.setDistance(0D);
            smartScreenOrderVo.setMinute(0);
            if(null != orderTaxi.getDriverId()){
                Driver driver = driverService.selectById(orderTaxi.getDriverId());
                Car car = carMapper.selectById(driver.getCarId());
                smartScreenOrderVo.setCarLicensePlate(car.getCarLicensePlate());
                smartScreenOrderVo.setDriverPhone(driver.getPhone());
                String value = redisUtil.getValue("DRIVER" + driver.getId());//lon + "," + lat
                if(ToolUtil.isNotEmpty(value)){
                    Map<String, String> distance = gdMapElectricFenceUtil.getDistance(value, orderTaxi.getStartLon() + "," + orderTaxi.getStartLat(), 1);
                    if(null != distance){
                        BigDecimal bigDecimal = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                        int duration = Double.valueOf(Integer.valueOf(distance.get("duration")) / 60).intValue();
                        smartScreenOrderVo.setDistance(bigDecimal.doubleValue());
                        smartScreenOrderVo.setMinute(duration);
                    }
    }
    @Override
    public List<Map<String, Object>> queryOrderInfo2(Integer orderId, Integer state, String lon, String lat) {
        return this.baseMapper.queryOrderInfo2(orderId,state,lon,lat);
            }
            smartScreenOrderVo.setStatus(orderTaxi.getState());
            smartScreenOrderVo.setArrivalTime(null == orderTaxi.getArriveTime() ? "" : sdf.format(orderTaxi.getArriveTime()));
            orderVos.add(smartScreenOrderVo);
        }
        return orderVos;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/LoginController.java
@@ -44,7 +44,7 @@
    /**
     * 跳转到主页
     */
    @RequestMapping(value = "/", method = RequestMethod.GET)
//    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String index(Model model) {
        //获取菜单列表
        List<Integer> roleList = ShiroKit.getUser().getRoleList();
@@ -71,7 +71,7 @@
    /**
     * 跳转到登录页面
     */
    @RequestMapping(value = "/login", method = RequestMethod.GET)
//    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public String login() {
        if (ShiroKit.isAuthenticated() || ShiroKit.getUser() != null) {
            return REDIRECT + "/";
@@ -83,7 +83,7 @@
    /**
     * 点击登录执行的动作
     */
    @RequestMapping(value = "/login", method = RequestMethod.POST)
//    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public String loginVali() {
        String username = super.getPara("username").trim();
@@ -102,11 +102,7 @@
        Subject currentUser = ShiroKit.getSubject();
        UsernamePasswordToken token = new UsernamePasswordToken(username, password.toCharArray());
        if ("on".equals(remember)) {
            token.setRememberMe(true);
        } else {
            token.setRememberMe(false);
        }
        currentUser.login(token);
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/AdditionalFeeMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/BankCardMapper.java
New file
@@ -0,0 +1,7 @@
package com.stylefeng.guns.modular.system.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.modular.system.model.BankCard;
public interface BankCardMapper extends BaseMapper<BankCard> {
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/CouponRecordMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverMapper.java
@@ -30,15 +30,6 @@
    /**
     * 获取当前已上班type业务类型、设置了可以接此类型的单据的司机
     * @param type
     * @param companyId
     * @return
     */
    List<Driver> queryIdleDriver1(@Param("type") Integer type, @Param("companyId") Integer companyId);
    /**
     * 根据订单id获取司机数据
     * @param orderId
     * @return
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverServiceMapper.java
@@ -16,6 +16,4 @@
     * @throws Exception
     */
    List<DriverService> queryBusiness(@Param("uid") Integer uid, @Param("type") Integer... type);
    List<Integer> getDriverService(@Param("uid") Integer uid, @Param("type") Integer... type);
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MerchantActivityMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MerchantActivitySlaveMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MerchantCouponMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MerchantMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/OfflineTravelPaymentMapper.java
New file
@@ -0,0 +1,7 @@
package com.stylefeng.guns.modular.system.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.modular.system.model.OfflineTravelPayment;
public interface OfflineTravelPaymentMapper extends BaseMapper<OfflineTravelPayment> {
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/OrderAdditionalFeeMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCarBrandMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TaxiCardMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TaxiCardPaymentMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbCarRentalMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbCommentMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbMessNumMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbRecruitMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbSellingCarMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbShowModularMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TbSpellOrderRuleMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserMerchantCouponMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserTaxiCardMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserUserMapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AdditionalFeeMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/BankCardMapper.xml
New file
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stylefeng.guns.modular.system.dao.BankCardMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.BankCard">
        <id column="id" property="id"/>
        <result column="bank" property="bank"/>
        <result column="name" property="name"/>
        <result column="code" property="code"/>
        <result column="acctNumSuffix" property="acctNumSuffix"/>
        <result column="phone" property="phone"/>
        <result column="IdNum" property="IdNum"/>
        <result column="userType" property="userType"/>
        <result column="userId" property="userId"/>
        <result column="signNum" property="signNum"/>
        <result column="insertTime" property="insertTime"/>
    </resultMap>
</mapper>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CouponRecordMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverMapper.xml
@@ -67,6 +67,7 @@
        <result column="laveBusinessMoney" property="laveBusinessMoney" />
        <result column="laveBusinessMoney" property="laveBusinessMoney" />
        <result column="appletsOpenId" property="appletsOpenId"/>
        <result column="mchtNo" property="mchtNo"/>
        <result column="flag" property="flag"/>
@@ -159,12 +160,7 @@
        (
          select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
        )
        <if test="8>type">
            and id in (select driverId from t_driver_orders where `type` = #{type})
        </if>
        <if test="type>7">
            and id in (select driverId from t_driver_orders where `type` = 1)
        </if>
    </select>
@@ -251,25 +247,12 @@
        (
        select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
        )
        <if test="8>type">
            and id in (select driverId from t_driver_orders where `type` = #{type})
            and carId in (select carId from t_car_service where `type` = #{type}
            <if test="null != serverCarModelId">
                and serverCarModelId = #{serverCarModelId}
            </if>
            )
        </if>
        <if test="type>7">
            and id in (select driverId from t_driver_orders where `type` =1)
            and carId in (select carId from t_car_service where `type` = 1
            <if test="null != serverCarModelId">
                and serverCarModelId = #{serverCarModelId}
            </if>
            )
        </if>
    </select>
@@ -344,90 +327,5 @@
        left join t_car_model c on (b.carModelId = c.id)
        left join t_car_brand d on (c.brandId = d.id)
        where a.id = #{id}
    </select>
    <select id="queryIdleDriver1" resultType="Driver">
        select
        id as id,
        account as account,
        jobNumber as jobNumber,
        phone as phone,
        password as password,
        name as name,
        sex as sex,
        idCard as idCard,
        companyId as companyId,
        franchiseeId as franchiseeId,
        headImgUrl as headImgUrl,
        faceImgUrl as faceImgUrl,
        idCardImgUrl1 as idCardImgUrl1,
        idCardImgUrl2 as idCardImgUrl2,
        placeOfEmployment as placeOfEmployment,
        birthday as birthday,
        bankCardNumber as bankCardNumber,
        driverNationality as driverNationality,
        driverNation as driverNation,
        driverMaritalStatus as driverMaritalStatus,
        driverLanguageLevel as driverLanguageLevel,
        driverEducation as driverEducation,
        driverCensus as driverCensus,
        driverAddress as driverAddress,
        driverContactAddress as driverContactAddress,
        driverAge as driverAge,
        driveCard as driveCard,
        driveCardImgUrl as driveCardImgUrl,
        driverType as driverType,
        getDriverLicenseDate as getDriverLicenseDate,
        driverLicenseOn as driverLicenseOn,
        driverLicenseOff as driverLicenseOff,
        taxiDriver as taxiDriver,
        taxiAptitudeCard as taxiAptitudeCard,
        networkCarlssueImg as networkCarlssueImg,
        networkCarlssueOrganization as networkCarlssueOrganization,
        networkCarlssueDate as networkCarlssueDate,
        getNetworkCarProofDate as getNetworkCarProofDate,
        networkCarProofOn as networkCarProofOn,
        networkCarProofOff as networkCarProofOff,
        registerDate as registerDate,
        fullTimeDriver as fullTimeDriver,
        inDriverBlacklist as inDriverBlacklist,
        commercialType as commercialType,
        contractCompany as contractCompany,
        contractOn as contractOn,
        contractOff as contractOff,
        emergencyContact as emergencyContact,
        emergencyContactPhone as emergencyContactPhone,
        emergencyContactAddress as emergencyContactAddress,
        remark as remark,
        isPlatCar as isPlatCar,
        carId as carId,
        authState as authState,
        state as state,
        addType as addType,
        balance as balance,
        flag as flag,
        insertTime as insertTime,
        insertUser as insertUser,
        updateTime as updateTime,
        updateUser as updateUser
        from t_driver
        where flag != 3 and state != 1 and authState = 2
        <if test="null != companyId">
            <choose>
                <when test="companyId != 1">
                    and companyId = #{companyId} or franchiseeId = #{companyId}
                </when>
                <otherwise>
                    and companyId is null or companyId = 0 or companyId = 1 or franchiseeId is null or franchiseeId = 0
                </otherwise>
            </choose>
        </if>
        and id in
        (
        select driverId from t_driver_work where startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
        )
        and id in (select driverId from t_driver_orders where `type` = #{type})
    </select>
</mapper>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverServiceMapper.xml
@@ -23,7 +23,4 @@
            </foreach>
        </if>
    </select>
    <select id="getDriverService" resultType="java.lang.Integer">
        select driverId from t_driver_work where driverId = #{uid} and  startTime &lt; now() and state = 1 and `type` like CONCAT('%', #{type}, '%')
    </select>
</mapper>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/InvoiceMapper.xml
@@ -22,10 +22,10 @@
    <select id="queryMyInvoice" resultType="map">
    <select id="queryMyInvoice" resultType="Invoice">
        select
        id as id,
        date_format( insertTime,'%Y-%m-%d %H:%i:%s') as insertTime,
        insertTime as insertTime,
        ('电子发票') as type,
        ('出行服务') as content,
        state as state,
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MerchantActivityMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MerchantActivitySlaveMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MerchantCouponMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MerchantMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OfflineTravelPaymentMapper.xml
New file
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stylefeng.guns.modular.system.dao.OfflineTravelPaymentMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.OfflineTravelPayment">
        <id column="id" property="id"/>
        <result column="orderId" property="orderId"/>
        <result column="payType" property="payType"/>
        <result column="payMoney" property="payMoney"/>
        <result column="payTime" property="payTime"/>
        <result column="driverId" property="driverId"/>
        <result column="status" property="status"/>
        <result column="insertTime" property="insertTime"/>
    </resultMap>
</mapper>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OrderAdditionalFeeMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OrderCancelMapper.xml
@@ -55,7 +55,7 @@
        select
        (money * -1) as money,
        DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time,
        CONCAT(if(orderType = 1, '快车', if(orderType = 2, '出租车', if(orderType = 3, '跨城', if(orderType = 4, '同城小件物流', if(orderType = 5, '跨城小件物流', '包车'))))), '订单取消') as name,
        CONCAT(if(orderType = 1, '专车', if(orderType = 2, '出租车', if(orderType = 3, '跨城', if(orderType = 4, '同城小件物流', if(orderType = 5, '跨城小件物流', '包车'))))), '订单取消') as name,
        UNIX_TIMESTAMP(insertTime) as insertTime
        from t_order_cancel where state = 2 and userType = 1 and money is not null and userId = #{uid}
        <choose>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceMapper.xml
@@ -14,19 +14,8 @@
    <select id="query" resultType="map">
        select
        id as id,
        content as content,
        contentPutOne as contentPutOne,
        contentNotOne as contentNotOne,
        contentPutTwo as contentPutTwo,
        contentNotTwo as contentNotTwo,
        contentPutThree as contentPutThree,
        contentNotThree as contentNotThree,
        contentExclusive as contentExclusive,
        contentPrice as contentPrice,fareTypeNote1,fareTypeNote2,fareTypeNote3,
        isOpen as isOpen,
        isOpenExclusive as isOpenExclusive,
        isOpenPrice as isOpenPrice
        from t_system_price where state = 1 and companyId = #{companyId}
        content as content
        from t_system_price where companyId = #{companyId}
        <if test="null != type">
            and `type` = #{type}
        </if>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarBrandMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaxiCardMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TaxiCardPaymentMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbCarRentalMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbCommentMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbMessNumMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbRecruitMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbSellingCarMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbShowModularMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TbSpellOrderRuleMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserInfoMapper.xml
@@ -153,16 +153,14 @@
        a.nickName as nickName,
        a.avatar as avatar,
        DATE_FORMAT(a.birthday, '%Y-%m-%d') as birthday,
        a.sex as sex,
        a.isAuth as isAuth,
        ifnull(a.sex, 1) as sex,
        ifnull(a.isAuth, 1) as isAuth,
        (select state from t_verified where userId = a.id order by insertTime desc limit 0,1) as verified,
        a.name as name,
        a.integral as integral,
        a.emergencyContact as emergencyContact,
        a.emergencyContactNumber as emergencyContactNumber,
        a.balance as balance,
        if((select count(1) from t_user_taxi_card where userId = #{uid}) = 0, 0, 1) as payTaxiCar,
        if((select id from t_merchant where auditStatus = 2 and userType = 1 and userId = a.id and state = 1) is null, 0, 1) as merchant
        a.balance as balance
        from t_user a where 1 = 1
        <if test="null != uid">
            and a.id = #{uid}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMerchantCouponMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserTaxiCardMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserUserMapper.xml
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/WithdrawalMapper.xml
@@ -11,7 +11,6 @@
        <result column="money" property="money" />
        <result column="state" property="state" />
        <result column="remark" property="remark" />
        <result column="bankName" property="bankName"/>
        <result column="code" property="code" />
        <result column="name" property="name" />
        <result column="userType" property="userType" />
@@ -26,7 +25,6 @@
        select
        id as id,
        DATE_FORMAT(insertTime, '%Y.%m.%d') as insertTime,
        bankName as bankName,
        money as money,
        ('银行卡提现') as name,
        remark as remark,
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/AdditionalFee.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/BankCard.java
New file
@@ -0,0 +1,161 @@
package com.stylefeng.guns.modular.system.model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
/**
 * 银行卡
 */
@TableName("t_bank_card")
public class BankCard {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @TableField("id")
    private Integer id;
    /**
     * 银行全称
     */
    @TableField("bank")
    private String bank;
    /**
     * 开户人姓名
     */
    @TableField("name")
    private String name;
    /**
     * 银行卡号
     */
    @TableField("code")
    private String code;
    /**
     * 银行卡号后四位
     */
    @TableField("acctNumSuffix")
    private String acctNumSuffix;
    /**
     * 银行预留手机号
     */
    @TableField("phone")
    private String phone;
    /**
     * 身份证号码
     */
    @TableField("IdNum")
    private String IdNum;
    /**
     * 用户类型(1=乘客,2=司机)
     * @return
     */
    @TableField("userType")
    private Integer userType;
    /**
     * 用户id
     */
    @TableField("userId")
    private Integer userId;
    /**
     * 签约协议号
     */
    @TableField("signNum")
    private String signNum;
    /**
     * 添加时间
     * @return
     */
    @TableField("insertTime")
    private Date insertTime;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getBank() {
        return bank;
    }
    public void setBank(String bank) {
        this.bank = bank;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getAcctNumSuffix() {
        return acctNumSuffix;
    }
    public void setAcctNumSuffix(String acctNumSuffix) {
        this.acctNumSuffix = acctNumSuffix;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getIdNum() {
        return IdNum;
    }
    public void setIdNum(String idNum) {
        IdNum = idNum;
    }
    public Integer getUserType() {
        return userType;
    }
    public void setUserType(Integer userType) {
        this.userType = userType;
    }
    public Integer getUserId() {
        return userId;
    }
    public void setUserId(Integer userId) {
        this.userId = userId;
    }
    public String getSignNum() {
        return signNum;
    }
    public void setSignNum(String signNum) {
        this.signNum = signNum;
    }
    public Date getInsertTime() {
        return insertTime;
    }
    public void setInsertTime(Date insertTime) {
        this.insertTime = insertTime;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Company.java
@@ -254,36 +254,6 @@
    @TableField("insertTime")
    private Date insertTime;
    private String detailAddress;
    private String scale;
    private String companyInfo;
    public String getDetailAddress() {
        return detailAddress;
    }
    public void setDetailAddress(String detailAddress) {
        this.detailAddress = detailAddress;
    }
    public String getScale() {
        return scale;
    }
    public void setScale(String scale) {
        this.scale = scale;
    }
    public String getCompanyInfo() {
        return companyInfo;
    }
    public void setCompanyInfo(String companyInfo) {
        this.companyInfo = companyInfo;
    }
    public Integer getId() {
        return id;
    }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Complaint.java
@@ -58,19 +58,6 @@
     */
    @TableField("handleUserId")
    private Integer handleUserId;
    /**
     * 处理结果
     */
    @TableField("complaintID")
    private String complaintID;
    public String getComplaintID() {
        return complaintID;
    }
    public void setComplaintID(String complaintID) {
        this.complaintID = complaintID;
    }
    public Integer getId() {
        return id;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/CouponRecord.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Driver.java
@@ -329,6 +329,11 @@
     */
    @TableField("appletsOpenId")
    private String appletsOpenId;
    /**
     * 柳州银行收款商户号
     */
    @TableField("mchtNo")
    private String mchtNo;
    @Override
    public Integer getId() {
@@ -828,6 +833,14 @@
        this.appletsOpenId = appletsOpenId;
    }
    public String getMchtNo() {
        return mchtNo;
    }
    public void setMchtNo(String mchtNo) {
        this.mchtNo = mchtNo;
    }
    @Override
    public String toString() {
        return "Driver{" +
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Merchant.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/MerchantActivity.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/MerchantActivitySlave.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/MerchantCoupon.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OfflineTravelPayment.java
New file
@@ -0,0 +1,136 @@
package com.stylefeng.guns.modular.system.model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
/**
* 线下出行支付记录
* @author pzb
* @Date 2022/11/30 9:00
*/
@TableName("t_offline_travel_payment")
public class OfflineTravelPayment {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @TableField("id")
    private Integer id;
    /**
     * 下单唯一标识
     */
    @TableField("orderId")
    private String orderId;
    /**
     * 支付方式(1=微信,2=支付宝)
     */
    @TableField("payType")
    private Integer payType;
    /**
     * 支付金额
     */
    @TableField("payMoney")
    private Double payMoney;
    /**
     * 支付时间
     */
    @TableField("payTime")
    private Date payTime;
    /**
     * 支付流水号
     */
    @TableField("payNumber")
    private String payNumber;
    /**
     * 服务司机id
     */
    @TableField("driverId")
    private Integer driverId;
    /**
     * 状态(1=待支付,2=已支付)
     */
    @TableField("status")
    private Integer status;
    /**
     * 添加时间
     */
    @TableField("insertTime")
    private Date insertTime;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public Integer getPayType() {
        return payType;
    }
    public void setPayType(Integer payType) {
        this.payType = payType;
    }
    public Double getPayMoney() {
        return payMoney;
    }
    public void setPayMoney(Double payMoney) {
        this.payMoney = payMoney;
    }
    public Date getPayTime() {
        return payTime;
    }
    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }
    public String getPayNumber() {
        return payNumber;
    }
    public void setPayNumber(String payNumber) {
        this.payNumber = payNumber;
    }
    public Integer getDriverId() {
        return driverId;
    }
    public void setDriverId(Integer driverId) {
        this.driverId = driverId;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getInsertTime() {
        return insertTime;
    }
    public void setInsertTime(Date insertTime) {
        this.insertTime = insertTime;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OpenCityBusiness.java
@@ -9,7 +9,7 @@
@TableName("t_open_city_business")
public class OpenCityBusiness extends BaseBean {
    /**
     * 业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出现)
     * 业务类型(1=专车,2=出租车,3=跨城出行,4=同城小件物流,5=跨城小件物流,6=包车)
     */
    @TableField("businessType")
    private Integer businessType;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OrderAdditionalFee.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OrderCancel.java
@@ -24,7 +24,7 @@
    @TableField("orderId")
    private Integer orderId;
    /**
     * 订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)
     * 订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
     */
    @TableField("orderType")
    private Integer orderType;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OrderEvaluate.java
@@ -29,7 +29,7 @@
    @TableField("driverId")
    private Integer driverId;
    /**
     * 订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)
     * 订单类型(1=专车,2=出租车,3=跨城出行,4=同城小件物流,5=跨城小件物流,6=包车)
     */
    @TableField("orderType")
    private Integer orderType;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SystemNotice.java
@@ -24,7 +24,7 @@
    @TableField("type")
    private Integer type;
    /**
     * 系统消息类型(1=打车业务,2=优惠券,3=其他)
     * 系统消息类型(1=打车业务,2=优惠券)
     */
    @TableField("noticeType")
    private Integer noticeType;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCarBrand.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TaxiCard.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TaxiCardPayment.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbCarRental.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbComment.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbMessNum.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbRecruit.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbSellingCar.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbShowModular.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TbSpellOrderRule.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserCouponRecord.java
@@ -81,7 +81,7 @@
    @TableField("couponActivityId")
    private Integer couponActivityId;
    /**
     * 活动类型(1=赠送活动,2=注册,3=邀请,4=充值,5=打车卡购买)
     * 活动类型(1=赠送活动,2=注册,3=邀请,4=充值)
     * @return
     */
    @TableField("activityType")
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserMerchantCoupon.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserTaxiCard.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserUser.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Withdrawal.java
@@ -49,11 +49,6 @@
    @TableField("remark")
    private String remark;
    /**
     * 银行名称
     */
    @TableField("bankName")
    private String bankName;
    /**
     * 银行账户
     */
    @TableField("code")
@@ -121,14 +116,6 @@
    public void setBalance(Double balance) {
        this.balance = balance;
    }
    public String getBankName() {
        return bankName;
    }
    public void setBankName(String bankName) {
        this.bankName = bankName;
    }
    public Double getMoney() {
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IAdditionalFeeService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IBankCardService.java
New file
@@ -0,0 +1,42 @@
package com.stylefeng.guns.modular.system.service;
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.modular.system.model.BankCard;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.BankCardWarpper;
import java.util.List;
public interface IBankCardService extends IService<BankCard> {
    /**
     * 添加银行卡
     * @param uid
     * @param bankNum
     * @param bank
     * @param name
     * @param phone
     * @param code
     * @param IdNum
     * @return
     */
    ResultUtil addBankCard(Integer uid, String bankNum, String bank, String name, String phone, String code, String IdNum);
    /**
     * 获取银行卡列表
     * @param uid
     * @return
     */
    List<BankCardWarpper> queryBankCardList(Integer uid);
    /**
     * 删除银行卡
     * @param uid
     * @param id
     * @return
     */
    ResultUtil delBankCard(Integer uid, Integer id);
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ICouponRecordService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java
@@ -36,20 +36,6 @@
    /**
     * 获取给定车型的司机
     * @param type
     * @param lon
     * @param lat
     * @param distance
     * @param companyId
     * @return
     * @throws Exception
     */
    List<Driver> queryIdleDriver1(Integer type, Double lon, Double lat, Double distance, Integer companyId) throws Exception;
    /**
     * 根据订单id获取司机数据
     * @param orderId
     * @return
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverServiceService.java
@@ -16,6 +16,4 @@
     * @throws Exception
     */
    List<DriverService> query(Integer driverId, Integer...type) throws Exception;
    List<Integer> getDriverService(Integer uid,Integer... type);
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMerchantActivityService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMerchantActivitySlaveService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMerchantCouponService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMerchantService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOfflineTravelPaymentService.java
New file
@@ -0,0 +1,7 @@
package com.stylefeng.guns.modular.system.service;
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.modular.system.model.OfflineTravelPayment;
public interface IOfflineTravelPaymentService extends IService<OfflineTravelPayment> {
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOpenCityService.java
@@ -24,7 +24,4 @@
     * @throws Exception
     */
    boolean openCity(String code) throws Exception;
    OpenCity openCity1(String code) throws Exception;
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOrderAdditionalFeeService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOrderService.java
@@ -27,4 +27,14 @@
     * @throws Exception
     */
    ResultUtil weChatPay(Integer orderId, Integer orderType, Integer type, Integer userType, Integer uid, String content) throws Exception;
    /**
     * 司机线下订单收款
     * @param driverId
     * @param money
     * @return
     * @throws Exception
     */
    ResultUtil driverQrCodePaymentCollection(Integer driverId, Double money, Integer payType) throws Exception;
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IRegionService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISysIntegralService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCarBrandService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITaxiCardPaymentService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITaxiCardService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbCarRentalService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbCommentService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbMessNumService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbRecruitService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbSellingCarService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbShowModularService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITbSpellOrderRuleService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserInfoService.java
@@ -224,4 +224,12 @@
     * @throws Exception
     */
    ResultUtil phoneLoginBindingWeChat(Integer userId, String jscode) throws Exception;
    void addCoupon(UserInfo userInfo) throws Exception;
    String getDefaultName();
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserMerchantCouponService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserTaxiCardService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserUserService.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IWithdrawalService.java
@@ -18,7 +18,16 @@
     * @param uid
     * @throws Exception
     */
    ResultUtil withdrawal(Double money, String bankName, String code, String name, Integer uid) throws Exception;
    ResultUtil withdrawal(Double money, String code, String name, Integer uid) throws Exception;
    /**
     * 提现操作
     * @param money
     * @throws Exception
     */
    ResultUtil withdrawal1(Double money, String acctName, Integer bankCardId, Integer uid) throws Exception;
    /**
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/AdditionalFeeServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/BankCardServiceImpl.java
New file
@@ -0,0 +1,92 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.BankCardMapper;
import com.stylefeng.guns.modular.system.model.BankCard;
import com.stylefeng.guns.modular.system.service.IBankCardService;
import com.stylefeng.guns.modular.system.util.LiuZhouBank.ProtocolSignUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.BankCardWarpper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class BankCardServiceImpl extends ServiceImpl<BankCardMapper, BankCard> implements IBankCardService {
    @Override
    public ResultUtil addBankCard(Integer uid, String bankNum, String bank, String name, String phone, String code, String IdNum) {
        BankCard bankCard = this.selectOne(new EntityWrapper<BankCard>().eq("code", bankNum).eq("userType", 1).eq("userId", uid));
        if(null != bankCard){
            return ResultUtil.error("该银行卡号已添加");
        }
        Map<String, String> map = ProtocolSignUtil.protocolSign(IdNum, phone, name, bankNum, code);
        String code1 = map.get("code");
        if("01".equals(code1)){
            String msg = map.get("msg");
            return ResultUtil.error(msg);
        }
        String signNum = map.get("signNum");
        String acctNumSuffix = map.get("acctNumSuffix");
        bankCard = new BankCard();
        bankCard.setBank(bank);
        bankCard.setCode(bankNum);
        bankCard.setAcctNumSuffix(acctNumSuffix);
        bankCard.setName(name);
        bankCard.setPhone(phone);
        bankCard.setIdNum(IdNum);
        bankCard.setUserType(1);
        bankCard.setUserId(uid);
        bankCard.setSignNum(signNum);
        bankCard.setInsertTime(new Date());
        this.insert(bankCard);
        return ResultUtil.success();
    }
    @Override
    public List<BankCardWarpper> queryBankCardList(Integer uid) {
        List<BankCard> bankCards = this.selectList(new EntityWrapper<BankCard>().eq("userType", 1).eq("userId", uid));
        List<BankCardWarpper> list = new ArrayList<>();
        for (BankCard bankCard : bankCards) {
            BankCardWarpper bankCardWarpper = new BankCardWarpper();
            BeanUtils.copyProperties(bankCard, bankCardWarpper);
            bankCardWarpper.setCode("************" + bankCard.getAcctNumSuffix());
            list.add(bankCardWarpper);
        }
        return list;
    }
    @Override
    public ResultUtil delBankCard(Integer uid, Integer id) {
        BankCard bankCard = this.selectById(id);
        if(bankCard.getUserId().compareTo(uid) != 0){
            return ResultUtil.error("删除失败");
        }
        Map<String, String> map = ProtocolSignUtil.queryProtocolSign(bankCard.getSignNum(), bankCard.getCode());
        String code = map.get("code");
        if("01".equals(code)){
            String msg = map.get("msg");
            return ResultUtil.error(msg);
        }
        String sugnNum = map.get("SignNum");
        String signStatus = map.get("SignStatus");
        Map<String, String> map1 = ProtocolSignUtil.protocolRescind(sugnNum);
        String code1 = map1.get("code");
        if("01".equals(code1)){
            String msg = map1.get("msg");
            return ResultUtil.error(msg);
        }
        this.deleteById(id);
        return ResultUtil.success();
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CompanyCityServiceImpl.java
@@ -1,6 +1,7 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.dao.CompanyCityMapper;
import com.stylefeng.guns.modular.system.dao.CompanyMapper;
import com.stylefeng.guns.modular.system.model.Company;
@@ -49,6 +50,9 @@
     */
    @Override
    public Company query(String code) throws Exception {
        if(ToolUtil.isEmpty(code)){
            return null;
        }
        String province = code.substring(0, 2) + "0000";
        String city = code.substring(0, 4) + "00";
        List<Company> query = companyMapper.query(province, city, code);
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ComplaintServiceImpl.java
@@ -14,7 +14,6 @@
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Random;
@Service
@@ -51,15 +50,6 @@
        complaint.setDescription(description);
        complaint.setUserId(uid);
        complaint.setIsHandle(0);
        Random random = new Random();
        String result="";
        for (int i=0;i<6;i++)
        {
            result += random.nextInt(10);
        }
        complaint.setComplaintID("TS" + result);
        this.insert(complaint);
        systemNoticeService.addSystemNotice(1, "您的投诉已提交成功,我们会尽快处理!", uid, 1);
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CouponRecordServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java
@@ -88,6 +88,7 @@
        for(Driver driver : drivers){
            String value = redisUtil.getValue("DRIVER" + String.valueOf(driver.getId()));
            if(null != value){
//                Map<String, String> distance1 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, value, 0);//计算距离
                Map<String, Double> distance1 = geodesyUtil.getDistance(lon + "," + lat, value);
                double d = Double.valueOf(distance1.get("WGS84")).doubleValue();
                if(d < (distance * 1000)){
@@ -98,22 +99,6 @@
        return list;
    }
    @Override
    public List<Driver> queryIdleDriver1(Integer type, Double lon, Double lat, Double distance, Integer companyId) throws Exception {
        List<Driver> drivers = driverMapper.queryIdleDriver1(type, companyId);
        List<Driver> list = new ArrayList<>();
        for(Driver driver : drivers){
            String value = redisUtil.getValue("DRIVER" + String.valueOf(driver.getId()));
            if(null != value){
                Map<String, Double> distance1 = geodesyUtil.getDistance(lon + "," + lat, value);
                double d = Double.valueOf(distance1.get("WGS84")).doubleValue();
                if(d < (distance * 1000)){
                    list.add(driver);
                }
            }
        }
        return list;
    }
    /**
     * 根据订单id获取司机数据
@@ -158,7 +143,7 @@
            baseWarpper.setId(d.getType());
            switch (d.getType()){
                case 1:
                    baseWarpper.setName("快车");
                    baseWarpper.setName("专车");
                    break;
                case 2:
                    baseWarpper.setName("出租车");
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceServiceImpl.java
@@ -28,9 +28,4 @@
    public List<DriverService> query(Integer driverId, Integer... type) throws Exception {
        return driverServiceMapper.queryBusiness(driverId, type);
    }
    @Override
    public List<Integer> getDriverService(Integer uid, Integer... type) {
        return driverServiceMapper.getDriverService(uid, type);
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/InvoiceServiceImpl.java
@@ -4,12 +4,6 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.dao.InvoiceMapper;
import com.stylefeng.guns.modular.system.model.Invoice;
import com.stylefeng.guns.modular.system.service.IInvoiceService;
@@ -34,15 +28,6 @@
    @Autowired
    private IOrderTaxiService orderTaxiService;
    @Autowired
    private IOrderPrivateCarService orderPrivateCarService;
    @Autowired
    private IOrderCrossCityService orderCrossCityService;
    @Autowired
    private IOrderLogisticsService orderLogisticsService;
    /**
@@ -61,24 +46,16 @@
            Integer orderId = jsonObject.getIntValue("id");
            switch (orderType){
                case 1://专车
                    OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                    sum=sum.add(new BigDecimal(orderPrivateCar.getPayMoney()));
                    break;
                case 2://出租车
                    OrderTaxi orderTaxi = orderTaxiService.selectById(orderId);
                    sum=sum.add(new BigDecimal(orderTaxi.getPayMoney()));
                    sum.add(new BigDecimal(orderTaxi.getPayMoney()));
                    break;
                case 3://跨城出行
                    OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId);
                    sum=sum.add(new BigDecimal(orderCrossCity.getPayMoney()));
                    break;
                case 4://同城小件物流
                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
                    sum=sum.add(new BigDecimal(orderLogistics.getPayMoney()));
                    break;
                case 5://跨城小件物流
                    OrderLogistics orderLogistics1 = orderLogisticsService.selectById(orderId);
                    sum=sum.add(new BigDecimal(orderLogistics1.getPayMoney()));
                    break;
            }
        }
@@ -98,9 +75,6 @@
            Integer orderId = jsonObject.getIntValue("id");
            switch (orderType){
                case 1://专车
                    OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                    orderPrivateCar.setInvoiceId(invoice.getId());
                    orderPrivateCarService.updateById(orderPrivateCar);
                    break;
                case 2://出租车
                    OrderTaxi orderTaxi = orderTaxiService.selectById(orderId);
@@ -108,19 +82,10 @@
                    orderTaxiService.updateById(orderTaxi);
                    break;
                case 3://跨城出行
                    OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId);
                    orderCrossCity.setInvoiceId(invoice.getId());
                    orderCrossCityService.updateById(orderCrossCity);
                    break;
                case 4://同城小件物流
                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
                    orderLogistics.setInvoiceId(invoice.getId());
                    orderLogisticsService.updateById(orderLogistics);
                    break;
                case 5://跨城小件物流
                    OrderLogistics orderLogistics1 = orderLogisticsService.selectById(orderId);
                    orderLogistics1.setInvoiceId(invoice.getId());
                    orderLogisticsService.updateById(orderLogistics1);
                    break;
            }
        }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MerchantActivityServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MerchantActivitySlaveServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MerchantCouponServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MerchantServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OfflineTravelPaymentServiceImpl.java
New file
@@ -0,0 +1,11 @@
package com.stylefeng.guns.modular.system.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.OfflineTravelPaymentMapper;
import com.stylefeng.guns.modular.system.model.OfflineTravelPayment;
import com.stylefeng.guns.modular.system.service.IOfflineTravelPaymentService;
import org.springframework.stereotype.Service;
@Service
public class OfflineTravelPaymentServiceImpl extends ServiceImpl<OfflineTravelPaymentMapper, OfflineTravelPayment> implements IOfflineTravelPaymentService {
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OpenCityBusinessServiceImpl.java
@@ -41,7 +41,7 @@
            BaseWarpper baseWarpper = new BaseWarpper();
            switch (b.getBusinessType()){
                case 1:
                    baseWarpper.setName("快车/专车");
                    baseWarpper.setName("专车");
                    baseWarpper.setId(1);
                    break;
                case 2:
@@ -49,16 +49,20 @@
                    baseWarpper.setId(2);
                    break;
                case 3:
                    baseWarpper.setName("机场专线");
                    baseWarpper.setName("跨城出行");
                    baseWarpper.setId(3);
                    break;
                case 7:
                    baseWarpper.setName("景区直通车");
                    baseWarpper.setId(7);
                case 4:
                    baseWarpper.setName("同城小件物流");
                    baseWarpper.setId(4);
                    break;
                case 8:
                    baseWarpper.setName("公务出行");
                    baseWarpper.setId(8);
                case 5:
                    baseWarpper.setName("跨城小件物流");
                    baseWarpper.setId(5);
                    break;
                case 6:
                    baseWarpper.setName("包车");
                    baseWarpper.setId(6);
                    break;
            }
            list.add(baseWarpper);
@@ -81,7 +85,7 @@
            BaseWarpper baseWarpper = new BaseWarpper();
            switch (b.getBusinessType()){
                case 1:
                    baseWarpper.setName("快车/专车");
                    baseWarpper.setName("专车");
                    baseWarpper.setId(1);
                    break;
                case 2:
@@ -89,16 +93,20 @@
                    baseWarpper.setId(2);
                    break;
                case 3:
                    baseWarpper.setName("机场专线");
                    baseWarpper.setName("跨城出行");
                    baseWarpper.setId(3);
                    break;
                case 7:
                    baseWarpper.setName("景区直通车");
                    baseWarpper.setId(7);
                case 4:
                    baseWarpper.setName("同城小件物流");
                    baseWarpper.setId(4);
                    break;
                case 8:
                    baseWarpper.setName("公务出行");
                    baseWarpper.setId(8);
                case 5:
                    baseWarpper.setName("跨城小件物流");
                    baseWarpper.setId(5);
                    break;
                case 6:
                    baseWarpper.setName("包车");
                    baseWarpper.setId(6);
                    break;
            }
            list.add(baseWarpper);
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OpenCityServiceImpl.java
@@ -66,21 +66,4 @@
        }
        return true;
    }
    @Override
    public OpenCity openCity1(String code) throws Exception {
        String province = code.substring(0, 2) + "0000";
        String city = code.substring(0, 4) + "00";
        List<OpenCity> openCities = openCityMapper.queryByCode(code);
        if(openCities.size() == 0){
            openCities = openCityMapper.queryByCode(city);
        }
        if(openCities.size() == 0){
            openCities = openCityMapper.queryByCode(province);
        }
        if(openCities.size() == 0){
            return null;
        }
        return openCities.get(0);
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderAdditionalFeeServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java
@@ -2,17 +2,25 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.OfflineTravelPayment;
import com.stylefeng.guns.modular.system.service.IDriverService;
import com.stylefeng.guns.modular.system.service.IOfflineTravelPaymentService;
import com.stylefeng.guns.modular.system.service.IOrderService;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.util.ChinaMobileUtil;
import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil;
import com.stylefeng.guns.modular.system.util.LiuZhouBank.PayUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.UUIDUtil;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
@@ -21,6 +29,8 @@
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -50,6 +60,15 @@
    @Autowired
    private IOrderLogisticsService orderLogisticsService;
    @Autowired
    private IOfflineTravelPaymentService offlineTravelPaymentService;
    @Autowired
    private IDriverService driverService;
    @Value("${callbackPath}")
    private String callbackPath;
    /**
@@ -133,4 +152,35 @@
        }
        return ResultUtil.success();
    }
    @Override
    public ResultUtil driverQrCodePaymentCollection(Integer driverId, Double money, Integer payType) throws Exception {
        String randomCode = UUIDUtil.getRandomCode();
        String pay_type = "";
        if(payType == 1){//微信
            pay_type = "02";
        }
        if(payType == 2){//支付宝
            pay_type = "04";
        }
        OfflineTravelPayment offlineTravelPayment = new OfflineTravelPayment();
        offlineTravelPayment.setOrderId(randomCode);
        offlineTravelPayment.setDriverId(driverId);
        offlineTravelPayment.setPayType(payType);
        offlineTravelPayment.setPayMoney(money);
        offlineTravelPayment.setStatus(1);
        offlineTravelPayment.setInsertTime(new Date());
        offlineTravelPaymentService.insert(offlineTravelPayment);
        Driver driver = driverService.selectById(driverId);
        String codeUrl = PayUtil.polymericPay(null, null, "", pay_type, money, "打车支付"
                , callbackPath + "/base/offlineTravelPaymentCallback", randomCode
                , "https://okyueche.com:8443/h5/#/pages/index/evaluate", driver.getMchtNo());
        if(ToolUtil.isNotEmpty(codeUrl)){
            Map<String, String> map = new HashMap<>();
            map.put("url", codeUrl);
            map.put("id", randomCode);
            return ResultUtil.success(map);
        }
        return ResultUtil.error("获取支付数据失败");
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PhoneServiceImpl.java
@@ -5,6 +5,8 @@
import com.stylefeng.guns.modular.system.dao.PhoneMapper;
import com.stylefeng.guns.modular.system.model.Phone;
import com.stylefeng.guns.modular.system.service.IPhoneService;
import com.stylefeng.guns.modular.system.util.AESUtil;
import com.stylefeng.guns.modular.system.util.DESUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -27,18 +29,21 @@
     */
    @Override
    public List<Phone> queryPhones(String code) throws Exception {
        List<Phone> list = new ArrayList<>();
        if(ToolUtil.isNotEmpty(code)){
        if(ToolUtil.isEmpty(code)){
            return new ArrayList<>();
        }
            String province = code.substring(0, 2) + "0000";
            String city = code.substring(0, 4) + "00";
            list = phoneMapper.queryPhones(province, city, code);
        List<Phone> list = phoneMapper.queryPhones(province, city, code);
            if(list.size() == 0){
                list = phoneMapper.queryPhones(province, city, null);
            }
            if(list.size() == 0){
                list = phoneMapper.queryPhones(province, null, null);
            }
        for (Phone phone : list) {
            phone.setPhone(AESUtil.encrypt(phone.getPhone()));
        }
        return list;
    }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RegionServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ServerCarModelServiceImpl.java
@@ -2,17 +2,12 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.ServerCarModelMapper;
import com.stylefeng.guns.modular.system.dao.SystemPriceMapper;
import com.stylefeng.guns.modular.system.model.Company;
import com.stylefeng.guns.modular.system.model.OpenCity;
import com.stylefeng.guns.modular.system.model.OpenCityBusiness;
import com.stylefeng.guns.modular.system.model.ServerCarModel;
import com.stylefeng.guns.modular.system.service.ICompanyCityService;
import com.stylefeng.guns.modular.system.service.IOpenCityBusinessService;
import com.stylefeng.guns.modular.system.service.IOpenCityService;
import com.stylefeng.guns.modular.system.service.IServerCarModelService;
import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil;
import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil;
@@ -44,12 +39,6 @@
    @Autowired
    private ICompanyCityService companyCityService;
    @Autowired
    private IOpenCityService openCityService;
    @Autowired
    private IOpenCityBusinessService openCityBusinessService;
@@ -71,17 +60,6 @@
        if(null == query){
            return ResultUtil.error("起点暂无企业提供服务", new ArrayList<>());
        }
        if(type == 1 && query.getIsSpe() == 2){
            return ResultUtil.success(new ArrayList<>());
        }
        OpenCity openCity = openCityService.openCity1(geocode.get("districtCode"));
        if(null != openCity){
            OpenCityBusiness openCityBusiness = openCityBusinessService.selectOne(new EntityWrapper<OpenCityBusiness>().eq("businessType", 1).eq("openCityId", openCity.getId()).ne("flag", 3));
            if(null == openCityBusiness){
                return ResultUtil.success(new ArrayList<>());
            }
        }
        Map<String, String> distance = gdMapElectricFenceUtil.getDistance(startLonLat, endLonLat, 1);
        if(null == distance){
            return ResultUtil.error("获取预估距离出错", new ArrayList<>());
@@ -92,9 +70,9 @@
        long duration_ = Long.valueOf(duration).longValue();
        List<ServerCarModelWarpper> price = this.getPrice(query.getId(), distance1_, duration_, 0, 1);
//        if(price.size() == 0){
//            return ResultUtil.error("未获取到可服务的车型", new ArrayList<>());
//        }
        if(price.size() == 0){
            return ResultUtil.error("未获取到可服务的车型", new ArrayList<>());
        }
        return ResultUtil.success(price);
    }
@@ -131,74 +109,44 @@
            //开始根据不同的方式计算金额
            double amount = 0;
            if(type == 1){//专车
                JSONObject jsonObject = JSON.parseObject(query1.get("content").toString());
                Double num1 = jsonObject.getDouble("num1");//起步价(元)
                Double num2 = jsonObject.getDouble("num2");//起步公里(公里)
                Double num3 = jsonObject.getDouble("num3");//起步时间(分钟)
                Double num4 = jsonObject.getDouble("num4");//里程费(元)
                Double num5 = jsonObject.getDouble("num5");//时长费(分钟)
                Double num6 = jsonObject.getDouble("num6");//等待费(分钟)
                Double num7 = jsonObject.getDouble("num7");//等待费(元)
                Double num8 = jsonObject.getDouble("num8");//远途费(公里)
                Double num9 = jsonObject.getDouble("num9");//远途费(公里)
                Double num10 = jsonObject.getDouble("num10");//远途费(元)
                Double num11 = jsonObject.getDouble("num11");//远途费(公里)
                Double num12 = jsonObject.getDouble("num12");//远途费(公里)
                Double num13 = jsonObject.getDouble("num13");//远途费(元)
                Double num14 = jsonObject.getDouble("num14");//远途费(公里)
                Double num15 = jsonObject.getDouble("num15");//远途费(元)
                String num16 = jsonObject.getString("num16");//夜间费(开始时间)
                Double num17 = jsonObject.getDouble("num17");//夜间费(元)
                Double num18 = jsonObject.getDouble("num18");//夜间费(元)
                Double num19 = jsonObject.getDouble("num19");//夜间费(元)
                Double num20 = jsonObject.getDouble("num20");//夜间费(元)
                Double num21 = jsonObject.getDouble("num21");//夜间费(元)
                Double num22 = jsonObject.getDouble("num22");//夜间费(元)
                String num23 = jsonObject.getString("num23");//高峰费(开始时间)
                String num24 = jsonObject.getString("num24");//高峰费(开始时间)
                Double num25 = jsonObject.getDouble("num25");//高峰费(元)
                Double num26 = jsonObject.getDouble("num26");//高峰费(元)
                Double num27 = jsonObject.getDouble("num27");//高峰费(元)
                Double num28 = jsonObject.getDouble("num28");//高峰费(元)
                Double num29 = jsonObject.getDouble("num29");//高峰费(元)
                Double num30 = jsonObject.getDouble("num30");//高峰费(元)
                double d = distance / 1000;//实际公里
                double t = duration / 60;//实际时间
                JSONObject jsonObject = JSON.parseObject(query1.get("content").toString());//等待费
                Double waitMoney = jsonObject.getDouble("num2");
                JSONObject contentPutOne = JSON.parseObject(query1.get("contentPutOne").toString());//一人拼成
                JSONObject contentNotOne = JSON.parseObject(query1.get("contentNotOne").toString());//一人未拼成
                JSONObject contentPutTwo = JSON.parseObject(query1.get("contentPutTwo").toString());//2人拼成
                JSONObject contentNotTwo = JSON.parseObject(query1.get("contentNotTwo").toString());//2人未拼成
                JSONObject contentPutThree = JSON.parseObject(query1.get("contentPutThree").toString());//3人拼成
                JSONObject contentNotThree = JSON.parseObject(query1.get("contentNotThree").toString());//3人未拼成
                JSONObject contentExclusive = JSON.parseObject(query1.get("contentExclusive").toString());//独享
                JSONObject contentPrice = JSON.parseObject(query1.get("contentPrice").toString());//一口价
                //一口价
                ServerCarModelWarpper serverCarModelWarpper = ServerCarModelWarpper.getServerCarModelWarpper(map);
                serverCarModelWarpper.setFareTypeNote1(query1.get("fareTypeNote1").toString());
                serverCarModelWarpper.setFareTypeNote2(query1.get("fareTypeNote2").toString());
                serverCarModelWarpper.setFareTypeNote3(query1.get("fareTypeNote3").toString());
                serverCarModelWarpper.setContentPutOne(contentPutOne);
                serverCarModelWarpper.setContentNotOne(contentNotOne);
                serverCarModelWarpper.setContentPutTwo(contentPutTwo);
                serverCarModelWarpper.setContentNotTwo(contentNotTwo);
                serverCarModelWarpper.setContentPutThree(contentPutThree);
                serverCarModelWarpper.setContentNotThree(contentNotThree);
                serverCarModelWarpper.setContentExclusive(contentExclusive);
                serverCarModelWarpper.setContentPrice(contentPrice);
                serverCarModelWarpper.setAmount(new BigDecimal(this.calculationPrice(contentExclusive,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setBuyNowAmount(new BigDecimal(this.calculationPrice(contentPrice,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setPutTogetherOneAmount(new BigDecimal(this.calculationPrice(contentPutOne,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setNotAssembledOneAmount(new BigDecimal(this.calculationPrice(contentNotOne,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setPutTogetherTwoAmount(new BigDecimal(this.calculationPrice(contentPutTwo,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setNotAssembledTwoAmount(new BigDecimal(this.calculationPrice(contentNotTwo,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setPutTogetherThreeAmount(new BigDecimal(this.calculationPrice(contentPutThree,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setNotAssembledThreeAmount(new BigDecimal(this.calculationPrice(contentNotThree,distance,duration,wait,waitMoney)).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setMileage(d);
                serverCarModelWarpper.setDuration(t);
                serverCarModelWarpper.setIsOpen(Integer.parseInt(query1.get("isOpen").toString()));
                serverCarModelWarpper.setIsOpenExclusive(Integer.parseInt(query1.get("isOpenExclusive").toString()));
                serverCarModelWarpper.setIsOpenPrice(Integer.parseInt(query1.get("isOpenPrice").toString()));
                data.add(serverCarModelWarpper);
            }
        }
        return data;
    }
    public Double  calculationPrice(JSONObject rule, double distance, long duration, long wait,Double waitMoney) throws Exception {
        double amount = 0;
        //等待费
        Date date = new Date();
        double d = distance / 1000;//实际公里
        double t = duration / 60;//实际时间
        double d1 = (d - rule.getDouble("num2")) < 0 ? 0 : d - rule.getDouble("num2");//超出起步里程的公里
        double t1 = (t - rule.getDouble("num3")) < 0 ? 0 : t - rule.getDouble("num3");//超过起步分钟数的时间
                double d1 = (d - num2) < 0 ? 0 : d - num2;//超出起步里程的公里
                double t1 = (t - num3) < 0 ? 0 : t - num3;//超过起步分钟数的时间
        double yt1 = 0;//远途1段
        double yt2 = 0;//远途2段
        double yt3 = 0;//远途3段
@@ -207,71 +155,94 @@
        //夜间服务处理逻辑
        Calendar s = Calendar.getInstance();
        s.setTime(date);
        s.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num14").split(" - ")[0].split(":")[0]));
        s.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num14").split(" - ")[0].split(":")[1]));
                s.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num16.split(" - ")[0].split(":")[0]));
                s.set(Calendar.MINUTE, Integer.valueOf(num16.split(" - ")[0].split(":")[1]));
        Calendar e = Calendar.getInstance();
        e.setTime(date);
        e.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num14").split(" - ")[1].split(":")[0]));
        e.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num14").split(" - ")[1].split(":")[1]));
                e.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num16.split(" - ")[1].split(":")[0]));
                e.set(Calendar.MINUTE, Integer.valueOf(num16.split(" - ")[1].split(":")[1]));
        if(date.getTime() > s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()){
            if(d > rule.getDouble("num6")){
                yt1 = rule.getDouble("num18") * (rule.getDouble("num7") - rule.getDouble("num6"));
                    if(d > num8.doubleValue()){
                        yt1 = num20 * (num9 - num8);
            }
            if(d >  rule.getDouble("num9")){
                yt2 = rule.getDouble("num19") * (rule.getDouble("num10") - rule.getDouble("num9"));
                    if(d > num11.doubleValue()){
                        yt2 = num21 * (num12 - num11);
            }
            if(d > rule.getDouble("num12")){
                yt3 = rule.getDouble("num20") * (d - rule.getDouble("num12"));
                    if(d > num14.doubleValue()){
                        yt3 = num22 * (d - num14);
            }
            amount = rule.getDouble("num15") + (d1 * rule.getDouble("num16")) + (t1 * rule.getDouble("num17")) + (wait * waitMoney) + yt1 + yt2 + yt3;
        }else{
                    amount = num17 + (d1 * num18) + (t1 * num19) + (wait * num7) + yt1 + yt2 + yt3;
                    ServerCarModelWarpper serverCarModelWarpper = ServerCarModelWarpper.getServerCarModelWarpper(map);
                    serverCarModelWarpper.setAmount(new BigDecimal(amount).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                    serverCarModelWarpper.setMileage(d);
                    serverCarModelWarpper.setDuration(t);
                    data.add(serverCarModelWarpper);
                    continue;
                }
                //高峰时段处理逻辑
            Calendar s1 = Calendar.getInstance();
            s1.setTime(date);
            s1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num21").split(" - ")[0].split(":")[0]));
            s1.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num21").split(" - ")[0].split(":")[1]));
                s1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num23.split(" - ")[0].split(":")[0]));
                s1.set(Calendar.MINUTE, Integer.valueOf(num23.split(" - ")[0].split(":")[1]));
            Calendar e1 = Calendar.getInstance();
            e1.setTime(date);
            e1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num21").split(" - ")[1].split(":")[0]));
            e1.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num21").split(" - ")[1].split(":")[1]));
                e1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num23.split(" - ")[1].split(":")[0]));
                e1.set(Calendar.MINUTE, Integer.valueOf(num23.split(" - ")[1].split(":")[1]));
            Calendar s2 = Calendar.getInstance();
            s2.setTime(date);
            s2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num22").split(" - ")[0].split(":")[0]));
            s2.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num22").split(" - ")[0].split(":")[1]));
                s2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num24.split(" - ")[0].split(":")[0]));
                s2.set(Calendar.MINUTE, Integer.valueOf(num24.split(" - ")[0].split(":")[1]));
            Calendar e2 = Calendar.getInstance();
            e2.setTime(date);
            e2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num22").split(" - ")[1].split(":")[0]));
            e2.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num22").split(" - ")[1].split(":")[1]));
            //高峰时段处理逻辑
                e2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num24.split(" - ")[1].split(":")[0]));
                e2.set(Calendar.MINUTE, Integer.valueOf(num24.split(" - ")[1].split(":")[1]));
            if((date.getTime() > s1.getTimeInMillis() && date.getTime() < e1.getTimeInMillis()) || (date.getTime() > s2.getTimeInMillis() && date.getTime() < e2.getTimeInMillis())){
                if(d > rule.getDouble("num6")){
                    yt1 = rule.getDouble("num26") * (rule.getDouble("num7") - rule.getDouble("num6"));
                    if(d > num8.doubleValue()){
                        yt1 = num28 * (num9 - num8);
                }
                if(d >  rule.getDouble("num9")){
                    yt2 = rule.getDouble("num27") * (rule.getDouble("num10") - rule.getDouble("num9"));
                    if(d > num11.doubleValue()){
                        yt2 = num29 * (num12 - num11);
                }
                if(d > rule.getDouble("num12")){
                    yt3 = rule.getDouble("num28") * (d - rule.getDouble("num12"));
                    if(d > num14.doubleValue()){
                        yt3 = num30 * (d - num14);
                }
                amount = rule.getDouble("num23") + (d1 * rule.getDouble("num24")) + (t1 * rule.getDouble("num25")) + (wait * waitMoney) + yt1 + yt2 + yt3;
            }else{
                    amount = num25 + (d1 * num26) + (t1 * num27) + (wait * num7) + yt1 + yt2 + yt3;
                    ServerCarModelWarpper serverCarModelWarpper = ServerCarModelWarpper.getServerCarModelWarpper(map);
                    serverCarModelWarpper.setAmount(new BigDecimal(amount).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                    serverCarModelWarpper.setMileage(d);
                    serverCarModelWarpper.setDuration(t);
                    data.add(serverCarModelWarpper);
                    continue;
                }
                //其他时间段的计算
                if(d > rule.getDouble("num6")){
                    yt1 = rule.getDouble("num8") * (rule.getDouble("num7") - rule.getDouble("num6"));
                if(d > num8.doubleValue()){
                    yt1 = num10 * (num9 - num8);
                }
                if(d >  rule.getDouble("num9")){
                    yt2 = rule.getDouble("num11") * (rule.getDouble("num10") - rule.getDouble("num9"));
                if(d > num11.doubleValue()){
                    yt2 = num13 * (num12 - num11);
                }
                if(d > rule.getDouble("num12")){
                    yt3 = rule.getDouble("num13") * (d - rule.getDouble("num12"));
                if(d > num14.doubleValue()){
                    yt3 = num15 * (d - num14);
                }
                amount = rule.getDouble("num1") + (d1 * rule.getDouble("num4")) + (t1 * rule.getDouble("num5")) + (wait * waitMoney) + yt1 + yt2 + yt3;
                amount = num1 + (d1 * num4) + (t1 * num5) + (wait * num7) + yt1 + yt2 + yt3;
                ServerCarModelWarpper serverCarModelWarpper = ServerCarModelWarpper.getServerCarModelWarpper(map);
                serverCarModelWarpper.setAmount(new BigDecimal(amount).setScale(BigDecimal.ROUND_HALF_EVEN, 2).doubleValue());
                serverCarModelWarpper.setMileage(d);
                serverCarModelWarpper.setDuration(t);
                data.add(serverCarModelWarpper);
                continue;
            }
        }
        return amount;
        return data;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SysIntegralServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCarBrandServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TaxiCardPaymentServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TaxiCardServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbCarRentalServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbCommentServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbMessNumServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbRecruitServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbSellingCarServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbShowModularServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TbSpellOrderRuleServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserCouponRecordServiceImpl.java
@@ -70,7 +70,7 @@
    @Override
    public ResultUtil delMyCoupon(Integer id, Integer uid) throws Exception {
        UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(id);
        if(userCouponRecord.getUserId().compareTo(uid) != 0){
        if(userCouponRecord.getUserId() != uid){
            return ResultUtil.error("您不能删除此优惠券");
        }
        userCouponRecordMapper.deleteById(id);
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java
@@ -14,6 +14,7 @@
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil;
import com.stylefeng.guns.modular.system.warpper.LoginWarpper;
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
@@ -31,6 +32,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -114,6 +116,10 @@
    private String salt = "&a.s";
    private Map<String, Long> loginTime = new HashMap<>();//登录时间
    private Map<String, Integer> loginFailures = new HashMap<>();//登录失败次数
    /**
     * 获取短信验证码
@@ -147,7 +153,7 @@
                templateCode = "SMS_154775431";//修改密码
                break;
        }
        String sData = aLiSendSms.sendSms(phone, "SMS_229715276", "{\"code\":\"" + authCode + "\"}");
        String sData = aLiSendSms.sendSms(phone, templateCode, "{\"code\":\"" + authCode + "\"}");
        JSONObject jsonObject = JSON.parseObject(sData);
        String message = jsonObject.getString("Message");
        if(!"OK".equals(message)){
@@ -188,15 +194,33 @@
     */
    @Override
    public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, String registAreaCode,String loginType) throws Exception {
        phone = AESUtil.decrypt(phone);//对电话号码进行解密
        Integer frequency = loginFailures.get(phone);
        Long time = loginTime.get(phone);
        if(null != time && System.currentTimeMillis() < (time + 1800000) && null != frequency && frequency >= 5){
            return ResultUtil.error("暂时无法登录,请30分钟后重试!");
        }
        if(null != time && System.currentTimeMillis() >= (time + 1800000)){
            frequency = 0;
            loginFailures.put(phone, frequency);
        }
        boolean b = this.checkCaptcha(phone, code);
        if(!b){
            frequency = (null == frequency ? 0 : frequency) + 1;
            loginFailures.put(phone, frequency);
            if(frequency == 1){
                loginTime.put(phone, System.currentTimeMillis());
            }
            return ResultUtil.error("验证码无效");
        }
        UserInfo userInfo = userInfoMapper.queryByPhone(phone);
        String encrypt = AESUtil.encrypt(phone);//对电话号码进行加密
        UserInfo userInfo = userInfoMapper.queryByPhone(encrypt);
        if(null == userInfo){
            userInfo = new UserInfo();
            userInfo.setPhone(phone);
            userInfo.setPhone(encrypt);
            userInfo.setPassWord(ShiroKit.md5("", salt));
            userInfo.setNickName(this.getDefaultName());
            userInfo.setRegistIp(registIp);
@@ -241,7 +265,6 @@
        loginWarpper.setAppid(UUIDUtil.getRandomCode());
        loginWarpper.setEmergencyContact(userInfo.getEmergencyContact());
        loginWarpper.setEmergencyContactNumber(userInfo.getEmergencyContactNumber());
        loginWarpper.setPhone(2);
        smsrecordService.saveData(1, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!");
        return ResultUtil.success(loginWarpper);
@@ -260,14 +283,17 @@
        }
        System.out.println( response);
        JSONObject json = JSONObject.parseObject(response);
        if(!json.getBoolean("success")){
        if(null == json || !json.getBoolean("success")){
            return ResultUtil.error("登录失败");
        }
        String phone = json.getJSONObject("data").getString("mobile");
        UserInfo userInfo = userInfoMapper.queryByPhone(phone);
        String encrypt = AESUtil.encrypt(phone);//对电话号码进行加密
        UserInfo userInfo = userInfoMapper.queryByPhone(encrypt);
        if(null == userInfo){
            userInfo = new UserInfo();
            userInfo.setPhone(phone);
            userInfo.setPhone(encrypt);
            userInfo.setPassWord(ShiroKit.md5("", salt));
            userInfo.setNickName(this.getDefaultName());
            userInfo.setRegistIp(registIp);
@@ -331,9 +357,9 @@
                        incomeService.saveData(2, driver.getId(), 1, Integer.valueOf(String.valueOf(map.get("id"))), null, Double.valueOf(String.valueOf(map.get("money"))));
                    }
                }
                driver.setActivityMoney(bigDecimal.add(new BigDecimal(null == driver.getActivityMoney() ? 0 : driver.getActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(null == driver.getLaveActivityMoney() ? 0 : driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                driver.setBalance(bigDecimal.add(new BigDecimal(null == driver.getBalance() ? 0 : driver.getBalance())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                driver.setActivityMoney(bigDecimal.add(new BigDecimal(driver.getActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                driver.setBalance(bigDecimal.add(new BigDecimal(driver.getBalance())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                driverMapper.updateById(driver);
                Map<String, Date> date = dateUtil.getStartAndEndDate(new Date());
@@ -407,7 +433,19 @@
     */
    @Override
    public ResultUtil<LoginWarpper> userLogin(String phone, String password,String loginType) throws Exception {
        UserInfo userInfo = this.queryByPhone(phone);
        Integer frequency = loginFailures.get(phone);
        Long time = loginTime.get(phone);
        if(null != time && System.currentTimeMillis() < (time + 1800000) && null != frequency && frequency >= 5){
            return ResultUtil.error("暂时无法登录,请30分钟后重试!");
        }
        if(null != time && System.currentTimeMillis() >= (time + 1800000)){
            frequency = 0;
            loginFailures.put(phone, frequency);
        }
        String encrypt = AESUtil.encrypt(phone);//对电话号码进行加密
        UserInfo userInfo = this.queryByPhone(encrypt);
        if(null == userInfo){
            return ResultUtil.error("账号无效");
        }
@@ -415,6 +453,11 @@
            return ResultUtil.error("账号被冻结");
        }
        if(!ShiroKit.md5(password, salt).equals(userInfo.getPassWord())){
            frequency = (null == frequency ? 0 : frequency) + 1;
            loginFailures.put(phone, frequency);
            if(frequency == 1){
                loginTime.put(phone, System.currentTimeMillis());
            }
            return ResultUtil.error("密码错误");
        }
@@ -445,6 +488,7 @@
    @Override
    public ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp,
                                            String registAreaCode, Integer sex, String nickName, String avatar,String loginType) throws Exception {
        UserInfo userInfo = null;
        if(type == 2){//小程序
            if(ToolUtil.isEmpty(jscode)){
@@ -500,7 +544,15 @@
        if(userInfo.getState() == 2){
            return ResultUtil.error("账号被冻结");
        }
        Integer frequency = loginFailures.get(userInfo.getPhone());
        Long time = loginTime.get(userInfo.getPhone());
        if(null != time && System.currentTimeMillis() < (time + 1800000) && null != frequency && frequency >= 5){
            return ResultUtil.error("暂时无法登录,请30分钟后重试!");
        }
        if(null != time && System.currentTimeMillis() >= (time + 1800000)){
            frequency = 0;
            loginFailures.put(userInfo.getPhone(), frequency);
        }
        if(type == 2){//小程序登录
            String value = redisUtil.getValue("appletOpenId");
            JSONObject jsonObject = null;
@@ -538,11 +590,16 @@
     */
    @Override
    public ResultUtil forgetPassword(String phone, String code, String password) throws Exception {
        phone = AESUtil.decrypt(phone);//对电话号码进行解密
        boolean b = this.checkCaptcha(phone, code);
        if(!b){
            return ResultUtil.error("验证码无效");
        }
        UserInfo userInfo = this.queryByPhone(phone);
        String encrypt = AESUtil.encrypt(phone);//对电话号码进行加密
        UserInfo userInfo = this.queryByPhone(encrypt);
        if(null == userInfo){
            return ResultUtil.error("手机号码未注册");
        }
@@ -569,12 +626,20 @@
     */
    @Override
    public ResultUtil bindingPhone(Integer uid, String phone, String code,String loginType) throws Exception {
        if(ToolUtil.isEmpty(phone)){
            return ResultUtil.error("手机号不能为空");
        }
        phone = AESUtil.decrypt(phone);//对电话号码进行解密
        boolean b = this.checkCaptcha(phone, code);
        if(!b){
            return ResultUtil.error("验证码无效");
        }
        UserInfo userInfo = this.selectById(uid);
        UserInfo userInfo1 = userInfoMapper.queryByPhone(phone);
        String encrypt = AESUtil.encrypt(phone);//对电话号码进行加密
        UserInfo userInfo1 = userInfoMapper.queryByPhone(encrypt);
        if(null != userInfo1){
            userInfo1.setOpenId(userInfo.getOpenId());
            userInfo1.setUnionid(userInfo.getUnionid());
@@ -584,7 +649,7 @@
            userInfo1.setNickName(userInfo.getNickName());
            this.updateById(userInfo1);
            if(ToolUtil.isNotEmpty(loginType) && loginType.equals("Applets")){//小程序登录后绑定手机号码
            if(loginType.equals("Applets")){//小程序登录后绑定手机号码
                String value = redisUtil.getValue("appletOpenId");
                JSONObject jsonObject = null;
                if(ToolUtil.isNotEmpty(value)){
@@ -632,7 +697,7 @@
            return ResultUtil.success(loginWarpper);
        }
        userInfo.setPhone(phone);
        userInfo.setPhone(encrypt);
        userInfo.setUpdateTime(new Date());
        userInfo.setUpdateUser(userInfo.getId());
        this.updateById(userInfo);
@@ -676,7 +741,8 @@
     */
    @Override
    public Map<String, Object> queryUserInfo(Integer uid) throws Exception {
        return userInfoMapper.queryUserInfo(uid, null);
        Map<String, Object> map = userInfoMapper.queryUserInfo(uid, null);
        return map;
    }
@@ -719,43 +785,24 @@
        if(money.compareTo(0D) <= 0){
            return ResultUtil.error("支付金额必须大于0元");
        }
        if(payType == 1){//微信支付
            String value = redisUtil.getValue("appletOpenId");
            String appletsOpenId = null;
            if(ToolUtil.isNotEmpty(value)){
                JSONObject jsonObject = JSON.parseObject(value);
                appletsOpenId = jsonObject.getString(uid.toString());
            }else{
                appletsOpenId = userInfo.getAppletsOpenId();
            }
            Integer integer = paymentRecordService.saveData(2, uid, 1, null, null, 1, money, "", 1);//添加预支付数据
            String app = type == 1 ? "APP" : "JSAPI";
            return payMoneyUtil.weixinpay("余额充值", uid.toString(), integer.toString(), money.toString(), "/base/wxCancelUserBalance", app, userInfo.getAppletsOpenId());
//            Map<String, String> map = icbcPayUtil.placeAnOrder(integer.toString(), 9, 5, uid.toString(), "余额充值", money, callbackPath + "/base/wxCancelUserBalance", uid.toString(), type, appletsOpenId);
//            if(map.get("code").equals("200")){
//                PaymentRecord paymentRecord = paymentRecordService.selectById(integer);
//                paymentRecord.setCode(map.get("order_id"));
//                paymentRecordService.updateById(paymentRecord);
//                return ResultUtil.success(map.get("data"));
//            }else{
//                return ResultUtil.error(map.get("msg"), "");
//            }
        Integer integer = paymentRecordService.saveData(2, uid, 1, null, null, payType, money, "", 1);//添加预支付数据
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String out_trade_no = sdf.format(new Date()) + integer;
        if(payType == 1){//微信支付
            String appletsOpenId = "";
            String tradeType = "APP";
            if(type == 3){
                appletsOpenId = userInfo.getAppletsOpenId();
                tradeType = "JSAPI";
                if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                    return ResultUtil.error("支付异常,请重新授权登录小程序");
                }
            }
            return payMoneyUtil.weixinpay("余额充值", uid.toString(), out_trade_no, money.toString(), callbackPath + "/base/wxCancelUserBalance", tradeType, appletsOpenId);
        }
        if(payType == 2){//支付宝支付
            Integer integer = paymentRecordService.saveData(2, uid, 1, null, null, 2, money, "", 1);//添加预支付数据
            return payMoneyUtil.alipay("余额充值", "余额充值", uid.toString(), integer.toString(), money.toString(), "/base/aliCancelUserBalance");
//            Map<String, String> map = icbcPayUtil.placeAnOrder(integer.toString(), 10, 5, uid.toString(), "余额充值", money, callbackPath + "/base/aliCancelUserBalance", uid.toString(), type, null);
//            if(map.get("code").equals("200")){
//                PaymentRecord paymentRecord = paymentRecordService.selectById(integer);
//                paymentRecord.setCode(map.get("order_id"));
//                paymentRecordService.updateById(paymentRecord);
//                return ResultUtil.success(map.get("data"));
//            }else{
//                return ResultUtil.error(map.get("msg"), "");
//            }
            return payMoneyUtil.alipay("完成订单", uid.toString(), out_trade_no, money.toString(), callbackPath + "/base/aliCancelUserBalance");
        }
        return ResultUtil.success();
    }
@@ -771,16 +818,20 @@
     */
    @Override
    public ResultUtil updatePhone(String code, String phone, Integer uid) throws Exception {
        phone = AESUtil.decrypt(phone);//解密
        boolean b = this.checkCaptcha(phone, code);
        if(!b){
            return ResultUtil.error("验证码无效");
        }
        UserInfo userInfo = this.selectById(uid);
        UserInfo userInfo1 = userInfoMapper.queryByPhone(phone);
        String encrypt = AESUtil.encrypt(phone);//对手机号进行加密
        UserInfo userInfo1 = userInfoMapper.queryByPhone(encrypt);
        if(null != userInfo1){
            return ResultUtil.error("手机号已被注册");
        }
        userInfo.setPhone(phone);
        userInfo.setPhone(encrypt);
        this.updateById(userInfo);
//        smsrecordService.saveData(2, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!");
@@ -894,7 +945,7 @@
//        map.put("clientSecret", "JZrYSBvtVlIRbnsnoJuaqheRWAEHcEJVgeAeIHAUojwUwZIAVzSpAWxgozhfPbcq");
        map.put("grantType", "authorization_code");
        map.put("authCode", authCode);
        String get = httpClientUtil.pushHttpRequset("GET", path + "/api/oauth/accessToken", map, null, "");
        String get = httpClientUtil.pushHttpRequset("GET", path + "/api/oauth/accessToken", map, null, "").getData();
        System.err.print("获取accessToken:" + get);
        JSONObject jsonObject = JSON.parseObject(get);
        Boolean success = jsonObject.getBoolean("success");
@@ -908,7 +959,7 @@
            if(null == userInfo){
                return ResultUtil.error("获取用户信息失败");
            }
            return this.captchaLogin(userInfo.get("phone"), "1234", null, registAreaCode, loginType);
            return this.captchaLogin(AESUtil.encrypt(userInfo.get("phone")), "1234", null, registAreaCode, loginType);
        }else{
            return ResultUtil.error(jsonObject.getString("msg"));
        }
@@ -944,7 +995,12 @@
//        String path = "https://open.test.brightcns.cn";//测试环境
        Map<String, Object> map = new HashMap<>();
        map.put("accessToken", accessToken);
        String get = httpClientUtil.pushHttpRequset("GET", path + "/api/userinfo", map, null, "");
        String get = null;
        try {
            get = httpClientUtil.pushHttpRequset("GET", path + "/api/userinfo", map, null, "").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.print("获取用户信息:" + get);
        JSONObject jsonObject = JSON.parseObject(get);
        Boolean success = jsonObject.getBoolean("success");
@@ -1111,7 +1167,7 @@
     */
    public String getDefaultName(){
        int num = this.selectCount(new EntityWrapper<UserInfo>().ne("flag", 3)) + 1000001;
        return "JYX" + String.valueOf(num).substring(1);
        return "OK" + String.valueOf(num).substring(1);
    }
@@ -1124,8 +1180,12 @@
    private String getToken(UserInfo userInfo, String password,String type) throws Exception{
        if(ToolUtil.isEmpty(type))type="APP";
        //封装请求账号密码为shiro可验证的token
        UsernamePasswordToken usernamePasswordToken = new UsernamePasswordToken(userInfo.getPhone(), password.toCharArray());
        String credentials = userInfo.getPassWord();
        if(ToolUtil.isEmpty(password)){
            password = "123456";
            credentials = ShiroKit.md5(password, salt);
        }
        UsernamePasswordToken usernamePasswordToken = new UsernamePasswordToken(userInfo.getPhone(), password.toCharArray());
        ByteSource credentialsSalt = new Md5Hash(salt);
        SimpleAuthenticationInfo simpleAuthenticationInfo = new SimpleAuthenticationInfo(
                new ShiroUser(), credentials, credentialsSalt, "");
@@ -1149,7 +1209,7 @@
     * @param userInfo
     * @throws Exception
     */
    private synchronized void addCoupon(UserInfo userInfo) throws Exception{
    public synchronized void addCoupon(UserInfo userInfo) throws Exception{
        //添加优惠券
        List<Map<String, Object>> list = userActivityRegisteredService.query(userInfo.getCompanyId());
        int num = 0;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserMerchantCouponServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserTaxiCardServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserUserServiceImpl.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/VerifiedServiceImpl.java
@@ -6,9 +6,7 @@
import com.stylefeng.guns.modular.system.model.Verified;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.service.IVerifiedService;
import com.stylefeng.guns.modular.system.util.ALiApiUtil;
import com.stylefeng.guns.modular.system.util.JuHeUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -37,7 +35,8 @@
     */
    @Override
    public ResultUtil verified(Verified verified, Integer uid) throws Exception {
        boolean b = juHeUtil.idcard(verified.getName(), verified.getIdcode());
        String travel = AESUtil.decrypt(verified.getIdcode());//解密
        boolean b = aLiApiUtil.authentication(verified.getName(), travel);
        verified.setState(b ? 2 : 3);
        verified.setUserId(uid);
        verified.setInsertTime(new Date());
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/WithdrawalServiceImpl.java
@@ -2,13 +2,14 @@
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.system.dao.WithdrawalMapper;
import com.stylefeng.guns.modular.system.model.BankCard;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.UserInfo;
import com.stylefeng.guns.modular.system.model.Withdrawal;
import com.stylefeng.guns.modular.system.service.IBankCardService;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.service.IWithdrawalService;
import com.stylefeng.guns.modular.system.util.ICBCPayUtil;
import com.stylefeng.guns.modular.system.util.PayMoneyUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -35,7 +36,7 @@
    private ICBCPayUtil icbcPayUtil;
    @Autowired
    private PayMoneyUtil payMoneyUtil;
    private IBankCardService bankCardService;
    private Map<String, Timer> timerMap = new HashMap<>();
@@ -51,7 +52,7 @@
     * @throws Exception
     */
    @Override
    public ResultUtil withdrawal(Double money, String bankName, String code, String name, Integer uid) throws Exception {
    public ResultUtil withdrawal(Double money, String code, String name, Integer uid) throws Exception {
        if(money.compareTo(0D) <= 0){
            return ResultUtil.error("提现金额必须大于0");
        }
@@ -65,7 +66,6 @@
        Withdrawal withdrawal = new Withdrawal();
        withdrawal.setBalance(userInfo.getBalance());
        withdrawal.setBankName(bankName);
        withdrawal.setCode(code);
        withdrawal.setFlag(1);
        withdrawal.setInsertTime(new Date());
@@ -74,14 +74,51 @@
        withdrawal.setState(1);
        withdrawal.setUserId(uid);
        withdrawal.setUserType(1);
        ResultUtil<String> transfer = icbcPayUtil.transfer(Double.valueOf(withdrawal.getMoney() * 100).longValue(), withdrawal.getCode(), withdrawal.getName());
        if(transfer.getCode() != 200){
            return transfer;
        }
        withdrawal.setSerialNo(transfer.getData());
        this.insert(withdrawal);
        double v = new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
        double v = new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
        userInfo.setBalance(v);
        userInfoService.updateById(userInfo);
        return ResultUtil.success();
    }
    @Override
    public ResultUtil withdrawal1(Double money, String acctName, Integer bankCardId, Integer uid) throws Exception {
        if(money.compareTo(0D) <= 0){
            return ResultUtil.error("提现金额必须大于0");
        }
        UserInfo userInfo = userInfoService.selectById(uid);
        if(null == userInfo.getBalance()){
            return ResultUtil.error("账户没有余额,不能提现");
        }
        if(userInfo.getBalance().compareTo(money) < 0){
            return ResultUtil.error("提现金额必须小于账户余额");
        }
        BankCard bankCard = bankCardService.selectById(bankCardId);
        Withdrawal withdrawal = new Withdrawal();
        withdrawal.setBalance(userInfo.getBalance());
        withdrawal.setCode(bankCard.getCode());
        withdrawal.setFlag(1);
        withdrawal.setInsertTime(new Date());
        withdrawal.setMoney(money);
        withdrawal.setName(acctName);
        withdrawal.setState(1);
        withdrawal.setUserId(uid);
        withdrawal.setUserType(1);
        this.insert(withdrawal);
        double v = new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
        userInfo.setBalance(v);
        userInfoService.updateById(userInfo);
        return ResultUtil.success();
    }
    /**
     * 获取历史提交数
@@ -118,26 +155,28 @@
            TimerTask timerTask = new TimerTask() {
                @Override
                public void run() {
                    try {
                        Map<String, String> map = payMoneyUtil.wxPayBank("用户提现", withdrawal.getMoney().toString(), withdrawal.getId().toString(), withdrawal.getCode(), withdrawal.getName(), withdrawal.getBankName());
                        if("SUCCESS".equals(map.get("return_code"))){
                            withdrawal.setSerialNo(map.get("payment_no"));
                    Integer integer = icbcPayUtil.queryTransfer(withdrawal.getSerialNo());
                    if(integer == 0){//交易成功
                            withdrawal.setState(2);
                            WithdrawalServiceImpl.this.updateById(withdrawal);
                            Timer timer = timerMap.get(withdrawal.getSerialNo());
                            timer.cancel();
                        }else{
                            UserInfo userInfo = userInfoService.selectById(withdrawal.getUserId());
                            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                            userInfoService.updateById(userInfo);
                            withdrawal.setState(3);
                            WithdrawalServiceImpl.this.updateById(withdrawal);
                            Timer timer = timerMap.get(withdrawal.getSerialNo());
                            timer.cancel();
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    if(integer == 2){//交易拒绝/失败
                        //还原余额
                        if(withdrawal.getUserType() == 1){//用户
                            withdrawal.setState(3);
                            WithdrawalServiceImpl.this.updateById(withdrawal);
                            UserInfo userInfo = userInfoService.selectById(withdrawal.getUserId());
                            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                            userInfoService.updateById(userInfo);
                            Timer timer = timerMap.get(withdrawal.getSerialNo());
                            timer.cancel();
                        }
                    }
                }
            };
@@ -146,6 +185,10 @@
            timerMap.put(withdrawal.getSerialNo(), timer);
        }
        if(state == 2){//审核拒绝
            UserInfo userInfo = userInfoService.selectById(withdrawal.getUserId());
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            userInfoService.updateById(userInfo);
            withdrawal.setState(3);
            this.updateById(withdrawal);
        }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AESUtil.java
New file
@@ -0,0 +1,98 @@
package com.stylefeng.guns.modular.system.util;
import com.stylefeng.guns.core.util.ToolUtil;
import org.springframework.util.Base64Utils;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.spec.InvalidKeySpecException;
import java.util.Base64;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 * 定义AES加密解密工具类
 */
public class AESUtil {
    private static final String KEY_ALGORITHM = "AES";//加密方式
    private static final String DEFAULT_CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding";//默认的加密算法
    private static final String KEY = "xqT86jictTPpHMem";//密码
    private static final String IV_PARAMETER = "xqT86jicxqT86jic";//偏移量
    private static final String CHARSET = "UTF-8";//编码
    /**
     * 加密操作
     * @param content  待加密内容
     * @return
     * @throws Exception
     */
    public static String encrypt(String content) {
        try {
            if(ToolUtil.isEmpty(content)){
                return content;
            }
            Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
            byte[] raw = KEY.getBytes(CHARSET);
            SecretKeySpec skeySpec = new SecretKeySpec(raw, KEY_ALGORITHM);
            IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes());
            cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
            byte[] encrypted = cipher.doFinal(content.getBytes(CHARSET));
            return Base64Utils.encodeToString(encrypted);
        }catch (Exception e){
            e.printStackTrace();
        }
        return content;
    }
    /**
     *解密操作
     * @param content 待解密内容
     * @return
     * @throws Exception
     */
    public static String decrypt(String content) {
        try {
            if(ToolUtil.isEmpty(content)){
                return content;
            }
            byte[] raw = KEY.getBytes(CHARSET);
            SecretKeySpec skeySpec = new SecretKeySpec(raw, KEY_ALGORITHM);
            Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
            IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes());
            cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
            byte[] encrypted1 = Base64Utils.decodeFromString(content);
            byte[] original = cipher.doFinal(encrypted1);
            String originalString = new String(original, CHARSET);
            return originalString;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return content;
    }
    public static void main(String[] ages){
//        String encrypt = AESUtil.encrypt("19167181339");
//        System.err.println(encrypt);
        String encrypt = AESUtil.encrypt("VM0S5boDnJqBFZUxn4X6Vw==");
        System.err.println(encrypt);
//        String travel = AESUtil.decrypt("wRhQ5gEAAAEQAAAAAAAAAA==");
//        System.err.println(travel);
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ALiApiUtil.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -34,7 +35,12 @@
        param.put("verifyKey", "IVO4js5kValcdt");
        param.put("userName", name);
        param.put("identifyNum", code);
        String get = httpClientUtil.pushHttpRequset("GET", url, param, header, "form");
        String get = null;
        try {
            get = httpClientUtil.pushHttpRequset("GET", url, param, header, "form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject jsonObject = JSON.parseObject(get);
        if(jsonObject.getIntValue("code") == 200){
            JSONObject value = jsonObject.getJSONObject("value");
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ALiSendSms.java
@@ -21,8 +21,8 @@
    // 设置鉴权参数,初始化客户端
    private DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",// 地域ID
            "LTAI5tCeHnZXREQBcVf3NHLB",// 您的AccessKey ID
            "OEX6AtRb3qOCyp53xOFdDEYgBjzZzS");// 您的AccessKey Secret
            "LTAI4G9Zez9H4B36vakPXGy4",// 您的AccessKey ID
            "BOVPUeZndKVbrPOq6Ef5j6oiydB3XZ");// 您的AccessKey Secret
    private IAcsClient client = new DefaultAcsClient(profile);
    private static void log_print(String functionName, Object result) {
@@ -70,7 +70,7 @@
        // 接收短信的手机号码
        request.putQueryParameter("PhoneNumbers", phone);
        // 短信签名名称。请在控制台签名管理页面签名名称一列查看(必须是已添加、并通过审核的短信签名)。
        request.putQueryParameter("SignName", "嘉易行");
        request.putQueryParameter("SignName", "OK出行");
        // 短信模板ID
        request.putQueryParameter("TemplateCode", templateCode);
        // 短信模板变量对应的实际值,JSON格式。
@@ -110,7 +110,7 @@
            // 创建短信模板
            String templateCode = sendSmsDemo.addSmsTemplate();
            // 使用刚创建的短信模板发送短信
            String sData = sendSmsDemo.sendSms("15828353127", "SMS_229790135", "{\"code\":\"8888\"}");
            String sData = sendSmsDemo.sendSms("156xxxxxxxx", templateCode, "{\"code\":\"8888\"}");
            Gson gson = new Gson();
            Map map = gson.fromJson(sData, Map.class);
            String bizId = map.get("BizId").toString();
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ChinaMobileUtil.java
@@ -1,12 +1,12 @@
package com.stylefeng.guns.modular.system.util;
import com.alibaba.fastjson.JSON;
import com.aliyun.dyplsapi20170525.models.*;
import com.aliyun.teaopenapi.models.*;
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.core.util.MD5Util;
import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -16,98 +16,114 @@
@Component
public class ChinaMobileUtil {
    private String accessKeyId = "LTAI5tCeHnZXREQBcVf3NHLB";
    private String APIKey = "zj42494b1bdd416b9762229af6b5cbbd";
    private String accessKeySecret = "OEX6AtRb3qOCyp53xOFdDEYgBjzZzS";
    private String SecretKey = "30323561316534653735613230316339";
    private String poolKey = "FC100000145494178";//号码池KEY
    /**
     * 使用AK&SK初始化账号Client
     * @return Client
     * @throws Exception
     */
    public com.aliyun.dyplsapi20170525.Client createClient() throws Exception {
        Config config = new Config()
                // 您的AccessKey ID
                .setAccessKeyId(accessKeyId)
                // 您的AccessKey Secret
                .setAccessKeySecret(accessKeySecret);
        // 访问的域名
        config.endpoint = "dyplsapi.aliyuncs.com";
        return new com.aliyun.dyplsapi20170525.Client(config);
    }
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
     * 绑定隐私号
     * 绑定小号
     * @param phoneA
     * @param phoneB
     * @param expiration    "2021-12-14 12:00:00"
     * @param areaCode
     * @return
     * @throws Exception
     */
    public Map<String, String> midAxbBindSend(String phoneA, String phoneB, Long expiration) throws Exception{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        com.aliyun.dyplsapi20170525.Client client = createClient();
        BindAxbRequest bindAxbRequest = new BindAxbRequest()
                .setPhoneNoA(phoneA)
                .setExpiration(sdf.format(new Date(expiration)))
                .setPoolKey(poolKey)
                .setPhoneNoB(phoneB);
        // 复制代码运行请自行打印 API 的返回值
        BindAxbResponse bindAxbResponse = client.bindAxb(bindAxbRequest);
        Map<String, String> map = new HashMap<>();
        if(!bindAxbResponse.getBody().getCode().equals("OK")){
            map.put("code", "-1");
    public Map<String, String> midAxbBindSend(String phoneA, String phoneB, Integer areaCode) throws Exception{
        //组装请求对象-具体描述见开发文档-订单小号-AXB接口规范部分内容
        Map<String, Object> request = new HashMap<>();
        request.put("APPID", APIKey);
        request.put("bindtype", "AXB");
        request.put("requestId", UUIDUtil.getRandomCode(16));
        request.put("record", "0");
        //用户号码,必填,格式遵循国际电信联盟定义的E.164标准
        request.put("telA", "86" + phoneA);
        //用户号码B,必填,格式遵循国际电信联盟定义的E.164标准
        request.put("telB", "86" + phoneB);
        //需要选择的小号所属区号,当telX不写时必填,例如:杭州(571)
        request.put("areaCode", 571);
        //订单小号,非必填,当指定小号绑定时填写,格式遵循国际电信联盟定义的E.164标准
//        request.setTelX("8618867110000");
        //绑定关系过期失效时间,秒,取值必须大于0且最大值不超过4294967296
        request.put("expiration", Integer.valueOf(7 * 24 * 60 * 60));
        Map<String, String> header = new HashMap<String, String>(3);
        header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes())));
        header.put("Content-Type", "application/json;charset=utf-8");
        String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/binding", request, header, "json").getData();
        Map<String, String> map1 = new HashMap<>();
        if(post.indexOf("0000") != -1){
            JSONObject jsonObject = JSONObject.parseObject(post);
            if(jsonObject.getString("code").equals("0000")){
                map1.put("code", "200");
                map1.put("msg", jsonObject.getString("message"));
                map1.put("telX", jsonObject.getString("x_no").substring(2));
                map1.put("bindId", jsonObject.getString("bindId"));
        }else{
            map.put("code", "200");
            map.put("telX", bindAxbResponse.getBody().getSecretBindDTO().getSecretNo());
            map.put("bindId", bindAxbResponse.getBody().getSecretBindDTO().getSubsId());
                map1.put("code", jsonObject.getString("code"));
                map1.put("msg", jsonObject.getString("message"));
        }
        return map;
        }else{
            map1.put("code", "-1");
            map1.put("msg", post);
        }
        return map1;
    }
    /**
     * 修改绑定关系
     * 解绑小号关系
     * @param bindId    绑定关系id
     * @param phone     隐私号
     * @return
     * @throws Exception
     */
    public Map<String, String> midAxbUnBindSend(String bindId, String phone, Long expiration) throws Exception{
        com.aliyun.dyplsapi20170525.Client client = createClient();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        UpdateSubscriptionRequest updateSubscriptionRequest = new UpdateSubscriptionRequest()
                .setPoolKey(poolKey)
                .setSubsId(bindId)
                .setPhoneNoX(phone)
                .setOperateType("updateExpire")
                .setExpiration(sdf.format(new Date(expiration)));
        // 复制代码运行请自行打印 API 的返回值
        UpdateSubscriptionResponse updateSubscriptionResponse = client.updateSubscription(updateSubscriptionRequest);
        Map<String, String> map = new HashMap<>();
        if(!updateSubscriptionResponse.getBody().getCode().equals("OK")){
            map.put("code", "-1");
    public Map<String, String> midAxbUnBindSend(String bindId) throws Exception{
        //组装请求对象-具体描述见开发文档-订单小号-AXB接口规范部分内容
        Map<String, Object> request = new HashMap<>();
        //绑定关系ID
        request.put("APPID", APIKey);
        request.put("bindId", bindId);
        Map<String, String> header = new HashMap<String, String>(3);
        header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes())));
        header.put("Content-Type", "application/json;charset=utf-8");
        String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/unbinding", request, header, "json").getData();
        JSONObject jsonObject = JSONObject.parseObject(post);
        Map<String, String> map1 = new HashMap<>();
        if(jsonObject.getString("code").equals("0000")){
            map1.put("code", "200");
            map1.put("msg", jsonObject.getString("message"));
        }else{
            map.put("code", "200");
            map1.put("code", jsonObject.getString("code"));
            map1.put("msg", jsonObject.getString("message"));
        }
        return map;
        return map1;
    }
    public static void main(String[] ages){
        try {
            ChinaMobileUtil chinaMobileUtil = new ChinaMobileUtil();
            Map<String, String> map = chinaMobileUtil.midAxbBindSend("15828353127", "18382330577", System.currentTimeMillis() + 100000);
            System.err.println(JSON.toJSONString(map));
            chinaMobileUtil.midAxbUnBindSend(map.get("bindId"), map.get("telX"), System.currentTimeMillis() + 60000);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    public Map<String, String> HeaderUtils(String APIKey, String SecretKey) throws Exception{
        Map<String, String> header = new HashMap<>();
        long time = System.currentTimeMillis();
        String signStr = MD5Util.encrypt(APIKey + SecretKey + time);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("apiKey", APIKey);
        jsonObject.put("time", time);
        jsonObject.put("sign", signStr);
        Base64 base64 = new Base64();
        String s = base64.encodeToString(jsonObject.toJSONString().getBytes("UTF-8"));
        header.put("header", s);
        jsonObject = new JSONObject();
        jsonObject.put("platformId", "");
        jsonObject.put("secret", "");
        s = base64.encodeToString(jsonObject.toJSONString().getBytes("UTF-8"));
        header.put("accessCode", s);
        return header;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DESUtil.java
New file
@@ -0,0 +1,195 @@
package com.stylefeng.guns.modular.system.util;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.CipherOutputStream;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;
import java.io.*;
import java.security.Key;
import java.security.Security;
import java.util.Base64;
public class DESUtil {
    /**
     * 偏移变量,固定占8位字节
     */
    private final static String IV_PARAMETER = "12345678";
    /**
     * 密钥算法
     */
    private static final String ALGORITHM = "DES";
    /**
     * 加密/解密算法-工作模式-填充模式
     */
    private static final String CIPHER_ALGORITHM = "DES/ECB/PKCS7Padding";
    /**
     * 默认编码
     */
    private static final String CHARSET = "utf-8";
    //设置java支持PKCS7Padding
    static {
        Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    }
    public static void main(String[] args) {
        String s = "123456";
        // 加密
        String s2 = encrypt("xqT86jictTPpHMem", s);
        System.out.println(s2);
        //解密
        String s3 = decrypt("xqT86jictTPpHMem", s2);
        System.out.println(s3);
    }
    /**
     * 生成key
     *
     * @param password
     * @return
     * @throws Exception
     */
    private static Key generateKey(String password) throws Exception {
        DESKeySpec dks = new DESKeySpec(password.getBytes(CHARSET));
        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM);
        return keyFactory.generateSecret(dks);
    }
    /**
     * DES加密字符串
     *
     * @param password 加密密码,长度不能够小于8位
     * @param data 待加密字符串
     * @return 加密后内容
     */
    public static String encrypt(String password, String data) {
        if (password== null || password.length() < 8) {
            throw new RuntimeException("加密失败,key不能小于8位");
        }
        if (data == null)
            return null;
        try {
            Key secretKey = generateKey(password);
            Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
//            IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET));
            cipher.init(Cipher.ENCRYPT_MODE, secretKey);
            byte[] bytes = cipher.doFinal(data.getBytes(CHARSET));
            //JDK1.8及以上可直接使用Base64,JDK1.7及以下可以使用BASE64Encoder
            //Android平台可以使用android.util.Base64
            return new String(Base64.getEncoder().encode(bytes));
        } catch (Exception e) {
            e.printStackTrace();
            return data;
        }
    }
    /**
     * DES解密字符串
     *
     * @param password 解密密码,长度不能够小于8位
     * @param data 待解密字符串
     * @return 解密后内容
     */
    public static String decrypt(String password, String data) {
        if (password== null || password.length() < 8) {
            throw new RuntimeException("加密失败,key不能小于8位");
        }
        if (data == null)
            return null;
        try {
            Key secretKey = generateKey(password);
            Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
//            IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET));
            cipher.init(Cipher.DECRYPT_MODE, secretKey);
            return new String(cipher.doFinal(Base64.getDecoder().decode(data.getBytes(CHARSET))), CHARSET);
        } catch (Exception e) {
            e.printStackTrace();
            return data;
        }
    }
    /**
     * DES加密文件
     *
     * @param srcFile  待加密的文件
     * @param destFile 加密后存放的文件路径
     * @return 加密后的文件路径
     */
    public static String encryptFile(String password, String srcFile, String destFile) {
        if (password== null || password.length() < 8) {
            throw new RuntimeException("加密失败,key不能小于8位");
        }
        try {
//            IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET));
            Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
            cipher.init(Cipher.ENCRYPT_MODE, generateKey(password));
            InputStream is = new FileInputStream(srcFile);
            OutputStream out = new FileOutputStream(destFile);
            CipherInputStream cis = new CipherInputStream(is, cipher);
            byte[] buffer = new byte[1024];
            int r;
            while ((r = cis.read(buffer)) > 0) {
                out.write(buffer, 0, r);
            }
            cis.close();
            is.close();
            out.close();
            return destFile;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }
    /**
     * DES解密文件
     *
     * @param srcFile  已加密的文件
     * @param destFile 解密后存放的文件路径
     * @return 解密后的文件路径
     */
    public static String decryptFile(String password, String srcFile, String destFile) {
        if (password== null || password.length() < 8) {
            throw new RuntimeException("加密失败,key不能小于8位");
        }
        try {
            File file = new File(destFile);
            if (!file.exists()) {
                file.getParentFile().mkdirs();
                file.createNewFile();
            }
//            IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET));
            Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM);
            cipher.init(Cipher.DECRYPT_MODE, generateKey(password));
            InputStream is = new FileInputStream(srcFile);
            OutputStream out = new FileOutputStream(destFile);
            CipherOutputStream cos = new CipherOutputStream(out, cipher);
            byte[] buffer = new byte[1024];
            int r;
            while ((r = is.read(buffer)) >= 0) {
                cos.write(buffer, 0, r);
            }
            cos.close();
            is.close();
            out.close();
            return destFile;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDFalconUtil.java
@@ -21,7 +21,7 @@
@Component
public class GDFalconUtil implements ApplicationRunner {
    private String key = "ba2915f8d8c1428df72e964a5f94f167";
    private String key = "e17d799b2506d05faf7f88320a266803";
    @Autowired
    private RestTemplate restTemplate;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDMapElectricFenceUtil.java
@@ -33,7 +33,7 @@
    @Autowired
    private IGDInterfaceService gdInterfaceService;
    private String key = "ba2915f8d8c1428df72e964a5f94f167";
    private String key = "e17d799b2506d05faf7f88320a266803";
    private JSONArray jsonArray = new JSONArray();
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDMapGeocodingUtil.java
@@ -20,7 +20,7 @@
@Component
public class GDMapGeocodingUtil {
    private String key = "ba2915f8d8c1428df72e964a5f94f167";
    private String key = "e17d799b2506d05faf7f88320a266803";
    @Autowired
    private RestTemplate restTemplate;
@@ -113,8 +113,10 @@
        String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan;
        String forObject = restTemplate.getForObject(url, String.class);
        JSONObject jsonObject = JSON.parseObject(forObject);
        System.out.println(url);
        Map<String, String> map = new HashMap<>();
//        gdInterfaceService.saveData("https://restapi.amap.com/v3/geocode/regeo", "经纬度转行政区域");
        if(jsonObject.getString("status").equals("1")){
            JSONObject regeocode = jsonObject.getJSONObject("regeocode");
            JSONObject addressComponent = regeocode.getJSONObject("addressComponent");
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/HttpClientUtil.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ICBCPayUtil.java
@@ -9,6 +9,7 @@
import com.icbc.api.request.*;
import com.icbc.api.response.*;
import com.icbc.api.utils.IcbcSignature;
import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
@@ -83,7 +84,7 @@
     * @param type              支付端类型(1:用户端,2:司机端,3:小程序)
     * @throws UnknownHostException
     */
    public Map<String, String> placeAnOrder1(String out_trade_no, Integer pay_mode, Integer access_type, String deciveInfo, String body, Double total_fee, String mer_url, String attach, Integer type, String openId) throws Exception {
    public Map<String, String> placeAnOrder(String out_trade_no, Integer pay_mode, Integer access_type, String deciveInfo, String body, Double total_fee, String mer_url, String attach, Integer type, String openId) throws Exception {
        //签名类型为RSA时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA,其他参数使用缺省值
        DefaultIcbcClient client = new DefaultIcbcClient(app_id, IcbcConstants.SIGN_TYPE_RSA2, privateKey, icbcPulicKey);
        CardbusinessAggregatepayB2cOnlineConsumepurchaseRequestV1 request = new
@@ -102,7 +103,7 @@
        bizContent.setMer_prtcl_no(mer_prtcl_no);
        bizContent.setOrig_date_time(format);
        bizContent.setDecive_info(deciveInfo);
        bizContent.setBody("嘉易行-" + body);
        bizContent.setBody("OK出行-" + body);
        bizContent.setFee_type("001");
        InetAddress ip4 = Inet4Address.getLocalHost();
        bizContent.setSpbill_create_ip(ip4.getHostAddress());
@@ -206,7 +207,7 @@
     * @param order_id      工行订单号
     * @return
     */
    public String queryTransaction1(String out_trade_no, String order_id){
    public String queryTransaction(String out_trade_no, String order_id){
        //签名类型为RSA时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA,其他参数使用缺省值
        DefaultIcbcClient client = new DefaultIcbcClient(app_id, IcbcConstants.SIGN_TYPE_RSA2, privateKey, icbcPulicKey);
        CardbusinessAggregatepayB2cOnlineOrderqryRequestV1 request = new CardbusinessAggregatepayB2cOnlineOrderqryRequestV1();
@@ -252,7 +253,7 @@
     * @return
     * @throws Exception
     */
    public Map<String, String> payCallback1(HttpServletRequest request) throws Exception{
    public Map<String, String> payCallback(HttpServletRequest request) throws Exception{
        String biz_content1 = request.getParameter("biz_content");
        JSONObject biz_content = JSON.parseObject(biz_content1);
        int return_code = biz_content.getIntValue("return_code");
@@ -282,7 +283,7 @@
     * @param response
     * @throws Exception
     */
    public void answer1(HttpServletResponse response) throws Exception{
    public void answer(HttpServletResponse response) throws Exception{
        response.setContentType("application/json;charset=UTF-8");
        StringBuffer sb = new StringBuffer();
        String nativeUUID = UUIDUtil.getNativeUUID();
@@ -307,7 +308,7 @@
     * @param payeeCnname       收款账户名称
     * @return
     */
    public ResultUtil<String> transfer1(Long money, String payeeAccount, String payeeCnname) throws Exception{
    public ResultUtil<String> transfer(Long money, String payeeAccount, String payeeCnname) throws Exception{
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        SimpleDateFormat sdf_ = new SimpleDateFormat("HHmmssSSS");
        Date date = new Date();
@@ -368,7 +369,7 @@
     * @param serialNo      转账申请序列号(转账接口返回)
     * @return              -1=查询异常,0=交易成功,1=交易处理中,2=交易拒绝
     */
    public Integer queryTransfer1(String serialNo){
    public Integer queryTransfer(String serialNo){
        String url = "https://gw.open.icbc.com.cn/api/mybank/enterprise/pay/qpayent/V1";
        DefaultIcbcClient client = new DefaultIcbcClient(app_id, IcbcConstants.SIGN_TYPE_RSA2, privateKey, icbcPulicKey);
        try {
@@ -549,7 +550,7 @@
     * @return
     * @throws Exception
     */
    public Map<String, Object> merrefund1(String order_id, String out_trade_no, Double ret_total_amt, String order_apd_inf, String outtrx_serial_no) throws Exception{
    public Map<String, Object> merrefund(String order_id, String out_trade_no, Double ret_total_amt, String order_apd_inf, String outtrx_serial_no) throws Exception{
        ret_total_amt = ret_total_amt * 100;
        //签名类型为RSA2时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA2,其他参数使用缺省值
        DefaultIcbcClient client = new DefaultIcbcClient(app_id, IcbcConstants.SIGN_TYPE_RSA2, privateKey, icbcPulicKey);
@@ -602,7 +603,7 @@
     * @param outtrx_serial_no      商户系统退货编号
     * @return
     */
    public Map<String, Object> refundqry1(String out_trade_no, String order_id, String outtrx_serial_no){
    public Map<String, Object> refundqry(String out_trade_no, String order_id, String outtrx_serial_no){
        // 签名类型为RSA时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA,其他参数使用缺省值
        DefaultIcbcClient client = new DefaultIcbcClient(app_id, IcbcConstants.SIGN_TYPE_RSA2, privateKey, icbcPulicKey);
        CardbusinessAggregatepayB2cOnlineRefundqryRequestV1 request = new CardbusinessAggregatepayB2cOnlineRefundqryRequestV1();
@@ -653,7 +654,12 @@
        String url = "https://bankaddress.shumaidata.com/bankaddress?bankcard=" + code;
        Map<String, String> header = new HashMap<>();
        header.put("Authorization", "APPCODE b7d32437d08149099457dcb50fb57df2");
        String get = httpClientUtil.pushHttpRequset("GET", url, null, header, "form");
        String get = null;
        try {
            get = httpClientUtil.pushHttpRequset("GET", url, null, header, "form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject jsonObject = JSON.parseObject(get);
        int code1 = jsonObject.getIntValue("code");
        Map<String, String> map = new HashMap<>();
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/JuHeUtil.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@@ -32,7 +33,12 @@
        map.put("key", key);
        map.put("idcard", idcard);
        map.put("realname", name);
        String content = httpClientUtil.pushHttpRequset("GET", "http://op.juhe.cn/idcard/query", map, new HashMap<>(), "form");
        String content = null;
        try {
            content = httpClientUtil.pushHttpRequset("GET", "http://op.juhe.cn/idcard/query", map, new HashMap<>(), "form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(content);
        JSONObject jsonObject = JSON.parseObject(content);
        if(jsonObject.getIntValue("error_code") == 0){
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/LiuZhouBank/Config.java
New file
@@ -0,0 +1,21 @@
package com.stylefeng.guns.modular.system.util.LiuZhouBank;
/**
* 配置枚举类
* @author pzb
* @Date 2022/11/28 19:07
*/
public interface Config {
    String MCHT_NO = "49561404121B083";
    String APP_ID = "bolz18g5bw9eb80pc72d";
    String PRIVATE_KEY = "3f0e856ca40ae36b787aaae4f72d85a5034759fe11e75c9033f17b09c94e4b85";
    String FOP_PUBLIC_KEY = "04bf22b5bf2e98719c149f98b54264a3e2ced402d03430e884cf464289766ef24b3e9323b203a9132069b70830f468c5cd834b234c7479a2608f3026187a24a12b";
    String TEST_URL = "http://117.141.212.41:38188";
    String PRODUCTION_URL = "https://open.bolz.cn:8188";
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/LiuZhouBank/PayUtil.java
New file
@@ -0,0 +1,390 @@
package com.stylefeng.guns.modular.system.util.LiuZhouBank;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.core.util.ToolUtil;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 支付工具类
* @author pzb
* @Date 2022/11/28 21:10
*/
public class PayUtil {
//    /**
//     * 聚合支付预下单(微信、本行卡)
//     * @param subAppId          微信分配商户的子商户公众账号 ID
//     * @param openid            微信小程序openid
//     * @param chnlPayPage       微信商户号
//     * @param payType           支付类型:01-本行卡支付,02-聚合 微信,03-本行卡支付,微信支付 04-支付宝支付,05-本行卡支付,支付宝支付,06-微信支付,支付宝支付 07-全部
//     * @param amount            支付金额
//     * @param transDesc         交易描述
//     * @param backNotifyUrl     回调地址
//     * @param transSeq          商户流水号
//     * @param frontNotifyUrl    支付成功的跳转页面(前端)
//     * @param mcht_no           银行商户号
//     * @return
//     */
//    public static String polymericPay(String subAppId, String openid, String chnlPayPage, String payType, Double amount, String transDesc, String backNotifyUrl, String transSeq, String frontNotifyUrl, String mcht_no){
//        String uri = "/api/conductor/cashier/polymericPay/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
//
//        /**
//         * model,request,response类
//         * 不同接口的model,request,response均不相同
//         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
//         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
//         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
//         */
//        ConductorCashierPolymericpayModel_100 model = new ConductorCashierPolymericpayModel_100();
//        ConductorCashierPolymericpayRequest_100 request = new ConductorCashierPolymericpayRequest_100();
//        ConductorCashierPolymericpayResponse_100 response = null;
//
//        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//        SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//        String format = sdf1.format(new Date());
//        String format1 = sdf2.format(new Date());
//        model.setMchtNo(mcht_no);
//        model.setTransSeq(transSeq);
//        model.setTransDate(format);
//        model.setTransTime(format1);
//        model.setVersion("1.0");
//        model.setSndDt(format + format1);
//
//        model.setSubAppId(subAppId);//微信分配商户的子商户公众账号 ID
//        model.setOpenId(openid);//商户通过微信预授权获取的用户唯一标识,当payChnlType=02时必传
//        model.setChnlPayPage(chnlPayPage);//微信分配商户的子商户账号 ID,当 payChnlType=02 时必传
//        model.setPayChnlType(ToolUtil.isNotEmpty(openid) ? "02" : "01");//01-H5  02-微信小程序
//        model.setPayType(payType);//支付类型:01-本行卡支付,02-聚合 微信,03-本行卡支付,微信支付 04-支付宝支付,05-本行卡支付,支 付宝支付,06-微信支付,支付宝支 付 07-全部
//        model.setTransAmount(amount.toString());//交易金额
//        model.setTransDesc(transDesc);//交易描述
//        model.setBackNotifyUrl(backNotifyUrl);//后台异步通知回调地址
//        model.setFrontNotifyUrl(frontNotifyUrl);
//        try {
//            model.setTermIp(InetAddress.getLocalHost().getHostAddress());//终端IP
//        } catch (UnknownHostException e) {
//            e.printStackTrace();
//        }
//        request.setBizModel(model);
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        System.err.println("预下单请求:" + JSON.toJSONString(model));
//        System.err.println("预下单响应:" + JSON.toJSONString(response));
//        if("00000000".equals(response.getBizCode()) || "88888888".equals(response.getBizCode())){
//            String transDate = response.getTransDate();
//            String transTime = response.getTransTime();
//            String transSeq1 = response.getTransSeq();
//            return response.getCodeUrl();
//        }else{
//            System.err.println(response.getBizCode() + ":" + response.getBizMsg());
//        }
//        return null;
//    }
//
//
//    /**
//     * 聚合支付交易状态查询
//     * @param oriTransSeq       原商户上送交易流水号
//     * @param oriTransDate      原交易日期
//     * @param oriTansTime       原交易时间
//     * @param oriTransAmount    原交易金额
//     * @return
//     */
//    public static String poPayTransStatusQuery(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount){
//        String uri = "/api/conductor/cashier/poPayTransStatusQuery/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
//
//        /**
//         * model,request,response类
//         * 不同接口的model,request,response均不相同
//         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
//         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
//         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
//         */
//        ConductorCashierPopaytransstatusqueryModel_100 model = new ConductorCashierPopaytransstatusqueryModel_100();
//        ConductorCashierPopaytransstatusqueryRequest_100 request = new ConductorCashierPopaytransstatusqueryRequest_100();
//        ConductorCashierPopaytransstatusqueryResponse_100 response = null;
//
//        model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号
//        model.setOriTransType("mergePay.order");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单
//        model.setOriTransDate(oriTransDate);//原交易日期
//        model.setOriTransTime(oriTansTime);//原交易时间
//        model.setOriTransAmount(oriTransAmount.toString());//原交易金额
//        request.setBizModel(model);
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        return JSONObject.toJSONString(response);
//    }
//
//
//    /**
//     * 聚合支付退款
//     * @param oriTransSeq       原商户上送交易流水号
//     * @param oriTransDate      原交易日期
//     * @param oriTansTime       原交易时间
//     * @param oriTransAmount    原交易金额
//     * @param refundAmount      退款金额
//     * @return
//     */
//    public static String polymericPayRefund(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount, Double refundAmount){
//        String uri = "/api/conductor/cashier/polymericPayRefund/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
//
//        /**
//         * model,request,response类
//         * 不同接口的model,request,response均不相同
//         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
//         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
//         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
//         */
//        ConductorCashierPolymericpayrefundModel_100 model = new ConductorCashierPolymericpayrefundModel_100();
//        ConductorCashierPolymericpayrefundRequest_100 request = new ConductorCashierPolymericpayrefundRequest_100();
//        ConductorCashierPolymericpayrefundResponse_100 response = null;
//
//        model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号
//        model.setOriTransType("mergePay.order");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单
//        model.setOriTransDate(oriTransDate);//原交易日期
//        model.setOriTransTime(oriTansTime);//原交易时间
//        model.setOriTransAmount(oriTransAmount.toString());//原交易金额
//        model.setRefundAmount(refundAmount.toString());//退款金额
//        request.setBizModel(model);
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        return JSONObject.toJSONString(response);
//    }
//
//
//    /**
//     * 协议代付关联支付宝服务窗支付
//     * @param chnlSeq       渠道流水号(自定义,唯一)
//     * @param signNum       签约协议号
//     * @param mchtReserve   商户保留内容,和签约上送一致
//     * @param buyerId       支付宝买家用户id
//     * @param body          商品描述
//     * @param totalFee      支付金额
//     * @param notifyUrl     通知回调地址
//     */
//    public static void relatedZFBOfficialPay(String chnlSeq, String signNum, String mchtReserve, String buyerId, String body, String totalFee, String notifyUrl){
//        String uri = "/api/conductor/cashier/relatedZFBOfficialPay/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
//
//        /**
//         * model,request,response类
//         * 不同接口的model,request,response均不相同
//         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
//         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
//         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
//         */
//        ConductorCashierRelatedzfbofficialpayModel_100 model = new ConductorCashierRelatedzfbofficialpayModel_100();
//        ConductorCashierRelatedzfbofficialpayRequest_100 request = new ConductorCashierRelatedzfbofficialpayRequest_100();
//        ConductorCashierRelatedzfbofficialpayResponse_100 response = null;
//
//        Date date = new Date();
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
//        SimpleDateFormat sdf1 = new SimpleDateFormat("HHmmss");
//
//        model.setChnlSeq(chnlSeq);//渠道流水号
//        model.setChnlDate(sdf.format(date));//渠道日期
//        model.setChnlTime(sdf1.format(date));//渠道时间
//        model.setSignNum(signNum);//签约协议号
//        model.setMchtReserve(mchtReserve);//商户保留 即在协议签约时,上送的商户保留字段,普通商户一般为用户标识号,需要确保唯一
//        model.setDeviceInfo("");//设备号
//        model.setBuyerId(buyerId);//卖价支付宝用户ID
//        model.setBody(body);//商品描述
//        model.setTotalFee(totalFee);//支付总金额
//        try {
//            model.setTermIp(InetAddress.getLocalHost().getHostAddress());//终端IP
//        } catch (UnknownHostException e) {
//            e.printStackTrace();
//        }
//        model.setTermMac("");//终端MAC信息
//        model.setLocations("");//经纬度信息
//        model.setNotifyUrl(notifyUrl);//通知回调地址
//        request.setBizModel(model);
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        if("00000000".equals(response.getBizCode())){
//            if("00".equals(response.getCode())){
//                String tradeMoney = response.getTradeMoney();//实际支付金额
//                String totalFee1 = response.getTotalFee();//订单金额
//                String tradeNo = response.getTradeNo();//支付宝JS订单号
//            }else{
//                System.err.println(response.getMsg());
//            }
//
//            String transDate = response.getTransDate();
//            String transTime = response.getTransTime();
//            String transSeq1 = response.getTransSeq();
//
//        }else{
//            System.err.println(response.getBizMsg());
//        }
//
//    }
//
//
//
//
//
//
//    /**
//     * 支付宝扫码支付
//     * @param chnlSeq
//     * @param deviceInfo
//     * @param body
//     * @param totalFee
//     * @param subject
//     * @param notifyUrl
//     * @return
//     */
//    public static String zfbScanCodePay(String chnlSeq, String deviceInfo, String body, Double totalFee, String subject, String notifyUrl){
//        String uri = "/api/conductor/cashier/zfbScanCodePay/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
//
//        /**
//         * model,request,response类
//         * 不同接口的model,request,response均不相同
//         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
//         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
//         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
//         */
//        ConductorCashierZfbscancodepayModel_100 model = new ConductorCashierZfbscancodepayModel_100();
//        ConductorCashierZfbscancodepayRequest_100 request = new ConductorCashierZfbscancodepayRequest_100();
//        ConductorCashierZfbscancodepayResponse_100 response = null;
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd HHmmss");
//        String format = sdf.format(new Date());
//        model.setChnlSeq(chnlSeq);//渠道流水号
//        model.setChnlDate(format.split(" ")[0]);//渠道日期
//        model.setChnlTime(format.split(" ")[1]);//渠道时间
//        model.setDeviceInfo(deviceInfo);//设备号
//        model.setBody(body);//商品描述
//        model.setFeeType("CNY");//货币类型
//        model.setTotalFee(totalFee.toString());//总金额
//        model.setSubject(subject);//订单标题
//        try {
//            model.setTermIp(InetAddress.getLocalHost().getHostAddress());//终端IP
//            model.setTermMac("");//终端MAC信息
//            model.setLocations("");//经纬度信息
//        } catch (UnknownHostException e) {
//            e.printStackTrace();
//        }
//        model.setNotifyUrl(notifyUrl);//异步通知回调地址
//        request.setBizModel(model);
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        if("00000000".equals(response.getBizCode())){
//            if("00".equals(response.getResultCode())){//成功
//                return response.getCodeUrl();
//            }else{
//                System.err.println(response.getResultMsg());
//                return null;
//            }
//        }else{
//            System.err.println(response.getBizMsg());
//            return null;
//        }
//    }
//
//
//
//
//    /**
//     * 支付回调处理
//     * @param request
//     * @return
//     */
//    public static ResultNotification payResultNotification(HttpServletRequest request){
//        String param = null;
//        try {
//            param = getParam(request);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        JSONObject jsonObject1 = JSON.parseObject(param);
//        JSONObject jsonObject = FopClient.SM2checkSign(jsonObject1, Config.FOP_PUBLIC_KEY);
//        if(!jsonObject.getBoolean("sign")){
//            System.err.println("线下收款回调异常---------->" + jsonObject.getString("msg"));
//            return null;
//        }
//        ResultNotification resultNotification = jsonObject1.toJavaObject(ResultNotification.class);
//        resultNotification.setResponseStr("success");//响应内容
//        return resultNotification;
//    }
//
//
//
//    /**
//     * 获取请求内容
//     * @param request
//     * @return
//     * @throws IOException
//     */
//    private static String getParam(HttpServletRequest request) throws IOException {
//        // 读取参数
//        InputStream inputStream;
//        StringBuilder sb = new StringBuilder();
//        inputStream = request.getInputStream();
//        String s;
//        BufferedReader in = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
//        while ((s = in.readLine()) != null) {
//            sb.append(s);
//        }
//        in.close();
//        inputStream.close();
//        return sb.toString();
//    }
//
    public static void main(String[] args) {
//        String polymericPay = PayUtil.polymericPay(null, null, null, "02", 0.01d, "测试支付", "https://10pz685243.zicp.fun/user/base/offlineTravelPaymentCallback", "123111");
//        System.err.println(polymericPay);
//        PayUtil.relatedZFBOfficialPay("11212", "", "", "1212", "测试商品", "0.01", "");
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/LiuZhouBank/ProtocolSignUtil.java
New file
@@ -0,0 +1,543 @@
package com.stylefeng.guns.modular.system.util.LiuZhouBank;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.UUIDUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * 银行签约工具类
 * @author pzb
 * @Date 2022/11/28 19:06
 */
public class ProtocolSignUtil {
    /**
     * 签约前获取短信验证码
     * @param IdNum         身份证号码
     * @param phone         银行预留电话
     * @param acctName      账户名称
     * @param acctNum       账户号
     * @return
     */
    public static ResultUtil<String> protocolSignSendSms(String IdNum, String phone, String acctName, String acctNum){
        try {
//            String uri = "/api/conductor/cashier/protocolSignSendSms/1.0.0";
//            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                    .IsBodyEncrypt(true)
//                    .SererUrl(Config.PRODUCTION_URL + uri)
//                    .EncryptType(EncryptType.SM4)
//                    .SignType(SignType.SM2).build();
            /**
             * model,request,response类
             * 不同接口的model,request,response均不相同
             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
             */
//            ConductorCashierProtocolsignsendsmsModel_100 model = new ConductorCashierProtocolsignsendsmsModel_100();
//            ConductorCashierProtocolsignsendsmsRequest_100  request = new ConductorCashierProtocolsignsendsmsRequest_100();
//            ConductorCashierProtocolsignsendsmsResponse_100 response = null;
//
//            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//            String format = sdf1.format(new Date());
//            String format1 = sdf2.format(new Date());
//            model.setMchtNo(Config.MCHT_NO);
//            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
//            model.setTransDate(format);
//            model.setTransTime(format1);
//            model.setVersion("1.0");
//            model.setSndDt(format + format1);
//
//            model.setContractType("02");//01代扣,02代付
//            model.setIdType("01");//01 居民身份证
//            model.setIdNum(IdNum);//证件号码
//            model.setMobilePhone(phone);//银行预留手机号
//            model.setAcctName(acctName);//账户名称
//            model.setAcctNum(acctNum);//账号
//            model.setCardType("01");//01本行卡,02他行卡
//            request.setBizModel(model);
//            System.err.println("请求参数----》" + JSON.toJSONString(model));
//            response = fopClient.execute(request);
//            System.err.println("响应结果----》" + JSON.toJSONString(response));
//            if("00000000".equals(response.getBizCode())){
                return ResultUtil.success();
//            }else{
//                System.err.println(response.getBizMsg());
//                return ResultUtil.error(response.getBizMsg());
//            }
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 银行卡签约
     * @param IdNum     身份证号码
     * @param phone     银行预留电话号码
     * @param acctName  账户名
     * @param acctNum   账号
     * @param code
     * @return
     */
    public static Map<String, String> protocolSign(String IdNum, String phone, String acctName, String acctNum, String code){
        Map<String, String> map = new HashMap<>();
        try {
//            String uri = "/api/conductor/cashier/protocolSign/1.0.0";
//            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                    .IsBodyEncrypt(true)
//                    .SererUrl(Config.PRODUCTION_URL + uri)
//                    .EncryptType(EncryptType.SM4)
//                    .SignType(SignType.SM2).build();
            /**
             * model,request,response类
             * 不同接口的model,request,response均不相同
             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
             */
//            ConductorCashierProtocolsignModel_100 model = new ConductorCashierProtocolsignModel_100();
//            ConductorCashierProtocolsignRequest_100 request = new ConductorCashierProtocolsignRequest_100();
//            ConductorCashierProtocolsignResponse_100 response = null;
//
//            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//            String format = sdf1.format(new Date());
//            String format1 = sdf2.format(new Date());
//            model.setMchtNo(Config.MCHT_NO);
//            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
//            model.setTransDate(format);
//            model.setTransTime(format1);
//            model.setVersion("1.0");
//            model.setSndDt(format + format1);
//
//            model.setContractType("02");//协议类型01代扣,02代付
//            model.setChannelType("11");//11收单商户
//            model.setBusiType("01");//01商户后台接口调用
//            model.setIdType("01");//01 居民身份证
//            model.setIdNum(IdNum);//证件号码
//            model.setMobilePhone(phone);//银行预留手机号码
//            model.setAcctName(acctName);//户名
//            model.setAcctNum(acctNum);//账户
//            model.setCardType("01");//01本行卡,02他行卡
//            model.setDynamicCode(code);//短信验证码
//            request.setBizModel(model);
//            System.err.println("请求参数----》" + JSON.toJSONString(model));
//            response = fopClient.execute(request);
//            System.err.println("响应结果----》" + JSON.toJSONString(response));
//            if("00000000".equals(response.getBizCode())){
//                map.put("code", "00");
//                map.put("signNum", response.getSignNum());
//                map.put("acctNumSuffix", response.getAcctNumSuffix());//银行卡号后4位
//            }else{
//                map.put("code", "01");
//                map.put("msg", response.getBizMsg());
//            }
        }catch (Exception e){
            e.printStackTrace();
            map.put("code", "01");
            map.put("msg", "接口异常");
        }
        return map;
    }
    /**
     * 协议签约查询
     * @param signNum   签约协议号
     * @param acctNum   银行账号
     * @return
     */
    public static Map<String, String> queryProtocolSign(String signNum, String acctNum){
        Map<String, String> map = new HashMap<>();
        try {
//            String uri = "/api/conductor/cashier/queryProtocolSign/1.0.0";
//            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                    .IsBodyEncrypt(true)
//                    .SererUrl(Config.PRODUCTION_URL + uri)
//                    .EncryptType(EncryptType.SM4)
//                    .SignType(SignType.SM2).build();
            /**
             * model,request,response类
             * 不同接口的model,request,response均不相同
             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
             */
//            ConductorCashierQueryprotocolsignModel_100 model = new ConductorCashierQueryprotocolsignModel_100();
//            ConductorCashierQueryprotocolsignRequest_100 request = new ConductorCashierQueryprotocolsignRequest_100();
//            ConductorCashierQueryprotocolsignResponse_100 response = null;
//
//            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//            String format = sdf1.format(new Date());
//            String format1 = sdf2.format(new Date());
//            model.setMchtNo(Config.MCHT_NO);
//            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
//            model.setTransDate(format);
//            model.setTransTime(format1);
//            model.setVersion("1.0");
//            model.setSndDt(format + format1);
//
//            model.setSignNum(signNum);//签约协议号
//            model.setAcctNum(acctNum);//账号
//            model.setContractType("02");//协议类型01代扣,02代付
//            request.setBizModel(model);
//            System.err.println("请求参数----》" + JSON.toJSONString(model));
//            response = fopClient.execute(request);
//            System.err.println("响应结果----》" + JSON.toJSONString(response));
//            String bizCode = response.getBizCode();
//            if("00000000".equals(bizCode)){
//                String signNum1 = response.getSignNum();
//                String signStatus = response.getSignStatus();
//                map.put("code", "00");
//                map.put("SignNum", signNum1);//签约协议号
//                map.put("SignStatus", signStatus);//签约状态 01-签约,02-解约,03客户黑名单,04-垫资超限冻结
//            }else{
//                map.put("code", "01");
//                map.put("msg", response.getBizMsg());
//            }
        }catch (Exception e){
            e.printStackTrace();
            map.put("code", "01");
            map.put("msg", "接口异常");
        }
        return map;
    }
    /**
     * 协议解约
     * @param signNum   签约协议号
     * @return
     */
    public static Map<String, String> protocolRescind(String signNum){
        Map<String, String> map = new HashMap<>();
        try {
//            String uri = "/api/conductor/cashier/protocolRescind/1.0.0";
//            FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                    .IsBodyEncrypt(true)
//                    .SererUrl(Config.PRODUCTION_URL + uri)
//                    .EncryptType(EncryptType.SM4)
//                    .SignType(SignType.SM2).build();
//
//            /**
//             * model,request,response类
//             * 不同接口的model,request,response均不相同
//             * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
//             * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
//             * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
//             */
//            ConductorCashierProtocolrescindModel_100 model = new ConductorCashierProtocolrescindModel_100();
//            ConductorCashierProtocolrescindRequest_100 request = new ConductorCashierProtocolrescindRequest_100();
//            ConductorCashierProtocolrescindResponse_100 response = null;
//
//            SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//            SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//            String format = sdf1.format(new Date());
//            String format1 = sdf2.format(new Date());
//            model.setMchtNo(Config.MCHT_NO);
//            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
//            model.setTransDate(format);
//            model.setTransTime(format1);
//            model.setVersion("1.0");
//            model.setSndDt(format + format1);
//
//            model.setSignNum(signNum);//签约协议号
//            model.setContractType("02");//协议类型01代扣,02代付
//            model.setChannelType("11");//11收单商户
//            request.setBizModel(model);
//            System.err.println("请求参数----》" + JSON.toJSONString(model));
//            response = fopClient.execute(request);
//            System.err.println("响应结果----》" + JSON.toJSONString(response));
//            String bizCode = response.getBizCode();
//
//            if("00000000".equals(bizCode)){
//                String signNum1 = response.getSignNum();
//                String transSeq = response.getTransSeq();
//                map.put("code", "00");
//                map.put("SignNum", signNum1);//签约协议号
//                map.put("TransSeq", transSeq);//流水号
//            }else{
//                map.put("code", "01");
//                map.put("msg", response.getBizMsg());//流水号
//            }
        }catch (Exception e){
            map.put("code", "01");
            map.put("msg", "接口异常");//流水号
        }
        return map;
    }
    /**
     * 协议支付
     * @param signNum       签约协议号
     * @param amount        支付金额
     * @param transDesc     交易描述
     * @return
     */
    public static String protocolPayTrans(String signNum, Double amount, String transDesc){
//        String uri = "/api/conductor/cashier/protocolPayTrans/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
//
//        /**
//         * model,request,response类
//         * 不同接口的model,request,response均不相同
//         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
//         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
//         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
//         */
//        ConductorCashierProtocolpaytransModel_100 model = new ConductorCashierProtocolpaytransModel_100();
//        ConductorCashierProtocolpaytransRequest_100 request = new ConductorCashierProtocolpaytransRequest_100();
//        ConductorCashierProtocolpaytransResponse_100 response = null;
//
//
//        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//        SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//        String format = sdf1.format(new Date());
//        String format1 = sdf2.format(new Date());
//        model.setMchtNo(Config.MCHT_NO);
//        try {
//            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        model.setTransDate(format);
//        model.setTransTime(format1);
//        model.setVersion("1.0");
//        model.setSndDt(format + format1);
//
//        model.setSignNum(signNum);//签约协议号
//        model.setTransAmount(amount.toString());//支付金额
//        model.setTransDesc(transDesc);//交易描述
//        request.setBizModel(model);
//        System.err.println("请求参数----》" + JSON.toJSONString(model));
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        System.err.println("响应结果----》" + JSON.toJSONString(response));
        return  JSONObject.toJSONString("");
    }
    /**
     * 协议代付
     * @param signNum
     * @param amount
     * @param transDesc
     * @return
     */
    public static Map<String, Object> protocolAgentPay(String signNum, Double amount, String transDesc){
//        String uri = "/api/conductor/cashier/protocolAgentPay/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
        /**
         * model,request,response类
         * 不同接口的model,request,response均不相同
         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
         */
//        ConductorCashierProtocolagentpayModel_100 model = new ConductorCashierProtocolagentpayModel_100();
//        ConductorCashierProtocolagentpayRequest_100 request = new ConductorCashierProtocolagentpayRequest_100();
//        ConductorCashierProtocolagentpayResponse_100 response = null;
//        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//        SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//        String format = sdf1.format(new Date());
//        String format1 = sdf2.format(new Date());
//        model.setMchtNo(Config.MCHT_NO);
//        try {
//            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        model.setTransDate(format);
//        model.setTransTime(format1);
//        model.setVersion("1.0");
//        model.setSndDt(format + format1);
//
//        model.setSignNum(signNum);//签约协议号
//        model.setTransAmount(amount.toString());//支付金额
//        model.setTransDesc(transDesc);//交易描述
//        request.setBizModel(model);
//        System.err.println("请求参数----》" + JSON.toJSONString(model));
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        System.err.println("响应结果----》" + JSON.toJSONString(response));
//        String bizCode = response.getBizCode();
//        Map<String, Object> map = new HashMap<>();
//        if("00000000".equals(bizCode)){
//            String transSeq = response.getTransSeq();
//            map.put("code", "00");
//            map.put("TransSeq", transSeq);
//        }else{
//            map.put("code", "01");
//            map.put("msg", response.getBizMsg());
//            System.err.println(response.getBizMsg());
//        }
        return new HashMap<>();
    }
    /**
     * 统一交易退款
     * @param oriTransSeq       原商户上送交易流水号
     * @param oriTransDate      原交易日期
     * @param oriTansTime       原交易时间
     * @param oriTransAmount    原交易金额
     * @param refundAmount      退款金额
     * @return
     */
    public static String protocolPayRefund(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount, Double refundAmount){
//        String uri = "/api/conductor/cashier/protocolPayRefund/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
//        /**
//         * model,request,response类
//         * 不同接口的model,request,response均不相同
//         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
//         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
//         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
//         */
//        ConductorCashierProtocolpayrefundModel_100 model = new ConductorCashierProtocolpayrefundModel_100();
//        ConductorCashierProtocolpayrefundRequest_100 request = new ConductorCashierProtocolpayrefundRequest_100();
//        ConductorCashierProtocolpayrefundResponse_100 response = null;
//
//        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//        SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//        String format = sdf1.format(new Date());
//        String format1 = sdf2.format(new Date());
//        model.setMchtNo(Config.MCHT_NO);
//        try {
//            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        model.setTransDate(format);
//        model.setTransTime(format1);
//        model.setVersion("1.0");
//        model.setSndDt(format + format1);
//
//        model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号
//        model.setOriTransType("sign.pay");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单
//        model.setOriTransDate(oriTransDate);//原交易日期
//        model.setOriTansTime(oriTansTime);//原交易时间
//        model.setOriTransAmount(oriTransAmount.toString());//原交易金额
//        model.setRefundAmount(refundAmount.toString());//退款金额
//        request.setBizModel(model);
//        System.err.println("请求参数----》" + JSON.toJSONString(model));
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        System.err.println("响应结果----》" + JSON.toJSONString(response));
        return  JSONObject.toJSONString("");
    }
    /**
     * 统一交易状态查询
     * @param oriTransSeq       原商户上送交易流水号
     * @param oriTransDate      原交易日期
     * @param oriTansTime       原交易时间
     * @param oriTransAmount    原交易金额
     * @return
     */
    public static String queryTransStatus(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount){
//        String uri = "/api/conductor/cashier/protocolPayRefund/1.0.0";
//        FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY)
//                .IsBodyEncrypt(true)
//                .SererUrl(Config.PRODUCTION_URL + uri)
//                .EncryptType(EncryptType.SM4)
//                .SignType(SignType.SM2).build();
        /**
         * model,request,response类
         * 不同接口的model,request,response均不相同
         * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全
         * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中
         * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100
         */
//        ConductorCashierQuerytransstatusModel_100 model = new ConductorCashierQuerytransstatusModel_100();
//        ConductorCashierQuerytransstatusRequest_100 request = new ConductorCashierQuerytransstatusRequest_100();
//        ConductorCashierQuerytransstatusResponse_100 response = null;
//
//        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
//        SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss");
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//        String format = sdf1.format(new Date());
//        String format1 = sdf2.format(new Date());
//        model.setMchtNo(Config.MCHT_NO);
//        try {
//            model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5));
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        model.setTransDate(format);
//        model.setTransTime(format1);
//        model.setVersion("1.0");
//        model.setSndDt(format + format1);
//
//        model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号
//        model.setOriTransType("sign.pay");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单
//        model.setOriTransDate(oriTransDate);//原交易日期
//        model.setOriTansTime(oriTansTime);//原交易时间
//        model.setOriTransAmount(oriTransAmount.toString());//原交易金额
//        request.setBizModel(model);
//        System.err.println("请求参数----》" + JSON.toJSONString(model));
//        try {
//            response = fopClient.execute(request);
//        } catch (FopApiException e) {
//            e.printStackTrace();
//        }
//        System.err.println("响应结果----》" + JSON.toJSONString(response));
//        return  JSONObject.toJSONString(response);
        return null;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/LiuZhouBank/ResultNotification.java
New file
@@ -0,0 +1,215 @@
package com.stylefeng.guns.modular.system.util.LiuZhouBank;
/**
* 回调结果
* @author pzb
* @Date 2022/11/28 20:56
*/
public class ResultNotification {
    /**
     * 响应码
     * 0000000:成功
     * 其他:失败
     */
    private String returnCode;
    /**
     * 响应信息
     */
    private String returnMessage;
    /**
     * 商户号
     */
    private String mchtNo;
    /**
     * 商户名称
     */
    private String mchtName;
    /**
     * 签名证书序列号
     */
    private String signSn;
    /**
     * 加密证书序列号
     */
    private String encSn;
    /**
     * 业务结果信息  00 成功  01 失败
     */
    private String resultCode;
    /**
     * 业务结果信息
     */
    private String resultMsg;
    /**
     * 渠道流水号即报文上送的渠道流水号
     */
    private String chnlSeq;
    /**
     * 订单金额
     */
    private String totalFee;
    /**
     * 系统交易日期
     */
    private String txnDate;
    /**
     * 系统交易时间
     */
    private String txnTime;
    /**
     * 特约商户
     */
    private String subMchId;
    /**
     * 系统流水号
     */
    private String txnSeq;
    /**
     * 支付交易渠道 01-微信,02-支付宝,03-云闪付
     */
    private String paytype;
    /**
     * 签名
     */
    private String sign;
    /**
     * 接口响应内容
     */
    private String responseStr;
    public String getReturnCode() {
        return returnCode;
    }
    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }
    public String getReturnMessage() {
        return returnMessage;
    }
    public void setReturnMessage(String returnMessage) {
        this.returnMessage = returnMessage;
    }
    public String getMchtNo() {
        return mchtNo;
    }
    public void setMchtNo(String mchtNo) {
        this.mchtNo = mchtNo;
    }
    public String getMchtName() {
        return mchtName;
    }
    public void setMchtName(String mchtName) {
        this.mchtName = mchtName;
    }
    public String getResultCode() {
        return resultCode;
    }
    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }
    public String getResultMsg() {
        return resultMsg;
    }
    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }
    public String getChnlSeq() {
        return chnlSeq;
    }
    public void setChnlSeq(String chnlSeq) {
        this.chnlSeq = chnlSeq;
    }
    public String getTotalFee() {
        return totalFee;
    }
    public void setTotalFee(String totalFee) {
        this.totalFee = totalFee;
    }
    public String getTxnDate() {
        return txnDate;
    }
    public void setTxnDate(String txnDate) {
        this.txnDate = txnDate;
    }
    public String getTxnTime() {
        return txnTime;
    }
    public void setTxnTime(String txnTime) {
        this.txnTime = txnTime;
    }
    public String getTxnSeq() {
        return txnSeq;
    }
    public void setTxnSeq(String txnSeq) {
        this.txnSeq = txnSeq;
    }
    public String getPaytype() {
        return paytype;
    }
    public void setPaytype(String paytype) {
        this.paytype = paytype;
    }
    public String getSign() {
        return sign;
    }
    public void setSign(String sign) {
        this.sign = sign;
    }
    public String getResponseStr() {
        return responseStr;
    }
    public void setResponseStr(String responseStr) {
        this.responseStr = responseStr;
    }
    public String getSignSn() {
        return signSn;
    }
    public void setSignSn(String signSn) {
        this.signSn = signSn;
    }
    public String getEncSn() {
        return encSn;
    }
    public void setEncSn(String encSn) {
        this.encSn = encSn;
    }
    public String getSubMchId() {
        return subMchId;
    }
    public void setSubMchId(String subMchId) {
        this.subMchId = subMchId;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MinistryOfTransport.java
@@ -2,8 +2,10 @@
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import sun.security.krb5.internal.PAData;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -60,7 +62,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -83,7 +90,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -111,7 +123,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -144,7 +161,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -174,7 +196,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -220,7 +247,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -275,7 +307,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -304,7 +341,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -329,7 +371,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -389,7 +436,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -418,7 +470,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -447,7 +504,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -475,7 +537,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -502,7 +569,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -534,7 +606,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -562,7 +639,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -589,7 +671,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -614,7 +701,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -639,7 +731,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -668,7 +765,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -694,7 +796,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -751,7 +858,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -782,7 +894,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -815,7 +932,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -840,7 +962,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -863,7 +990,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -885,7 +1017,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -908,7 +1045,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -937,7 +1079,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -971,7 +1118,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -1004,7 +1156,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
@@ -1056,7 +1213,12 @@
        data.put("Source", Source);
        data.put("IPCType", IPCType);
        data.put("baseInfoCompany", jsonObject);
        String s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json");
        String s = null;
        try {
            s = httpClientUtil.pushHttpRequset("POST", path, data, null, "json").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println(s);
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PayMoneyUtil.java
@@ -4,12 +4,18 @@
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.CertAlipayRequest;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.domain.AlipayTradeAppPayModel;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.*;
import com.alipay.api.response.*;
import com.alipay.api.request.AlipayTradeAppPayRequest;
import com.alipay.api.request.AlipayTradePrecreateRequest;
import com.alipay.api.request.AlipayTradeQueryRequest;
import com.alipay.api.request.AlipayTradeRefundRequest;
import com.alipay.api.response.AlipayTradeAppPayResponse;
import com.alipay.api.response.AlipayTradePrecreateResponse;
import com.alipay.api.response.AlipayTradeQueryResponse;
import com.alipay.api.response.AlipayTradeRefundResponse;
import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil;
import org.apache.commons.collections.map.HashedMap;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.dom4j.Document;
@@ -60,7 +66,10 @@
    private String appid;//微信appid
    @Value("${wx.appletsAppid}")
    private String appletsAppid;//微信小程序appid
    private String appletsAppid;
    @Value("${wx.appletsAppSecret}")
    private String appletsAppSecret;
    @Value("${wx.mchId}")
    private String mchId;//微信商户号
@@ -68,65 +77,31 @@
    @Value("${wx.key}")
    private String key;//微信商户号
    @Value("${callbackPath}")
    private String callbackPath;//支付回调网关地址
    private String app_cert_path = "C:/cert/alipay/user/app_cert_path.crt";//应用公钥证书路径
    private String alipay_cert_path = "C:/cert/alipay/user/alipay_cert_path.crt";//支付宝公钥证书文件路径
    private String alipay_root_cert_path = "C:/cert/alipay/user/alipay_root_cert_path.crt";//支付宝CA根证书文件路径
    @Value("${wx.certPath}")
    String certPath;
    @Autowired
    private HttpClientUtil httpClientUtil;
    private Map<String, JSONObject> order = new HashMap<>();//存储支付订单用于主动查询支付结果
    /**
     * 支付宝支付
     */
    public ResultUtil alipay(String body, String subject, String passbackParams, String outTradeNo, String amount, String notifyUrl){
        //构造client
        CertAlipayRequest certAlipayRequest = new CertAlipayRequest ();
        //设置网关地址
        certAlipayRequest.setServerUrl("https://openapi.alipay.com/gateway.do");
        //设置应用Id
        certAlipayRequest.setAppId(aliAppid);
        //设置应用私钥
        certAlipayRequest.setPrivateKey(appPrivateKey);
        //设置请求格式,固定值json
        certAlipayRequest.setFormat("json");
        //设置字符集
        certAlipayRequest.setCharset("UTF-8");
        //设置签名类型
        certAlipayRequest.setSignType("RSA2");
        //设置应用公钥证书路径
        certAlipayRequest.setCertPath(app_cert_path);
        //设置支付宝公钥证书路径
        certAlipayRequest.setAlipayPublicCertPath(alipay_cert_path);
        //设置支付宝根证书路径
        certAlipayRequest.setRootCertPath(alipay_root_cert_path);
        //构造client
        AlipayClient alipayClient = null;
        try {
            alipayClient = new DefaultAlipayClient(certAlipayRequest);
        } catch (AlipayApiException e) {
            e.printStackTrace();
        }
    public ResultUtil alipay(String body, String subject, String outTradeNo, String amount, String notifyUrl){
        //实例化客户端
        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", aliAppid, appPrivateKey, "json", "UTF-8", alipayPublicKey, "RSA2");
        //实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest ();
        //SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
        AlipayTradeAppPayModel model = new AlipayTradeAppPayModel ();
        model.setBody(body);
        model.setSubject (subject);
        model.setOutTradeNo (outTradeNo);
        model.setBody(body);//对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。
        model.setSubject(subject);//商品的标题/交易标题/订单标题/订单关键字等。
        model.setOutTradeNo(outTradeNo);//商户网站唯一订单号
        model.setTimeoutExpress ("30m" );
        model.setTotalAmount (amount);
        model.setTotalAmount(amount);//付款金额
        model.setProductCode ( "QUICK_MSECURITY_PAY" );
        model.setPassbackParams(passbackParams);//自定义参数
        request.setBizModel ( model );
        request.setNotifyUrl (callbackPath + notifyUrl);
        request.setNotifyUrl(notifyUrl);
        try  {
            //这里和普通的接口调用不同,使用的是sdkExecute
            AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
@@ -137,33 +112,6 @@
        }  catch (AlipayApiException e ) {
            e.printStackTrace();
        }
//        //实例化客户端
//        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", aliAppid, appPrivateKey, "json", "UTF-8", alipay_public_key, "RSA2");
//        //实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
//        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
//        //SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
//        AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
//        model.setBody(body);//对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。
//        model.setSubject(subject);//商品的标题/交易标题/订单标题/订单关键字等。
//        model.setOutTradeNo(outTradeNo);//商户网站唯一订单号
//        model.setTimeoutExpress("30m");
//        model.setTotalAmount(amount);//付款金额
//        model.setProductCode("QUICK_MSECURITY_PAY");
//        model.setPassbackParams(passbackParams);//自定义参数
//        request.setBizModel(model);
//        request.setNotifyUrl(callbackPath + notifyUrl);
//        try {
//            //这里和普通的接口调用不同,使用的是sdkExecute
//            AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
//            Map<String, String> map = new HashMap<>();
//            map.put("orderString", response.getBody());
//            System.out.println(map);//就是orderString 可以直接给客户端请求,无需再做处理。
//            return ResultUtil.success(map);
//        } catch (AlipayApiException e) {
//            e.printStackTrace();
//        }
        return null;
    }
@@ -184,7 +132,7 @@
                "    \"out_trade_no\":\"" + outTradeNo + "\"," +//商户订单号
                "    \"total_amount\":\"" + 1 + "\"," +
                "    \"subject\":\"" + subject + "\"," +
                "    \"notify_url\":\"" + callbackPath + notifyUrl + "\"," +
                "    \"notify_url\":\"" + notifyUrl + "\"," +
                "    \"body\":\"" + body + "\"," +
                "    \"store_id\":\"NJ_001\"," +
                "    \"timeout_express\":\"90m\"}");//订单允许的最晚付款时间
@@ -215,51 +163,47 @@
            String valueStr = "";
            for (int i = 0; i < values.length; i++) {
                valueStr = (i == values.length - 1) ? valueStr + values[i]
                        : valueStr + values[i] + "_";
                        : valueStr + values[i] + ",";
            }
            //乱码解决,这段代码在出现乱码时使用。
            //valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
            params.put(name, valueStr);
        }
        //切记alipaypublickey是支付宝的公钥,请去open.alipay.com对应应用下查看。
        //boolean AlipaySignature.rsaCheckV1(Map<String, String> params, String publicKey, String charset, String sign_type)
//        try {
//            boolean flag = AlipaySignature.rsaCheckV1(params, alipay_public_key, "UTF-8","RSA2");
//            if(flag){
//                Map<String, String> map = new HashMap<>();
//                String out_trade_no = params.get("out_trade_no");
//                String subject = params.get("subject");
//                String total_amount = params.get("total_amount");
//                String trade_no = params.get("trade_no");
//                String passback_params = params.get("passback_params");
//                map.put("out_trade_no", out_trade_no);//商家订单号
//                map.put("subject", subject);
//                map.put("total_amount", total_amount);
//                map.put("trade_no", trade_no);//支付宝交易号
//                map.put("passback_params", passback_params);//回传参数
//                return map;
//            }else{
//                System.err.println("验签失败");
//            }
//
//        } catch (AlipayApiException e) {
//            e.printStackTrace();
//        }
//        return null;
        Map<String, String> map = new HashMap<>();
        String out_trade_no = params.get("out_trade_no");
        String subject = params.get("subject");
        String total_amount = params.get("total_amount");
        String trade_no = params.get("trade_no");
        String passback_params = params.get("passback_params");
        map.put("out_trade_no", out_trade_no);//商家订单号
        map.put("subject", subject);
        map.put("total_amount", total_amount);
        map.put("trade_no", trade_no);//支付宝交易号
        map.put("passback_params", passback_params);//回传参数
        return map;
        //切记alipaypublickey是支付宝的公钥,请去open.alipay.com对应应用下查看。
        //boolean AlipaySignature.rsaCheckV1(Map<String, String> params, String publicKey, String charset, String sign_type)
//        try {
//            boolean flag = AlipaySignature.rsaCheckV1(params, alipayPublicKey, "UTF-8","RSA2");
//            if(flag){
//                Map<String, String> map = new HashMap<>();
//                String out_trade_no = params.get("out_trade_no");
//                String subject = params.get("subject");
//                String total_amount = params.get("total_amount");
//                String trade_no = params.get("trade_no");
//                map.put("out_trade_no", out_trade_no);//商家订单号
//                map.put("subject", subject);
//                map.put("total_amount", total_amount);
//                map.put("trade_no", trade_no);//支付宝交易号
//                return map;
//            }
//
//        } catch (AlipayApiException e) {
//            e.printStackTrace();
//        }
//        return null;
    }
@@ -296,7 +240,7 @@
     * @param tradeType     交易类型
     * @return
     */
    public ResultUtil weixinpay(String body, String attach, String out_trade_no, String total_fee, String notify_url, String tradeType, String openId) throws Exception{
    public ResultUtil weixinpay(String body, String attach, String out_trade_no, String total_fee, String notify_url, String tradeType, String openid) throws Exception{
        int i = new BigDecimal(total_fee).multiply(new BigDecimal("100")).intValue();
        String hostAddress = null;
        try {
@@ -306,7 +250,7 @@
        }
        String nonce_str = UUIDUtil.getRandomCode(16);
        Map<String, Object> map = new HashMap<>();
        map.put("appid", "APP".equals(tradeType) ? appid : appletsAppid);
        map.put("appid", "JSAPI".equals(tradeType) ? appletsAppid : appid);
        map.put("mch_id", mchId);
        map.put("nonce_str", nonce_str);
        map.put("body", body);
@@ -314,11 +258,9 @@
        map.put("out_trade_no", out_trade_no);//存储的订单code
        map.put("total_fee", i);
        map.put("spbill_create_ip", hostAddress);
        map.put("notify_url", callbackPath + notify_url);
        map.put("notify_url", notify_url);
        map.put("trade_type", tradeType);
        if("JSAPI".equals(tradeType)){
            map.put("openid", openId);
        }
        map.put("openid", openid);
        String s = this.weixinSignature(map);
        map.put("sign", s);
@@ -338,7 +280,7 @@
        xmlString.append("</xml>");
        Map<String, String> map1 = null;
        String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>());
        String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData();
        //将结果xml解析成map
        body1 = body1.replaceAll("<!\\[CDATA\\[","");
        body1 = body1.replaceAll("]]>", "");
@@ -357,7 +299,6 @@
                String prepay_id = map1.get("prepay_id");
                switch (type){
                    case "JSAPI":
                        //重新进行签名后返回给前端
                        Map<String, Object> map2 = new HashMap<>();
                        map2.put("appId", map1.get("appid"));
                        map2.put("nonceStr", map1.get("nonce_str"));
@@ -373,8 +314,10 @@
                        map2.put("sign", s2);
                        return ResultUtil.success(map2);
                    case "NATIVE":
                        Map<String, Object> map4 = new HashMap<>();
                        String code_url = map1.get("code_url");
                        return ResultUtil.success(code_url);
                        map4.put("code_url", code_url);
                        return ResultUtil.success(map4);
                    case "APP":
                        //重新进行签名后返回给前端
                        Map<String, Object> map3 = new HashMap<>();
@@ -384,8 +327,8 @@
                        map3.put("partnerid", mchId);
                        map3.put("prepayid", prepay_id);
                        map3.put("timestamp", new Date().getTime() / 1000);
                        String s1 = this.weixinSignature(map3);
                        map3.put("sign", s1);
                        String s3 = this.weixinSignature(map3);
                        map3.put("sign", s3);
                        System.err.println(map3);
                        return ResultUtil.success(map3);
                }
@@ -496,7 +439,12 @@
        xmlString.append("</xml>");
        Map<String, String> map1 = null;
        String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>());
        String body1 = null;
        try {
            body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        //将结果xml解析成map
        body1 = body1.replaceAll("<!\\[CDATA\\[","");
        body1 = body1.replaceAll("]]>", "");
@@ -571,15 +519,15 @@
        int rf = new BigDecimal(refund_fee).multiply(new BigDecimal("100")).intValue();
        String nonce_str = UUIDUtil.getRandomCode();
        Map<String, Object> map = new HashMap<>();
        map.put("appid", appid);
        map.put("appid", appletsAppid);
        map.put("mch_id", mchId);
        map.put("nonce_str", nonce_str);
        map.put("transaction_id", transaction_id);
        map.put("out_refund_no", out_refund_no);
        map.put("total_fee", tf);
        map.put("refund_fee", rf);
        map.put("notify_url", callbackPath + notify_url);
        String s = this.weixinSignature(map, key);
        map.put("notify_url", notify_url);
        String s = this.weixinSignature(map);
        map.put("sign", s);
        String url = "https://api.mch.weixin.qq.com/secapi/pay/refund";
@@ -600,8 +548,7 @@
        Map<String, String> map1 = null;
        String body1 = null;
        try {
            String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";
            body1 = httpClientUtil.pushHttpsRequsetXml(url, xmlString.toString(), new HashMap<>(), "1523106371", certPath, "PKCS12");
            body1 = httpClientUtil.pushHttpsRequsetXml(url, xmlString.toString(), new HashMap<>(), mchId, certPath, "PKCS12");
        } catch (Exception e) {
            e.printStackTrace();
        }
@@ -663,7 +610,7 @@
                map1.put("result", result);
                return map1;
            }else{
//                System.err.println(map.get("return_msg"));
                System.err.println(map.get("return_msg"));
            }
        } catch (IOException e) {
            e.printStackTrace();
@@ -748,7 +695,7 @@
        xmlString.append("</xml>");
        Map<String, String> map1 = null;
        String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>());
        String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData();
        //将结果xml解析成map
        body1 = body1.replaceAll("<!\\[CDATA\\[","");
        body1 = body1.replaceAll("]]>", "");
@@ -789,232 +736,6 @@
        }
    }
    /**
     * 微信转账功能(企业付款到零钱)
     * @param openid                商户appid下,某用户的openid
     * @param desc                  企业付款备注,必填。
     * @param total_fee             企业付款金额
     * @param partner_trade_no      商户订单号,需保持唯一性
     * @return
     */
    public Map<String, String> wxTransfers(String openid, String desc, String total_fee, String partner_trade_no) throws Exception{
        int amount = new BigDecimal(total_fee).multiply(new BigDecimal("100")).intValue();
        String nonce_str = UUIDUtil.getRandomCode();
        Map<String, Object> map = new HashMap<>();
        map.put("mch_appid", appid);//申请商户号的appid或商户号绑定的appid
        map.put("mchid", mchId);//微信支付分配的商户号
        map.put("nonce_str", nonce_str);//随机字符串,不长于32位
        map.put("partner_trade_no", partner_trade_no);//商户订单号,需保持唯一性
        map.put("openid", openid);//商户appid下,某用户的openid
        map.put("check_name", "NO_CHECK");//NO_CHECK:不校验真实姓名 FORCE_CHECK:强校验真实姓名
        map.put("amount", amount);//企业付款金额,单位为分
        map.put("desc", desc);//企业付款备注,必填。
        String s = this.weixinSignature(map, key);
        map.put("sign", s);
        String url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers";
        //设置请求头
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_XML);
        StringBuffer xmlString = new StringBuffer();
        Set<String> strings = map.keySet();
        String[] keys = {};
        keys = strings.toArray(keys);
        Arrays.sort(keys);
        xmlString.append("<xml>");
        for(int l = 0; l < keys.length; l++){
            xmlString.append("<" + keys[l] + ">" + map.get(keys[l]) + "</" + keys[l] + ">");
        }
        xmlString.append("</xml>");
        Map<String, String> map1 = null;
        String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//证书地址
        String body1 = httpClientUtil.pushHttpsRequsetXml(url, xmlString.toString(), new HashMap<>(), "1523106371", certPath, "PKCS12");
        //将结果xml解析成map
        body1 = body1.replaceAll("<!\\[CDATA\\[","");
        body1 = body1.replaceAll("]]>", "");
        try {
            map1 = this.xmlToMap(body1, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (DocumentException e) {
            e.printStackTrace();
        }
        String return_code = map1.get("return_code");
        Map<String, String> map2 = new HashMap<>();
        if("SUCCESS".equals(return_code)){
            String result_code = map1.get("result_code");
            if("SUCCESS".equals(result_code)){
                map2.put("return_code", result_code);
                map2.put("payment_no", String.valueOf(map1.get("payment_no")));//付款订单号
                map2.put("payment_time", String.valueOf(map1.get("payment_time")));//付款时间
                return map2;
            }else{
                map2.put("return_code", result_code);
                map2.put("err_code", map1.get("err_code"));
                map2.put("err_code_des", map1.get("err_code_des"));
                return map2;
            }
        }else{
            map2.put("return_code", return_code);
            map2.put("return_msg", map1.get("return_msg"));
            return map2;
        }
    }
    /**
     * 微信转账功能(企业付款到银行卡)
     * @param desc              备注信息
     * @param total_fee         转账金额
     * @param partner_trade_no  订单号
     * @param enc_bank_no       银行卡号
     * @param enc_true_name     收款方用户名
     * @param bankName          银行名称
     * @return
     * @throws Exception
     */
    public Map<String, String> wxPayBank(String desc, String total_fee, String partner_trade_no, String enc_bank_no, String enc_true_name, String bankName) throws Exception{
        int amount = new BigDecimal(total_fee).multiply(new BigDecimal("100")).intValue();
        String nonce_str = UUIDUtil.getRandomCode();
        Map<String, Object> map = new HashMap<>();
        map.put("mch_id", mchId);//微信支付分配的商户号
        map.put("nonce_str", nonce_str);//随机字符串,不长于32位
        map.put("partner_trade_no", partner_trade_no);//商户订单号,需保持唯一性
        map.put("enc_bank_no", enc_bank_no);//收款方银行卡号(采用标准RSA算法,公钥由微信侧提供)
        map.put("enc_true_name", enc_true_name);//收款方用户名(采用标准RSA算法,公钥由微信侧提供)
        map.put("bank_code", findBankCode(bankName));//
        map.put("amount", amount);//企业付款金额,单位为分
        map.put("desc", desc);//企业付款备注,必填。
        String s = this.weixinSignature(map, key);
        map.put("sign", s);
        String url = "https://api.mch.weixin.qq.com/mmpaysptrans/pay_bank";
        //设置请求头
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_XML);
        StringBuffer xmlString = new StringBuffer();
        Set<String> strings = map.keySet();
        String[] keys = {};
        keys = strings.toArray(keys);
        Arrays.sort(keys);
        xmlString.append("<xml>");
        for(int l = 0; l < keys.length; l++){
            xmlString.append("<" + keys[l] + ">" + map.get(keys[l]) + "</" + keys[l] + ">");
        }
        xmlString.append("</xml>");
        Map<String, String> map1 = null;
        String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//证书地址
        String body1 = httpClientUtil.pushHttpsRequsetXml(url, xmlString.toString(), new HashMap<>(), "1523106371", certPath, "PKCS12");
        //将结果xml解析成map
        body1 = body1.replaceAll("<!\\[CDATA\\[","");
        body1 = body1.replaceAll("]]>", "");
        try {
            map1 = this.xmlToMap(body1, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (DocumentException e) {
            e.printStackTrace();
        }
        String return_code = map1.get("return_code");
        Map<String, String> map2 = new HashMap<>();
        if("SUCCESS".equals(return_code)){
            String result_code = map1.get("result_code");
            if("SUCCESS".equals(result_code)){
                map2.put("return_code", result_code);
                map2.put("payment_no", String.valueOf(map1.get("payment_no")));//付款订单号
                map2.put("cmms_amt", String.valueOf(map1.get("cmms_amt")));//手续费金额 RMB:分
                return map2;
            }else{
                map2.put("return_code", result_code);
                map2.put("err_code", map1.get("err_code"));
                map2.put("err_code_des", map1.get("err_code_des"));
                return map2;
            }
        }else{
            map2.put("return_code", return_code);
            map2.put("return_msg", map1.get("return_msg"));
            return map2;
        }
    }
    /**
     * 微信转账到银行卡不编号
     * @param bankName
     * @return
     */
    public String findBankCode(String bankName){
        String json = "{\"工商银行 \":1002,\"农业银行\":1005,\"建设银行\":1003,\"中国银行\":1026,\"交通银行 \":1020,\"招商银行 \":1001,\"邮储银行\":1066,\"民生银行 \":1006,\"平安银行 \":1010,\"中信银行\":1021,\"浦发银行 \":1004,\"兴业银行 \":1009,\"光大银行 \":1022,\"广发银行\":1027,\"华夏银行\":1025,\"宁波银行\":1056,\"北京银行\":4836,\"上海银行\":1024,\"南京银行\":1054,\"长子县融汇村镇银行\":4755,\"长沙银行\":4216,\"浙江泰隆商业银行\":4051,\"中原银行 \":4753,\"企业银行(中国)\":4761,\"顺德农商银行 \":4036,\"衡水银行\":4752,\"长治银行\":4756,\"大同银行\":4767,\"河南省农村信用社\":4115,\"宁夏黄河农村商业银行\":4150,\"山西省农村信用社\":4156,\"安徽省农村信用社\":4166,\"甘肃省农村信用社\":4157,\"天津农村商业银行\":4153,\"广西壮族自治区农村信用社\":4113,\"陕西省农村信用社\":4108,\"深圳农村商业银行\":4076,\"宁波鄞州农村商业银行\":4052,\"浙江省农村信用社联合社\":4764,\"江苏省农村信用社联合社\":4217,\"江苏紫金农村商业银行股份有限公司 \":4072,\"北京中关村银行股份有限公司 \":4769,\"星展银行( 中国) 有限公司 \":4778,\"枣庄银行股份有限公司 \":4766,\"海口联合农村商业银行股份有限公司 \":4758,\"南洋商业银行( 中国) 有限公司 \":4763}";
        JSONObject jsonObject = JSON.parseObject(json);
        Set<String> strings = jsonObject.keySet();
        for(String key : strings){
            if(key.indexOf(bankName) >= 0){
                return jsonObject.getString(key);
            }
        }
        return "";
    }
    /**
     * 支付宝转账
     * @param out_biz_no        商家侧唯一订单号,由商家自定义。对于不同转账请求,商家需保证该订单号在自身系统唯一。
     * @param trans_amount      订单总金额,单位为元,精确到小数点后两位
     * @param order_title       转账业务的标题,用于在支付宝用户的账单里显示
     * @param identity          参与方的唯一标识(收款方支付宝账号)
     * @param name              参与方真实姓名,如果非空,将校验收款支付宝账号姓名一致性。
     * @param remark            业务备注
     * @return
     * @throws Exception
     */
    public Map<String, Object> aliTransfer(String out_biz_no, Double trans_amount, String order_title, String identity, String name, String remark) throws Exception{
        CertAlipayRequest certAlipayRequest = new CertAlipayRequest();
        certAlipayRequest.setServerUrl("https://openapi.alipay.com/gateway.do");  //gateway:支付宝网关(固定)https://openapi.alipay.com/gateway.do
        certAlipayRequest.setAppId(aliAppid);  //APPID 即创建应用后生成,详情见创建应用并获取 APPID
        certAlipayRequest.setPrivateKey(appPrivateKey);  //开发者应用私钥,由开发者自己生成
        certAlipayRequest.setFormat("json");  //参数返回格式,只支持 json 格式
        certAlipayRequest.setCharset("UTF-8");  //请求和签名使用的字符编码格式,支持 GBK和 UTF-8
        certAlipayRequest.setSignType("RSA2");  //商户生成签名字符串所使用的签名算法类型,目前支持 RSA2 和 RSA,推荐商家使用 RSA2。
        certAlipayRequest.setCertPath(app_cert_path); //应用公钥证书路径(app_cert_path 文件绝对路径)
        certAlipayRequest.setAlipayPublicCertPath(alipay_cert_path); //支付宝公钥证书文件路径(alipay_cert_path 文件绝对路径)
        certAlipayRequest.setRootCertPath(alipay_root_cert_path);  //支付宝CA根证书文件路径(alipay_root_cert_path 文件绝对路径)
        AlipayClient alipayClient = new DefaultAlipayClient(certAlipayRequest);
        AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
        request.setBizContent("{" +
                "\"out_biz_no\":\"" + out_biz_no + "\"," +
                "\"trans_amount\":" + trans_amount + "," +
                "\"product_code\":\"TRANS_ACCOUNT_NO_PWD\"," +
                "\"biz_scene\":\"DIRECT_TRANSFER\"," +
                "\"order_title\":\"" + order_title + "\"," +
                "\"payee_info\":{" +
                "\"identity\":\"" + identity + "\"," +
                "\"identity_type\":\"ALIPAY_USER_ID\"," +
                "\"name\":\"" + name + "\"," +
                "}," +
                "\"remark\":\"" + remark + "\"" +
                "}");
        AlipayFundTransUniTransferResponse response = alipayClient.certificateExecute(request);
        Map<String, Object> map = new HashMap<>();
        if(response.isSuccess()){
            String status = response.getStatus();
            if(status.equals("SUCCESS")){//成功
                map.put("code", response.getCode());
                map.put("order_id", response.getOrderId());//支付宝订单号
                map.put("pay_fund_order_id", response.getPayFundOrderId());//支付宝流水号
            }else{
                map.put("code", response.getCode());
                map.put("sub_msg", response.getSubMsg());
            }
        } else {
            map.put("code", response.getSubCode());
            map.put("sub_msg", response.getSubMsg());
        }
        return map;
    }
    /**
@@ -1066,42 +787,6 @@
                }
            }
            sb.append("key=" + key);
            String sign = MD5AndKL.MD5Encode(sb.toString(), "UTF-8").toUpperCase(); //注:MD5签名方式
            return sign;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * 微信下单的签名算法
     * @param map
     * @return
     */
    private String weixinSignature(Map<String, Object> map, String key_){
        try {
            Set<Map.Entry<String, Object>> entries = map.entrySet();
            List<Map.Entry<String, Object>> infoIds = new ArrayList<Map.Entry<String, Object>>(entries);
            // 对所有传入参数按照字段名的 ASCII 码从小到大排序(字典序)
            Collections.sort(infoIds, new Comparator<Map.Entry<String, Object>>() {
                public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2) {
                    return (o1.getKey()).toString().compareTo(o2.getKey());
                }
            });
            // 构造签名键值对的格式
            StringBuilder sb = new StringBuilder();
            for (Map.Entry<String, Object> item : infoIds) {
                if (item.getKey() != null || item.getKey() != "") {
                    String key = item.getKey();
                    Object val = item.getValue();
                    if (!(val == "" || val == null)) {
                        sb.append(key + "=" + val + "&");
                    }
                }
            }
            sb.append("key=" + key_);
            String sign = MD5AndKL.MD5Encode(sb.toString(), "UTF-8").toUpperCase(); //注:MD5签名方式
            return sign;
        } catch (Exception e) {
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java
@@ -12,6 +12,7 @@
import com.stylefeng.guns.modular.system.dao.SystemPriceMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil;
import com.stylefeng.guns.modular.taxi.model.TransactionDetails;
import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -92,7 +93,12 @@
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/baseInfoPassenger", map, header,"form");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/baseInfoPassenger", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("---------------------------乘客基本信息--------------------------:" + result);
    }
@@ -134,7 +140,12 @@
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCancel", map, header,"form");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCancel", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("----------------------------订单撤销接口------------------:" + result);
    }
@@ -220,7 +231,12 @@
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operatePay", map, header,"form");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operatePay", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("------------------------经营支付接口----------------------:" + result);
    }
@@ -247,7 +263,12 @@
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/ratedPassenger", map, header,"form");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/ratedPassenger", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("-----------------------------乘客评价信息----------------------:" + result);
    }
@@ -278,7 +299,12 @@
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip");
        header.put("Accept-Charset", "utf-8");
        String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/ratedDriver", map, header,"form");
        String result = null;
        try {
            result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/ratedDriver", map, header,"form").getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println("---------------------------驾驶员信誉信息-----------------------:" + result);
    }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java
@@ -18,6 +18,8 @@
import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.*;
/**
@@ -48,7 +50,6 @@
    private Map<String, Timer> taskMap = new HashMap<>();//存储定时推送的定时器
    private final String host = "http://ZUUL-GATEWAY/";
@@ -68,13 +69,8 @@
        Map<String, Object> map = new HashMap<>();
        map.put("orderId", orderId);
        map.put("orderType", orderType);
        map.put("time", time);
        if(orderType==1 && state==100){
            map.put("carpooling", 1);
            map.put("state", 2);
        }else{
            map.put("state", state);
        }
        map.put("time", time);
        jsonObject.put("data", map);
        //调用推送
@@ -84,10 +80,21 @@
        //将请求头部和参数合成一个请求
        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
        params.add("msg", jsonObject.toJSONString());
        if(orderType == 2 && type == 1){
            OrderTaxi orderTaxi = orderTaxiService.selectById(orderId);
            if(orderTaxi.getOrderSource() == 7){
                params.add("id", orderTaxi.getDeviceCode());
            }else{
        params.add("id", String.valueOf(uid));
            }
        }else{
            params.add("id", String.valueOf(uid));
        }
        params.add("type", String.valueOf(type));
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
        String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class);
        String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class);
        JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class);
        if(jsonObject1.getIntValue("code") != 200){
            System.err.println(jsonObject1.getString("msg"));
@@ -119,10 +126,20 @@
        //将请求头部和参数合成一个请求
        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
        params.add("msg", jsonObject.toJSONString());
        if(orderType == 2 && type == 1){
            OrderTaxi orderTaxi = orderTaxiService.selectById(orderId);
            if(orderTaxi.getOrderSource() == 7){
                params.add("id", orderTaxi.getDeviceCode());
            }else{
        params.add("id", String.valueOf(uid));
            }
        }else{
            params.add("id", String.valueOf(uid));
        }
        params.add("type", String.valueOf(type));
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
        String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class);
        String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class);
        JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class);
        if(jsonObject1.getIntValue("code") != 200){
            System.err.println(jsonObject1.getString("msg"));
@@ -237,8 +254,8 @@
        if(null == distance){
            System.err.println("查询距离出错了");
        }else{
            d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
            t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
            d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
            t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
        }
        JSONObject msg = new JSONObject();
        msg.put("code", 200);
@@ -271,8 +288,8 @@
            if(null == distance){
                System.err.println("查询距离出错了");
            }else{
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
            }
            map.put("laveMileage", d);//距离终点剩余未服务的里程数
            map.put("laveTime", t);//距离终端剩余未服务的预计时间
@@ -288,10 +305,20 @@
        JSONObject jsonObject = pushMap.get(orderId + "_" + orderType);
        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
        params.add("msg", msg.toJSONString());
        if(orderType == 2){
            OrderTaxi orderTaxi = orderTaxiService.selectById(orderId);
            if(orderTaxi.getOrderSource() == 7){
                params.add("id", orderTaxi.getDeviceCode());
            }else{
        params.add("id", jsonObject.getString("id"));
            }
        }else{
            params.add("id", jsonObject.getString("id"));
        }
        params.add("type", jsonObject.getString("type"));
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
        String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class);
        String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class);
        JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class);
        if(jsonObject1.getIntValue("code") != 200){
            System.err.println(jsonObject1.getString("msg"));
@@ -321,7 +348,7 @@
        params.add("id", id.toString());
        params.add("type", type.toString());
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
        String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class);
        String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class);
        JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class);
        if(jsonObject1.getIntValue("code") != 200){
            System.err.println(jsonObject1.getString("msg"));
@@ -355,10 +382,20 @@
        //将请求头部和参数合成一个请求
        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
        params.add("msg", jsonObject.toJSONString());
        if(orderType == 2 && type == 1){
            OrderTaxi orderTaxi = orderTaxiService.selectById(orderId);
            if(orderTaxi.getOrderSource() == 7){
                params.add("id", orderTaxi.getDeviceCode());
            }else{
        params.add("id", String.valueOf(uid));
            }
        }else{
            params.add("id", String.valueOf(uid));
        }
        params.add("type", String.valueOf(type));
        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
        String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class);
        String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class);
        JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class);
        if(jsonObject1.getIntValue("code") != 200){
            System.err.println(jsonObject1.getString("msg"));
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RedisUtil.java
@@ -24,7 +24,6 @@
    @Autowired
    private RestTemplate internalRestTemplate;
    private final String host = "http://ZUUL-GATEWAY/";
    /**
     * 向redis中存储字符串没有过期时间
@@ -42,7 +41,7 @@
            params.add("key", key);
            params.add("value", value);
            HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
            String s = internalRestTemplate.postForObject(host + "/redis/setValue_", requestEntity, String.class);
            String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/setValue_", requestEntity, String.class);
            JSONObject jsonObject = JSON.parseObject(s, JSONObject.class);
            if(jsonObject.getIntValue("code") != 200){
                System.err.println("调用redis出错了");
@@ -70,7 +69,7 @@
            params.add("value", value);
            params.add("time", String.valueOf(time));
            HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(params, headers);
            String s = internalRestTemplate.postForObject(host + "/redis/setValue", requestEntity, String.class);
            String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/setValue", requestEntity, String.class);
            JSONObject jsonObject = JSON.parseObject(s, JSONObject.class);
            if(jsonObject.getIntValue("code") != 200){
                System.err.println("调用redis出错了");
@@ -93,7 +92,7 @@
            MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
            params.add("key", key);
            HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
            String s = internalRestTemplate.postForObject(host + "/redis/getValue",requestEntity , String.class);
            String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/getValue",requestEntity , String.class);
            JSONObject jsonObject = JSON.parseObject(s, JSONObject.class);
            if(jsonObject.getIntValue("code") != 200){
                System.err.println("调用redis出错了");
@@ -117,7 +116,7 @@
            MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
            params.add("key", key);
            HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
            String s = internalRestTemplate.postForObject(host + "/redis/remove",requestEntity , String.class);
            String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/remove",requestEntity , String.class);
            JSONObject jsonObject = JSON.parseObject(s, JSONObject.class);
            if(jsonObject.getIntValue("code") != 200){
                System.err.println("调用redis出错了");
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java
@@ -2,8 +2,6 @@
import com.stylefeng.guns.modular.system.service.IUserCouponRecordService;
import com.stylefeng.guns.modular.system.service.IUserMerchantCouponService;
import com.stylefeng.guns.modular.system.service.IUserTaxiCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -18,9 +16,6 @@
    @Autowired
    private IUserCouponRecordService userCouponRecordService;
    @Autowired
    private IUserMerchantCouponService userMerchantCouponService;
    /**
@@ -31,8 +26,6 @@
        try {
            //修改过期的优惠券
            userCouponRecordService.updateTimeOut();
            //修改过期的商家优惠券
            userMerchantCouponService.updateExpired();
        } catch (Exception e) {
            e.printStackTrace();
        }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/UUIDUtil.java
@@ -72,7 +72,7 @@
     * @return
     */
    public synchronized static String getTimeStr(){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmssS");
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmssSSS");
        return simpleDateFormat.format(new Date());
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/VerifyCodeUtils.java
New file
@@ -0,0 +1,260 @@
package com.stylefeng.guns.modular.system.util;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Random;
public class VerifyCodeUtils {
    //使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
    public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
    private static Random random = new Random();
    /**
     * 使用系统默认字符源生成验证码
     * @param verifySize    验证码长度
     * @return
     */
    public static String generateVerifyCode(int verifySize){
        return generateVerifyCode(verifySize, VERIFY_CODES);
    }
    /**
     * 使用指定源生成验证码
     * @param verifySize    验证码长度
     * @param sources   验证码字符源
     * @return
     */
    public static String generateVerifyCode(int verifySize, String sources){
        if(sources == null || sources.length() == 0){
            sources = VERIFY_CODES;
        }
        int codesLen = sources.length();
        Random rand = new Random(System.currentTimeMillis());
        StringBuilder verifyCode = new StringBuilder(verifySize);
        for(int i = 0; i < verifySize; i++){
            verifyCode.append(sources.charAt(rand.nextInt(codesLen-1)));
        }
        return verifyCode.toString();
    }
    /**
     * 生成随机验证码文件,并返回验证码值
     * @param w
     * @param h
     * @param outputFile
     * @param verifySize
     * @return
     * @throws IOException
     */
    public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException {
        String verifyCode = generateVerifyCode(verifySize);
        outputImage(w, h, outputFile, verifyCode);
        return verifyCode;
    }
    /**
     * 输出随机验证码图片流,并返回验证码值
     * @param w
     * @param h
     * @param os
     * @param verifySize
     * @return
     * @throws IOException
     */
    public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException{
        String verifyCode = generateVerifyCode(verifySize);
        outputImage(w, h, os, verifyCode);
        return verifyCode;
    }
    /**
     * 生成指定验证码图像文件
     * @param w
     * @param h
     * @param outputFile
     * @param code
     * @throws IOException
     */
    public static void outputImage(int w, int h, File outputFile, String code) throws IOException{
        if(outputFile == null){
            return;
        }
        File dir = outputFile.getParentFile();
        if(!dir.exists()){
            dir.mkdirs();
        }
        try{
            outputFile.createNewFile();
            FileOutputStream fos = new FileOutputStream(outputFile);
            outputImage(w, h, fos, code);
            fos.close();
        } catch(IOException e){
            throw e;
        }
    }
    /**
     * 输出指定验证码图片流
     * @param w
     * @param h
     * @param os
     * @param code
     * @throws IOException
     */
    public static void outputImage(int w, int h, OutputStream os, String code) throws IOException{
        int verifySize = code.length();
        BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Random rand = new Random();
        Graphics2D g2 = image.createGraphics();
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
        Color[] colors = new Color[5];
        Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN,
                Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, Color.ORANGE,
                Color.PINK, Color.YELLOW };
        float[] fractions = new float[colors.length];
        for(int i = 0; i < colors.length; i++){
            colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)];
            fractions[i] = rand.nextFloat();
        }
        Arrays.sort(fractions);
        g2.setColor(Color.GRAY);// 设置边框色
        g2.fillRect(0, 0, w, h);
        Color c = getRandColor(200, 250);
        g2.setColor(c);// 设置背景色
        g2.fillRect(0, 2, w, h-4);
        //绘制干扰线
        Random random = new Random();
        g2.setColor(getRandColor(160, 200));// 设置线条的颜色
        for (int i = 0; i < 20; i++) {
            int x = random.nextInt(w - 1);
            int y = random.nextInt(h - 1);
            int xl = random.nextInt(6) + 1;
            int yl = random.nextInt(12) + 1;
            g2.drawLine(x, y, x + xl + 40, y + yl + 20);
        }
        // 添加噪点
        float yawpRate = 0.05f;// 噪声率
        int area = (int) (yawpRate * w * h);
        for (int i = 0; i < area; i++) {
            int x = random.nextInt(w);
            int y = random.nextInt(h);
            int rgb = getRandomIntColor();
            image.setRGB(x, y, rgb);
        }
        shear(g2, w, h, c);// 使图片扭曲
        g2.setColor(getRandColor(100, 160));
        int fontSize = h-4;
        Font font = new Font("Algerian", Font.ITALIC, fontSize);
        g2.setFont(font);
        char[] chars = code.toCharArray();
        for(int i = 0; i < verifySize; i++){
            AffineTransform affine = new AffineTransform();
            affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + fontSize/2, h/2);
            g2.setTransform(affine);
            g2.drawChars(chars, i, 1, ((w-10) / verifySize) * i + 5, h/2 + fontSize/2 - 10);
        }
        g2.dispose();
        ImageIO.write(image, "png", os);
    }
    private static Color getRandColor(int fc, int bc) {
        if (fc > 255)
            fc = 255;
        if (bc > 255)
            bc = 255;
        int r = fc + random.nextInt(bc - fc);
        int g = fc + random.nextInt(bc - fc);
        int b = fc + random.nextInt(bc - fc);
        return new Color(r, g, b);
    }
    private static int getRandomIntColor() {
        int[] rgb = getRandomRgb();
        int color = 0;
        for (int c : rgb) {
            color = color << 8;
            color = color | c;
        }
        return color;
    }
    private static int[] getRandomRgb() {
        int[] rgb = new int[3];
        for (int i = 0; i < 3; i++) {
            rgb[i] = random.nextInt(255);
        }
        return rgb;
    }
    private static void shear(Graphics g, int w1, int h1, Color color) {
        shearX(g, w1, h1, color);
        shearY(g, w1, h1, color);
    }
    private static void shearX(Graphics g, int w1, int h1, Color color) {
        int period = random.nextInt(2);
        boolean borderGap = true;
        int frames = 1;
        int phase = random.nextInt(2);
        for (int i = 0; i < h1; i++) {
            double d = (double) (period >> 1)
                    * Math.sin((double) i / (double) period
                    + (6.2831853071795862D * (double) phase)
                    / (double) frames);
            g.copyArea(0, i, w1, 1, (int) d, 0);
            if (borderGap) {
                g.setColor(color);
                g.drawLine((int) d, i, 0, i);
                g.drawLine((int) d + w1, i, w1, i);
            }
        }
    }
    private static void shearY(Graphics g, int w1, int h1, Color color) {
        int period = random.nextInt(40) + 10; // 50;
        boolean borderGap = true;
        int frames = 20;
        int phase = 7;
        for (int i = 0; i < w1; i++) {
            double d = (double) (period >> 1)
                    * Math.sin((double) i / (double) period
                    + (6.2831853071795862D * (double) phase)
                    / (double) frames);
            g.copyArea(i, 0, 1, h1, 0, (int) d);
            if (borderGap) {
                g.setColor(color);
                g.drawLine(i, (int) d, i, 0);
                g.drawLine(i, (int) d + h1, i, h1);
            }
        }
    }
    public static void main(String[] args) throws IOException{
        File dir = new File("C:/Users/H__D/Desktop/");
        int w = 200, h = 80;
        String verifyCode = generateVerifyCode(4);
        File file = new File(dir, verifyCode + ".jpg");
        outputImage(w, h, file, verifyCode);
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/httpClinet/HttpClientUtil.java
New file
@@ -0,0 +1,265 @@
package com.stylefeng.guns.modular.system.util.httpClinet;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.ssl.SSLContexts;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Component;
import javax.net.ssl.SSLContext;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.security.KeyStore;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * http工具类
 */
@Component
public class HttpClientUtil {
    private PoolingHttpClientConnectionManager connectionManager;
    public HttpClientUtil(){
        //1.创建连接池管理器
        connectionManager = new PoolingHttpClientConnectionManager(60000,
                TimeUnit.MILLISECONDS);
        connectionManager.setMaxTotal(1000);
        connectionManager.setDefaultMaxPerRoute(50);
    }
    /**
     * 创建一个httpClient对象
     */
    private CloseableHttpClient getHttpCline(){
        return  HttpClients.custom()
                .setConnectionManager(connectionManager)
                .disableAutomaticRetries()
                .build();
    }
    private RequestConfig getRequestConfig(){
        RequestConfig.Builder builder = RequestConfig.custom();
        builder.setSocketTimeout(60000)//3.1设置客户端等待服务端返回数据的超时时间
                .setConnectTimeout(30000)//3.2设置客户端发起TCP连接请求的超时时间
                .setExpectContinueEnabled(true)
                .setConnectionRequestTimeout(30000);//3.3设置客户端从连接池获取链接的超时时间
        return builder.build();
    }
    /**
     * 创建一个POST请求实例
     * @param url       请求地址
     * @param params    请求参数
     */
    private CloseableHttpResponse setPostHttpRequset(String url, Map<String, Object> params, Map<String, String> header, String contentType) throws Exception{
        HttpPost httpPost = new HttpPost(url);
        httpPost.setConfig(this.getRequestConfig());
        if(null != header){
            for(String key : header.keySet()){
                httpPost.setHeader(key, header.get(key));
            }
        }
        List<NameValuePair> list = new ArrayList<>();
        if(null != params){
            Set<String> keys = params.keySet();
            for(String key : keys){
                list.add(new BasicNameValuePair(key, null == params.get(key) ? null : params.get(key).toString()));
            }
        }
        switch (contentType){
            case "form":
                httpPost.setEntity(new UrlEncodedFormEntity(list, "UTF-8"));
                break;
            case "json":
                ObjectMapper objectMapper = new ObjectMapper();
                String s =objectMapper.writeValueAsString(params);
                httpPost.setEntity(new StringEntity(s, ContentType.create(ContentType.APPLICATION_JSON.getMimeType(), Charset.forName("UTF-8"))));
                break;
        }
        return getHttpCline().execute(httpPost);
    }
    /**
     * 获取get请求实例
     * @param url       请求地址
     * @param params    请求参数
     */
    private CloseableHttpResponse setGetHttpRequset(String url, Map<String, Object> params, Map<String, String> header) throws Exception{
        StringBuffer sb = new StringBuffer();
        String p = "";
        if(null != params){
            Set<String> keys = params.keySet();
            for(String key : keys){
                sb.append(key + "=" + params.get(key) + "&");
            }
            p = "?" + sb.substring(0, sb.length() - 1);
        }
        HttpGet httpGet = new HttpGet(url + p);
        httpGet.setConfig(getRequestConfig());
        if(null != header){
            for(String key : header.keySet()){
                httpGet.setHeader(key, header.get(key));
            }
        }
        return getHttpCline().execute(httpGet);
    }
    /**
     * 发送http请求
     * @param mothed        "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS"
     * @param url           请求地址
     * @param params        请求参数
     * @param header        请求头
     * @param contentType   参数请求方式form/json
     * @return
     */
    public HttpResult pushHttpRequset(String mothed, String url, Map<String, Object> params, Map<String, String> header, String contentType) throws Exception{
        String randome = UUID.randomUUID().toString();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:S");
        System.err.println(sdf.format(new Date()) + "----(" + randome + ")请求参数:" + JSON.toJSONString(params));
        CloseableHttpResponse httpResponse = null;
        switch (mothed){
            case "GET":
                httpResponse = this.setGetHttpRequset(url, params, header);
                break;
            case "POST":
                httpResponse = setPostHttpRequset(url, params, header, contentType);
                break;
        }
        int statusCode = httpResponse.getStatusLine().getStatusCode();
        String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
        System.err.println(sdf.format(new Date()) + "----(" + randome + ")返回结果:" + content);
        HttpResult httpResult = HttpResult.getHttpResult(statusCode, content);
        this.close(httpResponse);
        return httpResult;
    }
    /**
     * 发送XML请求
     * @param url       请求地址
     * @param xml       XML数据
     * @param header    自定义请求头
     * @return
     */
    public HttpResult pushHttpRequsetXml(String url, String xml, Map<String, String> header) throws Exception{
        HttpPost httpPost = new HttpPost(url);
        httpPost.setConfig(getRequestConfig());
        for(String key : header.keySet()){
            httpPost.setHeader(key, header.get(key));
        }
        httpPost.setHeader("Content-Type", "application/xml");
        httpPost.setEntity(new StringEntity(xml, "UTF-8"));
        CloseableHttpResponse httpResponse = getHttpCline().execute(httpPost);
        int statusCode = httpResponse.getStatusLine().getStatusCode();
        String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
        HttpResult httpResult = HttpResult.getHttpResult(statusCode, content);
        this.close(httpResponse);
        return httpResult;
    }
    /**
     * 请求https发送XML请求
     * @param url           接口路径
     * @param xml           内容
     * @param header        请求头
     * @param certPassword      证书密码
     * @param certPath      证书路径
     * @param certType      证书类型
     * @return
     * @throws Exception
     */
    public String pushHttpsRequsetXml(String url, String xml, Map<String, String> header, String certPassword, String certPath, String certType) throws Exception{
        HttpPost httpPost = new HttpPost(url);
        for(String key : header.keySet()){
            httpPost.setHeader(key, header.get(key));
        }
        httpPost.setHeader("Content-Type", "application/xml");
        httpPost.setEntity(new StringEntity(xml, "UTF-8"));
        CloseableHttpClient httpCline = this.initCert(certPassword, certPath, certType);
        CloseableHttpResponse httpResponse = httpCline.execute(httpPost);
        String content = null;
        if(httpResponse.getStatusLine().getStatusCode() == 200){
            content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8");
        }else{
            content = "返回状态码:" + httpResponse.getStatusLine() + "。" + EntityUtils.toString(httpResponse.getEntity());
        }
        this.close(httpResponse);
        httpCline.close();
        return content;
    }
    /**
     * 初始化https对象(带证书)
     * @param key       证书密码
     * @param certPath  证书路径
     * @param certType  证书类型
     * @throws Exception
     */
    private CloseableHttpClient initCert(String key, String certPath, String certType) throws Exception {
        KeyStore keyStore = KeyStore.getInstance(certType);
        InputStream inputStream = new FileInputStream(new File(certPath));
        try {
            keyStore.load(inputStream, key.toCharArray());
        } finally {
            inputStream.close();
        }
        SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, key.toCharArray()).build();
        SSLConnectionSocketFactory sslsf =
                new SSLConnectionSocketFactory(sslcontext, new String[] {"TLSv1"}, null,
                        SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
        return HttpClients.custom().setSSLSocketFactory(sslsf).build();
    }
    /**
     * 关闭资源
     */
    private void close(CloseableHttpResponse httpResponse){
        try {
            if(null != httpResponse){
                EntityUtils.consume(httpResponse.getEntity());//此处高能,通过源码分析,由EntityUtils是否回收HttpEntity
                httpResponse.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            try {
                if(null != httpResponse){
                    httpResponse.close();
                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/httpClinet/HttpResult.java
New file
@@ -0,0 +1,45 @@
package com.stylefeng.guns.modular.system.util.httpClinet;
/**
 * http请求返回封装
 */
public class HttpResult {
    /**
     * 返回状态码
     */
    private Integer code;
    /**
     * 返回结果
     */
    private String data;
    /**
     * 返回封装结果
     * @param code
     * @param data
     * @return
     */
    public static HttpResult getHttpResult(Integer code, String data){
        HttpResult httpResult = new HttpResult();
        httpResult.setCode(code);
        httpResult.setData(data);
        return httpResult;
    }
    public Integer getCode() {
        return code;
    }
    public void setCode(Integer code) {
        this.code = code;
    }
    public String getData() {
        return data;
    }
    public void setData(String data) {
        this.data = data;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/BankCardWarpper.java
New file
@@ -0,0 +1,64 @@
package com.stylefeng.guns.modular.system.warpper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * 银行卡
 */
@ApiModel
public class BankCardWarpper {
    /**
     * 主键
     */
    @ApiModelProperty("id")
    private Integer id;
    /**
     * 银行全称
     */
    @ApiModelProperty("银行全称")
    private String bank;
    /**
     * 开户人姓名
     */
    @ApiModelProperty("开户人姓名")
    private String name;
    /**
     * 银行卡号
     */
    @ApiModelProperty("银行卡号")
    private String code;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getBank() {
        return bank;
    }
    public void setBank(String bank) {
        this.bank = bank;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/CouponWarpper.java
@@ -12,7 +12,7 @@
    @ApiModelProperty("主键id")
    private Integer id;
    @ApiModelProperty("优惠金额")
    private Double money = 0D;
    private Double money;
    @ApiModelProperty("类型(0=通用,1=专车,2=出租车,3=城际,4=小件物流)")
    private Integer userType;
    @ApiModelProperty("有效期")
@@ -23,8 +23,6 @@
    private Double fullMoney;
    @ApiModelProperty("公司名称")
    private String name;
    @ApiModelProperty("优惠券名称")
    private String couponName;
    @ApiModelProperty("状态(1=未使用,2=已使用,3=已过期)")
    private Integer state;
@@ -92,14 +90,6 @@
        this.state = state;
    }
    public String getCouponName() {
        return couponName;
    }
    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }
    @Override
    public String toString() {
        return "CouponWarpper{" +
@@ -126,7 +116,6 @@
                couponWarpper.setFullMoney(null != map.get("fullMoney") ? Double.valueOf(String.valueOf(map.get("fullMoney"))) : 0);
                couponWarpper.setName(null != map.get("name") ? String.valueOf(map.get("name")) : "");
                couponWarpper.setState(null != map.get("state") ? Integer.valueOf(String.valueOf(map.get("state"))) : 0);
                couponWarpper.setCouponName(null != map.get("couponName") ? String.valueOf(map.get("couponName")) : "");
                list.add(couponWarpper);
            }
        }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/CouponsListVo.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MerchantCouponListWarpper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MerchantCouponWarpper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MerchantWapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderAdditionalFeeWarpper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderCrossCityInfoWrapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderInfoWarpper.java
@@ -1,13 +1,8 @@
package com.stylefeng.guns.modular.system.warpper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotations.TableField;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ApiModel("订单详情")
@@ -104,12 +99,6 @@
    private Double discount;
    @ApiModelProperty("折扣优惠金额")
    private Double discountMoney;
    @ApiModelProperty("打车卡优惠金额")
    private Double taxiCardMoney;
    @ApiModelProperty("节假日费")
    private Double holidayFee;
    @ApiModelProperty("附加费")
    private List<OrderAdditionalFeeWarpper> orderAdditionalFeeWarpper;
    @ApiModelProperty("订单支付金额")
    private Double payMoney;
    @ApiModelProperty("小费金额")
@@ -134,211 +123,6 @@
    private String cancelRemark;
    @ApiModelProperty("备注")
    private String remark;
    @ApiModelProperty("1=司机取消")
    private Integer driverCancle;
    @ApiModelProperty("一人拼成规则")
    private JSONObject contentPutOne;//一人拼成
    @ApiModelProperty("一人未拼成规则")
    private JSONObject contentNotOne;//一人未拼成
    @ApiModelProperty("2人拼成规则")
    private JSONObject contentPutTwo;//2人拼成
    @ApiModelProperty("2人未拼成规则")
    private JSONObject contentNotTwo;//2人未拼成
    @ApiModelProperty("3人拼成规则")
    private JSONObject contentPutThree;//3人拼成
    @ApiModelProperty("3人未拼成规则")
    private JSONObject contentNotThree;//3人未拼成
    @ApiModelProperty("独享规则")
    private JSONObject contentExclusive;//独享
    @ApiModelProperty("一口价规则")
    private JSONObject contentPrice;//一口价
    @ApiModelProperty("计价说明(拼车)")
    private String fareTypeNote1;
    @ApiModelProperty("计价说明(独享)")
    private String fareTypeNote2;
    @ApiModelProperty("计价说明(一口价)")
    private String fareTypeNote3;
    public JSONObject getContentPutOne() {
        return contentPutOne;
    }
    public void setContentPutOne(JSONObject contentPutOne) {
        this.contentPutOne = contentPutOne;
    }
    public JSONObject getContentNotOne() {
        return contentNotOne;
    }
    public void setContentNotOne(JSONObject contentNotOne) {
        this.contentNotOne = contentNotOne;
    }
    public JSONObject getContentPutTwo() {
        return contentPutTwo;
    }
    public void setContentPutTwo(JSONObject contentPutTwo) {
        this.contentPutTwo = contentPutTwo;
    }
    public JSONObject getContentNotTwo() {
        return contentNotTwo;
    }
    public void setContentNotTwo(JSONObject contentNotTwo) {
        this.contentNotTwo = contentNotTwo;
    }
    public JSONObject getContentPutThree() {
        return contentPutThree;
    }
    public void setContentPutThree(JSONObject contentPutThree) {
        this.contentPutThree = contentPutThree;
    }
    public JSONObject getContentNotThree() {
        return contentNotThree;
    }
    public void setContentNotThree(JSONObject contentNotThree) {
        this.contentNotThree = contentNotThree;
    }
    public JSONObject getContentExclusive() {
        return contentExclusive;
    }
    public void setContentExclusive(JSONObject contentExclusive) {
        this.contentExclusive = contentExclusive;
    }
    public JSONObject getContentPrice() {
        return contentPrice;
    }
    public void setContentPrice(JSONObject contentPrice) {
        this.contentPrice = contentPrice;
    }
    public String getFareTypeNote1() {
        return fareTypeNote1;
    }
    public void setFareTypeNote1(String fareTypeNote1) {
        this.fareTypeNote1 = fareTypeNote1;
    }
    public String getFareTypeNote2() {
        return fareTypeNote2;
    }
    public void setFareTypeNote2(String fareTypeNote2) {
        this.fareTypeNote2 = fareTypeNote2;
    }
    public String getFareTypeNote3() {
        return fareTypeNote3;
    }
    public void setFareTypeNote3(String fareTypeNote3) {
        this.fareTypeNote3 = fareTypeNote3;
    }
    public Integer getDriverCancle() {
        return driverCancle;
    }
    public void setDriverCancle(Integer driverCancle) {
        this.driverCancle = driverCancle;
    }
    /**
     * 乘车类型(1=独享,2=一口价,3=拼车)
     */
    @ApiModelProperty("乘车类型(1=独享,2=一口价,3=拼车)")
    private Integer rideType;
    private Integer pid;
    @ApiModelProperty("0未成功,1成功")
    private Integer spellSuccess;
    @ApiModelProperty("等待费规则")
    private String waitRule;
    @ApiModelProperty("计费规则")
    private String chargeRule;
    @ApiModelProperty("计费规则")
    private String chargeRules;
    public String getChargeRules() {
        return chargeRules;
    }
    public void setChargeRules(String chargeRules) {
        this.chargeRules = chargeRules;
    }
    public String getWaitRule() {
        return waitRule;
    }
    public void setWaitRule(String waitRule) {
        this.waitRule = waitRule;
    }
    public String getChargeRule() {
        return chargeRule;
    }
    public void setChargeRule(String chargeRule) {
        this.chargeRule = chargeRule;
    }
    public Integer getSpellSuccess() {
        return spellSuccess;
    }
    public void setSpellSuccess(Integer spellSuccess) {
        this.spellSuccess = spellSuccess;
    }
    public Integer getPid() {
        return pid;
    }
    public void setPid(Integer pid) {
        this.pid = pid;
    }
    @ApiModelProperty("送人订单")
    private List<OrderCrossCityInfoWrapper> giveOrderList=new ArrayList<>();
    @ApiModelProperty("接人订单")
    private List<OrderCrossCityInfoWrapper> meetOrderList=new ArrayList<>();
    public List<OrderCrossCityInfoWrapper> getGiveOrderList() {
        return giveOrderList;
    }
    public void setGiveOrderList(List<OrderCrossCityInfoWrapper> giveOrderList) {
        this.giveOrderList = giveOrderList;
    }
    public List<OrderCrossCityInfoWrapper> getMeetOrderList() {
        return meetOrderList;
    }
    public void setMeetOrderList(List<OrderCrossCityInfoWrapper> meetOrderList) {
        this.meetOrderList = meetOrderList;
    }
    public Integer getOrderId() {
        return orderId;
@@ -804,38 +588,6 @@
        this.lineShiftTime = lineShiftTime;
    }
    public Double getTaxiCardMoney() {
        return taxiCardMoney;
    }
    public void setTaxiCardMoney(Double taxiCardMoney) {
        this.taxiCardMoney = taxiCardMoney;
    }
    public Double getHolidayFee() {
        return holidayFee;
    }
    public void setHolidayFee(Double holidayFee) {
        this.holidayFee = holidayFee;
    }
    public Integer getRideType() {
        return rideType;
    }
    public void setRideType(Integer rideType) {
        this.rideType = rideType;
    }
    public List<OrderAdditionalFeeWarpper> getOrderAdditionalFeeWarpper() {
        return orderAdditionalFeeWarpper;
    }
    public void setOrderAdditionalFeeWarpper(List<OrderAdditionalFeeWarpper> orderAdditionalFeeWarpper) {
        this.orderAdditionalFeeWarpper = orderAdditionalFeeWarpper;
    }
    @Override
    public String toString() {
        return "OrderInfoWarpper{" +
@@ -897,14 +649,10 @@
                '}';
    }
    public static OrderInfoWarpper getOrderInfoWarpper(Map<String, Object> map, List<OrderAdditionalFeeWarpper> list){
    public static OrderInfoWarpper getOrderInfoWarpper(Map<String, Object> map){
        OrderInfoWarpper orderInfoWarpper = new OrderInfoWarpper();
        if(null != map){
            orderInfoWarpper.setOrderId(null != map.get("orderId") ? Integer.valueOf(String.valueOf(map.get("orderId"))) : 0);
            orderInfoWarpper.setPid(null != map.get("pid") ? Integer.valueOf(String.valueOf(map.get("pid"))) : 0);
            orderInfoWarpper.setSpellSuccess(null != map.get("spellSuccess") ? Integer.valueOf(String.valueOf(map.get("spellSuccess"))) : 1);
            orderInfoWarpper.setDriverCancle(null != map.get("driverCancle") ? Integer.valueOf(String.valueOf(map.get("driverCancle"))) : 0);
            orderInfoWarpper.setRideType(null != map.get("rideType") ? Integer.valueOf(String.valueOf(map.get("rideType"))) : 1);
            orderInfoWarpper.setOrderType(null != map.get("orderType") ? Integer.valueOf(map.get("orderType").toString()) : 0);
            orderInfoWarpper.setType(null != map.get("type") ? Integer.valueOf(map.get("type").toString()) : 0);
            orderInfoWarpper.setState(null != map.get("state") ? Integer.valueOf(String.valueOf(map.get("state"))) : 0);
@@ -917,9 +665,6 @@
            orderInfoWarpper.setDriverName(null != map.get("driverName") ? String.valueOf(map.get("driverName")).substring(0, 1) + "师傅" : "");
            orderInfoWarpper.setLicensePlate(null != map.get("licensePlate") ? String.valueOf(map.get("licensePlate")) : "");
            orderInfoWarpper.setBrand(null != map.get("brand") ? String.valueOf(map.get("brand")) : "");
            orderInfoWarpper.setWaitRule(null != map.get("waitRule") ? String.valueOf(map.get("waitRule")) : "");
            orderInfoWarpper.setChargeRule(null != map.get("chargeRule") ? String.valueOf(map.get("chargeRule")) : "");
            orderInfoWarpper.setChargeRules(null != map.get("chargeRules") ? String.valueOf(map.get("chargeRules")) : "");
            orderInfoWarpper.setScore(null != map.get("score") ? Double.valueOf(String.valueOf(map.get("score"))) : 0);
            orderInfoWarpper.setOrderNum(null != map.get("orderNum") ? Integer.valueOf(String.valueOf(map.get("orderNum"))) : 0);
            orderInfoWarpper.setDriverPhone(null != map.get("driverPhone") ? String.valueOf(map.get("driverPhone")) : "");
@@ -965,9 +710,6 @@
            orderInfoWarpper.setEndCity(null != map.get("endCity") ? map.get("endCity").toString() : "");
            orderInfoWarpper.setRemark(null != map.get("remark") ? map.get("remark").toString() : "");
            orderInfoWarpper.setLineShiftTime(null != map.get("lineShiftTime") ? map.get("lineShiftTime").toString() : "");
            orderInfoWarpper.setHolidayFee(null != map.get("holidayFee") ? Double.valueOf(map.get("holidayFee").toString()) : 0);
            orderInfoWarpper.setTaxiCardMoney(null != map.get("taxiCardMoney") ? Double.valueOf(map.get("taxiCardMoney").toString()) : 0);
            orderInfoWarpper.setOrderAdditionalFeeWarpper(list);
        }
        return orderInfoWarpper;
    }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderRuleWarpper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/OrderWarpper.java
@@ -43,61 +43,13 @@
    private Double payMoney;
    @ApiModelProperty("差价金额")
    private Double differenceMoney;
    @ApiModelProperty("感谢费")
    private Double thankYouFee;
    @ApiModelProperty("开票状态(1=未开票,2=已开票)")
    private Integer invoice;
    @ApiModelProperty("订单名称")
    private String orderName;
    @ApiModelProperty("订单类型(1=专车,2=出租车,3=跨城出行,4=同城小件物流,5=跨城小件物流)")
    private Integer orderType;
    @ApiModelProperty("小件物流用户上传图片,多个英文分号分隔")
    private String userImg;
    @ApiModelProperty("小件物流司机上传图片,多个英文分号分隔")
    private String driverImg;
    @ApiModelProperty("需要送达时间")
    private String arriveTimeExpect;
    @ApiModelProperty("下单时间")
    private Long insertTime;
    @ApiModelProperty("取件码")
    private String pickUpCode;
    @ApiModelProperty("服务结束事件")
    private String endServiceTime;
    @ApiModelProperty("乘车类型(1=独享,2=一口价,3=拼车)")
    private Integer rideType;
    public Integer getRideType() {
        return rideType;
    }
    public void setRideType(Integer rideType) {
        this.rideType = rideType;
    }
    public String getEndServiceTime() {
        return endServiceTime;
    }
    public void setEndServiceTime(String endServiceTime) {
        this.endServiceTime = endServiceTime;
    }
    public String getPickUpCode() {
        return pickUpCode;
    }
    public void setPickUpCode(String pickUpCode) {
        this.pickUpCode = pickUpCode;
    }
    public String getArriveTimeExpect() {
        return arriveTimeExpect;
    }
    public void setArriveTimeExpect(String arriveTimeExpect) {
        this.arriveTimeExpect = arriveTimeExpect;
    }
    public Integer getOrderId() {
        return orderId;
@@ -243,30 +195,6 @@
        this.differenceMoney = differenceMoney;
    }
    public Double getThankYouFee() {
        return thankYouFee;
    }
    public void setThankYouFee(Double thankYouFee) {
        this.thankYouFee = thankYouFee;
    }
    public String getUserImg() {
        return userImg;
    }
    public void setUserImg(String userImg) {
        this.userImg = userImg;
    }
    public String getDriverImg() {
        return driverImg;
    }
    public void setDriverImg(String driverImg) {
        this.driverImg = driverImg;
    }
    @Override
    public String toString() {
        return "OrderWarpper{" +
@@ -294,7 +222,6 @@
        if(null != maps){
            for(Map<String, Object> map : maps){
                OrderWarpper orderWarpper = new OrderWarpper();
                orderWarpper.setRideType(null != map.get("rideType") ? Integer.valueOf(String.valueOf(map.get("rideType"))) : 1);
                orderWarpper.setOrderId(null != map.get("orderId") ? Integer.valueOf(String.valueOf(map.get("orderId"))) : 0);
                orderWarpper.setOrderTime(null != map.get("orderTime") ? String.valueOf(map.get("orderTime")) : "");
                orderWarpper.setTime(null != map.get("time") ? String.valueOf(map.get("time")) : "");
@@ -313,12 +240,6 @@
                orderWarpper.setCarTime(null != map.get("carTime") ? Integer.valueOf(String.valueOf(map.get("carTime"))) : 0);
                orderWarpper.setServerCarModel(null != map.get("serverCarModel") ? String.valueOf(map.get("serverCarModel")) : "");
                orderWarpper.setDifferenceMoney(null != map.get("differenceMoney") ? Double.valueOf(map.get("differenceMoney").toString()) : 0D);
                orderWarpper.setUserImg(null != map.get("userImg") ? String.valueOf(map.get("userImg")) : "");
                orderWarpper.setDriverImg(null != map.get("driverImg") ? String.valueOf(map.get("driverImg")) : "");
                orderWarpper.setThankYouFee(null != map.get("thankYouFee") ? Double.valueOf(map.get("thankYouFee").toString()) : 0D);
                orderWarpper.setArriveTimeExpect(null != map.get("arriveTimeExpect") ? String.valueOf(String.valueOf(map.get("arriveTimeExpect"))) : "");
                orderWarpper.setPickUpCode(null != map.get("pickUpCode") ? String.valueOf(map.get("pickUpCode")) : "");
                orderWarpper.setEndServiceTime(null != map.get("endServiceTime") ? String.valueOf(map.get("endServiceTime")) : "");
                list.add(orderWarpper);
            }
        }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/PreferentialDataVo.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/ServerCarModelWarpper.java
@@ -1,8 +1,6 @@
package com.stylefeng.guns.modular.system.warpper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -18,7 +16,7 @@
    private String name;
    @ApiModelProperty("车型照片")
    private String img;
    @ApiModelProperty("预估金额-专车对应独享")
    @ApiModelProperty("预估金额")
    private Double amount;
    @ApiModelProperty("包车的价格")
    private String price;
@@ -26,220 +24,6 @@
    private Double mileage;
    @ApiModelProperty("预估时间(分钟)")
    private Double duration;
    @ApiModelProperty("预估金额-专车对应一口价")
    private Double buyNowAmount;
    @ApiModelProperty("预估金额-专车对应一人拼成价格")
    private Double putTogetherOneAmount;
    @ApiModelProperty("预估金额-专车对应一人未拼成价格")
    private Double notAssembledOneAmount;
    @ApiModelProperty("预估金额-专车对应两人拼成价格")
    private Double putTogetherTwoAmount;
    @ApiModelProperty("预估金额-专车对应两人未拼成价格")
    private Double notAssembledTwoAmount;
    @ApiModelProperty("预估金额-专车对应三人拼成价格")
    private Double putTogetherThreeAmount;
    @ApiModelProperty("预估金额-专车对应三人未拼成价格")
    private Double notAssembledThreeAmount;
    @ApiModelProperty("是否开启拼车(1=是,2=否)")
    private Integer isOpen;
    @ApiModelProperty("是否开启独享(1=是,2=否)")
    private Integer isOpenExclusive;
    @ApiModelProperty("是否开启一口价(1=是,2=否)")
    private Integer isOpenPrice;
    @ApiModelProperty("一人拼成规则")
    private JSONObject contentPutOne;//一人拼成
    @ApiModelProperty("一人未拼成规则")
    private JSONObject contentNotOne;//一人未拼成
    @ApiModelProperty("2人拼成规则")
    private JSONObject contentPutTwo;//2人拼成
    @ApiModelProperty("2人未拼成规则")
    private JSONObject contentNotTwo;//2人未拼成
    @ApiModelProperty("3人拼成规则")
    private JSONObject contentPutThree;//3人拼成
    @ApiModelProperty("3人未拼成规则")
    private JSONObject contentNotThree;//3人未拼成
    @ApiModelProperty("独享规则")
    private JSONObject contentExclusive;//独享
    @ApiModelProperty("一口价规则")
    private JSONObject contentPrice;//一口价
    @ApiModelProperty("计价说明(拼车)")
    private String fareTypeNote1;
    @ApiModelProperty("计价说明(独享)")
    private String fareTypeNote2;
    @ApiModelProperty("计价说明(一口价)")
    private String fareTypeNote3;
    public String getFareTypeNote1() {
        return fareTypeNote1;
    }
    public void setFareTypeNote1(String fareTypeNote1) {
        this.fareTypeNote1 = fareTypeNote1;
    }
    public String getFareTypeNote2() {
        return fareTypeNote2;
    }
    public void setFareTypeNote2(String fareTypeNote2) {
        this.fareTypeNote2 = fareTypeNote2;
    }
    public String getFareTypeNote3() {
        return fareTypeNote3;
    }
    public void setFareTypeNote3(String fareTypeNote3) {
        this.fareTypeNote3 = fareTypeNote3;
    }
    public JSONObject getContentPutOne() {
        return contentPutOne;
    }
    public void setContentPutOne(JSONObject contentPutOne) {
        this.contentPutOne = contentPutOne;
    }
    public JSONObject getContentNotOne() {
        return contentNotOne;
    }
    public void setContentNotOne(JSONObject contentNotOne) {
        this.contentNotOne = contentNotOne;
    }
    public JSONObject getContentPutTwo() {
        return contentPutTwo;
    }
    public void setContentPutTwo(JSONObject contentPutTwo) {
        this.contentPutTwo = contentPutTwo;
    }
    public JSONObject getContentNotTwo() {
        return contentNotTwo;
    }
    public void setContentNotTwo(JSONObject contentNotTwo) {
        this.contentNotTwo = contentNotTwo;
    }
    public JSONObject getContentPutThree() {
        return contentPutThree;
    }
    public void setContentPutThree(JSONObject contentPutThree) {
        this.contentPutThree = contentPutThree;
    }
    public JSONObject getContentNotThree() {
        return contentNotThree;
    }
    public void setContentNotThree(JSONObject contentNotThree) {
        this.contentNotThree = contentNotThree;
    }
    public JSONObject getContentExclusive() {
        return contentExclusive;
    }
    public void setContentExclusive(JSONObject contentExclusive) {
        this.contentExclusive = contentExclusive;
    }
    public JSONObject getContentPrice() {
        return contentPrice;
    }
    public void setContentPrice(JSONObject contentPrice) {
        this.contentPrice = contentPrice;
    }
    public Integer getIsOpenExclusive() {
        return isOpenExclusive;
    }
    public void setIsOpenExclusive(Integer isOpenExclusive) {
        this.isOpenExclusive = isOpenExclusive;
    }
    public Integer getIsOpenPrice() {
        return isOpenPrice;
    }
    public void setIsOpenPrice(Integer isOpenPrice) {
        this.isOpenPrice = isOpenPrice;
    }
    public Double getBuyNowAmount() {
        return buyNowAmount;
    }
    public void setBuyNowAmount(Double buyNowAmount) {
        this.buyNowAmount = buyNowAmount;
    }
    public Double getPutTogetherOneAmount() {
        return putTogetherOneAmount;
    }
    public void setPutTogetherOneAmount(Double putTogetherOneAmount) {
        this.putTogetherOneAmount = putTogetherOneAmount;
    }
    public Double getNotAssembledOneAmount() {
        return notAssembledOneAmount;
    }
    public void setNotAssembledOneAmount(Double notAssembledOneAmount) {
        this.notAssembledOneAmount = notAssembledOneAmount;
    }
    public Double getPutTogetherTwoAmount() {
        return putTogetherTwoAmount;
    }
    public void setPutTogetherTwoAmount(Double putTogetherTwoAmount) {
        this.putTogetherTwoAmount = putTogetherTwoAmount;
    }
    public Double getNotAssembledTwoAmount() {
        return notAssembledTwoAmount;
    }
    public void setNotAssembledTwoAmount(Double notAssembledTwoAmount) {
        this.notAssembledTwoAmount = notAssembledTwoAmount;
    }
    public Double getPutTogetherThreeAmount() {
        return putTogetherThreeAmount;
    }
    public void setPutTogetherThreeAmount(Double putTogetherThreeAmount) {
        this.putTogetherThreeAmount = putTogetherThreeAmount;
    }
    public Double getNotAssembledThreeAmount() {
        return notAssembledThreeAmount;
    }
    public void setNotAssembledThreeAmount(Double notAssembledThreeAmount) {
        this.notAssembledThreeAmount = notAssembledThreeAmount;
    }
    public Integer getIsOpen() {
        return isOpen;
    }
    public void setIsOpen(Integer isOpen) {
        this.isOpen = isOpen;
    }
    public Integer getId() {
        return id;
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/SmartScreenOrderVo.java
New file
@@ -0,0 +1,99 @@
package com.stylefeng.guns.modular.system.warpper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class SmartScreenOrderVo {
    @ApiModelProperty("订单id")
    private Integer id;
    @ApiModelProperty("乘客电话号码")
    private String userPhone;
    @ApiModelProperty("下单时间")
    private String insertTime;
    @ApiModelProperty("车牌号")
    private String carLicensePlate;
    @ApiModelProperty("司机手机号")
    private String driverPhone;
    @ApiModelProperty("距离(公里)")
    private Double distance;
    @ApiModelProperty("时间(分钟)")
    private Integer minute;
    @ApiModelProperty("订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车)")
    private Integer status;
    @ApiModelProperty("司机到达预约点时间")
    private String arrivalTime;
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getUserPhone() {
        return userPhone;
    }
    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }
    public String getInsertTime() {
        return insertTime;
    }
    public void setInsertTime(String insertTime) {
        this.insertTime = insertTime;
    }
    public String getCarLicensePlate() {
        return carLicensePlate;
    }
    public void setCarLicensePlate(String carLicensePlate) {
        this.carLicensePlate = carLicensePlate;
    }
    public String getDriverPhone() {
        return driverPhone;
    }
    public void setDriverPhone(String driverPhone) {
        this.driverPhone = driverPhone;
    }
    public Double getDistance() {
        return distance;
    }
    public void setDistance(Double distance) {
        this.distance = distance;
    }
    public Integer getMinute() {
        return minute;
    }
    public void setMinute(Integer minute) {
        this.minute = minute;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getArrivalTime() {
        return arrivalTime;
    }
    public void setArrivalTime(String arrivalTime) {
        this.arrivalTime = arrivalTime;
    }
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/TaxiCardWapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserInfoWarpper.java
@@ -37,10 +37,6 @@
    private String emergencyContact;
    @ApiModelProperty("紧急联系人电话")
    private String emergencyContactNumber;
    @ApiModelProperty("是否买过打车卡(0=否,1=是)")
    private Integer payTaxiCar;
    @ApiModelProperty("是否开通商家(0=否,1=是)")
    private Integer merchant;
    public Integer getId() {
        return id;
@@ -146,22 +142,6 @@
        this.balance = balance;
    }
    public Integer getPayTaxiCar() {
        return payTaxiCar;
    }
    public void setPayTaxiCar(Integer payTaxiCar) {
        this.payTaxiCar = payTaxiCar;
    }
    public Integer getMerchant() {
        return merchant;
    }
    public void setMerchant(Integer merchant) {
        this.merchant = merchant;
    }
    @Override
    public String toString() {
        return "UserInfoWarpper{" +
@@ -197,8 +177,6 @@
            userInfoWarpper.setEmergencyContact(null != map.get("emergencyContact") ? String.valueOf(map.get("emergencyContact")) : "");
            userInfoWarpper.setEmergencyContactNumber(null != map.get("emergencyContactNumber") ? String.valueOf(map.get("emergencyContactNumber")) : "");
            userInfoWarpper.setBalance(null != map.get("balance") ? Double.valueOf(String.valueOf(map.get("balance"))) : 0);
            userInfoWarpper.setPayTaxiCar(null != map.get("payTaxiCar") ? Integer.valueOf(String.valueOf(map.get("payTaxiCar"))) : 0);
            userInfoWarpper.setMerchant(null != map.get("merchant") ? Integer.valueOf(String.valueOf(map.get("merchant"))) : 0);
        }
        return userInfoWarpper;
    }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserMerchantCouponWapper.java
File was deleted
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/dao/mapping/OrderTaxiMapper.xml
@@ -37,7 +37,6 @@
        <result column="parkMoney" property="parkMoney"/>
        <result column="roadTollMoney" property="roadTollMoney"/>
        <result column="tipMoney" property="tipMoney"/>
        <result column="holidayFee" property="holidayFee"/>
        <result column="redPacketMoney" property="redPacketMoney"/>
        <result column="couponMoney" property="couponMoney"/>
        <result column="redPacketId" property="redPacketId"/>
@@ -45,12 +44,8 @@
        <result column="discount" property="discount"/>
        <result column="discountMoney" property="discountMoney"/>
        <result column="activityId" property="activityId"/>
        <result column="taxiCardId" property="taxiCardId"/>
        <result column="userTaxiCardId" property="userTaxiCardId"/>
        <result column="discountAmount" property="discountAmount"/>
        <result column="companyId" property="companyId"/>
        <result column="payMoney" property="payMoney"/>
        <result column="thankYouFee" property="thankYouFee"/>
        <result column="substitute" property="substitute"/>
        <result column="passengers" property="passengers"/>
        <result column="passengersPhone" property="passengersPhone"/>
@@ -67,6 +62,7 @@
        <result column="invoiceId" property="invoiceId"/>
        <result column="isReassign" property="isReassign"/>
        <result column="reassignNotice" property="reassignNotice"/>
        <result column="deviceCode" property="deviceCode"/>
        <result column="trackId" property="trackId"/>
        <result column="isDelete" property="isDelete"/>
        <result column="oldState" property="oldState"/>
@@ -146,8 +142,7 @@
        driverId as driverId,
        (2) as orderType,
        state as state,
        oldState as oldState,
        thankYouFee
        oldState as oldState
        from t_order_taxi where userId = #{uid} order by insertTime desc limit #{pageNum}, #{size}
    </select>
@@ -175,7 +170,7 @@
    <select id="queryInvoiceOrder" resultType="map">
        select
        id as orderId,
        id as id,
        DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i') as time,
        startAddress as startAddress,
        endAddress as endAddress,
@@ -186,22 +181,16 @@
        (2) as orderType
        from t_order_taxi where state in (8, 9)
        <if test="type == 1">
            and (invoiceId is null or invoiceId in (select id from t_invoice where state = 3))
            and invoiceId is null and invoiceId in (select id from t_invoice where state != 2)
        </if>
        <if test="type == 2">
            and invoiceId in (select id from t_invoice where state = 2)
        </if>
        <if test="null != startTime">
            and travelTime >= #{startTime}
        <if test="null != startTime and null != endTime">
            and travelTime between #{startTime} and #{endTime}
        </if>
        <if test="null != startMoney">
            and payMoney >= #{startMoney}
        </if>
        <if test="null != endTime">
            and  #{endTime}>= travelTime
        </if>
        <if test="null != endMoney">
            and   #{endMoney}>=payMoney
        <if test="null != startMoney and null != endMoney">
            and payMoney between #{startMoney} and #{endMoney}
        </if>
        <if test="null !=uid">
            and userId = #{uid}
@@ -256,9 +245,7 @@
        h.userType as cancelUserType,
        h.money as cancelMoney,
        h.reason as cancelReason,
        h.remark as cancelRemark,
        a.holidayFee,
        a.discountAmount as taxiCardMoney
        h.remark as cancelRemark
        from t_order_taxi a
        left join t_driver b on (a.driverId = b.id)
        left join t_car c on (a.carId = c.id)
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/dao/mapping/PaymentRecordMapper.xml
@@ -14,6 +14,8 @@
        <result column="amount" property="amount"/>
        <result column="code" property="code"/>
        <result column="state" property="state"/>
        <result column="refundState" property="refundState"/>
        <result column="refundCode" property="refundCode"/>
        <result column="insertTime" property="insertTime"/>
    </resultMap>
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/model/OrderTaxi.java
@@ -179,9 +179,6 @@
     */
    @TableField("tipMoney")
    private Double tipMoney;
    //节假费
    @TableField("holidayFee")
    private Double holidayFee;
    /**
     * 红包抵扣金额
     */
@@ -218,21 +215,6 @@
    @TableField("activityId")
    private Integer activityId;
    /**
     * 打折卡id
     */
    @TableField("taxiCardId")
    private Integer taxiCardId;
    /**
     * 打车卡记录id
     */
    @TableField("userTaxiCardId")
    private Integer userTaxiCardId;
    /**
     * 优惠金额
     */
    @TableField("discountAmount")
    private Double discountAmount;
    /**
     * 公司id
     */
    @TableField("companyId")
@@ -242,9 +224,6 @@
     */
    @TableField("payMoney")
    private Double payMoney;
    //感谢费
    @TableField("thankYouFee")
    private Double thankYouFee;
    /**
     * 是否是代下单(0:否,1:是)
     */
@@ -332,6 +311,11 @@
     */
    @TableField("trackId")
    private String trackId;
    /**
     * 设备号
     */
    @TableField("deviceCode")
    private String deviceCode;
    /**
     * 是否删除(1=否,2=是)
     */
@@ -612,14 +596,6 @@
        this.tipMoney = tipMoney;
    }
    public Double getHolidayFee() {
        return holidayFee;
    }
    public void setHolidayFee(Double holidayFee) {
        this.holidayFee = holidayFee;
    }
    public Double getRedPacketMoney() {
        return redPacketMoney;
    }
@@ -652,30 +628,6 @@
        this.couponId = couponId;
    }
    public Integer getTaxiCardId() {
        return taxiCardId;
    }
    public void setTaxiCardId(Integer taxiCardId) {
        this.taxiCardId = taxiCardId;
    }
    public Integer getUserTaxiCardId() {
        return userTaxiCardId;
    }
    public void setUserTaxiCardId(Integer userTaxiCardId) {
        this.userTaxiCardId = userTaxiCardId;
    }
    public Double getDiscountAmount() {
        return discountAmount;
    }
    public void setDiscountAmount(Double discountAmount) {
        this.discountAmount = discountAmount;
    }
    public Integer getCompanyId() {
        return companyId;
    }
@@ -690,14 +642,6 @@
    public void setPayMoney(Double payMoney) {
        this.payMoney = payMoney;
    }
    public Double getThankYouFee() {
        return thankYouFee;
    }
    public void setThankYouFee(Double thankYouFee) {
        this.thankYouFee = thankYouFee;
    }
    public Integer getSubstitute() {
@@ -901,6 +845,14 @@
        this.bindId = bindId;
    }
    public String getDeviceCode() {
        return deviceCode;
    }
    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }
    @Override
    public String toString() {
        return "OrderTaxi{" +
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/model/PaymentRecord.java
@@ -19,7 +19,7 @@
    @TableField("id")
    private Integer id;
    /**
     * 类别(1=订单相关支付,2=充值支付,3=感谢费支付,4=购买打车卡)
     * 支付类别(1=订单相关支付,2=其他支付)
     */
    @TableField("category")
    private Integer category;
@@ -63,6 +63,16 @@
     */
    @TableField("state")
    private Integer state;
    /**
     * 退款状态(1=退款中,2=已退款)
     */
    @TableField("refundState")
    private Integer refundState;
    /**
     * 退款单号
     */
    @TableField("refundCode")
    private String refundCode;
    /**
     * 添加时间
     */
@@ -149,6 +159,22 @@
        this.state = state;
    }
    public Integer getRefundState() {
        return refundState;
    }
    public void setRefundState(Integer refundState) {
        this.refundState = refundState;
    }
    public String getRefundCode() {
        return refundCode;
    }
    public void setRefundCode(String refundCode) {
        this.refundCode = refundCode;
    }
    public Date getInsertTime() {
        return insertTime;
    }
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/IOrderTaxiService.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.*;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.system.warpper.EndPushWarpper;
import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper;
import com.stylefeng.guns.modular.system.warpper.OrderStatusWarpper;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import java.util.Date;
@@ -78,16 +81,6 @@
    Map<String, Object> queryBalance(Integer orderId, Integer uid) throws Exception;
    /**
     * 获取用户余额和优惠数据
     * @param uid
     * @return
     * @throws Exception
     */
    PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception;
    /**
     * 获取优惠券列表
     * @param orderId
@@ -98,19 +91,6 @@
    /**
     * 获取优惠券和打车卡列表
     * @param orderId
     * @param uid
     * @param pageNum
     * @param size
     * @return
     * @throws Exception
     */
    List<CouponsListVo> queryCouponList(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception;
    /**
     * 订单完成支付订单操作
     * @param payType
     * @param orderId
@@ -118,18 +98,6 @@
     * @throws Exception
     */
    ResultUtil payTaxiOrder(Integer payType, Integer orderId, Integer couponId, Integer type)throws Exception;
    /**
     * 订单完成支付订单操作
     * @param payType
     * @param orderId
     * @return
     * @throws Exception
     */
    ResultUtil payTaxiOrder1(Integer payType, Integer orderId, Integer objectId, Integer objectType, Integer type)throws Exception;
    /**
@@ -268,27 +236,4 @@
     * @throws Exception
     */
    String getOrderNum() throws Exception;
    /**
     * 支付感谢费
     * @param uid
     * @param orderId
     * @param money
     * @param payType
     * @return
     * @throws Exception
     */
    ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception;
    /**
     * 感谢费支付回调处理
     * @param orderId
     * @param order_id
     * @throws Exception
     */
    void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception;
}
UserTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -6,12 +6,8 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.crossCity.server.impl.OrderCrossCityServiceImpl;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
@@ -19,7 +15,9 @@
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.warpper.*;
import com.stylefeng.guns.modular.system.warpper.BaseWarpper;
import com.stylefeng.guns.modular.system.warpper.EndPushWarpper;
import com.stylefeng.guns.modular.system.warpper.OrderServerWarpper;
import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper;
import com.stylefeng.guns.modular.taxi.model.OrderTaxi;
import com.stylefeng.guns.modular.taxi.model.PaymentRecord;
@@ -42,10 +40,10 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Transactional(isolation = Isolation.READ_UNCOMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@@ -156,30 +154,6 @@
    @Autowired
    private IOrderCrossCityService orderCrossCityService;
    @Resource
    private OrderCrossCityMapper orderCrossCityMapper;
    @Autowired
    private IOrderLogisticsService orderLogisticsService;
    @Autowired
    private IOpenCityService openCityService;
    @Autowired
    private ITaxiCardService taxiCardService;
    @Autowired
    private ITaxiCardPaymentService taxiCardPaymentService;
    @Autowired
    private IUserUserService userUserService;
    @Autowired
    private IUserTaxiCardService userTaxiCardService;
    @Autowired
    private IRegionService regionService;
    public static List<Integer> orderIds = new ArrayList<>();
@@ -218,39 +192,37 @@
        /**
         * 1.出租车、专车、跨城有待支付的订单不能叫车
         * 2.小件物流有未完成的订单可以下跨城、专车、出租车
         * 3.出租车、专车、跨城有预约单可以下即时单
         * 1.下了即时单就不能下预约单和即时单
         * 2.下了预约单和再下一张即时单不能再下预约单
         */
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, null, 1, 7, 12);
        if(orderPrivateCars.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, null, 1, 7, 12);
        List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, 1, 1, 1, 2, 3, 4, 5, 6, 11);
        if(list.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(uid, 7, 12);
        if(orderCrossCities1.size() > 0){
            return ResultUtil.error("有未完成的订单");
        }
        if(orderTaxi.getOrderType() == 1){
            orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12);
        List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11);
            if(orderPrivateCars.size() > 0){
                return ResultUtil.error("有未完成的订单");
            }
            list = orderTaxiMapper.queryByState_(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12);
            if(list.size() > 0){
        list = orderTaxiMapper.queryByState_(uid, 2, 1, 1, 2, 3, 4, 5, 6, 11);
        if(list.size() > 0 && orderTaxi.getOrderType() == 2){
                return ResultUtil.error("有未完成的订单");
            }
        orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 2, 1, 1, 2, 3, 4, 5, 6, 7, 11);
        if(orderPrivateCars.size() > 0 && orderTaxi.getOrderType() == 2){
            return ResultUtil.error("有未完成的订单");
        }
        orderTaxi.setOrderNum(this.getOrderNum());
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(String.valueOf(orderTaxi.getPlacementLon()), String.valueOf(orderTaxi.getPlacementLat()));
        orderTaxi.setPlacementAddress(geocode.get("address"));
        orderTaxi.setStartAddress(orderTaxi.getStartAddress().replaceAll("& #40;", "\\("));//特殊字符转义
        orderTaxi.setStartAddress(orderTaxi.getStartAddress().replaceAll("& #41;", "\\)"));
        if(ToolUtil.isNotEmpty(orderTaxi.getEndAddress())){
        orderTaxi.setEndAddress(orderTaxi.getEndAddress().replaceAll("& #40;", "\\("));
        orderTaxi.setEndAddress(orderTaxi.getEndAddress().replaceAll("& #41;", "\\)"));
        }
        orderTaxi.setUserId(uid);
        orderTaxi.setMileage(0D);
        orderTaxi.setOrderMoney(0D);
@@ -300,14 +272,15 @@
            orderTaxi.setCarId(driver.getCarId());
            orderTaxi.setState(2);//待出发
            orderTaxi.setSnatchOrderTime(new Date());
            //调用高德创建轨迹
            String s = gdFalconUtil.selectTerminal(driver.getPhone());
            String track = gdFalconUtil.createTrack(s);
            orderTaxi.setTrackId(track);
//            //调用高德创建轨迹
//            String s = gdFalconUtil.selectTerminal(driver.getPhone());
//            String track = gdFalconUtil.createTrack(s);
//            orderTaxi.setTrackId(track);
//
            //调用移动的小号接口
            Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000));
            Map<String, String> geocode1 = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString());
            Region region = regionMapper.query(geocode1.get("districtCode"));
            Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1)));
            if(String.valueOf(map.get("code")).equals("200")){
                orderTaxi.setTelX(map.get("telX"));
                orderTaxi.setBindId(map.get("bindId"));
@@ -440,14 +413,14 @@
        }
        OrderTaxi orderTaxi = this.selectById(id);
        if(null == uid){
            uid = orderTaxi.getUserId();
        }
        Integer integer = null;
        if(null == orderTaxi){
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
//        if(orderTaxi.getState() == 4){
//            return ResultUtil.error("司机已到达预约点,取消会产生一定的费用");
//        }
        if(orderTaxi.getState() >= 5 && orderTaxi.getState() != 11){
        if(orderTaxi.getState() > 5 && orderTaxi.getState() != 11){
            return ResultUtil.error("取消订单失败,不合法的操作");
        }
        if(null == orderTaxi.getDriverId()){//没有接单的情况
@@ -522,13 +495,13 @@
        OrderTaxi orderTaxi = this.selectById(id);
        Integer uid = orderTaxi.getUserId();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        ResultUtil resultUtil = ResultUtil.success();
        if(null == orderTaxi){
            return ResultUtil.error("取消订单失败,订单信息有误", "");
            return ResultUtil.error("取消订单失败,订单信息有误");
        }
        if(orderTaxi.getState() != 12){
            return ResultUtil.error("取消订单失败,不合法的操作", "");
            return ResultUtil.error("取消订单失败,不合法的操作");
        }
        OrderCancel orderCancel = null;
        if(null == cancleId){
@@ -539,56 +512,42 @@
        CancleOrder query = cancleOrderService.query(orderTaxi.getOrderType(), 2, orderTaxi.getCompanyId());
        if(null != query){
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
            String out_trade_no = sdf.format(new Date()) + 2 + id;
            if(payType == 1){//微信支付
                String value = redisUtil.getValue("appletOpenId");
                String appletsOpenId = null;
                if(ToolUtil.isNotEmpty(value)){
                    JSONObject jsonObject = JSON.parseObject(value);
                    appletsOpenId = jsonObject.getString(uid.toString());
                }else{
                String appletsOpenId = "";
                String tradeType = "APP";
                if(type == 3){
                    appletsOpenId = userInfo.getAppletsOpenId();
                    tradeType = "JSAPI";
                    if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                        return ResultUtil.error("支付异常,请重新授权登录小程序");
                }
                orderCancel.setPayType(1);
                orderCancelService.updateById(orderCancel);
                String app = type == 1 ? "APP" : "JSAPI";
                resultUtil = payMoneyUtil.weixinpay("订单取消", "", id + "_2_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/wxCancelOrderTaxi", app, userInfo.getAppletsOpenId());
                }
                resultUtil = payMoneyUtil.weixinpay("订单取消", "", out_trade_no,  query.getMoney().toString(), callbackPath + "/base/wxCancelOrderTaxi", tradeType, appletsOpenId);
                if(resultUtil.getCode() == 200){
                paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, id, 2, 1, query.getMoney(), "", 1);//添加预支付数据
//                Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",2", 9, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/wxCancelOrderTaxi", "", type, appletsOpenId);
//                if(map.get("code").equals("200")){
//                    paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, id, 2, 1, query.getMoney(), map.get("order_id"), 1);//添加预支付数据
//                    resultUtil = ResultUtil.success(map.get("data"));
//                }else{
//                    resultUtil = ResultUtil.error(map.get("msg"), "");
//                }
                }
            }
            if(payType == 2){//支付宝支付
                orderCancel.setPayType(2);
                orderCancelService.updateById(orderCancel);
                resultUtil = payMoneyUtil.alipay("订单取消", "订单取消", "", id + "_2_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/aliCancelOrderTaxi");
                resultUtil = payMoneyUtil.alipay("取消订单支付", "取消订单", out_trade_no, query.getMoney().toString(), callbackPath + "/base/aliCancelOrderTaxi");
                if(resultUtil.getCode() == 200){
                paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, id, 2, 2, query.getMoney(), "", 1);//添加预支付数据
//                Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",2", 10, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/aliCancelOrderTaxi", "", type, null);
//                if(map.get("code").equals("200")){
//                    paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, id, 2, 2, query.getMoney(), map.get("order_id"), 1);//添加预支付数据
//                    resultUtil = ResultUtil.success(map.get("data"));
//                }else{
//                    resultUtil = ResultUtil.error(map.get("msg"), "");
//                }
                }
            }
            if(payType == 3){//余额支付
                if(userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()){
                    return ResultUtil.error("余额不足,无法完成支付", "");
                    return ResultUtil.error("余额不足,无法完成支付");
                }
                userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(query.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                //添加交易明细
                transactionDetailsService.saveData(uid, "出租车取消订单", query.getMoney(), 2, 1, 1, 2, id);
                transactionDetailsService.saveData(uid, "取消订单", query.getMoney(), 2, 1, 1, 2, id);
                userInfoService.updateById(userInfo);
                //解除小号绑定
                if(orderTaxi.getBindId() != null){
                    chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId(), orderTaxi.getTelX(), (System.currentTimeMillis() + 600000));
                    chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId());
                }
                orderTaxi.setState(10);
@@ -661,206 +620,6 @@
        return map;
    }
    @Override
    public PreferentialDataVo queryBalance1(Integer orderId, Integer uid) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        PreferentialDataVo preferentialDataVo = new PreferentialDataVo();
        preferentialDataVo.setBalance(userInfo.getBalance());
        OrderTaxi orderTaxi = this.selectById(orderId);
        //获取优惠券中最优数据
        List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("companyId", orderTaxi.getCompanyId()).eq("state", 1).in("couponUseType", Arrays.asList(0, 2)).eq("userId", uid).where("now() < expirationTime"));
        Integer id = null;
        Double price = 0d;
        Integer type = 0;
        for (UserCouponRecord userCouponRecord : list){
            if(userCouponRecord.getCouponType() == 1){//抵扣券
                if(price.compareTo(userCouponRecord.getMoney()) < 0){
                    price = userCouponRecord.getMoney();
                    id = userCouponRecord.getId();
                    type = 1;
                }
            }else{//满减券
                if(orderTaxi.getOrderMoney().compareTo(userCouponRecord.getFullMoney()) >= 0 && price.compareTo(userCouponRecord.getMoney()) < 0){
                    price = userCouponRecord.getMoney();
                    id = userCouponRecord.getId();
                    type = 1;
                }
            }
        }
        //获取打车卡中最优数
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString());
        CompanyCity companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderTaxi.getCompanyId()).eq("areaCode", geocode.get("districtCode")).eq("state", 1));
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderTaxi.getCompanyId()).eq("cityCode", geocode.get("cityCode")).eq("state", 1));
        }
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderTaxi.getCompanyId()).eq("provinceCode", geocode.get("provinceCode")).eq("state", 1));
        }
        List<UserTaxiCard> userTaxiCards = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().like("companyCityId", "%" + companyCity.getId() + "%")
                .in("type", Arrays.asList(1, 2, 3, 4)).eq("userId", uid).where("now() between startTime and endTime"));
        //全国卡
        List<TaxiCard> taxiCards = taxiCardService.selectList(new EntityWrapper<TaxiCard>().eq("taxiCardType", 2).in("type", Arrays.asList(1, 2, 3, 4)).eq("state", 1));
        if(taxiCards.size() > 0) {
            List<UserTaxiCard> userTaxiCards2 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                    .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
            userTaxiCards.addAll(userTaxiCards2);
        }
        Map<String, Object> map = getOptimalTaxiCards(orderTaxi, price, id, type, userTaxiCards);
        price = Double.valueOf(map.get("price").toString());
        id = null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : null;
        type = Integer.valueOf(map.get("type").toString());
        //亲密账户
        List<UserTaxiCard> userTaxiCards_ = new ArrayList<>();
        List<UserUser> bindUserId = userUserService.selectList(new EntityWrapper<UserUser>().eq("bindUserId", uid));
        CompanyCity finalCompanyCity = companyCity;
        bindUserId.forEach(userUser -> {
            List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().in("type", Arrays.asList(1, 2, 3, 4))
                    .like("companyCityId", "%" + finalCompanyCity.getId() + "%").eq("userId", userUser.getUserId()).where("now() between startTime and endTime"));
            userTaxiCards_.addAll(userTaxiCards1);
            //全国卡
            if(taxiCards.size() > 0) {
                List<UserTaxiCard> userTaxiCards2 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", userUser.getUserId())
                        .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
                userTaxiCards_.addAll(userTaxiCards2);
            }
        });
        map = getOptimalTaxiCards(orderTaxi, price, id, type, userTaxiCards_);
        price = Double.valueOf(map.get("price").toString());
        id = null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : null;
        type = Integer.valueOf(map.get("type").toString());
        preferentialDataVo.setObjectId(id);
        preferentialDataVo.setDiscountAmount(price);
        preferentialDataVo.setType(type);
        return preferentialDataVo;
    }
    /**
     * 获取最优数据
     * @param orderTaxi
     * @param price
     * @param id
     * @param type
     * @param userTaxiCards
     * @return
     */
    public Map<String, Object> getOptimalTaxiCards(OrderTaxi orderTaxi, Double price, Integer id, Integer type, List<UserTaxiCard> userTaxiCards) throws Exception{
        Map<String, Object> map = new HashMap<>();
        for(UserTaxiCard t : userTaxiCards){
            JSONObject jsonObject = JSON.parseObject(t.getContent());
            List<Integer> integers = jsonObject.getJSONArray("businessTypes").toJavaList(Integer.class);
            if(!integers.contains(2)){
                continue;
            }
            if(t.getType() == 1){//打折次数卡{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                Integer time = jsonObject.getInteger("time");
                if(time == 0){
                    continue;
                }
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discount = jsonObject.getDouble("discount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        double v = new BigDecimal(orderTaxi.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        if(price.compareTo(v) < 0){
                            price = v;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
            if(t.getType() == 2){//优惠卡{"businessTypes":[1,2,3],"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"fullReduction":[[50,3],[100,5],[150,10]]}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        for(int j = fullReduction.size() - 1; j >= 0; j--){
                            JSONArray jsonArray = fullReduction.getJSONArray(j);
                            Double p = jsonArray.getDouble(0);//满金额
                            Double y = jsonArray.getDouble(1);//优惠金额
                            if(orderTaxi.getOrderMoney().compareTo(p) >= 0 && price.compareTo(y) < 0){
                                price = y;
                                id = t.getId();
                                type = 2;
                            }
                        }
                    }
                }
            }
            if(t.getType() == 3){//次数卡{"businessTypes":[1,2,3],"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"time":1,"discountAmount":10}
                Integer time = jsonObject.getInteger("time");
                if(time == 0){
                    continue;
                }
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discountAmount = jsonObject.getDouble("discountAmount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        if(price.compareTo(discountAmount) < 0){
                            price = discountAmount;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
            if(t.getType() == 4){//打折天数卡{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                Double discount = jsonObject.getDouble("discount");//折扣
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");//使用时间段
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        double v = new BigDecimal(orderTaxi.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        if(price.compareTo(v) < 0){
                            price = v;
                            id = t.getId();
                            type = 2;
                        }
                    }
                }
            }
        }
        map.put("price", price);
        map.put("id", id);
        map.put("type", type);
        return map;
    }
    /**
     * 获取优惠券列表
@@ -878,238 +637,6 @@
    }
    @Override
    public List<CouponsListVo> queryCouponList(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception {
        pageNum = (pageNum - 1) * size;
        OrderTaxi orderTaxi = this.selectById(orderId);
        List<CouponsListVo> rows = new ArrayList<>();
        List<UserCouponRecord> list = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("companyId", orderTaxi.getCompanyId())
                .eq("state", 1).in("couponUseType", Arrays.asList(0, 2)).eq("userId", uid).where("expirationTime >= now()"));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        for (UserCouponRecord userCouponRecord : list){
            if(userCouponRecord.getCouponType() == 2){//满减券
                if(orderTaxi.getOrderMoney().compareTo(userCouponRecord.getFullMoney()) < 0){
                    continue;
                }
            }
            CouponsListVo couponsListVo = new CouponsListVo();
            couponsListVo.setId(userCouponRecord.getId());
            couponsListVo.setDataType(1);
            couponsListVo.setMoney(userCouponRecord.getMoney());
            couponsListVo.setUserType(userCouponRecord.getCouponUseType());
            couponsListVo.setTime(sdf.format(userCouponRecord.getExpirationTime()));
            couponsListVo.setType(userCouponRecord.getCouponType());
            couponsListVo.setFullMoney(userCouponRecord.getFullMoney());
            couponsListVo.setState(userCouponRecord.getState());
            Company company = companyService.selectById(userCouponRecord.getCompanyId());
            couponsListVo.setCompany(company.getName());
            rows.add(couponsListVo);
        }
        Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString());
        CompanyCity companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderTaxi.getCompanyId()).eq("areaCode", geocode.get("districtCode")).eq("state", 1));
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderTaxi.getCompanyId()).eq("cityCode", geocode.get("cityCode")).eq("state", 1));
        }
        if(null == companyCity){
            companyCity = companyCityService.selectOne(new EntityWrapper<CompanyCity>().eq("companyId", orderTaxi.getCompanyId()).eq("provinceCode", geocode.get("provinceCode")).eq("state", 1));
        }
        List<UserTaxiCard> userTaxiCards = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                .in("type", Arrays.asList(1, 2, 3, 4)).like("companyCityId", "%" + companyCity.getId() + "%").where("now() between startTime and endTime"));
        //全国卡
        List<TaxiCard> taxiCards = taxiCardService.selectList(new EntityWrapper<TaxiCard>().eq("taxiCardType", 2).in("type", Arrays.asList(1, 2, 3, 4)).eq("state", 1));
        if(taxiCards.size() > 0) {
            List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", uid)
                    .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
            userTaxiCards.addAll(userTaxiCards1);
        }
        //亲密账户
        List<UserUser> bindUserId = userUserService.selectList(new EntityWrapper<UserUser>().eq("bindUserId", uid));
        CompanyCity finalCompanyCity = companyCity;
        bindUserId.forEach(userUser -> {
            List<UserTaxiCard> taxiCardPayments1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().in("type", Arrays.asList(1, 2, 3, 4))
                    .like("companyCityId", "%" + finalCompanyCity.getId() + "%").eq("userId", userUser.getUserId()).where("now() between startTime and endTime"));
            userTaxiCards.addAll(taxiCardPayments1);
            //全国卡
            if(taxiCards.size() > 0) {
                List<UserTaxiCard> userTaxiCards1 = userTaxiCardService.selectList(new EntityWrapper<UserTaxiCard>().eq("userId", userUser.getUserId())
                        .in("type", Arrays.asList(1, 2, 3, 4)).in("taxiCardId", taxiCards.stream().map(TaxiCard::getId).collect(Collectors.toList())).where("now() between startTime and endTime"));
                userTaxiCards.addAll(userTaxiCards1);
            }
        });
        for(UserTaxiCard t : userTaxiCards){
            try {
                CouponsListVo couponsListVo = new CouponsListVo();
                couponsListVo.setId(t.getId());
                couponsListVo.setDataType(2);
                couponsListVo.setUserType(1);
                couponsListVo.setTaxiCardType(t.getType());
                couponsListVo.setTime(sdf.format(t.getEndTime()));
                couponsListVo.setState(1);
                Company company = companyService.selectById(t.getCompanyId());
                couponsListVo.setCompany(company.getName());
                couponsListVo.setName(taxiCardService.selectById(t.getTaxiCardId()).getName());
                JSONObject jsonObject = JSON.parseObject(t.getContent());
                JSONArray businessTypes = jsonObject.getJSONArray("businessTypes");
                if(!businessTypes.toJavaList(Integer.class).contains(2)){
                    continue;
                }
                if(t.getType() == 1){//{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                    Integer time = jsonObject.getInteger("time");
                    if(time == 0){
                        continue;
                    }
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setMoney(jsonObject.getDouble("discount"));
                    couponsListVo.setType(1);
                }
                if(t.getType() == 2){//{"businessTypes":[1,2,3],"fullReduction":[[50,3],[100,5],[150,10]]}
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                    b = true;
                    for(int i = fullReduction.size() - 1; i >= 0 ; i--){
                        JSONArray jsonArray = fullReduction.getJSONArray(i);
                        Double m = jsonArray.getDouble(0);
                        Double j = jsonArray.getDouble(1);
                        if(orderTaxi.getOrderMoney().compareTo(m) >= 0){
                            couponsListVo.setMoney(j);
                            couponsListVo.setFullMoney(m);
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setType(2);
                }
                if(t.getType() == 3){//{"businessTypes":[1,2,3],"time":1,"discountAmount":10}
                    Integer time = jsonObject.getInteger("time");
                    if(time == 0){
                        continue;
                    }
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setMoney(jsonObject.getDouble("discountAmount"));
                    couponsListVo.setType(2);
                }
                if(t.getType() == 4){//{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                    JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                    SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
                    boolean b = true;
                    for(int i = 0; i < timeQuantum.size(); i++){
                        String[] split = timeQuantum.getString(i).split(" - ");
                        Date s = sdf.parse(sdf1.format(new Date()) + " " + split[0]);
                        Date e = sdf.parse(sdf1.format(new Date()) + " " + split[1]);
                        if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                            b = false;
                            break;
                        }
                    }
                    if(b){
                        continue;
                    }
                    couponsListVo.setMoney(jsonObject.getDouble("discount"));
                    couponsListVo.setType(1);
                }
                String str = "";
                TaxiCard taxiCard = taxiCardService.selectById(t.getTaxiCardId());
                if(taxiCard.getTaxiCardType() == 1){
                    String[] split = taxiCard.getCompanyCityId().split(";");
                    for(String c : split){
                        CompanyCity companyCity1 = companyCityService.selectById(c);
                        if(ToolUtil.isNotEmpty(companyCity1.getAreaCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getAreaCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                        if(ToolUtil.isNotEmpty(companyCity1.getCityCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getCityCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                        if(ToolUtil.isNotEmpty(companyCity1.getProvinceCode())){
                            Region region = regionService.selectOne(new EntityWrapper<Region>().eq("code", companyCity1.getProvinceCode()));
                            str += region.getName() + ";";
                            continue;
                        }
                    }
                }else{
                    str = "全国;";
                }
                couponsListVo.setCity(str.substring(0, str.length() - 1));
                rows.add(couponsListVo);
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        Collections.sort(rows, new Comparator<CouponsListVo>() {
            public int compare(CouponsListVo s1, CouponsListVo s2) {
                return Integer.compare(s1.getId(), s2.getId());
            }
        });
        if(rows.size() >= (pageNum + 1) * size){
            rows = rows.subList(pageNum, pageNum + size);
        }else if(pageNum < rows.size() && rows.size() < (pageNum + 1) * size){
            rows = rows.subList(pageNum, rows.size());
        }else{
            rows = new ArrayList<>();
        }
        return rows;
    }
    /**
     * 订单完成支付订单操作
     * @param payType   1=微信,2=支付宝,3=余额
@@ -1121,15 +648,15 @@
    public ResultUtil payTaxiOrder(Integer payType, Integer orderId, Integer couponId, Integer type) throws Exception {
        OrderTaxi orderTaxi = this.selectById(orderId);
        if(orderTaxi.getState() == 8 || orderTaxi.getState() == 9){
            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
            return ResultUtil.error("订单已完成支付,不允许重复支付");
        }
        if(orderTaxi.getState() != 7){
            return ResultUtil.error("订单不在待支付状态,不允许支付", "");
            return ResultUtil.error("订单不在待支付状态,不允许支付");
        }
        Integer uid = orderTaxi.getUserId();
        Double orderMoney = orderTaxi.getOrderMoney();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        ResultUtil resultUtil = ResultUtil.success();
        orderTaxi.setCouponMoney(0D);//初始化历史数据
        orderTaxi.setCouponId(null);
@@ -1138,19 +665,19 @@
        if(null != couponId){
            userCouponRecord = userCouponRecordService.selectById(couponId);
            if(userCouponRecord.getCompanyId() != orderTaxi.getCompanyId()){
                return ResultUtil.error("优惠券不能用于此订单", "");
                return ResultUtil.error("优惠券不能用于此订单");
            }
            if(userCouponRecord.getState() == 2){
                return ResultUtil.error("优惠券已使用", "");
                return ResultUtil.error("优惠券已使用");
            }
            if(userCouponRecord.getState() == 3){
                return ResultUtil.error("优惠券已过期", "");
                return ResultUtil.error("优惠券已过期");
            }
            if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 2){
                return ResultUtil.error("优惠券不能用于此类型订单", "");
                return ResultUtil.error("优惠券不能用于此类型订单");
            }
            if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){
                return ResultUtil.error("优惠券不能用于此订单", "");
                return ResultUtil.error("优惠券不能用于此订单");
            }
            orderMoney = orderMoney - userCouponRecord.getMoney();
            orderTaxi.setCouponMoney(userCouponRecord.getMoney());
@@ -1178,18 +705,33 @@
            }
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String out_trade_no = sdf.format(new Date()) + 2 + orderTaxi.getId();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId());
            String appletsOpenId = "";
            String tradeType = "APP";
            if(type == 3){
                appletsOpenId = userInfo.getAppletsOpenId();
                tradeType = "JSAPI";
                if(ToolUtil.isEmpty(userInfo.getAppletsOpenId())){
                    return ResultUtil.error("支付异常,请重新授权登录小程序");
                }
            }
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", out_trade_no, orderMoney.toString(), callbackPath + "/base/wxPayOrderTaxi", tradeType, appletsOpenId);
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, orderId, 2, 1, orderMoney, "", 1);//添加预支付数据
        }
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi");
            resultUtil = payMoneyUtil.alipay("订单完成支付", "支付订单", out_trade_no, orderMoney.toString(), callbackPath + "/base/aliPayOrderTaxi");
            if(resultUtil.getCode() == 200){
            paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, orderId, 2, 2, orderMoney, "", 1);//添加预支付数据
            }
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
                return ResultUtil.error("余额不足,无法完成支付");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
@@ -1198,7 +740,7 @@
            userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "出租车", orderMoney, 2, 1, 1, 2, orderId);
            transactionDetailsService.saveData(uid, "完成订单", orderMoney, 2, 1, 1, 2, orderId);
            userInfoService.updateById(userInfo);
            orderTaxi.setState(8);
@@ -1266,275 +808,6 @@
        return resultUtil;
    }
    @Override
    public ResultUtil payTaxiOrder1(Integer payType, Integer orderId, Integer objectId, Integer objectType, Integer type) throws Exception {
        OrderTaxi orderTaxi = this.selectById(orderId);
        if(orderTaxi.getState() == 8 || orderTaxi.getState() == 9){
            return ResultUtil.error("订单已完成支付,不允许重复支付", "");
        }
        if(orderTaxi.getState() != 7){
            return ResultUtil.error("订单不在待支付状态,不允许支付", "");
        }
        Integer uid = orderTaxi.getUserId();
        Double orderMoney = orderTaxi.getOrderMoney();
        UserInfo userInfo = userInfoService.selectById(uid);
        ResultUtil resultUtil = ResultUtil.success(new Object());
        orderTaxi.setCouponMoney(0D);//初始化历史数据
        orderTaxi.setCouponId(null);
        //计算优惠券
        UserCouponRecord userCouponRecord = null;
        if(null != objectId && 1 == objectType){
            userCouponRecord = userCouponRecordService.selectById(objectId);
            if(userCouponRecord.getCompanyId() != orderTaxi.getCompanyId()){
                return ResultUtil.error("优惠券不能用于此订单", "");
            }
            if(userCouponRecord.getState() == 2){
                return ResultUtil.error("优惠券已使用", "");
            }
            if(userCouponRecord.getState() == 3){
                return ResultUtil.error("优惠券已过期", "");
            }
            if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 2){
                return ResultUtil.error("优惠券不能用于此类型订单", "");
            }
            if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){
                return ResultUtil.error("优惠券不能用于此订单", "");
            }
            orderMoney = orderMoney - userCouponRecord.getMoney();
            orderTaxi.setCouponMoney(userCouponRecord.getMoney());
            orderTaxi.setCouponId(objectId);
        }
        //计算打车卡
        UserTaxiCard userTaxiCard = null;
        if(null != objectId && objectType == 2){
            userTaxiCard = userTaxiCardService.selectById(objectId);
            TaxiCard taxiCard = taxiCardService.selectById(userTaxiCard.getTaxiCardId());
            if(taxiCard.getTaxiCardType() == 1 && userTaxiCard.getCompanyId() != orderTaxi.getCompanyId()){
                return ResultUtil.error("打车卡不能用于此订单", "");
            }
            if(System.currentTimeMillis() > userTaxiCard.getEndTime().getTime()){
                return ResultUtil.error("打车卡已过期", "");
            }
            if(userTaxiCard.getType() == 1 || userTaxiCard.getType() == 3){
                Integer time = JSON.parseObject(userTaxiCard.getContent()).getInteger("time");
                if(0 == time){
                    return ResultUtil.error("打车卡已使用完", "");
                }
            }
            List<Integer> integers = JSON.parseObject(userTaxiCard.getContent()).getJSONArray("businessTypes").toJavaList(Integer.class);
            if(!integers.contains(2)){
                return ResultUtil.error("打车卡不能用于此类型订单", "");
            }
            Double yh = 0D;
            JSONObject jsonObject = JSON.parseObject(userTaxiCard.getContent());
            if(userTaxiCard.getType() == 1){//打折次数卡{"businessTypes":[1,2,3],"time":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"],"discount":5}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                Double discount = jsonObject.getDouble("discount");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = new BigDecimal(orderTaxi.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        jsonObject.put("time", jsonObject.getInteger("time") - 1);
                        userTaxiCard.setContent(jsonObject.toJSONString());
                        break;
                    }
                }
            }
            if(userTaxiCard.getType() == 2){//优惠卡{"businessTypes":[1,2,3],"fullReduction":[[50,3],[100,5],[150,10]]}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                JSONArray fullReduction = jsonObject.getJSONArray("fullReduction");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        for(int j = fullReduction.size() - 1; j >= 0 ; j--){
                            JSONArray jsonArray = fullReduction.getJSONArray(j);
                            Double p = jsonArray.getDouble(0);//满金额
                            if(orderTaxi.getOrderMoney().compareTo(p) >= 0){
                                yh = jsonArray.getDouble(1);//优惠金额
                                break;
                            }
                        }
                    }
                }
            }
            if(userTaxiCard.getType() == 3){//次数卡{"businessTypes":[1,2,3],"time":1,"discountAmount":10}
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = jsonObject.getDouble("discountAmount");
                        jsonObject.put("time", jsonObject.getInteger("time") - 1);
                        userTaxiCard.setContent(jsonObject.toJSONString());
                    }
                }
            }
            if(userTaxiCard.getType() == 4){//打折天数卡{"businessTypes":[1,2,3],"discount":5,"timeQuantum":["08:00:00 - 09:00:00","17:00:00 - 18:00:00"]}
                Double discount = jsonObject.getDouble("discount");//折扣
                JSONArray timeQuantum = jsonObject.getJSONArray("timeQuantum");//使用时间段
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                Date date = new Date();
                for(int i = 0; i < timeQuantum.size(); i++){
                    String[] split = timeQuantum.getString(i).split(" - ");
                    Date s = sdf1.parse(sdf.format(date) + " " + split[0]);
                    Date e = sdf1.parse(sdf.format(date) + " " + split[1]);
                    if(s.getTime() <= System.currentTimeMillis() && System.currentTimeMillis() < e.getTime()){
                        yh = new BigDecimal(orderTaxi.getOrderMoney()).multiply(new BigDecimal((10 - discount) / 10)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                        break;
                    }
                }
            }
            orderMoney = orderMoney - yh;
            orderTaxi.setTaxiCardId(userTaxiCard.getTaxiCardId());
            orderTaxi.setUserTaxiCardId(objectId);
            orderTaxi.setDiscountAmount(yh);
        }
        //计算红包
        UserRedPacketRecord query = userRedPacketRecordService.query(uid, orderTaxi.getCompanyId(), 1, 2, orderMoney);
        if(null != query && orderMoney.compareTo(query.getMoney()) > 0){
            orderMoney = orderMoney - query.getMoney();
            orderTaxi.setRedPacketMoney(query.getMoney());
            orderTaxi.setRedPacketId(query.getId());
        }
        //计算折扣
        UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderTaxi.getCompanyId());
        if(null != query2){
            Double taxi = query2.getTaxi();
            orderTaxi.setDiscount(taxi);
            double v = new BigDecimal(orderMoney).multiply(new BigDecimal(taxi / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
            if(orderMoney.compareTo(v) > 0){
                orderTaxi.setDiscountMoney(orderMoney - v);
                orderTaxi.setActivityId(query2.getId());
                orderMoney = v;
            }
        }
        orderMoney = orderMoney < 0 ? 0 : orderMoney;
        if(payType == 1){//微信支付
            if(orderMoney == 0){
                return ResultUtil.error("请使用余额支付");
            }
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, orderId, 2, 1, orderMoney, "", 1);//添加预支付数据
        }
        if(payType == 2){//支付宝支付
            if(orderMoney == 0){
                return ResultUtil.error("请使用余额支付");
            }
            resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi");
            paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, orderId, 2, 2, orderMoney, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){
                return ResultUtil.error("余额不足,无法完成支付", "");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId());
            if(null != query1){
                userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
            }
            //添加交易明细
            transactionDetailsService.saveData(uid, "出租车", orderMoney, 2, 1, 1, 2, orderId);
            userInfoService.updateById(userInfo);
            orderTaxi.setState(8);
            orderTaxi.setPayType(3);
            orderTaxi.setPayMoney(orderMoney);
            //处理优惠券和红包
            if(null != userCouponRecord){
                userCouponRecord.setState(2);
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            //处理打车卡
            if(null != userTaxiCard){
                userTaxiCardService.updateById(userTaxiCard);
            }
            if(null != query){
                query.setState(2);
                query.setEndTime(new Date());
                userRedPacketRecordService.updateById(query);
            }
            //添加已收入明细
            Company company = companyService.selectById(orderTaxi.getCompanyId());
            Double taxi = company.getTaxiMoney();
            BigDecimal d = null;//企业收入
            BigDecimal c = null;//司机收入
            // TODO: 2022/3/19  抽成按照订单金额计算,优先保证司机的收入,用户支付金额不够,则在平台收入中补贴司机收入
            //例如:订单金额10元,优惠3元,司机收入比例80%,平台收入比例20%。
            //司机收入:10 * 0.8 = 8
            //平台收入:7 - 8 = -1
            if(company.getIsTaxiFixedOrProportional() == 2){//固定
                d = new BigDecimal(taxi.compareTo(orderTaxi.getOrderMoney()) > 0 ? orderTaxi.getOrderMoney() : taxi);
                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d);
            }
            if(company.getIsTaxiFixedOrProportional() == 1){//比例
                c = new BigDecimal(orderTaxi.getOrderMoney()).multiply(new BigDecimal(1 - (taxi / 100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                d = new BigDecimal(orderTaxi.getPayMoney()).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            incomeService.saveData(1, orderTaxi.getCompanyId(), 2, orderTaxi.getId(), 2, d.doubleValue());
            incomeService.saveData(2, orderTaxi.getDriverId(), 2, orderTaxi.getId(), 2, c.doubleValue());
            Driver driver = driverService.selectById(orderTaxi.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            // TODO: 2020/5/24 这里需要给司机和用户推送订单状态
            new Thread(new Runnable() {
                @Override
                public void run() {
                    pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0);
                    pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0);
                }
            }).start();
            //用户付款后,删除限制司机6分钟不能接单的标识
            String vehicle = redisUtil.getValue("VEHICLE");
            if(ToolUtil.isNotEmpty(vehicle)){
                JSONArray jsonArray = JSON.parseArray(vehicle);
                for(int i = 0; i < jsonArray.size(); i++){
                    if(jsonArray.getInteger(i).compareTo(orderTaxi.getDriverId()) == 0){
                        jsonArray.remove(i);
                        break;
                    }
                }
                redisUtil.setStrValue("VEHICLE", jsonArray.toJSONString());
            }
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成出行订单支付,谢谢使用!", uid, 1);
        }
        this.updateAllColumnById(orderTaxi);
        return resultUtil;
    }
    /**
     * 手动完成订单操作
@@ -1722,8 +995,8 @@
        if(null == distance){
            System.err.println("查询距离出错了");
        }else{
            d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
            t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
            d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
            t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
        }
        OrderServerWarpper orderServerWarpper = new OrderServerWarpper();
        orderServerWarpper.setOrderId(orderTaxi.getId());
@@ -1745,8 +1018,8 @@
            if(null == distance){
                System.err.println("查询距离出错了");
            }else{
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60),2).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
                d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString();
                t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + "";
            }
            orderServerWarpper.setReservationMileage("0");
            orderServerWarpper.setReservationTime("0");
@@ -1876,9 +1149,9 @@
    public void payOrderTaxiCallback(Integer id, String order_id, Integer type) throws Exception {
        OrderTaxi orderTaxi = this.selectById(id);
        PaymentRecord query = paymentRecordService.query(1, orderTaxi.getUserId(), 1, Integer.valueOf(id), 2, type, 1);
        if(null != query && query.getState() == 1){
        if(null != query){
            //添加交易明细
            transactionDetailsService.saveData(orderTaxi.getUserId(), "出租车", query.getAmount(), 2, 1, 1, 2, query.getOrderId());
            transactionDetailsService.saveData(orderTaxi.getUserId(), "完成订单", query.getAmount(), 2, 1, 1, 2, query.getOrderId());
            orderTaxi.setState(8);
            orderTaxi.setPayType(type);
            orderTaxi.setPayMoney(query.getAmount());
@@ -1895,15 +1168,6 @@
                userCouponRecord.setState(2);
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            if(null != orderTaxi.getUserTaxiCardId()){
                UserTaxiCard userTaxiCard = userTaxiCardService.selectById(orderTaxi.getUserTaxiCardId());
                if(userTaxiCard.getType() == 1 || userTaxiCard.getType() == 3){
                    JSONObject jsonObject = JSON.parseObject(userTaxiCard.getContent());
                    jsonObject.put("time", jsonObject.getInteger("time") - 1);
                    userTaxiCard.setContent(jsonObject.toJSONString());
                    userTaxiCardService.updateById(userTaxiCard);
                }
            }
            if(null != orderTaxi.getRedPacketId()){
                UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(orderTaxi.getRedPacketId());
@@ -1922,17 +1186,13 @@
            Double taxi = company.getTaxiMoney();
            BigDecimal d = null;//企业收入
            BigDecimal c = null;//司机收入
            // TODO: 2022/3/19  抽成按照订单金额计算,优先保证司机的收入,用户支付金额不够,则在平台收入中补贴司机收入
            //例如:订单金额10元,优惠3元,司机收入比例80%,平台收入比例20%。
            //司机收入:10 * 0.8 = 8
            //平台收入:7 - 8 = -1
            if(company.getIsTaxiFixedOrProportional() == 2){//固定
                d = new BigDecimal(taxi.compareTo(orderTaxi.getOrderMoney()) > 0 ? orderTaxi.getOrderMoney() : taxi);
                d = new BigDecimal(taxi);
                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            if(company.getIsTaxiFixedOrProportional() == 1){//比例
                c = new BigDecimal(orderTaxi.getOrderMoney()).multiply(new BigDecimal(1 - (taxi / 100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                d = new BigDecimal(orderTaxi.getPayMoney()).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                d = new BigDecimal(orderTaxi.getTravelMoney()).multiply(new BigDecimal(taxi).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                c = new BigDecimal(orderTaxi.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
            }
            incomeService.saveData(1, orderTaxi.getCompanyId(), 2, orderTaxi.getId(), 2, d.doubleValue());
            incomeService.saveData(2, orderTaxi.getDriverId(), 2, orderTaxi.getId(), 2, c.doubleValue());
@@ -1985,11 +1245,11 @@
        PaymentRecord query = paymentRecordService.query(1, orderTaxi.getUserId(), 1, Integer.valueOf(id), 2, type, 1);
        if(null != query){
            //添加交易明细
            transactionDetailsService.saveData(orderTaxi.getUserId(), "出租车取消订单", query.getAmount(), 2, 1, 1, 2, query.getOrderId());
            transactionDetailsService.saveData(orderTaxi.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 2, query.getOrderId());
            orderTaxi.setState(10);
            //解除小号绑定
            if(orderTaxi.getBindId() != null){
                chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId(), orderTaxi.getTelX(), (System.currentTimeMillis() + 600000));
                chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId());
            }
            orderTaxi.setBindId("");
            orderTaxi.setTelX("");
@@ -2051,7 +1311,6 @@
                        if(list.size() > 0){
                            double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数
                            int lastIndex = Double.valueOf(list.size() * driverProportion).intValue();//计算占比转成整数(下标截取)
                            lastIndex = lastIndex == 0 ? list.size() : lastIndex;
                            list = list.subList(0, lastIndex);//获取空闲司机中占比数据
                            for(Driver driver : list){//开始进行推送
                                //查询是否在限制推单范围内
@@ -2091,77 +1350,5 @@
    public synchronized String getOrderNum() throws Exception{
        int size = this.selectCount(null);
        return "TAXI" + String.valueOf(1000000 + size + 1).substring(1);
    }
    @Override
    public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception {
        UserInfo userInfo = userInfoService.selectById(uid);
        OrderTaxi orderTaxi = this.selectById(orderId);
        ResultUtil resultUtil = ResultUtil.success();
        if(payType == 1){//微信支付
            String app = type == 1 ? "APP" : "JSAPI";
            resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId());
            paymentRecordService.saveData(3, uid, 1, orderId, 2, 1, money, "", 1);//添加预支付数据
        }
        if(payType == 2){//支付宝支付
            resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee");
            paymentRecordService.saveData(1, uid, 1, orderId, 2, 2, money, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < money){
                return ResultUtil.error("余额不足,无法完成支付", "");
            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId());
            userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "出租车-感谢费", money, 2, 1, 1, 2, orderId);
            userInfoService.updateById(userInfo);
            orderTaxi.setThankYouFee(money);
            this.updateById(orderTaxi);
            //添加已收入明细
            incomeService.saveData(2, orderTaxi.getDriverId(), 6, orderTaxi.getId(), 2, money);
            Driver driver = driverService.selectById(orderTaxi.getDriverId());
            driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            driverService.updateById(driver);
            systemNoticeService.addSystemNotice(1, "您已使用余额成功完成感谢费支付,谢谢使用!", uid, 1);
        }
        return resultUtil;
    }
    @Override
    public void payThankYouFeeCallback(Integer orderId, String order_id, Integer payType) throws Exception {
        OrderTaxi orderTaxi = this.selectById(orderId);
        UserInfo userInfo = userInfoService.selectById(orderTaxi.getUserId());
        PaymentRecord query = paymentRecordService.query(3, userInfo.getId(), 1, orderId, 2, payType, 1);
        query.setState(2);
        query.setCode(order_id);
        paymentRecordService.updateById(query);
        SysIntegral query1 = sysIntegralMapper.query(orderTaxi.getCompanyId());
        userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分
        //添加交易明细
        transactionDetailsService.saveData(userInfo.getId(), "出租车-感谢费", query.getAmount(), 2, 1, 1, 2, orderId);
        userInfoService.updateById(userInfo);
        orderTaxi.setThankYouFee(query.getAmount());
        this.updateById(orderTaxi);
        //添加已收入明细
        incomeService.saveData(2, orderTaxi.getDriverId(), 6, orderTaxi.getId(), 2, query.getAmount());
        Driver driver = driverService.selectById(orderTaxi.getDriverId());
        driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(query.getAmount())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
        driverService.updateById(driver);
        systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : "支付宝") + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1);
    }
}
UserTravel/guns-admin/src/main/resources/application.yml
@@ -45,12 +45,13 @@
wx:
  grantType: authorization_code #填authorization_code
  appid: wx0c6aa2ec86988981 #应用唯一标识,在微信开放平台提交应用审核通过后获得
  appSecret: 612844f991c69a876bb836ac1846a79e #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得
  appletsAppid: wx0c6aa2ec86988981 #小程序APPid
  appletsAppSecret: ff00a48a6e61b49c2fd654de90052e46 #
  mchId: 1523106371 #微信支付分配的商户号
  key: s4TQO0NqPaRc0YfGptejNjlOpFlt4y2K #key为商户平台设置的密钥key:
  appid: wx0071ebcb539570f8 #应用唯一标识,在微信开放平台提交应用审核通过后获得
  appSecret: d88141e2ca669828c9bc2ab63ba1b7d8 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得
  appletsAppid: wx7608ef3dae49b691 #小程序APPid
  appletsAppSecret: 8ea5529ad9bc9703557ebfd6a95299f6 #
  mchId: 1415940702 #微信支付分配的商户号
  key: OKCHUXING20221226gxyskjYXGSwengk #key为商户平台设置的密钥key:
  certPath: /usr/local/server/cer/weixin/apiclient_cert.p12
alipay:
  appid: 2021003104609428  #应用程序唯一标识