From 5dacdee9b54c78372b68140e2b068d03a620eab9 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 02 七月 2025 19:00:52 +0800 Subject: [PATCH] 修改bug --- ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java | 64 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SellingCarController.java | 27 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java | 44 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java | 29 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdditionalFeeController.java | 20 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyWithdrawController.java | 25 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java | 11 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_add.html | 8 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TUserController.java | 110 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSmsrecordController.java | 29 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_edit.html | 8 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UserMgrController.java | 132 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java | 91 ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/userActivity/userActivity_info.js | 56 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgreementController.java | 46 ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/incomeDetail/summaryOfIncomeDetails.js | 21 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tVersionManagement/tVersionManagement_add.html | 20 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/taxiCardPayment.html | 4 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/shiro/check/PermissionCheckFactory.java | 15 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java | 24 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_add.html | 2 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TEnterpriseWithdrawalController.java | 36 ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/report/order.js | 4 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityHistoryServiceImpl.java | 112 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysSensitiveWordsController.java | 76 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/ShiroExtUtil.java | 144 ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sellingCar/sellingCar_info.js | 16 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TPubWithdrawalController.java | 32 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_edit.html | 2 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/punish.html | 4 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard.html | 4 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SpendingDetailPlatformController.java | 30 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityGiveController.java | 22 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_right.html | 2 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TProblemController.java | 39 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TDispatchController.java | 215 +- ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSysReformist/tSysReformist.html | 10 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_edit.html | 4 ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sysCouponActivity/tUser.js | 9 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/DriverActivityController.java | 30 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/RecruitController.java | 24 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java | 33 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java | 89 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdvertisementController.java | 39 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java | 18 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java | 62 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/BeetlConfiguration.java | 14 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/taxiCardPayment.html | 4 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java | 60 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit_detail.html | 4 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java | 72 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVerifiedController.java | 34 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/LogAop.java | 14 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityServiceImpl.java | 37 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/order.html | 2 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysRedPacketRecordController.java | 41 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfIncomeDetails.html | 2 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java | 26 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TPubWithdrawalServiceImpl.java | 260 +- ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tCompany/tCompany_info.js | 30 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java | 112 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java | 16 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysReformistController.java | 512 +++--- ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralGoodsController.java | 36 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EmployeeUtil.java | 104 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi_edit.html | 34 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_add.html | 2 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RecruitServiceImpl.java | 11 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java | 34 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java | 11 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java | 112 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/IncomeDetailController.java | 115 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderEvaluateController.java | 31 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java | 34 ManagementQYTTravel/guns-admin/src/main/resources/application.yml | 4 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityController.java | 30 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/WebConfig.java | 28 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/UserActivityController.java | 35 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TNoticesController.java | 29 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_update.html | 2 ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser_info.js | 12 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java | 376 ++-- ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tNotices/system_info.js | 16 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EnterpriseUtil.java | 16 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/order.html | 2 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit.html | 4 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTaxiServiceImpl.java | 35 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharterController.java | 33 ManagementQYTTravel/guns-admin/src/main/webapp/static/home.js | 8 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_edit.html | 2 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfSpendingDetails.html | 2 ManagementQYTTravel/guns-admin/src/main/resources/application-dev.yml | 95 + ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java | 59 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharteredCarController.java | 18 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_add.html | 2 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSiteController.java | 40 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi.html | 6 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TTaxiCardController.java | 37 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/UserUtil.java | 44 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_detail.html | 2 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_tab.html | 2 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/SpringSessionConfig.java | 2 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/QYTUserInfo.java | 4 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_add.html | 4 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/AddNotice.java | 17 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSystemPrice/taxiSet.html | 4 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tUser/tUser_userDetail.html | 1 ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit.html | 10 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SellingCarServiceImpl.java | 24 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/IncomeServiceImpl.java | 45 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCrossCityController.java | 25 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/BlackboardController.java | 64 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarRentalServiceImpl.java | 88 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityServiceImpl.java | 31 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/CarRentalController.java | 26 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/ReportController.java | 53 ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/carRental/carRental_info.js | 16 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java | 27 ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java | 20 119 files changed, 2,693 insertions(+), 2,313 deletions(-) diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/SpringSessionConfig.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/SpringSessionConfig.java index af628be..05243ce 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/SpringSessionConfig.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/SpringSessionConfig.java @@ -11,7 +11,7 @@ * @date 2017-07-13 21:05 */ @Configuration -@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 86400) //session过期时间 如果部署多机环境,需要打开注释 +@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 28800) //session过期时间 如果部署多机环境,需要打开注释 @ConditionalOnProperty(prefix = "guns", name = "spring-session-open", havingValue = "true") public class SpringSessionConfig { diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/WebConfig.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/WebConfig.java index eb4c2ff..d66fdfb 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/WebConfig.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/config/web/WebConfig.java @@ -183,6 +183,26 @@ @Bean public FilterRegistrationBean getOnconMDCasFilter() { +// OnconMDCasFilter onconMDCasFilter = new OnconMDCasFilter(); +// FilterRegistrationBean registrationBean = new FilterRegistrationBean(); +// registrationBean.setFilter(onconMDCasFilter); +// List<String> urlPatterns = new ArrayList<String>(); +// urlPatterns.add("/*"); +// registrationBean.setUrlPatterns(urlPatterns); +// registrationBean.setOrder(2); +// +// registrationBean.addInitParameter("oncon.com.security.urls", "/**"); +// registrationBean.addInitParameter("erp.si-tech.com.cn.noCheckUrl", "/index.html,/static/**,/upload/**"); +// registrationBean.addInitParameter("erp.si-tech.com.cn.nologinstatus", "/*"); +// registrationBean.addInitParameter("erp.si-tech.com.cn.loginstatus", "/*"); +// registrationBean.addInitParameter("com.oncon.sso.urlparams.nologin", "code,code2"); +// +// registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginUrl", "https://testsso1.teamshub.com/login"); +// registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.validateUrl", "https://testsso1.teamshub.com/serviceValidate"); +// registrationBean.addInitParameter("com.oncon.md.loginUrl", "https://testsso1.teamshub.com/sso-session/login"); +// registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.serverName", "https://traffic.qytzt.cn:443"); + + OnconMDCasFilter onconMDCasFilter = new OnconMDCasFilter(); FilterRegistrationBean registrationBean = new FilterRegistrationBean(); registrationBean.setFilter(onconMDCasFilter); @@ -197,12 +217,10 @@ registrationBean.addInitParameter("erp.si-tech.com.cn.loginstatus", "/*"); registrationBean.addInitParameter("com.oncon.sso.urlparams.nologin", "code,code2"); - registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginUrl", "https://testsso1.teamshub.com/login"); - registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.validateUrl", "https://testsso1.teamshub.com/serviceValidate"); - registrationBean.addInitParameter("com.oncon.md.loginUrl", "https://testsso1.teamshub.com/sso-session/login"); + registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.loginUrl", "https://sso.teamshub.com/login"); + registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.validateUrl", "https://sso.teamshub.com/serviceValidate"); + registrationBean.addInitParameter("com.oncon.md.loginUrl", "https://passport.teamshub.com/login"); registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.serverName", "https://traffic.qytzt.cn:443"); -// registrationBean.addInitParameter("edu.yale.its.tp.cas.client.filter.serverName", "http://127.0.0.1:8010"); - return registrationBean; } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java index d964c0e..b67c3c5 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/GlobalExceptionHandler.java @@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; +import javax.annotation.Resource; import java.lang.reflect.UndeclaredThrowableException; import static com.stylefeng.guns.core.support.HttpKit.getIp; @@ -34,9 +35,11 @@ @ControllerAdvice @Order(-1) public class GlobalExceptionHandler { - + private Logger log = LoggerFactory.getLogger(this.getClass()); - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 拦截业务异常 */ @@ -44,7 +47,7 @@ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseBody public ErrorTip notFount(GunsException e) { - LogManager.me().executeLog(LogTaskFactory.exceptionLog(ShiroExtUtil.getUser().getId(), e)); + LogManager.me().executeLog(LogTaskFactory.exceptionLog(shiroExtUtil.getUser().getId(), e)); getRequest().setAttribute("tip", e.getMessage()); log.error("业务异常:", e); return new ErrorTip(e.getCode(), e.getMessage()); @@ -115,7 +118,7 @@ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) @ResponseBody public ErrorTip notFount(RuntimeException e) { - LogManager.me().executeLog(LogTaskFactory.exceptionLog(ShiroExtUtil.getUser().getId(), e)); + LogManager.me().executeLog(LogTaskFactory.exceptionLog(shiroExtUtil.getUser().getId(), e)); getRequest().setAttribute("tip", "服务器未知运行时异常"); log.error("运行时异常:", e); return new ErrorTip(BizExceptionEnum.SERVER_ERROR.getCode(), BizExceptionEnum.SERVER_ERROR.getMessage()); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/LogAop.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/LogAop.java index 0dbb477..377690a 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/LogAop.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/aop/LogAop.java @@ -20,6 +20,7 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; +import javax.annotation.Resource; import java.lang.reflect.Method; import java.util.Map; @@ -32,16 +33,19 @@ @Aspect @Component public class LogAop { - + private Logger log = LoggerFactory.getLogger(this.getClass()); - + + @Resource + private ShiroExtUtil shiroExtUtil; + @Pointcut(value = "@annotation(com.stylefeng.guns.core.common.annotion.BussinessLog)") public void cutService() { } - + @Around("cutService()") public Object recordSysLog(ProceedingJoinPoint point) throws Throwable { - + //先执行业务 Object result = point.proceed(); @@ -68,7 +72,7 @@ String methodName = currentMethod.getName(); //如果当前用户未登录,不做日志 - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); if (null == user) { return; } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/BeetlConfiguration.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/BeetlConfiguration.java index 9a9b869..f8a0b82 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/BeetlConfiguration.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/BeetlConfiguration.java @@ -3,6 +3,7 @@ import com.stylefeng.guns.core.tag.DictSelectorTag; import com.stylefeng.guns.core.util.KaptchaUtil; import com.stylefeng.guns.core.util.ToolUtil; +import com.stylefeng.guns.modular.system.util.SpringContextsUtil; import org.beetl.core.Context; import org.beetl.core.Function; import org.beetl.core.Tag; @@ -21,21 +22,20 @@ * @Date 2018/2/22 21:03 */ public class BeetlConfiguration extends BeetlGroupUtilConfiguration { - + @Autowired Environment env; - + @Autowired ApplicationContext applicationContext; - + @Autowired DictSelectorTag dictSelectorTag; - - - + + @Override public void initOther() { - groupTemplate.registerFunctionPackage("shiro", new ShiroExtUtil()); + groupTemplate.registerFunctionPackage("shiro", SpringContextsUtil.getBean(ShiroExtUtil.class)); groupTemplate.registerFunctionPackage("tool", new ToolUtil()); groupTemplate.registerFunctionPackage("kaptcha", new KaptchaUtil()); groupTemplate.registerTagFactory("dictSelector", new TagFactory() { diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/ShiroExtUtil.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/ShiroExtUtil.java index 04cc4b8..bb560ab 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/ShiroExtUtil.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/beetl/ShiroExtUtil.java @@ -15,73 +15,39 @@ */ package com.stylefeng.guns.core.beetl; +import com.alibaba.fastjson.JSON; import com.stylefeng.guns.core.common.exception.BizExceptionEnum; import com.stylefeng.guns.core.exception.GunsException; import com.stylefeng.guns.core.shiro.ShiroUser; +import com.stylefeng.guns.modular.system.warpper.LoginUser; +import org.apache.commons.codec.binary.Base64; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; -import java.util.HashMap; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import java.io.UnsupportedEncodingException; import java.util.List; -import java.util.Map; +@Component public class ShiroExtUtil { - private static final String NAMES_DELIMETER = ","; + private final String NAMES_DELIMETER = ","; - public static Map<String, ShiroUser> map = new HashMap<>(); - - /** - * 获取当前 Subject - * - * @return Subject - */ - protected static Subject getSubject() { - return SecurityUtils.getSubject(); - } - - /** - * 获取封装的 ShiroUser - * - * @return ShiroUser - */ - public static ShiroUser getUser() { - String sessionId = RequestContextHolder.currentRequestAttributes().getSessionId(); - ShiroUser shiroUser = map.get(sessionId); - if(null == shiroUser){ - throw new GunsException(BizExceptionEnum.TOKEN_ERROR); - } - return shiroUser; - } - - /** - * 验证当前用户是否属于该角色?,使用时与lacksRole 搭配使用 - * - * @param roleName 角色名 - * @return 属于该角色:true,否则false - */ - public boolean hasRole(String roleName) { - return getSubject() != null && roleName != null - && roleName.length() > 0 && getSubject().hasRole(roleName); - } - - /** - * 与hasRole标签逻辑相反,当用户不属于该角色时验证通过。 - * - * @param roleName 角色名 - * @return 不属于该角色:true,否则false - */ - public boolean lacksRole(String roleName) { - return !hasRole(roleName); - } - + @Resource + private RedisTemplate<String, String> redisTemplate; + /** * 验证当前用户是否属于以下任意一个角色。 * * @param roleNames 角色列表 * @return 属于:true,否则false */ - public static boolean hasAnyRoles(String roleNames) { + public boolean hasAnyRoles(String roleNames) { boolean hasAnyRole = false; ShiroUser user = getUser(); if (user != null && roleNames != null && roleNames.length() > 0) { @@ -95,7 +61,62 @@ } return hasAnyRole; } - + + /** + * 获取封装的 ShiroUser + * + * @return ShiroUser + */ + public ShiroUser getUser() { + ServletRequestAttributes attrs = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + if (attrs != null) { + HttpServletRequest request = attrs.getRequest(); + HttpSession session = request.getSession(); + String onconParam = edu.yale.its.tp.cas.client.Util.getOnconParam(session); + try { + onconParam = new String(Base64.decodeBase64(onconParam), "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + LoginUser loginUser = JSON.parseObject(onconParam, LoginUser.class); + System.out.println("当前登录用户:" + JSON.toJSONString(loginUser)); + String shiroUser = redisTemplate.opsForValue().get(loginUser.getOnconUUID()); + System.out.println("当前登录用户缓存数据:" + shiroUser); + return JSON.parseObject(shiroUser, ShiroUser.class); + } + throw new GunsException(BizExceptionEnum.TOKEN_ERROR); + } + + /** + * 与hasRole标签逻辑相反,当用户不属于该角色时验证通过。 + * + * @param roleName 角色名 + * @return 不属于该角色:true,否则false + */ + public boolean lacksRole(String roleName) { + return !hasRole(roleName); + } + + /** + * 验证当前用户是否属于该角色?,使用时与lacksRole 搭配使用 + * + * @param roleName 角色名 + * @return 属于该角色:true,否则false + */ + public boolean hasRole(String roleName) { + return getSubject() != null && roleName != null + && roleName.length() > 0 && getSubject().hasRole(roleName); + } + + /** + * 获取当前 Subject + * + * @return Subject + */ + protected Subject getSubject() { + return SecurityUtils.getSubject(); + } + /** * 验证当前用户是否属于以下所有角色。 * @@ -115,24 +136,24 @@ } return hasAllRole; } - + /** * 验证当前用户是否拥有指定权限,使用时与lacksPermission 搭配使用 * * @param permission 权限名 * @return 拥有权限:true,否则false */ - public static boolean hasPermission(String permission) { + public boolean hasPermission(String permission) { ShiroUser user = getUser(); - if(null == user){ + if (null == user) { return false; } - if(user.isAdmin()){ + if (user.isAdmin()) { return true; } return user.getMenuIds().contains(permission); } - + /** * 与hasPermission标签逻辑相反,当前用户没有制定权限时,验证通过。 * @@ -142,7 +163,7 @@ public boolean lacksPermission(String permission) { return !hasPermission(permission); } - + /** * 已认证通过的用户。不包含已记住的用户,这是与user标签的区别所在。与notAuthenticated搭配使用 * @@ -151,7 +172,7 @@ public boolean authenticated() { return getSubject() != null && getSubject().isAuthenticated(); } - + /** * 未认证通过用户,与authenticated标签相对应。与guest标签的区别是,该标签包含已记住用户。。 * @@ -160,7 +181,7 @@ public boolean notAuthenticated() { return !authenticated(); } - + /** * 认证通过或已记住的用户。与guset搭配使用。 * @@ -169,7 +190,7 @@ public boolean isUser() { return getSubject() != null && getSubject().getPrincipal() != null; } - + /** * 验证当前用户是否为“访客”,即未认证(包含未记住)的用户。用user搭配使用 * @@ -178,7 +199,7 @@ public boolean isGuest() { return !isUser(); } - + /** * 输出当前用户信息,通常为登录帐号信息。 * @@ -191,7 +212,6 @@ } return ""; } - } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/shiro/check/PermissionCheckFactory.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/shiro/check/PermissionCheckFactory.java index ead8d14..d0e9f70 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/shiro/check/PermissionCheckFactory.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/core/shiro/check/PermissionCheckFactory.java @@ -25,6 +25,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; /** @@ -34,14 +35,16 @@ @DependsOn("springContextHolder") @Transactional(readOnly = true) public class PermissionCheckFactory implements ICheck { - + @Resource + private ShiroExtUtil shiroExtUtil; + public static ICheck me() { return SpringContextHolder.getBean(ICheck.class); } - + @Override public boolean check(Object[] permissions) { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); if (null == user) { return false; } @@ -49,7 +52,7 @@ return true; } String join = CollectionKit.join(permissions, ","); - if (ShiroExtUtil.hasAnyRoles(join)) { + if (shiroExtUtil.hasAnyRoles(join)) { return true; } return false; @@ -58,7 +61,7 @@ @Override public boolean checkAll() { HttpServletRequest request = HttpKit.getRequest(); - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); if (null == user) { return false; } @@ -67,7 +70,7 @@ if (str.length > 3) { requestURI = "/" + str[1] + "/" + str[2]; } - if (ShiroExtUtil.hasPermission(requestURI)) { + if (shiroExtUtil.hasPermission(requestURI)) { return true; } return false; diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/CarRentalController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/CarRentalController.java index 2b85458..34271d2 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/CarRentalController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/CarRentalController.java @@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; @@ -50,27 +51,30 @@ @Autowired private ITRegionService regionService; - + @Autowired private ITUserService userService; - + @Autowired private ITDriverService driverService; - + @Autowired private ITCompanyService companyService; - - - + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转到列表页 + * * @return */ @GetMapping("/showCarRental") - public String showCarRental(Model model){ + public String showCarRental(Model model) { List<TCarBrand> state = carBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); model.addAttribute("carBrand", state); - model.addAttribute("userType", ShiroExtUtil.getUser().getRoleType()); + model.addAttribute("userType", shiroExtUtil.getUser().getRoleType()); return PREFIX + "carRental.html"; } @@ -81,7 +85,7 @@ */ @GetMapping("/carRental_add") public String carRental_add(Model model){ - model.addAttribute("push", ShiroExtUtil.getUser().getRoleType() == 1 ? true : false); + model.addAttribute("push", shiroExtUtil.getUser().getRoleType() == 1 ? true : false); List<TCarBrand> state = carBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); model.addAttribute("carBrand", state); List<TRegion> regions = regionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); @@ -146,7 +150,7 @@ model.addAttribute("province", regions); regions = regionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", regionService.selectOne(new EntityWrapper<TRegion>().eq("code", carRental.getProvinceCode())).getId())); model.addAttribute("city", regions); - model.addAttribute("push", ShiroExtUtil.getUser().getRoleType() == 1 ? true : false); + model.addAttribute("push", shiroExtUtil.getUser().getRoleType() == 1 ? true : false); return PREFIX + "carRental_edit.html"; } @@ -714,7 +718,7 @@ carRental.setImgUrl(eighteen); carRental.setVideoUrl(nineteen); carRental.setFirstPageShow(2); - carRental.setInsertUser(ShiroExtUtil.getUser().getId()); + carRental.setInsertUser(shiroExtUtil.getUser().getId()); carRentalService.insert(carRental); } } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/DriverActivityController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/DriverActivityController.java index ce56ae3..29d2958 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/DriverActivityController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/DriverActivityController.java @@ -5,22 +5,21 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; +import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.shiro.ShiroUser; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.DateUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; -import java.math.BigDecimal; +import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; @@ -44,16 +43,19 @@ @Autowired private IDriverActivityOnlineService driverActivityOnlineService; - + @Autowired private IDriverActivityOrderService driverActivityOrderService; - + @Autowired private IDriverActivityRegisteredService driverActivityRegisteredService; - + @Autowired private IDriverActivityHistoryService driverActivityHistoryService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到首页 */ @@ -61,7 +63,7 @@ public String index() { return PREFIX + "driverActivity.html"; } - + /** * 跳转到添加 */ @@ -230,16 +232,16 @@ @RequestMapping(value = "/list") @ResponseBody public Object list(String createTime,String name) { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(createTime)){ + if (SinataUtil.isNotEmpty(createTime)) { String[] timeArray = createTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(driverActivityService.getList(page,beginTime,endTime,name,user.getRoleType(),user.getObjectId())); + page.setRecords(driverActivityService.getList(page, beginTime, endTime, name, user.getRoleType(), user.getObjectId())); return super.packForBT(page); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java index 71c0f6e..fd73770 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/HomeController.java @@ -65,36 +65,37 @@ @Autowired private ITOrderPrivateCarService itOrderPrivateCarService; - + @Autowired private ITOrderCrossCityService itOrderCrossCityService; - + @Autowired private ITOrderLogisticsService itOrderLogisticsService; - + @Autowired private IDriverOnlineService driverOnlineService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + @RequestMapping("/openNetCarInfo") - public Object openNetCarInfo(Integer id, Model model){ + public Object openNetCarInfo(Integer id, Model model) { model.addAttribute("id", id); return "/netCarInfo.html"; } - + @RequestMapping("/showDriverOnline") - public String showDriverOnline(){ + public String showDriverOnline() { return "/driverOnline.html"; } - - - - + + @ResponseBody @PostMapping("/getSumData") - public Object getSumData(Integer companyId, Date addDate, Date start, Date end){ - Integer id = ShiroExtUtil.getUser().getId(); + public Object getSumData(Integer companyId, Date addDate, Date start, Date end) { + Integer id = shiroExtUtil.getUser().getId(); User user = userService.selectById(id); - if(companyId == null && user.getRoleType() != 1){ + if (companyId == null && user.getRoleType() != 1) { companyId = user.getObjectId(); } Map<String, Object> map = new HashMap<>(); @@ -103,7 +104,7 @@ Calendar calendar2 = Calendar.getInstance(); Calendar calendar3 = Calendar.getInstance(); Calendar calendar4 = Calendar.getInstance(); - if(addDate == null){ + if (addDate == null) { calendar1.setTime(date); calendar2.setTime(date); }else{ @@ -129,45 +130,44 @@ calendar4.set(Calendar.HOUR_OF_DAY, 23); calendar4.set(Calendar.MINUTE, 59); calendar4.set(Calendar.SECOND, 59); - + //【今日运行情况】 Map<String, Object> map1 = new HashMap<>(); Wrapper<TUser> ne = new EntityWrapper<TUser>().between("insertTime", calendar1.getTime(), calendar2.getTime()).ne("flag", 3); - if(companyId != null){ + if (companyId != null) { ne.eq("companyId", companyId); } int i = tUserService.selectCount(ne); map1.put("passengerInfo", i); //新增用户 - + Wrapper<TDriver> ne1 = new EntityWrapper<TDriver>().ne("state", 1).eq("authState", 2).ne("flag", 3); - if(companyId != null){ + if (companyId != null) { ne1.eq("companyId", companyId).or().eq("franchiseeId", companyId); } - List<TDriver> tDrivers = tDriverService.selectList(ne1); - int size = driverOnlineService.queryOnlineDriverCount(null, null); - map1.put("netcardriver", size); //在线司机 - + int count = tDriverService.selectCount(new EntityWrapper<TDriver>().ne("state", 1).eq("authState", 2).ne("flag", 3)); + map1.put("netcardriver", count); //在线司机 + Wrapper<TOrderTaxi> travelTime1 = new EntityWrapper<TOrderTaxi>().between("insertTime", calendar1.getTime(), calendar2.getTime()); - if(companyId != null){ + if (companyId != null) { travelTime1.eq("companyId", companyId); } int i1 = tOrderTaxiService.selectCount(travelTime1); map1.put("orderDetail2", i1); //出租车订单 - + Wrapper<TOrderPrivateCar> zcTodayTme = new EntityWrapper<TOrderPrivateCar>().between("insertTime", calendar1.getTime(), calendar2.getTime()); - if(companyId != null){ + if (companyId != null) { zcTodayTme.eq("companyId", companyId); } int zcTodayNum = itOrderPrivateCarService.selectCount(zcTodayTme); map1.put("orderDetail1", zcTodayNum); //快车订单 - + Wrapper<TOrderCrossCity> kcTodayTme = new EntityWrapper<TOrderCrossCity>().between("insertTime", calendar1.getTime(), calendar2.getTime()); - if(companyId != null){ + if (companyId != null) { kcTodayTme.eq("companyId", companyId); } int kcTodayNum = itOrderCrossCityService.selectCount(kcTodayTme); map1.put("orderDetail3", kcTodayNum); //跨城订单 - + Wrapper<TOrderLogistics> tcxTodayTme = new EntityWrapper<TOrderLogistics>().between("insertTime", calendar1.getTime(), calendar2.getTime()); if(companyId != null){ tcxTodayTme.eq("companyId", companyId); @@ -216,7 +216,7 @@ Double allIncomeMoney = tOrderTaxiService.getAllIncomeMoney(companyId, null, null); /// 购买打车卡产生的收益 - Double allCardMoney = taxiCardService.AllCardMoney(ShiroExtUtil.getUser().getObjectId()); + Double allCardMoney = taxiCardService.AllCardMoney(shiroExtUtil.getUser().getObjectId()); if(allCardMoney==null){ allCardMoney=0.0; } @@ -383,8 +383,8 @@ @ResponseBody @PostMapping("/getDriverPosition") - public Object getDriverPosition(Integer companyId){ - Integer id = ShiroExtUtil.getUser().getId(); + public Object getDriverPosition(Integer companyId) { + Integer id = shiroExtUtil.getUser().getId(); User user = userService.selectById(id); if (companyId == null && user.getRoleType() != 1) { companyId = user.getObjectId(); @@ -454,15 +454,15 @@ @ResponseBody @PostMapping("/getCompanyInfoByUserId") - public Object getCompanyInfoByUserId(){ - Integer id = ShiroExtUtil.getUser().getId(); + public Object getCompanyInfoByUserId() { + Integer id = shiroExtUtil.getUser().getId(); User user = userService.selectById(id); companys = new ArrayList<>(); List<TCompany> ids = new ArrayList<>(); TCompany tCompany = null; - if(user.getRoleType() == 1 && user.getObjectId() == null){ + if (user.getRoleType() == 1 && user.getObjectId() == null) { tCompany = tCompanyService.selectById(1); - }else{ + } else { tCompany = tCompanyService.selectById(user.getObjectId()); } ids.add(tCompany); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/IncomeDetailController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/IncomeDetailController.java index 3f2b697..8295d6b 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/IncomeDetailController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/IncomeDetailController.java @@ -6,12 +6,10 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ExcelUtil; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.model.TBalanceModifyRecord; -import com.stylefeng.guns.modular.system.model.TDriver; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.ResultUtil; import org.apache.poi.hssf.usermodel.HSSFWorkbook; @@ -19,6 +17,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.OutputStream; import java.math.BigDecimal; @@ -46,19 +45,23 @@ @Autowired private ITTaxiCardPaymentService taxiCardPaymentService; - + @Autowired private ITOrderLogisticsService orderLogisticsService; - + @Autowired private ITOrderTaxiService orderTaxiService; - + @Autowired private IIncomeService incomeService; - - + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转到订单收益 + * * @return */ @RequestMapping("order") @@ -85,19 +88,19 @@ page.setRecords(null); }else{*/ - List<Map<String, Object>> list = orderTaxiService.getIncomeOrderList(page, beginTime, endTime, phone, name, state, type, ShiroExtUtil.getUser().getObjectId(), income, payType); - list = list.stream().filter(e-> ToolUtil.isNotEmpty(e.get("payState"))).collect(Collectors.toList()); + List<Map<String, Object>> list = orderTaxiService.getIncomeOrderList(page, beginTime, endTime, phone, name, state, type, shiroExtUtil.getUser().getObjectId(), income, payType); + list = list.stream().filter(e -> ToolUtil.isNotEmpty(e.get("payState"))).collect(Collectors.toList()); Page<Map<String, Object>> page1 = new Page<>(0, 1000000); - List<Map<String, Object>> list1 = orderTaxiService.getIncomeOrderList(page1, beginTime, endTime, phone, name, state, type, ShiroExtUtil.getUser().getObjectId(), income, payType); - list1 = list1.stream().filter(e->ToolUtil.isNotEmpty(e.get("payState"))).collect(Collectors.toList()); - BigDecimal orderMoney = new BigDecimal("0"); - BigDecimal money = new BigDecimal("0"); - BigDecimal payMoney = new BigDecimal("0"); - BigDecimal couponMoney = new BigDecimal("0"); - BigDecimal discountAmount = new BigDecimal("0"); - BigDecimal redPacketMoney = new BigDecimal("0"); - BigDecimal additionalFee = new BigDecimal("0"); - BigDecimal other = new BigDecimal("0"); + List<Map<String, Object>> list1 = orderTaxiService.getIncomeOrderList(page1, beginTime, endTime, phone, name, state, type, shiroExtUtil.getUser().getObjectId(), income, payType); + list1 = list1.stream().filter(e -> ToolUtil.isNotEmpty(e.get("payState"))).collect(Collectors.toList()); + BigDecimal orderMoney = new BigDecimal("0"); + BigDecimal money = new BigDecimal("0"); + BigDecimal payMoney = new BigDecimal("0"); + BigDecimal couponMoney = new BigDecimal("0"); + BigDecimal discountAmount = new BigDecimal("0"); + BigDecimal redPacketMoney = new BigDecimal("0"); + BigDecimal additionalFee = new BigDecimal("0"); + BigDecimal other = new BigDecimal("0"); for (Map<String, Object> map : list) { Object money1 = map.get("money"); BigDecimal bigDecimal = new BigDecimal(money1.toString()); @@ -224,7 +227,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = orderTaxiService.getIncomeOrderListEx(beginTime, endTime, phone, name, state, type, ShiroExtUtil.getUser().getObjectId(), income, payType); + List<Map<String, Object>> mapList = orderTaxiService.getIncomeOrderListEx(beginTime, endTime, phone, name, state, type, shiroExtUtil.getUser().getObjectId(), income, payType); mapList = mapList.stream().filter(e-> ToolUtil.isNotEmpty(e.get("payState"))).collect(Collectors.toList()); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -388,8 +391,8 @@ page.setRecords(null); }else{*/ - List<Map<String, Object>> list = orderLogisticsService.getTimeOutOrderList(page, beginTime, endTime, phone, name, id, ShiroExtUtil.getUser().getObjectId(), orderType); - Map<String, Object> map = orderLogisticsService.getTimeOutOrderSumMoney(beginTime, endTime, phone, name, id, ShiroExtUtil.getUser().getObjectId(), orderType); + List<Map<String, Object>> list = orderLogisticsService.getTimeOutOrderList(page, beginTime, endTime, phone, name, id, shiroExtUtil.getUser().getObjectId(), orderType); + Map<String, Object> map = orderLogisticsService.getTimeOutOrderSumMoney(beginTime, endTime, phone, name, id, shiroExtUtil.getUser().getObjectId(), orderType); if (!list.isEmpty() && map != null) { map.put("id", "合计"); list.add(map); @@ -425,7 +428,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = orderLogisticsService.getTimeOutOrderListEx(beginTime, endTime, phone, name, id, ShiroExtUtil.getUser().getObjectId(), orderType); + List<Map<String, Object>> mapList = orderLogisticsService.getTimeOutOrderListEx(beginTime, endTime, phone, name, id, shiroExtUtil.getUser().getObjectId(), orderType); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -497,7 +500,7 @@ String cardName) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; @@ -507,16 +510,16 @@ page.setRecords(null); }else{*/ - List<Map<String, Object>> list = taxiCardPaymentService.getList(page, beginTime, endTime, null, type, phone, name, id, cardName, ShiroExtUtil.getUser().getObjectId()); - if(list!=null && list.size()>0){ - Map<String,Object> map = new HashMap<>(); - map.put("id", "合计"); - map.put("payMoney", taxiCardPaymentService.getSumMoney(beginTime, endTime, null, type, phone, name, id, cardName, ShiroExtUtil.getUser().getObjectId())); - list.add(map); - } - - page.setRecords(list); - /* }*/ + List<Map<String, Object>> list = taxiCardPaymentService.getList(page, beginTime, endTime, null, type, phone, name, id, cardName, shiroExtUtil.getUser().getObjectId()); + if (list != null && list.size() > 0) { + Map<String, Object> map = new HashMap<>(); + map.put("id", "合计"); + map.put("payMoney", taxiCardPaymentService.getSumMoney(beginTime, endTime, null, type, phone, name, id, cardName, shiroExtUtil.getUser().getObjectId())); + list.add(map); + } + + page.setRecords(list); + /* }*/ return super.packForBT(page); } @@ -533,28 +536,28 @@ DateFormat format = new SimpleDateFormat("yyyyMMdd"); String time = format.format(date); String fileName = "打车卡"+time+".xls"; - String[] title = new String[] {"支付时间","流水ID","打车卡名称","打车卡类型","乘客名称","乘客手机号","支付类型","收益金额"}; - - + String[] title = new String[]{"支付时间", "流水ID", "打车卡名称", "打车卡类型", "乘客名称", "乘客手机号", "支付类型", "收益金额"}; + + String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new Page<>(1, 10000000); - List<Map<String, Object>> mapList = taxiCardPaymentService.getList(page, beginTime, endTime, null, type, phone, name, id, cardName, ShiroExtUtil.getUser().getObjectId()); - + List<Map<String, Object>> mapList = taxiCardPaymentService.getList(page, beginTime, endTime, null, type, phone, name, id, cardName, shiroExtUtil.getUser().getObjectId()); + String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { - Map<String,Object> d=mapList.get(i); + Map<String, Object> d = mapList.get(i); values[i] = new String[title.length]; - values[i][0]=d.get("createTime").toString(); - values[i][1]=d.get("id").toString(); - values[i][2]=d.get("cardName").toString(); - values[i][3]=d.get("typeName").toString(); - values[i][4]=d.get("nickName")!=null?d.get("nickName").toString():""; + values[i][0] = d.get("createTime").toString(); + values[i][1] = d.get("id").toString(); + values[i][2] = d.get("cardName").toString(); + values[i][3] = d.get("typeName").toString(); + values[i][4] = d.get("nickName") != null ? d.get("nickName").toString():""; values[i][5]=d.get("phone")!=null?d.get("phone").toString():""; String payType = d.get("payType").toString(); if("1".equals(payType)){ @@ -594,21 +597,21 @@ String id) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - List<Map<String, Object>> list = complaintDeductmoneyService.getList(page, beginTime, endTime, null, userPhone, userName, id, ShiroExtUtil.getUser().getObjectId()); - if(list!=null && list.size()>0){ - Map<String,Object> map = new HashMap<>(); - map.put("id", "合计"); - map.put("money", complaintDeductmoneyService.getSumMoney(beginTime, endTime, null, userPhone, userName, id, ShiroExtUtil.getUser().getObjectId())); - list.add(map); - } - page.setRecords(list); + List<Map<String, Object>> list = complaintDeductmoneyService.getList(page, beginTime, endTime, null, userPhone, userName, id, shiroExtUtil.getUser().getObjectId()); + if (list != null && list.size() > 0) { + Map<String, Object> map = new HashMap<>(); + map.put("id", "合计"); + map.put("money", complaintDeductmoneyService.getSumMoney(beginTime, endTime, null, userPhone, userName, id, shiroExtUtil.getUser().getObjectId())); + list.add(map); + } + page.setRecords(list); return super.packForBT(page); } @@ -634,7 +637,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = complaintDeductmoneyService.getListEx(beginTime, endTime, null, userPhone, userName, id, ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> mapList = complaintDeductmoneyService.getListEx(beginTime, endTime, null, userPhone, userName, id, shiroExtUtil.getUser().getObjectId()); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityController.java index 285de65..7acb694 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityController.java @@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; @@ -45,21 +46,24 @@ @Autowired private IUserMerchantCouponService userMerchantCouponService; - + @Autowired private ITMerchantService merchantService; - + @Autowired private IMerchantActivitySlaveService merchantActivitySlaveService; - + @Autowired private IUserService userService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + @RequestMapping("/index") public String index() { return PREFIX + "merchantActivity.html"; } - + /** * @param startTime * @param endTime @@ -71,7 +75,7 @@ @RequestMapping("/list") @ResponseBody public Object list(String startTime, String endTime, Integer type, String merchantName, Integer status) { - Integer companyId = ShiroExtUtil.getUser().getObjectId(); + Integer companyId = shiroExtUtil.getUser().getObjectId(); Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); List<Map<String, Object>> list = merchantActivityService.list(startTime, endTime, type, merchantName, status, companyId, page); @@ -141,7 +145,7 @@ @ResponseBody public Object add(@RequestBody MerchantActivity activity) { - Integer userId = ShiroExtUtil.getUser().getId(); + Integer userId = shiroExtUtil.getUser().getId(); User user = userService.selectById(userId); if (ToolUtil.isNotEmpty(user)) { if (user.getRoleType().equals(2)) { @@ -358,8 +362,8 @@ public Object activityExamineList(String startTime, String endTime, Integer type, Integer auditStatus) { Integer companyId = null; - if (ShiroExtUtil.getUser().getRoleType().equals(1)) { - companyId = ShiroExtUtil.getUser().getObjectId(); + if (shiroExtUtil.getUser().getRoleType().equals(1)) { + companyId = shiroExtUtil.getUser().getObjectId(); } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); @@ -403,18 +407,18 @@ @RequestMapping("/examine") @ResponseBody public Object examine(Integer id, Integer state, String auditNote) { - + MerchantActivity activity = merchantActivityService.selectById(id); - Integer userId = ShiroExtUtil.getUser().getId(); + Integer userId = shiroExtUtil.getUser().getId(); User user = userService.selectById(userId); - + if (ToolUtil.isNotEmpty(activity)) { activity.setAuditStatus(state); activity.setAuditNote(auditNote); activity.setAuditUserId(user.getObjectId()); activity.setAuditTime(new Date()); - + merchantActivityService.updateById(activity); } return SUCCESS_TIP; diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityGiveController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityGiveController.java index e81bb93..d39026d 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityGiveController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/MerchantActivityGiveController.java @@ -8,10 +8,12 @@ import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; import com.stylefeng.guns.core.log.LogObjectHolder; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.core.util.ToolUtil; -import com.stylefeng.guns.modular.system.model.*; +import com.stylefeng.guns.modular.system.model.MerchantActivity; +import com.stylefeng.guns.modular.system.model.MerchantActivitySlave; +import com.stylefeng.guns.modular.system.model.User; +import com.stylefeng.guns.modular.system.model.UserMerchantCoupon; import com.stylefeng.guns.modular.system.response.MerchantActivityVo; import com.stylefeng.guns.modular.system.response.UserRequest; import com.stylefeng.guns.modular.system.service.*; @@ -25,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; @@ -46,15 +49,18 @@ private ITMerchantService merchantService; @Autowired private IUserMerchantCouponService userMerchantCouponService; - + @Autowired private IUserService userService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + @RequestMapping("/index") public String index() { return PREFIX + "merchantActivityGive.html"; } - + /** * @param startTime * @param endTime @@ -67,8 +73,8 @@ @ResponseBody public Object list(String startTime, String endTime, Integer type, String merchantName, Integer status) { - Integer companyId = ShiroExtUtil.getUser().getObjectId(); - + Integer companyId = shiroExtUtil.getUser().getObjectId(); + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); List<Map<String, Object>> list = merchantActivityService.getMerchantActivityGiveList(startTime, endTime, type, merchantName, status, companyId, page); page.setRecords(list); @@ -230,7 +236,7 @@ @RequestMapping("/add") public Object add(@RequestBody MerchantActivity activity) { - Integer userId = ShiroExtUtil.getUser().getId(); + Integer userId = shiroExtUtil.getUser().getId(); User user = userService.selectById(userId); if (ToolUtil.isNotEmpty(user)) { if (user.getRoleType().equals(2)) { diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/RecruitController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/RecruitController.java index 3cb9b8f..02ac3e0 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/RecruitController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/RecruitController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.*; /** @@ -25,25 +26,28 @@ @Controller @RequestMapping("/recruit") public class RecruitController { - + private String PREFIX = "/system/recruit/"; - + @Autowired private ITRegionService regionService; - + @Autowired private IRecruitService recruitService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到列表页 + * * @return */ @GetMapping("/showRecruit") - public String showRecruit(){ + public String showRecruit() { return PREFIX + "recruit.html"; } - - + + /** * 跳转到添加页 * @return @@ -118,13 +122,13 @@ @PostMapping("/addRecruit") public ResultUtil addRecruit(Recruit recruit){ try { - recruit.setCompanyType(ShiroExtUtil.getUser().getRoleType()); - recruit.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + recruit.setCompanyType(shiroExtUtil.getUser().getRoleType()); + recruit.setCompanyId(shiroExtUtil.getUser().getObjectId()); recruit.setProvinceName(regionService.selectOne(new EntityWrapper<TRegion>().eq("code", recruit.getProvinceCode())).getName()); recruit.setCityName(regionService.selectOne(new EntityWrapper<TRegion>().eq("code", recruit.getCityCode())).getName()); recruit.setFirstPageShow(2); recruit.setCreateTime(new Date()); - recruit.setInsertUser(ShiroExtUtil.getUser().getId()); + recruit.setInsertUser(shiroExtUtil.getUser().getId()); if (recruit.getInterviewOrNot() == 1) { recruit.setStartSalary(0D); recruit.setEndSalary(0D); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/ReportController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/ReportController.java index e63619e..f4a55eb 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/ReportController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/ReportController.java @@ -7,7 +7,6 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.shiro.ShiroUser; import com.stylefeng.guns.core.util.ExcelUtil; import com.stylefeng.guns.core.util.SinataUtil; @@ -25,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.OutputStream; @@ -65,16 +65,19 @@ @Autowired private ITPubWithdrawalService tPubWithdrawalService; - + @Autowired private IComplaintDeductmoneyService complaintDeductmoneyService; - + @Autowired private ITTaxiCardPaymentService taxiCardPaymentService; - + @Autowired private ITOrderTaxiService orderTaxiService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到用户管理首页 */ @@ -82,7 +85,7 @@ public String user() { return PREFIX + "tUser.html"; } - + /** * 跳转到订单收益 * @return @@ -117,7 +120,7 @@ String ids,Integer type,String payType) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; @@ -126,10 +129,10 @@ /*if (ShiroKit.getUser().getRoleType() != 1){ page.setRecords(null); }else{*/ - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); List<Map<String, Object>> list = orderTaxiService.getOrderList(page, beginTime, endTime, ids, type, payType, user.getObjectId()); - page.setRecords(list); - /* }*/ + page.setRecords(list); + /* }*/ return super.packForBT(page); } @@ -158,7 +161,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = orderTaxiService.getOrderListEx(beginTime, endTime, ids, type, payType, ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> mapList = orderTaxiService.getOrderListEx(beginTime, endTime, ids, type, payType, shiroExtUtil.getUser().getObjectId()); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -266,13 +269,13 @@ String ids) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { @@ -353,19 +356,19 @@ String ids,String type) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - List<Map<String, Object>> list = taxiCardPaymentService.getList(page, beginTime, endTime, ids, type, null, null, null, null, ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> list = taxiCardPaymentService.getList(page, beginTime, endTime, ids, type, null, null, null, null, shiroExtUtil.getUser().getObjectId()); Map<String, Object> map = new HashMap<>(); map.put("id", "合计"); - map.put("payMoney", taxiCardPaymentService.getSumMoney(beginTime, endTime, ids, type, null, null, null, null, ShiroExtUtil.getUser().getObjectId())); + map.put("payMoney", taxiCardPaymentService.getSumMoney(beginTime, endTime, ids, type, null, null, null, null, shiroExtUtil.getUser().getObjectId())); list.add(map); - page.setRecords(list); + page.setRecords(list); return super.packForBT(page); } @@ -388,7 +391,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = taxiCardPaymentService.getListEx(beginTime, endTime, ids, type, null, null, null, null, ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> mapList = taxiCardPaymentService.getListEx(beginTime, endTime, ids, type, null, null, null, null, shiroExtUtil.getUser().getObjectId()); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -430,20 +433,20 @@ String ids) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { - List<Map<String, Object>> list = complaintDeductmoneyService.getList(page, beginTime, endTime, ids, null, null, null, ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> list = complaintDeductmoneyService.getList(page, beginTime, endTime, ids, null, null, null, shiroExtUtil.getUser().getObjectId()); Map<String, Object> map = new HashMap<>(); map.put("id", "合计"); - map.put("money", complaintDeductmoneyService.getSumMoney(beginTime, endTime, ids, null, null, null, ShiroExtUtil.getUser().getObjectId())); + map.put("money", complaintDeductmoneyService.getSumMoney(beginTime, endTime, ids, null, null, null, shiroExtUtil.getUser().getObjectId())); list.add(map); page.setRecords(list); } @@ -470,7 +473,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = complaintDeductmoneyService.getListEx(beginTime, endTime, ids, null, null, null, ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> mapList = complaintDeductmoneyService.getListEx(beginTime, endTime, ids, null, null, null, shiroExtUtil.getUser().getObjectId()); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -521,13 +524,13 @@ String ids) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SellingCarController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SellingCarController.java index 217b221..11d98d7 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SellingCarController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SellingCarController.java @@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.*; @@ -47,26 +48,30 @@ @Autowired private ITRegionService regionService; - + @Autowired private ITUserService userService; - + @Autowired private ITDriverService driverService; - + @Autowired private ITCompanyService companyService; - - + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转到列表页 + * * @return */ @GetMapping("/showSellingCarList") - public String showSellingCarList(Model model){ + public String showSellingCarList(Model model) { List<TCarBrand> state = carBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); model.addAttribute("carBrand", state); - model.addAttribute("userType", ShiroExtUtil.getUser().getRoleType()); + model.addAttribute("userType", shiroExtUtil.getUser().getRoleType()); return PREFIX + "sellingCar.html"; } @@ -76,8 +81,8 @@ * @return */ @GetMapping("/sellingCar_add") - public String sellingCar_add(Model model){ - model.addAttribute("push", ShiroExtUtil.getUser().getRoleType() == 1 ? true : false); + public String sellingCar_add(Model model) { + model.addAttribute("push", shiroExtUtil.getUser().getRoleType() == 1 ? true : false); List<TCarBrand> state = carBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); model.addAttribute("carBrand", state); List<TRegion> regions = regionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); @@ -94,13 +99,13 @@ * @return */ @GetMapping("/sellingCar_update") - public String sellingCar_update(Model model, Integer id){ + public String sellingCar_update(Model model, Integer id) { SellingCar sellingCar = sellingCarService.selectById(id); model.addAttribute("item", sellingCar); model.addAttribute("imgs", sellingCar.getImgUrl().split(",")); model.addAttribute("videos", sellingCar.getVideoUrl().split(",")); model.addAttribute("describeImgs", sellingCar.getDescribeImgUrl().split(",")); - model.addAttribute("push", ShiroExtUtil.getUser().getRoleType() == 1 ? true : false); + model.addAttribute("push", shiroExtUtil.getUser().getRoleType() == 1 ? true : false); List<TCarBrand> state = carBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); model.addAttribute("carBrand", state); List<TRegion> regions = regionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SpendingDetailPlatformController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SpendingDetailPlatformController.java index e4a19e3..e7198d4 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SpendingDetailPlatformController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SpendingDetailPlatformController.java @@ -6,7 +6,6 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.DateUtil; import com.stylefeng.guns.core.util.ExcelUtil; import com.stylefeng.guns.core.util.ToolUtil; @@ -19,10 +18,10 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.OutputStream; import java.math.BigDecimal; -import java.math.RoundingMode; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; @@ -76,17 +75,20 @@ @Autowired private ITOrderLogisticsService orderLogisticsService; - + @Autowired private ITSysWithdrawalPoundageService withdrawalPoundageService; - + @Autowired private ITTimeoutAppealService timeoutAppealService; - + @Autowired private ITReassignService reassignService; - - + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转订单收益明细 */ @@ -94,8 +96,8 @@ public String index() { return PREFIX + "orderRevenueDetails.html"; } - - + + /** * 跳转到奖励收益明细 */ @@ -1092,7 +1094,7 @@ */ @RequestMapping(value = "/detail/{driverId}") public String detail(@PathVariable Integer driverId, Model model){ - Map<String, Object> map = driverService.selectMap(new EntityWrapper<TDriver>().eq("id", driverId).eq("companyId", ShiroExtUtil.getUser().getObjectId())); + Map<String, Object> map = driverService.selectMap(new EntityWrapper<TDriver>().eq("id", driverId).eq("companyId", shiroExtUtil.getUser().getObjectId())); double activityIncome; Wrapper wrapper1 = new EntityWrapper<Income>().eq("userType",2).eq("objectId",driverId).eq("type",1); @@ -1196,17 +1198,17 @@ @ResponseBody public Object list(String driverName, String driverPhone, String startTime, String endTime) { Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - Wrapper wrapper = new EntityWrapper<TDriver>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).orderBy("id", false); - + Wrapper wrapper = new EntityWrapper<TDriver>().eq("companyId", shiroExtUtil.getUser().getObjectId()).orderBy("id", false); + if (ToolUtil.isNotEmpty(driverName)) { wrapper.like("name", driverName); } if (ToolUtil.isNotEmpty(driverPhone)) { wrapper.like("phone", driverPhone); } - + List<Map<String, Object>> list = driverService.selectMapsPage(page, wrapper).getRecords(); - + for (Map<String, Object> map : list) { /// 活动收益 diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java index 79741ac..0b242eb 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponActivityController.java @@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.*; /** @@ -38,18 +39,21 @@ @Controller @RequestMapping("/sysCouponActivity") public class SysCouponActivityController extends BaseController { - + private String PREFIX = "/system/sysCouponActivity/"; - + @Autowired private ISysCouponActivityService sysCouponActivityService; - + @Autowired private ITUserService userService; - + @Autowired private ISysCouponRecordService couponRecordService; - + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转到首页 */ @@ -57,7 +61,7 @@ public String index() { return PREFIX + "sysCouponActivity.html"; } - + /** * 跳转到选择优惠券页面 * @return @@ -119,7 +123,7 @@ } if(SinataUtil.isNotEmpty(couponUseType)){wrapper.eq("couponUseType",couponUseType);} if(SinataUtil.isNotEmpty(status)){wrapper.eq("status",status);} - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); if(user.getRoleType()!=1){ wrapper.eq("companyId",user.getObjectId()); wrapper.eq("companyType",user.getRoleType()); @@ -142,8 +146,8 @@ sysCouponActivity.setFullMoney(sysCouponRecord.getFullMoney()); sysCouponActivity.setInsertTime(new Date()); sysCouponActivity.setCouponId(activityId); - sysCouponActivity.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - sysCouponActivity.setCompanyType(ShiroExtUtil.getUser().getRoleType()); + sysCouponActivity.setCompanyId(shiroExtUtil.getUser().getObjectId()); + sysCouponActivity.setCompanyType(shiroExtUtil.getUser().getRoleType()); sysCouponActivity.setStatus(sysCouponActivity.getCompanyType() == 1 ? 3 : 1); sysCouponActivityService.insert(sysCouponActivity); if (sysCouponActivity.getCompanyType() == 1) { @@ -257,8 +261,8 @@ sysCouponActivity.setFullMoney(sysCouponRecord.getFullMoney()); sysCouponActivity.setInsertTime(new Date()); sysCouponActivity.setCouponId(activityId); - sysCouponActivity.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - sysCouponActivity.setCompanyType(ShiroExtUtil.getUser().getRoleType()); + sysCouponActivity.setCompanyId(shiroExtUtil.getUser().getObjectId()); + sysCouponActivity.setCompanyType(shiroExtUtil.getUser().getRoleType()); sysCouponActivity.setStatus(sysCouponActivity.getCompanyType() == 1 ? 3 : 1); sysCouponActivityService.updateById(sysCouponActivity); return SUCCESS_TIP; diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java index 47503ad..3409867 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysCouponRecordController.java @@ -6,24 +6,21 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; - -import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.SysRedPacketRecord; -import com.stylefeng.guns.modular.system.util.DateUtil; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; +import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.SysCouponRecord; import com.stylefeng.guns.modular.system.service.ISysCouponRecordService; +import com.stylefeng.guns.modular.system.util.DateUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; -import java.util.Map; /** * 控制器 @@ -34,21 +31,24 @@ @Controller @RequestMapping("/sysCouponRecord") public class SysCouponRecordController extends BaseController { - - private String PREFIX = "/system/sysCouponRecord/"; - - @Autowired - private ISysCouponRecordService sysCouponRecordService; - - /** - * 跳转到首页 - */ - @RequestMapping("") - public String index(Model model) { - model.addAttribute("jumpType",1); - model.addAttribute("num",0); - return PREFIX + "sysCouponRecord.html"; - } + + private String PREFIX = "/system/sysCouponRecord/"; + + @Autowired + private ISysCouponRecordService sysCouponRecordService; + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** + * 跳转到首页 + */ + @RequestMapping("") + public String index(Model model) { + model.addAttribute("jumpType", 1); + model.addAttribute("num", 0); + return PREFIX + "sysCouponRecord.html"; + } /** * 跳转到添加 @@ -75,29 +75,29 @@ @RequestMapping(value = "/list") @ResponseBody public Object list(String createTime,Integer couponUseType,Integer couponType) { - - Date startTimes = null; - Date endTimes = null; - if (SinataUtil.isNotEmpty(createTime)){ - String[] timeArray = createTime.split(" - "); - startTimes = DateUtil.getDate_str3(timeArray[0]+" 00:00:00"); - endTimes = DateUtil.getDate_str3(timeArray[1]+" 23:59:59"); - } - Page<SysCouponRecord> page = new PageFactory<SysCouponRecord>().defaultPage(); - Wrapper wrapper = new EntityWrapper<SysCouponRecord>(); - if (SinataUtil.isNotEmpty(createTime)) { - wrapper.between("insertTime", startTimes, endTimes); - } - if (SinataUtil.isNotEmpty(couponUseType)) { - wrapper.eq("couponUseType", couponUseType); - } - if (SinataUtil.isNotEmpty(couponType)) { - wrapper.eq("couponType", couponType); - } - wrapper.eq("companyId", ShiroExtUtil.getUser().getObjectId()); - wrapper.eq("companyType", ShiroExtUtil.getUser().getRoleType()); - wrapper.orderBy("id", false); - return super.packForBT(sysCouponRecordService.selectPage(page, wrapper)); + + Date startTimes = null; + Date endTimes = null; + if (SinataUtil.isNotEmpty(createTime)) { + String[] timeArray = createTime.split(" - "); + startTimes = DateUtil.getDate_str3(timeArray[0] + " 00:00:00"); + endTimes = DateUtil.getDate_str3(timeArray[1] + " 23:59:59"); + } + Page<SysCouponRecord> page = new PageFactory<SysCouponRecord>().defaultPage(); + Wrapper wrapper = new EntityWrapper<SysCouponRecord>(); + if (SinataUtil.isNotEmpty(createTime)) { + wrapper.between("insertTime", startTimes, endTimes); + } + if (SinataUtil.isNotEmpty(couponUseType)) { + wrapper.eq("couponUseType", couponUseType); + } + if (SinataUtil.isNotEmpty(couponType)) { + wrapper.eq("couponType", couponType); + } + wrapper.eq("companyId", shiroExtUtil.getUser().getObjectId()); + wrapper.eq("companyType", shiroExtUtil.getUser().getRoleType()); + wrapper.orderBy("id", false); + return super.packForBT(sysCouponRecordService.selectPage(page, wrapper)); } /** @@ -106,11 +106,11 @@ @RequestMapping(value = "/add") @ResponseBody public Object add(SysCouponRecord sysCouponRecord) { - sysCouponRecord.setInsertTime(new Date()); - sysCouponRecord.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - sysCouponRecord.setCompanyType(ShiroExtUtil.getUser().getRoleType()); - sysCouponRecordService.insert(sysCouponRecord); - return SUCCESS_TIP; + sysCouponRecord.setInsertTime(new Date()); + sysCouponRecord.setCompanyId(shiroExtUtil.getUser().getObjectId()); + sysCouponRecord.setCompanyType(shiroExtUtil.getUser().getRoleType()); + sysCouponRecordService.insert(sysCouponRecord); + return SUCCESS_TIP; } /** diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysRedPacketRecordController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysRedPacketRecordController.java index f59cc05..31067d8 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysRedPacketRecordController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/SysRedPacketRecordController.java @@ -6,22 +6,21 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; -import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.util.DateUtil; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; +import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.SysRedPacketRecord; import com.stylefeng.guns.modular.system.service.ISysRedPacketRecordService; +import com.stylefeng.guns.modular.system.util.DateUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; -import java.util.Map; /** * 控制器 @@ -32,12 +31,16 @@ @Controller @RequestMapping("/sysRedPacketRecord") public class SysRedPacketRecordController extends BaseController { - + private String PREFIX = "/system/sysRedPacketRecord/"; - + @Autowired private ISysRedPacketRecordService sysRedPacketRecordService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转到首页 */ @@ -45,7 +48,7 @@ public String index() { return PREFIX + "sysRedPacketRecord.html"; } - + /** * 跳转到添加 */ @@ -83,8 +86,8 @@ if (SinataUtil.isNotEmpty(createTime)) { wrapper.between("insertTime", startTimes, endTimes); } - wrapper.eq("companyId", ShiroExtUtil.getUser().getObjectId()); - wrapper.eq("companyType", ShiroExtUtil.getUser().getRoleType()); + wrapper.eq("companyId", shiroExtUtil.getUser().getObjectId()); + wrapper.eq("companyType", shiroExtUtil.getUser().getRoleType()); wrapper.orderBy("id", false); return super.packForBT(sysRedPacketRecordService.selectPage(page, wrapper)); } @@ -96,8 +99,8 @@ @ResponseBody public Object add(SysRedPacketRecord sysRedPacketRecord) { sysRedPacketRecord.setInsertTime(new Date()); - sysRedPacketRecord.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - sysRedPacketRecord.setCompanyType(ShiroExtUtil.getUser().getRoleType()); + sysRedPacketRecord.setCompanyId(shiroExtUtil.getUser().getObjectId()); + sysRedPacketRecord.setCompanyType(shiroExtUtil.getUser().getRoleType()); sysRedPacketRecordService.insert(sysRedPacketRecord); return SUCCESS_TIP; } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdditionalFeeController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdditionalFeeController.java index 0ea1f3b..fe516f4 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdditionalFeeController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdditionalFeeController.java @@ -6,7 +6,6 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.DateUtil; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.model.TAdditionalFee; @@ -16,24 +15,29 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; + @Controller @RequestMapping("/tAdditionalFee") public class TAdditionalFeeController extends BaseController { - + private String PREFIX = "/system/tAdditionalFee/"; - + @Autowired private ITAdditionalFeeService additionalFeeService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + @RequestMapping("") - public String index(){ + public String index() { return PREFIX + "tAdditionalFee.html"; } - + /// 跳转添加 @RequestMapping("/tAdditionalFee_add") - public String tAdditionalFee_add(){ + public String tAdditionalFee_add() { return PREFIX + "tAdditionalFee_add.html"; } @@ -69,7 +73,7 @@ @RequestMapping("/add") @ResponseBody public Object add(TAdditionalFee additionalFee){ - Integer companyId = ShiroExtUtil.getUser().getObjectId(); + Integer companyId = shiroExtUtil.getUser().getObjectId(); additionalFee.setCreateTime(DateUtil.parseTime(DateUtil.getTime())); additionalFee.setState(1); additionalFee.setCompanyId(companyId); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdvertisementController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdvertisementController.java index 73afba4..8ccddba 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdvertisementController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAdvertisementController.java @@ -1,27 +1,25 @@ package com.stylefeng.guns.modular.system.controller.general; import com.baomidou.mybatisplus.mapper.EntityWrapper; -import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.plugins.Page; import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; -import com.stylefeng.guns.core.util.DateUtil; +import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.util.SinataUtil; +import com.stylefeng.guns.modular.system.model.TAdvertisement; import com.stylefeng.guns.modular.system.model.TRegion; +import com.stylefeng.guns.modular.system.service.ITAdvertisementService; import com.stylefeng.guns.modular.system.service.ITRegionService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TAdvertisement; -import com.stylefeng.guns.modular.system.service.ITAdvertisementService; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; import java.util.List; import java.util.Map; @@ -35,15 +33,18 @@ @Controller @RequestMapping("/tAdvertisement") public class TAdvertisementController extends BaseController { - + private String PREFIX = "/system/tAdvertisement/"; - + @Autowired private ITAdvertisementService tAdvertisementService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + @Autowired private ITRegionService tRegionService; - + /** * 跳转到广告设置首页 */ @@ -103,7 +104,7 @@ @ResponseBody public Object add(TAdvertisement tAdvertisement) { tAdvertisement.setInsertTime(new Date()); - tAdvertisement.setInsertUser(ShiroExtUtil.getUser().getId()); + tAdvertisement.setInsertUser(shiroExtUtil.getUser().getId()); tAdvertisementService.insert(tAdvertisement); return SUCCESS_TIP; } @@ -125,14 +126,14 @@ @ResponseBody public Object opt(@RequestParam Integer tAdvertisementId,@RequestParam Integer optType) { TAdvertisement tAdvertisement = tAdvertisementService.selectById(tAdvertisementId); - if (SinataUtil.isNotEmpty(tAdvertisement)){ - if (1 == optType.intValue()){ //上线 + if (SinataUtil.isNotEmpty(tAdvertisement)) { + if (1 == optType.intValue()) { //上线 tAdvertisement.setState(1); - }else if (2 == optType.intValue()){ //下线 + } else if (2 == optType.intValue()) { //下线 tAdvertisement.setState(2); } tAdvertisement.setUpdateTime(new Date()); - tAdvertisement.setUpdateUser(ShiroExtUtil.getUser().getId()); + tAdvertisement.setUpdateUser(shiroExtUtil.getUser().getId()); tAdvertisementService.updateById(tAdvertisement); } return SUCCESS_TIP; @@ -145,7 +146,7 @@ @ResponseBody public Object update(TAdvertisement tAdvertisement) { tAdvertisement.setUpdateTime(new Date()); - tAdvertisement.setUpdateUser(ShiroExtUtil.getUser().getId()); + tAdvertisement.setUpdateUser(shiroExtUtil.getUser().getId()); tAdvertisementService.updateById(tAdvertisement); return SUCCESS_TIP; } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgreementController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgreementController.java index 42b939b..7d8fd69 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgreementController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TAgreementController.java @@ -3,22 +3,21 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; +import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.util.DateUtil; import com.stylefeng.guns.core.util.ToolUtil; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.TAgreement; import com.stylefeng.guns.modular.system.service.ITAgreementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; -import java.util.List; /** * 用户端协议管理控制器 @@ -29,12 +28,15 @@ @Controller @RequestMapping("/tAgreement") public class TAgreementController extends BaseController { - + private String PREFIX = "/system/tAgreement/"; - + @Autowired private ITAgreementService tAgreementService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到用户端协议管理首页 */ @@ -211,7 +213,7 @@ TAgreement agreement = tAgreementService.selectById(id); agreement.setContent(context); agreement.setUpdateTime(new Date()); - agreement.setUpdateUser(ShiroExtUtil.getUser().getId()); + agreement.setUpdateUser(shiroExtUtil.getUser().getId()); tAgreementService.updateById(agreement); return SUCCESS_TIP; } @@ -350,31 +352,31 @@ @RequestMapping(value = "/addOrUpdateIntimateAgreement") @ResponseBody public Object addOrUpdateIntimateAgreement(TAgreement tAgreement) { - if (tAgreement.getId() == 0){ + if (tAgreement.getId() == 0) { tAgreement.setId(null); - tAgreement.setInsertUser(ShiroExtUtil.getUser().getName()); + tAgreement.setInsertUser(shiroExtUtil.getUser().getName()); tAgreement.setUseType(1); tAgreement.setType(16); tAgreement.setFlag("1"); tAgreement.setInsertTime(DateUtil.parseTime(DateUtil.getTime())); - tAgreement.setUpdateUser(ShiroExtUtil.getUser().getId()); - + tAgreement.setUpdateUser(shiroExtUtil.getUser().getId()); + /// 过滤富文本的特殊字符 String content = tAgreement.getContent(); content = content.replaceAll("& lt;", "<").replaceAll("& gt;", ">"); - + content = content.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;"); tAgreement.setContent(content); tAgreementService.insert(tAgreement); }else { - tAgreement.setUpdateUser(ShiroExtUtil.getUser().getId()); + tAgreement.setUpdateUser(shiroExtUtil.getUser().getId()); tAgreement.setUpdateTime(DateUtil.parseTime(DateUtil.getTime())); tAgreement.setFlag("2"); - + /// 过滤富文本的特殊字符 String content = tAgreement.getContent(); content = content.replaceAll("& lt;", "<").replaceAll("& gt;", ">"); - + content = content.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;"); tAgreement.setContent(content); tAgreementService.updateById(tAgreement); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java index 5099a2d..041d445 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCarController.java @@ -7,7 +7,6 @@ import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; import com.stylefeng.guns.core.log.LogObjectHolder; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.DateUtil; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.core.util.WoUtil; @@ -75,19 +74,22 @@ @Autowired private ITCarServiceService itCarServiceService; - + @Autowired private ITServerCarmodelService itServerCarmodelService; - + @Autowired private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - + @Resource private CarInsuranceMapper carInsuranceMapper; - + @Resource + private ShiroExtUtil shiroExtUtil; + + @Value("${pushMinistryOfTransport}") private boolean pushMinistryOfTransport; - + /** * 跳转到车辆管理首页 */ @@ -104,16 +106,16 @@ List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).eq("state", 0).ne("flag", 3)); model.addAttribute("companyList", companyList); - Integer roleType = ShiroExtUtil.getUser().getRoleType(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); model.addAttribute("roleType", roleType); if (2 == roleType) { - List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", ShiroExtUtil.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); + List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", shiroExtUtil.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); model.addAttribute("franchiseeList", franchiseeList); } else { model.addAttribute("franchiseeList", null); } //查询当前用户所属分公司/加盟商 - model.addAttribute("objectName", tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()).getName()); + model.addAttribute("objectName", tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()).getName()); //车辆品牌 List<TCarBrand> brandList = tCarBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); @@ -153,9 +155,9 @@ model.addAttribute("item", tCar); LogObjectHolder.me().set(tCar); - Integer roleType = ShiroExtUtil.getUser().getRoleType(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); model.addAttribute("roleType", roleType); - model.addAttribute("objectName", tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()).getName()); + model.addAttribute("objectName", tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()).getName()); if (1 == roleType) { List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).eq("state", 0).ne("flag", 3)); @@ -163,7 +165,7 @@ List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", tCar.getCompanyId()).eq("state", 0).ne("flag", 3)); model.addAttribute("franchiseeList", franchiseeList); } else if (2 == roleType) { - List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", ShiroExtUtil.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); + List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", shiroExtUtil.getUser().getObjectId()).eq("state", 0).ne("flag", 3)); model.addAttribute("franchiseeList", franchiseeList); } @@ -384,7 +386,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tCarService.getCarList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, id, brandName, modelName, carColor, serverStr, carLicensePlate, driverName, companyName, franchiseeName)); + page.setRecords(tCarService.getCarList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, id, brandName, modelName, carColor, serverStr, carLicensePlate, driverName, companyName, franchiseeName)); return super.packForBT(page); } @@ -410,26 +412,26 @@ tCar.setAddType(2); tCar.setIsPlatCar(1); } else if (2 == roleType) { //分公司 - if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { - tCar.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { + tCar.setCompanyId(shiroExtUtil.getUser().getObjectId()); } if (SinataUtil.isNotEmpty(franchiseeId)) { tCar.setFranchiseeId(franchiseeId); } tCar.setIsPlatCar(2); tCar.setAddType(3); - tCar.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); + tCar.setAddObjectId(shiroExtUtil.getUser().getObjectId()); } else if (3 == roleType) { //加盟商 - TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); + TCompany tCompany = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); if (SinataUtil.isNotEmpty(tCompany)) { tCar.setCompanyId(tCompany.getSuperiorId()); } - if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { - tCar.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { + tCar.setFranchiseeId(shiroExtUtil.getUser().getObjectId()); } tCar.setIsPlatCar(2); tCar.setAddType(4); - tCar.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); + tCar.setAddObjectId(shiroExtUtil.getUser().getObjectId()); } tCar.setInsertTime(new Date()); tCar.setState(1); @@ -510,19 +512,19 @@ tCar.setFranchiseeId(0); } } else if (2 == roleType) { //分公司 - if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { - tCar.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { + tCar.setCompanyId(shiroExtUtil.getUser().getObjectId()); } if (SinataUtil.isNotEmpty(franchiseeId)) { tCar.setFranchiseeId(franchiseeId); } } else if (3 == roleType) { //加盟商 - TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); + TCompany tCompany = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); if (SinataUtil.isNotEmpty(tCompany)) { tCar.setCompanyId(tCompany.getSuperiorId()); } - if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { - tCar.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { + tCar.setFranchiseeId(shiroExtUtil.getUser().getObjectId()); } } @@ -868,14 +870,14 @@ car.setCommercialInsuranceTime(DateUtil.parseDate(fifteen)); car.setInsertTime(new Date()); car.setState(1); - if (ShiroExtUtil.getUser().getRoleType() == 1) { + if (shiroExtUtil.getUser().getRoleType() == 1) { car.setAddType(2); - } else if (ShiroExtUtil.getUser().getRoleType() == 2) { + } else if (shiroExtUtil.getUser().getRoleType() == 2) { car.setAddType(3); - car.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); - } else if (ShiroExtUtil.getUser().getRoleType() == 3) { + car.setAddObjectId(shiroExtUtil.getUser().getObjectId()); + } else if (shiroExtUtil.getUser().getRoleType() == 3) { car.setAddType(4); - car.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); + car.setAddObjectId(shiroExtUtil.getUser().getObjectId()); } tCarService.insert(car); @@ -968,7 +970,7 @@ */ @RequestMapping(value = "/outCar") public void outCar(HttpServletRequest request, HttpServletResponse response) { - List<Map<String, Object>> listMap = tCarService.getCarListNoPage(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> listMap = tCarService.getCarListNoPage(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId()); // 表格数据【封装】 List<List<String>> dataList = new ArrayList<>(); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java index 1b474fe..48bd745 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyController.java @@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -57,25 +58,25 @@ @Autowired private ITTaxiCardService cardService; - - @Autowired - private ITCompanyCityService tCompanyCityService; - - @Autowired - private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - - @Autowired - private ISpellOrderRuleService spellOrderRuleService; - - @Value("${pushMinistryOfTransport}") - private boolean pushMinistryOfTransport; - - - - - /** - * 跳转到修改平台信息 - */ + + @Autowired + private ITCompanyCityService tCompanyCityService; + + @Autowired + private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; + + @Autowired + private ISpellOrderRuleService spellOrderRuleService; + @Resource + private ShiroExtUtil shiroExtUtil; + + @Value("${pushMinistryOfTransport}") + private boolean pushMinistryOfTransport; + + + /** + * 跳转到修改平台信息 + */ @RequestMapping("/admin_update") public String tCompanyUpdate(Model model) { TCompany tCompany = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type",1).notIn("flag",3)); @@ -127,13 +128,13 @@ */ @RequestMapping("/tCompany_addFranchisee") public String tCompany_addFranchisee(Model model) { - Integer roleType = ShiroExtUtil.getUser().getRoleType(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); if (1 == roleType){ //查询分公司 List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); model.addAttribute("companyList",companyList); }else if (2 == roleType){ - TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); + TCompany tCompany = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); model.addAttribute("company",tCompany); } model.addAttribute("roleType",roleType); @@ -196,7 +197,7 @@ model.addAttribute("item", tCompany); LogObjectHolder.me().set(tCompany); - Integer roleType = ShiroExtUtil.getUser().getRoleType(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); model.addAttribute("roleType", roleType); TCompany obj = tCompanyService.selectById(tCompany.getSuperiorId()); @@ -222,13 +223,13 @@ model.addAttribute("item", tCompany); LogObjectHolder.me().set(tCompany); - Integer roleType = ShiroExtUtil.getUser().getRoleType(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); if (1 == roleType) { //查询分公司 List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); model.addAttribute("companyList", companyList); } else if (2 == roleType) { - TCompany obj = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); + TCompany obj = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); model.addAttribute("company", obj); } model.addAttribute("roleType", roleType); @@ -319,10 +320,10 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() == 3) { + if (shiroExtUtil.getUser().getRoleType() == 3) { page.setRecords(null); } else { - page.setRecords(tCompanyService.getFranchiseeList(page, beginTime, endTime, name, account, principalName, principalPhone, serviceStr, state, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId())); + page.setRecords(tCompanyService.getFranchiseeList(page, beginTime, endTime, name, account, principalName, principalPhone, serviceStr, state, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId())); } return super.packForBT(page); } @@ -359,6 +360,7 @@ tCompany.setEnterCode(enterCode); tCompany.setType(2); //2:分公司 tCompany.setState(0); //0:正常 + tCompany.setFlag("1"); tCompany.setInsertTime(new Date()); tCompany.setUpdateTime(new Date()); tCompanyService.insert(tCompany); @@ -452,10 +454,11 @@ tCompany.setEnterCode(enterCode); tCompany.setType(3); //2:分公司 - if (ShiroExtUtil.getUser().getRoleType() == 2) { - tCompany.setSuperiorId(ShiroExtUtil.getUser().getObjectId()); + if (shiroExtUtil.getUser().getRoleType() == 2) { + tCompany.setSuperiorId(shiroExtUtil.getUser().getObjectId()); } tCompany.setState(0); //0:正常 + tCompany.setFlag("1"); tCompany.setInsertTime(new Date()); tCompanyService.insert(tCompany); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyWithdrawController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyWithdrawController.java index d381547..b7330b0 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyWithdrawController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TCompanyWithdrawController.java @@ -4,7 +4,6 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.log.LogObjectHolder; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.model.TCompanyWithdraw; import com.stylefeng.guns.modular.system.model.TEnterpriseWithdrawal; @@ -36,24 +35,26 @@ @Controller @RequestMapping("/tCompanyWithdraw") public class TCompanyWithdrawController extends BaseController { - + private String PREFIX = "/system/tCompanyWithdraw/"; - + @Autowired private ITCompanyWithdrawService tCompanyWithdrawService; - + @Resource private ITEnterpriseWithdrawalService enterpriseWithdrawalService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到首页 */ @RequestMapping("") public String index(Model model) { - Integer id = ShiroExtUtil.getUser().getObjectId(); + Integer id = shiroExtUtil.getUser().getObjectId(); List<TEnterpriseWithdrawal> companyId = enterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", id)); - if(companyId.size()>0){ - }else { + if (companyId.size() > 0) { + } else { model.addAttribute("money",0); } return PREFIX + "tCompanyWithdraw.html"; @@ -85,7 +86,7 @@ @RequestMapping(value = "/list") @ResponseBody public Object list(String createTime,Integer state) { - Integer id = ShiroExtUtil.getUser().getObjectId(); + Integer id = shiroExtUtil.getUser().getObjectId(); EntityWrapper<TCompanyWithdraw> withdrawEntityWrapper = new EntityWrapper<>(); String sTime=null; String eTime=null; @@ -114,13 +115,13 @@ @ResponseBody @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW) public Object add(Double money,String type,String remark) { - List<TEnterpriseWithdrawal> companyId = enterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + List<TEnterpriseWithdrawal> companyId = enterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", shiroExtUtil.getUser().getObjectId())); if (companyId.size() > 0) { } TCompanyWithdraw tCompanyWithdraw = new TCompanyWithdraw(); tCompanyWithdraw.setWithdrawMoney(new BigDecimal(money)); - tCompanyWithdraw.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - tCompanyWithdraw.setCreateId(ShiroExtUtil.getUser().getId()); + tCompanyWithdraw.setCompanyId(shiroExtUtil.getUser().getObjectId()); + tCompanyWithdraw.setCreateId(shiroExtUtil.getUser().getId()); tCompanyWithdraw.setCreateTime(new Date()); if ("提现".equals(type)) { tCompanyWithdraw.setType(1); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java index e4ed3d1..c6b6493 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TComplaintController.java @@ -4,26 +4,22 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TProblem; +import com.stylefeng.guns.modular.system.model.TComplaint; import com.stylefeng.guns.modular.system.model.TSystemNotice; +import com.stylefeng.guns.modular.system.service.ITComplaintService; import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TComplaint; -import com.stylefeng.guns.modular.system.service.ITComplaintService; +import org.springframework.web.bind.annotation.ResponseBody; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; +import javax.annotation.Resource; import java.util.Date; import java.util.Map; @@ -36,23 +32,25 @@ @Controller @RequestMapping("/tComplaint") public class TComplaintController extends BaseController { - + private String PREFIX = "/system/tComplaint/"; - + @Autowired private ITComplaintService tComplaintService; - + @Autowired private ITSystemNoticeService tSystemNoticeService; - + @Autowired private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - + + @Resource + private ShiroExtUtil shiroExtUtil; + @Value("${pushMinistryOfTransport}") private boolean pushMinistryOfTransport; - - - + + /** * 跳转到投诉列表首页 */ @@ -116,7 +114,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tComplaintService.getComplaintList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, userName, userPhone, driverPhone, isHandle, null)); + page.setRecords(tComplaintService.getComplaintList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, userName, userPhone, driverPhone, isHandle, null)); return super.packForBT(page); } @@ -127,18 +125,18 @@ @ResponseBody public Object immediately(@RequestParam Integer id,@RequestParam String handleResult) { TComplaint tComplaint = tComplaintService.selectById(id); - if(SinataUtil.isNotEmpty(tComplaint)){ + if(SinataUtil.isNotEmpty(tComplaint)) { tComplaint.setHandleResult(handleResult); - tComplaint.setHandleUserId(ShiroExtUtil.getUser().getId()); + tComplaint.setHandleUserId(shiroExtUtil.getUser().getId()); tComplaint.setIsHandle(1); tComplaint.setHandleTime(new Date()); tComplaintService.updateById(tComplaint); - + //增加系统消息 TSystemNotice notice = new TSystemNotice(); notice.setType(2); notice.setUserType(1); - notice.setContent("投诉处理结果:【"+handleResult+"】。"); + notice.setContent("投诉处理结果:【" + handleResult + "】。"); notice.setUserId(tComplaint.getUserId()); notice.setInsertTime(new Date()); notice.setRead(1); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java index a29282d..78e019b 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java @@ -22,6 +22,7 @@ import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.*; import com.stylefeng.guns.modular.system.util.qianyuntong.EmployeeUtil; +import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil; import com.stylefeng.guns.modular.system.util.qianyuntong.model.*; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; @@ -96,6 +97,9 @@ @Autowired private IUserService userService; + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转投诉页面 * @@ -133,7 +137,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tComplaintService.getComplaintList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, userName, userPhone, driverPhone, isHandle, driverId)); + page.setRecords(tComplaintService.getComplaintList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, userName, userPhone, driverPhone, isHandle, driverId)); return super.packForBT(page); } /** @@ -160,12 +164,12 @@ List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); model.addAttribute("companyList", companyList); - Integer roleType = ShiroExtUtil.getUser().getRoleType(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); model.addAttribute("roleType", roleType); if (2 == roleType) { List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>() .eq("type", 3) - .eq("superiorId", ShiroExtUtil.getUser().getObjectId()) + .eq("superiorId", shiroExtUtil.getUser().getObjectId()) .notIn("state", 1) .notIn("flag", 3)); model.addAttribute("franchiseeList", franchiseeList); @@ -173,7 +177,7 @@ model.addAttribute("franchiseeList", null); } //查询当前用户所属分公司/加盟商 - model.addAttribute("objectName", tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()).getName()); + model.addAttribute("objectName", tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()).getName()); //查询线路列表 List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1)); @@ -239,9 +243,9 @@ model.addAttribute("item", tDriver); LogObjectHolder.me().set(tDriver); - Integer roleType = ShiroExtUtil.getUser().getRoleType(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); model.addAttribute("roleType", roleType); - model.addAttribute("objectName", tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()).getName()); + model.addAttribute("objectName", tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()).getName()); if (1 == roleType) { List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).ne("flag", 3)); @@ -249,7 +253,7 @@ List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", tDriver.getCompanyId())); model.addAttribute("franchiseeList", franchiseeList); } else if (2 == roleType) { - List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", ShiroExtUtil.getUser().getObjectId())); + List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId", shiroExtUtil.getUser().getObjectId())); model.addAttribute("franchiseeList", franchiseeList); } @@ -570,13 +574,13 @@ Integer authState) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tDriverService.getAuthDriverList(page, beginTime, endTime, companyName, phone, account, addType, authState)); @@ -603,7 +607,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tDriverService.getDriverList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, companyName, phone, name, addType, authState)); + page.setRecords(tDriverService.getDriverList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, companyName, phone, name, addType, authState)); return super.packForBT(page); } @@ -628,7 +632,7 @@ }*/ //2020-08-21:新需求,已被绑定的车辆可以被继续绑定 Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tDriverService.getCanSelectCarList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), null, carLicensePlate, brandName, modelName, color, serverStr)); + page.setRecords(tDriverService.getCanSelectCarList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), null, carLicensePlate, brandName, modelName, color, serverStr)); return super.packForBT(page); } @@ -668,26 +672,32 @@ System.out.println("司机注册审核发送短信 :【driverId=" + tDriver.getId().toString() + "】,调用接口:" + result); //审核通过,在中台添加司机账号 if (2 == tDriver.getAuthState()) { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); Integer objectId = user.getObjectId(); TCompany tCompany = itCompanyService.selectById(objectId); - User user1 = userService.selectById(user.getId()); - SaveStaffNodeRequest request = new SaveStaffNodeRequest(); - request.setMobile(user1.getPhone()); - request.setEntercode(tCompany.getEnterCode()); - request.setEmpName(tDriver.getName()); - request.setEmpNickname(tDriver.getName()); - request.setLoginNo(tDriver.getPhone()); - request.setEmpSex(tDriver.getSex() == 1 ? "男" : "女"); - request.setMphone(tDriver.getPhone()); - request.setEmail(tDriver.getPhone() + "@qyt.com"); - request.setDeptId(0); - request.setPositionId(1); - request.setSuperLevel(0); - request.setHideMobile(0); - SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); + List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); + Long empId = null; + if(null == userInfoByPhone || userInfoByPhone.size() == 0){ + SaveStaffNodeRequest request = new SaveStaffNodeRequest(); + request.setMobile(tCompany.getPrincipalPhone()); + request.setEntercode(tCompany.getEnterCode()); + request.setEmpName(tDriver.getName()); + request.setEmpNickname(tDriver.getName()); + request.setLoginNo(tDriver.getPhone()); + request.setEmpSex(tDriver.getSex() == 1 ? "男" : "女"); + request.setMphone(tDriver.getPhone()); + request.setEmail(tDriver.getPhone() + "@qyt.com"); + request.setDeptId(0); + request.setPositionId(1); + request.setSuperLevel(0); + request.setHideMobile(0); + SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); + empId = saveStaffNode.getEmpId(); + }else{ + empId = userInfoByPhone.get(0).getEmpId(); + } TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); - tDriver.setEmpId(saveStaffNode.getEmpId()); + tDriver.setEmpId(empId); tDriver.setEntercode(tCompany1.getEnterCode()); tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); } @@ -738,8 +748,8 @@ tDriver.setIsPlatCar(1); tDriver.setAuthState(2); }else if (2 == roleType) { //分公司 - if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { - tDriver.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { + tDriver.setCompanyId(shiroExtUtil.getUser().getObjectId()); } if (SinataUtil.isNotEmpty(franchiseeId)) { tDriver.setFranchiseeId(franchiseeId); @@ -747,47 +757,54 @@ tDriver.setAddType(3); tDriver.setIsPlatCar(2); tDriver.setAuthState(1); - tDriver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); + tDriver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); }else if (3 == roleType) { //加盟商 - TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); + TCompany tCompany = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); if (SinataUtil.isNotEmpty(tCompany)) { tDriver.setCompanyId(tCompany.getSuperiorId()); } - if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { - tDriver.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { + tDriver.setFranchiseeId(shiroExtUtil.getUser().getObjectId()); } tDriver.setAddType(4); tDriver.setIsPlatCar(2); tDriver.setAuthState(1); - tDriver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); + tDriver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); } tDriver.setInsertTime(new Date()); - tDriver.setInsertUser(ShiroExtUtil.getUser().getId()); + tDriver.setInsertUser(shiroExtUtil.getUser().getId()); // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); //审核通过,在中台添加司机账号 if (2 == tDriver.getAuthState()) { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); Integer objectId = user.getObjectId(); TCompany tCompany = itCompanyService.selectById(objectId); - User user1 = userService.selectById(user.getId()); - SaveStaffNodeRequest request = new SaveStaffNodeRequest(); - request.setMobile(user1.getPhone()); - request.setEntercode(tCompany.getEnterCode()); - request.setEmpName(tDriver.getName()); - request.setEmpNickname(tDriver.getName()); - request.setLoginNo(tDriver.getPhone()); - request.setEmpSex(tDriver.getSex() == 1 ? "男" : "女"); - request.setMphone(tDriver.getPhone()); - request.setEmail(tDriver.getPhone() + "@qyt.com"); - request.setDeptId(0); - request.setPositionId(1); - request.setSuperLevel(0); - request.setHideMobile(0); - SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); + List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); + Long empId = null; + if(null == userInfoByPhone || userInfoByPhone.size() == 0){ + SaveStaffNodeRequest request = new SaveStaffNodeRequest(); + request.setMobile(tCompany.getPrincipalPhone()); + request.setEntercode(tCompany.getEnterCode()); + request.setEmpName(tDriver.getName()); + request.setEmpNickname(tDriver.getName()); + request.setLoginNo(tDriver.getPhone()); + request.setEmpSex(tDriver.getSex() == 1 ? "男" : "女"); + request.setMphone(tDriver.getPhone()); + request.setEmail(tDriver.getPhone() + "@qyt.com"); + request.setDeptId(0); + request.setPositionId(1); + request.setSuperLevel(0); + request.setHideMobile(0); + SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); + empId = saveStaffNode.getEmpId(); + }else{ + empId = userInfoByPhone.get(0).getEmpId(); + } + TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); - tDriver.setEmpId(saveStaffNode.getEmpId()); + tDriver.setEmpId(empId); tDriver.setEntercode(tCompany1.getEnterCode()); tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); } @@ -840,25 +857,28 @@ public Object delete(@RequestParam Integer tDriverId) { TDriver driver = tDriverService.selectById(tDriverId); driver.setFlag("3"); - ShiroUser user = ShiroExtUtil.getUser(); - User user1 = userService.selectById(user.getId()); + ShiroUser user = shiroExtUtil.getUser(); TCompany tCompany = itCompanyService.selectById(user.getObjectId()); - //中台先删除司机 - GetStaffNodeRequest request = new GetStaffNodeRequest(); - request.setEmpId(driver.getEmpId()); - request.setMobile(user1.getPhone()); - request.setEntercode(tCompany.getEnterCode()); - StaffNodeInfo staffNode = EmployeeUtil.getStaffNode(request); - if (null != staffNode && "1".equals(staffNode.getIsValid())) { - DeleteStafNodeRequest deleteStafNodeRequest = new DeleteStafNodeRequest(); - deleteStafNodeRequest.setEmpId(driver.getEmpId()); - deleteStafNodeRequest.setEntercode(tCompany.getEnterCode()); - deleteStafNodeRequest.setMobile(user1.getPhone()); - EmployeeUtil.ecrmDeleteStafNode(deleteStafNodeRequest); + if (null != driver.getEmpId()) { + //中台先删除司机 + GetStaffNodeRequest request = new GetStaffNodeRequest(); + request.setEmpId(driver.getEmpId()); + request.setMobile(tCompany.getPrincipalPhone()); + request.setEntercode(tCompany.getEnterCode()); + StaffNodeInfo staffNode = EmployeeUtil.getStaffNode(request); + if (null != staffNode && "1".equals(staffNode.getIsValid())) { + DeleteStafNodeRequest deleteStafNodeRequest = new DeleteStafNodeRequest(); + deleteStafNodeRequest.setEmpId(driver.getEmpId()); + deleteStafNodeRequest.setEntercode(tCompany.getEnterCode()); + deleteStafNodeRequest.setMobile(tCompany.getPrincipalPhone()); + EmployeeUtil.ecrmDeleteStafNode(deleteStafNodeRequest); + } } tDriverService.updateById(driver); String value = (String) redisTemplate.opsForValue().get("DRIVER_" + driver.getPhone()); - redisTemplate.delete(value); + if (ToolUtil.isNotEmpty(value)) { + redisTemplate.delete(value); + } redisTemplate.delete("DRIVER_" + driver.getId()); redisTemplate.delete("DRIVER_" + driver.getPhone()); return SUCCESS_TIP; @@ -895,33 +915,42 @@ }).start(); String value = (String) redisTemplate.opsForValue().get("DRIVER_" + tDriver.getPhone()); - redisTemplate.delete(value); + if (ToolUtil.isNotEmpty(value)) { + redisTemplate.delete(value); + } redisTemplate.delete("DRIVER_" + tDriver.getId()); redisTemplate.delete("DRIVER_" + tDriver.getPhone()); } tDriver.setRemark(remark); //审核通过,在中台添加司机账号 - if (2 == tDriver.getAuthState()) { - ShiroUser user = ShiroExtUtil.getUser(); + if (2 == tDriver.getAuthState() && tDriver.getEmpId() == null) { + ShiroUser user = shiroExtUtil.getUser(); Integer objectId = user.getObjectId(); TCompany tCompany = itCompanyService.selectById(objectId); - User user1 = userService.selectById(user.getId()); - SaveStaffNodeRequest request = new SaveStaffNodeRequest(); - request.setMobile(user1.getPhone()); - request.setEntercode(tCompany.getEnterCode()); - request.setEmpName(tDriver.getName()); - request.setEmpNickname(tDriver.getName()); - request.setLoginNo(tDriver.getPhone()); - request.setEmpSex(tDriver.getSex() == 1 ? "男" : "女"); - request.setMphone(tDriver.getPhone()); - request.setEmail(tDriver.getPhone() + "@qyt.com"); - request.setDeptId(0); - request.setPositionId(1); - request.setSuperLevel(0); - request.setHideMobile(0); - SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); + List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(tDriver.getPhone(), tCompany.getEnterCode()); + Long empId = null; + if(null == userInfoByPhone || userInfoByPhone.size() == 0){ + SaveStaffNodeRequest request = new SaveStaffNodeRequest(); + request.setMobile(tCompany.getPrincipalPhone()); + request.setEntercode(tCompany.getEnterCode()); + request.setEmpName(tDriver.getName()); + request.setEmpNickname(tDriver.getName()); + request.setLoginNo(tDriver.getPhone()); + request.setEmpSex(tDriver.getSex() == 1 ? "男" : "女"); + request.setMphone(tDriver.getPhone()); + request.setEmail(tDriver.getPhone() + "@qyt.com"); + request.setDeptId(0); + request.setPositionId(1); + request.setSuperLevel(0); + request.setHideMobile(0); + SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); + empId = saveStaffNode.getEmpId(); + }else{ + empId = userInfoByPhone.get(0).getEmpId(); + } + TCompany tCompany1 = itCompanyService.selectById(tDriver.getCompanyId()); - tDriver.setEmpId(saveStaffNode.getEmpId()); + tDriver.setEmpId(empId); tDriver.setEntercode(tCompany1.getEnterCode()); tDriver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); } @@ -959,27 +988,27 @@ tDriver.setFranchiseeId(franchiseeId); } }else if (2 == roleType) { //分公司 - if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { - tDriver.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { + tDriver.setCompanyId(shiroExtUtil.getUser().getObjectId()); } if (SinataUtil.isNotEmpty(franchiseeId)) { tDriver.setFranchiseeId(franchiseeId); } - }else if (3 == roleType) { //加盟商 - TCompany tCompany = tCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); + } else if (3 == roleType) { //加盟商 + TCompany tCompany = tCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); if (SinataUtil.isNotEmpty(tCompany)) { tDriver.setCompanyId(tCompany.getSuperiorId()); } - if (SinataUtil.isNotEmpty(ShiroExtUtil.getUser().getObjectId())) { - tDriver.setFranchiseeId(ShiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(shiroExtUtil.getUser().getObjectId())) { + tDriver.setFranchiseeId(shiroExtUtil.getUser().getObjectId()); } } tDriver.setUpdateTime(new Date()); - tDriver.setUpdateUser(ShiroExtUtil.getUser().getId()); + tDriver.setUpdateUser(shiroExtUtil.getUser().getId()); // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); - if(ToolUtil.isEmpty(tDriver.getPassword())){ + if (ToolUtil.isEmpty(tDriver.getPassword())) { tDriver.setPassword(obj.getPassword()); - }else{ + } else { tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); } obj.setCompanyId(tDriver.getCompanyId()); @@ -1027,18 +1056,18 @@ obj.setEmergencyContactPhone(tDriver.getEmergencyContactPhone()); obj.setEmergencyContactAddress(tDriver.getEmergencyContactAddress()); obj.setUpdateTime(new Date()); - obj.setUpdateUser(ShiroExtUtil.getUser().getId()); + obj.setUpdateUser(shiroExtUtil.getUser().getId()); tDriverService.updateAllColumnById(obj); - + //删除业务 - tDriverServiceService.delete(new EntityWrapper<TDriverService>().eq("driverId",tDriver.getId())); - + tDriverServiceService.delete(new EntityWrapper<TDriverService>().eq("driverId", tDriver.getId())); + //删除线路 - tDriverLineService.delete(new EntityWrapper<TDriverLine>().eq("driverId",tDriver.getId())); - + tDriverLineService.delete(new EntityWrapper<TDriverLine>().eq("driverId", tDriver.getId())); + //添加经营业务 String[] serverArray = serverBox.split(","); - for (int i=0;i<serverArray.length;i++){ + for (int i = 0; i < serverArray.length; i++) { TDriverService service = new TDriverService(); service.setDriverId(tDriver.getId()); service.setType(Integer.valueOf(serverArray[i])); @@ -1073,12 +1102,12 @@ public void uploadDriverModel(HttpServletRequest request, HttpServletResponse response) { // 表格数据【封装】 List<List<String>> dataList = new ArrayList<List<String>>(); - + String title = ""; - + // 首行【封装】 List<String> shellList = new ArrayList<String>(); - if (ShiroExtUtil.getUser().getRoleType() == 1) { + if (shiroExtUtil.getUser().getRoleType() == 1) { title = "平台导入司机模板"; shellList.add("司机名称"); @@ -1100,7 +1129,7 @@ shellList.add("经营业务:包车[是/否]"); shellList.add("登录账号[手机号]"); shellList.add("登录密码[密码长度为6-18]"); - } else if (ShiroExtUtil.getUser().getRoleType() == 2) { + } else if (shiroExtUtil.getUser().getRoleType() == 2) { title = "分公司导入司机模板"; shellList.add("司机名称"); @@ -1120,7 +1149,7 @@ shellList.add("经营业务:包车[是/否]"); shellList.add("登录账号[手机号]"); shellList.add("登录密码[密码长度为6-18]"); - } else if (ShiroExtUtil.getUser().getRoleType() == 3) { + } else if (shiroExtUtil.getUser().getRoleType() == 3) { title = "加盟商导入司机模板"; shellList.add("司机名称"); @@ -1161,7 +1190,7 @@ MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); try { - if (ShiroExtUtil.getUser().getRoleType() == 1) { + if (shiroExtUtil.getUser().getRoleType() == 1) { Workbook book = WoUtil.ImportFile(file); Sheet sh = book.getSheetAt(0); //获取到第一个表 for (int i = 1; i <= sh.getLastRowNum(); i++) { @@ -1172,16 +1201,16 @@ if (SinataUtil.isNotEmpty(cell0)) { zero = String.valueOf(cell0.getStringCellValue()).trim(); } - + Cell cell1 = row.getCell(1); //所属机构[平台司机/加盟司机] String one = null; - if (SinataUtil.isNotEmpty(cell1)){ + if (SinataUtil.isNotEmpty(cell1)) { one = String.valueOf(cell1.getStringCellValue()).trim(); } - + Cell cell2 = row.getCell(2); //所属分公司[提示:加盟司机选填] String two = null; - if (SinataUtil.isNotEmpty(cell2)){ + if (SinataUtil.isNotEmpty(cell2)) { two = String.valueOf(cell2.getStringCellValue()).trim(); } @@ -1374,9 +1403,9 @@ driver.setDriverAge(Integer.valueOf(six)); driver.setDriveCard(five); driver.setTaxiAptitudeCard(nine); - if ("平台司机".equals(one)){ + if ("平台司机".equals(one)) { driver.setIsPlatCar(1); - }else if ("加盟司机".equals(one)){ + } else if ("加盟司机".equals(one)) { driver.setIsPlatCar(2); } driver.setCompanyId(companyId); @@ -1384,36 +1413,43 @@ driver.setState(2); driver.setAuthState(2); driver.setFlag("1"); - driver.setInsertUser(ShiroExtUtil.getUser().getId()); + driver.setInsertUser(shiroExtUtil.getUser().getId()); driver.setInsertTime(new Date()); driver.setAddType(2); - driver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); + driver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); if (SinataUtil.isNotEmpty(eight)) { driver.setDriverAddress(eight); } //审核通过,在中台添加司机账号 if (2 == driver.getAuthState()) { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); Integer objectId = user.getObjectId(); TCompany tCompany = itCompanyService.selectById(objectId); - User user1 = userService.selectById(user.getId()); - SaveStaffNodeRequest saveStaffNodeRequest = new SaveStaffNodeRequest(); - saveStaffNodeRequest.setMobile(user1.getPhone()); - saveStaffNodeRequest.setEntercode(tCompany.getEnterCode()); - saveStaffNodeRequest.setEmpName(driver.getName()); - saveStaffNodeRequest.setEmpNickname(driver.getName()); - saveStaffNodeRequest.setLoginNo(driver.getPhone()); - saveStaffNodeRequest.setEmpSex(driver.getSex() == 1 ? "男" : "女"); - saveStaffNodeRequest.setMphone(driver.getPhone()); - saveStaffNodeRequest.setEmail(driver.getPhone() + "@qyt.com"); - saveStaffNodeRequest.setDeptId(0); - saveStaffNodeRequest.setPositionId(1); - saveStaffNodeRequest.setSuperLevel(0); - saveStaffNodeRequest.setHideMobile(0); - SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(saveStaffNodeRequest); + List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(driver.getPhone(), tCompany.getEnterCode()); + Long empId = null; + if(null == userInfoByPhone || userInfoByPhone.size() == 0){ + SaveStaffNodeRequest saveStaffNodeRequest = new SaveStaffNodeRequest(); + saveStaffNodeRequest.setMobile(tCompany.getPrincipalPhone()); + saveStaffNodeRequest.setEntercode(tCompany.getEnterCode()); + saveStaffNodeRequest.setEmpName(driver.getName()); + saveStaffNodeRequest.setEmpNickname(driver.getName()); + saveStaffNodeRequest.setLoginNo(driver.getPhone()); + saveStaffNodeRequest.setEmpSex(driver.getSex() == 1 ? "男" : "女"); + saveStaffNodeRequest.setMphone(driver.getPhone()); + saveStaffNodeRequest.setEmail(driver.getPhone() + "@qyt.com"); + saveStaffNodeRequest.setDeptId(0); + saveStaffNodeRequest.setPositionId(1); + saveStaffNodeRequest.setSuperLevel(0); + saveStaffNodeRequest.setHideMobile(0); + SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(saveStaffNodeRequest); + empId = saveStaffNode.getEmpId(); + }else{ + empId = userInfoByPhone.get(0).getEmpId(); + } + TCompany tCompany1 = itCompanyService.selectById(driver.getCompanyId()); - driver.setEmpId(saveStaffNode.getEmpId()); + driver.setEmpId(empId); driver.setEntercode(tCompany1.getEnterCode()); driver.setEnterId(Long.valueOf(tCompany1.getEnterCode())); } @@ -1449,7 +1485,7 @@ itDriverServiceService.insert(service); } //添加小件跨城物流服务模式 - if ("是".equals(fifteen)){ + if ("是".equals(fifteen)) { TDriverService service = new TDriverService(); service.setDriverId(driver.getId()); service.setType(5); @@ -1464,7 +1500,7 @@ } } } - } else if (ShiroExtUtil.getUser().getRoleType() == 2) { + } else if (shiroExtUtil.getUser().getRoleType() == 2) { Workbook book = WoUtil.ImportFile(file); Sheet sh = book.getSheetAt(0); //获取到第一个表 for (int i = 1; i <= sh.getLastRowNum(); i++) { @@ -1475,16 +1511,16 @@ if (SinataUtil.isNotEmpty(cell0)) { zero = String.valueOf(cell0.getStringCellValue()).trim(); } - + Cell cell1 = row.getCell(1); //所属加盟商[选填] String one = null; - if (SinataUtil.isNotEmpty(cell1)){ + if (SinataUtil.isNotEmpty(cell1)) { one = String.valueOf(cell1.getStringCellValue()).trim(); } - + Cell cell2 = row.getCell(2); //性别[男/女] String two = null; - if (SinataUtil.isNotEmpty(cell2)){ + if (SinataUtil.isNotEmpty(cell2)) { two = String.valueOf(cell2.getStringCellValue()).trim(); } @@ -1616,24 +1652,24 @@ return new ErrorTip(500, "驾龄格式不正确"); } //判断手机号 - if (!isPhone(fifteen)){ + if (!isPhone(fifteen)) { return new ErrorTip(500, "登录账号[手机号]格式不正确"); } //判断登录密码 - if (!isPassword(sixteen)){ + if (!isPassword(sixteen)) { return new ErrorTip(500, "登录密码格式不正确"); } //查找平台公司 - Integer companyId = ShiroExtUtil.getUser().getObjectId(); + Integer companyId = shiroExtUtil.getUser().getObjectId(); Integer franchiseeId = 0; //判断所属分公司是否存在 - if (SinataUtil.isNotEmpty(one)){ - TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",companyId).eq("name", one).eq("type", 3).notIn("flag", "3").last(" limit 1")); - if (SinataUtil.isNotEmpty(franchisee)){ + if (SinataUtil.isNotEmpty(one)) { + TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId", companyId).eq("name", one).eq("type", 3).notIn("flag", "3").last(" limit 1")); + if (SinataUtil.isNotEmpty(franchisee)) { franchiseeId = franchisee.getId(); } } - + TDriver driver = new TDriver(); driver.setAccount(fifteen); driver.setJobNumber(eight); @@ -1655,17 +1691,17 @@ driver.setState(1); driver.setAuthState(1); driver.setFlag("1"); - driver.setInsertUser(ShiroExtUtil.getUser().getId()); + driver.setInsertUser(shiroExtUtil.getUser().getId()); driver.setInsertTime(new Date()); driver.setAddType(3); - driver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); - if (SinataUtil.isNotEmpty(six)){ + driver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(six)) { driver.setDriverAddress(six); } tDriverService.insert(driver); - + //添加快车服务模式 - if ("是".equals(nine)){ + if ("是".equals(nine)) { TDriverService service = new TDriverService(); service.setDriverId(driver.getId()); service.setType(1); @@ -1693,7 +1729,7 @@ itDriverServiceService.insert(service); } //添加小件跨城物流服务模式 - if ("是".equals(thirteen)){ + if ("是".equals(thirteen)) { TDriverService service = new TDriverService(); service.setDriverId(driver.getId()); service.setType(5); @@ -1709,7 +1745,7 @@ } } - } else if (ShiroExtUtil.getUser().getRoleType() == 3) { + } else if (shiroExtUtil.getUser().getRoleType() == 3) { Workbook book = WoUtil.ImportFile(file); Sheet sh = book.getSheetAt(0); //获取到第一个表 for (int i = 1; i <= sh.getLastRowNum(); i++) { @@ -1720,16 +1756,16 @@ if (SinataUtil.isNotEmpty(cell0)) { zero = String.valueOf(cell0.getStringCellValue()).trim(); } - + Cell cell2 = row.getCell(1); //性别[男/女] String one = null; - if (SinataUtil.isNotEmpty(cell2)){ + if (SinataUtil.isNotEmpty(cell2)) { one = String.valueOf(cell2.getStringCellValue()).trim(); } - + Cell cell3 = row.getCell(2); //驾驶证号码 String two = null; - if (SinataUtil.isNotEmpty(cell3)){ + if (SinataUtil.isNotEmpty(cell3)) { two = String.valueOf(cell3.getStringCellValue()).trim(); } @@ -1855,25 +1891,25 @@ return new ErrorTip(500, "驾龄格式不正确"); } //判断手机号 - if (!isPhone(fourteen)){ + if (!isPhone(fourteen)) { return new ErrorTip(500, "登录账号[手机号]格式不正确"); } //判断登录密码 - if (!isPassword(fifteen)){ + if (!isPassword(fifteen)) { return new ErrorTip(500, "登录密码格式不正确"); } //查找平台公司 Integer companyId = 0; Integer franchiseeId = 0; - TCompany franchisee = itCompanyService.selectById(ShiroExtUtil.getUser().getObjectId()); - if (SinataUtil.isNotEmpty(franchisee)){ + TCompany franchisee = itCompanyService.selectById(shiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(franchisee)) { companyId = franchisee.getSuperiorId(); franchiseeId = franchisee.getId(); } - if (companyId == 0 && franchiseeId == 0){ + if (companyId == 0 && franchiseeId == 0) { return new ErrorTip(500, "当前登录账户上级分公司不能为空"); } - + TDriver driver = new TDriver(); driver.setAccount(fourteen); driver.setJobNumber(seven); @@ -1895,17 +1931,17 @@ driver.setState(1); driver.setAuthState(1); driver.setFlag("1"); - driver.setInsertUser(ShiroExtUtil.getUser().getId()); + driver.setInsertUser(shiroExtUtil.getUser().getId()); driver.setInsertTime(new Date()); driver.setAddType(4); - driver.setAddObjectId(ShiroExtUtil.getUser().getObjectId()); - if (SinataUtil.isNotEmpty(five)){ + driver.setAddObjectId(shiroExtUtil.getUser().getObjectId()); + if (SinataUtil.isNotEmpty(five)) { driver.setDriverAddress(five); } tDriverService.insert(driver); - + //添加快车服务模式 - if ("是".equals(eight)){ + if ("是".equals(eight)) { TDriverService service = new TDriverService(); service.setDriverId(driver.getId()); service.setType(1); @@ -2007,7 +2043,7 @@ */ @RequestMapping(value = "/outDriver") public void outDriver(HttpServletRequest request, HttpServletResponse response) { - List<Map<String, Object>> listMap = tDriverService.getDriverListNoPage(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> listMap = tDriverService.getDriverListNoPage(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId()); // 表格数据【封装】 List<List<String>> dataList = new ArrayList<>(); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TEnterpriseWithdrawalController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TEnterpriseWithdrawalController.java index f0ed4e4..7814035 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TEnterpriseWithdrawalController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TEnterpriseWithdrawalController.java @@ -4,7 +4,6 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.log.LogObjectHolder; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.controller.util.Base64Util; import com.stylefeng.guns.modular.system.model.TBank; @@ -38,24 +37,27 @@ @Controller @RequestMapping("/tEnterpriseWithdrawal") public class TEnterpriseWithdrawalController extends BaseController { - + private String PREFIX = "/system/tEnterpriseWithdrawal/"; - + @Autowired private ITEnterpriseWithdrawalService tEnterpriseWithdrawalService; - + @Autowired private ITBankService bankService; - + @Autowired private ITBankNextService bankNextService; + + @Resource + private ShiroExtUtil shiroExtUtil; /** * 跳转到首页 */ @RequestMapping("") public String index(Model model) { - TEnterpriseWithdrawal companyId = tEnterpriseWithdrawalService.selectOne(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TEnterpriseWithdrawal companyId = tEnterpriseWithdrawalService.selectOne(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", shiroExtUtil.getUser().getObjectId())); if (companyId != null) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); model.addAttribute("item", companyId); @@ -138,7 +140,7 @@ @Transactional(readOnly = false,propagation = Propagation.REQUIRED,rollbackFor = Exception.class) public Object add(TEnterpriseWithdrawal tEnterpriseWithdrawal,Integer accountType,String code,String businessExpireTimeOne,String unifiedSocialCreditCodeExpireTimeOne,String certificateExpireTimeOne) { tEnterpriseWithdrawal.setCode(code); - List<TEnterpriseWithdrawal> companyId = tEnterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + List<TEnterpriseWithdrawal> companyId = tEnterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", shiroExtUtil.getUser().getObjectId())); if(companyId.size()>0){ return "5001"; } @@ -148,23 +150,23 @@ tEnterpriseWithdrawal.setBusinessExpireTime(tEnterpriseWithdrawal.getBusinessExpireTime()+",长期"); } if(ToolUtil.isNotEmpty(unifiedSocialCreditCodeExpireTimeOne)){ - tEnterpriseWithdrawal.setUnifiedSocialCreditCodeExpireTime(tEnterpriseWithdrawal.getUnifiedSocialCreditCodeExpireTime()+","+unifiedSocialCreditCodeExpireTimeOne); - }else { - tEnterpriseWithdrawal.setUnifiedSocialCreditCodeExpireTime(tEnterpriseWithdrawal.getUnifiedSocialCreditCodeExpireTime()+",长期"); - + tEnterpriseWithdrawal.setUnifiedSocialCreditCodeExpireTime(tEnterpriseWithdrawal.getUnifiedSocialCreditCodeExpireTime() + "," + unifiedSocialCreditCodeExpireTimeOne); + } else { + tEnterpriseWithdrawal.setUnifiedSocialCreditCodeExpireTime(tEnterpriseWithdrawal.getUnifiedSocialCreditCodeExpireTime() + ",长期"); + } - if(ToolUtil.isNotEmpty(certificateExpireTimeOne)){ - tEnterpriseWithdrawal.setCertificateExpireTime(tEnterpriseWithdrawal.getCertificateExpireTime()+","+certificateExpireTimeOne); - }else { - tEnterpriseWithdrawal.setCertificateExpireTime(tEnterpriseWithdrawal.getCertificateExpireTime()+",长期"); + if (ToolUtil.isNotEmpty(certificateExpireTimeOne)) { + tEnterpriseWithdrawal.setCertificateExpireTime(tEnterpriseWithdrawal.getCertificateExpireTime() + "," + certificateExpireTimeOne); + } else { + tEnterpriseWithdrawal.setCertificateExpireTime(tEnterpriseWithdrawal.getCertificateExpireTime() + ",长期"); } tEnterpriseWithdrawal.setIsAudit(1); - tEnterpriseWithdrawal.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + tEnterpriseWithdrawal.setCompanyId(shiroExtUtil.getUser().getObjectId()); tEnterpriseWithdrawal.setAccountType(accountType); String randomString = ToolUtil.getRandomString(32); tEnterpriseWithdrawal.setOutRequestNo(randomString); - if(tEnterpriseWithdrawal.getEnterpriseType()==1){ + if (tEnterpriseWithdrawal.getEnterpriseType() == 1) { tEnterpriseWithdrawal.setAccountType(2); } try { diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java index 71e2130..6686631 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TFeedbackController.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; import java.util.Map; @@ -29,15 +30,17 @@ @Controller @RequestMapping("/tFeedback") public class TFeedbackController extends BaseController { - + private String PREFIX = "/system/tFeedback/"; - + @Autowired private ITFeedbackService tFeedbackService; - + @Autowired private ITSystemNoticeService tSystemNoticeService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到司机反馈管理首页 */ @@ -45,7 +48,7 @@ public String index() { return PREFIX + "tFeedback.html"; } - + /** * 跳转到用户反馈管理首页 */ @@ -99,13 +102,13 @@ Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tFeedbackService.getFeedbackList(page, beginTime, endTime, 2, driverName, driverPhone, state)); @@ -124,13 +127,13 @@ Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tFeedbackService.getFeedbackList(page, beginTime, endTime, 1, userName, userPhone, state)); @@ -145,18 +148,18 @@ @ResponseBody public Object immediately(@RequestParam Integer id,@RequestParam String remark) { TFeedback tFeedback = tFeedbackService.selectById(id); - if (SinataUtil.isNotEmpty(tFeedback)){ + if (SinataUtil.isNotEmpty(tFeedback)) { tFeedback.setCldate(new Date()); tFeedback.setRemark(remark); - tFeedback.setHandleUserId(ShiroExtUtil.getUser().getId()); + tFeedback.setHandleUserId(shiroExtUtil.getUser().getId()); tFeedback.setState(2); tFeedbackService.updateById(tFeedback); - + //增加系统消息 TSystemNotice notice = new TSystemNotice(); notice.setType(2); notice.setUserType(tFeedback.getType()); - notice.setContent("反馈处理结果:【"+remark+"】。"); + notice.setContent("反馈处理结果:【" + remark + "】。"); notice.setUserId(tFeedback.getUserId()); notice.setInsertTime(new Date()); notice.setRead(1); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java index 9ae4982..d2a1f9a 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TInvoiceController.java @@ -4,20 +4,19 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; -import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TComplaint; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; +import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.TInvoice; import com.stylefeng.guns.modular.system.service.ITInvoiceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Map; /** @@ -29,12 +28,15 @@ @Controller @RequestMapping("/tInvoice") public class TInvoiceController extends BaseController { - + private String PREFIX = "/system/tInvoice/"; - + @Autowired private ITInvoiceService tInvoiceService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到开发票列表首页 */ @@ -42,7 +44,7 @@ public String index() { return PREFIX + "tInvoice.html"; } - + /** * 跳转到查看详情 */ @@ -88,13 +90,13 @@ Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tInvoiceService.getInvoiceList(page, beginTime, endTime, email, name, type, state)); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TNoticesController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TNoticesController.java index 7820398..a85d931 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TNoticesController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TNoticesController.java @@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -33,12 +34,16 @@ @Controller @RequestMapping("/tNotices") public class TNoticesController extends BaseController { - + private String PREFIX = "/system/tNotices/"; - + @Autowired private ITNoticesService tNoticesService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转到滚动消息设置首页 */ @@ -46,7 +51,7 @@ public String index() { return PREFIX + "tNotices.html"; } - + /** * 跳转到系统公告设置首页 */ @@ -107,7 +112,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tNoticesService.getRollingNoticeList(page, beginTime, endTime, 1, content)); @@ -129,7 +134,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tNoticesService.getRollingNoticeList(page, beginTime, endTime, 2, content)); @@ -145,7 +150,7 @@ public Object add(TNotices tNotices) { tNotices.setIsDelete(1); tNotices.setInsertTime(new Date()); - tNotices.setInsertUser(ShiroExtUtil.getUser().getId()); + tNotices.setInsertUser(shiroExtUtil.getUser().getId()); tNotices.setType(1); tNoticesService.insert(tNotices); return SUCCESS_TIP; @@ -159,7 +164,7 @@ public Object addSystem(TNotices tNotices) { tNotices.setIsDelete(1); tNotices.setInsertTime(new Date()); - tNotices.setInsertUser(ShiroExtUtil.getUser().getId()); + tNotices.setInsertUser(shiroExtUtil.getUser().getId()); tNotices.setType(2); tNoticesService.insert(tNotices); @@ -187,7 +192,7 @@ } tNotices.setIsShow(1); tNotices.setUpdateTime(new Date()); - tNotices.setUpdateUser(ShiroExtUtil.getUser().getId()); + tNotices.setUpdateUser(shiroExtUtil.getUser().getId()); tNoticesService.updateById(tNotices); return SUCCESS_TIP; } @@ -202,7 +207,7 @@ tNotices.setIsDelete(2); tNotices.setFlag("3"); tNotices.setUpdateTime(new Date()); - tNotices.setUpdateUser(ShiroExtUtil.getUser().getId()); + tNotices.setUpdateUser(shiroExtUtil.getUser().getId()); tNoticesService.updateById(tNotices); return SUCCESS_TIP; } @@ -213,7 +218,7 @@ @RequestMapping(value = "/update") @ResponseBody public Object update(TNotices tNotices) { - tNotices.setUpdateUser(ShiroExtUtil.getUser().getId()); + tNotices.setUpdateUser(shiroExtUtil.getUser().getId()); tNotices.setUpdateTime(new Date()); tNoticesService.updateById(tNotices); return SUCCESS_TIP; @@ -225,7 +230,7 @@ @RequestMapping(value = "/updateSystem") @ResponseBody public Object updateSystem(TNotices tNotices) { - tNotices.setUpdateUser(ShiroExtUtil.getUser().getId()); + tNotices.setUpdateUser(shiroExtUtil.getUser().getId()); tNotices.setUpdateTime(new Date()); tNoticesService.updateById(tNotices); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java index 702ecf5..7e92b48 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOpenCityController.java @@ -8,25 +8,25 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; +import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.util.DateUtil; import com.stylefeng.guns.core.util.SinataUtil; +import com.stylefeng.guns.modular.system.model.TOpenCity; import com.stylefeng.guns.modular.system.model.TOpenCityBusiness; import com.stylefeng.guns.modular.system.model.TRegion; import com.stylefeng.guns.modular.system.service.ITOpenCityBusinessService; +import com.stylefeng.guns.modular.system.service.ITOpenCityService; import com.stylefeng.guns.modular.system.service.ITRegionService; import com.stylefeng.guns.modular.system.util.GaoDeMapUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TOpenCity; -import com.stylefeng.guns.modular.system.service.ITOpenCityService; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -41,18 +41,20 @@ @Controller @RequestMapping("/tOpenCity") public class TOpenCityController extends BaseController { - + private String PREFIX = "/system/tOpenCity/"; - + @Autowired private ITOpenCityService tOpenCityService; - + @Autowired private ITRegionService tRegionService; - + @Autowired private ITOpenCityBusinessService tOpenCityBusinessService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到城市管理首页 */ @@ -60,7 +62,7 @@ public String index() { return PREFIX + "tOpenCity.html"; } - + /** * 跳转到添加城市管理 */ @@ -150,8 +152,8 @@ if (SinataUtil.isNotEmpty(tOpenCity.getCityName())){ address+=tOpenCity.getCityName(); } - if (SinataUtil.isNotEmpty(tOpenCity.getProvinceName())){ - address+=tOpenCity.getProvinceName(); + if (SinataUtil.isNotEmpty(tOpenCity.getProvinceName())) { + address += tOpenCity.getProvinceName(); } JSONObject positionObj = GaoDeMapUtil.getLngAndLat(address); String longitude = positionObj.getString("longitude"); @@ -159,11 +161,11 @@ tOpenCity.setLon(Double.valueOf(longitude)); tOpenCity.setLat(Double.valueOf(latitude)); tOpenCity.setInsertTime(new Date()); - tOpenCity.setInsertUser(ShiroExtUtil.getUser().getId()); + tOpenCity.setInsertUser(shiroExtUtil.getUser().getId()); tOpenCityService.insert(tOpenCity); - + //添加经营业务 - testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId()); + testJSONStrToJSONArray(businessTypeStr, tOpenCity.getId()); return SUCCESS_TIP; } @@ -173,14 +175,14 @@ for (int i = 0; i < size; i++){ JSONObject jsonObject = jsonArray.getJSONObject(i); TOpenCityBusiness business = new TOpenCityBusiness(); - if (SinataUtil.isNotEmpty(jsonObject.getInteger("busId")) && jsonObject.getInteger("busId") != 0){ + if (SinataUtil.isNotEmpty(jsonObject.getInteger("busId")) && jsonObject.getInteger("busId") != 0) { business = tOpenCityBusinessService.selectById(jsonObject.getInteger("busId")); business.setUpdateTime(new Date()); - business.setUpdateUser(ShiroExtUtil.getUser().getId()); + business.setUpdateUser(shiroExtUtil.getUser().getId()); business.setFlag("2"); - }else{ + }else { business.setInsertTime(DateUtil.parse(jsonObject.getString("time") + " 00:00:00", "yyyy-MM-dd HH:mm:ss")); - business.setInsertUser(ShiroExtUtil.getUser().getId()); + business.setInsertUser(shiroExtUtil.getUser().getId()); } business.setOpenCityId(tOpenCityId); String type = jsonObject.getString("type"); @@ -262,10 +264,10 @@ //获取经纬度 String address = tOpenCity.getAreaName(); if (SinataUtil.isNotEmpty(tOpenCity.getCityName())){ - address+=tOpenCity.getCityName(); + address += tOpenCity.getCityName(); } - if (SinataUtil.isNotEmpty(tOpenCity.getProvinceName())){ - address+=tOpenCity.getProvinceName(); + if (SinataUtil.isNotEmpty(tOpenCity.getProvinceName())) { + address += tOpenCity.getProvinceName(); } JSONObject positionObj = GaoDeMapUtil.getLngAndLat(address); String longitude = positionObj.getString("longitude"); @@ -273,15 +275,15 @@ tOpenCity.setLon(Double.valueOf(longitude)); tOpenCity.setLat(Double.valueOf(latitude)); tOpenCity.setUpdateTime(new Date()); - tOpenCity.setUpdateUser(ShiroExtUtil.getUser().getId()); + tOpenCity.setUpdateUser(shiroExtUtil.getUser().getId()); tOpenCityService.updateById(tOpenCity); - + //删除经营业务 TOpenCityBusiness business = new TOpenCityBusiness(); business.setFlag("3"); - tOpenCityBusinessService.update(business,new EntityWrapper<TOpenCityBusiness>().eq("openCityId",tOpenCity.getId())); + tOpenCityBusinessService.update(business, new EntityWrapper<TOpenCityBusiness>().eq("openCityId", tOpenCity.getId())); //添加经营业务 - testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId()); + testJSONStrToJSONArray(businessTypeStr, tOpenCity.getId()); return SUCCESS_TIP; } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderEvaluateController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderEvaluateController.java index 75039d9..658df7e 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderEvaluateController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TOrderEvaluateController.java @@ -4,20 +4,19 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; -import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TComplaint; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; +import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.TOrderEvaluate; import com.stylefeng.guns.modular.system.service.ITOrderEvaluateService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Map; /** @@ -29,12 +28,14 @@ @Controller @RequestMapping("/tOrderEvaluate") public class TOrderEvaluateController extends BaseController { - + private String PREFIX = "/system/tOrderEvaluate/"; - + @Autowired private ITOrderEvaluateService tOrderEvaluateService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到评价列表首页 */ @@ -42,7 +43,7 @@ public String index() { return PREFIX + "tOrderEvaluate.html"; } - + /** * 跳转到查看详情 */ @@ -96,7 +97,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tOrderEvaluateService.getOrderEvaluateList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, userName, userPhone, driverName, driverPhone, fraction, orderType)); + page.setRecords(tOrderEvaluateService.getOrderEvaluateList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, userName, userPhone, driverName, driverPhone, fraction, orderType)); return super.packForBT(page); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TProblemController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TProblemController.java index de16e99..1376f49 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TProblemController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TProblemController.java @@ -4,22 +4,20 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TFeedback; +import com.stylefeng.guns.modular.system.model.TProblem; import com.stylefeng.guns.modular.system.model.TSystemNotice; +import com.stylefeng.guns.modular.system.service.ITProblemService; import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TProblem; -import com.stylefeng.guns.modular.system.service.ITProblemService; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; import java.util.Map; @@ -32,15 +30,18 @@ @Controller @RequestMapping("/tProblem") public class TProblemController extends BaseController { - + private String PREFIX = "/system/tProblem/"; - + @Autowired private ITProblemService tProblemService; - + @Autowired private ITSystemNoticeService itSystemNoticeService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到用户留言管理首页 */ @@ -48,7 +49,7 @@ public String index() { return PREFIX + "tProblem.html"; } - + /** * 跳转到查看详情 */ @@ -84,13 +85,13 @@ Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tProblemService.getProblemList(page, beginTime, endTime, userName, state)); @@ -105,18 +106,18 @@ @ResponseBody public Object immediately(@RequestParam Integer tProblemId,@RequestParam String answer) { TProblem tProblem = tProblemService.selectById(tProblemId); - if (SinataUtil.isNotEmpty(tProblem)){ + if (SinataUtil.isNotEmpty(tProblem)) { tProblem.setAnswer(answer); tProblem.setHandleTime(new Date()); - tProblem.setHandleUserId(ShiroExtUtil.getUser().getId()); + tProblem.setHandleUserId(shiroExtUtil.getUser().getId()); tProblem.setState(2); tProblemService.updateById(tProblem); - + //增加系统消息 TSystemNotice notice = new TSystemNotice(); notice.setType(2); notice.setUserType(1); - notice.setContent("您的留言被回复啦:【"+answer+"】"); + notice.setContent("您的留言被回复啦:【" + answer + "】"); notice.setUserId(tProblem.getUserId()); notice.setInsertTime(new Date()); notice.setRead(1); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TPubWithdrawalController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TPubWithdrawalController.java index f195e08..0508f84 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TPubWithdrawalController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TPubWithdrawalController.java @@ -5,7 +5,6 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; @@ -34,26 +33,29 @@ @Slf4j @RequestMapping("/tPubWithdrawal") public class TPubWithdrawalController extends BaseController { - + private String PREFIX = "/system/tPubWithdrawal/"; - + @Autowired private ITPubWithdrawalService tPubWithdrawalService; - + @Autowired private ITSystemNoticeService tSystemNoticeService; @Resource private IUserWithdrawalService userWithdrawalService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到提现列表首页 */ @RequestMapping("") public String index(Model model) { - model.addAttribute("id", ShiroExtUtil.getUser().getObjectId()); + model.addAttribute("id", shiroExtUtil.getUser().getObjectId()); return PREFIX + "tPubWithdrawal.html"; } - + /** * 跳转到查看详情 */ @@ -136,23 +138,21 @@ tPubWithdrawal.setHandleTime(new Date()); if (SinataUtil.isNotEmpty(tPubWithdrawal)){ // tPubWithdrawal.setState(state); //调用接口修改状态 - - - - + + Integer stateObj = 1; - if (2 == state){ //同意提现 + if (2 == state) { //同意提现 stateObj = 1; - }else if (3 == state){ //拒绝提现 + } else if (3 == state) { //拒绝提现 stateObj = 2; } - Integer objectId = ShiroExtUtil.getUser().getObjectId(); + Integer objectId = shiroExtUtil.getUser().getObjectId(); // 获取手续费 Double poundage = tPubWithdrawalService.getPoundage(objectId); - if(poundage!=null && poundage>0){ + if (poundage != null && poundage > 0) { BigDecimal money = tPubWithdrawal.getMoney(); - if(money.doubleValue()>=1){ + if (money.doubleValue() >= 1) { BigDecimal divide = new BigDecimal(poundage).divide(new BigDecimal(100)); tPubWithdrawal.setMoney(money.subtract(money.multiply(divide))); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSmsrecordController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSmsrecordController.java index 4b12fd1..e9e646a 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSmsrecordController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSmsrecordController.java @@ -4,20 +4,17 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TComplaint; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.TSmsrecord; import com.stylefeng.guns.modular.system.service.ITSmsrecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Map; /** @@ -29,12 +26,14 @@ @Controller @RequestMapping("/tSmsrecord") public class TSmsrecordController extends BaseController { - + private String PREFIX = "/system/tSmsrecord/"; - + @Autowired private ITSmsrecordService tSmsrecordService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到短信记录首页 */ @@ -42,7 +41,7 @@ public String index() { return PREFIX + "tSmsrecord.html"; } - + /** * 跳转到查看详情 */ @@ -72,7 +71,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tSmsrecordService.getSmsCodeList(page, beginTime, endTime, phone)); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysReformistController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysReformistController.java index b713127..c9d299d 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysReformistController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysReformistController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; @@ -79,6 +80,13 @@ @Autowired private ITElectricRecordService recordService; + @Autowired + ITSystemPriceService priceService; + @Autowired + private ITServerCarmodelService serverCarmodelService; + @Resource + private ShiroExtUtil shiroExtUtil; + @RequestMapping ("/check-change/{id}") @ResponseBody public ResultUtil Change(@PathVariable Integer id,String priceType,String isCheck ) { @@ -104,27 +112,25 @@ } } } - String join = String.join(",", split); - carModel.setIsCheck(join); - serverCarmodelService.updateById(carModel); - System.err.println("================="+id+"===="+priceType); - return new ResultUtil(null,0,"保存成功"); + String join = String.join(",", split); + carModel.setIsCheck(join); + serverCarmodelService.updateById(carModel); + System.err.println("=================" + id + "====" + priceType); + return new ResultUtil(null, 0, "保存成功"); } - @Autowired - private ITServerCarmodelService serverCarmodelService; - @Autowired ITSystemPriceService priceService; - @RequestMapping("/checklist") - @ResponseBody - public Object checklist(Model model) { - Integer id = ShiroExtUtil.getUser().getId(); + + @RequestMapping("/checklist") + @ResponseBody + public Object checklist(Model model) { + Integer id = shiroExtUtil.getUser().getId(); // List<TSystemPrice> tSystemPrices = priceService.selectList(new EntityWrapper<TSystemPrice>().eq("companyId", id).eq("type", 1).eq("state", 1)); // List<Integer> ids = new ArrayList<>(); // for (TSystemPrice tSystemPrice : tSystemPrices) { // ids.add(tSystemPrice.getServerCarModelId()); // } - - - List<TServerCarmodel> tCarModels = serverCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("state",1).eq("type",1)); + + + List<TServerCarmodel> tCarModels = serverCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("state",1).eq("type",1)); TServerCarmodel type = serverCarmodelService.selectOne(new EntityWrapper<TServerCarmodel>().eq("type", 4)); List<TServerCarmodel> returnList = new ArrayList<>(); for (TServerCarmodel tCarModel : tCarModels) { @@ -162,73 +168,73 @@ @RequestMapping("") public String index(Model model) { //改派设置 - TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", shiroExtUtil.getUser().getObjectId())); model.addAttribute("reformist",reformist); //积分设置 - TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", shiroExtUtil.getUser().getObjectId())); model.addAttribute("integral",integral); //人脸识别 - TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", shiroExtUtil.getUser().getObjectId())); model.addAttribute("faceDistinguish",faceDistinguish); //快车推单(第一轮) - TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 1)); + TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 1)); model.addAttribute("zcOne",zcOne); //快车推单(第二轮) - TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 2)); + TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 2)); model.addAttribute("zcTwo",zcTwo); //快车推单(第三轮) - TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 3)); + TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 3)); model.addAttribute("zcThree",zcThree); //出租车推单(第一轮) - TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 1)); + TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 1)); model.addAttribute("czcOne",czcOne); //出租车推单(第二轮) - TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 2)); + TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 2)); model.addAttribute("czcTwo",czcTwo); //出租车推单(第三轮) - TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 3)); + TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 3)); model.addAttribute("czcThree",czcThree); //普通取消设置(快车) - TSysCancleOrder ptCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 1)); + TSysCancleOrder ptCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 1)); model.addAttribute("ptCancel1",ptCancel1); //普通取消设置(出租车) - TSysCancleOrder ptCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 2)); + TSysCancleOrder ptCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 2)); model.addAttribute("ptCancel2",ptCancel2); //普通取消设置(跨城出行) - TSysCancleOrder ptCancel3 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 3)); + TSysCancleOrder ptCancel3 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 3)); model.addAttribute("ptCancel3",ptCancel3); //预约取消设置(快车) - TSysCancleOrder yyCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 2).eq("orderType", 1)); + TSysCancleOrder yyCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 2).eq("orderType", 1)); model.addAttribute("yyCancel1",yyCancel1); //预约取消设置(出租车) - TSysCancleOrder yyCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 2).eq("orderType", 2)); + TSysCancleOrder yyCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 2).eq("orderType", 2)); model.addAttribute("yyCancel2",yyCancel2); //拼车设置 - SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<SpellOrderRule>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<SpellOrderRule>().eq("companyId", shiroExtUtil.getUser().getObjectId())); model.addAttribute("spellOrderRule", null == spellOrderRule ? "" : JSONObject.parseObject(spellOrderRule.getContent())); //报警电话 - TPhone phone1 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 1)); + TPhone phone1 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 1)); model.addAttribute("phone1",phone1); //客服电话 - TPhone phone2 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 2)); + TPhone phone2 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 2)); model.addAttribute("phone2",phone2); //客服电话 - TPhone phone3 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 3)); + TPhone phone3 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 3)); model.addAttribute("phone3",phone3); //95128电召电话 - TPhone phone4 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 4)); + TPhone phone4 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 4)); model.addAttribute("phone4",phone4); //招聘电话 - TPhone phone5 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 5)); + TPhone phone5 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 5)); model.addAttribute("phone5",phone5); //节假日服务费 - BigDecimal holidayFee = companyService.selectById(ShiroExtUtil.getUser().getObjectId()).getHolidayFee(); + BigDecimal holidayFee = companyService.selectById(shiroExtUtil.getUser().getObjectId()).getHolidayFee(); model.addAttribute("holidayFee",holidayFee); //超时扣款 TSysTimeoutMoney tSysTimeoutMoney = timeoutMoneyService.selectOne(null); @@ -272,7 +278,7 @@ } } model.addAttribute("showModulars", map); - TDriverPayDays tDriverPayDays = driverPayDaysService.selectOne(new EntityWrapper<TDriverPayDays>().eq("company_id", ShiroExtUtil.getUser().getObjectId())); + TDriverPayDays tDriverPayDays = driverPayDaysService.selectOne(new EntityWrapper<TDriverPayDays>().eq("company_id", shiroExtUtil.getUser().getObjectId())); if(tDriverPayDays!=null){ model.addAttribute("driverDay", tDriverPayDays.getDay()); }else { @@ -314,381 +320,381 @@ Integer dck1, Integer dck2,Integer driverDays) { //改派设置 if("reassigningSet".equals(type)){ - TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", shiroExtUtil.getUser().getObjectId())); if (SinataUtil.isNotEmpty(reformist)){ reformist.setMoney(one); reformist.setIsSpecialCar(isSpecialCar); reformist.setIsTaxiCar(isTaxiCar); tSysReformistService.updateById(reformist); - }else{ - reformist = new TSysReformist(); - reformist.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - reformist.setMoney(one); - reformist.setIsSpecialCar(isSpecialCar); - reformist.setIsTaxiCar(isTaxiCar); - tSysReformistService.insert(reformist); + }else { + reformist = new TSysReformist(); + reformist.setCompanyId(shiroExtUtil.getUser().getObjectId()); + reformist.setMoney(one); + reformist.setIsSpecialCar(isSpecialCar); + reformist.setIsTaxiCar(isTaxiCar); + tSysReformistService.insert(reformist); } } if("driverPayDays".equals(type)){ - TDriverPayDays tDriverPayDays = driverPayDaysService.selectOne(new EntityWrapper<TDriverPayDays>().eq("company_id", ShiroExtUtil.getUser().getObjectId())); + TDriverPayDays tDriverPayDays = driverPayDaysService.selectOne(new EntityWrapper<TDriverPayDays>().eq("company_id", shiroExtUtil.getUser().getObjectId())); if (SinataUtil.isNotEmpty(tDriverPayDays)){ tDriverPayDays.setDay(driverDays); tDriverPayDays.setUpdateTime(new Date()); driverPayDaysService.updateById(tDriverPayDays); - }else{ - tDriverPayDays = new TDriverPayDays(); - tDriverPayDays.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - tDriverPayDays.setUpdateTime(new Date()); - tDriverPayDays.setDay(driverDays); - driverPayDaysService.insert(tDriverPayDays); + }else { + tDriverPayDays = new TDriverPayDays(); + tDriverPayDays.setCompanyId(shiroExtUtil.getUser().getObjectId()); + tDriverPayDays.setUpdateTime(new Date()); + tDriverPayDays.setDay(driverDays); + driverPayDaysService.insert(tDriverPayDays); } } //积分设置 if("integralSet".equals(type)){ - TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", shiroExtUtil.getUser().getObjectId())); if (SinataUtil.isNotEmpty(integral)){ integral.setIntegral(two); tSysIntegralService.updateById(integral); - }else{ - integral = new TSysIntegral(); - integral.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - integral.setIntegral(two); - tSysIntegralService.insert(integral); + }else { + integral = new TSysIntegral(); + integral.setCompanyId(shiroExtUtil.getUser().getObjectId()); + integral.setIntegral(two); + tSysIntegralService.insert(integral); } } //人脸识别 if("faceRecognitionSettings".equals(type)){ - TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", shiroExtUtil.getUser().getObjectId())); if (SinataUtil.isNotEmpty(faceDistinguish)){ faceDistinguish.setIsOpen(three); faceDistinguish.setMinuteNum(openValue); tSysFaceDistinguishService.updateById(faceDistinguish); - }else{ - faceDistinguish = new TSysFaceDistinguish(); - faceDistinguish.setIsOpen(three); - faceDistinguish.setMinuteNum(openValue); - faceDistinguish.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - tSysFaceDistinguishService.insert(faceDistinguish); + }else { + faceDistinguish = new TSysFaceDistinguish(); + faceDistinguish.setIsOpen(three); + faceDistinguish.setMinuteNum(openValue); + faceDistinguish.setCompanyId(shiroExtUtil.getUser().getObjectId()); + tSysFaceDistinguishService.insert(faceDistinguish); } } //推单设置 if("pushOrderSettings".equals(type)){ //快车推单(第一轮) - TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 1)); + TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 1)); if (SinataUtil.isNotEmpty(zcOne)){ zcOne.setPushDistance(zc1); zcOne.setPushTime(zc2); zcOne.setDriverProportion(zc3); tSysPushOrderService.updateById(zcOne); - }else{ - zcOne = new TSysPushOrder(); - zcOne.setPushDistance(zc1); - zcOne.setPushTime(zc2); - zcOne.setDriverProportion(zc3); - zcOne.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - zcOne.setPushType(1); - zcOne.setType(1); - tSysPushOrderService.insert(zcOne); + }else { + zcOne = new TSysPushOrder(); + zcOne.setPushDistance(zc1); + zcOne.setPushTime(zc2); + zcOne.setDriverProportion(zc3); + zcOne.setCompanyId(shiroExtUtil.getUser().getObjectId()); + zcOne.setPushType(1); + zcOne.setType(1); + tSysPushOrderService.insert(zcOne); } //快车推单(第二轮) - TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 2)); + TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 2)); if (SinataUtil.isNotEmpty(zcTwo)){ zcTwo.setPushDistance(zc4); zcTwo.setPushTime(zc5); zcTwo.setDriverProportion(zc6); tSysPushOrderService.updateById(zcTwo); - }else{ - zcTwo = new TSysPushOrder(); - zcTwo.setPushDistance(zc4); - zcTwo.setPushTime(zc5); - zcTwo.setDriverProportion(zc6); - zcTwo.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - zcTwo.setPushType(1); - zcTwo.setType(2); - tSysPushOrderService.insert(zcTwo); + }else { + zcTwo = new TSysPushOrder(); + zcTwo.setPushDistance(zc4); + zcTwo.setPushTime(zc5); + zcTwo.setDriverProportion(zc6); + zcTwo.setCompanyId(shiroExtUtil.getUser().getObjectId()); + zcTwo.setPushType(1); + zcTwo.setType(2); + tSysPushOrderService.insert(zcTwo); } //快车推单(第三轮) - TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 3)); + TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 1).eq("type", 3)); if (SinataUtil.isNotEmpty(zcThree)){ zcThree.setPushDistance(zc7); zcThree.setPushTime(zc8); zcThree.setDriverProportion(zc9); tSysPushOrderService.updateById(zcThree); - }else{ - zcThree = new TSysPushOrder(); - zcThree.setPushDistance(zc7); - zcThree.setPushTime(zc8); - zcThree.setDriverProportion(zc9); - zcThree.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - zcThree.setPushType(1); - zcThree.setType(3); - tSysPushOrderService.insert(zcThree); + }else { + zcThree = new TSysPushOrder(); + zcThree.setPushDistance(zc7); + zcThree.setPushTime(zc8); + zcThree.setDriverProportion(zc9); + zcThree.setCompanyId(shiroExtUtil.getUser().getObjectId()); + zcThree.setPushType(1); + zcThree.setType(3); + tSysPushOrderService.insert(zcThree); } //出租车推单(第一轮) - TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 1)); + TSysPushOrder czcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 1)); if (SinataUtil.isNotEmpty(czcOne)){ czcOne.setPushDistance(czc1); czcOne.setPushTime(czc2); czcOne.setDriverProportion(czc3); tSysPushOrderService.updateById(czcOne); - }else{ - czcOne = new TSysPushOrder(); - czcOne.setPushDistance(czc1); - czcOne.setPushTime(czc2); - czcOne.setDriverProportion(czc3); - czcOne.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - czcOne.setPushType(2); - czcOne.setType(1); - tSysPushOrderService.insert(czcOne); + }else { + czcOne = new TSysPushOrder(); + czcOne.setPushDistance(czc1); + czcOne.setPushTime(czc2); + czcOne.setDriverProportion(czc3); + czcOne.setCompanyId(shiroExtUtil.getUser().getObjectId()); + czcOne.setPushType(2); + czcOne.setType(1); + tSysPushOrderService.insert(czcOne); } //出租车推单(第二轮) - TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 2)); + TSysPushOrder czcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 2)); if (SinataUtil.isNotEmpty(czcTwo)){ czcTwo.setPushDistance(czc4); czcTwo.setPushTime(czc5); czcTwo.setDriverProportion(czc6); tSysPushOrderService.updateById(czcTwo); - }else{ - czcTwo = new TSysPushOrder(); - czcTwo.setPushDistance(czc4); - czcTwo.setPushTime(czc5); - czcTwo.setDriverProportion(czc6); - czcTwo.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - czcTwo.setPushType(2); - czcTwo.setType(2); - tSysPushOrderService.insert(czcTwo); + }else { + czcTwo = new TSysPushOrder(); + czcTwo.setPushDistance(czc4); + czcTwo.setPushTime(czc5); + czcTwo.setDriverProportion(czc6); + czcTwo.setCompanyId(shiroExtUtil.getUser().getObjectId()); + czcTwo.setPushType(2); + czcTwo.setType(2); + tSysPushOrderService.insert(czcTwo); } //出租车推单(第三轮) - TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 3)); + TSysPushOrder czcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("pushType", 2).eq("type", 3)); if (SinataUtil.isNotEmpty(czcThree)){ czcThree.setPushDistance(czc7); czcThree.setPushTime(czc8); czcThree.setDriverProportion(czc9); tSysPushOrderService.updateById(czcThree); - }else{ - czcThree = new TSysPushOrder(); - czcThree.setPushDistance(czc7); - czcThree.setPushTime(czc8); - czcThree.setDriverProportion(czc9); - czcThree.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - czcThree.setPushType(2); - czcThree.setType(3); - tSysPushOrderService.insert(czcThree); + }else { + czcThree = new TSysPushOrder(); + czcThree.setPushDistance(czc7); + czcThree.setPushTime(czc8); + czcThree.setDriverProportion(czc9); + czcThree.setCompanyId(shiroExtUtil.getUser().getObjectId()); + czcThree.setPushType(2); + czcThree.setType(3); + tSysPushOrderService.insert(czcThree); } } //取消设置 if("cancelOrderSettings".equals(type)){ //普通取消设置(快车) - TSysCancleOrder ptCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 1)); + TSysCancleOrder ptCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 1)); if (SinataUtil.isNotEmpty(ptCancelOne)){ ptCancelOne.setMinuteNum(ptCancel1); ptCancelOne.setMoney(ptCancel2); tSysCancleOrderService.updateById(ptCancelOne); - }else{ - ptCancelOne = new TSysCancleOrder(); - ptCancelOne.setMinuteNum(ptCancel1); - ptCancelOne.setMoney(ptCancel2); - ptCancelOne.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - ptCancelOne.setType(1); - ptCancelOne.setOrderType(1); - tSysCancleOrderService.insert(ptCancelOne); + }else { + ptCancelOne = new TSysCancleOrder(); + ptCancelOne.setMinuteNum(ptCancel1); + ptCancelOne.setMoney(ptCancel2); + ptCancelOne.setCompanyId(shiroExtUtil.getUser().getObjectId()); + ptCancelOne.setType(1); + ptCancelOne.setOrderType(1); + tSysCancleOrderService.insert(ptCancelOne); } //普通取消设置(出租车) - TSysCancleOrder ptCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 2)); + TSysCancleOrder ptCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 2)); if (SinataUtil.isNotEmpty(ptCancelTwo)){ ptCancelTwo.setMinuteNum(ptCancel3); ptCancelTwo.setMoney(ptCancel4); tSysCancleOrderService.updateById(ptCancelTwo); - }else{ - ptCancelTwo = new TSysCancleOrder(); - ptCancelTwo.setMinuteNum(ptCancel3); - ptCancelTwo.setMoney(ptCancel4); - ptCancelTwo.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - ptCancelTwo.setType(1); - ptCancelTwo.setOrderType(2); - tSysCancleOrderService.insert(ptCancelTwo); + }else { + ptCancelTwo = new TSysCancleOrder(); + ptCancelTwo.setMinuteNum(ptCancel3); + ptCancelTwo.setMoney(ptCancel4); + ptCancelTwo.setCompanyId(shiroExtUtil.getUser().getObjectId()); + ptCancelTwo.setType(1); + ptCancelTwo.setOrderType(2); + tSysCancleOrderService.insert(ptCancelTwo); } //普通取消设置(跨城出行) - TSysCancleOrder ptCancelThree = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 3)); + TSysCancleOrder ptCancelThree = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 1).eq("orderType", 3)); if (SinataUtil.isNotEmpty(ptCancelThree)){ ptCancelThree.setMinuteNum(ptCancel5); ptCancelThree.setMoney(ptCancel6); tSysCancleOrderService.updateById(ptCancelThree); - }else{ - ptCancelThree = new TSysCancleOrder(); - ptCancelThree.setMinuteNum(ptCancel5); - ptCancelThree.setMoney(ptCancel6); - ptCancelThree.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - ptCancelThree.setType(1); - ptCancelThree.setOrderType(3); - tSysCancleOrderService.insert(ptCancelThree); + }else { + ptCancelThree = new TSysCancleOrder(); + ptCancelThree.setMinuteNum(ptCancel5); + ptCancelThree.setMoney(ptCancel6); + ptCancelThree.setCompanyId(shiroExtUtil.getUser().getObjectId()); + ptCancelThree.setType(1); + ptCancelThree.setOrderType(3); + tSysCancleOrderService.insert(ptCancelThree); } } //预约取消设置 if("cancelTheReservationOrderSetting".equals(type)){ //预约取消设置(快车) - TSysCancleOrder yyCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 2).eq("orderType", 1)); + TSysCancleOrder yyCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 2).eq("orderType", 1)); if (SinataUtil.isNotEmpty(yyCancelOne)){ yyCancelOne.setMinuteNum(yyCancel1); yyCancelOne.setMoney(yyCancel2); tSysCancleOrderService.updateById(yyCancelOne); - }else{ - yyCancelOne = new TSysCancleOrder(); - yyCancelOne.setMinuteNum(yyCancel1); - yyCancelOne.setMoney(yyCancel2); - yyCancelOne.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - yyCancelOne.setType(2); - yyCancelOne.setOrderType(1); - tSysCancleOrderService.insert(yyCancelOne); + }else { + yyCancelOne = new TSysCancleOrder(); + yyCancelOne.setMinuteNum(yyCancel1); + yyCancelOne.setMoney(yyCancel2); + yyCancelOne.setCompanyId(shiroExtUtil.getUser().getObjectId()); + yyCancelOne.setType(2); + yyCancelOne.setOrderType(1); + tSysCancleOrderService.insert(yyCancelOne); } //预约取消设置(出租车) - TSysCancleOrder yyCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 2).eq("orderType", 2)); + TSysCancleOrder yyCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 2).eq("orderType", 2)); if (SinataUtil.isNotEmpty(yyCancelTwo)){ yyCancelTwo.setMinuteNum(yyCancel3); yyCancelTwo.setMoney(yyCancel4); tSysCancleOrderService.updateById(yyCancelTwo); - }else{ - yyCancelTwo = new TSysCancleOrder(); - yyCancelTwo.setMinuteNum(yyCancel3); - yyCancelTwo.setMoney(yyCancel4); - yyCancelTwo.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - yyCancelTwo.setType(2); - yyCancelTwo.setOrderType(2); - tSysCancleOrderService.insert(yyCancelTwo); + }else { + yyCancelTwo = new TSysCancleOrder(); + yyCancelTwo.setMinuteNum(yyCancel3); + yyCancelTwo.setMoney(yyCancel4); + yyCancelTwo.setCompanyId(shiroExtUtil.getUser().getObjectId()); + yyCancelTwo.setType(2); + yyCancelTwo.setOrderType(2); + tSysCancleOrderService.insert(yyCancelTwo); } } //拼单派单 - if("spellOrderSetting".equals(type)){ - SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<SpellOrderRule>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("num1", pdpd1); - jsonObject.put("num2", pdpd2); - jsonObject.put("num3", pdpd3); - jsonObject.put("num4", pdpd4); - jsonObject.put("num5", pdpd5); - jsonObject.put("num6", pdpd6); - if(SinataUtil.isNotEmpty(spellOrderRule)){ - spellOrderRule.setContent(jsonObject.toJSONString()); - spellOrderRuleService.updateById(spellOrderRule); - }else{ - spellOrderRule = new SpellOrderRule(); - spellOrderRule.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - spellOrderRule.setContent(jsonObject.toJSONString()); - spellOrderRuleService.insert(spellOrderRule); - } + if("spellOrderSetting".equals(type)) { + SpellOrderRule spellOrderRule = spellOrderRuleService.selectOne(new EntityWrapper<SpellOrderRule>().eq("companyId", shiroExtUtil.getUser().getObjectId())); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("num1", pdpd1); + jsonObject.put("num2", pdpd2); + jsonObject.put("num3", pdpd3); + jsonObject.put("num4", pdpd4); + jsonObject.put("num5", pdpd5); + jsonObject.put("num6", pdpd6); + if (SinataUtil.isNotEmpty(spellOrderRule)) { + spellOrderRule.setContent(jsonObject.toJSONString()); + spellOrderRuleService.updateById(spellOrderRule); + } else { + spellOrderRule = new SpellOrderRule(); + spellOrderRule.setCompanyId(shiroExtUtil.getUser().getObjectId()); + spellOrderRule.setContent(jsonObject.toJSONString()); + spellOrderRuleService.insert(spellOrderRule); + } } //电话设置 if("phoneSettings".equals(type)){ //报警电话 - TPhone phoneOne = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 1)); + TPhone phoneOne = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 1)); if (SinataUtil.isNotEmpty(phoneOne)){ phoneOne.setPhone(phone1); tPhoneService.updateById(phoneOne); - }else{ - phoneOne = new TPhone(); - phoneOne.setPhone(phone1); - phoneOne.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - phoneOne.setType(1); - if (ShiroExtUtil.getUser().getRoleType() == 1) { - phoneOne.setPlatform(1); - } else { - phoneOne.setPlatform(2); - } - tPhoneService.insert(phoneOne); + }else { + phoneOne = new TPhone(); + phoneOne.setPhone(phone1); + phoneOne.setCompanyId(shiroExtUtil.getUser().getObjectId()); + phoneOne.setType(1); + if (shiroExtUtil.getUser().getRoleType() == 1) { + phoneOne.setPlatform(1); + } else { + phoneOne.setPlatform(2); + } + tPhoneService.insert(phoneOne); } //客服电话 - TPhone phoneTwo = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 2)); + TPhone phoneTwo = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 2)); if (SinataUtil.isNotEmpty(phoneTwo)){ phoneTwo.setPhone(phone2); tPhoneService.updateById(phoneTwo); - }else{ - phoneTwo = new TPhone(); - phoneTwo.setPhone(phone2); - phoneTwo.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - phoneTwo.setType(2); - if (ShiroExtUtil.getUser().getRoleType() == 1) { - phoneTwo.setPlatform(1); - } else { - phoneTwo.setPlatform(2); - } - tPhoneService.insert(phoneTwo); + }else { + phoneTwo = new TPhone(); + phoneTwo.setPhone(phone2); + phoneTwo.setCompanyId(shiroExtUtil.getUser().getObjectId()); + phoneTwo.setType(2); + if (shiroExtUtil.getUser().getRoleType() == 1) { + phoneTwo.setPlatform(1); + } else { + phoneTwo.setPlatform(2); + } + tPhoneService.insert(phoneTwo); } //客服电话 - TPhone phone = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 3)); + TPhone phone = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 3)); if (SinataUtil.isNotEmpty(phone)){ phone.setPhone(phone3); tPhoneService.updateById(phone); - }else{ - phone = new TPhone(); - phone.setPhone(phone3); - phone.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - phone.setType(3); - if (ShiroExtUtil.getUser().getRoleType() == 1) { - phone.setPlatform(1); - } else { - phone.setPlatform(2); - } - tPhoneService.insert(phone); + }else { + phone = new TPhone(); + phone.setPhone(phone3); + phone.setCompanyId(shiroExtUtil.getUser().getObjectId()); + phone.setType(3); + if (shiroExtUtil.getUser().getRoleType() == 1) { + phone.setPlatform(1); + } else { + phone.setPlatform(2); + } + tPhoneService.insert(phone); } //招聘电话 - TPhone phoneFive = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 5)); + TPhone phoneFive = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 5)); if (SinataUtil.isNotEmpty(phoneFive)){ phoneFive.setPhone(phone5); tPhoneService.updateById(phoneFive); - }else{ - phoneFive = new TPhone(); - phoneFive.setPhone(phone5); - phoneFive.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - phoneFive.setType(5); - if (ShiroExtUtil.getUser().getRoleType() == 1) { - phoneFive.setPlatform(1); - } else { - phoneFive.setPlatform(2); - } - tPhoneService.insert(phoneFive); + }else { + phoneFive = new TPhone(); + phoneFive.setPhone(phone5); + phoneFive.setCompanyId(shiroExtUtil.getUser().getObjectId()); + phoneFive.setType(5); + if (shiroExtUtil.getUser().getRoleType() == 1) { + phoneFive.setPlatform(1); + } else { + phoneFive.setPlatform(2); + } + tPhoneService.insert(phoneFive); } } //95128 if("95128TheOnCall".equals(type)){ //95128电召电话 - TPhone phoneFour = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("type", 4)); + TPhone phoneFour = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("type", 4)); if (SinataUtil.isNotEmpty(phoneFour)){ phoneFour.setPhone(phone4); tPhoneService.updateById(phoneFour); - }else{ - phoneFour = new TPhone(); - phoneFour.setPhone(phone4); - phoneFour.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - phoneFour.setType(4); - if (ShiroExtUtil.getUser().getRoleType() == 1) { - phoneFour.setPlatform(1); - } else { - phoneFour.setPlatform(2); - } - tPhoneService.insert(phoneFour); + }else { + phoneFour = new TPhone(); + phoneFour.setPhone(phone4); + phoneFour.setCompanyId(shiroExtUtil.getUser().getObjectId()); + phoneFour.setType(4); + if (shiroExtUtil.getUser().getRoleType() == 1) { + phoneFour.setPlatform(1); + } else { + phoneFour.setPlatform(2); + } + tPhoneService.insert(phoneFour); } } /// 节假日服务费 - if("holidayServiceFeeSetting".equals(type)){ - Integer companyId = ShiroExtUtil.getUser().getObjectId(); - TCompany company = companyService.selectById(companyId); - company.setHolidayFee(holidayFee); - companyService.updateById(company); + if("holidayServiceFeeSetting".equals(type)) { + Integer companyId = shiroExtUtil.getUser().getObjectId(); + TCompany company = companyService.selectById(companyId); + company.setHolidayFee(holidayFee); + companyService.updateById(company); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysSensitiveWordsController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysSensitiveWordsController.java index a98ed1c..09a1c59 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysSensitiveWordsController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSysSensitiveWordsController.java @@ -4,19 +4,16 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.TSysSensitiveWords; import com.stylefeng.guns.modular.system.service.ITSysSensitiveWordsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; import java.util.Map; @@ -29,21 +26,24 @@ @Controller @RequestMapping("/tSysSensitiveWords") public class TSysSensitiveWordsController extends BaseController { - - private String PREFIX = "/system/tSysSensitiveWords/"; - - @Autowired - private ITSysSensitiveWordsService tSysSensitiveWordsService; - - /** - * 跳转到敏感词管理首页 - */ - @RequestMapping("") - public String index() { - return PREFIX + "tSysSensitiveWords.html"; - } - - /** + + private String PREFIX = "/system/tSysSensitiveWords/"; + + @Autowired + private ITSysSensitiveWordsService tSysSensitiveWordsService; + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** + * 跳转到敏感词管理首页 + */ + @RequestMapping("") + public String index() { + return PREFIX + "tSysSensitiveWords.html"; + } + + /** * 跳转到添加敏感词管理 */ @RequestMapping("/tSysSensitiveWords_add") @@ -58,20 +58,20 @@ @ResponseBody public Object list(String createTime, String content) { - String beginTime = null; - String endTime = null; - if (SinataUtil.isNotEmpty(createTime)){ - String[] timeArray = createTime.split(" - "); - beginTime = timeArray[0]; - endTime = timeArray[1]; - } - Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { - page.setRecords(null); - } else { - page.setRecords(tSysSensitiveWordsService.getSensitiveWordList(page, beginTime, endTime, content)); - } - return super.packForBT(page); + String beginTime = null; + String endTime = null; + if (SinataUtil.isNotEmpty(createTime)) { + String[] timeArray = createTime.split(" - "); + beginTime = timeArray[0]; + endTime = timeArray[1]; + } + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + if (shiroExtUtil.getUser().getRoleType() != 1) { + page.setRecords(null); + } else { + page.setRecords(tSysSensitiveWordsService.getSensitiveWordList(page, beginTime, endTime, content)); + } + return super.packForBT(page); } /** diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TTaxiCardController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TTaxiCardController.java index 977f78e..01e75b0 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TTaxiCardController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TTaxiCardController.java @@ -8,8 +8,6 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; - import com.stylefeng.guns.core.util.DateUtil; import com.stylefeng.guns.core.util.ExcelUtil; import com.stylefeng.guns.core.util.ToolUtil; @@ -25,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.OutputStream; import java.text.DateFormat; @@ -48,23 +47,25 @@ @Autowired private ITRegionService regionService; - + @Autowired private ITCompanyService companyService; - + @Autowired private IUserService userService; - + @Autowired private ITTaxiCardPaymentService taxiCardPaymentService; - + @Resource + private ShiroExtUtil shiroExtUtil; + @RequestMapping("") - public String index(){ + public String index() { return PREFIX + "tTaxiCard.html"; } - + @RequestMapping("/audit") - public String audit(){ + public String audit() { return PREFIX + "tTaxiCardAudit.html"; } @@ -176,7 +177,7 @@ @RequestMapping("/tTaxiCard_add") public String tTaxiCardAdd(Model model){ - model.addAttribute("roleType", ShiroExtUtil.getUser().getRoleType()); + model.addAttribute("roleType", shiroExtUtil.getUser().getRoleType()); return PREFIX + "tTaxiCard_add.html"; } @@ -194,7 +195,7 @@ model.addAttribute("viewIdentity","myself"); /// 查看角色--自己 model.addAttribute("item", tTaxiCard); - model.addAttribute("roleType", ShiroExtUtil.getUser().getRoleType()); + model.addAttribute("roleType", shiroExtUtil.getUser().getRoleType()); return PREFIX + "tTaxiCard_edit.html"; } @@ -212,7 +213,7 @@ public Object ttaxiCardList(String startTime, String endTime, Integer type, String nameStr){ Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); Wrapper wrapper = new EntityWrapper<TTaxiCard>().eq("auditStatus", 2) - .eq("companyId", ShiroExtUtil.getUser().getObjectId()).orderBy("id", false); + .eq("companyId", shiroExtUtil.getUser().getObjectId()).orderBy("id", false); if (ToolUtil.isNotEmpty(startTime) && ToolUtil.isNotEmpty(endTime)){ wrapper.between("createTime",startTime + " 00:00:00",endTime + " 23:59:59"); @@ -291,7 +292,7 @@ @ResponseBody public Object tTaxiCardAuditList(String startTime, String endTime, Integer type, String nameStr){ Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - Wrapper wrapper = new EntityWrapper<TTaxiCard>().ne("companyId", ShiroExtUtil.getUser().getObjectId()).orderBy("id", false); + Wrapper wrapper = new EntityWrapper<TTaxiCard>().ne("companyId", shiroExtUtil.getUser().getObjectId()).orderBy("id", false); if (ToolUtil.isNotEmpty(startTime) && ToolUtil.isNotEmpty(endTime)){ wrapper.between("createTime",startTime + " 00:00:00",endTime + " 23:59:59"); @@ -375,7 +376,7 @@ @RequestMapping("/initSuitCity") @ResponseBody public Object initSuitCity(){ - List<TCompanyCity> list = companyCityService.selectList(new EntityWrapper<TCompanyCity>().eq("companyId", ShiroExtUtil.getUser().getObjectId())); + List<TCompanyCity> list = companyCityService.selectList(new EntityWrapper<TCompanyCity>().eq("companyId", shiroExtUtil.getUser().getObjectId())); List<String> stringList = new ArrayList<>(); for (TCompanyCity tCompanyCity : list) { String area = ""; @@ -424,12 +425,12 @@ @RequestMapping("/add") @ResponseBody public Object add(TTaxiCard taxiCard) { - Integer companyId = ShiroExtUtil.getUser().getObjectId(); - Integer createUserId = ShiroExtUtil.getUser().getId(); + Integer companyId = shiroExtUtil.getUser().getObjectId(); + Integer createUserId = shiroExtUtil.getUser().getId(); taxiCard.setCompanyId(companyId); taxiCard.setCreateUserId(createUserId); taxiCard.setState(2); - if (ShiroExtUtil.getUser().getRoleType() == 1) { + if (shiroExtUtil.getUser().getRoleType() == 1) { taxiCard.setAuditStatus(2); } else { taxiCard.setAuditStatus(1); @@ -508,7 +509,7 @@ @RequestMapping("/searchCoupons") @ResponseBody public Object searchCoupons(){ - Integer companyId = ShiroExtUtil.getUser().getObjectId(); + Integer companyId = shiroExtUtil.getUser().getObjectId(); return couponRecordService.selectList(new EntityWrapper<SysCouponRecord>().eq("companyId",companyId)); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TUserController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TUserController.java index e88a709..8bbfca0 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TUserController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TUserController.java @@ -11,7 +11,9 @@ import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.core.util.WoUtil; -import com.stylefeng.guns.modular.system.model.*; +import com.stylefeng.guns.modular.system.model.TBalanceModifyRecord; +import com.stylefeng.guns.modular.system.model.TCompany; +import com.stylefeng.guns.modular.system.model.TUser; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.ExcelExportUtil; import com.stylefeng.guns.modular.system.util.HttpRequestUtil; @@ -28,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; @@ -44,12 +47,14 @@ @Controller @RequestMapping("/tUser") public class TUserController extends BaseController { - + private String PREFIX = "/system/tUser/"; - + @Autowired private ITUserService tUserService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到用户管理首页 */ @@ -57,7 +62,7 @@ public String index() { return PREFIX + "tUser.html"; } - + /** * 跳转到修改用户管理 */ @@ -115,7 +120,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tUserService.getUserList(page, beginTime, endTime, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), isAuth, state, id, nickName, phone, companyName)); + page.setRecords(tUserService.getUserList(page, beginTime, endTime, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), isAuth, state, id, nickName, phone, companyName)); return super.packForBT(page); } /** @@ -137,7 +142,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tUserService.getUserListCoupon(page, beginTime, endTime, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), isAuth, state, id, nickName, phone, companyName)); + page.setRecords(tUserService.getUserListCoupon(page, beginTime, endTime, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), isAuth, state, id, nickName, phone, companyName)); return super.packForBT(page); } @@ -153,45 +158,44 @@ public Object updateBalance(@RequestParam Integer tUserId, @RequestParam Integer updateType, @RequestParam BigDecimal money) { - TUser tUser = tUserService.selectById(tUserId); - Integer objectId = ShiroExtUtil.getUser().getObjectId(); + TUser tUser = tUserService.selectById(tUserId); + Integer objectId = shiroExtUtil.getUser().getObjectId(); - List<TEnterpriseWithdrawal> companyId = tEnterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", objectId)); - if(companyId.size()==0){ - return "5000"; - } - - List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("phone", tUser.getPhone())); - if(userWithdrawals.size()==0){ - return "5001"; - } - - if (SinataUtil.isNotEmpty(tUser)){ - if (1 == updateType.intValue()){ //增加 +// List<TEnterpriseWithdrawal> companyId = tEnterpriseWithdrawalService.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", objectId)); +// if (companyId.size() == 0) { +// return "5000"; +// } +// +// List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("phone", tUser.getPhone())); +// if (userWithdrawals.size() == 0) { +// return "5001"; +// } + + if (SinataUtil.isNotEmpty(tUser)) { + if (1 == updateType.intValue()) { //增加 tUser.setBalance(tUser.getBalance().add(money)); - - }else if (2 == updateType.intValue()){ //减少 - if((tUser.getBalance().subtract(money)).compareTo(new BigDecimal(0)) == -1){ + + } else if (2 == updateType.intValue()) { //减少 + if ((tUser.getBalance().subtract(money)).compareTo(new BigDecimal(0)) == -1) { tUser.setBalance(new BigDecimal(0)); - }else{ + } else { tUser.setBalance(tUser.getBalance().subtract(money)); } } - tUser.setUpdateTime(new Date()); - tUser.setUpdateUser(ShiroExtUtil.getUser().getId()); - tUserService.updateById(tUser); - - + tUser.setUpdateTime(new Date()); + tUser.setUpdateUser(shiroExtUtil.getUser().getId()); + tUserService.updateById(tUser); + + /// 插入余额修改记录 TBalanceModifyRecord tBalanceModifyRecord = new TBalanceModifyRecord(); tBalanceModifyRecord.setCreateTime(DateUtil.parseTime(DateUtil.getTime())); tBalanceModifyRecord.setMoney(money); tBalanceModifyRecord.setType(updateType); - + Random random = new Random(); - String result=""; - for (int i=0;i<8;i++) - { + String result = ""; + for (int i = 0; i < 8; i++) { result+=random.nextInt(10); } tBalanceModifyRecord.setRecordID(result); @@ -222,11 +226,11 @@ public Object updatePassword(@RequestParam Integer tUserId, @RequestParam String password) { TUser tUser = tUserService.selectById(tUserId); - if (SinataUtil.isNotEmpty(tUser)){ + if (SinataUtil.isNotEmpty(tUser)) { tUser.setPassWord(ShiroKit.md5(password, "&a.s")); - tUser.setUpdateTime(new Date()); - tUser.setUpdateUser(ShiroExtUtil.getUser().getId()); - tUserService.updateById(tUser); + tUser.setUpdateTime(new Date()); + tUser.setUpdateUser(shiroExtUtil.getUser().getId()); + tUserService.updateById(tUser); } return SUCCESS_TIP; } @@ -239,23 +243,23 @@ public Object optUser(@RequestParam Integer tUserId,@RequestParam Integer optType,@RequestParam String remark) { TUser tUser = tUserService.selectById(tUserId); if (SinataUtil.isNotEmpty(tUser)){ - if (1 == optType.intValue()){ //冻结 + if (1 == optType.intValue()) { //冻结 tUser.setState(2); tUser.setRemark(remark); - + //增加推送 - Map<String,String> map = new HashMap<>(); + Map<String, String> map = new HashMap<>(); map.put("uid", tUser.getId().toString()); String result = HttpRequestUtil.postRequest(PushURL.freeze_user_url, map); - System.out.println("冻结用户:【userId="+tUser.getId().toString()+"】,调用接口:"+result); - - }else if (2 == optType.intValue()){ //解冻 + System.out.println("冻结用户:【userId=" + tUser.getId().toString() + "】,调用接口:" + result); + + } else if (2 == optType.intValue()) { //解冻 tUser.setState(1); tUser.setRemark(remark); } - tUser.setUpdateTime(new Date()); - tUser.setUpdateUser(ShiroExtUtil.getUser().getId()); - tUserService.updateById(tUser); + tUser.setUpdateTime(new Date()); + tUser.setUpdateUser(shiroExtUtil.getUser().getId()); + tUserService.updateById(tUser); } return SUCCESS_TIP; } @@ -439,9 +443,9 @@ } user.setEmergencyContact(emergencyContact); user.setEmergencyContactNumber(emergencyContactNumber); - if ("是".equals(isAuth)){ + if ("是".equals(isAuth)) { user.setIsAuth(2); - }else if ("否".equals(isAuth)){ + } else if ("否".equals(isAuth)) { user.setIsAuth(1); } user.setName(name); @@ -450,9 +454,9 @@ user.setPassWord(ShiroKit.md5(passWord, "&a.s")); user.setState(1); user.setFlag("1"); - user.setInsertTime(new Date()); - user.setInsertUser(ShiroExtUtil.getUser().getId()); - tUserService.insert(user); + user.setInsertTime(new Date()); + user.setInsertUser(shiroExtUtil.getUser().getId()); + tUserService.insert(user); } } } catch (Exception e) { @@ -550,7 +554,7 @@ */ @RequestMapping(value = "/outUser") public void outUser(HttpServletRequest request, HttpServletResponse response) { - List<Map<String, Object>> listMap = tUserService.getUserListNoPage(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> listMap = tUserService.getUserListNoPage(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId()); // 表格数据【封装】 List<List<String>> dataList = new ArrayList<>(); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVerifiedController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVerifiedController.java index ae5c5dc..cf04a2e 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVerifiedController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVerifiedController.java @@ -4,24 +4,20 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TSystemNotice; -import com.stylefeng.guns.modular.system.model.TUser; +import com.stylefeng.guns.modular.system.model.TVerified; import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; import com.stylefeng.guns.modular.system.service.ITUserService; +import com.stylefeng.guns.modular.system.service.ITVerifiedService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TVerified; -import com.stylefeng.guns.modular.system.service.ITVerifiedService; +import org.springframework.web.bind.annotation.ResponseBody; -import java.util.Date; +import javax.annotation.Resource; import java.util.Map; /** @@ -33,18 +29,20 @@ @Controller @RequestMapping("/tVerified") public class TVerifiedController extends BaseController { - + private String PREFIX = "/system/tVerified/"; - + @Autowired private ITVerifiedService tVerifiedService; - + @Autowired private ITSystemNoticeService tSystemNoticeService; - + @Autowired private ITUserService tUserService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到实名认证列表首页 */ @@ -52,7 +50,7 @@ public String index() { return PREFIX + "tVerified.html"; } - + /** * 跳转到添加实名认证列表 */ @@ -82,13 +80,13 @@ Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tVerifiedService.getVerifiedList(page, beginTime, endTime, userName, userPhone, name, state)); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java index b905dc2..fd926ce 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TVersionManagementController.java @@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.HashMap; @@ -37,18 +38,21 @@ @Controller @RequestMapping("/tVersionManagement") public class TVersionManagementController extends BaseController { - + private String PREFIX = "/system/tVersionManagement/"; - + @Autowired private ITVersionManagementService tVersionManagementService; - + @Autowired private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - + + @Resource + private ShiroExtUtil shiroExtUtil; + @Value("${pushMinistryOfTransport}") private boolean pushMinistryOfTransport; - + /** * 跳转到版本管理首页 */ @@ -99,13 +103,13 @@ String version) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tVersionManagementService.getVersionList(page, beginTime, endTime, version)); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/UserActivityController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/UserActivityController.java index d858278..02b7e03 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/UserActivityController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/UserActivityController.java @@ -1,27 +1,25 @@ package com.stylefeng.guns.modular.system.controller.general; import com.baomidou.mybatisplus.mapper.EntityWrapper; -import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.plugins.Page; import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.page.PageInfoBT; -import com.stylefeng.guns.core.shiro.ShiroKit; +import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.shiro.ShiroUser; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.DateUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; @@ -60,23 +58,26 @@ @Autowired private ISysCouponRecordService sysCouponRecordService; - + @Autowired private ISysRedPacketRecordService sysRedPacketRecordService; - + @Autowired private IUserCouponRecordService userCouponRecordService; - + @Autowired private ITUserRedPacketRecordService redPacketRecordService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转领取统计 + * * @return */ @RequestMapping("/receiveRecord") - public String receiveRecord(Model model,Integer activityId){ - model.addAttribute("activityId",activityId); + public String receiveRecord(Model model, Integer activityId) { + model.addAttribute("activityId", activityId); UserActivity userActivity = userActivityService.selectById(activityId); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); model.addAttribute("startTime", sdf.format(userActivity.getStartTime())); @@ -264,16 +265,16 @@ @RequestMapping(value = "/blanceList") @ResponseBody public Object blanceList(String createTime,Integer activityId) { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(createTime)){ + if (SinataUtil.isNotEmpty(createTime)) { String[] timeArray = createTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(userCouponRecordService.getBlanceList(page,beginTime,endTime,activityId)); + page.setRecords(userCouponRecordService.getBlanceList(page, beginTime, endTime, activityId)); return super.packForBT(page); } /** @@ -289,7 +290,7 @@ startTimes = DateUtil.getDate_str3(timeArray[0]+" 00:00:00"); endTimes = DateUtil.getDate_str3(timeArray[1]+" 23:59:59"); } - Integer uid = ShiroExtUtil.getUser().getId(); + Integer uid = shiroExtUtil.getUser().getId(); return userActivityService.queryUserActivityList(uid, startTimes, endTimes, name, status, offset, limit); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TDispatchController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TDispatchController.java index b8459ea..2e7b2a1 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TDispatchController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TDispatchController.java @@ -6,22 +6,23 @@ import com.stylefeng.guns.core.base.tips.ErrorTip; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; +import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.TCompany; +import com.stylefeng.guns.modular.system.model.TDispatch; import com.stylefeng.guns.modular.system.service.ITCompanyService; +import com.stylefeng.guns.modular.system.service.ITDispatchService; import com.stylefeng.guns.modular.system.service.IUserService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TDispatch; -import com.stylefeng.guns.modular.system.service.ITDispatchService; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -36,46 +37,48 @@ @Controller @RequestMapping("/tDispatch") public class TDispatchController extends BaseController { - - private String PREFIX = "/system/tDispatch/"; - - @Autowired - private ITDispatchService tDispatchService; - - @Autowired - private ITCompanyService tCompanyService; - - @Autowired - private IUserService userService; - - /** - * 跳转到调度管理首页 - */ - @RequestMapping("") - public String index() { - return PREFIX + "tDispatch.html"; - } - - /** + + private String PREFIX = "/system/tDispatch/"; + + @Autowired + private ITDispatchService tDispatchService; + + @Autowired + private ITCompanyService tCompanyService; + + @Autowired + private IUserService userService; + @Resource + private ShiroExtUtil shiroExtUtil; + + /** + * 跳转到调度管理首页 + */ + @RequestMapping("") + public String index() { + return PREFIX + "tDispatch.html"; + } + + /** * 跳转到添加调度管理 */ @RequestMapping("/tDispatch_add") public String tDispatchAdd(Model model) { - model.addAttribute("roleType", ShiroExtUtil.getUser().getRoleType()); - - List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2) - .eq("isCross", 1) - .last(" and state != 1 and FIND_IN_SET(flag,'1,2')")); - model.addAttribute("companyList",companyList); - - if (2 == ShiroExtUtil.getUser().getRoleType()) { - List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3) - .eq("superiorId", ShiroExtUtil.getUser().getObjectId())); - model.addAttribute("franchiseeList", franchiseeList); - } else { - model.addAttribute("franchiseeList", null); - } - return PREFIX + "tDispatch_add.html"; + model.addAttribute("roleType", shiroExtUtil.getUser().getRoleType()); + + List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2) + .eq("isCross", 1) + .last(" and state != 1 and FIND_IN_SET(flag,'1,2')")); + model.addAttribute("companyList", companyList); + + if (2 == shiroExtUtil.getUser().getRoleType()) { + List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3) + .eq("superiorId", shiroExtUtil.getUser().getObjectId())); + model.addAttribute("franchiseeList", franchiseeList); + } else { + model.addAttribute("franchiseeList", null); + } + return PREFIX + "tDispatch_add.html"; } /** @@ -102,26 +105,26 @@ */ @RequestMapping("/tDispatch_update/{tDispatchId}") public String tDispatchUpdate(@PathVariable Integer tDispatchId, Model model) { - TDispatch tDispatch = tDispatchService.selectById(tDispatchId); - model.addAttribute("item",tDispatch); - LogObjectHolder.me().set(tDispatch); - - Integer roleType = ShiroExtUtil.getUser().getRoleType(); - model.addAttribute("roleType",roleType); - if (1 == roleType){ - List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2) - .eq("isCross", 1) - .last(" and state != 1 and FIND_IN_SET(flag,'1,2')")); - model.addAttribute("companyList",companyList); - - List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3) - .eq("superiorId",tDispatch.getCompanyId()) - .eq("isCross", 1) + TDispatch tDispatch = tDispatchService.selectById(tDispatchId); + model.addAttribute("item", tDispatch); + LogObjectHolder.me().set(tDispatch); + + Integer roleType = shiroExtUtil.getUser().getRoleType(); + model.addAttribute("roleType", roleType); + if (1 == roleType) { + List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2) + .eq("isCross", 1) + .last(" and state != 1 and FIND_IN_SET(flag,'1,2')")); + model.addAttribute("companyList", companyList); + + List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3) + .eq("superiorId", tDispatch.getCompanyId()) + .eq("isCross", 1) .last(" and state != 1 and FIND_IN_SET(flag,'1,2')")); model.addAttribute("franchiseeList",franchiseeList); }else if (2 == roleType){ List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3) - .eq("superiorId", ShiroExtUtil.getUser().getObjectId()) + .eq("superiorId", shiroExtUtil.getUser().getObjectId()) .eq("isCross", 1) .last(" and state != 1 and FIND_IN_SET(flag,'1,2')")); model.addAttribute("franchiseeList",franchiseeList); @@ -143,7 +146,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tDispatchService.getDispatchList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, name, companyName, franchiseeName, account, state)); + page.setRecords(tDispatchService.getDispatchList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, name, companyName, franchiseeName, account, state)); return super.packForBT(page); } @@ -153,31 +156,31 @@ @RequestMapping(value = "/add") @ResponseBody public Object add(TDispatch tDispatch) { - //判断账号是否存在 - int count = tDispatchService.selectCount(new EntityWrapper<TDispatch>().eq("account", tDispatch.getAccount()).last(" and FIND_IN_SET(state,'1,2')")); - if (count > 0) { - return new ErrorTip(500, "账号已存在,请重新输入"); - } - Integer roleType = ShiroExtUtil.getUser().getRoleType(); - Integer objectId = ShiroExtUtil.getUser().getObjectId(); - if (2 == roleType) { - tDispatch.setCompanyId(objectId); - } else if (3 == roleType) { - TCompany company = tCompanyService.selectById(objectId); - tDispatch.setCompanyId(company.getSuperiorId()); - tDispatch.setFranchiseeId(objectId); - } - tDispatch.setInsertTime(new Date()); - tDispatch.setInsertUserId(ShiroExtUtil.getUser().getId()); - tDispatch.setInsertUserRole(roleType); - tDispatch.setState(1); - if(tDispatch.getCompanyId() == null){ - Integer objectId1 = userService.selectById(ShiroExtUtil.getUser().getId()).getObjectId(); - tDispatch.setCompanyId(objectId1); - } - tDispatch.setPassword(ShiroKit.md5(tDispatch.getPassword(), "WL:x9#")); - tDispatchService.insert(tDispatch); - return SUCCESS_TIP; + //判断账号是否存在 + int count = tDispatchService.selectCount(new EntityWrapper<TDispatch>().eq("account", tDispatch.getAccount()).last(" and FIND_IN_SET(state,'1,2')")); + if (count > 0) { + return new ErrorTip(500, "账号已存在,请重新输入"); + } + Integer roleType = shiroExtUtil.getUser().getRoleType(); + Integer objectId = shiroExtUtil.getUser().getObjectId(); + if (2 == roleType) { + tDispatch.setCompanyId(objectId); + } else if (3 == roleType) { + TCompany company = tCompanyService.selectById(objectId); + tDispatch.setCompanyId(company.getSuperiorId()); + tDispatch.setFranchiseeId(objectId); + } + tDispatch.setInsertTime(new Date()); + tDispatch.setInsertUserId(shiroExtUtil.getUser().getId()); + tDispatch.setInsertUserRole(roleType); + tDispatch.setState(1); + if (tDispatch.getCompanyId() == null) { + Integer objectId1 = userService.selectById(shiroExtUtil.getUser().getId()).getObjectId(); + tDispatch.setCompanyId(objectId1); + } + tDispatch.setPassword(ShiroKit.md5(tDispatch.getPassword(), "WL:x9#")); + tDispatchService.insert(tDispatch); + return SUCCESS_TIP; } /** @@ -207,28 +210,28 @@ @RequestMapping(value = "/update") @ResponseBody public Object update(TDispatch tDispatch) { - TDispatch obj = tDispatchService.selectById(tDispatch.getId()); - if (!obj.getAccount().equals(tDispatch.getAccount())) { - //判断账号是否存在 - int count = tDispatchService.selectCount(new EntityWrapper<TDispatch>().eq("account", tDispatch.getAccount()).last(" and FIND_IN_SET(state,'1,2')")); - if (count > 0) { - return new ErrorTip(500, "账号已存在,请重新输入"); - } - } - Integer roleType = ShiroExtUtil.getUser().getRoleType(); - Integer objectId = ShiroExtUtil.getUser().getObjectId(); - if (2 == roleType) { - tDispatch.setCompanyId(objectId); - } else if (3 == roleType) { - TCompany company = tCompanyService.selectById(objectId); - tDispatch.setCompanyId(company.getSuperiorId()); - tDispatch.setFranchiseeId(objectId); - } - if (SinataUtil.isNotEmpty(tDispatch.getPassword())) { - tDispatch.setPassword(ShiroKit.md5(tDispatch.getPassword(), "WL:x9#")); - } - tDispatchService.updateById(tDispatch); - return SUCCESS_TIP; + TDispatch obj = tDispatchService.selectById(tDispatch.getId()); + if (!obj.getAccount().equals(tDispatch.getAccount())) { + //判断账号是否存在 + int count = tDispatchService.selectCount(new EntityWrapper<TDispatch>().eq("account", tDispatch.getAccount()).last(" and FIND_IN_SET(state,'1,2')")); + if (count > 0) { + return new ErrorTip(500, "账号已存在,请重新输入"); + } + } + Integer roleType = shiroExtUtil.getUser().getRoleType(); + Integer objectId = shiroExtUtil.getUser().getObjectId(); + if (2 == roleType) { + tDispatch.setCompanyId(objectId); + } else if (3 == roleType) { + TCompany company = tCompanyService.selectById(objectId); + tDispatch.setCompanyId(company.getSuperiorId()); + tDispatch.setFranchiseeId(objectId); + } + if (SinataUtil.isNotEmpty(tDispatch.getPassword())) { + tDispatch.setPassword(ShiroKit.md5(tDispatch.getPassword(), "WL:x9#")); + } + tDispatchService.updateById(tDispatch); + return SUCCESS_TIP; } } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralGoodsController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralGoodsController.java index ce9f2bf..6722859 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralGoodsController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralGoodsController.java @@ -4,19 +4,19 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; -import com.stylefeng.guns.core.util.SinataUtil; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; +import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.TIntegralGoods; import com.stylefeng.guns.modular.system.service.ITIntegralGoodsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; import java.util.Map; @@ -29,12 +29,14 @@ @Controller @RequestMapping("/tIntegralGoods") public class TIntegralGoodsController extends BaseController { - + private String PREFIX = "/system/tIntegralGoods/"; - + @Autowired private ITIntegralGoodsService tIntegralGoodsService; - + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到商品管理首页 */ @@ -42,7 +44,7 @@ public String index() { return PREFIX + "tIntegralGoods.html"; } - + /** * 跳转到添加商品管理 */ @@ -70,13 +72,13 @@ public Object list(String insertTime,String name,Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tIntegralGoodsService.getIntegralGoodsList(page, beginTime, endTime, name, state)); @@ -91,8 +93,8 @@ @ResponseBody public Object add(TIntegralGoods tIntegralGoods) { tIntegralGoods.setInsertTime(new Date()); - tIntegralGoods.setInsertUserId(ShiroExtUtil.getUser().getId()); - tIntegralGoods.setInsertUserRole(ShiroExtUtil.getUser().getRoleType()); + tIntegralGoods.setInsertUserId(shiroExtUtil.getUser().getId()); + tIntegralGoods.setInsertUserRole(shiroExtUtil.getUser().getRoleType()); tIntegralGoods.setState(1); tIntegralGoodsService.insert(tIntegralGoods); return SUCCESS_TIP; diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java index 0117fe6..e63298c 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TIntegralOrderController.java @@ -4,20 +4,18 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TOrderCharter; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.TIntegralOrder; import com.stylefeng.guns.modular.system.service.ITIntegralOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Map; /** @@ -29,12 +27,15 @@ @Controller @RequestMapping("/tIntegralOrder") public class TIntegralOrderController extends BaseController { - + private String PREFIX = "/system/tIntegralOrder/"; - + @Autowired private ITIntegralOrderService tIntegralOrderService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到积分兑换订单首页 */ @@ -42,7 +43,7 @@ public String index() { return PREFIX + "tIntegralOrder.html"; } - + /** * 跳转到查看详情 */ @@ -70,13 +71,13 @@ public Object list(String insertTime,String userName,String goodsName,String consigneeName,String consigneePhone,Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tIntegralOrderService.getIntegralOrderList(page, beginTime, endTime, userName, goodsName, consigneeName, consigneePhone, state)); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java index 37dcf0a..f2ad09a 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TLineController.java @@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -53,16 +54,19 @@ @Autowired private ITLinePriceService itLinePriceService; - + @Autowired private ITLineShiftService itLineShiftService; - + @Autowired private ITCompanyService itCompanyService; - + @Autowired private ITLineCompanyService itLineCompanyService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到跨城站点管理首页 */ @@ -70,7 +74,7 @@ public String index() { return PREFIX + "tLine.html"; } - + /** * 跳转到添加跨城站点管理 */ @@ -150,13 +154,13 @@ public Object list(String insertTime,String name,String insertUser,String modelStr,Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tLineService.getLineList(page, beginTime, endTime, name, insertUser, modelStr, state)); @@ -178,9 +182,9 @@ tLine.setName(name); tLine.setState(1); tLine.setInsertTime(new Date()); - tLine.setInsertUserId(ShiroExtUtil.getUser().getId()); + tLine.setInsertUserId(shiroExtUtil.getUser().getId()); tLineService.insert(tLine); - + //添加线路站点起点+终点 TLineSite start = new TLineSite(); start.setLineId(tLine.getId()); @@ -327,7 +331,7 @@ lineCompany.setLineId(lineId); lineCompany.setCompanyId(jsonObject.getInteger("companyId")); lineCompany.setInsertTime(new Date()); - lineCompany.setInsertUserId(ShiroExtUtil.getUser().getId()); + lineCompany.setInsertUserId(shiroExtUtil.getUser().getId()); itLineCompanyService.insert(lineCompany); } } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharterController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharterController.java index 26d544b..92cee4b 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharterController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharterController.java @@ -4,20 +4,18 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.TOrderEvaluate; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.TOrderCharter; import com.stylefeng.guns.modular.system.service.ITOrderCharterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Map; /** @@ -29,12 +27,15 @@ @Controller @RequestMapping("/tOrderCharter") public class TOrderCharterController extends BaseController { - + private String PREFIX = "/system/tOrderCharter/"; - + @Autowired private ITOrderCharterService tOrderCharterService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到旅游包车订单首页 */ @@ -42,7 +43,7 @@ public String index() { return PREFIX + "tOrderCharter.html"; } - + /** * 跳转到查看详情 */ @@ -70,13 +71,13 @@ public Object list(String insertTime,String userName,String contactName,String contactPhone,String useDemand,Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tOrderCharterService.getCharterOrderList(page, beginTime, endTime, userName, contactName, contactPhone, useDemand, state)); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharteredCarController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharteredCarController.java index c789420..aa204c0 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharteredCarController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCharteredCarController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.List; import java.util.Map; @@ -27,12 +28,15 @@ @Controller @RequestMapping("/tOrderCharteredCar") public class TOrderCharteredCarController extends BaseController { - + private String PREFIX = "/system/tOrderCharteredCar/"; - + @Autowired private ITOrderCharteredCarService tOrderCharteredCarService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到旅游包车订单首页 */ @@ -40,7 +44,7 @@ public String index() { return PREFIX + "tOrderCharteredCar.html"; } - + /** * 跳转到修改旅游包车订单 */ @@ -58,16 +62,16 @@ public Object list(String insertTime,String userName,String contactPerson,String contactPhone,String modelUse,Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { - List<Map<String, Object>> charterCarOrderList = tOrderCharteredCarService.getCharterCarOrderList(page, beginTime, endTime, userName, contactPerson, contactPhone, modelUse, state, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> charterCarOrderList = tOrderCharteredCarService.getCharterCarOrderList(page, beginTime, endTime, userName, contactPerson, contactPhone, modelUse, state, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId()); for (Map<String, Object> map : charterCarOrderList) { String[] prices = map.get("price").toString().split("-"); String p = Double.valueOf(prices[0]) * Integer.valueOf(map.get("peopleNumber").toString()) + "-" + Double.valueOf(prices[1]) * Integer.valueOf(map.get("peopleNumber").toString()); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCrossCityController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCrossCityController.java index 791e5c2..869cec6 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCrossCityController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderCrossCityController.java @@ -68,6 +68,8 @@ @Resource private MongoTemplate mongoTemplate; + @Resource + private ShiroExtUtil shiroExtUtil; /** @@ -102,27 +104,28 @@ model.addAttribute("tOrderCrossCityId",tOrderCrossCityId); return PREFIX + "tOrderCrossCity_track.html"; } - + /** * 获取订单轨迹 + * * @param orderDetailId * @return */ @ResponseBody @RequestMapping(value = "/getOrderTrack", method = RequestMethod.POST) - public ResultUtil getOrderTrack(String orderDetailId){ - if(ToolUtil.isNotEmpty(orderDetailId)){ + public ResultUtil getOrderTrack(Integer orderDetailId) { + if (ToolUtil.isNotEmpty(orderDetailId)) { try { Query query = new Query() .addCriteria(Criteria.where("orderId").is(orderDetailId).and("orderType").is(3)) .with(new Sort(Sort.Direction.ASC, "insertTime")); List<TOrderPosition> positions = mongoTemplate.find(query, TOrderPosition.class); resultUtil = ResultUtil.success(positions); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); resultUtil = ResultUtil.runErr(); } - }else { + } else { resultUtil = ResultUtil.paranErr(); } return resultUtil; @@ -152,7 +155,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tOrderCrossCityService.getCrossCityOrderList(page, beginTime, endTime, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), orderNum, orderSource, userName, userPhone, passengers, passengersPhone, serverCarModelId, driver, lineId, state)); + page.setRecords(tOrderCrossCityService.getCrossCityOrderList(page, beginTime, endTime, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), orderNum, orderSource, userName, userPhone, passengers, passengersPhone, serverCarModelId, driver, lineId, state)); return super.packForBT(page); } @@ -188,16 +191,16 @@ @ResponseBody public Object cancel(@RequestParam Integer tOrderCrossCityId) throws Exception { TOrderCrossCity tOrderCrossCity = tOrderCrossCityService.selectById(tOrderCrossCityId); - ShiroUser user = ShiroExtUtil.getUser(); - + ShiroUser user = shiroExtUtil.getUser(); + TOrderCrossCity orderCrossCity = tOrderCrossCityService.selectById(tOrderCrossCityId); - if(orderCrossCity.getState() > 5 && orderCrossCity.getState() != 11 && orderCrossCity.getState() != 7){ + if (orderCrossCity.getState() > 5 && orderCrossCity.getState() != 11 && orderCrossCity.getState() != 7) { return ResultUtil.error("订单状态不在可取消范围内"); } orderCrossCity.setState(10); tOrderCrossCityService.updateById(orderCrossCity); - - if(orderCrossCity.getDriverId() != null){ + + if (orderCrossCity.getDriverId() != null) { //修改司机信息 LineShiftDriver lineShiftDriver = lineShiftDriverMapper.selectById(orderCrossCity.getLineShiftDriverId()); lineShiftDriver.setLaveSeat(lineShiftDriver.getLaveSeat() + orderCrossCity.getPeopleNumber() > lineShiftDriver.getTotalSeat() ? diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java index 01bf626..409724e 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderLogisticsController.java @@ -57,18 +57,21 @@ @Autowired private IIncomeService incomeService; - + @Autowired private ITDriverService tDriverService; - + @Autowired private ITTimeoutAppealService timeoutAppealService; - + @Autowired private PayMoneyUtil payMoneyUtil; @Autowired private IUserCouponRecordService userCouponRecordService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到小件物流订单首页 */ @@ -76,7 +79,7 @@ public String index() { return PREFIX + "tOrderLogistics.html"; } - + /** * 跳转到添加小件物流订单 */ @@ -118,13 +121,13 @@ Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tOrderLogisticsService.getLogisticsOrderList(page, beginTime, endTime, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), + page.setRecords(tOrderLogisticsService.getLogisticsOrderList(page, beginTime, endTime, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), orderNum, orderSource, type, userName, userPhone, recipient, recipientPhone, driver, state)); return super.packForBT(page); } @@ -138,14 +141,14 @@ @RequestMapping(value = "/cancel") @ResponseBody public Object cancel(@RequestParam Integer tOrderLogisticsId) { - try{ - ShiroUser user = ShiroExtUtil.getUser(); + try { + ShiroUser user = shiroExtUtil.getUser(); TOrderLogistics tOrderLogistics = tOrderLogisticsService.selectById(tOrderLogisticsId); tOrderLogistics.setState(10); - + //已支付的情况下进行退款操作 - if(null != tOrderLogistics.getPayType() && null != tOrderLogistics.getPayMoney()) { - if (tOrderLogistics.getPayType() ==3) {//余额支付 + if (null != tOrderLogistics.getPayType() && null != tOrderLogistics.getPayMoney()) { + if (tOrderLogistics.getPayType() == 3) {//余额支付 TUser tUser = userService.selectById(tOrderLogistics.getUserId()); tUser.setBalance(tUser.getBalance().add(tOrderLogistics.getPayMoney())); userService.updateById(tUser); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java index 3b5918f..56870c6 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java @@ -69,6 +69,9 @@ @Resource private MongoTemplate mongoTemplate; + @Resource + private ShiroExtUtil shiroExtUtil; + /** * 跳转到快车订单首页 @@ -133,38 +136,39 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tOrderPrivateCarService.getPrivateCarOrderList(page, beginTime, endTime, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), + page.setRecords(tOrderPrivateCarService.getPrivateCarOrderList(page, beginTime, endTime, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), orderNum, orderSource, userName, userPhone, passengers, passengersPhone, serverCarModelId, driver, state, rideType)); return super.packForBT(page); } - + private ResultUtil resultUtil; - + /** * 获取订单轨迹 + * * @param orderDetailId * @return */ @ResponseBody @RequestMapping(value = "/getOrderTrack", method = RequestMethod.POST) - public ResultUtil getOrderTrack(String orderDetailId){ - if(ToolUtil.isNotEmpty(orderDetailId)){ + public ResultUtil getOrderTrack(Integer orderDetailId) { + if (ToolUtil.isNotEmpty(orderDetailId)) { try { Query query = new Query() .addCriteria(Criteria.where("orderId").is(orderDetailId).and("orderType").is(1)) .with(new Sort(Sort.Direction.ASC, "insertTime")); List<TOrderPosition> positions = mongoTemplate.find(query, TOrderPosition.class); resultUtil = ResultUtil.success(positions); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); resultUtil = ResultUtil.runErr(); } - }else { + } else { resultUtil = ResultUtil.paranErr(); } return resultUtil; } - + /** * 取消快车订单 */ diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java index da67de9..5d27d19 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java @@ -78,18 +78,19 @@ @Autowired private IPaymentRecordService paymentRecordService; - + @Autowired private IIncomeService incomeService; - + @Autowired private ITOrderLogisticsService orderLogisticsService; - + @Autowired private ITOrderTaxiService orderTaxiService; - - - + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转到快车改派管理首页 */ @@ -202,11 +203,11 @@ } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); //page.setRecords(tReassignService.getPrivateCarReassignOrderList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,originalDriverName,originalDriverPhone,orderNum,nowDriverName,nowDriverPhone,orderState,state)); - List<Map<String, Object>> list = tReassignService.getPrivateCarReassignOrderList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); + List<Map<String, Object>> list = tReassignService.getPrivateCarReassignOrderList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); if(!list.isEmpty()) { Map<String, Object> map = new HashMap<>(); map.put("insertTime", "改派金额合计"); - map.put("money", tReassignService.getPrivateCarReassignOrderListMoney(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state)); + map.put("money", tReassignService.getPrivateCarReassignOrderListMoney(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state)); list.add(map); } page.setRecords(list); @@ -238,7 +239,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = tReassignService.getPrivateCarReassignOrderListEx(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); + List<Map<String, Object>> mapList = tReassignService.getPrivateCarReassignOrderListEx(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -310,11 +311,11 @@ } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); //page.setRecords(tReassignService.getCrossReassignOrderList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,originalDriverName,originalDriverPhone,orderNum,nowDriverName,nowDriverPhone,orderState,state)); - List<Map<String, Object>> list = tReassignService.getCrossReassignOrderList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); - if(!list.isEmpty()){ - Map<String,Object> map = new HashMap<>(); + List<Map<String, Object>> list = tReassignService.getCrossReassignOrderList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); + if(!list.isEmpty()) { + Map<String, Object> map = new HashMap<>(); map.put("insertTime", "改派金额合计"); - map.put("money", tReassignService.getCrossReassignOrderListMoney(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state)); + map.put("money", tReassignService.getCrossReassignOrderListMoney(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state)); list.add(map); } page.setRecords(list); @@ -346,7 +347,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = tReassignService.getCrossReassignOrderListEx(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); + List<Map<String, Object>> mapList = tReassignService.getCrossReassignOrderListEx(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -412,17 +413,17 @@ Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - List<Map<String, Object>> list = tReassignService.getSmallPieceLogisticsList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); - if(!list.isEmpty()){ - Map<String,Object> map = new HashMap<>(); + List<Map<String, Object>> list = tReassignService.getSmallPieceLogisticsList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); + if (!list.isEmpty()) { + Map<String, Object> map = new HashMap<>(); map.put("insertTime", "改派金额合计"); - map.put("money", tReassignService.getSmallPieceLogisticsListMoney(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state)); + map.put("money", tReassignService.getSmallPieceLogisticsListMoney(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state)); list.add(map); } page.setRecords(list); @@ -455,7 +456,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = tReassignService.getSmallPieceLogisticsListEx(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); + List<Map<String, Object>> mapList = tReassignService.getSmallPieceLogisticsListEx(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -527,11 +528,11 @@ } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); //page.setRecords(tReassignService.getTaxiReassignOrderList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,originalDriverName,originalDriverPhone,orderNum,nowDriverName,nowDriverPhone,orderState,state)); - List<Map<String, Object>> list = tReassignService.getTaxiReassignOrderList(page, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); - if(!list.isEmpty()){ - Map<String,Object> map = new HashMap<>(); + List<Map<String, Object>> list = tReassignService.getTaxiReassignOrderList(page, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); + if(!list.isEmpty()) { + Map<String, Object> map = new HashMap<>(); map.put("insertTime", "改派金额合计"); - map.put("money", tReassignService.getTaxiReassignOrderListMoney(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state)); + map.put("money", tReassignService.getTaxiReassignOrderListMoney(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state)); list.add(map); } page.setRecords(list); @@ -563,7 +564,7 @@ beginTime = timeArray[0]; endTime = timeArray[1]; } - List<Map<String, Object>> mapList = tReassignService.getTaxiReassignOrderListEx(ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); + List<Map<String, Object>> mapList = tReassignService.getTaxiReassignOrderListEx(shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), beginTime, endTime, originalDriverName, originalDriverPhone, orderNum, nowDriverName, nowDriverPhone, orderState, state); String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { @@ -686,16 +687,16 @@ @RequestMapping(value = "/opt") @ResponseBody public Object opt(@RequestParam Integer tReassignId,@RequestParam Integer optType) { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); TReassign tReassign = tReassignService.selectById(tReassignId); - if (1 == optType){ + if (1 == optType) { Integer originalDriverId = tReassign.getOriginalDriverId(); - + TDriver driver = itDriverService.selectById(originalDriverId); driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); itDriverService.updateById(driver); - + tReassign.setState(5); tReassignService.updateById(tReassign); //还原订单状态 @@ -771,17 +772,17 @@ public Object optCross(@RequestParam Integer tReassignId,@RequestParam Integer optType) { try { TReassign tReassign = tReassignService.selectById(tReassignId); - ShiroUser user = ShiroExtUtil.getUser(); - if (1 == optType){ - - + ShiroUser user = shiroExtUtil.getUser(); + if (1 == optType) { + + Integer originalDriverId = tReassign.getOriginalDriverId(); - + TDriver driver = itDriverService.selectById(originalDriverId); driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); itDriverService.updateById(driver); - + tReassign.setState(5); tReassign.setReviewer(user.getId()); tReassign.setReviewerType(2); @@ -934,17 +935,17 @@ @ResponseBody public Object optSmall(@RequestParam Integer tReassignId,@RequestParam Integer optType) { try { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); TReassign tReassign = tReassignService.selectById(tReassignId); - if (1 == optType){ + if (1 == optType) { Integer originalDriverId = tReassign.getOriginalDriverId(); - + TDriver driver = itDriverService.selectById(originalDriverId); driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); itDriverService.updateById(driver); - - + + tReassign.setState(5); tReassignService.updateById(tReassign); @@ -1063,12 +1064,12 @@ @RequestMapping(value = "/optTaxi") @ResponseBody public Object optTaxi(@RequestParam Integer tReassignId,@RequestParam Integer optType) { - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); TReassign tReassign = tReassignService.selectById(tReassignId); - if (1 == optType){ - + if (1 == optType) { + Integer originalDriverId = tReassign.getOriginalDriverId(); - + TDriver driver = itDriverService.selectById(originalDriverId); driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java index 354a7d8..e4a1f35 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java @@ -6,18 +6,16 @@ import com.stylefeng.guns.core.base.tips.ErrorTip; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.TServerCarmodel; import com.stylefeng.guns.modular.system.service.ITServerCarmodelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; import java.util.Map; @@ -30,21 +28,24 @@ @Controller @RequestMapping("/tServerCarmodel") public class TServerCarmodelController extends BaseController { - - private String PREFIX = "/system/tServerCarmodel/"; - - @Autowired - private ITServerCarmodelService tServerCarmodelService; - - /** - * 跳转到快车车型设置首页 - */ - @RequestMapping("") - public String index() { - return PREFIX + "tServerCarmodel.html"; - } - - /** + + private String PREFIX = "/system/tServerCarmodel/"; + + @Autowired + private ITServerCarmodelService tServerCarmodelService; + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** + * 跳转到快车车型设置首页 + */ + @RequestMapping("") + public String index() { + return PREFIX + "tServerCarmodel.html"; + } + + /** * 跳转到跨城车型设置首页 */ @RequestMapping("/acrossCity") @@ -127,13 +128,13 @@ @RequestMapping(value = "/list") @ResponseBody public Object list(String name,Integer state) { - Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { - page.setRecords(null); - } else { - page.setRecords(tServerCarmodelService.getServerCarModelList(page, 1, name, state)); - } - return super.packForBT(page); + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + if (shiroExtUtil.getUser().getRoleType() != 1) { + page.setRecords(null); + } else { + page.setRecords(tServerCarmodelService.getServerCarModelList(page, 1, name, state)); + } + return super.packForBT(page); } /** @@ -142,13 +143,13 @@ @RequestMapping(value = "/listAcrossCity") @ResponseBody public Object listAcrossCity(String name,Integer state) { - Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { - page.setRecords(null); - } else { - page.setRecords(tServerCarmodelService.getServerCarModelList(page, 2, name, state)); - } - return super.packForBT(page); + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + if (shiroExtUtil.getUser().getRoleType() != 1) { + page.setRecords(null); + } else { + page.setRecords(tServerCarmodelService.getServerCarModelList(page, 2, name, state)); + } + return super.packForBT(page); } /** @@ -157,13 +158,13 @@ @RequestMapping(value = "/listCharter") @ResponseBody public Object listCharter(String name,Integer state) { - Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { - page.setRecords(null); - } else { - page.setRecords(tServerCarmodelService.getServerCarModelList(page, 3, name, state)); - } - return super.packForBT(page); + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + if (shiroExtUtil.getUser().getRoleType() != 1) { + page.setRecords(null); + } else { + page.setRecords(tServerCarmodelService.getServerCarModelList(page, 3, name, state)); + } + return super.packForBT(page); } /** diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSiteController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSiteController.java index 567ab08..e7d269f 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSiteController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSiteController.java @@ -8,28 +8,25 @@ import com.stylefeng.guns.core.base.controller.BaseController; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; -import com.stylefeng.guns.core.util.DateUtil; +import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.core.util.ToolUtil; -import com.stylefeng.guns.modular.system.model.TDriverLine; import com.stylefeng.guns.modular.system.model.TLocation; import com.stylefeng.guns.modular.system.model.TRegion; +import com.stylefeng.guns.modular.system.model.TSite; import com.stylefeng.guns.modular.system.service.ITLocationService; import com.stylefeng.guns.modular.system.service.ITRegionService; +import com.stylefeng.guns.modular.system.service.ITSiteService; import com.stylefeng.guns.modular.system.util.GDMapElectricFenceUtil; import com.stylefeng.guns.modular.system.util.ResultUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TSite; -import com.stylefeng.guns.modular.system.service.ITSiteService; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -49,18 +46,19 @@ @Autowired private ITSiteService tSiteService; - + @Autowired private ITRegionService tRegionService; - + @Autowired private ITLocationService itLocationService; - + @Autowired private GDMapElectricFenceUtil gdMapElectricFenceUtil; - - - + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 跳转到跨城站点管理首页 */ @@ -128,13 +126,13 @@ public Object list(String insertTime,String name,String insertUser,String city,Integer state) { String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(insertTime)){ + if (SinataUtil.isNotEmpty(insertTime)) { String[] timeArray = insertTime.split(" - "); beginTime = timeArray[0]; endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - if (ShiroExtUtil.getUser().getRoleType() != 1) { + if (shiroExtUtil.getUser().getRoleType() != 1) { page.setRecords(null); } else { page.setRecords(tSiteService.getSiteList(page, beginTime, endTime, name, insertUser, city, state)); @@ -149,12 +147,12 @@ @ResponseBody public Object add(TSite tSite,@RequestParam String subArr) { tSite.setInsertTime(new Date()); - tSite.setInsertUserId(ShiroExtUtil.getUser().getId()); + tSite.setInsertUserId(shiroExtUtil.getUser().getId()); tSite.setState(1); tSiteService.insert(tSite); - + //添加站点区域 - addLocation(subArr,tSite.getId()); + addLocation(subArr, tSite.getId()); return ResultUtil.success(); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java index b5d9323..608d39a 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java @@ -6,27 +6,25 @@ import com.stylefeng.guns.core.base.tips.ErrorTip; import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.constant.factory.PageFactory; -import com.stylefeng.guns.core.shiro.ShiroKit; +import com.stylefeng.guns.core.log.LogObjectHolder; import com.stylefeng.guns.core.util.SinataUtil; import com.stylefeng.guns.modular.system.model.TServerCarmodel; -import com.stylefeng.guns.modular.system.model.User; +import com.stylefeng.guns.modular.system.model.TSystemPrice; import com.stylefeng.guns.modular.system.service.ITServerCarmodelService; +import com.stylefeng.guns.modular.system.service.ITSystemPriceService; import com.stylefeng.guns.modular.system.service.IUserService; import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; import com.stylefeng.guns.modular.system.util.ResultUtil; import net.sf.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.beans.factory.annotation.Autowired; -import com.stylefeng.guns.core.log.LogObjectHolder; -import org.springframework.web.bind.annotation.RequestParam; -import com.stylefeng.guns.modular.system.model.TSystemPrice; -import com.stylefeng.guns.modular.system.service.ITSystemPriceService; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -46,22 +44,22 @@ @Autowired private ITSystemPriceService tSystemPriceService; - + @Autowired private ITServerCarmodelService tServerCarmodelService; - + @Autowired private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; - + @Autowired private IUserService userService; - + @Resource + private ShiroExtUtil shiroExtUtil; + @Value("${pushMinistryOfTransport}") private boolean pushMinistryOfTransport; - - - - + + /** * 跳转到快车价格设置首页 */ @@ -76,13 +74,13 @@ @RequestMapping("/small") public String small(Model model) { //跨城小件物流 - TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("state", 1)); + TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("state", 1)); if (SinataUtil.isNotEmpty(one)){ JSONObject json1 = JSONObject.fromObject(one.getContent()); model.addAttribute("json1",json1); } //同城小件物流 - TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", ShiroExtUtil.getUser().getObjectId()).eq("state", 1)); + TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", shiroExtUtil.getUser().getObjectId()).eq("state", 1)); if (SinataUtil.isNotEmpty(two)){ JSONObject json2 = JSONObject.fromObject(two.getContent()); model.addAttribute("json2",json2); @@ -94,32 +92,32 @@ @RequestMapping("/taxi") public String taxi(Model model) { - Integer id = ShiroExtUtil.getUser().getId(); + Integer id = shiroExtUtil.getUser().getId(); TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 2).eq("companyId", id)); - if (SinataUtil.isNotEmpty(one)){ + if (SinataUtil.isNotEmpty(one)) { JSONObject json1 = JSONObject.fromObject(one.getContent()); - model.addAttribute("json",json1); + model.addAttribute("json", json1); } - return PREFIX + "taxiSet.html"; - } + return PREFIX + "taxiSet.html"; + } /** * 跳转到添加快车价格设置 */ @RequestMapping("/tSystemPrice_add") public String tSystemPriceAdd(Model model) { //查询所有快车车型 - List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", ShiroExtUtil.getUser().getObjectId()).ne("state", 3)); + List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", shiroExtUtil.getUser().getObjectId()).ne("state", 3)); List<TServerCarmodel> modelList = tServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1)); List<TServerCarmodel> serverCarmodels = new ArrayList<>(); - for(TServerCarmodel tsc : modelList){ + for (TServerCarmodel tsc : modelList) { boolean b = true; - for(TSystemPrice tsp : tSystemPrices){ - if(tsc.getId() == tsp.getServerCarModelId()){ + for (TSystemPrice tsp : tSystemPrices) { + if (tsc.getId() == tsp.getServerCarModelId()) { b = false; break; } } - if(b){ + if (b) { serverCarmodels.add(tsc); } } @@ -138,22 +136,22 @@ JSONObject json = JSONObject.fromObject(tSystemPrice.getContent()); model.addAttribute("content",json); - - model.addAttribute("contentPutOne",JSONObject.fromObject(tSystemPrice.getContentPutOne())); - model.addAttribute("contentNotOne",JSONObject.fromObject(tSystemPrice.getContentNotOne())); - model.addAttribute("contentPutTwo",JSONObject.fromObject(tSystemPrice.getContentPutTwo())); - model.addAttribute("contentNotTwo",JSONObject.fromObject(tSystemPrice.getContentNotTwo())); - model.addAttribute("contentPutThree",JSONObject.fromObject(tSystemPrice.getContentPutThree())); - model.addAttribute("contentNotThree",JSONObject.fromObject(tSystemPrice.getContentNotThree())); - model.addAttribute("contentExclusive",JSONObject.fromObject(tSystemPrice.getContentExclusive())); - model.addAttribute("contentPrice",JSONObject.fromObject(tSystemPrice.getContentPrice())); - + + model.addAttribute("contentPutOne", JSONObject.fromObject(tSystemPrice.getContentPutOne())); + model.addAttribute("contentNotOne", JSONObject.fromObject(tSystemPrice.getContentNotOne())); + model.addAttribute("contentPutTwo", JSONObject.fromObject(tSystemPrice.getContentPutTwo())); + model.addAttribute("contentNotTwo", JSONObject.fromObject(tSystemPrice.getContentNotTwo())); + model.addAttribute("contentPutThree", JSONObject.fromObject(tSystemPrice.getContentPutThree())); + model.addAttribute("contentNotThree", JSONObject.fromObject(tSystemPrice.getContentNotThree())); + model.addAttribute("contentExclusive", JSONObject.fromObject(tSystemPrice.getContentExclusive())); + model.addAttribute("contentPrice", JSONObject.fromObject(tSystemPrice.getContentPrice())); + //查询所有快车车型 - List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", ShiroExtUtil.getUser().getObjectId()).ne("state", 3)); + List<TSystemPrice> tSystemPrices = tSystemPriceService.selectList(new EntityWrapper<TSystemPrice>().eq("type", 1).eq("companyId", shiroExtUtil.getUser().getObjectId()).ne("state", 3)); List<TServerCarmodel> modelList = tServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1) .notIn("id", tSystemPrices.stream().map(TSystemPrice::getServerCarModelId).collect(Collectors.toList()))); List<TServerCarmodel> serverCarmodels = new ArrayList<>(); - + modelList.add(tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId())); // boolean b = true; // for(TSystemPrice tsp : tSystemPrices){ @@ -177,7 +175,7 @@ @ResponseBody public Object list(String name,Integer state) { Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tSystemPriceService.getSpecialPriceList(page, ShiroExtUtil.getUser().getObjectId(), name, state)); + page.setRecords(tSystemPriceService.getSpecialPriceList(page, shiroExtUtil.getUser().getObjectId(), name, state)); return super.packForBT(page); } @@ -191,20 +189,20 @@ int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() .eq("type", 1) .eq("serverCarModelId", tSystemPrice.getServerCarModelId()) - .eq("companyId", ShiroExtUtil.getUser().getObjectId()) + .eq("companyId", shiroExtUtil.getUser().getObjectId()) .last(" and not FIND_IN_SET(state,'3')")); - if (count > 0){ + if (count > 0) { TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); - return new ErrorTip(500, "【"+one.getName()+"】已存在,请重新选择"); + return new ErrorTip(500, "【" + one.getName() + "】已存在,请重新选择"); } - tSystemPrice.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + tSystemPrice.setCompanyId(shiroExtUtil.getUser().getObjectId()); tSystemPrice.setType(1); tSystemPrice.setState(1); tSystemPriceService.insert(tSystemPrice); new Thread(new Runnable() { @Override public void run() { - if(pushMinistryOfTransport){//上传数据 + if (pushMinistryOfTransport) {//上传数据 pushMinistryOfTransportUtil.baseInfoCompanyFare(tSystemPrice.getId()); } } @@ -215,15 +213,15 @@ @RequestMapping(value = "/taxiSet") @ResponseBody public Object taxiSet(String content) { - Integer id = ShiroExtUtil.getUser().getId(); + Integer id = shiroExtUtil.getUser().getId(); TSystemPrice tSystemPrice1 = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 2).eq("companyId", id)); - if (tSystemPrice1==null) { + if (tSystemPrice1 == null) { TSystemPrice tSystemPrice = new TSystemPrice(); tSystemPrice.setContent(content); tSystemPrice.setType(2); tSystemPrice.setCompanyId(id); tSystemPriceService.insert(tSystemPrice); - }else { + } else { tSystemPrice1.setContent(content); tSystemPriceService.updateById(tSystemPrice1); } @@ -243,7 +241,7 @@ int count = tSystemPriceService.selectCount(new EntityWrapper<TSystemPrice>() .eq("type", 1) .eq("serverCarModelId", tSystemPrice.getServerCarModelId()) - .eq("companyId", ShiroExtUtil.getUser().getObjectId()) + .eq("companyId", shiroExtUtil.getUser().getObjectId()) .last(" and not FIND_IN_SET(state,'3')")); if (count > 0){ TServerCarmodel one = tServerCarmodelService.selectById(tSystemPrice.getServerCarModelId()); @@ -287,28 +285,28 @@ @ResponseBody public Object smallSubmit(String json1,String json2) { //跨城小件物流 - TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TSystemPrice one = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 5).eq("companyId", shiroExtUtil.getUser().getObjectId())); if (SinataUtil.isNotEmpty(one)){ one.setContent(json1); tSystemPriceService.updateById(one); - }else{ + }else { one = new TSystemPrice(); one.setState(1); one.setType(5); - one.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + one.setCompanyId(shiroExtUtil.getUser().getObjectId()); one.setContent(json1); tSystemPriceService.insert(one); } //同城小件物流 - TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", ShiroExtUtil.getUser().getObjectId())); + TSystemPrice two = tSystemPriceService.selectOne(new EntityWrapper<TSystemPrice>().eq("type", 4).eq("companyId", shiroExtUtil.getUser().getObjectId())); if (SinataUtil.isNotEmpty(two)){ two.setContent(json2); tSystemPriceService.updateById(two); - }else{ + }else { two = new TSystemPrice(); two.setState(1); two.setType(4); - two.setCompanyId(ShiroExtUtil.getUser().getObjectId()); + two.setCompanyId(shiroExtUtil.getUser().getObjectId()); two.setContent(json2); tSystemPriceService.insert(two); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/BlackboardController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/BlackboardController.java index 4dec57e..12f6cdb 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/BlackboardController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/BlackboardController.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.Date; /** @@ -34,36 +35,39 @@ @Autowired private IUserService userService; - - @Autowired - private IRoleService roleService; - - @Autowired - private IDeptService deptService; - - @Autowired - private ITCompanyService companyService; - - private ResultUtil resultUtil; - - /** - * 跳转到黑板 - */ - @RequestMapping("") - public String blackboard(Model model,Integer type) { - //查询当前用户是否有"首页"菜单的权限 - Integer id = ShiroExtUtil.getUser().getId(); - User user = userService.selectById(id); - Integer menuNum = userService.getMenuNumByRole(user.getRoleid()); - if (menuNum > 0){ - return "/home.html"; - } else { - //查询登录次数 - int count = loginLogService.selectCount(new EntityWrapper<LoginLog>().eq("userid", ShiroExtUtil.getUser().getId())); - model.addAttribute("loginNum", count); - - Role role = roleService.selectById(user.getRoleid()); - Dept dept = deptService.selectById(user.getDeptid()); + + @Autowired + private IRoleService roleService; + + @Autowired + private IDeptService deptService; + + @Autowired + private ITCompanyService companyService; + + private ResultUtil resultUtil; + + @Resource + private ShiroExtUtil shiroExtUtil; + + /** + * 跳转到黑板 + */ + @RequestMapping("") + public String blackboard(Model model, Integer type) { + //查询当前用户是否有"首页"菜单的权限 + Integer id = shiroExtUtil.getUser().getId(); + User user = userService.selectById(id); + Integer menuNum = userService.getMenuNumByRole(user.getRoleid()); + if (menuNum > 0) { + return "/home.html"; + } else { + //查询登录次数 + int count = loginLogService.selectCount(new EntityWrapper<LoginLog>().eq("userid", shiroExtUtil.getUser().getId())); + model.addAttribute("loginNum", count); + + Role role = roleService.selectById(user.getRoleid()); + Dept dept = deptService.selectById(user.getDeptid()); model.addAttribute("deptName",dept==null?"顶级":dept.getFullname()); model.addAttribute("roleName", role.getName()); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java index dc9ed70..c07767e 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java @@ -1,10 +1,10 @@ package com.stylefeng.guns.modular.system.controller.system; +import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.code.kaptcha.Constants; import com.stylefeng.guns.core.base.controller.BaseController; -import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.common.exception.InvalidKaptchaException; import com.stylefeng.guns.core.log.LogManager; import com.stylefeng.guns.core.log.factory.LogTaskFactory; @@ -34,7 +34,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.context.request.RequestContextHolder; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -43,6 +42,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import static com.stylefeng.guns.core.support.HttpKit.getIp; @@ -64,7 +64,7 @@ private IUserService userService; @Resource - private RedisTemplate<String, Object> redisTemplate; + private RedisTemplate<String, String> redisTemplate; @Autowired private IShiro shiro; @@ -114,8 +114,7 @@ model.addAttribute("avatar", avatar); model.addAttribute("userName", user.getName()); model.addAttribute("type", 0); - String sessionId = RequestContextHolder.currentRequestAttributes().getSessionId(); - ShiroExtUtil.map.put(sessionId, shiroUser); + redisTemplate.opsForValue().set(loginUser.getOnconUUID(), JSON.toJSONString(shiroUser), 10, TimeUnit.HOURS); return "/index.html"; } @@ -125,7 +124,7 @@ @RequestMapping(value = "/logout", method = RequestMethod.GET) public String logOut(HttpServletRequest request) { request.getSession().invalidate(); -// HttpUtil.get("https://testsso1.teamshub.com/logout?logouturl=https%3A%2F%2Fsso.teamshub.com%2Flogout%3Flogoutat%3Dhttps%3A%2F%2Ftraffic.qytzt.cn%2F"); + HttpUtil.get("https://passport.teamshub.com/logout?logouturl=https%3A%2F%2Fsso.teamshub.com%2Flogout%3F%0Alogoutat%3Dhttps%253A%252F%252Ftraffic.qytzt.cn%253A443%252F"); return REDIRECT + "/"; } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UserMgrController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UserMgrController.java index 91ccac7..55cb4af 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UserMgrController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UserMgrController.java @@ -28,6 +28,7 @@ import com.stylefeng.guns.modular.system.service.IUserService; import com.stylefeng.guns.modular.system.transfer.UserDto; import com.stylefeng.guns.modular.system.util.qianyuntong.EmployeeUtil; +import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil; import com.stylefeng.guns.modular.system.util.qianyuntong.model.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -36,10 +37,12 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import javax.naming.NoPermissionException; import javax.validation.Valid; import java.io.File; import java.util.Date; +import java.util.List; import java.util.Map; import java.util.UUID; @@ -66,6 +69,8 @@ @Autowired private ITCompanyService companyService; + @Resource + private ShiroExtUtil shiroExtUtil; /** @@ -119,7 +124,7 @@ */ @RequestMapping("/user_info") public String userInfo(Model model) { - Integer userId = ShiroExtUtil.getUser().getId(); + Integer userId = shiroExtUtil.getUser().getId(); if (ToolUtil.isEmpty(userId)) { throw new GunsException(BizExceptionEnum.REQUEST_NULL); } @@ -148,8 +153,8 @@ if (!newPwd.equals(rePwd)) { throw new GunsException(BizExceptionEnum.TWO_PWD_NOT_MATCH); } - Integer userId = ShiroExtUtil.getUser().getId(); - User user = userService.selectById(userId); + Integer userId = shiroExtUtil.getUser().getId(); + User user = userService.selectById(userId); String oldMd5 = ShiroKit.md5(oldPwd, user.getSalt()); if (user.getPassword().equals(oldMd5)) { String newMd5 = ShiroKit.md5(newPwd, user.getSalt()); @@ -170,20 +175,20 @@ //创建日期 String beginTime = null; String endTime = null; - if (SinataUtil.isNotEmpty(createTime)) { - String[] timeArray = createTime.split(" - "); - beginTime = timeArray[0]; - endTime = timeArray[1]; - } - if (ShiroExtUtil.getUser().isAdmin()) { - Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(userService.getUserListPage(page, null, name, beginTime, endTime, deptid)); - return super.packForBT(page); - } else { - Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(userService.getUserListPage(page, null, name, beginTime, endTime, deptid)); - return super.packForBT(page); - } + if (SinataUtil.isNotEmpty(createTime)) { + String[] timeArray = createTime.split(" - "); + beginTime = timeArray[0]; + endTime = timeArray[1]; + } + if (shiroExtUtil.getUser().isAdmin()) { + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + page.setRecords(userService.getUserListPage(page, null, name, beginTime, endTime, deptid)); + return super.packForBT(page); + } else { + Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); + page.setRecords(userService.getUserListPage(page, null, name, beginTime, endTime, deptid)); + return super.packForBT(page); + } } /** @@ -202,24 +207,30 @@ if (theUser != null) { throw new GunsException(BizExceptionEnum.USER_ALREADY_REG); } - ShiroUser user1 = ShiroExtUtil.getUser(); + ShiroUser user1 = shiroExtUtil.getUser(); User user2 = userService.selectById(user1.getId()); TCompany tCompany = companyService.selectById(user2.getObjectId()); - SaveStaffNodeRequest request1 = new SaveStaffNodeRequest(); - request1.setMobile(user2.getPhone()); - request1.setEntercode(tCompany.getEnterCode()); - request1.setEmpName(user.getName()); - request1.setEmpNickname(user.getName()); - request1.setLoginNo(user.getAccount()); - request1.setEmpSex(user.getSex() == 1 ? "男" : "女"); - request1.setMphone(user.getPhone()); - request1.setEmail(user.getPhone() + "@qyt.com"); - request1.setDeptId(0); - request1.setPositionId(1); - request1.setSuperLevel(0); - request1.setHideMobile(0); - SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request1); - Long empId = saveStaffNode.getEmpId(); + List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(user.getPhone(), tCompany.getEnterCode()); + Long empId = null; + if(null == userInfoByPhone || userInfoByPhone.size() == 0){ + SaveStaffNodeRequest request1 = new SaveStaffNodeRequest(); + request1.setMobile(tCompany.getPrincipalPhone()); + request1.setEntercode(tCompany.getEnterCode()); + request1.setEmpName(user.getName()); + request1.setEmpNickname(user.getName()); + request1.setLoginNo(user.getAccount()); + request1.setEmpSex(user.getSex() == 1 ? "男" : "女"); + request1.setMphone(user.getPhone()); + request1.setEmail(user.getPhone() + "@qyt.com"); + request1.setDeptId(0); + request1.setPositionId(1); + request1.setSuperLevel(0); + request1.setHideMobile(0); + SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request1); + empId = saveStaffNode.getEmpId(); + }else{ + empId = userInfoByPhone.get(0).getEmpId(); + } // 完善账号信息 user.setSalt(ShiroKit.getRandomSalt(5)); @@ -250,36 +261,41 @@ throw new GunsException(BizExceptionEnum.REQUEST_NULL); } User oldUser = userService.selectById(user.getId()); - ShiroUser user1 = ShiroExtUtil.getUser(); + ShiroUser user1 = shiroExtUtil.getUser(); User user2 = userService.selectById(user1.getId()); TCompany tCompany = companyService.selectById(user2.getObjectId()); //调用中台接口 GetStaffNodeRequest request = new GetStaffNodeRequest(); request.setEmpId(oldUser.getEmpId()); - request.setMobile(user2.getPhone()); + request.setMobile(tCompany.getPrincipalPhone()); request.setEntercode(tCompany.getEnterCode()); StaffNodeInfo staffNode = EmployeeUtil.getStaffNode(request); Long empId = null; if (null == staffNode || "0".equals(staffNode.getIsValid())) { - SaveStaffNodeRequest request1 = new SaveStaffNodeRequest(); - request1.setMobile(user2.getPhone()); - request1.setEntercode(tCompany.getEnterCode()); - request1.setEmpName(user.getName()); - request1.setEmpNickname(user.getName()); - request1.setLoginNo(user.getAccount()); - request1.setEmpSex(user.getSex() == 1 ? "男" : "女"); - request1.setMphone(user.getPhone()); - request1.setEmail(user.getPhone() + "@qyt.com"); - request1.setDeptId(0); - request1.setPositionId(1); - request1.setSuperLevel(0); - request1.setHideMobile(0); - SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request1); - empId = saveStaffNode.getEmpId(); + List<QYTUserInfo> userInfoByPhone = UserUtil.getUserInfoByPhone(user.getPhone(), tCompany.getEnterCode()); + if(null == userInfoByPhone || userInfoByPhone.size() == 0){ + SaveStaffNodeRequest request1 = new SaveStaffNodeRequest(); + request1.setMobile(tCompany.getPrincipalPhone()); + request1.setEntercode(tCompany.getEnterCode()); + request1.setEmpName(user.getName()); + request1.setEmpNickname(user.getName()); + request1.setLoginNo(user.getAccount()); + request1.setEmpSex(user.getSex() == 1 ? "男" : "女"); + request1.setMphone(user.getPhone()); + request1.setEmail(user.getPhone() + "@qyt.com"); + request1.setDeptId(0); + request1.setPositionId(1); + request1.setSuperLevel(0); + request1.setHideMobile(0); + SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request1); + empId = saveStaffNode.getEmpId(); + }else{ + empId = userInfoByPhone.get(0).getEmpId(); + } } else { EditStaffNodeRequest request1 = new EditStaffNodeRequest(); request1.setEmpId(staffNode.getEmpId()); - request1.setMobile(user2.getPhone()); + request1.setMobile(tCompany.getPrincipalPhone()); request1.setEntercode(tCompany.getEnterCode()); request1.setEnterId(Long.valueOf(tCompany.getEnterCode())); request1.setEmpName(user.getName()); @@ -292,8 +308,8 @@ request1.setPositionId(1); request1.setSuperLevel(0); request1.setHideMobile(0); - EmployeeUtil.editStaffNode(request1); - empId = staffNode.getEmpId(); + EmployeeUtil.editStaffNode(request1); + empId = staffNode.getEmpId(); } oldUser.setEmpId(empId); oldUser.setEntercode(tCompany.getEnterCode()); @@ -302,11 +318,11 @@ user.setEntercode(tCompany.getEnterCode()); user.setEnterId(Long.valueOf(tCompany.getEnterCode())); - if (ShiroExtUtil.getUser().isAdmin) { + if (shiroExtUtil.getUser().isAdmin) { this.userService.updateById(UserFactory.editUser(user, oldUser)); return SUCCESS_TIP; } else { - ShiroUser shiroUser = ShiroExtUtil.getUser(); + ShiroUser shiroUser = shiroExtUtil.getUser(); if (shiroUser.getId().equals(user.getId())) { this.userService.updateById(UserFactory.editUser(user, oldUser)); return SUCCESS_TIP; @@ -331,19 +347,19 @@ throw new GunsException(BizExceptionEnum.CANT_DELETE_ADMIN); } User user = userService.selectById(userId); - ShiroUser user1 = ShiroExtUtil.getUser(); + ShiroUser user1 = shiroExtUtil.getUser(); User user2 = userService.selectById(user1.getId()); TCompany tCompany = companyService.selectById(user2.getObjectId()); //调用中台接口 GetStaffNodeRequest request = new GetStaffNodeRequest(); request.setEmpId(user.getEmpId()); - request.setMobile(user2.getPhone()); + request.setMobile(tCompany.getPrincipalPhone()); request.setEntercode(tCompany.getEnterCode()); StaffNodeInfo staffNode = EmployeeUtil.getStaffNode(request); if (null != staffNode && "1".equals(staffNode.getIsValid())) { DeleteStafNodeRequest request1 = new DeleteStafNodeRequest(); request1.setEmpId(user.getEnterId()); - request1.setMobile(user2.getPhone()); + request1.setMobile(tCompany.getPrincipalPhone()); request1.setEntercode(tCompany.getEnterCode()); EmployeeUtil.ecrmDeleteStafNode(request1); } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java index 8bb5fa4..7ce2dbc 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java @@ -60,6 +60,8 @@ @Resource private MongoTemplate mongoTemplate; + @Resource + private ShiroExtUtil shiroExtUtil; /** * 跳转到出租车订单首页 @@ -148,7 +150,7 @@ endTime = timeArray[1]; } Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); - page.setRecords(tOrderTaxiService.getTaxiOrderList(page, beginTime, endTime, ShiroExtUtil.getUser().getRoleType(), ShiroExtUtil.getUser().getObjectId(), orderNum, orderSource, userName, userPhone, passengers, passengersPhone, driver, state)); + page.setRecords(tOrderTaxiService.getTaxiOrderList(page, beginTime, endTime, shiroExtUtil.getUser().getRoleType(), shiroExtUtil.getUser().getObjectId(), orderNum, orderSource, userName, userPhone, passengers, passengersPhone, driver, state)); return super.packForBT(page); } @@ -167,7 +169,7 @@ } private ResultUtil resultUtil; - + /** * 获取订单轨迹 * @@ -176,7 +178,7 @@ */ @ResponseBody @RequestMapping(value = "/getOrderTrack", method = RequestMethod.POST) - public ResultUtil getOrderTrack(String orderDetailId) { + public ResultUtil getOrderTrack(Integer orderDetailId) { if (ToolUtil.isNotEmpty(orderDetailId)) { try { Query query = new Query() @@ -274,6 +276,12 @@ @RequestMapping(value = "/add") @ResponseBody public Object add(TOrderTaxi tOrderTaxi) { + if (ToolUtil.isEmpty(tOrderTaxi.getStartLat()) || ToolUtil.isEmpty(tOrderTaxi.getStartLon())) { + return "请选择有效的上车地点"; + } + if (ToolUtil.isEmpty(tOrderTaxi.getEndLat()) || ToolUtil.isEmpty(tOrderTaxi.getEndLon())) { + return "请选择有效的下车地点"; + } TUser user = userService.selectOne(new EntityWrapper<TUser>().eq("phone", tOrderTaxi.getPassengersPhone())); if (ToolUtil.isNotEmpty(user)) {/// 用户是平台用户 tOrderTaxi.setOrderNum("TAXI" + String.valueOf(1000000 + tOrderTaxiService.selectList(null).size() + 1).substring(1)); @@ -307,7 +315,7 @@ tUser.setInsertTime(DateUtil.parseTime(DateUtil.getTime())); tUser.setPhone(tOrderTaxi.getPassengersPhone()); tUser.setName(tOrderTaxi.getPassengers()); - tUser.setNickName("QYT" + String.valueOf(1000000 + userService.selectList(null).size() + 1).substring(1)); + tUser.setNickName("GRJY" + String.valueOf(1000000 + userService.selectList(null).size() + 1).substring(1)); userService.insert(tUser); /// 存入订单信息 diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarRentalServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarRentalServiceImpl.java index 548d313..0502fa3 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarRentalServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarRentalServiceImpl.java @@ -3,7 +3,6 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.dao.CarRentalMapper; import com.stylefeng.guns.modular.system.model.*; @@ -12,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -22,54 +22,56 @@ @Autowired private ITCarBrandService carBrandService; - - @Autowired - private ITRegionService regionService; - - @Autowired - private IMessNumService messNumService; - - @Autowired - private ITSystemNoticeService systemNoticeService; - - - - @Override - public Map<String, Object> list(String createTime, String title, Integer brandId, String insertUser, List<Integer> status, Integer userType, Integer offset, Integer limit) throws Exception { - Integer companyId = ShiroExtUtil.getUser().getRoleType() == 1 ? null : ShiroExtUtil.getUser().getObjectId(); - String start = ""; - String end = ""; - if(ToolUtil.isNotEmpty(createTime)){ - String[] split = createTime.split(" - "); - start = split[0]; - end = split[1]; - } - Map<String, Object> map = new HashMap<>(); - List<Map<String, Object>> list = this.baseMapper.list(companyId, start, end, title, brandId, insertUser, status, userType, offset, limit); - int count = this.baseMapper.listCount(companyId, start, end, title, brandId, insertUser, status, userType); - map.put("rows", list); + + @Autowired + private ITRegionService regionService; + + @Autowired + private IMessNumService messNumService; + + @Autowired + private ITSystemNoticeService systemNoticeService; + + @Resource + private ShiroExtUtil shiroExtUtil; + + + @Override + public Map<String, Object> list(String createTime, String title, Integer brandId, String insertUser, List<Integer> status, Integer userType, Integer offset, Integer limit) throws Exception { + Integer companyId = shiroExtUtil.getUser().getRoleType() == 1 ? null : shiroExtUtil.getUser().getObjectId(); + String start = ""; + String end = ""; + if (ToolUtil.isNotEmpty(createTime)) { + String[] split = createTime.split(" - "); + start = split[0]; + end = split[1]; + } + Map<String, Object> map = new HashMap<>(); + List<Map<String, Object>> list = this.baseMapper.list(companyId, start, end, title, brandId, insertUser, status, userType, offset, limit); + int count = this.baseMapper.listCount(companyId, start, end, title, brandId, insertUser, status, userType); + map.put("rows", list); map.put("total", count); return map; } @Override public ResultUtil addCarRental(CarRental carRental) throws Exception { - carRental.setUserType(3); - carRental.setUserId(ShiroExtUtil.getUser().getObjectId()); - TCarBrand tCarBrand = carBrandService.selectById(carRental.getBrandId()); - carRental.setBrandName(tCarBrand.getName()); - TRegion region = regionService.selectOne(new EntityWrapper<TRegion>().eq("code", carRental.getProvinceCode())); - carRental.setProvinceName(region.getName()); - region = regionService.selectOne(new EntityWrapper<TRegion>().eq("code", carRental.getCityCode())); - carRental.setCityName(region.getName()); - carRental.setCreateTime(new Date()); - carRental.setFirstPageShow(2); - carRental.setInsertUser(ShiroExtUtil.getUser().getId()); - if (ShiroExtUtil.getUser().getRoleType() == 1 && carRental.getStatus() == 1) { - carRental.setStatus(4); - } - this.insert(carRental); - return ResultUtil.success(); + carRental.setUserType(3); + carRental.setUserId(shiroExtUtil.getUser().getObjectId()); + TCarBrand tCarBrand = carBrandService.selectById(carRental.getBrandId()); + carRental.setBrandName(tCarBrand.getName()); + TRegion region = regionService.selectOne(new EntityWrapper<TRegion>().eq("code", carRental.getProvinceCode())); + carRental.setProvinceName(region.getName()); + region = regionService.selectOne(new EntityWrapper<TRegion>().eq("code", carRental.getCityCode())); + carRental.setCityName(region.getName()); + carRental.setCreateTime(new Date()); + carRental.setFirstPageShow(2); + carRental.setInsertUser(shiroExtUtil.getUser().getId()); + if (shiroExtUtil.getUser().getRoleType() == 1 && carRental.getStatus() == 1) { + carRental.setStatus(4); + } + this.insert(carRental); + return ResultUtil.success(); } @Override diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityHistoryServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityHistoryServiceImpl.java index c0bccce..0f38b14 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityHistoryServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityHistoryServiceImpl.java @@ -1,17 +1,17 @@ package com.stylefeng.guns.modular.system.service.impl; import com.baomidou.mybatisplus.plugins.Page; +import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ExcelUtil; import com.stylefeng.guns.core.util.ToolUtil; -import com.stylefeng.guns.modular.system.model.DriverActivityHistory; import com.stylefeng.guns.modular.system.dao.DriverActivityHistoryMapper; +import com.stylefeng.guns.modular.system.model.DriverActivityHistory; import com.stylefeng.guns.modular.system.service.IDriverActivityHistoryService; -import com.baomidou.mybatisplus.service.impl.ServiceImpl; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -26,60 +26,64 @@ */ @Service public class DriverActivityHistoryServiceImpl extends ServiceImpl<DriverActivityHistoryMapper, DriverActivityHistory> implements IDriverActivityHistoryService { - @Override - public List<Map<String, Object>> getList(Page<Map<String, Object>> page, Integer activityId, Integer type) { - return this.baseMapper.getList(page,activityId,type); - } - - @Override - public List<Map<String, Object>> getListt(Integer activityId, Integer type) { - return this.baseMapper.getListt(activityId, type); - } - - - @Override + + @Resource + private ShiroExtUtil shiroExtUtil; + + @Override + public List<Map<String, Object>> getList(Page<Map<String, Object>> page, Integer activityId, Integer type) { + return this.baseMapper.getList(page, activityId, type); + } + + @Override + public List<Map<String, Object>> getListt(Integer activityId, Integer type) { + return this.baseMapper.getListt(activityId, type); + } + + + @Override public Map<String, Object> rewardDetailsList(String driverName, String driverPhone, String createTime, Integer offset, Integer limit) throws Exception { - String startTime = ""; - String endTime = ""; - if (ToolUtil.isNotEmpty(createTime)) { - String[] split = createTime.split(" - "); - startTime = split[0]; - endTime = split[1]; - } - List<Map<String, Object>> list = this.baseMapper.rewardDetailsList(ShiroExtUtil.getUser().getObjectId(), driverName, driverPhone, startTime, endTime, offset, limit); - int count = this.baseMapper.rewardDetailsListCount(ShiroExtUtil.getUser().getObjectId(), driverName, driverPhone, startTime, endTime); - Double aDouble = this.baseMapper.rewardDetailsListSum(ShiroExtUtil.getUser().getObjectId(), driverName, driverPhone, startTime, endTime); - Map<String, Object> map1 = new HashMap<>(); - map1.put("insertTime", "合计"); - map1.put("money", aDouble); - list.add(map1); - - Map<String, Object> map = new HashMap<>(); - map.put("rows", list); - map.put("total", count); - return map; - } + String startTime = ""; + String endTime = ""; + if (ToolUtil.isNotEmpty(createTime)) { + String[] split = createTime.split(" - "); + startTime = split[0]; + endTime = split[1]; + } + List<Map<String, Object>> list = this.baseMapper.rewardDetailsList(shiroExtUtil.getUser().getObjectId(), driverName, driverPhone, startTime, endTime, offset, limit); + int count = this.baseMapper.rewardDetailsListCount(shiroExtUtil.getUser().getObjectId(), driverName, driverPhone, startTime, endTime); + Double aDouble = this.baseMapper.rewardDetailsListSum(shiroExtUtil.getUser().getObjectId(), driverName, driverPhone, startTime, endTime); + Map<String, Object> map1 = new HashMap<>(); + map1.put("insertTime", "合计"); + map1.put("money", aDouble); + list.add(map1); + + Map<String, Object> map = new HashMap<>(); + map.put("rows", list); + map.put("total", count); + return map; + } @Override public HSSFWorkbook exportRewardDetails(String driverName, String driverPhone, String createTime) throws Exception { - String startTime = ""; - String endTime = ""; - if(ToolUtil.isNotEmpty(createTime)){ - String[] split = createTime.split(" - "); - startTime = split[0]; - endTime = split[1]; - } - List<Map<String, Object>> list = this.baseMapper.rewardDetailsList(ShiroExtUtil.getUser().getObjectId(), driverName, driverPhone, startTime, endTime, null, null); - String[] title = new String[]{"时间", "司机名称", "活动名称", "奖励支出"}; - String[][] values = new String[list.size()][5]; - for (int i = 0; i < list.size(); i++) { - Map<String, Object> map = list.get(i); - values[i][0] = null != map.get("insertTime") ? map.get("insertTime").toString() : ""; - values[i][1] = null != map.get("name") ? map.get("name").toString() : ""; - values[i][2] = null != map.get("activityName") ? map.get("activityName").toString() : ""; - values[i][3] = null != map.get("money") ? map.get("money").toString() : ""; - } - - return ExcelUtil.getHSSFWorkbook("奖励明细", title, values, null); + String startTime = ""; + String endTime = ""; + if (ToolUtil.isNotEmpty(createTime)) { + String[] split = createTime.split(" - "); + startTime = split[0]; + endTime = split[1]; + } + List<Map<String, Object>> list = this.baseMapper.rewardDetailsList(shiroExtUtil.getUser().getObjectId(), driverName, driverPhone, startTime, endTime, null, null); + String[] title = new String[]{"时间", "司机名称", "活动名称", "奖励支出"}; + String[][] values = new String[list.size()][5]; + for (int i = 0; i < list.size(); i++) { + Map<String, Object> map = list.get(i); + values[i][0] = null != map.get("insertTime") ? map.get("insertTime").toString() : ""; + values[i][1] = null != map.get("name") ? map.get("name").toString() : ""; + values[i][2] = null != map.get("activityName") ? map.get("activityName").toString() : ""; + values[i][3] = null != map.get("money") ? map.get("money").toString() : ""; + } + + return ExcelUtil.getHSSFWorkbook("奖励明细", title, values, null); } } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityServiceImpl.java index bf253ed..31718f2 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityServiceImpl.java @@ -2,12 +2,11 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.plugins.Page; +import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.shiro.ShiroUser; - -import com.stylefeng.guns.modular.system.model.DriverActivity; import com.stylefeng.guns.modular.system.dao.DriverActivityMapper; +import com.stylefeng.guns.modular.system.model.DriverActivity; import com.stylefeng.guns.modular.system.model.DriverActivityOnline; import com.stylefeng.guns.modular.system.model.DriverActivityOrder; import com.stylefeng.guns.modular.system.model.DriverActivityRegistered; @@ -15,12 +14,11 @@ import com.stylefeng.guns.modular.system.service.IDriverActivityOrderService; import com.stylefeng.guns.modular.system.service.IDriverActivityRegisteredService; import com.stylefeng.guns.modular.system.service.IDriverActivityService; -import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.modular.system.util.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.math.BigDecimal; +import javax.annotation.Resource; import java.util.Date; import java.util.List; import java.util.Map; @@ -35,24 +33,27 @@ */ @Service public class DriverActivityServiceImpl extends ServiceImpl<DriverActivityMapper, DriverActivity> implements IDriverActivityService { - - + + @Autowired private IDriverActivityOnlineService driverActivityOnlineService; - + @Autowired private IDriverActivityOrderService driverActivityOrderService; - + @Autowired private IDriverActivityRegisteredService driverActivityRegisteredService; - + + @Resource + private ShiroExtUtil shiroExtUtil; + @Override public List<Map<String, Object>> getList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, Integer companyType, Integer companyId) { - return this.baseMapper.getList(page,beginTime,endTime,name,companyType,companyId); + return this.baseMapper.getList(page, beginTime, endTime, name, companyType, companyId); } - + @Override public void insertOrUpdate(Integer id, String staTime, String startTime, String num1, Double num2, Double num3, Integer num4, Double num5, Integer num6, Double num7, Integer num8, Double num9, Integer num10, Double num11) { //判断id是否为空,为空执行添加,或者执行修改 @@ -60,13 +61,13 @@ String[] timeArray = startTime.split(" - "); Date startTimes = DateUtil.getDate_str3(timeArray[0]); Date endTimes = DateUtil.getDate_str3(timeArray[1]); - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); Date nowDay = new Date(); //添加活动 DriverActivity driverActivity = new DriverActivity(); driverActivity.setInsertTime(nowDay); - driverActivity.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - driverActivity.setCompanyType(ShiroExtUtil.getUser().getRoleType()); + driverActivity.setCompanyId(shiroExtUtil.getUser().getObjectId()); + driverActivity.setCompanyType(shiroExtUtil.getUser().getRoleType()); driverActivity.setStatus(driverActivity.getCompanyType() == 1 ? 3 : 1); driverActivity.setName(num1); driverActivity.setStartTime(startTimes); @@ -141,14 +142,14 @@ String[] timeArray = startTime.split(" - "); Date startTimes = DateUtil.getDate_str3(timeArray[0]); Date endTimes = DateUtil.getDate_str3(timeArray[1]); - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); Date nowDay = new Date(); //添加活动 DriverActivity driverActivity = new DriverActivity(); driverActivity.setId(id); - driverActivity.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - driverActivity.setCompanyType(ShiroExtUtil.getUser().getRoleType()); + driverActivity.setCompanyId(shiroExtUtil.getUser().getObjectId()); + driverActivity.setCompanyType(shiroExtUtil.getUser().getRoleType()); driverActivity.setStatus(driverActivity.getCompanyType() == 1 ? 3 : 1); driverActivity.setName(num1); driverActivity.setStartTime(startTimes); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/IncomeServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/IncomeServiceImpl.java index efd09df..5ab2901 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/IncomeServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/IncomeServiceImpl.java @@ -1,18 +1,17 @@ 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.core.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ExcelUtil; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.dao.IncomeMapper; -import com.stylefeng.guns.modular.system.model.*; +import com.stylefeng.guns.modular.system.model.Income; import com.stylefeng.guns.modular.system.service.*; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; @@ -35,17 +34,19 @@ @Autowired private ITOrderCallService orderCallService; - + @Autowired private ITUserService userService; - + @Autowired private ITOrderCharteredCarService orderCharteredCarService; - + @Autowired private ITDriverService driverService; - - + @Resource + private ShiroExtUtil shiroExtUtil; + + /** * 添加数据 * @param userType @@ -230,7 +231,7 @@ Map<String, Object> maps = new HashMap<>(); List<Map<String, Object>> datas = new ArrayList<>(); - List<Map<String, Object>> list2 = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, offset, limit); + List<Map<String, Object>> list2 = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, offset, limit); for (Map<String, Object> income : list2) { Double orderMoney = Double.valueOf(null != income.get("orderMoney") ? income.get("orderMoney").toString() : "0"); Double payMoney = Double.valueOf(income.get("payMoney").toString()); @@ -318,7 +319,7 @@ } List<Map<String, Object>> datas1 = new ArrayList<>(); - list2 = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); + list2 = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); for (Map<String, Object> income : list2) { Double orderMoney = Double.valueOf(null != income.get("orderMoney") ? income.get("orderMoney").toString() : "0"); Double payMoney = Double.valueOf(income.get("payMoney").toString()); @@ -442,16 +443,16 @@ public HSSFWorkbook exportSummaryOfIncomeDetails(String insertTime, Integer orderType, Integer incomeType, String name, String phone) throws Exception { String startTime = ""; String endTime = ""; - if(ToolUtil.isNotEmpty(insertTime)){ + if (ToolUtil.isNotEmpty(insertTime)) { String[] split = insertTime.split(" - "); startTime = split[0]; endTime = split[1]; } - List<Map<String, Object>> list = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); + List<Map<String, Object>> list = this.baseMapper.summaryOfIncomeDetailsListGroupSum1(1, shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); List<Map<String, Object>> datas = new ArrayList<>(); Integer num = 0; - + for (Map<String, Object> income : list) { Double orderMoney = Double.valueOf(null != income.get("orderMoney") ? income.get("orderMoney").toString() : "0"); Double payMoney = Double.valueOf(income.get("payMoney").toString()); @@ -459,7 +460,7 @@ Double overtimeDeduction = Double.valueOf(income.get("overtimeDeduction").toString()); Double complaint = Double.valueOf(income.get("complaint").toString()); String insertTime1 = income.get("insertTime").toString(); - Double taxiCardRevenue = Double.valueOf(new BigDecimal(income.get("taxiCardRevenue").toString()).setScale(2,RoundingMode.HALF_UP).toString()); + Double taxiCardRevenue = Double.valueOf(new BigDecimal(income.get("taxiCardRevenue").toString()).setScale(2, RoundingMode.HALF_UP).toString()); Double other = Double.valueOf(new BigDecimal(income.get("other").toString()).setScale(2,RoundingMode.HALF_UP).toString()); money = orderMoney - money; @@ -576,8 +577,8 @@ } Map<String, Object> maps = new HashMap<>(); - List<Map<String, Object>> list1 = this.baseMapper.summaryOfSpendingDetailsList1(ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, offset, limit); - List<Map<String, Object>> list2 = this.baseMapper.summaryOfSpendingDetailsList1(ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); + List<Map<String, Object>> list1 = this.baseMapper.summaryOfSpendingDetailsList1(shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, offset, limit); + List<Map<String, Object>> list2 = this.baseMapper.summaryOfSpendingDetailsList1(shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); BigDecimal orderRevenue = new BigDecimal("0"); BigDecimal activityAward = new BigDecimal("0"); BigDecimal other = new BigDecimal("0"); @@ -596,9 +597,9 @@ map.put("all", all.toString()); list1.add(map); maps.put("rows", list1); - System.out.println("支出明细"+list1); + System.out.println("支出明细" + list1); - list1 = this.baseMapper.summaryOfSpendingDetailsList1(ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); + list1 = this.baseMapper.summaryOfSpendingDetailsList1(shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); maps.put("total", list1.size()); return maps; } @@ -607,13 +608,13 @@ public HSSFWorkbook exportSummaryOfSpendingDetails(String insertTime, Integer orderType, Integer incomeType, String name, String phone) throws Exception { String startTime = ""; String endTime = ""; - if(ToolUtil.isNotEmpty(insertTime)){ + if (ToolUtil.isNotEmpty(insertTime)) { String[] split = insertTime.split(" - "); startTime = split[0]; endTime = split[1]; } - List<Map<String, Object>> list1 = this.baseMapper.summaryOfSpendingDetailsList1(ShiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); + List<Map<String, Object>> list1 = this.baseMapper.summaryOfSpendingDetailsList1(shiroExtUtil.getUser().getObjectId(), startTime, endTime, orderType, incomeType, name, phone, null, null); String[] title = new String[]{"时间", "订单类型", "收益类型", "司机名称", "司机手机号", "订单应支付金额", "平台奖励支出", "其他支出", "支出合计"}; String[][] values = new String[list1.size()][9]; int n = 0; @@ -622,8 +623,8 @@ Object insertTime1 = map1.get("insertTime"); values[n][0] = insertTime1.toString(); values[n][1] = ""; - if(null != map1.get("orderType")){ - switch (Integer.valueOf(map1.get("orderType").toString())){ + if (null != map1.get("orderType")) { + switch (Integer.valueOf(map1.get("orderType").toString())) { case 1: values[n][1] = "快车"; break; diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RecruitServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RecruitServiceImpl.java index 2108680..3ab0649 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RecruitServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RecruitServiceImpl.java @@ -2,26 +2,29 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.system.dao.RecruitMapper; import com.stylefeng.guns.modular.system.model.Recruit; import com.stylefeng.guns.modular.system.service.IRecruitService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; @Service public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> implements IRecruitService { - + + @Resource + private ShiroExtUtil shiroExtUtil; + @Override public Map<String, Object> list(String createTime, String title, String experienceRequirements, String insertUser, String driverType, Integer offset, Integer limit) throws Exception { - Integer companyId = ShiroExtUtil.getUser().getRoleType() == 1 ? null : ShiroExtUtil.getUser().getObjectId(); + Integer companyId = shiroExtUtil.getUser().getRoleType() == 1 ? null : shiroExtUtil.getUser().getObjectId(); String start = ""; String end = ""; - if(ToolUtil.isNotEmpty(createTime)){ + if (ToolUtil.isNotEmpty(createTime)) { String[] split = createTime.split(" - "); start = split[0]; end = split[1]; diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SellingCarServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SellingCarServiceImpl.java index ab39c77..5a4b30d 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SellingCarServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SellingCarServiceImpl.java @@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -21,25 +22,26 @@ @Autowired private ITCarBrandService carBrandService; - + @Autowired private ITRegionService regionService; - + @Autowired private IMessNumService messNumService; - + @Autowired private ITSystemNoticeService systemNoticeService; - - - - + + @Resource + private ShiroExtUtil shiroExtUtil; + + @Override public Map<String, Object> list(String createTime, String carLicensePlate, Integer brandId, String insertUser, List<Integer> status, Integer userType, Integer offset, Integer limit) throws Exception { - Integer companyId = ShiroExtUtil.getUser().getRoleType() == 1 ? null : ShiroExtUtil.getUser().getObjectId(); + Integer companyId = shiroExtUtil.getUser().getRoleType() == 1 ? null : shiroExtUtil.getUser().getObjectId(); String start = ""; String end = ""; - if(ToolUtil.isNotEmpty(createTime)){ + if (ToolUtil.isNotEmpty(createTime)) { String[] split = createTime.split(" - "); start = split[0]; end = split[1]; @@ -55,7 +57,7 @@ @Override public ResultUtil addSellingCar(SellingCar sellingCar) throws Exception { sellingCar.setUserType(3); - sellingCar.setUserId(ShiroExtUtil.getUser().getObjectId()); + sellingCar.setUserId(shiroExtUtil.getUser().getObjectId()); TCarBrand tCarBrand = carBrandService.selectById(sellingCar.getBrandId()); sellingCar.setBrandName(tCarBrand.getName()); TRegion province = regionService.selectOne(new EntityWrapper<TRegion>().eq("code", sellingCar.getProvinceCode())); @@ -64,7 +66,7 @@ sellingCar.setCityName(city.getName()); sellingCar.setCreateTime(new Date()); sellingCar.setFirstPageShow(2); - if (ShiroExtUtil.getUser().getRoleType() == 1 && sellingCar.getStatus() == 1) { + if (shiroExtUtil.getUser().getRoleType() == 1 && sellingCar.getStatus() == 1) { sellingCar.setStatus(4); } this.insert(sellingCar); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java index c8de0ec..7d3bce1 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java @@ -11,6 +11,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.math.BigDecimal; import java.util.HashMap; import java.util.List; @@ -26,12 +27,15 @@ */ @Service public class TDriverServiceImpl extends ServiceImpl<TDriverMapper, TDriver> implements ITDriverService { - + + @Resource + private ShiroExtUtil shiroExtUtil; + @Override public List<Map<String, Object>> getAuthDriverList(Page<Map<String, Object>> page, String beginTime, String endTime, String companyName, String phone, String account, Integer addType, Integer authState) { return this.baseMapper.getAuthDriverList(page, beginTime, endTime, companyName, phone, account, addType, authState); } - + @Override public Map<String, Object> getDriverById(Integer driverId) { return this.baseMapper.getDriverById(driverId); @@ -71,14 +75,14 @@ public List<Map<String, Object>> orderRevenueDetailsList(Page<Map<String, Object>> page, String driverName, String driverPhone, String createTime, Integer orderType) { String startTime = ""; String endTime = ""; - if(ToolUtil.isNotEmpty(createTime)){ + if (ToolUtil.isNotEmpty(createTime)) { startTime = createTime.split(" - ")[0]; endTime = createTime.split(" - ")[1]; } - List<Map<String, Object>> list = this.baseMapper.orderRevenueDetailsList(page, driverName, driverPhone, startTime, endTime, ShiroExtUtil.getUser().getObjectId(), orderType); - + List<Map<String, Object>> list = this.baseMapper.orderRevenueDetailsList(page, driverName, driverPhone, startTime, endTime, shiroExtUtil.getUser().getObjectId(), orderType); + page = new Page<>(0, 100000000); - List<Map<String, Object>> list1 = this.baseMapper.orderRevenueDetailsList(page, driverName, driverPhone, startTime, endTime, ShiroExtUtil.getUser().getObjectId(), orderType); + List<Map<String, Object>> list1 = this.baseMapper.orderRevenueDetailsList(page, driverName, driverPhone, startTime, endTime, shiroExtUtil.getUser().getObjectId(), orderType); BigDecimal orderMoney = new BigDecimal("0"); BigDecimal money = new BigDecimal("0"); BigDecimal payMoney = new BigDecimal("0"); @@ -100,24 +104,24 @@ public HSSFWorkbook exportOrderRevenueDetails(String driverName, String driverPhone, String createTime, Integer orderType) throws Exception { String startTime = ""; String endTime = ""; - if(ToolUtil.isNotEmpty(createTime)){ + if (ToolUtil.isNotEmpty(createTime)) { startTime = createTime.split(" - ")[0]; endTime = createTime.split(" - ")[1]; } Page<Map<String, Object>> page = new Page<>(0, 100000000); - List<Map<String, Object>> list = this.baseMapper.orderRevenueDetailsList(page, driverName, driverPhone, startTime, endTime, ShiroExtUtil.getUser().getObjectId(), orderType); + List<Map<String, Object>> list = this.baseMapper.orderRevenueDetailsList(page, driverName, driverPhone, startTime, endTime, shiroExtUtil.getUser().getObjectId(), orderType); String[] title = new String[]{"交易时间", "收益类型", "订单类型", "订单ID", "下单用户昵称", "下单用户手机", "乘车用户姓名" , "乘车用户手机", "起点", "终点", "司机名称", "司机手机号", "接单车辆", "支付类型", "订单原始金额", "平台抽佣金额", "司机订单收益支出"}; String[][] values = new String[list.size()][17]; for (int i = 0; i < list.size(); i++) { Map<String, Object> d = list.get(i); - values[i][0]=null!=d.get("insertTime")?d.get("insertTime").toString():""; - values[i][1]=d.get("incomeType")==null?"": - d.get("incomeType").toString().equals("1")?"活动收入": - d.get("incomeType").toString().equals("2")?"跑单收入": - d.get("incomeType").toString().equals("3")?"取消订单收入": - d.get("incomeType").toString().equals("4")?"改派订单收入": - d.get("incomeType").toString().equals("6")?"感谢费": + values[i][0] = null != d.get("insertTime") ? d.get("insertTime").toString() : ""; + values[i][1] = d.get("incomeType") == null ? "" : + d.get("incomeType").toString().equals("1") ? "活动收入" : + d.get("incomeType").toString().equals("2") ? "跑单收入" : + d.get("incomeType").toString().equals("3") ? "取消订单收入" : + d.get("incomeType").toString().equals("4") ? "改派订单收入" : + d.get("incomeType").toString().equals("6") ? "感谢费" : d.get("incomeType").toString().equals("7")?"超时扣款": d.get("incomeType").toString().equals("8")?"投诉扣款": d.get("incomeType").toString().equals("9")?"小件物流超时退款":""; diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTaxiServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTaxiServiceImpl.java index cd5c332..f58f210 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTaxiServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTaxiServiceImpl.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ExcelUtil; import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; import com.stylefeng.guns.modular.system.dao.TOrderTaxiMapper; @@ -41,23 +40,25 @@ @Autowired private ITReassignService reassignService; - + @Autowired private ITCompanyService companyService; - + @Autowired private ITLineService lineService; - + @Autowired private IIncomeService incomeService; - - - + + @Resource + private ShiroExtUtil shiroExtUtil; + + @Override public List<Map<String, Object>> getTaxiOrderList(Page<Map<String, Object>> page, String beginTime, String endTime, Integer roleType, Integer nowUserId, String orderNum, Integer orderSource, String userName, String userPhone, String passengers, String passengersPhone, String driver, Integer state) { return this.baseMapper.getTaxiOrderList(page, beginTime, endTime, roleType, nowUserId, orderNum, orderSource, userName, userPhone, passengers, passengersPhone, driver, state); } - + @Override public Map<String, Object> getTaxiOrderDetailById(Integer orderId) { return this.baseMapper.getTaxiOrderDetailById(orderId); @@ -447,7 +448,7 @@ @Override public List<Map<String, Object>> queryOtherIncomeDetail(Page<Map<String, Object>> page, String beginTime, String endTime, String orderNo, String name, String phone) { - Integer objectId = ShiroExtUtil.getUser().getObjectId(); + Integer objectId = shiroExtUtil.getUser().getObjectId(); return this.baseMapper.queryOtherIncomeDetail(page, beginTime, endTime, orderNo, name, phone,objectId); } @@ -456,18 +457,18 @@ Date date = new Date(); DateFormat format = new SimpleDateFormat("yyyyMMdd"); String time = format.format(date); - Integer objectId = ShiroExtUtil.getUser().getObjectId(); + Integer objectId = shiroExtUtil.getUser().getObjectId(); List<Map<String, Object>> mapList = this.baseMapper.exportOtherIncomeDetail(beginTime, endTime, orderNo, name, phone, objectId); - String[] title = new String[] {"交易时间","订单号","下单用户昵称","下单用户手机号","感谢费"/*,"附加费"*/}; + String[] title = new String[]{"交易时间", "订单号", "下单用户昵称", "下单用户手机号", "感谢费"/*,"附加费"*/}; String[][] values = new String[mapList.size()][]; for (int i = 0; i < mapList.size(); i++) { - Map<String,Object> d=mapList.get(i); + Map<String, Object> d = mapList.get(i); values[i] = new String[title.length]; - values[i][0]=null == d.get("insertTime") ? "" : d.get("insertTime").toString(); - values[i][1]=null == d.get("orderNum") ? "" : d.get("orderNum").toString(); - values[i][2]=null == d.get("nickName") ? "" : d.get("nickName").toString(); - values[i][3]=null == d.get("phone") ? "" : d.get("phone").toString(); - values[i][4]=null == d.get("thankYouFee") ? "0" : d.get("thankYouFee").toString(); + values[i][0] = null == d.get("insertTime") ? "" : d.get("insertTime").toString(); + values[i][1] = null == d.get("orderNum") ? "" : d.get("orderNum").toString(); + values[i][2] = null == d.get("nickName") ? "" : d.get("nickName").toString(); + values[i][3] = null == d.get("phone") ? "" : d.get("phone").toString(); + values[i][4] = null == d.get("thankYouFee") ? "0" : d.get("thankYouFee").toString(); // values[i][5]=null == d.get("additionalFee") ? "0" : d.get("additionalFee").toString(); } String fileNameTitle="平台其他收入明细"; diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TPubWithdrawalServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TPubWithdrawalServiceImpl.java index 5543de8..f53012f 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TPubWithdrawalServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TPubWithdrawalServiceImpl.java @@ -1,25 +1,24 @@ package com.stylefeng.guns.modular.system.service.impl; import com.baomidou.mybatisplus.plugins.Page; +import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.util.ExcelUtil; import com.stylefeng.guns.core.util.ToolUtil; -import com.stylefeng.guns.modular.system.model.TPubWithdrawal; import com.stylefeng.guns.modular.system.dao.TPubWithdrawalMapper; +import com.stylefeng.guns.modular.system.model.TPubWithdrawal; import com.stylefeng.guns.modular.system.service.ITDriverService; import com.stylefeng.guns.modular.system.service.ITPubWithdrawalService; -import com.baomidou.mybatisplus.service.impl.ServiceImpl; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * <p> @@ -31,34 +30,33 @@ */ @Service public class TPubWithdrawalServiceImpl extends ServiceImpl<TPubWithdrawalMapper, TPubWithdrawal> implements ITPubWithdrawalService { - - @Autowired - private ITDriverService driverService; - - - - - - @Override - public List<Map<String, Object>> getWithdrawalList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, Integer withdrawalType) { - List<Map<String, Object>> withdrawalList = this.baseMapper.getWithdrawalList(page, beginTime, endTime, name, withdrawalType, ShiroExtUtil.getUser().getObjectId()); - List<Map<String, Object>> list = new ArrayList<>(); - if (ShiroExtUtil.getUser().getObjectId() != 1) { - Integer objectId = ShiroExtUtil.getUser().getObjectId(); - System.out.println(objectId); - - for (Map<String, Object> map : withdrawalList) { - if (ToolUtil.isNotEmpty(map.get("companyId")) && map.get("companyId").toString().equals(String.valueOf(objectId))) { - list.add(map); - } - } + + @Autowired + private ITDriverService driverService; + @Resource + private ShiroExtUtil shiroExtUtil; + + + @Override + public List<Map<String, Object>> getWithdrawalList(Page<Map<String, Object>> page, String beginTime, String endTime, String name, Integer withdrawalType) { + List<Map<String, Object>> withdrawalList = this.baseMapper.getWithdrawalList(page, beginTime, endTime, name, withdrawalType, shiroExtUtil.getUser().getObjectId()); + List<Map<String, Object>> list = new ArrayList<>(); + if (shiroExtUtil.getUser().getObjectId() != 1) { + Integer objectId = shiroExtUtil.getUser().getObjectId(); + System.out.println(objectId); + + for (Map<String, Object> map : withdrawalList) { + if (ToolUtil.isNotEmpty(map.get("companyId")) && map.get("companyId").toString().equals(String.valueOf(objectId))) { + list.add(map); + } + } // withdrawalList = withdrawalList.stream().filter(e -> (e.get("companyId").toString()).equals(ShiroKit.getUser().getObjectId())).collect(Collectors.toList()); - } else { - list = withdrawalList; - } - - return list; - } + } else { + list = withdrawalList; + } + + return list; + } @Override public List<Map<String, Object>> getReportWithdrawalList(Page<Map<String, Object>> page, String beginTime, String endTime, String userId) { @@ -77,37 +75,37 @@ @Override public Map<String, Object> orderWithdrawalDetailsList(String driverName, String driverPhone, String createTime, Integer offset, Integer limit) throws Exception { - String startTime = ""; - String endTime = ""; - if (ToolUtil.isNotEmpty(createTime)) { - String[] split = createTime.split(" - "); - startTime = split[0]; - endTime = split[1]; - } - Map<String, Object> map = new HashMap<>(); - List<Map<String, Object>> list = this.baseMapper.orderWithdrawalDetailsList(ShiroExtUtil.getUser().getObjectId(), 2, driverName, driverPhone, startTime, endTime, offset, limit); - int count = this.baseMapper.orderWithdrawalDetailsListCount(ShiroExtUtil.getUser().getObjectId(), 2, driverName, driverPhone, startTime, endTime); - List<Map<String, Object>> list1 = this.baseMapper.orderWithdrawalDetailsList(ShiroExtUtil.getUser().getObjectId(), 2, driverName, driverPhone, startTime, endTime, null, null); - BigDecimal money = new BigDecimal("0");//提现金额 - BigDecimal poundage = new BigDecimal("0");//手续费 - BigDecimal balance = new BigDecimal("0");//未提现金额 - BigDecimal realGetMoney = new BigDecimal("0");//司机实际到账金额 - BigDecimal oldBalance = new BigDecimal("0");//司机实际到账金额 - for (Map<String, Object> map1 : list1) { - money = money.add(new BigDecimal(null != map1.get("money") ? map1.get("money").toString() : "0")); - poundage = poundage.add(new BigDecimal(null != map1.get("poundage") ? map1.get("poundage").toString() : "0")); - balance = balance.add(new BigDecimal(null != map1.get("balance") ? map1.get("balance").toString() : "0")); - realGetMoney = realGetMoney.add(new BigDecimal(null != map1.get("realGetMoney") ? map1.get("realGetMoney").toString() : "0")); - oldBalance = oldBalance.add(new BigDecimal(null != map1.get("oldBalance") ? map1.get("oldBalance").toString() : "0")); - } - Map<String, Object> map1 = new HashMap<>(); - map1.put("insertTime", "合计"); - map1.put("money", money.doubleValue()); - map1.put("poundage", poundage.doubleValue()); - map1.put("balance", balance.doubleValue()); - map1.put("realGetMoney", realGetMoney.doubleValue()); - map1.put("oldBalance", oldBalance.doubleValue()); - list.add(map1); + String startTime = ""; + String endTime = ""; + if (ToolUtil.isNotEmpty(createTime)) { + String[] split = createTime.split(" - "); + startTime = split[0]; + endTime = split[1]; + } + Map<String, Object> map = new HashMap<>(); + List<Map<String, Object>> list = this.baseMapper.orderWithdrawalDetailsList(shiroExtUtil.getUser().getObjectId(), 2, driverName, driverPhone, startTime, endTime, offset, limit); + int count = this.baseMapper.orderWithdrawalDetailsListCount(shiroExtUtil.getUser().getObjectId(), 2, driverName, driverPhone, startTime, endTime); + List<Map<String, Object>> list1 = this.baseMapper.orderWithdrawalDetailsList(shiroExtUtil.getUser().getObjectId(), 2, driverName, driverPhone, startTime, endTime, null, null); + BigDecimal money = new BigDecimal("0");//提现金额 + BigDecimal poundage = new BigDecimal("0");//手续费 + BigDecimal balance = new BigDecimal("0");//未提现金额 + BigDecimal realGetMoney = new BigDecimal("0");//司机实际到账金额 + BigDecimal oldBalance = new BigDecimal("0");//司机实际到账金额 + for (Map<String, Object> map1 : list1) { + money = money.add(new BigDecimal(null != map1.get("money") ? map1.get("money").toString() : "0")); + poundage = poundage.add(new BigDecimal(null != map1.get("poundage") ? map1.get("poundage").toString() : "0")); + balance = balance.add(new BigDecimal(null != map1.get("balance") ? map1.get("balance").toString() : "0")); + realGetMoney = realGetMoney.add(new BigDecimal(null != map1.get("realGetMoney") ? map1.get("realGetMoney").toString() : "0")); + oldBalance = oldBalance.add(new BigDecimal(null != map1.get("oldBalance") ? map1.get("oldBalance").toString() : "0")); + } + Map<String, Object> map1 = new HashMap<>(); + map1.put("insertTime", "合计"); + map1.put("money", money.doubleValue()); + map1.put("poundage", poundage.doubleValue()); + map1.put("balance", balance.doubleValue()); + map1.put("realGetMoney", realGetMoney.doubleValue()); + map1.put("oldBalance", oldBalance.doubleValue()); + list.add(map1); map.put("rows", list); map.put("total", count); @@ -116,25 +114,25 @@ @Override public HSSFWorkbook exportOrderWithdrawalDetails(String driverName, String driverPhone, String createTime) throws Exception { - String startTime = ""; - String endTime = ""; - if(ToolUtil.isNotEmpty(createTime)){ - String[] split = createTime.split(" - "); - startTime = split[0]; - endTime = split[1]; - } - List<Map<String, Object>> list = this.baseMapper.orderWithdrawalDetailsList(ShiroExtUtil.getUser().getObjectId(), 2, driverName, driverPhone, startTime, endTime, null, null); - String[] title = new String[]{"时间", "司机名称", "司机手机号", "司机可提现金额", "申请提现金额", "司机实际到账金额", "提现手续费", "司机未提现金额", "提现成功时间"}; - String[][] values = new String[list.size()][9]; - for (int i = 0; i < list.size(); i++) { - Map<String, Object> map = list.get(i); - values[i][0] = null != map.get("insertTime") ? map.get("insertTime").toString() : ""; - values[i][1] = null != map.get("name") ? map.get("name").toString() : ""; - values[i][2] = null != map.get("phone") ? map.get("phone").toString() : ""; - values[i][3] = null != map.get("oldBalance") ? map.get("oldBalance").toString() : ""; - values[i][4] = null != map.get("money") ? map.get("money").toString() : ""; - values[i][5] = null != map.get("realGetMoney") ? map.get("realGetMoney").toString() : ""; - values[i][6] = null != map.get("poundage") ? map.get("poundage").toString() : ""; + String startTime = ""; + String endTime = ""; + if (ToolUtil.isNotEmpty(createTime)) { + String[] split = createTime.split(" - "); + startTime = split[0]; + endTime = split[1]; + } + List<Map<String, Object>> list = this.baseMapper.orderWithdrawalDetailsList(shiroExtUtil.getUser().getObjectId(), 2, driverName, driverPhone, startTime, endTime, null, null); + String[] title = new String[]{"时间", "司机名称", "司机手机号", "司机可提现金额", "申请提现金额", "司机实际到账金额", "提现手续费", "司机未提现金额", "提现成功时间"}; + String[][] values = new String[list.size()][9]; + for (int i = 0; i < list.size(); i++) { + Map<String, Object> map = list.get(i); + values[i][0] = null != map.get("insertTime") ? map.get("insertTime").toString() : ""; + values[i][1] = null != map.get("name") ? map.get("name").toString() : ""; + values[i][2] = null != map.get("phone") ? map.get("phone").toString() : ""; + values[i][3] = null != map.get("oldBalance") ? map.get("oldBalance").toString() : ""; + values[i][4] = null != map.get("money") ? map.get("money").toString() : ""; + values[i][5] = null != map.get("realGetMoney") ? map.get("realGetMoney").toString() : ""; + values[i][6] = null != map.get("poundage") ? map.get("poundage").toString() : ""; values[i][7] = null != map.get("balance") ? map.get("balance").toString() : ""; values[i][8] = null != map.get("successTime") ? map.get("successTime").toString() : ""; } @@ -144,37 +142,37 @@ @Override public Map<String, Object> rewardWithdrawalDetailsList(String driverName, String driverPhone, String createTime, Integer offset, Integer limit) throws Exception { - String startTime = ""; - String endTime = ""; - if (ToolUtil.isNotEmpty(createTime)) { - String[] split = createTime.split(" - "); - startTime = split[0]; - endTime = split[1]; - } - Map<String, Object> map = new HashMap<>(); - List<Map<String, Object>> list = this.baseMapper.orderWithdrawalDetailsList(ShiroExtUtil.getUser().getObjectId(), 1, driverName, driverPhone, startTime, endTime, offset, limit); - int count = this.baseMapper.orderWithdrawalDetailsListCount(ShiroExtUtil.getUser().getObjectId(), 1, driverName, driverPhone, startTime, endTime); - List<Map<String, Object>> list1 = this.baseMapper.orderWithdrawalDetailsList(ShiroExtUtil.getUser().getObjectId(), 1, driverName, driverPhone, startTime, endTime, null, null); - BigDecimal money = new BigDecimal("0");//提现金额 - BigDecimal poundage = new BigDecimal("0");//手续费 - BigDecimal balance = new BigDecimal("0");//未提现金额 - BigDecimal actualCredit = new BigDecimal("0");//实际到账 - BigDecimal oldBalance = new BigDecimal("0");//可提现 - for (Map<String, Object> map1 : list1) { - money = money.add(new BigDecimal(null != map1.get("money") ? map1.get("money").toString() : "0")); - poundage = poundage.add(new BigDecimal(null != map1.get("poundage") ? map1.get("poundage").toString() : "0")); - balance = balance.add(new BigDecimal(null != map1.get("balance") ? map1.get("balance").toString() : "0")); - actualCredit = actualCredit.add(new BigDecimal(null != map1.get("realGetMoney") ? map1.get("realGetMoney").toString() : "0")); - oldBalance = oldBalance.add(new BigDecimal(null != map1.get("oldBalance") ? map1.get("oldBalance").toString() : "0")); - } - Map<String, Object> map1 = new HashMap<>(); - map1.put("insertTime", "合计"); - map1.put("money", money.doubleValue()); - map1.put("poundage", poundage.doubleValue()); - map1.put("balance", balance.doubleValue()); - map1.put("realGetMoney", actualCredit.doubleValue()); - map1.put("realGetMoney", actualCredit.doubleValue()); - map1.put("oldBalance", oldBalance.doubleValue()); + String startTime = ""; + String endTime = ""; + if (ToolUtil.isNotEmpty(createTime)) { + String[] split = createTime.split(" - "); + startTime = split[0]; + endTime = split[1]; + } + Map<String, Object> map = new HashMap<>(); + List<Map<String, Object>> list = this.baseMapper.orderWithdrawalDetailsList(shiroExtUtil.getUser().getObjectId(), 1, driverName, driverPhone, startTime, endTime, offset, limit); + int count = this.baseMapper.orderWithdrawalDetailsListCount(shiroExtUtil.getUser().getObjectId(), 1, driverName, driverPhone, startTime, endTime); + List<Map<String, Object>> list1 = this.baseMapper.orderWithdrawalDetailsList(shiroExtUtil.getUser().getObjectId(), 1, driverName, driverPhone, startTime, endTime, null, null); + BigDecimal money = new BigDecimal("0");//提现金额 + BigDecimal poundage = new BigDecimal("0");//手续费 + BigDecimal balance = new BigDecimal("0");//未提现金额 + BigDecimal actualCredit = new BigDecimal("0");//实际到账 + BigDecimal oldBalance = new BigDecimal("0");//可提现 + for (Map<String, Object> map1 : list1) { + money = money.add(new BigDecimal(null != map1.get("money") ? map1.get("money").toString() : "0")); + poundage = poundage.add(new BigDecimal(null != map1.get("poundage") ? map1.get("poundage").toString() : "0")); + balance = balance.add(new BigDecimal(null != map1.get("balance") ? map1.get("balance").toString() : "0")); + actualCredit = actualCredit.add(new BigDecimal(null != map1.get("realGetMoney") ? map1.get("realGetMoney").toString() : "0")); + oldBalance = oldBalance.add(new BigDecimal(null != map1.get("oldBalance") ? map1.get("oldBalance").toString() : "0")); + } + Map<String, Object> map1 = new HashMap<>(); + map1.put("insertTime", "合计"); + map1.put("money", money.doubleValue()); + map1.put("poundage", poundage.doubleValue()); + map1.put("balance", balance.doubleValue()); + map1.put("realGetMoney", actualCredit.doubleValue()); + map1.put("realGetMoney", actualCredit.doubleValue()); + map1.put("oldBalance", oldBalance.doubleValue()); list.add(map1); map.put("rows", list); @@ -185,25 +183,25 @@ @Override public HSSFWorkbook exportRewardWithdrawalDetails(String driverName, String driverPhone, String createTime) throws Exception { - String startTime = ""; - String endTime = ""; - if(ToolUtil.isNotEmpty(createTime)){ - String[] split = createTime.split(" - "); - startTime = split[0]; - endTime = split[1]; - } - List<Map<String, Object>> list = this.baseMapper.orderWithdrawalDetailsList(ShiroExtUtil.getUser().getObjectId(), 1, driverName, driverPhone, startTime, endTime, null, null); - String[] title = new String[]{"时间", "司机名称", "司机手机号", "司机可提现金额", "申请提现金额", "提现手续费", "司机实际到账金额", "奖励未提现金额"}; - String[][] values = new String[list.size()][8]; - for (int i = 0; i < list.size(); i++) { - Map<String, Object> map = list.get(i); - values[i][0] = null != map.get("insertTime") ? map.get("insertTime").toString() : ""; - values[i][1] = null != map.get("name") ? map.get("name").toString() : ""; - values[i][2] = null != map.get("phone") ? map.get("phone").toString() : ""; - values[i][3] = null != map.get("oldBalance") ? map.get("oldBalance").toString() : ""; - values[i][4] = null != map.get("money") ? map.get("money").toString() : ""; - values[i][5] = null != map.get("poundage") ? map.get("poundage").toString() : ""; - values[i][6] = null != map.get("realGetMoney") ? map.get("realGetMoney").toString() : ""; + String startTime = ""; + String endTime = ""; + if (ToolUtil.isNotEmpty(createTime)) { + String[] split = createTime.split(" - "); + startTime = split[0]; + endTime = split[1]; + } + List<Map<String, Object>> list = this.baseMapper.orderWithdrawalDetailsList(shiroExtUtil.getUser().getObjectId(), 1, driverName, driverPhone, startTime, endTime, null, null); + String[] title = new String[]{"时间", "司机名称", "司机手机号", "司机可提现金额", "申请提现金额", "提现手续费", "司机实际到账金额", "奖励未提现金额"}; + String[][] values = new String[list.size()][8]; + for (int i = 0; i < list.size(); i++) { + Map<String, Object> map = list.get(i); + values[i][0] = null != map.get("insertTime") ? map.get("insertTime").toString() : ""; + values[i][1] = null != map.get("name") ? map.get("name").toString() : ""; + values[i][2] = null != map.get("phone") ? map.get("phone").toString() : ""; + values[i][3] = null != map.get("oldBalance") ? map.get("oldBalance").toString() : ""; + values[i][4] = null != map.get("money") ? map.get("money").toString() : ""; + values[i][5] = null != map.get("poundage") ? map.get("poundage").toString() : ""; + values[i][6] = null != map.get("realGetMoney") ? map.get("realGetMoney").toString() : ""; values[i][7] = null != map.get("balance") ? map.get("balance").toString() : ""; } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityServiceImpl.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityServiceImpl.java index 5364097..a6912cf 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityServiceImpl.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityServiceImpl.java @@ -4,14 +4,13 @@ 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.beetl.ShiroExtUtil; -import com.stylefeng.guns.core.shiro.ShiroKit; import com.stylefeng.guns.core.shiro.ShiroUser; import com.stylefeng.guns.core.util.SinataUtil; -import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.dao.UserActivityMapper; +import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; -import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.modular.system.util.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -46,31 +45,33 @@ @Autowired private IUserActivityInviteService userActivityInviteService; - + @Autowired private IUserActivityRedenvelopeService userActivityRedenvelopeService; - + @Autowired private IUserActivityRegisteredService userActivityRegisteredService; - + @Autowired private IUserService userService; - + @Resource + private ShiroExtUtil shiroExtUtil; + @Override public void insertOrUpdate(Integer id, String name, String startTime, Integer registCouponId, Integer registEnable, Integer registNumber, Integer registEffective, Integer inviteCouponId, Integer inviteEnable, Integer inviteNumber, Integer inviteEffective, Integer balanceEnable, String balanceInfo, Integer discountEnable, Double discountSpecial, Double discountTaxi, Double discountLogistics, Integer redenvelopeId, Integer redenvelopeEnable, Double registerPrice, Double invitationPrice, Double redPrice) { - if(id==null) { + if (id == null) { String[] timeArray = startTime.split(" - "); Date startTimes = DateUtil.getDate_str3(timeArray[0]); Date endTimes = DateUtil.getDate_str3(timeArray[1]); - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); Date nowDay = new Date(); UserActivity userActivity = new UserActivity(); userActivity.setInsertTime(nowDay); - userActivity.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - userActivity.setCompanyType(ShiroExtUtil.getUser().getRoleType()); + userActivity.setCompanyId(shiroExtUtil.getUser().getObjectId()); + userActivity.setCompanyType(shiroExtUtil.getUser().getRoleType()); userActivity.setStatus(userActivity.getCompanyType() == 1 ? 3 : 1); userActivity.setName(name); userActivity.setStartTime(startTimes); @@ -169,13 +170,13 @@ String[] timeArray = startTime.split(" - "); Date startTimes = DateUtil.getDate_str3(timeArray[0]); Date endTimes = DateUtil.getDate_str3(timeArray[1]); - ShiroUser user = ShiroExtUtil.getUser(); + ShiroUser user = shiroExtUtil.getUser(); Date nowDay = new Date(); UserActivity userActivity = new UserActivity(); userActivity.setId(id); userActivity.setInsertTime(nowDay); - userActivity.setCompanyId(ShiroExtUtil.getUser().getObjectId()); - userActivity.setCompanyType(ShiroExtUtil.getUser().getRoleType()); + userActivity.setCompanyId(shiroExtUtil.getUser().getObjectId()); + userActivity.setCompanyType(shiroExtUtil.getUser().getRoleType()); userActivity.setStatus(userActivity.getCompanyType() == 1 ? 3 : 1); userActivity.setName(name); userActivity.setStartTime(startTimes); @@ -187,7 +188,7 @@ userActivityRedenvelopeService.delete(new EntityWrapper<UserActivityRedenvelope>().eq("userActivityId", id)); userActivityRegisteredService.delete(new EntityWrapper<UserActivityRegistered>().eq("userActivityId", id)); //添加注册奖励 - if(registCouponId!=null){ + if (registCouponId != null) { UserActivityRegistered userActivityRegistered = new UserActivityRegistered(); userActivityRegistered.setCouponId(registCouponId); userActivityRegistered.setEnable(registEnable); diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EmployeeUtil.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EmployeeUtil.java index 60c54be..f8c8724 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EmployeeUtil.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EmployeeUtil.java @@ -23,49 +23,22 @@ public class EmployeeUtil { - /** - * 企业增加员工 - * @param request - * @return - */ - public static SaveStaffNode saveStaffNode(SaveStaffNodeRequest request){ - //请求路径 - String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/saveStaffNode"; - //私钥文件 - String skprivateKeyFile = QianYunTongProperties.privateKeyPath; - //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 - String appKey = QianYunTongProperties.appkey;//appkey - Map<String, String> headers = new HashMap<>(); - headers.put("Content-Type", "application/json"); - Map<String, Object> contentMap = new HashMap<String, Object>(); - Date nowdate = new Date(); - SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); - - String timeStamp = date.format(nowdate); - String messageId = UUID.randomUUID().toString().replaceAll("-", ""); - contentMap.put(SystemParameterNames.getAppKey(), appKey); - contentMap.put(SystemParameterNames.getMessage_id(), messageId); - contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); - contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); - contentMap.put("content", new Gson().toJson(request)); - log.info("【企业增加员工】请求地址:" + url); - log.info("【企业增加员工】请求参数:" + JSON.toJSONString(contentMap)); - String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap); - log.info("【企业增加员工】请求结果:" + result); - JSONObject jsonObject = JSON.parseObject(result); - String retCode = jsonObject.getString("retCode"); - if (!"0".equals(retCode)) { - log.error("【企业增加员工】请求失败:" + result); - throw new RuntimeException("【企业增加员工】请求失败:" + result); - } - JSONObject object = jsonObject.getJSONObject("object"); - String status = object.getString("status"); - if (!"0".equals(status)) { - log.error("【企业增加员工】失败:" + object.toJSONString()); - throw new RuntimeException("【企业增加员工】失败:" + object.toJSONString()); - } - SaveStaffNode saveStaffNode = jsonObject.getObject("data", SaveStaffNode.class); - return saveStaffNode; + public static void main(String[] args) { + SaveStaffNodeRequest request = new SaveStaffNodeRequest(); + request.setMobile("18798410042"); + request.setEntercode("9811000039358999"); + request.setEmpName("莫萍"); + request.setEmpNickname("莫萍"); + request.setLoginNo("15180824124"); + request.setEmpSex("女"); + request.setMphone("15180824124"); + request.setEmail("15180824124" + "@qyt.com"); + request.setDeptId(0); + request.setPositionId(1); + request.setSuperLevel(0); + request.setHideMobile(0); + SaveStaffNode saveStaffNode = EmployeeUtil.saveStaffNode(request); + System.out.println(saveStaffNode); } @@ -204,4 +177,49 @@ StaffNodeInfo staffNodeInfo = object.getObject("data", StaffNodeInfo.class); return staffNodeInfo; } + + /** + * 企业增加员工 + * @param request + * @return + */ + public static SaveStaffNode saveStaffNode(SaveStaffNodeRequest request){ + //请求路径 + String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/saveStaffNode"; + //私钥文件 + String skprivateKeyFile = QianYunTongProperties.privateKeyPath; + //注意:私钥文件需要开发者手动新建.pem文件,将委办局提供的私钥串复制进文件里用于sign加密 + String appKey = QianYunTongProperties.appkey;//appkey + Map<String, String> headers = new HashMap<>(); + headers.put("Content-Type", "application/json"); + Map<String, Object> contentMap = new HashMap<String, Object>(); + Date nowdate = new Date(); + SimpleDateFormat date = new SimpleDateFormat("yyyyMMddHHmmss"); + + String timeStamp = date.format(nowdate); + String messageId = UUID.randomUUID().toString().replaceAll("-", ""); + contentMap.put(SystemParameterNames.getAppKey(), appKey); + contentMap.put(SystemParameterNames.getMessage_id(), messageId); + contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); + contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); + contentMap.put("content", new Gson().toJson(request)); + log.info("【企业增加员工】请求地址:" + url); + log.info("【企业增加员工】请求参数:" + JSON.toJSONString(contentMap)); + String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap); + log.info("【企业增加员工】请求结果:" + result); + JSONObject jsonObject = JSON.parseObject(result); + String retCode = jsonObject.getString("retCode"); + if (!"0".equals(retCode)) { + log.error("【企业增加员工】请求失败:" + result); + throw new RuntimeException("【企业增加员工】请求失败:" + result); + } + JSONObject object = jsonObject.getJSONObject("object"); + String status = object.getString("status"); + if (!"0".equals(status)) { + log.error("【企业增加员工】失败:" + object.toJSONString()); + throw new RuntimeException("【企业增加员工】失败:" + object.toJSONString()); + } + SaveStaffNode saveStaffNode = object.getObject("data", SaveStaffNode.class); + return saveStaffNode; + } } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EnterpriseUtil.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EnterpriseUtil.java index f8e6bb4..bf0e03b 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EnterpriseUtil.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/EnterpriseUtil.java @@ -296,4 +296,20 @@ } return true; } + + + public static void main(String[] args) { +// CreateEnterpriseRequest request = new CreateEnterpriseRequest(); +// request.setName("黔南云码通数字产业运营有限公司"); +// request.setNickName("黔南云码通"); +// request.setIndustry_code("123456789"); +// request.setMobile("15180824124"); +// request.setMobileFlag("1"); +// CreateEnterprise enterprise = EnterpriseUtil.createEnterprise(request); +// System.out.println(enterprise); +// + + CheckEnterExist checkEnterExist = EnterpriseUtil.checkEnterNameExist("黔南云码通数字产业运营有限公司"); + System.out.println(checkEnterExist); + } } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java index b23f447..a284fcc 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java @@ -7,10 +7,43 @@ * @Date 2025/6/6 15:03 */ public interface QianYunTongProperties { - /** - * 小程序appId - */ - String appId = "wxcc3c9058e2b294db"; + /************************************开发/测试start***********************************/ + +// /** +// * appkey +// */ +// String appkey = "10001104"; +// /** +// * 私钥地址 +// */ +// String privateKeyPath = "C:\\Users\\39373\\Desktop\\黔云通\\private_key_test.pem"; +// /** +// * 私钥地址 +// */ +// String privateKeyPath = "/root/server/app/key/private_key_test.pem"; +// /** +// * 消费者账号 +// */ +// String userName = "xiaofei"; +// /** +// * 状态 +// * 1:生产环境 +// * 2:测试环境 +// */ +// String status = "1"; +// /** +// * API地址 +// */ +// String apiUrl = "https://test-zhongtai.stqcloud.com:10070"; +// /** +// * 桶名 +// */ +// String bucketName = "bucuTest0625"; + + /************************************开发/测试end***********************************/ + + /************************************生产start***********************************/ + /** * appkey */ @@ -18,11 +51,15 @@ /** * 私钥地址 */ - String privateKeyPath = "/root/server/app/key/private_key_test.pem"; +// String privateKeyPath = "C:\\Users\\39373\\Desktop\\黔云通\\private_key.pem"; + /** + * 私钥地址 + */ + String privateKeyPath = "/root/server/app/key/private_key.pem"; /** * 消费者账号 */ - String userName = "xiaofei"; + String userName = "xiwang"; /** * 状态 * 1:生产环境 @@ -32,11 +69,20 @@ /** * API地址 */ - String apiUrl = "https://test-zhongtai.stqcloud.com:10070"; + String apiUrl = "http://jjzhongtai.stqcloud.com:10010"; /** * 桶名 */ - String bucketName = "bucuTest0625"; + String bucketName = "qyt20250702"; + + /************************************生产end***********************************/ + + + + /** + * 小程序appId + */ + String appId = "wxcc3c9058e2b294db"; /** * HOS的基础路径(公共前缀) */ diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/UserUtil.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/UserUtil.java index 245fb0c..7df020d 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/UserUtil.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/UserUtil.java @@ -1,15 +1,11 @@ package com.stylefeng.guns.modular.system.util.qianyuntong; -import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpResponse; -import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.open.common.util.OpenApiClient; import com.open.common.util.SystemParameterNames; -import com.stylefeng.guns.modular.system.util.UUIDUtil; import com.stylefeng.guns.modular.system.util.qianyuntong.model.*; import lombok.extern.slf4j.Slf4j; @@ -221,42 +217,10 @@ return true; } + - /** - * 微信小程序登录 - * - * @param code - * @return - */ - public static LoginWeChatXiao loginWeChatXiao(String code) { - HttpRequest post = HttpUtil.createPost("https://casme.teamshub.com/webapp-backstage/ajax/loginWeChatXiao/v1.0"); - post.header("Content-Type", "text/plain;charset=UTF-8"); - post.header("Accept-encodeing", "UTF-8"); - JSONObject body = new JSONObject(); - body.put("version", "1.0"); - try { - body.put("id", UUIDUtil.getRandomCode(6)); - } catch (Exception e) { - throw new RuntimeException(e); - } - body.put("type", "loginWeChatXiao"); - body.put("action", "request"); - body.put("code", code); - body.put("appId", QianYunTongProperties.appId); - post.body(body.toJSONString()); - HttpResponse execute = post.execute(); - if (200 != execute.getStatus()) { - log.error("微信登录失败"); - return null; - } - JSONObject jsonObject = JSON.parseObject(execute.body()); - Integer status = jsonObject.getInteger("status"); - if (0 != status) { - log.error("微信登录失败:" + jsonObject.getString("desc")); - return null; - } - LoginWeChatXiao loginWeChatXiao = jsonObject.getObject("data", LoginWeChatXiao.class); - return loginWeChatXiao; + public static void main(String[] args) { + List<QYTUserInfo> userInfoByPhone = getUserInfoByPhone("18798410042", "9811000039358999"); + System.out.println(userInfoByPhone); } - } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/QYTUserInfo.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/QYTUserInfo.java index 6dd1b2a..b0a0231 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/QYTUserInfo.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/model/QYTUserInfo.java @@ -28,7 +28,7 @@ /** * 员工编号 */ - private String empId; + private Long empId; /** * 手机号码 */ @@ -40,5 +40,5 @@ /** * 部门ID */ - private String deptId; + private Long deptId; } diff --git a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/AddNotice.java b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/AddNotice.java index b22e3d7..3c439fa 100644 --- a/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/AddNotice.java +++ b/ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/AddNotice.java @@ -6,16 +6,13 @@ import com.stylefeng.guns.modular.system.model.TNotices; import com.stylefeng.guns.modular.system.model.TSystemNotice; import com.stylefeng.guns.modular.system.model.TUser; -import com.stylefeng.guns.modular.system.util.JpushUtil; import com.stylefeng.guns.modular.system.util.task.base.AbstractJob; import org.quartz.JobDataMap; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * 添加公告记录 @@ -34,7 +31,7 @@ TNotices tNotices = tNoticesService.selectById(noticeId); if (SinataUtil.isNotEmpty(tNotices)){ if (tNotices.getIsUser() == 2){ - List<TUser> tUsers = tUserService.selectList(new EntityWrapper<TUser>().eq("state",1)); + List<TUser> tUsers = tUserService.selectList(new EntityWrapper<TUser>().eq("state", 1).ne("flag", 3)); //发送公告给用户 for (TUser user : tUsers){ TSystemNotice notice = new TSystemNotice(); @@ -56,7 +53,7 @@ } } if (tNotices.getIsDriver() == 2){ - List<TDriver> tDrivers = tDriverService.selectList(new EntityWrapper<TDriver>().eq("authState",2)); + List<TDriver> tDrivers = tDriverService.selectList(new EntityWrapper<TDriver>().eq("authState", 2).ne("flag", 3)); //发送公告给用户 for (TDriver driver : tDrivers){ TSystemNotice notice = new TSystemNotice(); @@ -76,11 +73,11 @@ map.put("id", record.getId()); //对象ID JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ - if (tNotices.getIsBroadcast() == 1){ - //增加极光推送 - JpushUtil.SendPushWithCustomForSh("DRIVER"+driver.getId().toString(),tNotices.getTitle(),"通知消息",null); - } - +// if (tNotices.getIsBroadcast() == 1){ +// //增加极光推送 +// JpushUtil.SendPushWithCustomForSh("DRIVER"+driver.getId().toString(),tNotices.getTitle(),"通知消息",null); +// } + } } } diff --git a/ManagementQYTTravel/guns-admin/src/main/resources/application-dev.yml b/ManagementQYTTravel/guns-admin/src/main/resources/application-dev.yml new file mode 100644 index 0000000..d4854a8 --- /dev/null +++ b/ManagementQYTTravel/guns-admin/src/main/resources/application-dev.yml @@ -0,0 +1,95 @@ +server: + port: 8010 + +guns: + swagger-open: true #是否开启swagger (true/false) + kaptcha-open: false #是否开启登录时验证码 (true/false) + spring-session-open: true #是否开启spring session,如果是多机环境需要开启(true/false) + session-invalidate-time: 1800 #session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒 + session-validation-interval: 900 #多久检测一次失效的session(只在单机环境下生效) 单位:秒 + file-upload-path: C:\Users\hi\Desktop\ #文件上传目录(不配置的话为java.io.tmpdir目录) + picture-server-address: http://192.168.0.43/resources/ #图片服务器地址 + rest-url: http://139.9.249.67:8080/rest/ #前端接口调用基础路径 + + +spring: + profiles: + active: dev +# active: prod + mvc: + static-path-pattern: /static/** + view: + prefix: /WEB-INF/view + devtools: + restart: + enabled: false + additional-paths: src/main/java + exclude: static/**,WEB-INF/view/** + servlet: + multipart: + max-request-size: 500MB + max-file-size: 500MB + redis: + host: 172.21.35.151 + port: 6514 + password: Test_cache@20#25 + database: 0 + timeout: 1000 + cluster: + nodes: 172.21.35.151:6514,172.21.35.152:6514,172.21.35.153:6514,172.21.35.151:6515,172.21.35.152:6515,172.21.35.153:6515 + +mybatis-plus: + type-aliases-package: com.stylefeng.guns.modular.system.model + global-config: + id-type: 0 #0:数据库ID自增 1:用户输入id 2:全局唯一id(IdWorker) 3:全局唯一ID(uuid) + db-column-underline: false + configuration: + configuration.map-underscore-to-camel-case: true #是否开启自动驼峰命名规则(camel case)映射 + log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl #输出Sql,如需打印Sql注释该配置 + +--- +spring: + datasource: + url: jdbc:mysql://172.21.35.140:8066/traffic_scdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai + username: traffic_testusr + password: QYT_test@20#25 + db-name: traffic_scdb #用来搜集数据库的所有表 + filters: wall,mergeStat + + +--- +spring: + data: + mongodb: + uri: mongodb://qyt_jtcx:qyt_jtcx2025@172.21.35.197:27017/traveling_track + + +--- +wx: + grantType: authorization_code #填authorization_code + appid: 1111 #应用唯一标识,在微信开放平台提交应用审核通过后获得 + appSecret: 1111 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 + appletsAppid: wxcc3c9058e2b294db #小程序APPid + appletsAppSecret: 5610fc6126255ca5f7bd9fa4330338b6 # + mchId: 1111 #微信支付分配的商户号 + key: 1111 #key为商户平台设置的密钥key: + +--- + +alipay: + appid: 1111 #应用程序唯一标识 + appPrivateKey: 1111 #开发者应用私钥 + alipayPublicKey: 1111 #应用公钥 + alipay_public_key: 1111 #支付宝公钥 + + + +--- + +#支付回调地址 +#正式环境 +callbackPath: https://traffic.qytzt.cn + +#交通部推送数据功能开关 +pushMinistryOfTransport: false + diff --git a/ManagementQYTTravel/guns-admin/src/main/resources/application.yml b/ManagementQYTTravel/guns-admin/src/main/resources/application.yml index 800be0b..f7c67b9 100644 --- a/ManagementQYTTravel/guns-admin/src/main/resources/application.yml +++ b/ManagementQYTTravel/guns-admin/src/main/resources/application.yml @@ -14,8 +14,8 @@ spring: profiles: - active: dev -# active: prod +# active: dev + active: prod mvc: static-path-pattern: /static/** view: diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_right.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_right.html index 6bafd0e..5d22db4 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_right.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_right.html @@ -47,7 +47,7 @@ </li> </ul> </div> - <a href="logout" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a> + <a href="https://passport.teamshub.com/logout?logouturl=https%3A%2F%2Fsso.teamshub.com%2Flogout%3F%0Alogoutat%3Dhttps%253A%252F%252Ftraffic.qytzt.cn%253A443%252F" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a> </div> <div class="row J_mainContent" id="content-main"> <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="${ctxPath}/blackboard?type=${type}" frameborder="0" data-id="${ctxPath}/blackboard" seamless></iframe> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_tab.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_tab.html index 79b3def..36019d3 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_tab.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/common/_tab.html @@ -22,7 +22,7 @@ <li><a class="J_menuItem" href="${ctxPath}/mgr/user_info">个人资料</a></li> <li><a class="J_menuItem" href="${ctxPath}/mgr/user_chpwd">修改密码</a></li> <li class="divider"></li> - <li><a href="${ctxPath}/logout">安全退出</a> + <li><a href="https://passport.teamshub.com/logout?logouturl=https%3A%2F%2Fsso.teamshub.com%2Flogout%3F%0Alogoutat%3Dhttps%253A%252F%252Ftraffic.qytzt.cn%253A443%252F">安全退出</a> </li> </ul> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/order.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/order.html index c145c06..d65fa97 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/order.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/order.html @@ -43,7 +43,7 @@ <#SelectCon id="payType" name="支付方式" > <option value="">全部</option> <option value="1">微信</option> - <option value="2">支付宝</option> +<!-- <option value="2">支付宝</option>--> <option value="3">余额支付</option> <option value="4">线下支付</option> </#SelectCon> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfIncomeDetails.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfIncomeDetails.html index b30332b..060858b 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfIncomeDetails.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfIncomeDetails.html @@ -40,7 +40,7 @@ <option value="4">改派订单收入</option> <option value="5">购买出行卡</option> <option value="6">感谢费</option> - <option value="7">超时扣款</option> +<!-- <option value="7">超时扣款</option>--> <option value="8">投诉扣款</option> </#SelectCon> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfSpendingDetails.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfSpendingDetails.html index fb4acbb..279c390 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfSpendingDetails.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/summaryOfSpendingDetails.html @@ -37,7 +37,7 @@ <option value="1">活动收入</option> <option value="2">跑单收入</option> <option value="6">感谢费</option> - <option value="9">小件物流超时退款</option> +<!-- <option value="9">小件物流超时退款</option>--> </#SelectCon> </div> <div class="col-sm-2"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/taxiCardPayment.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/taxiCardPayment.html index 8193878..7e1d838 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/taxiCardPayment.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/incomeDetail/taxiCardPayment.html @@ -56,8 +56,8 @@ <option value="2">优惠卡</option> <option value="3">次数卡</option> <option value="4">打折天数卡</option> - <option value="5">物流打折卡</option> - <option value="6">物流优惠包</option> +<!-- <option value="5">物流打折卡</option>--> +<!-- <option value="6">物流优惠包</option>--> </#SelectCon> </div> <div class="col-sm-3"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit.html index e68b12e..6cd1873 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit.html @@ -49,11 +49,11 @@ <option value="">全部</option> <option value="快车司机">快车司机</option> <option value="出租车司机">出租车司机</option> - <option value="商务车司机">商务车司机</option> - <option value="货运司机">货运司机</option> - <option value="小件物流司机">小件物流司机</option> - <option value="快车司机">快车司机</option> - <option value="专职司机">专职司机</option> + <!-- <option value="商务车司机">商务车司机</option>--> + <!-- <option value="货运司机">货运司机</option>--> + <!-- <option value="小件物流司机">小件物流司机</option>--> + <option value="快车司机">快车司机</option> + <!-- <option value="专职司机">专职司机</option>--> </select> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_add.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_add.html index e143198..e2d3795 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_add.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_add.html @@ -24,10 +24,10 @@ <select id="driverType" name="selectpicker" class="selectpicker show-tick form-control" multiple data-live-search="true" data-style="btn-primary" data-none-selected-text="请选择"> <option value="快车司机">快车司机</option> <option value="出租车司机">出租车司机</option> - <option value="商务车司机">商务车司机</option> - <option value="货运司机">货运司机</option> - <option value="小件物流司机">小件物流司机</option> - <option value="专职司机">专职司机</option> + <!-- <option value="商务车司机">商务车司机</option>--> + <!-- <option value="货运司机">货运司机</option>--> + <!-- <option value="小件物流司机">小件物流司机</option>--> + <!-- <option value="专职司机">专职司机</option>--> </select> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_edit.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_edit.html index 0422b55..59540da 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_edit.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/recruit/recruit_edit.html @@ -26,10 +26,10 @@ <select id="driverType" name="selectpicker" class="selectpicker show-tick form-control" multiple data-live-search="true" data-style="btn-primary" data-none-selected-text="请选择"> <option value="快车司机">快车司机</option> <option value="出租车司机">出租车司机</option> - <option value="商务车司机">商务车司机</option> - <option value="货运司机">货运司机</option> - <option value="小件物流司机">小件物流司机</option> - <option value="专职司机">专职司机</option> +<!-- <option value="商务车司机">商务车司机</option>--> +<!-- <option value="货运司机">货运司机</option>--> +<!-- <option value="小件物流司机">小件物流司机</option>--> +<!-- <option value="专职司机">专职司机</option>--> </select> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/order.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/order.html index 744c35b..b454a8a 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/order.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/order.html @@ -34,7 +34,7 @@ <#SelectCon id="payType" name="支付方式" > <option value="">全部</option> <option value="1">微信</option> - <option value="2">支付宝</option> +<!-- <option value="2">支付宝</option>--> <option value="3">其他</option> </#SelectCon> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/taxiCardPayment.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/taxiCardPayment.html index 3128cd2..e689efb 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/taxiCardPayment.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/report/taxiCardPayment.html @@ -30,8 +30,8 @@ <option value="2">优惠卡</option> <option value="3">次数卡</option> <option value="4">打折天数卡</option> - <option value="5">物流打折卡</option> - <option value="6">物流优惠包</option> +<!-- <option value="5">物流打折卡</option>--> +<!-- <option value="6">物流优惠包</option>--> </#SelectCon> </div> <div class="col-sm-3"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_add.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_add.html index a71a666..dfc48af 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_add.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_add.html @@ -11,7 +11,7 @@ <option value="">选择广告类型</option> <option value="1">弹窗广告</option> <option value="2">首页底部广告</option> - <option value="3">订单结束页广告</option> +<!-- <option value="3">订单结束页广告</option>--> </#select> <#select id="provinceId" name="所属省:"> <option value="">选择所属省</option> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_edit.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_edit.html index 7671ef1..81f3c02 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_edit.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tAdvertisement/tAdvertisement_edit.html @@ -11,7 +11,7 @@ <option value="">选择广告类型</option> <option value="1" ${1 == item.type ? 'selected=selected' : ''}>弹窗广告</option> <option value="2" ${2 == item.type ? 'selected=selected' : ''}>首页底部广告</option> - <option value="3" ${3 == item.type ? 'selected=selected' : ''}>订单结束页广告</option> +<!-- <option value="3" ${3 == item.type ? 'selected=selected' : ''}>订单结束页广告</option>--> </#select> <#select id="provinceId" name="所属省:"> <option value="">选择所属省</option> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/punish.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/punish.html index dcc440b..0e54ed6 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/punish.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tDriver/punish.html @@ -6,7 +6,7 @@ <div class="form-horizontal"> <div class="hr-line-dashed"></div> <div class="form-group"> - <label class="col-sm-2 control-label">课程日期</label> + <label class="col-sm-2 control-label">处罚日期</label> <div class="col-sm-9"> <input type="text" class="layui-input form-control" id="punishTime"> </div> @@ -28,7 +28,7 @@ </div> <div class="hr-line-dashed"></div> <div class="form-group"> - <label class="col-sm-2 control-label">已添加的培训记录</label> + <label class="col-sm-2 control-label">已添加的处罚记录</label> <div class="col-sm-9"> <div style="height: 150px; border: 1px solid #e5e6e7;overflow-y: auto;"> <table class="table table-striped table-bordered table-hover table-condensed"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_add.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_add.html index d562f9b..5038c0e 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_add.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_add.html @@ -22,11 +22,13 @@ </div> <#avatar id="imgUrl" name="封面:" /> <#input id="title" name="标题"/> + <!-- <#select id="isBroadcast" name="是否播报:" > <option value="">选择是否播报</option> <option value="1">是</option> <option value="2">否</option> </#select> + --> <div class="form-group" id="contentDiv"> <label class="col-sm-3 control-label">公告内容:</label> <div class="col-sm-9"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_update.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_update.html index 8243e79..cb6240c 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_update.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tNotices/system_update.html @@ -7,11 +7,13 @@ <div class="col-sm-11"> <#avatar id="imgUrl" name="封面:" avatarImg="${item.imgUrl}"/> <#input id="title" name="标题" value="${item.title}"/> + <!-- <#select id="isBroadcast" name="是否播报:" > <option value="">选择是否播报</option> <option value="1" ${1 == item.isBroadcast ? 'selected=selected' : ''}>是</option> <option value="2" ${2 == item.isBroadcast ? 'selected=selected' : ''}>否</option> </#select> + --> <div class="form-group" id="contentDiv"> <label class="col-sm-3 control-label">公告内容:</label> <div class="col-sm-9"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi.html index 34d4e20..3964487 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi.html @@ -18,12 +18,12 @@ <div class="col-sm-3"> <#SelectCon id="orderSource" name="订单来源" > <option value="">全部</option> - <option value="1">APP下单</option> +<!-- <option value="1">APP下单</option>--> <option value="2">扫码下单</option> <option value="3">小程序下单</option> - <option value="4">司机下单</option> +<!-- <option value="4">司机下单</option>--> <option value="5">调度下单</option> - <option value="6">道行龙城下单</option> +<!-- <option value="6">道行龙城下单</option>--> </#SelectCon> </div> <div class="col-sm-3"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi_edit.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi_edit.html index f6c9e08..df104e1 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi_edit.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tOrderTaxi/tOrderTaxi_edit.html @@ -25,26 +25,26 @@ </div> <div class="row"> <div class="col-sm-6 b-r"> - <#label id="insertTimeStr" name="下单时间" value="${item.insertTimeStr}"/> - <#label id="orderSourceStr" name="订单来源" value="${item.orderSourceStr}"/> - <#label id="userName" name="下单用户昵称" value="${item.userName}"/> - <#label id="passengers" name="乘车用户昵称" value="${item.passengers}"/> - <#label id="placementAddress" name="起点" value="${item.startAddress}"/> - <#label id="driver" name="接单司机" value="${item.driver}"/> - <#label id="car" name="接单车辆" value="${item.car}"/> - <#label id="boardingAddress" name="上车地点" value="${item.boardingAddress}"/> - <#label id="getoffAddress" name="下车地点" value="${item.getoffAddress}"/> + <#label id="insertTimeStr" name="下单时间" value="${item.insertTimeStr}"/> + <#label id="orderSourceStr" name="订单来源" value="${item.orderSourceStr}"/> + <#label id="userName" name="下单用户昵称" value="${null != item.contactPersonPhone ? '' : item.userName}"/> + <#label id="passengers" name="乘车用户昵称" value="${item.passengers}"/> + <#label id="placementAddress" name="起点" value="${item.startAddress}"/> + <#label id="driver" name="接单司机" value="${item.driver}"/> + <#label id="car" name="接单车辆" value="${item.car}"/> + <#label id="boardingAddress" name="上车地点" value="${item.boardingAddress}"/> + <#label id="getoffAddress" name="下车地点" value="${item.getoffAddress}"/> </div> <div class="col-sm-6"> - <#label id="orderNum" name="订单编号" value="${item.orderNum}"/> - <#label id="travelTimeStr" name="乘车时间" value="${item.travelTimeStr}"/> - <#label id="userPhone" name="下单用户手机号" value="${item.userPhone}"/> - <#label id="passengersPhone" name="乘车用户手机号" value="${item.passengersPhone}"/> - <#label id="endAddress" name="终点" value="${item.endAddress}"/> - <#label id="companyName" name="车辆所属机构" value="${item.companyName}"/> - <#label id="boardingTimeStr" name="上车时间" value="${item.boardingTimeStr}"/> - <#label id="getoffTimeStr" name="下车时间" value="${item.getoffTimeStr}"/> + <#label id="orderNum" name="订单编号" value="${item.orderNum}"/> + <#label id="travelTimeStr" name="乘车时间" value="${item.travelTimeStr}"/> + <#label id="userPhone" name="下单用户手机号" value="${null != item.contactPersonPhone ? item.contactPersonPhone : item.userPhone}"/> + <#label id="passengersPhone" name="乘车用户手机号" value="${item.passengersPhone}"/> + <#label id="endAddress" name="终点" value="${item.endAddress}"/> + <#label id="companyName" name="车辆所属机构" value="${item.companyName}"/> + <#label id="boardingTimeStr" name="上车时间" value="${item.boardingTimeStr}"/> + <#label id="getoffTimeStr" name="下车时间" value="${item.getoffTimeStr}"/> </div> </div> <div class="row" style="margin-top: 30px;"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSysReformist/tSysReformist.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSysReformist/tSysReformist.html index 6c708a6..ab62a71 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSysReformist/tSysReformist.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSysReformist/tSysReformist.html @@ -43,15 +43,15 @@ <div> <div style="float: left;"> <label class="lab checked" onclick="checkedLable(this)" tag="pushOrderSettings">推单设置</label> - <label class="lab" onclick="checkedLable(this)" tag="driverPayDays">司机分账账期设置</label> +<!-- <label class="lab" onclick="checkedLable(this)" tag="driverPayDays">司机分账账期设置</label>--> <label class="lab" onclick="checkedLable(this)" tag="cancelOrderSettings">取消订单设置</label> <label class="lab" onclick="checkedLable(this)" tag="cancelTheReservationOrderSetting">预约单取消设置</label> - <label class="lab" onclick="checkedLable(this)" tag="spellOrderSetting">拼单派单设置</label> - <label class="lab" onclick="checkedLable(this)" tag="timeoutDeductionSettings">超时扣款设置</label> +<!-- <label class="lab" onclick="checkedLable(this)" tag="spellOrderSetting">拼单派单设置</label>--> +<!-- <label class="lab" onclick="checkedLable(this)" tag="timeoutDeductionSettings">超时扣款设置</label>--> <label class="lab" onclick="checkedLable(this)" tag="reassigningSet">改派设置</label> - <label class="lab" onclick="checkedLable(this)" tag="faceRecognitionSettings">人脸识别设置</label> +<!-- <label class="lab" onclick="checkedLable(this)" tag="faceRecognitionSettings">人脸识别设置</label>--> <label class="lab" onclick="checkedLable(this)" tag="integralSet">积分设置</label> - <label class="lab" onclick="checkedLable(this)" tag="withdrawalFeeSetting">提现手续费设置</label> +<!-- <label class="lab" onclick="checkedLable(this)" tag="withdrawalFeeSetting">提现手续费设置</label>--> <label class="lab" onclick="checkedLable(this)" tag="phoneSettings">电话设置</label> <label class="lab" onclick="checkedLable(this)" tag="holidayServiceFeeSetting">节假日服务费设置</label> <!-- <label class="lab" onclick="checkedLable(this)" tag="95128TheOnCall">95128电召</label>--> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSystemPrice/taxiSet.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSystemPrice/taxiSet.html index 62cbf97..a164a6c 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSystemPrice/taxiSet.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tSystemPrice/taxiSet.html @@ -49,7 +49,7 @@ 起步价为 <input type="text" onblur="checkIsYuan(this)" value='${json.num1!}' name="num1" id="num1" class="form-control newWidth" placeholder="最多3位数"/> 元,起步包含<input type="text" onblur="checkIsGongLi(this)" name="num2" id="num2" value='${json.num2!}' class="form-control newWidth" placeholder="最多3位数"/> - 公里,不足基价公里按基价公里收费</br></br> + 公里,不足起步公里按起步公里收费</br></br> 超过起步里程后每公里加收 <input type="text" onblur="checkIsYuan(this)" name="num3" id="num3" value='${json.num3!}' class="form-control newWidth" placeholder="最多3位数"/>元 <!-- <span id="min">,<input type="text" onblur="checkIsMinute(this)" name="num5" id="num5" class="form-control newWidth" placeholder="最多3位数"/>--> <!-- 分钟</span>--> @@ -69,7 +69,7 @@ <input type="text" name="num6" id="num6" class="form-control newWidth" value='${json.num6!}' placeholder="选择时间"/> 点为夜间行驶时间, 起步价变为<input type="text" onblur="checkIsYuan(this)" value='${json.num7!}' name="num7" id="num7" class="form-control newWidth" placeholder="最多3位数"/>元, 起步包含<input type="text" onblur="checkIsGongLi(this)" name="num8" value='${json.num8!}' id="num8" class="form-control newWidth" placeholder="最多3位数"/> - 公里,不足基价公里按基价公里收费 + 公里,不足起步公里按起步公里收费 ,超过起步里程后每公里加收<input type="text" onblur="checkIsYuan(this)" name="num9" value='${json.num9!}' id="num9" class="form-control newWidth" placeholder="最多3位数"/>元 </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard.html index 688867a..34e246b 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard.html @@ -22,8 +22,8 @@ <option value="2">优惠卡</option> <option value="3">次数卡</option> <option value="4">打折天数卡</option> - <option value="5">物流打折卡</option> - <option value="6">物流优惠包</option> +<!-- <option value="5">物流打折卡</option>--> +<!-- <option value="6">物流优惠包</option>--> </#SelectCon> </div> <div class="col-sm-3"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit.html index 47d6ac5..a95c22a 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit.html @@ -22,8 +22,8 @@ <option value="2">优惠卡</option> <option value="3">次数卡</option> <option value="4">打折天数卡</option> - <option value="5">物流打折卡</option> - <option value="6">物流优惠包</option> +<!-- <option value="5">物流打折卡</option>--> +<!-- <option value="6">物流优惠包</option>--> </#SelectCon> </div> <div class="col-sm-3"> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit_detail.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit_detail.html index 33b35f3..d72cb04 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit_detail.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCardAudit_detail.html @@ -67,8 +67,8 @@ <option value="2">优惠卡</option> <option value="3">次数卡</option> <option value="4">打折天数卡</option> - <option value="5">物流打折卡</option> - <option value="6">优惠包</option> + <!-- <option value="5">物流打折卡</option>--> + <!-- <option value="6">优惠包</option>--> </select> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_add.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_add.html index a0ecfbb..272ec5c 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_add.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_add.html @@ -49,8 +49,8 @@ <option value="2">优惠卡</option> <option value="3">次数卡</option> <option value="4">打折天数卡</option> - <option value="5">物流打折卡</option> - <option value="6">优惠包</option> + <!-- <option value="5">物流打折卡</option>--> + <!-- <option value="6">优惠包</option>--> </select> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_edit.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_edit.html index c05c1d4..4796ae5 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_edit.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tTaxiCard/tTaxiCard_edit.html @@ -67,8 +67,8 @@ <option value="2">优惠卡</option> <option value="3">次数卡</option> <option value="4">打折天数卡</option> - <option value="5">物流打折卡</option> - <option value="6">优惠包</option> + <!-- <option value="5">物流打折卡</option>--> + <!-- <option value="6">优惠包</option>--> </select> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tUser/tUser_userDetail.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tUser/tUser_userDetail.html index 6b86d54..7d60c04 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tUser/tUser_userDetail.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tUser/tUser_userDetail.html @@ -10,7 +10,6 @@ <div class="row"> <div class="col-sm-6 b-r"> <#label id="insertTimeStr" name="注册时间" value="${item.insertTimeStr}"/> - <#label id="registIp" name="注册地IP" value="${item.registIp}"/> <#label id="phone" name="手机号" value="${item.phone}"/> <#label id="emergencyContact" name="紧急联系人姓名" value="${item.emergencyContact}"/> <#label id="isAuthStr" name="是否实名认证" value="${item.isAuthStr}"/> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tVersionManagement/tVersionManagement_add.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tVersionManagement/tVersionManagement_add.html index 92c41a8..079c032 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tVersionManagement/tVersionManagement_add.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/tVersionManagement/tVersionManagement_add.html @@ -9,19 +9,19 @@ <div class="form-group"> <label class="col-sm-3 control-label">端口类型:</label> <div class="col-sm-9" style="display: flex;align-items: center;"> - <div class="radio radio-info radio-inline"> - <input type="radio" id="type1" value="1" name="type" checked="" > - <label for="type1"> 用户端 </label> - </div> - <div class="radio radio-success radio-inline"> + <!-- <div class="radio radio-info radio-inline">--> + <!-- <input type="radio" id="type1" value="1" name="type" checked="" >--> + <!-- <label for="type1"> 用户端 </label>--> + <!-- </div>--> + <div class="radio radio-success radio-inline"> <input type="radio" id="type2" value="2" name="type" > <label for="type2"> 司机端 </label> </div> - <div class="radio radio-primary radio-inline"> - <input type="radio" id="type3" value="3" name="type" > - <label for="type3"> 车载端 </label> - </div> - <div class="radio radio-primary radio-inline"> + <!-- <div class="radio radio-primary radio-inline">--> + <!-- <input type="radio" id="type3" value="3" name="type" >--> + <!-- <label for="type3"> 车载端 </label>--> + <!-- </div>--> + <div class="radio radio-primary radio-inline"> <input type="radio" id="type4" value="4" name="type" > <label for="type4"> 调度端 </label> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_add.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_add.html index 3a7ccd1..eefaaad 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_add.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_add.html @@ -192,9 +192,11 @@ <input type="text" name="zc1" id="content5Num2" class="form-control newWidth" /> 折 <br/> + <!-- <br/> 小件物流活动打折: <input type="text" name="zc1" id="content5Num3" class="form-control newWidth" /> 折 + --> </div> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_detail.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_detail.html index 5954f90..a8c3be6 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_detail.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_detail.html @@ -335,6 +335,7 @@ @} name="zc1" id="content5Num2" class="form-control newWidth" readonly/> <br/> + <!-- <br/> 小件物流活动打折: <input type="text" @@ -344,6 +345,7 @@ value="" @} name="zc1" id="content5Num3" class="form-control newWidth" readonly /> + --> </div> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_edit.html b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_edit.html index 53afabd..928cb38 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_edit.html +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/WEB-INF/view/system/userActivity/userActivity_edit.html @@ -345,6 +345,7 @@ @} name="zc1" id="content5Num2" class="form-control newWidth" /> <br/> + <!-- <br/> 小件物流活动打折: <input type="text" @@ -354,6 +355,7 @@ value="" @} name="zc1" id="content5Num3" class="form-control newWidth" /> + --> </div> </div> </div> diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/home.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/home.js index b1c2a2e..c2d7fe9 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/home.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/home.js @@ -183,14 +183,16 @@ var map = new AMap.Map('container',{ resizeEnable: true, - zoom:10 + center: [107.561768, 26.188572], + zoom: 10 }); -var map_ = new AMap.Map('container_',{ +var map_ = new AMap.Map('container_', { resizeEnable: true, + center: [107.561768, 26.188572], mapStyle: 'amap://styles/1de318cbb8d12c02303a22c550b9ccc9', - zoom:10 + zoom: 10 }); var mouseTool = new AMap.MouseTool(map); diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/carRental/carRental_info.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/carRental/carRental_info.js index c330ffd..225ffa8 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/carRental/carRental_info.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/carRental/carRental_info.js @@ -316,28 +316,28 @@ formData.append('file', $('#file')[0].files[0]) //把file添加进去 name命名为img layer.load(); //上传loading $.ajax({ - url: Feng.ctxPath + '/upload/image1', + url: Feng.ctxPath + '/upload/image', data: formData, type: "POST", async: true, cache: false, contentType: false, processData: false, - success: function(res) { + success: function (res) { layer.closeAll('loading'); //关闭loading $('#file').val(''); - if(fileId == 'imgUrl'){ - $('#' + fileId).append('<div><img src="' + res + '" width="100px" class="imgUrl"><i class="fa fa-close" onclick="delImg(this, \'imgUrl\', 1)" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); + if (fileId == 'imgUrl') { + $('#' + fileId).append('<div><img src="' + res.data + '" width="100px" class="imgUrl"><i class="fa fa-close" onclick="delImg(this, \'imgUrl\', 1)" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); let files = $('#' + fileId).find('img'); $($('#' + fileId).parent('div')).siblings('label').text('*车辆照片(' + files.length + '/15):'); } - if(fileId == 'videoUrl'){ - $('#' + fileId).append('<div><video src="' + res + '" controls style="width: 200px !important;" class="videoUrl"></video><i class="fa fa-close" onclick="delImg(this, \'videoUrl\', 2)" style="color: red;color: red;font-size: 18px;position: absolute;left: 208px;top: -8px;"></i></div> '); + if (fileId == 'videoUrl') { + $('#' + fileId).append('<div><video src="' + res.data + '" controls style="width: 200px !important;" class="videoUrl"></video><i class="fa fa-close" onclick="delImg(this, \'videoUrl\', 2)" style="color: red;color: red;font-size: 18px;position: absolute;left: 208px;top: -8px;"></i></div> '); let files = $('#' + fileId).find('video'); $($('#' + fileId).parent('div')).siblings('label').text('*车辆视频(' + files.length + '/1):'); } - if(fileId == 'describeImgUrl'){ - $('#' + fileId).append('<div><img src="' + res + '" width="100px" class="describeImgUrl"/><i class="fa fa-close" onclick="delImg(this, \'describeImgUrl\')" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); + if (fileId == 'describeImgUrl') { + $('#' + fileId).append('<div><img src="' + res.data + '" width="100px" class="describeImgUrl"/><i class="fa fa-close" onclick="delImg(this, \'describeImgUrl\')" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); } } }) diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/incomeDetail/summaryOfIncomeDetails.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/incomeDetail/summaryOfIncomeDetails.js index 87a14ad..93e33fe 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/incomeDetail/summaryOfIncomeDetails.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/incomeDetail/summaryOfIncomeDetails.js @@ -220,25 +220,28 @@ return orderRevenue; } }, - {title: '购买打车卡收益', field: 'realGetMoney', visible: true, align: 'center', valign: 'middle', + { + title: '购买打车卡收益', field: 'realGetMoney', visible: true, align: 'center', valign: 'middle', formatter: function (value, row) { let taxiCardRevenue = typeof row.taxiCardRevenue == "undefined" ? "-" : row.taxiCardRevenue; return taxiCardRevenue; } }, - {title: '超时扣款收益', field: 'userName', visible: true, align: 'center', valign: 'middle', - formatter: function (value, row) { - let overtimeDeduction = typeof row.overtimeDeduction == "undefined" ? "-" : row.overtimeDeduction; - return overtimeDeduction; - } - }, - {title: '司机投诉扣款平台收益', field: 'userPhone', visible: true, align: 'center', valign: 'middle', + // {title: '超时扣款收益', field: 'userName', visible: true, align: 'center', valign: 'middle', + // formatter: function (value, row) { + // let overtimeDeduction = typeof row.overtimeDeduction == "undefined" ? "-" : row.overtimeDeduction; + // return overtimeDeduction; + // } + // }, + { + title: '司机投诉扣款平台收益', field: 'userPhone', visible: true, align: 'center', valign: 'middle', formatter: function (value, row) { let complaintDeductionProceeds = typeof row.complaintDeductionProceeds == "undefined" ? "-" : row.complaintDeductionProceeds; return complaintDeductionProceeds; } }, - {title: '其他收入', field: 'remark', visible: true, align: 'center', valign: 'middle', + { + title: '其他收入', field: 'remark', visible: true, align: 'center', valign: 'middle', formatter: function (value, row) { let other = typeof row.other == "undefined" ? "-" : row.other; return other; diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/report/order.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/report/order.js index b605ed8..32036eb 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/report/order.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/report/order.js @@ -124,10 +124,10 @@ {title: '节假日服务费', field: 'holidayFee', visible: true, align: 'center', valign: 'middle'}, {title: '取消费', field: 'cancleMoney', visible: true, align: 'center', valign: 'middle'}, {title: '改派费', field: 'reassignMoney', visible: true, align: 'center', valign: 'middle'}, - {title: '超时罚款', field: 'timeOutMoney', visible: true, align: 'center', valign: 'middle'}, + // {title: '超时罚款', field: 'timeOutMoney', visible: true, align: 'center', valign: 'middle'}, {title: '优惠金额', field: 'discountAmount', visible: true, align: 'center', valign: 'middle'}, {title: '感谢费', field: 'thankYouFee', visible: true, align: 'center', valign: 'middle'}, - {title: '小件物流差价费', field: 'spreadMoney', visible: true, align: 'center', valign: 'middle'}, + // {title: '小件物流差价费', field: 'spreadMoney', visible: true, align: 'center', valign: 'middle'}, /*{title: '司机收入', field: 'orderNum', visible: true, align: 'center', valign: 'middle', formatter: function (value,row) { return row.driverMoney - row.additionalMoney - row.holidayFee - row.tipMoney - row.thankYouFee - row.spreadMoney; diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sellingCar/sellingCar_info.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sellingCar/sellingCar_info.js index 2597923..b1f37da 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sellingCar/sellingCar_info.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sellingCar/sellingCar_info.js @@ -499,28 +499,28 @@ formData.append('file', $('#file')[0].files[0]) //把file添加进去 name命名为img layer.load(); //上传loading $.ajax({ - url: Feng.ctxPath + '/upload/image1', + url: Feng.ctxPath + '/upload/image', data: formData, type: "POST", async: true, cache: false, contentType: false, processData: false, - success: function(res) { + success: function (res) { layer.closeAll('loading'); //关闭loading $('#file').val(''); - if(fileId == 'imgUrl'){ - $('#' + fileId).append('<div><img src="' + res + '" width="100px" class="imgUrl"><i class="fa fa-close" onclick="delImg(this, \'imgUrl\', 1)" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); + if (fileId == 'imgUrl') { + $('#' + fileId).append('<div><img src="' + res.data + '" width="100px" class="imgUrl"><i class="fa fa-close" onclick="delImg(this, \'imgUrl\', 1)" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); let files = $('#' + fileId).find('img'); $($('#' + fileId).parent('div')).siblings('label').text('*车辆图片(' + files.length + '/15):'); } - if(fileId == 'videoUrl'){ - $('#' + fileId).append('<div><video src="' + res + '" controls style="width: 200px !important;" class="videoUrl"></video><i class="fa fa-close" onclick="delImg(this, \'videoUrl\', 2)" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); + if (fileId == 'videoUrl') { + $('#' + fileId).append('<div><video src="' + res.data + '" controls style="width: 200px !important;" class="videoUrl"></video><i class="fa fa-close" onclick="delImg(this, \'videoUrl\', 2)" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); let files = $('#' + fileId).find('video'); $($('#' + fileId).parent('div')).siblings('label').text('*车辆视频(' + files.length + '/1):'); } - if(fileId == 'describeImgUrl'){ - $('#' + fileId).append('<div><img src="' + res + '" width="100px" class="describeImgUrl"/><i class="fa fa-close" onclick="delImg(this, \'describeImgUrl\')" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); + if (fileId == 'describeImgUrl') { + $('#' + fileId).append('<div><img src="' + res.data + '" width="100px" class="describeImgUrl"/><i class="fa fa-close" onclick="delImg(this, \'describeImgUrl\')" style="color: red;color: red;font-size: 18px;position: absolute;left: 108px;top: -8px;"></i></div> '); } } }) diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sysCouponActivity/tUser.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sysCouponActivity/tUser.js index 8ea2cb6..fced80c 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sysCouponActivity/tUser.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/sysCouponActivity/tUser.js @@ -32,15 +32,6 @@ } }, {title: '用户ID', field: 'id', visible: true, align: 'center', valign: 'middle'}, - {title: '注册地IP', field: 'registIp', visible: true, align: 'center', valign: 'middle', - formatter: function (value, row) { - var btn = ""; - if(row.registIp != '' && row.registIp != null) { - btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="' + row.registIp + '" onfocus="TUser.tooltip()">' + row.registIp + '</p>'] - } - return btn; - } - }, {title: '注册地所属分公司ID', field: 'companyId', visible: false, align: 'center', valign: 'middle'}, {title: '注册地所属分公司', field: 'companyName', visible: true, align: 'center', valign: 'middle', formatter: function (value, row) { diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tCompany/tCompany_info.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tCompany/tCompany_info.js index 18cfc0d..6d1b18e 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tCompany/tCompany_info.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tCompany/tCompany_info.js @@ -804,16 +804,24 @@ }; function deleteSub(e) { - - var ajax = new $ax(Feng.ctxPath + '/tCompany/searchArea', function (data) { - if (data === "该区域正被打车卡使用,不允许移除"){ - Feng.error(data); - return false; - }else { - $(e).parent().parent().remove(); - } + swal({ + title: "您是否确认删除该区域?", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#DD6B55", + confirmButtonText: "删除", + closeOnConfirm: false + }, function () { + var ajax = new $ax(Feng.ctxPath + '/tCompany/searchArea', function (data) { + if (data === "该区域正被打车卡使用,不允许移除") { + Feng.error(data); + return false; + } else { + $(e).parent().parent().remove(); + } + }); + ajax.set("companyId", $("#id").val()); /// 适用地区id + ajax.set("id", $($(e).parent('td').prev('td').find('input')[0]).val()); /// 适用地区id + ajax.start(); }); - ajax.set("companyId",$("#id").val()); /// 适用地区id - ajax.set("id",$($(e).parent('td').prev('td').find('input')[0]).val()); /// 适用地区id - ajax.start(); } \ No newline at end of file diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tNotices/system_info.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tNotices/system_info.js index 660d093..f706945 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tNotices/system_info.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tNotices/system_info.js @@ -12,13 +12,13 @@ } } }, - isBroadcast: { - validators: { - notEmpty: { - message: '选择是否播报' - } - } - }, + // isBroadcast: { + // validators: { + // notEmpty: { + // message: '选择是否播报' + // } + // } + // }, isShow: { validators: { notEmpty: { @@ -83,7 +83,7 @@ .set('title') .set('sort') .set('isShow') - .set('isBroadcast') + // .set('isBroadcast') .set('type') .set('imgUrl') .set('flag') diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser_info.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser_info.js index be83122..78bdaaa 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser_info.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/tUser/tUser_info.js @@ -154,12 +154,12 @@ } //提交信息 var ajax = new $ax(Feng.ctxPath + "/tUser/updateBalance", function(data){ - if(data=="5000"){ - Feng.info("请先设置企业提现账户!"); - }else - if(data=="5001"){ - Feng.info("该用户未设置进件信息!"); - }else + // if(data=="5000"){ + // Feng.info("请先设置企业提现账户!"); + // }else + // if(data=="5001"){ + // Feng.info("该用户未设置进件信息!"); + // }else if(data.code==200){ Feng.success("修改成功!"); }else{ diff --git a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/userActivity/userActivity_info.js b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/userActivity/userActivity_info.js index a222eab..fc749d7 100644 --- a/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/userActivity/userActivity_info.js +++ b/ManagementQYTTravel/guns-admin/src/main/webapp/static/modular/system/userActivity/userActivity_info.js @@ -129,21 +129,21 @@ } } var content5Num2 = $("#content5Num2").val(); - if($.trim(content5Num2)!=""){ - if(isNaN(content5Num2) || content5Num2<=0 || content5Num2>10){ + if ($.trim(content5Num2) != "") { + if (isNaN(content5Num2) || content5Num2 <= 0 || content5Num2 > 10) { Feng.error("请输入正确折扣数!"); getContent(5); return; } } - var content5Num3 = $("#content5Num3").val(); - if($.trim(content5Num3)!=""){ - if(isNaN(content5Num3) || content5Num3<=0 || content5Num3>10){ - Feng.error("请输入正确折扣数!"); - getContent(5); - return; - } - } + // var content5Num3 = $("#content5Num3").val(); + // if($.trim(content5Num3)!=""){ + // if(isNaN(content5Num3) || content5Num3<=0 || content5Num3>10){ + // Feng.error("请输入正确折扣数!"); + // getContent(5); + // return; + // } + // } var content6RedId = $("#content6RedId").val(); var elem1 = document.querySelector('.js-switch'); var elem2 = document.querySelector('.js-switch1'); @@ -152,7 +152,7 @@ var elem3 = document.querySelector('.js-switch4'); console.log(JSON.stringify(subArr)) //提交信息 - var ajax = new $ax(Feng.ctxPath + "/userActivity/add", function(data){ + var ajax = new $ax(Feng.ctxPath + "/userActivity/add", function (data) { Feng.success("添加成功!"); window.parent.UserActivity.table.refresh(); UserActivityInfoDlg.close(); @@ -175,9 +175,9 @@ ajax.set("balanceInfo",JSON.stringify(subArr)); ajax.set("discountEnable",elem4.checked==true?2:1); ajax.set("discountSpecial",content5Num1); - ajax.set("discountTaxi",content5Num2); - ajax.set("discountLogistics",content5Num3); - ajax.set("redenvelopeId",$("#content6RedId").val()); + ajax.set("discountTaxi", content5Num2); + ajax.set("discountLogistics", 0); + ajax.set("redenvelopeId", $("#content6RedId").val()); ajax.set("redenvelopeEnable",elem5.checked==true?2:1); ajax.set('redPrice', $('#content6Num5').val()); ajax.start(); @@ -257,21 +257,21 @@ } } var content5Num2 = $("#content5Num2").val(); - if($.trim(content5Num2)!=""){ - if(isNaN(content5Num2) || content5Num2<=0 || content5Num2>10){ + if ($.trim(content5Num2) != "") { + if (isNaN(content5Num2) || content5Num2 <= 0 || content5Num2 > 10) { Feng.error("请输入正确折扣数!"); getContent(5); return; } } - var content5Num3 = $("#content5Num3").val(); - if($.trim(content5Num3)!=""){ - if(isNaN(content5Num3) || content5Num3<=0 || content5Num3>10){ - Feng.error("请输入正确折扣数!"); - getContent(5); - return; - } - } + // var content5Num3 = $("#content5Num3").val(); + // if($.trim(content5Num3)!=""){ + // if(isNaN(content5Num3) || content5Num3<=0 || content5Num3>10){ + // Feng.error("请输入正确折扣数!"); + // getContent(5); + // return; + // } + // } var content6RedId = $("#content6RedId").val(); var elem1 = document.querySelector('.js-switch'); var elem2 = document.querySelector('.js-switch1'); @@ -280,7 +280,7 @@ var elem3 = document.querySelector('.js-switch4'); console.log(JSON.stringify(subArr)) //提交信息 - var ajax = new $ax(Feng.ctxPath + "/userActivity/update", function(data){ + var ajax = new $ax(Feng.ctxPath + "/userActivity/update", function (data) { Feng.success("修改成功!"); window.parent.UserActivity.table.refresh(); UserActivityInfoDlg.close(); @@ -304,9 +304,9 @@ ajax.set("balanceInfo",JSON.stringify(subArr)); ajax.set("discountEnable",elem4.checked==true?2:1); ajax.set("discountSpecial",parseFloat(content5Num1)); - ajax.set("discountTaxi",parseFloat(content5Num2)); - ajax.set("discountLogistics",parseFloat(content5Num3)); - ajax.set("redenvelopeId",$("#content6RedId").val()); + ajax.set("discountTaxi", parseFloat(content5Num2)); + ajax.set("discountLogistics", parseFloat(0)); + ajax.set("redenvelopeId", $("#content6RedId").val()); ajax.set("redenvelopeEnable",elem5.checked==true?2:1); ajax.set('redPrice', $('#content6Num5').val()); ajax.start(); -- Gitblit v1.7.1