| | |
| | | import com.ruoyi.other.api.vo.GovernmentCloudOtherVO; |
| | | import com.ruoyi.system.api.feignClient.JianGuanSystemClient; |
| | | import com.ruoyi.system.api.vo.GovernmentCloudSystemVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | * @date 2023/7/11 8:39 |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | | public class GovernmentCloudTask { |
| | | |
| | | |
| | |
| | | private JianGuanSystemClient jianGuanSystemClient; |
| | | |
| | | // 每天早上9点执行的定时任务 |
| | | @Scheduled(cron = "0 0 9 * * ?") |
| | | @Scheduled(cron = "0 0 16 * * ?") |
| | | public void taskMonth() { |
| | | System.err.println("传数据"); |
| | | // account服务 |
| | | GovernmentCloudAccountVO data = jianGuanAccountClient.listAll().getData(); |
| | | if (data != null) { |
| | | List<TAppCoupon> appCoupons = data.getAppCoupons(); |
| | | if (!appCoupons.isEmpty()) { |
| | | log.info("用户优惠券"+appCoupons); |
| | | appCouponService.saveBatch(appCoupons); |
| | | } |
| | | List<TAppUser> appUsers = data.getAppUsers(); |
| | | if (!appUsers.isEmpty()) { |
| | | log.info("用户"+appUsers); |
| | | |
| | | appUserService.saveBatch(appUsers); |
| | | } |
| | | List<TAppUserAddress> appUserAddresses = data.getAppUserAddresses(); |
| | | if (!appUserAddresses.isEmpty()) { |
| | | log.info("用户地址"+appUserAddresses); |
| | | |
| | | appUserAddressService.saveBatch(appUserAddresses); |
| | | } |
| | | List<TAppUserCar> appUserCars = data.getAppUserCars(); |
| | | if (!appUserCars.isEmpty()) { |
| | | log.info("用户车辆"+appUserCars); |
| | | |
| | | appUserCarService.saveBatch(appUserCars); |
| | | } |
| | | List<TAppUserIntegralChange> appUserIntegralChanges = data.getAppUserIntegralChanges(); |
| | | if (!appUserIntegralChanges.isEmpty()) { |
| | | log.info("用户积分变动"+appUserIntegralChanges); |
| | | |
| | | appUserIntegralChangeService.saveBatch(appUserIntegralChanges); |
| | | } |
| | | List<TAppUserSign> appUserSigns = data.getAppUserSigns(); |
| | | if (!appUserSigns.isEmpty()) { |
| | | log.info("用户签到"+appUserSigns); |
| | | |
| | | appUserSignService.saveBatch(appUserSigns); |
| | | } |
| | | List<TAppUserTag> appUserTags = data.getAppUserTags(); |
| | | if (!appUserTags.isEmpty()) { |
| | | log.info("用户标签"+appUserTags); |
| | | |
| | | appUserTagService.saveBatch(appUserTags); |
| | | } |
| | | List<TAppUserVipDetail> appUserVipDetails = data.getAppUserVipDetails(); |
| | | if (!appUserVipDetails.isEmpty()) { |
| | | log.info("用户会员明细"+appUserVipDetails); |
| | | |
| | | appUserVipDetailService.saveBatch(appUserVipDetails); |
| | | } |
| | | List<TInviteUser> inviteUsers = data.getInviteUsers(); |
| | | if (!inviteUsers.isEmpty()) { |
| | | log.info("邀请用户"+inviteUsers); |
| | | inviteUserService.saveBatch(inviteUsers); |
| | | } |
| | | List<TInvoiceInformation> invoiceInformations = data.getInvoiceInformations(); |
| | | if (!invoiceInformations.isEmpty()) { |
| | | log.info("开票"+invoiceInformations); |
| | | tInvoiceInformationService.saveBatch(invoiceInformations); |
| | | } |
| | | } |
| | |
| | | if (data1 != null) { |
| | | List<Partner> partners = data1.getPartners(); |
| | | if (!partners.isEmpty()) { |
| | | log.info("合作商"+partners); |
| | | |
| | | partnerService.saveBatch(partners); |
| | | } |
| | | List<Site> sites = data1.getSites(); |
| | | if (!sites.isEmpty()) { |
| | | log.info("站点"+sites); |
| | | |
| | | siteService.saveBatch(sites); |
| | | } |
| | | List<TAccountingStrategy> accountingStrategies = data1.getAccountingStrategies(); |
| | | if (!accountingStrategies.isEmpty()) { |
| | | log.info("策略"+accountingStrategies); |
| | | |
| | | accountingStrategyService.saveBatch(accountingStrategies); |
| | | } |
| | | List<TAccountingStrategyDetail> accountingStrategyDetails = data1.getAccountingStrategyDetails(); |
| | | if (!accountingStrategyDetails.isEmpty()) { |
| | | log.info("策略明细"+accountingStrategyDetails); |
| | | |
| | | accountingStrategyDetailService.saveBatch(accountingStrategyDetails); |
| | | } |
| | | List<TApplyChargingPile> applyChargingPiles = data1.getApplyChargingPiles(); |
| | | if (!applyChargingPiles.isEmpty()) { |
| | | log.info("申请充电桩"+applyChargingPiles); |
| | | |
| | | applyChargingPileService.saveBatch(applyChargingPiles); |
| | | } |
| | | List<TCarport> carports = data1.getCarports(); |
| | | if (!carports.isEmpty()) { |
| | | log.info("停车场"+carports); |
| | | |
| | | carportService.saveBatch(carports); |
| | | } |
| | | List<TChargingGun> chargingGuns = data1.getChargingGuns(); |
| | | if (!chargingGuns.isEmpty()) { |
| | | log.info("充电枪"+chargingGuns); |
| | | |
| | | chargingGunService.saveBatch(chargingGuns); |
| | | } |
| | | List<TChargingPile> chargingPiles = data1.getChargingPiles(); |
| | | if (!chargingPiles.isEmpty()) { |
| | | log.info("充电桩"+chargingPiles); |
| | | |
| | | chargingPileService.saveBatch(chargingPiles); |
| | | } |
| | | List<TChargingPileNotification> chargingPileNotifications = data1.getChargingPileNotifications(); |
| | | if (!chargingPileNotifications.isEmpty()) { |
| | | log.info("通知"+chargingPileNotifications); |
| | | |
| | | chargingPileNotificationService.saveBatch(chargingPileNotifications); |
| | | } |
| | | List<TFaultMessage> faultMessages = data1.getFaultMessages(); |
| | | if (!faultMessages.isEmpty()) { |
| | | log.info("故障"+faultMessages); |
| | | |
| | | faultMessageService.saveBatch(faultMessages); |
| | | } |
| | | List<TMonitoringEquipment> monitoringEquipments = data1.getMonitoringEquipments(); |
| | | if (!monitoringEquipments.isEmpty()) { |
| | | log.info("监控设备"+monitoringEquipments); |
| | | |
| | | monitoringEquipmentService.saveBatch(monitoringEquipments); |
| | | } |
| | | List<TParkingLot> parkingLots = data1.getParkingLots(); |
| | | if (!parkingLots.isEmpty()) { |
| | | log.info("停车场"+parkingLots); |
| | | |
| | | parkingLotService.saveBatch(parkingLots); |
| | | } |
| | | List<TParkingRecord> parkingRecords = data1.getParkingRecords(); |
| | | if (!parkingRecords.isEmpty()) { |
| | | log.info("停车记录"+parkingRecords); |
| | | |
| | | parkingRecordService.saveBatch(parkingRecords); |
| | | } |
| | | // List<TPartnerSite> partnerSites = data1.getPartnerSites(); |
| | |
| | | // } |
| | | List<TRepair> repairs = data1.getRepairs(); |
| | | if (!repairs.isEmpty()) { |
| | | log.info("报修"+repairs); |
| | | |
| | | repairService.saveBatch(repairs); |
| | | } |
| | | // List<TSiteMenu> siteMenus = data1.getSiteMenus(); |
| | |
| | | // } |
| | | List<TVehicleRamp> vehicleRamps = data1.getVehicleRamps(); |
| | | if (!vehicleRamps.isEmpty()) { |
| | | log.info("车道"+vehicleRamps); |
| | | |
| | | vehicleRampService.saveBatch(vehicleRamps); |
| | | } |
| | | } |
| | |
| | | if (data2 != null) { |
| | | List<AccountingStrategyDetailOrder> accountingStrategyDetailOrders = data2.getAccountingStrategyDetailOrders(); |
| | | if (!accountingStrategyDetailOrders.isEmpty()) { |
| | | log.info("订单明细策略"+accountingStrategyDetailOrders); |
| | | |
| | | accountingStrategyDetailOrderService.saveBatch(accountingStrategyDetailOrders); |
| | | } |
| | | List<AccountingStrategyOrder> accountingStrategyOrders = data2.getAccountingStrategyOrders(); |
| | | if (!accountingStrategyOrders.isEmpty()) { |
| | | log.info("订单策略"+accountingStrategyOrders); |
| | | |
| | | accountingStrategyOrderService.saveBatch(accountingStrategyOrders); |
| | | } |
| | | List<TChargingBill> chargingBills = data2.getChargingBills(); |
| | | if (!chargingBills.isEmpty()) { |
| | | log.info("账单"+chargingBills); |
| | | |
| | | chargingBillService.saveBatch(chargingBills); |
| | | } |
| | | List<TChargingOrder> chargingOrders = data2.getChargingOrders(); |
| | | if (!chargingOrders.isEmpty()) { |
| | | log.info("充电订单"+chargingOrders); |
| | | |
| | | chargingOrderService.saveBatch(chargingOrders); |
| | | } |
| | | List<TChargingOrderAccountingStrategy> chargingOrderAccountingStrategies = data2.getChargingOrderAccountingStrategies(); |
| | | if (!chargingOrderAccountingStrategies.isEmpty()) { |
| | | log.info("充电订单策略"+chargingOrderAccountingStrategies); |
| | | |
| | | chargingOrderAccountingStrategyService.saveBatch(chargingOrderAccountingStrategies); |
| | | } |
| | | List<TChargingOrderRefund> chargingOrderRefunds = data2.getChargingOrderRefunds(); |
| | | if (!chargingOrderRefunds.isEmpty()) { |
| | | log.info("充电订单退款"+chargingOrderRefunds); |
| | | |
| | | chargingOrderRefundService.saveBatch(chargingOrderRefunds); |
| | | } |
| | | List<TExchangeOrder> exchangeOrders = data2.getExchangeOrders(); |
| | | if (!exchangeOrders.isEmpty()) { |
| | | log.info("兑换订单"+exchangeOrders); |
| | | |
| | | exchangeOrderService.saveBatch(exchangeOrders); |
| | | } |
| | | List<TGrantVip> grantVips = data2.getGrantVips(); |
| | | if (!grantVips.isEmpty()) { |
| | | log.info("赠送vip"+grantVips); |
| | | |
| | | grantVipService.saveBatch(grantVips); |
| | | } |
| | | List<TOrderAppeal> orderAppeals = data2.getOrderAppeals(); |
| | | if (!orderAppeals.isEmpty()) { |
| | | log.info("订单申诉"+orderAppeals); |
| | | |
| | | orderAppealService.saveBatch(orderAppeals); |
| | | } |
| | | List<TOrderEvaluate> orderEvaluates = data2.getOrderEvaluates(); |
| | | if (!orderEvaluates.isEmpty()) { |
| | | log.info("订单评价"+orderEvaluates); |
| | | |
| | | orderEvaluateService.saveBatch(orderEvaluates); |
| | | } |
| | | List<TOrderEvaluateTag> orderEvaluateTags = data2.getOrderEvaluateTags(); |
| | | if (!orderEvaluateTags.isEmpty()) { |
| | | log.info("订单评价标签"+orderEvaluateTags); |
| | | |
| | | orderEvaluateTagService.saveBatch(orderEvaluateTags); |
| | | } |
| | | List<TOrderInvoice> orderInvoices = data2.getOrderInvoices(); |
| | | if (!orderInvoices.isEmpty()) { |
| | | log.info("订单开票"+orderInvoices); |
| | | |
| | | orderInvoiceService.saveBatch(orderInvoices); |
| | | } |
| | | List<TOrderInvoiceDetail> orderInvoiceDetails = data2.getOrderInvoiceDetails(); |
| | | if (!orderInvoiceDetails.isEmpty()) { |
| | | log.info("订单开票明细"+orderInvoiceDetails); |
| | | |
| | | orderInvoiceDetailService.saveBatch(orderInvoiceDetails); |
| | | } |
| | | List<TSettlementConfirm> settlementConfirms = data2.getSettlementConfirms(); |
| | | if (!settlementConfirms.isEmpty()) { |
| | | log.info("账单结算"+settlementConfirms); |
| | | |
| | | settlementConfirmService.saveBatch(settlementConfirms); |
| | | } |
| | | List<TShoppingOrder> shoppingOrders = data2.getShoppingOrders(); |
| | | if (!shoppingOrders.isEmpty()) { |
| | | log.info("购物订单"+shoppingOrders); |
| | | |
| | | shoppingOrderService.saveBatch(shoppingOrders); |
| | | } |
| | | List<TShoppingOrderRefund> shoppingOrderRefunds = data2.getShoppingOrderRefunds(); |
| | | if (!shoppingOrderRefunds.isEmpty()) { |
| | | log.info("购物订单退款"+shoppingOrderRefunds); |
| | | |
| | | shoppingOrderRefundService.saveBatch(shoppingOrderRefunds); |
| | | } |
| | | List<TVipOrder> vipOrders = data2.getVipOrders(); |
| | | if (!vipOrders.isEmpty()) { |
| | | log.info("会员订单"+vipOrders); |
| | | |
| | | vipOrderService.saveBatch(vipOrders); |
| | | } |
| | | List<TVipOrderRefund> vipOrderRefunds = data2.getVipOrderRefunds(); |
| | | if (!vipOrderRefunds.isEmpty()) { |
| | | log.info("会员订单退款"+vipOrderRefunds); |
| | | |
| | | vipOrderRefundService.saveBatch(vipOrderRefunds); |
| | | } |
| | | } |
| | |
| | | if (data3 != null) { |
| | | List<Operator> operators = data3.getOperators(); |
| | | if (!operators.isEmpty()) { |
| | | log.info("运营商"+operators); |
| | | |
| | | operatorService.saveOrUpdateBatch(operators); |
| | | } |
| | | List<TActivity> activities = data3.getActivities(); |
| | | if (!activities.isEmpty()) { |
| | | log.info("活动"+activities); |
| | | |
| | | activityService.saveBatch(activities); |
| | | } |
| | | List<TAdvertising> advertisings = data3.getAdvertisings(); |
| | | if (!advertisings.isEmpty()) { |
| | | log.info("广告"+advertisings); |
| | | |
| | | advertisingService.saveBatch(advertisings); |
| | | } |
| | | List<TCompany> companies = data3.getCompanies(); |
| | | if (!companies.isEmpty()) { |
| | | log.info("公司"+companies); |
| | | |
| | | companyService.saveBatch(companies); |
| | | } |
| | | List<TCoupon> coupons = data3.getCoupons(); |
| | | if (!coupons.isEmpty()) { |
| | | log.info("优惠券"+coupons); |
| | | |
| | | couponService.saveBatch(coupons); |
| | | } |
| | | List<TEnterpriseUserApplication> enterpriseUserApplications = data3.getEnterpriseUserApplications(); |
| | | if (!enterpriseUserApplications.isEmpty()) { |
| | | log.info("公司申请"+enterpriseUserApplications); |
| | | |
| | | enterpriseUserApplicationService.saveBatch(enterpriseUserApplications); |
| | | } |
| | | List<TEvaluationTag> evaluationTags = data3.getEvaluationTags(); |
| | | if (!evaluationTags.isEmpty()) { |
| | | log.info("评价标签"+evaluationTags); |
| | | |
| | | evaluationTagService.saveBatch(evaluationTags); |
| | | } |
| | | List<TGoods> goods = data3.getGoods(); |
| | | if (!goods.isEmpty()) { |
| | | log.info("商品"+goods); |
| | | |
| | | goodsService.saveBatch(goods); |
| | | } |
| | | List<THtml> htmls = data3.getHtmls(); |
| | | if (!htmls.isEmpty()) { |
| | | log.info("html"+htmls); |
| | | |
| | | htmlService.saveOrUpdateBatch(htmls); |
| | | } |
| | | List<TIntegralRule> integralRules = data3.getIntegralRules(); |
| | | if (!integralRules.isEmpty()) { |
| | | log.info("积分规则"+integralRules); |
| | | |
| | | integralRuleService.saveBatch(integralRules); |
| | | } |
| | | List<TInvoiceType> invoiceTypes = data3.getInvoiceTypes(); |
| | | if (!invoiceTypes.isEmpty()) { |
| | | log.info("开票类型"+invoiceTypes); |
| | | |
| | | invoiceTypeService.saveBatch(invoiceTypes); |
| | | } |
| | | List<TNotice> notices = data3.getNotices(); |
| | | if (!notices.isEmpty()) { |
| | | log.info("通知"+notices); |
| | | |
| | | noticeService.saveBatch(notices); |
| | | } |
| | | List<TSystemConfiguration> systemConfigurations = data3.getSystemConfigurations(); |
| | | if (!systemConfigurations.isEmpty()) { |
| | | log.info("系统设置"+systemConfigurations); |
| | | systemConfigurationService.saveOrUpdateBatch(systemConfigurations); |
| | | } |
| | | List<TUserTag> userTags = data3.getUserTags(); |
| | | if (!userTags.isEmpty()) { |
| | | log.info("用户标签"+userTags); |
| | | userTagService.saveBatch(userTags); |
| | | } |
| | | List<TVip> vips = data3.getVips(); |
| | | if (!vips.isEmpty()) { |
| | | log.info("会员"+vips); |
| | | vipService.saveBatch(vips); |
| | | } |
| | | } |
| | |
| | | if (data4 != null) { |
| | | List<SysLoginLog> loginLogs = data4.getLoginLogs(); |
| | | if (!loginLogs.isEmpty()) { |
| | | log.info("登录日志"+loginLogs); |
| | | sysLoginLogService.saveBatch(loginLogs); |
| | | } |
| | | List<SysOperLog> sysOperLogs = data4.getSysOperLogs(); |
| | | if (!sysOperLogs.isEmpty()) { |
| | | log.info("操作日志"+sysOperLogs); |
| | | sysOperLogService.saveBatch(sysOperLogs); |
| | | } |
| | | List<SysRole> sysRoles = data4.getSysRoles(); |
| | | if (!sysRoles.isEmpty()) { |
| | | log.info("角色"+sysRoles); |
| | | sysRoleService.saveBatch(sysRoles); |
| | | } |
| | | List<SysUser> sysUsers = data4.getSysUsers(); |
| | | if (!sysUsers.isEmpty()) { |
| | | log.info("系统用户"+sysUsers); |
| | | sysUserService.saveBatch(sysUsers); |
| | | } |
| | | } |